Skip to content

Commit ea0d27c

Browse files
committed
feat: allow making submission phase arbitrary
1 parent 27f8e76 commit ea0d27c

File tree

6 files changed

+4389
-10
lines changed

6 files changed

+4389
-10
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ You can find sample `.env` files inside the `/docs` directory.
102102
1. 📦 Install npm dependencies
103103

104104
```bash
105-
npm install
105+
yarn install
106106
```
107107

108108
2. ⚙ Local config

docker/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use the base image with Node.js
2-
FROM node:12.22.12-buster
2+
FROM node:14.21.2-bullseye
33

44
# Copy the current directory into the Docker image
55
COPY . /challenge-api
@@ -8,6 +8,6 @@ COPY . /challenge-api
88
WORKDIR /challenge-api
99

1010
# Install the dependencies from package.json
11-
RUN npm install
11+
RUN yarn install
1212

13-
CMD npm start
13+
CMD yarn start

mock-api/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ FROM node:10.20-jessie
22

33
COPY . /challenge-api
44

5-
RUN (cd /challenge-api && npm install)
5+
RUN (cd /challenge-api && yarn install)
66

77
WORKDIR /challenge-api/mock-api
88

9-
RUN npm install
9+
RUN yarn install
1010

11-
CMD npm start
11+
CMD yarn start

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@
7676
]
7777
},
7878
"engines": {
79-
"node": "10.x"
79+
"node": "14.x"
8080
},
8181
"volta": {
82-
"node": "12.22.12"
82+
"node": "14.21.2"
8383
}
8484
}

src/common/phase-helper.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ class ChallengePhaseHelper {
7979
p.scheduledStartDate = moment(startDate).toDate()
8080
}
8181
if (p.name === 'Submission') {
82-
p.scheduledStartDate = moment(startDate).add(5, 'minutes').toDate()
82+
if (p.scheduledStartDate != null) {
83+
p.scheduledStartDate = moment(p.scheduledStartDate).toDate()
84+
}
85+
else {
86+
p.scheduledStartDate = moment(startDate).add(5, 'minutes').toDate()
87+
}
88+
8389
}
8490

8591
if (moment(p.scheduledStartDate).isSameOrBefore(moment())) {

0 commit comments

Comments
 (0)