Skip to content

Commit 8a2ca26

Browse files
author
Maria Mattlin
committed
PROD-2568 #comment Moved phase ids to config file #time 10m
1 parent d412c9f commit 8a2ca26

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"PHASE_ID_APPEALS": "1c24cfb3-5b0a-4dbd-b6bd-4b0dff5349c6",
3+
"PHASE_ID_APPEALS_RESPONSE": "797a6af7-cd3f-4436-9fca-9679f773bee9",
4+
"PHASE_ID_REGISTRATION": "a93544bc-c165-4af4-b55e-18f3593b457a",
5+
"PHASE_ID_REVIEW": "aa5a3f78-79e0-4bf7-93ff-b11e8f5b398b",
6+
"PHASE_ID_SUBMISSION": "6950164f-3c5e-4bdc-abc8-22aaf5a1bd49"
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export { default as WorkStrings } from './strings.json'
2+
export { default as WorkConfigConstants } from './config.json'

src-ts/tools/work/work-lib/work-provider/work-functions/work-factory/work.factory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import moment from 'moment'
22

3-
import { WorkStrings } from '../../../work-constants'
3+
import { WorkConfigConstants, WorkStrings } from '../../../work-constants'
44
import {
55
Challenge,
66
ChallengeCreateBody,
@@ -153,7 +153,7 @@ export function buildUpdateBody(workTypeConfig: WorkTypeConfig, challenge: Chall
153153
// If the duration of the Submission phase depends on the package selected (i.e.: Bug Hunt),
154154
// then update the duration for that phase to the correct value
155155
const timeline: Array<WorkTimelinePhase> = workTypeConfig.timeline.map((phase) => {
156-
if (workTypeConfig.submissionPhaseDuration && phase.phaseId === '6950164f-3c5e-4bdc-abc8-22aaf5a1bd49') {
156+
if (workTypeConfig.submissionPhaseDuration && phase.phaseId === WorkConfigConstants.PHASE_ID_SUBMISSION) {
157157
phase.duration = workTypeConfig.submissionPhaseDuration[formData[ChallengeMetadataName.packageType] as PricePackageName] || 0
158158
}
159159
return phase
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { WorkConfigConstants } from '../../../work-constants'
2+
13
import { WorkTimeline } from './work-timeline.model'
24
import { WorkType } from './work-type.enum'
35

@@ -7,27 +9,27 @@ export const WorkTimelines: WorkTimeline = {
79
{
810
// Registration
911
duration: 43200, // 0.5 day
10-
phaseId: 'a93544bc-c165-4af4-b55e-18f3593b457a',
12+
phaseId: WorkConfigConstants.PHASE_ID_REGISTRATION,
1113
},
1214
{
1315
// Submission
1416
duration: 86400, // 1 day, will vary by package
15-
phaseId: '6950164f-3c5e-4bdc-abc8-22aaf5a1bd49',
17+
phaseId: WorkConfigConstants.PHASE_ID_SUBMISSION,
1618
},
1719
{
1820
// Review
1921
duration: 172800, // 2 days
20-
phaseId: 'aa5a3f78-79e0-4bf7-93ff-b11e8f5b398b',
22+
phaseId: WorkConfigConstants.PHASE_ID_REVIEW,
2123
},
2224
{
2325
// Appeals
2426
duration: 43200, // 0.5 day
25-
phaseId: '1c24cfb3-5b0a-4dbd-b6bd-4b0dff5349c6',
27+
phaseId: WorkConfigConstants.PHASE_ID_APPEALS,
2628
},
2729
{
2830
// Appeals response
2931
duration: 43200, // 0.5 day
30-
phaseId: '797a6af7-cd3f-4436-9fca-9679f773bee9',
32+
phaseId: WorkConfigConstants.PHASE_ID_APPEALS_RESPONSE,
3133
},
3234
],
3335
}

0 commit comments

Comments
 (0)