1
|
|
|
import React, { useState } from "react"; |
2
|
|
|
import { useIntl, FormattedMessage, defineMessages } from "react-intl"; |
3
|
|
|
import { |
4
|
|
|
User, |
5
|
|
|
Job, |
6
|
|
|
Criteria, |
7
|
|
|
Experience, |
8
|
|
|
Skill, |
9
|
|
|
ExperienceSkill, |
10
|
|
|
JobPosterQuestion, |
11
|
|
|
JobApplicationAnswer, |
12
|
|
|
ApplicationNormalized, |
13
|
|
|
} from "../../../models/types"; |
14
|
|
|
import { languageRequirementDescription } from "../../../models/localizedConstants"; |
15
|
|
|
import { LanguageRequirementId } from "../../../models/lookupConstants"; |
16
|
|
|
import { |
17
|
|
|
basicInfoMessages, |
18
|
|
|
experienceMessages, |
19
|
|
|
fitMessages, |
20
|
|
|
} from "../applicationMessages"; |
21
|
|
|
import defaultBasicMessages, { |
22
|
|
|
citizenshipDeclaration, |
23
|
|
|
languageRequirementLabel, |
24
|
|
|
veteranStatus, |
25
|
|
|
} from "../BasicInfo/basicInfoMessages"; |
26
|
|
|
import ExperienceAwardAccordion from "../ExperienceAccordions/ExperienceAwardAccordion"; |
27
|
|
|
import ExperienceCommunityAccordion from "../ExperienceAccordions/ExperienceCommunityAccordion"; |
28
|
|
|
import ExperienceEducationAccordion from "../ExperienceAccordions/ExperienceEducationAccordion"; |
29
|
|
|
import ExperiencePersonalAccordion from "../ExperienceAccordions/ExperiencePersonalAccordion"; |
30
|
|
|
import ExperienceWorkAccordion from "../ExperienceAccordions/ExperienceWorkAccordion"; |
31
|
|
|
import SkillAccordion from "./SkillAccordion"; |
32
|
|
|
import { getLocale, localizeField } from "../../../helpers/localize"; |
33
|
|
|
import { getSkillOfCriteria, getIrrelevantSkillCount } from "../helpers"; |
34
|
|
|
import { getSkillLevelName } from "../../../models/jobUtil"; |
35
|
|
|
|
36
|
|
|
const messages = defineMessages({ |
37
|
|
|
edit: { |
38
|
|
|
id: "application.review.edit", |
39
|
|
|
defaultMessage: "Edit", |
40
|
|
|
description: "Link text for editing a section.", |
41
|
|
|
}, |
42
|
|
|
editTitle: { |
43
|
|
|
id: "application.review.editTitle", |
44
|
|
|
defaultMessage: "Edit this section.", |
45
|
|
|
description: "Link title for editing a section.", |
46
|
|
|
}, |
47
|
|
|
valueNotSet: { |
48
|
|
|
id: "application.review.valueNotSet", |
49
|
|
|
defaultMessage: "Not set", |
50
|
|
|
description: "Message displayed if a user has not yet set a given value.", |
51
|
|
|
}, |
52
|
|
|
communicationEn: { |
53
|
|
|
id: "application.review.communication.english", |
54
|
|
|
defaultMessage: "I prefer to communicate in English.", |
55
|
|
|
description: |
56
|
|
|
"Text displayed when a user selects 'en' in their profile for communication preference.", |
57
|
|
|
}, |
58
|
|
|
communicationFr: { |
59
|
|
|
id: "application.review.communication.french", |
60
|
|
|
defaultMessage: "I prefer to communicate in French.", |
61
|
|
|
description: |
62
|
|
|
"Text displayed when a user selects 'fr' in their profile for communication preference.", |
63
|
|
|
}, |
64
|
|
|
communicationNotSet: { |
65
|
|
|
id: "application.review.communication.notSet", |
66
|
|
|
defaultMessage: |
67
|
|
|
"You haven't set a communication language preference in your profile yet.", |
68
|
|
|
description: |
69
|
|
|
"Text displayed if a user has not yet selected a communication preference in their profile.", |
70
|
|
|
}, |
71
|
|
|
shareCheckboxLabel: { |
72
|
|
|
id: "application.review.shareCheckboxLabel", |
73
|
|
|
defaultMessage: |
74
|
|
|
"I would like Talent Cloud to share my application with other Government of Canada managers looking for similar sets of skills.", |
75
|
|
|
}, |
76
|
|
|
}); |
77
|
|
|
|
78
|
|
|
const managerViewHeaders = defineMessages({ |
79
|
|
|
basicInfo: { |
80
|
|
|
id: "application.review.manager.basicInfoHeading", |
81
|
|
|
defaultMessage: "Basic Information", |
82
|
|
|
description: |
83
|
|
|
"Manager's heading for the Basic Info section of the Application.", |
84
|
|
|
}, |
85
|
|
|
experience: { |
86
|
|
|
id: "application.review.manager.experienceHeading", |
87
|
|
|
defaultMessage: "Experience", |
88
|
|
|
description: |
89
|
|
|
"Manager's heading for the Experience section of the Application.", |
90
|
|
|
}, |
91
|
|
|
fit: { |
92
|
|
|
id: "application.review.manager.fitHeading", |
93
|
|
|
defaultMessage: "Fit", |
94
|
|
|
description: "Manager's heading for the Fit section of the Application.", |
95
|
|
|
}, |
96
|
|
|
accountSettings: { |
97
|
|
|
id: "application.review.manager.accountSettingsHeading", |
98
|
|
|
defaultMessage: "Account Settings", |
99
|
|
|
description: |
100
|
|
|
"Manager's heading for the Account Settings section of the Application.", |
101
|
|
|
}, |
102
|
|
|
}); |
103
|
|
|
|
104
|
|
|
interface ExperienceAccordionProps { |
105
|
|
|
experience: Experience; |
106
|
|
|
experienceSkills: ExperienceSkill[]; |
107
|
|
|
irrelevantSkillCount: number; |
108
|
|
|
skills: Skill[]; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
const ExperienceAccordion: React.FC<ExperienceAccordionProps> = ({ |
112
|
|
|
experience, |
113
|
|
|
experienceSkills, |
114
|
|
|
irrelevantSkillCount, |
115
|
|
|
skills, |
116
|
|
|
}) => { |
117
|
|
|
switch (experience.type) { |
118
|
|
|
case "experience_award": |
119
|
|
|
return ( |
120
|
|
|
<ExperienceAwardAccordion |
121
|
|
|
experience={experience} |
122
|
|
|
relevantSkills={experienceSkills} |
123
|
|
|
skills={skills} |
124
|
|
|
irrelevantSkillCount={irrelevantSkillCount} |
125
|
|
|
showSkillDetails |
126
|
|
|
showButtons={false} |
127
|
|
|
handleEdit={(): void => {}} |
128
|
|
|
handleDelete={async (): Promise<void> => {}} |
129
|
|
|
/> |
130
|
|
|
); |
131
|
|
|
case "experience_community": |
132
|
|
|
return ( |
133
|
|
|
<ExperienceCommunityAccordion |
134
|
|
|
experience={experience} |
135
|
|
|
relevantSkills={experienceSkills} |
136
|
|
|
skills={skills} |
137
|
|
|
irrelevantSkillCount={irrelevantSkillCount} |
138
|
|
|
showSkillDetails |
139
|
|
|
showButtons={false} |
140
|
|
|
handleEdit={(): void => {}} |
141
|
|
|
handleDelete={async (): Promise<void> => {}} |
142
|
|
|
/> |
143
|
|
|
); |
144
|
|
|
case "experience_education": |
145
|
|
|
return ( |
146
|
|
|
<ExperienceEducationAccordion |
147
|
|
|
experience={experience} |
148
|
|
|
relevantSkills={experienceSkills} |
149
|
|
|
skills={skills} |
150
|
|
|
irrelevantSkillCount={irrelevantSkillCount} |
151
|
|
|
showSkillDetails |
152
|
|
|
showButtons={false} |
153
|
|
|
handleDelete={async (): Promise<void> => {}} |
154
|
|
|
handleEdit={(): void => {}} |
155
|
|
|
/> |
156
|
|
|
); |
157
|
|
|
case "experience_personal": |
158
|
|
|
return ( |
159
|
|
|
<ExperiencePersonalAccordion |
160
|
|
|
experience={experience} |
161
|
|
|
relevantSkills={experienceSkills} |
162
|
|
|
skills={skills} |
163
|
|
|
irrelevantSkillCount={irrelevantSkillCount} |
164
|
|
|
showSkillDetails |
165
|
|
|
showButtons={false} |
166
|
|
|
handleEdit={(): void => {}} |
167
|
|
|
handleDelete={async (): Promise<void> => {}} |
168
|
|
|
/> |
169
|
|
|
); |
170
|
|
|
case "experience_work": |
171
|
|
|
return ( |
172
|
|
|
<ExperienceWorkAccordion |
173
|
|
|
experience={experience} |
174
|
|
|
relevantSkills={experienceSkills} |
175
|
|
|
skills={skills} |
176
|
|
|
irrelevantSkillCount={irrelevantSkillCount} |
177
|
|
|
showSkillDetails |
178
|
|
|
showButtons={false} |
179
|
|
|
handleEdit={(): void => {}} |
180
|
|
|
handleDelete={async (): Promise<void> => {}} |
181
|
|
|
/> |
182
|
|
|
); |
183
|
|
|
default: |
184
|
|
|
return null; |
185
|
|
|
} |
186
|
|
|
}; |
187
|
|
|
|
188
|
|
|
export type ExperienceView = "experience" | "skills" | "education"; |
189
|
|
|
|
190
|
|
|
interface ApplicationPreviewProps { |
191
|
|
|
application: ApplicationNormalized; |
192
|
|
|
criteria: Criteria[]; |
193
|
|
|
experiences: Experience[]; |
194
|
|
|
experienceSkills: ExperienceSkill[]; |
195
|
|
|
experienceViewState?: ExperienceView; |
196
|
|
|
experienceViewButtonOrder?: [ExperienceView, ExperienceView, ExperienceView]; |
197
|
|
|
job: Job; |
198
|
|
|
jobQuestions: JobPosterQuestion[]; |
199
|
|
|
jobApplicationAnswers: JobApplicationAnswer[]; |
200
|
|
|
skills: Skill[]; |
201
|
|
|
user: User; |
202
|
|
|
managerView?: boolean; |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
const ApplicationPreview: React.FunctionComponent<ApplicationPreviewProps> = ({ |
206
|
|
|
application, |
207
|
|
|
criteria, |
208
|
|
|
experiences, |
209
|
|
|
experienceSkills, |
210
|
|
|
experienceViewState, |
211
|
|
|
experienceViewButtonOrder, |
212
|
|
|
job, |
213
|
|
|
jobQuestions, |
214
|
|
|
jobApplicationAnswers, |
215
|
|
|
managerView, |
216
|
|
|
skills, |
217
|
|
|
user, |
218
|
|
|
children, |
219
|
|
|
}) => { |
220
|
|
|
const intl = useIntl(); |
221
|
|
|
const locale = getLocale(intl.locale); |
222
|
|
|
const [experienceView, setExperienceView] = useState<ExperienceView>( |
223
|
|
|
experienceViewState || "experience", |
224
|
|
|
); |
225
|
|
|
|
226
|
|
|
const handleViewClick = (e: React.MouseEvent<HTMLButtonElement>): void => { |
227
|
|
|
const viewType: ExperienceView = e.currentTarget.getAttribute( |
228
|
|
|
"data-experience-view", |
229
|
|
|
) as ExperienceView; |
230
|
|
|
if (viewType !== null) { |
231
|
|
|
setExperienceView(viewType); |
232
|
|
|
} |
233
|
|
|
}; |
234
|
|
|
|
235
|
|
|
const experienceViewButtons = ( |
236
|
|
|
buttonOrder = ["experience", "skills", "education"], |
237
|
|
|
): JSX.Element => { |
238
|
|
|
const experienceButton = ( |
239
|
|
|
<button |
240
|
|
|
data-c-button={`${ |
241
|
|
|
experienceView === "experience" ? "solid" : "outline" |
242
|
|
|
}(c1)`} |
243
|
|
|
type="button" |
244
|
|
|
data-c-radius="rounded" |
245
|
|
|
data-c-margin="right(.5)" |
246
|
|
|
className="gtag-application-review-all-experience" |
247
|
|
|
data-experience-view="experience" |
248
|
|
|
onClick={handleViewClick} |
249
|
|
|
key="experienceButton" |
250
|
|
|
> |
251
|
|
|
<FormattedMessage |
252
|
|
|
id="application.review.experienceViewButton" |
253
|
|
|
defaultMessage="All Experience" |
254
|
|
|
description="Button text for the experience view of the Review page." |
255
|
|
|
/> |
256
|
|
|
</button> |
257
|
|
|
); |
258
|
|
|
const skillsButton = ( |
259
|
|
|
<button |
260
|
|
|
data-c-button={`${ |
261
|
|
|
experienceView === "skills" ? "solid" : "outline" |
262
|
|
|
}(c1)`} |
263
|
|
|
type="button" |
264
|
|
|
data-c-radius="rounded" |
265
|
|
|
data-c-margin="right(.5)" |
266
|
|
|
className="gtag-application-review-skill-experience" |
267
|
|
|
data-experience-view="skills" |
268
|
|
|
onClick={handleViewClick} |
269
|
|
|
key="skillsButton" |
270
|
|
|
> |
271
|
|
|
<FormattedMessage |
272
|
|
|
id="application.review.skillsViewButton" |
273
|
|
|
defaultMessage="Skills for This Job" |
274
|
|
|
description="Button text for the skills view of the Review page." |
275
|
|
|
/> |
276
|
|
|
</button> |
277
|
|
|
); |
278
|
|
|
const educationButton = ( |
279
|
|
|
<button |
280
|
|
|
data-c-button={`${ |
281
|
|
|
experienceView === "education" ? "solid" : "outline" |
282
|
|
|
}(c1)`} |
283
|
|
|
type="button" |
284
|
|
|
data-c-radius="rounded" |
285
|
|
|
data-c-margin="right(.5)" |
286
|
|
|
className="gtag-application-review-education-experience" |
287
|
|
|
data-experience-view="education" |
288
|
|
|
onClick={handleViewClick} |
289
|
|
|
key="educationButton" |
290
|
|
|
> |
291
|
|
|
<FormattedMessage |
292
|
|
|
id="application.review.educationViewButton" |
293
|
|
|
defaultMessage="Education Requirements for This Job" |
294
|
|
|
description="Button text for the education view of the Review page." |
295
|
|
|
/> |
296
|
|
|
</button> |
297
|
|
|
); |
298
|
|
|
|
299
|
|
|
const buttonView = buttonOrder.map((button) => { |
300
|
|
|
switch (button) { |
301
|
|
|
case "experience": |
302
|
|
|
return experienceButton; |
303
|
|
|
case "skills": |
304
|
|
|
return skillsButton; |
305
|
|
|
case "education": |
306
|
|
|
return educationButton; |
307
|
|
|
default: |
308
|
|
|
return null; |
309
|
|
|
} |
310
|
|
|
}); |
311
|
|
|
|
312
|
|
|
return <>{buttonView}</>; |
313
|
|
|
}; |
314
|
|
|
|
315
|
|
|
return ( |
316
|
|
|
<div data-c-container="medium"> |
317
|
|
|
{!managerView && ( |
318
|
|
|
<> |
319
|
|
|
<h2 |
320
|
|
|
data-c-heading="h2" |
321
|
|
|
data-c-margin={!managerView ? "top(3) bottom(1)" : "bottom(1)"} |
322
|
|
|
> |
323
|
|
|
<FormattedMessage |
324
|
|
|
id="application.review.heading" |
325
|
|
|
defaultMessage="Review Your Application" |
326
|
|
|
description="Main page heading for the Review page." |
327
|
|
|
/> |
328
|
|
|
</h2> |
329
|
|
|
<p data-c-margin="bottom(1)"> |
330
|
|
|
<FormattedMessage |
331
|
|
|
id="application.review.subheadingOne" |
332
|
|
|
defaultMessage="Take one last look at your information before you submit it." |
333
|
|
|
description="First line of the subheading for the Review page." |
334
|
|
|
/> |
335
|
|
|
</p> |
336
|
|
|
<p data-c-margin="bottom(1)"> |
337
|
|
|
<FormattedMessage |
338
|
|
|
id="application.review.subheadingTwo" |
339
|
|
|
defaultMessage="Make sure everything you've said is as honest and accurate as possible." |
340
|
|
|
description="Second line of the subheading for the Review page." |
341
|
|
|
/> |
342
|
|
|
</p> |
343
|
|
|
<p> |
344
|
|
|
<FormattedMessage |
345
|
|
|
id="application.review.subheadingThree" |
346
|
|
|
defaultMessage={`Ask yourself, "If I was a manager, and I knew nothing about the applicant other than this application, would I think they could do a good job?"`} |
347
|
|
|
description="Third line of the subheading for the Review page." |
348
|
|
|
/> |
349
|
|
|
</p> |
350
|
|
|
</> |
351
|
|
|
)} |
352
|
|
|
<div |
353
|
|
|
data-c-grid="gutter(all, 1) middle" |
354
|
|
|
data-c-margin={!managerView ? "top(3) bottom(1)" : "bottom(1)"} |
355
|
|
|
> |
356
|
|
|
<div data-c-grid-item="tp(2of3) tl(4of5)"> |
357
|
|
|
<h3 data-c-font-size="h3"> |
358
|
|
|
{!managerView |
359
|
|
|
? intl.formatMessage(basicInfoMessages.heading) |
360
|
|
|
: intl.formatMessage(managerViewHeaders.basicInfo)} |
361
|
|
|
</h3> |
362
|
|
|
</div> |
363
|
|
|
{!managerView && ( |
364
|
|
|
<div |
365
|
|
|
data-c-grid-item="tp(1of3) tl(1of5)" |
366
|
|
|
data-c-align="base(center) tp(right)" |
367
|
|
|
> |
368
|
|
|
<a |
369
|
|
|
href="https://talent.test/demo/application-02" |
370
|
|
|
title={intl.formatMessage(messages.editTitle)} |
371
|
|
|
data-c-color="c2" |
372
|
|
|
data-c-font-weight="bold" |
373
|
|
|
> |
374
|
|
|
{intl.formatMessage(messages.edit)} |
375
|
|
|
</a> |
376
|
|
|
</div> |
377
|
|
|
)} |
378
|
|
|
</div> |
379
|
|
|
<hr data-c-hr="thin(gray)" data-c-margin="top(1)" /> |
380
|
|
|
<p |
381
|
|
|
data-c-font-weight="bold" |
382
|
|
|
data-c-color="c2" |
383
|
|
|
data-c-margin="top(1) bottom(.5)" |
384
|
|
|
> |
385
|
|
|
{intl.formatMessage(basicInfoMessages.citizenshipLabel)} |
386
|
|
|
</p> |
387
|
|
|
<p> |
388
|
|
|
{application.citizenship_declaration_id |
389
|
|
|
? intl.formatMessage( |
390
|
|
|
citizenshipDeclaration(application.citizenship_declaration_id), |
391
|
|
|
) |
392
|
|
|
: intl.formatMessage(messages.valueNotSet)} |
393
|
|
|
</p> |
394
|
|
|
<p |
395
|
|
|
data-c-font-weight="bold" |
396
|
|
|
data-c-color="c2" |
397
|
|
|
data-c-margin="top(1) bottom(.5)" |
398
|
|
|
> |
399
|
|
|
{intl.formatMessage(basicInfoMessages.veteranStatusLabel)} |
400
|
|
|
</p> |
401
|
|
|
<p> |
402
|
|
|
{application.veteran_status_id |
403
|
|
|
? intl.formatMessage(veteranStatus(application.veteran_status_id)) |
404
|
|
|
: intl.formatMessage(messages.valueNotSet)} |
405
|
|
|
</p> |
406
|
|
|
<p |
407
|
|
|
data-c-font-weight="bold" |
408
|
|
|
data-c-color="c2" |
409
|
|
|
data-c-margin="top(1) bottom(.5)" |
410
|
|
|
> |
411
|
|
|
{intl.formatMessage(basicInfoMessages.languageRequirementsHeading)} |
412
|
|
|
</p> |
413
|
|
|
<p data-c-margin="bottom(.5)"> |
414
|
|
|
{job.language_requirement_id && |
415
|
|
|
intl.formatMessage( |
416
|
|
|
languageRequirementDescription(job.language_requirement_id), |
417
|
|
|
)} |
418
|
|
|
</p> |
419
|
|
|
{job.language_requirement_id && |
420
|
|
|
application.language_requirement_confirmed && ( |
421
|
|
|
<p data-c-margin="bottom(.5)"> |
422
|
|
|
<i |
423
|
|
|
className="fas fa-check" |
424
|
|
|
data-c-color="go" |
425
|
|
|
data-c-margin="right(.25)" |
426
|
|
|
/> |
427
|
|
|
{intl.formatMessage( |
428
|
|
|
languageRequirementLabel(job.language_requirement_id), |
429
|
|
|
)} |
430
|
|
|
</p> |
431
|
|
|
)} |
432
|
|
|
{(job.language_requirement_id === |
433
|
|
|
LanguageRequirementId.bilingualIntermediate || |
434
|
|
|
job.language_requirement_id === |
435
|
|
|
LanguageRequirementId.bilingualAdvanced) && |
436
|
|
|
application.language_test_confirmed && ( |
437
|
|
|
<p> |
438
|
|
|
<i |
439
|
|
|
className="fas fa-check" |
440
|
|
|
data-c-color="go" |
441
|
|
|
data-c-margin="right(.25)" |
442
|
|
|
/> |
443
|
|
|
{intl.formatMessage(defaultBasicMessages.languageTestLabel)} |
444
|
|
|
</p> |
445
|
|
|
)} |
446
|
|
|
<div data-c-grid="gutter(all, 1) middle" data-c-padding="top(3)"> |
447
|
|
|
<div data-c-grid-item="tp(2of3) tl(4of5)"> |
448
|
|
|
<h3 data-c-font-size="h3"> |
449
|
|
|
{!managerView |
450
|
|
|
? intl.formatMessage(experienceMessages.heading) |
451
|
|
|
: intl.formatMessage(managerViewHeaders.experience)} |
452
|
|
|
</h3> |
453
|
|
|
</div> |
454
|
|
|
{!managerView && ( |
455
|
|
|
<div |
456
|
|
|
data-c-grid-item="tp(1of3) tl(1of5)" |
457
|
|
|
data-c-align="base(center) tp(right)" |
458
|
|
|
> |
459
|
|
|
<a |
460
|
|
|
href="https://talent.test/demo/application-04" |
461
|
|
|
title={intl.formatMessage(messages.editTitle)} |
462
|
|
|
data-c-color="c2" |
463
|
|
|
data-c-font-weight="bold" |
464
|
|
|
> |
465
|
|
|
{intl.formatMessage(messages.edit)} |
466
|
|
|
</a> |
467
|
|
|
</div> |
468
|
|
|
)} |
469
|
|
|
</div> |
470
|
|
|
<hr data-c-hr="thin(gray)" data-c-margin="tb(1)" /> |
471
|
|
|
<p data-c-padding="bottom(.5)" data-c-font-weight="bold"> |
472
|
|
|
<FormattedMessage |
473
|
|
|
id="application.review.changeViewHeading" |
474
|
|
|
defaultMessage="Change Your View:" |
475
|
|
|
description="Heading for the Review section with the buttons to change the layout." |
476
|
|
|
/> |
477
|
|
|
</p> |
478
|
|
|
<div data-c-padding="bottom(1)"> |
479
|
|
|
{experienceViewButtons(experienceViewButtonOrder)} |
480
|
|
|
</div> |
481
|
|
|
{experienceView === "experience" && ( |
482
|
|
|
<div className="experience-list"> |
483
|
|
|
<p data-c-margin="bottom(1)"> |
484
|
|
|
<FormattedMessage |
485
|
|
|
id="application.review.experienceViewHeading" |
486
|
|
|
defaultMessage="This view is a summary of all the experiences you will be sending as a part of your application." |
487
|
|
|
description="Heading for the experience view section of the Review page." |
488
|
|
|
/> |
489
|
|
|
</p> |
490
|
|
|
<div data-c-accordion-group=""> |
491
|
|
|
{experiences.map((experience) => { |
492
|
|
|
const irrelevantSkillCount = getIrrelevantSkillCount( |
493
|
|
|
criteria, |
494
|
|
|
experience, |
495
|
|
|
experienceSkills, |
496
|
|
|
); |
497
|
|
|
const relevantSkills = experienceSkills.filter( |
498
|
|
|
(experienceSkill) => |
499
|
|
|
experienceSkill.experience_type === experience.type && |
500
|
|
|
experienceSkill.experience_id === experience.id, |
501
|
|
|
); |
502
|
|
|
return ( |
503
|
|
|
<ExperienceAccordion |
504
|
|
|
key={`${experience.type}-${experience.id}`} |
505
|
|
|
experience={experience} |
506
|
|
|
experienceSkills={relevantSkills} |
507
|
|
|
skills={skills} |
508
|
|
|
irrelevantSkillCount={irrelevantSkillCount} |
509
|
|
|
/> |
510
|
|
|
); |
511
|
|
|
})} |
512
|
|
|
</div> |
513
|
|
|
</div> |
514
|
|
|
)} |
515
|
|
|
{experienceView === "skills" && ( |
516
|
|
|
<div className="experience-list"> |
517
|
|
|
<p data-c-margin="bottom(1)"> |
518
|
|
|
<FormattedMessage |
519
|
|
|
id="application.review.skillsViewHeading" |
520
|
|
|
defaultMessage="This view organizes your experiences by the skills required for this job." |
521
|
|
|
description="Heading for the skills view section of the Review page." |
522
|
|
|
/> |
523
|
|
|
</p> |
524
|
|
|
<div data-c-accordion-group=""> |
525
|
|
|
{criteria.map((criterion) => { |
526
|
|
|
const skillOfCriterion = getSkillOfCriteria(criterion, skills); |
527
|
|
|
|
528
|
|
|
if (skillOfCriterion !== null) { |
529
|
|
|
const skillLevel = intl.formatMessage( |
530
|
|
|
getSkillLevelName(criterion, skillOfCriterion), |
531
|
|
|
); |
532
|
|
|
|
533
|
|
|
const experiencesOfCriterion = experienceSkills.filter( |
534
|
|
|
(experienceSkill) => |
535
|
|
|
experienceSkill.skill_id === criterion.skill_id, |
536
|
|
|
); |
537
|
|
|
|
538
|
|
|
const relevantExperiences = experiences.filter((experience) => |
539
|
|
|
experiencesOfCriterion.some( |
540
|
|
|
(experienceSkill) => |
541
|
|
|
experienceSkill.experience_id === experience.id && |
542
|
|
|
experienceSkill.experience_type === experience.type, |
543
|
|
|
), |
544
|
|
|
); |
545
|
|
|
|
546
|
|
|
return ( |
547
|
|
|
<SkillAccordion |
548
|
|
|
key={criterion.id} |
549
|
|
|
skill={skillOfCriterion} |
550
|
|
|
skillLevel={skillLevel} |
551
|
|
|
experiences={relevantExperiences} |
552
|
|
|
experienceSkills={experiencesOfCriterion} |
553
|
|
|
/> |
554
|
|
|
); |
555
|
|
|
} |
556
|
|
|
return null; |
557
|
|
|
})} |
558
|
|
|
</div> |
559
|
|
|
</div> |
560
|
|
|
)} |
561
|
|
|
{experienceView === "education" && ( |
562
|
|
|
<div className="experience-list"> |
563
|
|
|
<p data-c-margin="bottom(1)"> |
564
|
|
|
<FormattedMessage |
565
|
|
|
id="application.review.educationViewHeading" |
566
|
|
|
defaultMessage="This view is a summary of all the experiences you have selected that help you meet the education requirements outlined below." |
567
|
|
|
description="Heading for the education view section of the Review page." |
568
|
|
|
/> |
569
|
|
|
</p> |
570
|
|
|
<div |
571
|
|
|
data-c-background="gray(20)" |
572
|
|
|
data-c-radius="rounded" |
573
|
|
|
data-c-padding="all(1)" |
574
|
|
|
data-c-margin="bottom(1)" |
575
|
|
|
> |
576
|
|
|
<p>{localizeField(locale, job, "education")}</p> |
577
|
|
|
</div> |
578
|
|
|
<div data-c-accordion-group=""> |
579
|
|
|
{experiences |
580
|
|
|
.filter((experience) => experience.is_education_requirement) |
581
|
|
|
.map((educationExperience) => { |
582
|
|
|
const irrelevantSkillCount = getIrrelevantSkillCount( |
583
|
|
|
criteria, |
584
|
|
|
educationExperience, |
585
|
|
|
experienceSkills, |
586
|
|
|
); |
587
|
|
|
const relevantSkills = experienceSkills.filter( |
588
|
|
|
(experienceSkill) => |
589
|
|
|
experienceSkill.experience_type === |
590
|
|
|
educationExperience.type && |
591
|
|
|
experienceSkill.experience_id === educationExperience.id, |
592
|
|
|
); |
593
|
|
|
return ( |
594
|
|
|
<ExperienceAccordion |
595
|
|
|
key={`${educationExperience.type}-${educationExperience.id}-edu`} |
596
|
|
|
experience={educationExperience} |
597
|
|
|
experienceSkills={relevantSkills} |
598
|
|
|
skills={skills} |
599
|
|
|
irrelevantSkillCount={irrelevantSkillCount} |
600
|
|
|
/> |
601
|
|
|
); |
602
|
|
|
})} |
603
|
|
|
</div> |
604
|
|
|
</div> |
605
|
|
|
)} |
606
|
|
|
<div data-c-grid="gutter(all, 1) middle" data-c-padding="top(3)"> |
607
|
|
|
<div data-c-grid-item="tp(2of3) tl(4of5)"> |
608
|
|
|
<h3 data-c-font-size="h3"> |
609
|
|
|
{!managerView |
610
|
|
|
? intl.formatMessage(fitMessages.heading) |
611
|
|
|
: intl.formatMessage(managerViewHeaders.fit)} |
612
|
|
|
</h3> |
613
|
|
|
</div> |
614
|
|
|
{!managerView && ( |
615
|
|
|
<div |
616
|
|
|
data-c-grid-item="tp(1of3) tl(1of5)" |
617
|
|
|
data-c-align="base(center) tp(right)" |
618
|
|
|
> |
619
|
|
|
<a |
620
|
|
|
href="https://talent.test/demo/application-07" |
621
|
|
|
title={intl.formatMessage(messages.editTitle)} |
622
|
|
|
data-c-color="c2" |
623
|
|
|
data-c-font-weight="bold" |
624
|
|
|
> |
625
|
|
|
{intl.formatMessage(messages.edit)} |
626
|
|
|
</a> |
627
|
|
|
</div> |
628
|
|
|
)} |
629
|
|
|
</div> |
630
|
|
|
<hr data-c-hr="thin(gray)" data-c-margin="top(1)" /> |
631
|
|
|
{jobQuestions.map((jobQuestion, index) => { |
632
|
|
|
const answer = jobApplicationAnswers.find( |
633
|
|
|
(appAnswer) => appAnswer.job_poster_question_id === jobQuestion.id, |
634
|
|
|
); |
635
|
|
|
return ( |
636
|
|
|
<> |
637
|
|
|
<p |
638
|
|
|
data-c-font-weight="bold" |
639
|
|
|
data-c-color="c2" |
640
|
|
|
data-c-margin="top(1) bottom(.5)" |
641
|
|
|
> |
642
|
|
|
{intl.formatMessage(fitMessages.questionLabel, { |
643
|
|
|
index: index + 1, |
644
|
|
|
})}{" "} |
645
|
|
|
{localizeField(locale, jobQuestion, "question")} |
646
|
|
|
</p> |
647
|
|
|
<p> |
648
|
|
|
{answer ? ( |
649
|
|
|
answer.answer |
650
|
|
|
) : ( |
651
|
|
|
<FormattedMessage |
652
|
|
|
id="application.review.missingAnswer" |
653
|
|
|
defaultMessage="Not yet answered." |
654
|
|
|
description="Message displayed if the applicant did not yet answer one of the Fit questions." |
655
|
|
|
/> |
656
|
|
|
)} |
657
|
|
|
</p> |
658
|
|
|
</> |
659
|
|
|
); |
660
|
|
|
})} |
661
|
|
|
<div data-c-grid="gutter(all, 1) middle" data-c-padding="top(3)"> |
662
|
|
|
<div data-c-grid-item="tp(2of3) tl(4of5)"> |
663
|
|
|
<h3 data-c-font-size="h3"> |
664
|
|
|
{!managerView ? ( |
665
|
|
|
<FormattedMessage |
666
|
|
|
id="application.review.accountSettingsHeading" |
667
|
|
|
defaultMessage="My Account Settings" |
668
|
|
|
/> |
669
|
|
|
) : ( |
670
|
|
|
intl.formatMessage(managerViewHeaders.accountSettings) |
671
|
|
|
)} |
672
|
|
|
</h3> |
673
|
|
|
</div> |
674
|
|
|
{!managerView && ( |
675
|
|
|
<div |
676
|
|
|
data-c-grid-item="tp(1of3) tl(1of5)" |
677
|
|
|
data-c-align="base(center) tp(right)" |
678
|
|
|
> |
679
|
|
|
<a |
680
|
|
|
href="https://talent.test/demo/application-07" // To |
681
|
|
|
title={intl.formatMessage(messages.editTitle)} |
682
|
|
|
data-c-color="c2" |
683
|
|
|
data-c-font-weight="bold" |
684
|
|
|
> |
685
|
|
|
{intl.formatMessage(messages.edit)} |
686
|
|
|
</a> |
687
|
|
|
</div> |
688
|
|
|
)} |
689
|
|
|
</div> |
690
|
|
|
<hr data-c-hr="thin(gray)" data-c-margin="top(1)" /> |
691
|
|
|
<p |
692
|
|
|
data-c-font-weight="bold" |
693
|
|
|
data-c-color="c2" |
694
|
|
|
data-c-margin="top(1) bottom(.5)" |
695
|
|
|
> |
696
|
|
|
<FormattedMessage |
697
|
|
|
id="application.review.contactLabel" |
698
|
|
|
defaultMessage="Contact & Communication" |
699
|
|
|
/> |
700
|
|
|
</p> |
701
|
|
|
{user.contact_language === "en" && ( |
702
|
|
|
<p data-c-margin="bottom(.5)"> |
703
|
|
|
<i |
704
|
|
|
className="fas fa-check" |
705
|
|
|
data-c-color="go" |
706
|
|
|
data-c-margin="right(.25)" |
707
|
|
|
/> |
708
|
|
|
{intl.formatMessage(messages.communicationEn)} |
709
|
|
|
</p> |
710
|
|
|
)} |
711
|
|
|
{user.contact_language === "fr" && ( |
712
|
|
|
<p data-c-margin="bottom(.5)"> |
713
|
|
|
<i |
714
|
|
|
className="fas fa-check" |
715
|
|
|
data-c-color="go" |
716
|
|
|
data-c-margin="right(.25)" |
717
|
|
|
/> |
718
|
|
|
{intl.formatMessage(messages.communicationFr)} |
719
|
|
|
</p> |
720
|
|
|
)} |
721
|
|
|
{user.contact_language !== "en" && user.contact_language !== "fr" && ( |
722
|
|
|
<p data-c-margin="bottom(.5)"> |
723
|
|
|
<i |
724
|
|
|
className="fas fa-times" |
725
|
|
|
data-c-color="stop" |
726
|
|
|
data-c-margin="right(.25)" |
727
|
|
|
/> |
728
|
|
|
{intl.formatMessage(messages.communicationNotSet)} |
729
|
|
|
</p> |
730
|
|
|
)} |
731
|
|
|
<p data-c-margin={!managerView ? "bottom(.5)" : "bottom(2)"}> |
732
|
|
|
<i |
733
|
|
|
className={`fas fa-${user.job_alerts ? "check" : "times"}`} |
734
|
|
|
data-c-color={user.job_alerts ? "go" : "stop"} |
735
|
|
|
data-c-margin={`right(.${user.job_alerts ? "25" : "5"})`} |
736
|
|
|
/> |
737
|
|
|
{user.job_alerts ? ( |
738
|
|
|
<FormattedMessage |
739
|
|
|
id="application.review.userContact" |
740
|
|
|
defaultMessage="I would like Talent Cloud to contact me at {email} about related jobs." |
741
|
|
|
values={{ |
742
|
|
|
email: user.email, |
743
|
|
|
}} |
744
|
|
|
/> |
745
|
|
|
) : ( |
746
|
|
|
<FormattedMessage |
747
|
|
|
id="application.review.userNoContact" |
748
|
|
|
defaultMessage="I do not want Talent Cloud to contact me at {email} about related jobs." |
749
|
|
|
values={{ |
750
|
|
|
email: user.email, |
751
|
|
|
}} |
752
|
|
|
/> |
753
|
|
|
)} |
754
|
|
|
</p> |
755
|
|
|
{children} |
756
|
|
|
</div> |
757
|
|
|
); |
758
|
|
|
}; |
759
|
|
|
|
760
|
|
|
export default ApplicationPreview; |
761
|
|
|
|