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