1
|
|
|
import { IntlShape } from "react-intl"; |
2
|
|
|
import { Application } from "../../../models/types"; |
3
|
|
|
import { |
4
|
|
|
ProgressBarProps, |
5
|
|
|
stepNames, |
6
|
|
|
ProgressBarStepStatus, |
7
|
|
|
} from "./ProgressBar"; |
8
|
|
|
import { |
9
|
|
|
applicationBasic, |
10
|
|
|
applicationExperienceIntro, |
11
|
|
|
applicationSkills, |
12
|
|
|
applicationFit, |
13
|
|
|
applicationReview, |
14
|
|
|
applicationSubmission, |
15
|
|
|
} from "../../../helpers/routes"; |
16
|
|
|
import { getLocale } from "../../../helpers/localize"; |
17
|
|
|
|
18
|
|
|
function basicInfoStatus(application: Application): ProgressBarStepStatus { |
19
|
|
|
// TODO: implement. |
20
|
|
|
return "complete"; |
21
|
|
|
} |
22
|
|
|
function experienceStatus(application: Application): ProgressBarStepStatus { |
23
|
|
|
// TODO: implement. |
24
|
|
|
return "complete"; |
25
|
|
|
} |
26
|
|
|
function skillsStatus(application: Application): ProgressBarStepStatus { |
27
|
|
|
// TODO: implement. |
28
|
|
|
return "complete"; |
29
|
|
|
} |
30
|
|
|
function myFitStatus(application: Application): ProgressBarStepStatus { |
31
|
|
|
// TODO: implement. |
32
|
|
|
return "complete"; |
33
|
|
|
} |
34
|
|
|
function reviewStatus(application: Application): ProgressBarStepStatus { |
35
|
|
|
// TODO: implement. |
36
|
|
|
return "complete"; |
37
|
|
|
} |
38
|
|
|
function submissionStatus(application: Application): ProgressBarStepStatus { |
39
|
|
|
// TODO: implement. |
40
|
|
|
return "complete"; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
export function makeProgressBarSteps( |
44
|
|
|
application: Application, |
45
|
|
|
intl: IntlShape, |
46
|
|
|
currentStep: |
47
|
|
|
| "welcome" |
48
|
|
|
| "basic" |
49
|
|
|
| "experience" |
50
|
|
|
| "skills" |
51
|
|
|
| "fit" |
52
|
|
|
| "review" |
53
|
|
|
| "submission" |
54
|
|
|
| "other", |
55
|
|
|
): ProgressBarProps["steps"] { |
56
|
|
|
const locale = getLocale(intl.locale); |
57
|
|
|
return [ |
58
|
|
|
{ |
59
|
|
|
link: { |
60
|
|
|
url: applicationBasic(locale, application.id), |
61
|
|
|
text: intl.formatMessage(stepNames.step01), |
62
|
|
|
title: intl.formatMessage(stepNames.step01), |
63
|
|
|
}, |
64
|
|
|
status: |
65
|
|
|
currentStep === "basic" ? "current" : basicInfoStatus(application), |
66
|
|
|
}, |
67
|
|
|
{ |
68
|
|
|
link: { |
69
|
|
|
url: applicationExperienceIntro(locale, application.id), |
70
|
|
|
text: intl.formatMessage(stepNames.step02), |
71
|
|
|
title: intl.formatMessage(stepNames.step02), |
72
|
|
|
}, |
73
|
|
|
status: |
74
|
|
|
currentStep === "experience" |
75
|
|
|
? "current" |
76
|
|
|
: experienceStatus(application), |
77
|
|
|
}, |
78
|
|
|
{ |
79
|
|
|
link: { |
80
|
|
|
url: applicationSkills(locale, application.id), |
81
|
|
|
text: intl.formatMessage(stepNames.step03), |
82
|
|
|
title: intl.formatMessage(stepNames.step03), |
83
|
|
|
}, |
84
|
|
|
status: currentStep === "skills" ? "current" : skillsStatus(application), |
85
|
|
|
}, |
86
|
|
|
{ |
87
|
|
|
link: { |
88
|
|
|
url: applicationFit(locale, application.id), |
89
|
|
|
text: intl.formatMessage(stepNames.step04), |
90
|
|
|
title: intl.formatMessage(stepNames.step04), |
91
|
|
|
}, |
92
|
|
|
status: currentStep === "fit" ? "current" : myFitStatus(application), |
93
|
|
|
}, |
94
|
|
|
{ |
95
|
|
|
link: { |
96
|
|
|
url: applicationReview(locale, application.id), |
97
|
|
|
text: intl.formatMessage(stepNames.step05), |
98
|
|
|
title: intl.formatMessage(stepNames.step05), |
99
|
|
|
}, |
100
|
|
|
status: currentStep === "review" ? "current" : reviewStatus(application), |
101
|
|
|
}, |
102
|
|
|
{ |
103
|
|
|
link: { |
104
|
|
|
url: applicationSubmission(locale, application.id), |
105
|
|
|
text: intl.formatMessage(stepNames.step06), |
106
|
|
|
title: intl.formatMessage(stepNames.step06), |
107
|
|
|
}, |
108
|
|
|
status: |
109
|
|
|
currentStep === "submission" |
110
|
|
|
? "current" |
111
|
|
|
: submissionStatus(application), |
112
|
|
|
}, |
113
|
|
|
]; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
export default makeProgressBarSteps; |
117
|
|
|
|