From 7daf981ac1a7b5212e50e2a9a30a32eba7bbe40d Mon Sep 17 00:00:00 2001 From: wickathou Date: Wed, 22 May 2024 11:51:19 +0300 Subject: [PATCH 1/8] Added configuration for plausible --- backend/misc/config.js | 6 +- frontend/public/index.html | 131 ++++++++++++++++++++++--------------- 2 files changed, 80 insertions(+), 57 deletions(-) diff --git a/backend/misc/config.js b/backend/misc/config.js index b7ee7deba..123bf9314 100644 --- a/backend/misc/config.js +++ b/backend/misc/config.js @@ -115,7 +115,7 @@ const settings = { }, REDIS_PASSWORD: { required: false, - value: process.env.REDIS_PASSWORD || 'NOPE' + value: process.env.REDIS_PASSWORD || 'NOPE', }, } @@ -127,7 +127,7 @@ const buildConfig = () => { config[key] = obj.default } else { throw new Error( - `Invalid configuration: ${key} must be provided a value from .env, or a default value. See config.js` + `Invalid configuration: ${key} must be provided a value from .env, or a default value. See config.js`, ) } } else { @@ -142,7 +142,7 @@ const config = buildConfig() logger.info({ message: 'Running app with config', - data: config, + // data: config, }) global.gConfig = config diff --git a/frontend/public/index.html b/frontend/public/index.html index 254d9d3df..5de95e8d6 100755 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -1,26 +1,50 @@ - - - - - - - - - - - - - - + + + + + + + + - + - - - - %REACT_APP_PAGE_TITLE% - - - + + %REACT_APP_PAGE_TITLE% - + html, + body { + height: 100%; + } - + body { + position: absolute; + left: -17px; + right: -17px; + padding-top: 0; + padding-right: 17px !important; + padding-left: 17px; + padding-bottom: 0px; + overflow-x: hidden; + overflow-y: auto !important; //Remove the !important if you want the scroll bar to disappear + } + + - - -
- - - - - \ No newline at end of file + --> + From 1ba2bb17c321405ccaf7e997c302ccea79c03aa7 Mon Sep 17 00:00:00 2001 From: wickathou Date: Wed, 22 May 2024 13:20:22 +0300 Subject: [PATCH 2/8] Fixed typo on env variable added debug message for alerts --- frontend/src/constants/config.js | 7 ++++--- frontend/src/graphql/client.js | 2 +- frontend/src/pages/_dashboard/renderDashboard/index.js | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/constants/config.js b/frontend/src/constants/config.js index 0a49e5cdf..7190e238d 100644 --- a/frontend/src/constants/config.js +++ b/frontend/src/constants/config.js @@ -13,9 +13,9 @@ const settings = { required: true, value: process.env.REACT_APP_BASE_URL, }, - WEB_SOCET_URL: { + WEB_SOCKET_URL: { required: false, - value: process.env.REACT_APP_WEB_SOCET_URL, + value: process.env.REACT_APP_WEB_SOCKET_URL, }, CALENDAR_URL: { required: false, @@ -38,7 +38,8 @@ const settings = { ID_TOKEN_NAMESPACE: { required: true, value: - process.env.REACT_APP_ID_TOKEN_NAMESPACE || 'https://eu.junctionplatform.com/', + process.env.REACT_APP_ID_TOKEN_NAMESPACE || + 'https://eu.junctionplatform.com/', }, IS_DEBUG: { default: process.env.REACT_APP_IS_DEBUG === 'true', diff --git a/frontend/src/graphql/client.js b/frontend/src/graphql/client.js index 9722f22ad..f151249c2 100644 --- a/frontend/src/graphql/client.js +++ b/frontend/src/graphql/client.js @@ -30,7 +30,7 @@ const errorLink = onError(({ graphQLErrors, networkError }) => { export default idToken => { const wsLink = new GraphQLWsLink( createClient({ - url: config.WEB_SOCET_URL,//TODO: is this causing renew loop problem? + url: config.WEB_SOCET_URL, //TODO: is this causing renew loop problem? connectionParams: { authToken: idToken }, }), ) diff --git a/frontend/src/pages/_dashboard/renderDashboard/index.js b/frontend/src/pages/_dashboard/renderDashboard/index.js index 3a7b6bcbc..ea7be432f 100644 --- a/frontend/src/pages/_dashboard/renderDashboard/index.js +++ b/frontend/src/pages/_dashboard/renderDashboard/index.js @@ -22,6 +22,7 @@ import { useActiveEvents, usePastEvents, } from 'graphql/queries/events' +import { debugGroup } from 'utils/debuggingTools' // import { Chat } from 'components/messaging/chat' export default role => { @@ -81,6 +82,7 @@ export default role => { // Must use lazy query because event is fetched asynchnronously const [getAlerts, { loading: alertsLoading, data: alertsData }] = useLazyQuery(ALERTS_QUERY) + useEffect(() => { if (event) { getAlerts({ variables: { eventId: event._id } }) @@ -129,7 +131,7 @@ export default role => { return newArray }) } - // eslint-disable-next-line react-hooks/exhaustive-deps + debugGroup('alertsData', [alertsData]) }, [alertsData, setAlerts, newAlert, setAlertCount]) /** Update project when team changes */ From 7c83c0145339e908bebd54a71325f67b49e65c04 Mon Sep 17 00:00:00 2001 From: wickathou Date: Wed, 22 May 2024 13:22:17 +0300 Subject: [PATCH 3/8] modified STAG pipeline --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7ddfac9d5..71bba2007 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,16 +27,16 @@ stages: - task: DownloadSecureFile@1 displayName: 'download STAG frontend' inputs: - secureFile: 'FRONTEND_ENV_FILE_STAG' # string. Required. Secure File. + secureFile: 'FRONTEND_ENV_FILE_STAG_UPDATED' # string. Required. Secure File. - task: CopyFiles@2 displayName: 'copy STAG frontend' inputs: SourceFolder: '$(Agent.TempDirectory)' - Contents: FRONTEND_ENV_FILE_STAG + Contents: FRONTEND_ENV_FILE_STAG_UPDATED TargetFolder: './frontend' - - script: mv ./frontend/FRONTEND_ENV_FILE_STAG ./frontend/.env + - script: mv ./frontend/FRONTEND_ENV_FILE_STAG_UPDATED ./frontend/.env displayName: 'rename STAG .env' - script: ls -a ./frontend From 4147095870ba89d71e14b245918787e905431e7f Mon Sep 17 00:00:00 2001 From: wickathou Date: Wed, 22 May 2024 13:25:43 +0300 Subject: [PATCH 4/8] Fixed typo on config variable for graphQL --- frontend/src/graphql/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/graphql/client.js b/frontend/src/graphql/client.js index f151249c2..062792f11 100644 --- a/frontend/src/graphql/client.js +++ b/frontend/src/graphql/client.js @@ -30,7 +30,7 @@ const errorLink = onError(({ graphQLErrors, networkError }) => { export default idToken => { const wsLink = new GraphQLWsLink( createClient({ - url: config.WEB_SOCET_URL, //TODO: is this causing renew loop problem? + url: config.WEB_SOCKET_URL, //TODO: is this causing renew loop problem? connectionParams: { authToken: idToken }, }), ) From aa382c4b2ad74c9fd7a05c09d9b75e6e497dfe56 Mon Sep 17 00:00:00 2001 From: wickathou Date: Thu, 30 May 2024 16:18:09 +0300 Subject: [PATCH 5/8] Removed repeated fields from the challenge schema --- shared/schemas/Challenge.js | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/shared/schemas/Challenge.js b/shared/schemas/Challenge.js index 397607fb1..7a229c152 100644 --- a/shared/schemas/Challenge.js +++ b/shared/schemas/Challenge.js @@ -46,30 +46,6 @@ const ChallengeSchema = new mongoose.Schema({ companyInfo: { type: String, }, - title: { - type: String, - }, - subtitle: { - type: String, - }, - description: { - type: String, - }, - insights: { - type: String, - }, - resources: { - type: String, - }, - prizes: { - type: String, - }, - criteria: { - type: String, - }, - companyInfo: { - type: String, - }, logo: CloudinaryImageSchema.mongoose, }) @@ -97,15 +73,6 @@ const ChallengeType = new GraphQLObjectType({ description: { type: GraphQLString, }, - title: { - type: GraphQLString, - }, - subtitle: { - type: GraphQLString, - }, - description: { - type: GraphQLString, - }, insights: { type: GraphQLString, }, From 6eecd1137aad22d2e624a180e01e14c0891a08b0 Mon Sep 17 00:00:00 2001 From: wickathou Date: Thu, 30 May 2024 17:00:49 +0300 Subject: [PATCH 6/8] Fixed issue with redux store values for challenges being modified by the /teams page with the teamCount property --- .../organiser/participants/teams/index.js | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/frontend/src/pages/_dashboard/renderDashboard/organiser/participants/teams/index.js b/frontend/src/pages/_dashboard/renderDashboard/organiser/participants/teams/index.js index 9f0e7c53a..b3abe3c32 100644 --- a/frontend/src/pages/_dashboard/renderDashboard/organiser/participants/teams/index.js +++ b/frontend/src/pages/_dashboard/renderDashboard/organiser/participants/teams/index.js @@ -14,23 +14,19 @@ export default () => { const registrationsLoading = useSelector( OrganiserSelectors.registrationsLoading, ) + const challengeList = [] const teamsLoading = useSelector(OrganiserSelectors.teamsLoading) - const challengeList = event?.challenges || [] - - if (challengeList.length > 0) { - challengeList.forEach(challenge => { - challenge.teamCount = 0 - }) - } - - if (teams.length > 0) { - teams.map(team => { - challengeList.find(challenge => { - if (challenge._id === team.challenge) { - challenge.teamCount += 1 - } + if (event?.challenges && event?.challenges.length > 0) { + challengeList.push(...event?.challenges.map(challenge => ({ ...challenge, teamCount: 0 }))) + if (teams.length > 0) { + teams.map(team => { + challengeList.find(challenge => { + if (challenge._id === team.challenge) { + challenge.teamCount += 1 + } + }) }) - }) + } } return ( From c269021a674bba02d56fcd8f3b023b838deb7632 Mon Sep 17 00:00:00 2001 From: wickathou Date: Thu, 30 May 2024 17:13:27 +0300 Subject: [PATCH 7/8] Fixed typo on websocket env variable --- frontend/src/constants/config.js | 4 ++-- frontend/src/graphql/client.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/constants/config.js b/frontend/src/constants/config.js index 0a49e5cdf..daae75efe 100644 --- a/frontend/src/constants/config.js +++ b/frontend/src/constants/config.js @@ -13,9 +13,9 @@ const settings = { required: true, value: process.env.REACT_APP_BASE_URL, }, - WEB_SOCET_URL: { + WEB_SOCKET_URL: { required: false, - value: process.env.REACT_APP_WEB_SOCET_URL, + value: process.env.REACT_APP_WEB_SOCKET_URL, }, CALENDAR_URL: { required: false, diff --git a/frontend/src/graphql/client.js b/frontend/src/graphql/client.js index 9722f22ad..bb164c25c 100644 --- a/frontend/src/graphql/client.js +++ b/frontend/src/graphql/client.js @@ -30,7 +30,7 @@ const errorLink = onError(({ graphQLErrors, networkError }) => { export default idToken => { const wsLink = new GraphQLWsLink( createClient({ - url: config.WEB_SOCET_URL,//TODO: is this causing renew loop problem? + url: config.WEB_SOCKET_URL,//TODO: is this causing renew loop problem? connectionParams: { authToken: idToken }, }), ) From 7a1fa5875fb015c926b16c16ec38fafd5f76d58c Mon Sep 17 00:00:00 2001 From: wickathou Date: Thu, 30 May 2024 17:22:29 +0300 Subject: [PATCH 8/8] Removed unnecesary debug message --- frontend/src/pages/_dashboard/renderDashboard/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/src/pages/_dashboard/renderDashboard/index.js b/frontend/src/pages/_dashboard/renderDashboard/index.js index ea7be432f..3d4220151 100644 --- a/frontend/src/pages/_dashboard/renderDashboard/index.js +++ b/frontend/src/pages/_dashboard/renderDashboard/index.js @@ -22,7 +22,6 @@ import { useActiveEvents, usePastEvents, } from 'graphql/queries/events' -import { debugGroup } from 'utils/debuggingTools' // import { Chat } from 'components/messaging/chat' export default role => { @@ -131,7 +130,6 @@ export default role => { return newArray }) } - debugGroup('alertsData', [alertsData]) }, [alertsData, setAlerts, newAlert, setAlertCount]) /** Update project when team changes */