Skip to content

Commit 3ff6aed

Browse files
authored
Merge pull request #371 from topcoder-platform/PROD-2614_Self-service_payment
PROD-2643 PROD-2619 PROD-2620 PROD-2760 PROD-2644 Fix the issues in self-service -> dev
2 parents 82bc219 + c476a22 commit 3ff6aed

File tree

15 files changed

+91
-41
lines changed

15 files changed

+91
-41
lines changed

src-ts/lib/form/form-functions/form.functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ export async function onSubmitAsync<T>(
7272
): Promise<void> {
7373

7474
event.preventDefault()
75+
event.stopPropagation()
7576

7677
const { groups, shortName, successMessage }: FormDefinition = formDef
7778
const inputs: Array<FormInputModel> = getFormInputFields(groups || [])
7879

7980
// get the dirty fields before we validate b/c validation marks them dirty on submit
8081
const dirty: FormInputModel | undefined = inputs?.find(fieldDef => !!fieldDef.dirty)
81-
8282
// if there are any validation errors, display a message and stop submitting
8383
// NOTE: need to check this before we check if the form is dirty bc you
8484
// could have a form that's not dirty but has errors and you wouldn't
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@import '../../styles/includes';
2+
3+
.iconWrapper {
4+
@include icon-mxx;
5+
6+
margin: 0 $space-lg $space-lg $space-lg;
7+
background: $tc-grad12;
8+
border-radius: $space-xxl;
9+
display: flex;
10+
align-items: center;
11+
justify-content: center;
12+
13+
svg {
14+
@include icon-xl;
15+
color: $tc-white;
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import classNames from 'classnames'
2+
import { FC } from 'react'
3+
4+
import styles from './IconWrapper.module.scss'
5+
6+
interface IconWrapperProps {
7+
className?: string
8+
icon: JSX.Element
9+
}
10+
11+
const IconWrapper: FC<IconWrapperProps> = ({ className, icon }: IconWrapperProps) => (
12+
<div className={classNames(styles.iconWrapper, className)}>
13+
<>{icon}</>
14+
</div>
15+
)
16+
17+
export default IconWrapper
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as IconWrapper } from './IconWrapper'

src-ts/lib/svgs/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ export {
3737
GitlabIcon,
3838
GithubIcon
3939
}
40+
export * from './icon-wrapper'

src-ts/tools/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ export {
2828
WorkTypeCategoryUnknownIcon,
2929
WorkTypeConfigs,
3030
BugHuntIntakeForm,
31+
bugHuntRoute
3132
} from './work'

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,11 @@ function getProgress(challenge: Challenge, workStatus: WorkStatus): WorkProgress
548548
name: 'Submitted',
549549
},
550550
{
551-
date: getProgressStepDateStart(challenge, [ChallengePhaseName.registration]),
551+
date: getProgressStepDateStart(challenge, [
552+
ChallengePhaseName.specificationReview,
553+
ChallengePhaseName.specificationSubmission,
554+
ChallengePhaseName.registration,
555+
]),
552556
name: 'Started',
553557
},
554558
{
@@ -694,7 +698,10 @@ function getTypeCategory(type: WorkType): WorkTypeCategory {
694698
case WorkType.designLegacy:
695699
return WorkTypeCategory.design
696700

697-
// TOOD: other categories: qa and dev
701+
case WorkType.bugHunt:
702+
return WorkTypeCategory.qa
703+
704+
// TOOD: other categories: dev
698705
default:
699706
return WorkTypeCategory.unknown
700707
}

src-ts/tools/work/work-lib/work-provider/work-functions/work-store/challenge-phase-name.enum.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
export enum ChallengePhaseName {
2+
specificationReview = 'Specification Review',
3+
specificationSubmission = 'Specification Submission',
24
appeals = 'Appeals',
35
appealsResponse = 'Appeals Response',
46
approval = 'Approval',

src-ts/tools/work/work-self-service/intake-forms/bug-hunt/BugHuntIntakeForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
} from '../../../work-lib'
3030
import { WorkServicePrice } from '../../../work-service-price'
3131
import { WorkTypeBanner } from '../../../work-type-banner'
32-
import { dashboardRoute } from '../../../work.routes'
32+
import { dashboardRoute, selfServiceStartRoute } from '../../../work.routes'
3333
import IntakeFormsBreadcrumb from '../intake-forms-breadcrumb/IntakeFormsBreadcrumb'
3434

3535
import { BugHuntFormConfig } from './bug-hunt.form.config'
@@ -52,7 +52,7 @@ const BugHuntIntakeForm: React.FC = () => {
5252
BugHuntFormConfig.buttons.primaryGroup[0].hidden = !isLoggedIn
5353
BugHuntFormConfig.buttons.primaryGroup[1].onClick = () => { setAction('submit') }
5454
if (BugHuntFormConfig.buttons.secondaryGroup) {
55-
BugHuntFormConfig.buttons.secondaryGroup[0].onClick = () => { navigate(-1) }
55+
BugHuntFormConfig.buttons.secondaryGroup[0].onClick = () => { navigate(selfServiceStartRoute) }
5656
}
5757

5858
const [challenge, setChallenge]: [Challenge | undefined, Dispatch<SetStateAction<Challenge | undefined>>] = useState()

src-ts/tools/work/work-service-price/WorkServicePrice.module.scss

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,6 @@
44

55
margin-top: $space-xl;
66

7-
.iconWrapper {
8-
height: 48;
9-
width: 48;
10-
margin: 0 $space-lg $space-lg $space-lg;
11-
background: $tc-grad12;
12-
border-radius: 24px;
13-
14-
svg {
15-
@include icon-xl;
16-
margin: $space-md;
17-
color: $tc-white;
18-
}
19-
}
20-
217
.inline {
228
display: flex;
239
flex-direction: row;

0 commit comments

Comments
 (0)