Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions backend/misc/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const settings = {
},
REDIS_PASSWORD: {
required: false,
value: process.env.REDIS_PASSWORD || 'NOPE'
value: process.env.REDIS_PASSWORD || 'NOPE',
},
}

Expand All @@ -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 {
Expand All @@ -142,7 +142,7 @@ const config = buildConfig()

logger.info({
message: 'Running app with config',
data: config,
// data: config,
})

global.gConfig = config
Expand Down
131 changes: 77 additions & 54 deletions frontend/public/index.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,50 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<!-- Favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon-16x16.png">
<link rel="manifest" href="%PUBLIC_URL%/site.webmanifest">
<link rel="mask-icon" href="%PUBLIC_URL%/safari-pinned-tab.svg" color="#ffffff">
<meta name="msapplication-TileColor" content="#000000">
<meta name="theme-color" content="#000000">
<!--
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<!-- Favicon -->
<link
rel="apple-touch-icon"
sizes="180x180"
href="%PUBLIC_URL%/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="%PUBLIC_URL%/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="%PUBLIC_URL%/favicon-16x16.png"
/>
<link rel="manifest" href="%PUBLIC_URL%/site.webmanifest" />
<link
rel="mask-icon"
href="%PUBLIC_URL%/safari-pinned-tab.svg"
color="#ffffff"
/>
<meta name="msapplication-TileColor" content="#000000" />
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<script defer data-domain="app.hackjunction.com" src="https://analytics.hackjunction.com/js/plausible.js"></script>
<script
defer
data-domain="%REACT_APP_PLAUSIBLE_DATA_DOMAIN%"
src="%REACT_APP_PLAUSIBLE_SRC%"
></script>

<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Expand All @@ -29,43 +53,45 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<!-- Page title -->
<title>%REACT_APP_PAGE_TITLE%</title>

<!-- Icon import-->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<!-- Page title -->
<title>%REACT_APP_PAGE_TITLE%</title>

<style>
#root {
min-height: 100%;
display: flex;
flex-direction: column;
}
<!-- Icon import-->
<link
rel="stylesheet"
href="https://fonts.googleapis.com/icon?family=Material+Icons"
/>

html,
body {
height: 100%;
}
<style>
#root {
min-height: 100%;
display: flex;
flex-direction: column;
}

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
}
</style>
html,
body {
height: 100%;
}

</head>
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
}
</style>
</head>

<body class="body">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
<body class="body">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

Expand All @@ -74,8 +100,5 @@

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->

</body>

</html>
--></body>
</html>
7 changes: 4 additions & 3 deletions frontend/src/constants/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/graphql/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
}),
)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/_dashboard/renderDashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,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 } })
Expand Down Expand Up @@ -129,7 +130,6 @@ export default role => {
return newArray
})
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [alertsData, setAlerts, newAlert, setAlertCount])

/** Update project when team changes */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
33 changes: 0 additions & 33 deletions shared/schemas/Challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})

Expand Down Expand Up @@ -97,15 +73,6 @@ const ChallengeType = new GraphQLObjectType({
description: {
type: GraphQLString,
},
title: {
type: GraphQLString,
},
subtitle: {
type: GraphQLString,
},
description: {
type: GraphQLString,
},
insights: {
type: GraphQLString,
},
Expand Down