-
Notifications
You must be signed in to change notification settings - Fork 14
BH Config & Carousel -> PROD-2321 #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
b85c5ef
53d0f36
7bc8b38
927c237
8d21d47
b5e15ac
69a2275
7e78cd3
3cf840e
2760fb1
cfafb93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ import { | |
ChallengeMetadataName, | ||
ChallengePhase, | ||
ChallengePhaseName, | ||
WorkPrice, | ||
WorkPrices | ||
} from '../work-store' | ||
|
||
import { ChallengeStatus } from './challenge-status.enum' | ||
import { WorkPrice } from './work-price.model' | ||
import { WorkPrices } from './work-prices.config' | ||
import { WorkProgressStep } from './work-progress-step.model' | ||
import { WorkProgress } from './work-progress.model' | ||
import { WorkStatus } from './work-status.enum' | ||
|
@@ -258,10 +258,6 @@ function findPhase(challenge: Challenge, phases: Array<string>): ChallengePhase | |
// tslint:disable-next-line: cyclomatic-complexity | ||
function getCost(challenge: Challenge, type: WorkType): number | undefined { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Factories should be really dumb--they just take data in one form and transform it to another. Now that we're thinking of the configs as data, it means this getCost method is actually retrieving data directly from the store in the form of the price config, which is an anti-pattern. Let's have the work-provider pass the WorkPrices config into the factory create method instead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @brooketopcoder Now I'm thinking of just returning the prices as part of the WorkTypeConfigs instead of a separate object and using that in the work.factory. Let me know if you see any issues with that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Disregard that last comment. We can't do that unless we import the config for the other intakes as well. Maybe a future update |
||
|
||
function getCountFromString(raw: string | undefined): number { | ||
return Number(raw?.split(' ')?.[0] || '0') | ||
} | ||
|
||
const priceConfig: WorkPrice = WorkPrices[type] | ||
switch (type) { | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { WorkType } from '../work-factory' | ||
|
||
export const WorkIntakeFormRoutes: { [workType: string]: ReadonlyArray<string> } = { | ||
// TODO: determine URL for Bug Hunt and if the following "/self-service" routes | ||
// can be deleted. Not sure if they correspond to the currentStep | ||
[WorkType.bugHunt]: [ | ||
'/self-service/wizard', | ||
'/self-service/work/new/bug-hunt/basic-info', | ||
'/self-service', | ||
'/self-service', | ||
'/self-service/work/new/bug-hunt/login-prompt', | ||
'/self-service', | ||
'/self-service/work/new/bug-hunt/review', | ||
'/self-service/work/new/bug-hunt/thank-you', | ||
], | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export interface WorkPrice { | ||
base: number, | ||
getPrice: (price: WorkPrice, pageCount?: number, deviceCount?: number) => number, | ||
payments?: { | ||
base?: { | ||
prizes: ReadonlyArray<number>, | ||
reviewers: ReadonlyArray<number>, | ||
}, | ||
promo?: { | ||
prizes: ReadonlyArray<number>, | ||
reviewers: ReadonlyArray<number>, | ||
}, | ||
}, | ||
perPage?: number, | ||
promo?: number, | ||
usePromo?: boolean, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface WorkTimeline { | ||
duration: number, | ||
phaseId: string, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { WorkType } from '../work-factory' | ||
|
||
import { WorkTimeline } from './work-timeline.model' | ||
|
||
export const WorkTimelines: { [workType: string]: ReadonlyArray<WorkTimeline> } = { | ||
// TODO: Determine actual timeline for Bug Hunt | ||
[WorkType.bugHunt]: [ | ||
{ | ||
// Registration | ||
duration: 259200, // 3 days | ||
phaseId: 'a93544bc-c165-4af4-b55e-18f3593b457a', | ||
}, | ||
{ | ||
// Submission | ||
duration: 259200, // 3 days | ||
phaseId: '6950164f-3c5e-4bdc-abc8-22aaf5a1bd49', | ||
}, | ||
{ | ||
// Review | ||
duration: 86400, // 1 day | ||
phaseId: 'aa5a3f78-79e0-4bf7-93ff-b11e8f5b398b', | ||
}, | ||
{ | ||
// Appeals | ||
duration: 86400, // 1 day | ||
phaseId: '1c24cfb3-5b0a-4dbd-b6bd-4b0dff5349c6', | ||
}, | ||
{ | ||
// Appeals response | ||
duration: 259200, // 3 days | ||
phaseId: '797a6af7-cd3f-4436-9fca-9679f773bee9', | ||
}, | ||
], | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import imgBugHunt from '../../../work-images/bug-hunt-main.jpeg' | ||
import { WorkType } from '../work-factory' | ||
|
||
import { WorkIntakeFormRoutes } from './work-intake-form-routes.config' | ||
import { bugHunt as workPriceBugHunt } from './work-prices.config' | ||
import { WorkTimelines } from './work-timelines.config' | ||
import { WorkTypeConfig } from './work-type.model' | ||
|
||
export const WorkTypeConfigs: { [workType: string]: WorkTypeConfig } = { | ||
// TODO: determine duration, intakeFormRoutes, timeline, challenge ids, etc | ||
[WorkType.bugHunt]: { | ||
about: `Our Website Bug Hunt services remove the burden of testing from you and your teams | ||
and provide detailed results quickly. This rapid testing cycle will empower you with | ||
information fast, so that your web developers can quickly address those problems. | ||
The Bug Hunt will start with a registration period, where experienced quality assurance | ||
engineers signup to register for the bug hunt. After the registration period completes, | ||
we will run the bug hunt for the time which meets the option you choose below.`, | ||
bgImage: imgBugHunt, | ||
description: 'This is Bug Hunt description', | ||
duration: 8, | ||
featured: true, | ||
intakeFormRoutes: WorkIntakeFormRoutes[WorkType.bugHunt], | ||
results: `You will receive thorough testing of your website, and at the conclusion will be provided | ||
a detailed report of bugs which have steps to reproduce, screenshots / videos if applicable, | ||
details of the bug, and severity of the issue.`, | ||
shortDescription: 'Find bugs quickly and vigorously', | ||
startRoute: WorkIntakeFormRoutes[WorkType.bugHunt][1], | ||
subtitle: `Conduct a time based testing bug hunt where Topcoder experts scramble to find bugs or issues on your website`, | ||
timeline: WorkTimelines[WorkType.bugHunt], | ||
timelineTemplateId: '7ebf1c69-f62f-4d3a-bdfb-fe9ddb56861c', | ||
title: WorkType.bugHunt, | ||
trackId: 'c0f5d461-8219-4c14-878a-c3a3f356466d', | ||
type: WorkType.bugHunt, | ||
typeId: '927abff4-7af9-4145-8ba1-577c16e64e2e', | ||
...workPriceBugHunt, | ||
// TODO: do we need to include breadcrumbs here? | ||
}, | ||
} | ||
|
||
export const bugHuntConfig: WorkTypeConfig = WorkTypeConfigs[WorkType.bugHunt] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { WorkType } from '../work-factory' | ||
|
||
import { WorkPrice } from './work-price.model' | ||
import { WorkTimeline } from './work-timeline.model' | ||
|
||
export interface WorkTypeConfig extends WorkPrice { | ||
about: string, | ||
bgImage: string, | ||
description: string, | ||
duration: number, | ||
featured: boolean, | ||
intakeFormRoutes: ReadonlyArray<string> | ||
results: string, | ||
shortDescription: string, | ||
startRoute: string, | ||
subtitle: string, | ||
timeline: ReadonlyArray<WorkTimeline> | ||
timelineTemplateId: string, | ||
title: string, | ||
trackId: string, | ||
type: WorkType, | ||
typeId: string, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove this tslint exclusion