Skip to content

Commit 938ce51

Browse files
authored
Merge pull request #209 from topcoder-platform/PROD-2568_timeline
PROD-2468 Timeline -> PROD-2321
2 parents 7df13c1 + 3eeb08e commit 938ce51

File tree

9 files changed

+51
-23
lines changed

9 files changed

+51
-23
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: 13 additions & 4 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,
@@ -10,14 +10,14 @@ import {
1010
ChallengePhase,
1111
ChallengePhaseName,
1212
ChallengeUpdateBody,
13+
PricePackageName,
1314
Work,
1415
WorkPrice,
15-
WorkPriceBreakdown,
1616
WorkPricesType,
17-
WorkPrize,
1817
WorkProgress,
1918
WorkProgressStep,
2019
WorkStatus,
20+
WorkTimelinePhase,
2121
WorkType,
2222
WorkTypeCategory,
2323
WorkTypeConfig,
@@ -150,12 +150,21 @@ export function buildUpdateBody(workTypeConfig: WorkTypeConfig, challenge: Chall
150150
}
151151
// ---- End Build Markdown string ---- //
152152

153+
// If the duration of the Submission phase depends on the package selected (i.e.: Bug Hunt),
154+
// then update the duration for that phase to the correct value
155+
const timeline: Array<WorkTimelinePhase> = workTypeConfig.timeline.map((phase) => {
156+
if (workTypeConfig.submissionPhaseDuration && phase.phaseId === WorkConfigConstants.PHASE_ID_SUBMISSION) {
157+
phase.duration = workTypeConfig.submissionPhaseDuration[formData[ChallengeMetadataName.packageType] as PricePackageName] || 0
158+
}
159+
return phase
160+
})
161+
153162
const body: ChallengeUpdateBody = {
154163
description: templateString.join(''),
155164
id: challenge.id,
156165
metadata: intakeMetadata,
157166
name: formData.projectTitle,
158-
phases: workTypeConfig.timeline,
167+
phases: timeline,
159168
prizeSets: priceConfig.getPrizeSets(priceConfig, formData.packageType),
160169
}
161170

src-ts/tools/work/work-lib/work-provider/work-functions/work-store/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export * from './work-progress.model'
2020
export * from './work-progress-step.model'
2121
export * from './work-status-filter.enum'
2222
export * from './work-status.enum'
23+
export * from './work-timeline-phase.model'
2324
export {
2425
bugHuntConfig as workBugHuntConfig,
2526
WorkTypeConfigs
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { WorkTimelinePhase } from './work-timeline-phase.model'
22

33
export interface WorkTimeline {
4-
[workType: string]: ReadonlyArray<WorkTimelinePhase>
4+
[workType: string]: Array<WorkTimelinePhase>
55
}
Lines changed: 12 additions & 10 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

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

src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-type.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ export const WorkTypeConfigs: { [workType: string]: WorkTypeConfig } = {
3535
},
3636
shortDescription: 'Find bugs quickly and vigorously',
3737
startRoute: WorkIntakeFormRoutes[WorkType.bugHunt]['basicInfo'],
38+
submissionPhaseDuration: {
39+
'advanced': 172800, // 2 days
40+
'premium': 259200, // 3 days
41+
'standard': 86400, // 1 day
42+
},
3843
subtitle: `Conduct a time based testing bug hunt where Topcoder experts scramble to find bugs or issues in the system`,
3944
tags: [ChallengeTag.qa],
4045
timeline: WorkTimelines[WorkType.bugHunt],

src-ts/tools/work/work-lib/work-provider/work-functions/work-store/work-type.model.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ChallengeTag } from './challenge-tag.enum'
2-
import { WorkPrice } from './work-price.model'
2+
import { PricePackageName, WorkPrice } from './work-price.model'
33
import { WorkTimelinePhase } from './work-timeline-phase.model'
44
import { WorkType } from './work-type.enum'
55

@@ -21,9 +21,12 @@ export interface WorkTypeConfig {
2121
}
2222
shortDescription: string,
2323
startRoute: string,
24+
submissionPhaseDuration?: {
25+
[key in PricePackageName]?: number
26+
},
2427
subtitle: string,
2528
tags: Array<ChallengeTag>,
26-
timeline: ReadonlyArray<WorkTimelinePhase>
29+
timeline: Array<WorkTimelinePhase>
2730
timelineTemplateId: string,
2831
title: string,
2932
trackId: string,

src-ts/tools/work/work.routes.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,20 @@ export const workRoutes: Array<PlatformRoute> = [
6464
route: `bug-hunt/basic-info/:workId`,
6565
title: intakeFormsTitle,
6666
},
67-
// General
6867
{
69-
element: <WorkLoginPrompt />,
70-
route: `:workType/login-prompt`,
68+
element: <Review />,
69+
route: `bug-hunt/review`,
7170
title: intakeFormsTitle,
7271
},
7372
{
7473
element: <Review />,
75-
route: `:workType/review`,
74+
route: `bug-hunt/review/:workId`,
7675
title: intakeFormsTitle,
7776
},
77+
// General
7878
{
79-
element: <Review />,
80-
route: `:workType/review/:workId`,
79+
element: <WorkLoginPrompt />,
80+
route: `:workType/login-prompt`,
8181
title: intakeFormsTitle,
8282
},
8383
{

0 commit comments

Comments
 (0)