Passed
Push — feature/add-2fa-support ( 23e818...85b1f3 )
by Chris
24:19 queued 11:16
created

resources/assets/js/models/localizedConstants.tsx   A

Complexity

Total Complexity 6
Complexity/F 0

Size

Lines of Code 792
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 646
dl 0
loc 792
rs 9.954
c 0
b 0
f 0
wmc 6
mnd 6
bc 6
fnc 0
bpm 0
cpm 0
noi 0
1
import { defineMessages, MessageDescriptor } from "react-intl";
2
import {
3
  AssessmentTypeId,
4
  AssessmentTypeIdValues,
5
  CriteriaTypeId,
6
  CriteriaTypeIdValues,
7
  SkillLevelId,
8
  SkillLevelIdValues,
9
  SkillTypeId,
10
  SkillTypeIdValues,
11
  ProvinceId,
12
  SecurityClearanceId,
13
  LanguageRequirementId,
14
  DepartmentId,
15
  FrequencyId,
16
  OvertimeRequirementId,
17
  TravelRequirementId,
18
} from "./lookupConstants";
19
import { getOrThrowError } from "../helpers/queries";
20
21
const skillLevelDescriptions = defineMessages({
22
  hardBasic: {
23
    id: "skillLevel.hard.basic.description",
24
    defaultMessage:
25
      "You have the ability to accomplish basic tasks with steady supervision and clear direction. The tasks you’re assigned are clear and don’t involve significant complexity. Their impact is usually locally felt. As you advance in this category, you should be developing the ability to accomplish tasks of moderate complexity with steady supervision. You will also need to be able to accomplish basic tasks with little or no supervision. This level is usually associated with tasks that form the bulk of the work for lower level positions, such as junior analysts or entry level developers.",
26
    description: "Description of basic hard skill level.",
27
  },
28
  hardIntermediate: {
29
    id: "skillLevel.hard.intermediate.description",
30
    defaultMessage:
31
      "You have the ability to accomplish tasks of moderate complexity or moderate impact with supervision. The approach to the tasks, and how they are delivered, is determined by the supervisor. You contribute input and advice. You are able to advance the task, even in the face of small to moderate hurdles and complications. As you advance in this category, you should be developing the ability to accomplish tasks of significant complexity or larger impact with steady supervision. You will also need to be able to accomplish tasks of moderate complexity or impact with little or no supervision. This level is usually associated with tasks that form the bulk of the work for mid-level positions, such as analysts or developers.",
32
    description: "Description of intermediate skill level.",
33
  },
34
  hardAdvanced: {
35
    id: "skillLevel.hard.advanced.description",
36
    defaultMessage:
37
      "You have the ability to accomplish tasks of significant complexity or impact with supervision. You provide advice and input on the approach to the tasks, and how they are delivered, for the supervisor’s consideration. You are able to advance the task, even in the face of moderate to large hurdles and complications. As you advance in this category, you should be developing the ability to accomplish tasks of significant complexity or larger impact with only light levels of supervision, where you are effectively the lead on the initiative. You may also take on a role of training others in this skills set or take on a light supervisory role for those at lower levels. This level is usually associated with tasks that form the bulk of the work for higher level positions, such as senior analysts or senior developers.",
38
    description: "Description of advanced hard skill level.",
39
  },
40
  hardExpert: {
41
    id: "skillLevel.hard.expert.description",
42
    defaultMessage:
43
      "You have the ability to accomplish tasks of significant complexity or impact, where you call the shots and answer to the organization’s senior management for your decisions. You bring forward the tasks, the approach and the delivery plan for senior management consideration. You often supervise others (individuals or teams) in delivering tasks of high complexity or system wide impact. You are able to advance these tasks, even in the face of significant unforeseen hurdles and complications. As you advance in this category, you should be developing the ability to assess others at more junior levels, becoming able to clearly identify the difference between beginner, intermediate and advanced tasks. You should be able to build teams, set direction and provide supervision. This level is usually associated with tasks that form the bulk of the work for management and executive level positions.",
44
    description: "Description of expert hard skill level.",
45
  },
46
  softBasic: {
47
    id: "skillLevel.soft.basic.description",
48
    defaultMessage:
49
      "You’re working on acquiring this skill or attribute. You are able to demonstrate it under favourable conditions (low stress, minimal difficulty) and can apply it in a work context intermittently.",
50
    description: "Description of soft basic skill level.",
51
  },
52
  softIntermediate: {
53
    id: "skillLevel.soft.intermediate.description",
54
    defaultMessage:
55
      "You’re able to consistently demonstrate this skill or attribute in the workplace, including under conditions of low-to-moderate stress or difficulty. Your peers and supervisors are able to attest to the fact that you have been able to demonstrate this skill or attribute on a regular basis.",
56
    description: "Description of soft intermediate skill level.",
57
  },
58
  softAdvanced: {
59
    id: "skillLevel.soft.advanced.description",
60
    defaultMessage:
61
      "You’re able to consistently demonstrate this skill or attribute in the workplace, including under conditions of high stress or difficulty. Your peers and supervisors recognize this as a strength you demonstrate in the workplace.",
62
    description: "Description of soft advanced skill level.",
63
  },
64
  softExpert: {
65
    id: "skillLevel.soft.expert.description",
66
    defaultMessage:
67
      "This is a foundational part of who you are. You consistently demonstrate this skill or attribute, even under conditions of extreme stress or difficulty. Your peers and supervisors recognize this as a significant strength you demonstrate in the workplace, providing an example to others.",
68
    description: "Description of expert soft skill level.",
69
  },
70
  asset: {
71
    id: "skillLevel.asset.description",
72
    defaultMessage:
73
      "This skill isn't required for the employee to do the job, but it provides an added benefit to their skillset and will improve the speed or effectiveness of their work.",
74
    description: "Description of what it means to be an 'Asset' skill.",
75
  },
76
});
77
78
const skillLevelNames = defineMessages({
79
  hardBasic: {
80
    id: "skillLevel.hard.basic.name",
81
    defaultMessage: "Beginner",
82
    description: "Single-word descriptor of basic hard skill level.",
83
  },
84
  hardIntermediate: {
85
    id: "skillLevel.hard.intermediate.name",
86
    defaultMessage: "Intermediate",
87
    description: "Single-word descriptor of intermediate hard skill level.",
88
  },
89
  hardAdvanced: {
90
    id: "skillLevel.hard.advanced.name",
91
    defaultMessage: "Advanced",
92
    description: "Single-word descriptor of advanced hard skill level.",
93
  },
94
  hardExpert: {
95
    id: "skillLevel.hard.expert.name",
96
    defaultMessage: "Expert",
97
    description: "Single-word descriptor of expert hard skill level.",
98
  },
99
  softBasic: {
100
    id: "skillLevel.soft.basic.name",
101
    defaultMessage: "In Early Development",
102
    description: "Single-word descriptor of soft basic skill level.",
103
  },
104
  softIntermediate: {
105
    id: "skillLevel.soft.intermediate.name",
106
    defaultMessage: "Moderately in Evidence",
107
    description: "Single-word descriptor of soft intermediate skill level.",
108
  },
109
  softAdvanced: {
110
    id: "skillLevel.soft.advanced.name",
111
    defaultMessage: "Strongly in Evidence",
112
    description: "Single-word descriptor of soft advanced skill level.",
113
  },
114
  softExpert: {
115
    id: "skillLevel.soft.expert.name",
116
    defaultMessage: "Deep Level Demonstration",
117
    description: "Single-word descriptor of soft expert skill level.",
118
  },
119
  asset: {
120
    id: "skillLevel.asset.name",
121
    defaultMessage: "Asset / No Level Required",
122
    description: "Name for 'Asset' skills.",
123
  },
124
});
125
126
const skillLevelL10n = (
127
  skillLevelId: number,
128
  skillTypeId: number,
129
  l10nObj: Record<
130
    string,
131
    {
132
      id: string;
133
      defaultMessage: string;
134
      description: string;
135
    }
136
  >,
137
): MessageDescriptor => {
138
  if (!SkillLevelIdValues.includes(skillLevelId)) {
139
    throw new Error("invalid SkillLevelIdValue");
140
  }
141
  if (!SkillTypeIdValues.includes(skillTypeId)) {
142
    throw new Error("invalid SkillTypeIdValue");
143
  }
144
  const basicKey = SkillLevelId.Basic.toString();
145
  const intermediateKey = SkillLevelId.Intermediate.toString();
146
  const advancedKey = SkillLevelId.Advanced.toString();
147
  const expertKey = SkillLevelId.Expert.toString();
148
  return {
149
    [SkillTypeId.Hard.toString()]: {
150
      [basicKey]: l10nObj.hardBasic,
151
      [intermediateKey]: l10nObj.hardIntermediate,
152
      [advancedKey]: l10nObj.hardAdvanced,
153
      [expertKey]: l10nObj.hardExpert,
154
    },
155
    [SkillTypeId.Soft.toString()]: {
156
      [basicKey]: l10nObj.softBasic,
157
      [intermediateKey]: l10nObj.softIntermediate,
158
      [advancedKey]: l10nObj.softAdvanced,
159
      [expertKey]: l10nObj.softExpert,
160
    },
161
  }[skillTypeId.toString()][skillLevelId.toString()];
162
};
163
164
export const skillLevelDescription = (
165
  skillLevelId: number,
166
  skillTypeId: number,
167
): MessageDescriptor =>
168
  skillLevelL10n(skillLevelId, skillTypeId, skillLevelDescriptions);
169
170
export const skillLevelName = (
171
  skillLevelId: number,
172
  skillTypeId: number,
173
): MessageDescriptor =>
174
  skillLevelL10n(skillLevelId, skillTypeId, skillLevelNames);
175
176
const assessmentTypes = defineMessages({
177
  narrativeAssessment: {
178
    id: "assessmentType.narrativeAssessment",
179
    defaultMessage: "Narrative Review",
180
    description: "Title of an assessment type.",
181
  },
182
  applicationScreeningQuestion: {
183
    id: "assessmentType.applicationScreeningQuestion",
184
    defaultMessage: "Application Screening Question",
185
    description: "Title of an assessment type.",
186
  },
187
  groupTest: {
188
    id: "assessmentType.groupTest",
189
    defaultMessage: "Group Test",
190
    description: "Title of an assessment type.",
191
  },
192
  informalPhoneConversation: {
193
    id: "assessmentType.informalPhoneConversation",
194
    defaultMessage: "Informal Phone Conversation",
195
    description: "Title of an assessment type.",
196
  },
197
  interview: {
198
    id: "assessmentType.interview",
199
    defaultMessage: "Interview",
200
    description: "Title of an assessment type.",
201
  },
202
  onlineExam: {
203
    id: "assessmentType.onlineExam",
204
    defaultMessage: "Online Exam",
205
    description: "Title of an assessment type.",
206
  },
207
  onSiteExam: {
208
    id: "assessmentType.onSiteExam",
209
    defaultMessage: "On-Site Exam",
210
    description: "Title of an assessment type.",
211
  },
212
  takeHomeExam: {
213
    id: "assessmentType.takeHomeExam",
214
    defaultMessage: "Take Home Exam",
215
    description: "Title of an assessment type.",
216
  },
217
  portfolioReview: {
218
    id: "assessmentType.portfolioReview",
219
    defaultMessage: "Portfolio Review",
220
    description: "Title of an assessment type.",
221
  },
222
  referenceCheck: {
223
    id: "assessmentType.referenceCheck",
224
    defaultMessage: "Reference Check",
225
    description: "Title of an assessment type.",
226
  },
227
  seriousGames: {
228
    id: "assessmentType.seriousGames",
229
    defaultMessage: "Serious Games",
230
    description: "Title of an assessment type.",
231
  },
232
});
233
234
export const assetSkillName = (): MessageDescriptor => skillLevelNames.asset;
235
export const assetSkillDescription = (): MessageDescriptor =>
236
  skillLevelDescriptions.asset;
237
238
export const assessmentType = (assessmentTypeId: number): MessageDescriptor => {
239
  if (!AssessmentTypeIdValues.includes(assessmentTypeId)) {
240
    throw new Error("invalid AssessmentTypeValue");
241
  }
242
  return {
243
    [AssessmentTypeId.ApplicationScreeningQuestion]:
244
      assessmentTypes.applicationScreeningQuestion,
245
    [AssessmentTypeId.GroupTest]: assessmentTypes.groupTest,
246
    [AssessmentTypeId.InformalPhoneConversation]:
247
      assessmentTypes.informalPhoneConversation,
248
    [AssessmentTypeId.Interview]: assessmentTypes.interview,
249
    [AssessmentTypeId.NarrativeAssessment]: assessmentTypes.narrativeAssessment,
250
    [AssessmentTypeId.OnSiteExam]: assessmentTypes.onSiteExam,
251
    [AssessmentTypeId.OnlineExam]: assessmentTypes.onlineExam,
252
    [AssessmentTypeId.PortfolioReview]: assessmentTypes.portfolioReview,
253
    [AssessmentTypeId.ReferenceCheck]: assessmentTypes.referenceCheck,
254
    [AssessmentTypeId.SeriousGames]: assessmentTypes.seriousGames,
255
    [AssessmentTypeId.TakeHomeExam]: assessmentTypes.takeHomeExam,
256
  }[assessmentTypeId.toString()];
257
};
258
259
const criteriaTypes = defineMessages({
260
  asset: {
261
    id: "criteriaType.asset",
262
    defaultMessage: "Asset",
263
    description: "Title of an asset criteria type.",
264
  },
265
  essential: {
266
    id: "criteriaType.essential",
267
    defaultMessage: "Essential",
268
    description: "Title of an esential criteria type.",
269
  },
270
});
271
272
export const criteriaType = (criteriaTypeId: number): MessageDescriptor => {
273
  if (!CriteriaTypeIdValues.includes(criteriaTypeId)) {
274
    throw new Error("invalid CriteriaTypeValue");
275
  }
276
  return {
277
    [CriteriaTypeId.Asset]: criteriaTypes.asset,
278
    [CriteriaTypeId.Essential]: criteriaTypes.essential,
279
  }[criteriaTypeId.toString()];
280
};
281
282
const assessmentTypeDescriptions = defineMessages({
283
  narrativeAssessment: {
284
    id: "assessmentType.narrativeAssessment.description",
285
    defaultMessage:
286
      "This is a description requested during the application process, in which applicants to self-identify and describe their experience and level of expertise with a skill.",
287
    description:
288
      "Description of an assessment type, to help a manager understand when to use it.",
289
  },
290
  applicationScreeningQuestion: {
291
    id: "assessmentType.applicationScreeningQuestion.description",
292
    defaultMessage:
293
      "These questions appear in the application form, and are submitted through Talent Cloud, they allow a first glance at the applicant’s understanding, process, knowledge, or cultural fit for the position.",
294
    description:
295
      "Description of an assessment type, to help a manager understand when to use it.",
296
  },
297
  groupTest: {
298
    id: "assessmentType.groupTest.description",
299
    defaultMessage:
300
      "Applicants perform this test in real-time in conjunction with other applicants, team members, or facilitators, to determine their skill prowess, team communication, and performance in a collaborative environment.",
301
    description:
302
      "Description of an assessment type, to help a manager understand when to use it.",
303
  },
304
  informalPhoneConversation: {
305
    id: "assessmentType.informalPhoneConversation.description",
306
    defaultMessage:
307
      "A loose structure chat between a member of the hiring board and an applicant, aimed at discovering the applicant’s knowledge, aptitudes, or personality traits, conversations may vary between applicants.",
308
    description:
309
      "Description of an assessment type, to help a manager understand when to use it.",
310
  },
311
  interview: {
312
    id: "assessmentType.interview.description",
313
    defaultMessage:
314
      "A formal question-and-answer examination performed in real-time between the hiring-board and an applicant. Questions are aimed at assessing skill expertise, level, and approach. Each question is crafted beforehand and follows the same structure between all interviewed applicants.",
315
    description:
316
      "Description of an assessment type, to help a manager understand when to use it.",
317
  },
318
  onlineExam: {
319
    id: "assessmentType.onlineExam.description",
320
    defaultMessage:
321
      "Prepared examination that does not require supervision, and can be performed from any location through internet access, with a defined time-frame for completion.",
322
    description:
323
      "Description of an assessment type, to help a manager understand when to use it.",
324
  },
325
  onSiteExam: {
326
    id: "assessmentType.onSiteExam.description",
327
    defaultMessage:
328
      "Prepared examination that requires the applicant to perform a test at a specific location under supervision, aimed at assessing skill expertise and technique.",
329
    description:
330
      "Description of an assessment type, to help a manager understand when to use it.",
331
  },
332
  takeHomeExam: {
333
    id: "assessmentType.takeHomeExam.description",
334
    defaultMessage:
335
      "Applicants receive a physical package containing the assessment tools, they complete the assessment at their own leisure and at their preferred location without supervision, and must return the materials before a specific deadline.",
336
    description:
337
      "Description of an assessment type, to help a manager understand when to use it.",
338
  },
339
  portfolioReview: {
340
    id: "assessmentType.portfolioReview.description",
341
    defaultMessage:
342
      "During the application process, applicants provide access to samples of their work to exhibit their skill level, and back-up their skill claims. ",
343
    description:
344
      "Description of an assessment type, to help a manager understand when to use it.",
345
  },
346
  referenceCheck: {
347
    id: "assessmentType.referenceCheck.description",
348
    defaultMessage:
349
      "During the application process, applicants provide contact information to an acquaintance who can validate and confirm their skill expertise, knowledge or aptitude.",
350
    description:
351
      "Description of an assessment type, to help a manager understand when to use it.",
352
  },
353
  seriousGames: {
354
    id: "assessmentType.seriousGames.description",
355
    defaultMessage:
356
      "Test involving the use of games to explore a candidate’s communication skills, resilience, emotional intelligence, among many other soft skills.",
357
    description:
358
      "Description of an assessment type, to help a manager understand when to use it.",
359
  },
360
});
361
362
export const assessmentTypeDescription = (
363
  assessmentTypeId: number,
364
): MessageDescriptor => {
365
  if (!AssessmentTypeIdValues.includes(assessmentTypeId)) {
366
    throw new Error("invalid AssessmentTypeValue");
367
  }
368
  return {
369
    [AssessmentTypeId.ApplicationScreeningQuestion]:
370
      assessmentTypeDescriptions.applicationScreeningQuestion,
371
    [AssessmentTypeId.GroupTest]: assessmentTypeDescriptions.groupTest,
372
    [AssessmentTypeId.InformalPhoneConversation]:
373
      assessmentTypeDescriptions.informalPhoneConversation,
374
    [AssessmentTypeId.Interview]: assessmentTypeDescriptions.interview,
375
    [AssessmentTypeId.NarrativeAssessment]:
376
      assessmentTypeDescriptions.narrativeAssessment,
377
    [AssessmentTypeId.OnSiteExam]: assessmentTypeDescriptions.onSiteExam,
378
    [AssessmentTypeId.OnlineExam]: assessmentTypeDescriptions.onlineExam,
379
    [AssessmentTypeId.PortfolioReview]:
380
      assessmentTypeDescriptions.portfolioReview,
381
    [AssessmentTypeId.ReferenceCheck]:
382
      assessmentTypeDescriptions.referenceCheck,
383
    [AssessmentTypeId.SeriousGames]: assessmentTypeDescriptions.seriousGames,
384
    [AssessmentTypeId.TakeHomeExam]: assessmentTypeDescriptions.takeHomeExam,
385
  }[assessmentTypeId];
386
};
387
388
const standardAssessmentText = defineMessages({
389
  narrativeReviewQuestion: {
390
    id: "assessmentType.narrativeReview.standardQuestion",
391
    defaultMessage:
392
      "Narrative Review of skill includes all descriptions added by the applicant in their application.",
393
    description:
394
      "Description which replaces 'interview question' for the Narrative Review assessment type.",
395
  },
396
  narrativeReviewAnswer: {
397
    id: "assessmentType.narrativeReview.standardAnswer",
398
    defaultMessage:
399
      "The provided description contains sufficient evidence to advance this candidate to the next screening steps.",
400
    description:
401
      "Standard evalutation statement which replaces 'expected answer' for all skills under the Narrative Review assessment type.",
402
  },
403
});
404
405
const provinceNames = defineMessages({
406
  [ProvinceId.AB]: {
407
    id: "province.ab",
408
    defaultMessage: "Alberta",
409
  },
410
  [ProvinceId.BC]: {
411
    id: "province.bc",
412
    defaultMessage: "British Columbia",
413
  },
414
  [ProvinceId.MB]: {
415
    id: "province.mb",
416
    defaultMessage: "Manitoba",
417
  },
418
  [ProvinceId.NL]: {
419
    id: "province.nl",
420
    defaultMessage: "Newfoundland and Labrador",
421
  },
422
  [ProvinceId.NB]: {
423
    id: "province.nb",
424
    defaultMessage: "New Brunswick",
425
  },
426
  [ProvinceId.NS]: {
427
    id: "province.ns",
428
    defaultMessage: "Nova Scotia",
429
  },
430
  [ProvinceId.NU]: {
431
    id: "province.nu",
432
    defaultMessage: "Nunavut",
433
  },
434
  [ProvinceId.NT]: {
435
    id: "province.nt",
436
    defaultMessage: "Northwest Territories",
437
  },
438
  [ProvinceId.ON]: {
439
    id: "province.on",
440
    defaultMessage: "Ontario",
441
  },
442
  [ProvinceId.PE]: {
443
    id: "province.pe",
444
    defaultMessage: "Prince Edward Island",
445
  },
446
  [ProvinceId.QC]: {
447
    id: "province.qc",
448
    defaultMessage: "Quebec",
449
  },
450
  [ProvinceId.SK]: {
451
    id: "province.sk",
452
    defaultMessage: "Saskatchewan",
453
  },
454
  [ProvinceId.YT]: {
455
    id: "province.yk",
456
    defaultMessage: "Yukon",
457
  },
458
});
459
460
export const provinceName = (provinceId: number): MessageDescriptor =>
461
  getOrThrowError(provinceNames, provinceId, "invalid ProvinceId");
462
463
const provinceAbreviations = defineMessages({
464
  [ProvinceId.AB]: {
465
    id: "province.ab.abreviation",
466
    defaultMessage: "Alb.",
467
  },
468
  [ProvinceId.BC]: {
469
    id: "province.bc.abreviation",
470
    defaultMessage: "B.C.",
471
  },
472
  [ProvinceId.MB]: {
473
    id: "province.mb.abreviation",
474
    defaultMessage: "Man.",
475
  },
476
  [ProvinceId.NL]: {
477
    id: "province.nl.abreviation",
478
    defaultMessage: "N.L.",
479
  },
480
  [ProvinceId.NB]: {
481
    id: "province.nb.abreviation",
482
    defaultMessage: "N.B.",
483
  },
484
  [ProvinceId.NS]: {
485
    id: "province.ns.abreviation",
486
    defaultMessage: "N.S.",
487
  },
488
  [ProvinceId.NU]: {
489
    id: "province.nu.abreviation",
490
    defaultMessage: "Nvt.",
491
  },
492
  [ProvinceId.NT]: {
493
    id: "province.nt.abreviation",
494
    defaultMessage: "N.W.T.",
495
  },
496
  [ProvinceId.ON]: {
497
    id: "province.on.abreviation",
498
    defaultMessage: "Ont.",
499
  },
500
  [ProvinceId.PE]: {
501
    id: "province.pe.abreviation",
502
    defaultMessage: "P.E.I.",
503
  },
504
  [ProvinceId.QC]: {
505
    id: "province.qc.abreviation",
506
    defaultMessage: "Que.",
507
  },
508
  [ProvinceId.SK]: {
509
    id: "province.sk.abreviation",
510
    defaultMessage: "Sask.",
511
  },
512
  [ProvinceId.YT]: {
513
    id: "province.yk.abreviation",
514
    defaultMessage: "Y.T.",
515
  },
516
});
517
518
export const provinceAbreviation = (provinceId: number): MessageDescriptor =>
519
  getOrThrowError(provinceAbreviations, provinceId, "invalid ProvinceId");
520
521
const securityClearances = defineMessages({
522
  [SecurityClearanceId.reliability]: {
523
    id: "securityClearance.reliability",
524
    defaultMessage: "Reliability",
525
  },
526
  [SecurityClearanceId.secret]: {
527
    id: "securityClearance.secret",
528
    defaultMessage: "Secret",
529
  },
530
  [SecurityClearanceId.topSecret]: {
531
    id: "securityClearance.topSecret",
532
    defaultMessage: "Top Secret",
533
  },
534
});
535
536
export const securityClearance = (
537
  securityClearanceId: number,
538
): MessageDescriptor =>
539
  getOrThrowError(
540
    securityClearances,
541
    securityClearanceId,
542
    "invalid security clearance id",
543
  );
544
545
const languageRequirements = defineMessages({
546
  [LanguageRequirementId.english]: {
547
    id: "languageRequirement.english",
548
    defaultMessage: "English Essential",
549
  },
550
  [LanguageRequirementId.french]: {
551
    id: "languageRequirement.french",
552
    defaultMessage: "French Essential",
553
  },
554
  [LanguageRequirementId.bilingualIntermediate]: {
555
    id: "languageRequirement.bilingualIntermediate",
556
    defaultMessage: "Bilingual - Intermediate",
557
  },
558
  [LanguageRequirementId.bilingualAdvanced]: {
559
    id: "languageRequirement.bilingualAdvanced",
560
    defaultMessage: "Bilingual - Advanced",
561
  },
562
  [LanguageRequirementId.englishOrFrench]: {
563
    id: "languageRequirement.englishOrFrench",
564
    defaultMessage: "English or French",
565
  },
566
});
567
568
export const languageRequirement = (
569
  languageRequirementId: number,
570
): MessageDescriptor =>
571
  getOrThrowError(
572
    languageRequirements,
573
    languageRequirementId,
574
    "invalid LanguageRequirementId",
575
  );
576
577
const languageRequirementDescriptions = defineMessages({
578
  [LanguageRequirementId.english]: {
579
    id: "languageRequirement.description.english",
580
    defaultMessage:
581
      "This position requires fluency in English in both written and verbal communication. As part of the assessment of your language abilities, the hiring manager may ask you to complete some assessment steps in English, such as interview questions or an exam.",
582
  },
583
  [LanguageRequirementId.french]: {
584
    id: "languageRequirement.description.french",
585
    defaultMessage:
586
      "This position requires fluency in French in both written and verbal communication. As part of the assessment of your language abilities, the hiring manager may ask you to complete some assessment steps in French, such as interview questions or an exam.",
587
  },
588
  [LanguageRequirementId.bilingualIntermediate]: {
589
    id: "languageRequirement.description.bilingualIntermediate",
590
    // TODO: turn "Public Service Commission of Canada" into a link to https://www.canada.ca/en/public-service-commission/jobs/services/gc-jobs/information-candidates/language-requirements-candidates.html
591
    defaultMessage:
592
      "This position requires working knowledge of both French and English. This means that you can take on job duties in either French or English, and you have intermediate reading, writing and verbal communication skills in both official languages. As part of this selection process, your language abilities will be tested by the Public Service Commission of Canada.",
593
  },
594
  [LanguageRequirementId.bilingualAdvanced]: {
595
    id: "languageRequirement.description.bilingualAdvanced",
596
    // TODO: turn "Public Service Commission of Canada" into a link to https://www.canada.ca/en/public-service-commission/jobs/services/gc-jobs/information-candidates/language-requirements-candidates.html
597
    defaultMessage:
598
      "This position requires advanced knowledge of both French and English. This means that you can take on job duties in either French or English, and you have strong reading, writing and verbal communication skills in both official languages. As part of this selection process, your language abilities will be tested by the Public Service Commission of Canada Public Service Commission of Canada.",
599
  },
600
  [LanguageRequirementId.englishOrFrench]: {
601
    id: "languageRequirement.description.englishOrFrench",
602
    defaultMessage:
603
      "For this position, you meet the language requirements if you have strong reading, writing and verbal communication skills in either English or French, or both (bilingual).",
604
  },
605
});
606
607
export const languageRequirementDescription = (
608
  languageRequirementId: number,
609
): MessageDescriptor =>
610
  getOrThrowError(
611
    languageRequirementDescriptions,
612
    languageRequirementId,
613
    "invalid LanguageRequirementId",
614
  );
615
616
const languageRequirementContexts = defineMessages({
617
  basic: {
618
    id: "languageRequirement.context.basic",
619
    defaultMessage:
620
      "You can submit this initial application in either official language of your choice (English or French).",
621
  },
622
  expanded: {
623
    id: "languageRequirement.context.expanded",
624
    defaultMessage:
625
      "You can complete all other steps of this assessment process in the official language of your choice, including the initial application, interview, exam and any other evaluation components.",
626
  },
627
});
628
629
export const languageRequirementContext = (
630
  languageRequirementId: number,
631
): MessageDescriptor => {
632
  switch (languageRequirementId) {
633
    case LanguageRequirementId.bilingualIntermediate:
634
    case LanguageRequirementId.bilingualAdvanced:
635
      return languageRequirementContexts.expanded;
636
637
    case LanguageRequirementId.englishOrFrench:
638
    case LanguageRequirementId.english:
639
    case LanguageRequirementId.french:
640
    default:
641
      return languageRequirementContexts.basic;
642
  }
643
};
644
645
const departments = defineMessages({
646
  [DepartmentId.treasuryBoard]: {
647
    id: "department.treasuryBoard",
648
    defaultMessage: "Treasury Board of Canada Secretariat",
649
  },
650
  [DepartmentId.naturalResources]: {
651
    id: "department.naturalResources",
652
    defaultMessage: "Natural Resources Canada",
653
  },
654
  [DepartmentId.transport]: {
655
    id: "department.transport",
656
    defaultMessage: "Transport Canada",
657
  },
658
  [DepartmentId.environmentAndClimateChange]: {
659
    id: "department.environmentAndClimateChange",
660
    defaultMessage: "Environment and Climate Change Canada",
661
  },
662
  [DepartmentId.employmentAndSocialDevelopment]: {
663
    id: "department.employmentAndSocialDevelopment",
664
    defaultMessage: "Employment and Social Development Canada",
665
  },
666
  [DepartmentId.globalAffairs]: {
667
    id: "department.globalAffairs",
668
    defaultMessage: "Global Affairs Canada",
669
  },
670
  [DepartmentId.borderServices]: {
671
    id: "department.borderServices",
672
    defaultMessage: "Canada Border Services Agency",
673
  },
674
  [DepartmentId.fisheriesAndOceans]: {
675
    id: "department.fisheriesAndOceans",
676
    defaultMessage: "Fisheries and Oceans Canada",
677
  },
678
  [DepartmentId.innovationScience]: {
679
    id: "department.innovationScience",
680
    defaultMessage: "Innovation, Science and Economic Development Canada",
681
  },
682
  [DepartmentId.publicServiceAndProcurement]: {
683
    id: "department.publicServiceAndProcurement",
684
    defaultMessage: "Public Services and Procurement Canada",
685
  },
686
  [DepartmentId.nationalDefence]: {
687
    id: "department.nationalDefence",
688
    defaultMessage: "Deparmtnet of National Defence",
689
  },
690
});
691
692
export const departmentName = (departmentId: number): MessageDescriptor =>
693
  getOrThrowError(departments, departmentId, "invalid DepartmentId");
694
695
export const narrativeReviewStandardQuestion = (): MessageDescriptor =>
696
  standardAssessmentText.narrativeReviewQuestion;
697
698
export const narrativeReviewStandardAnswer = (): MessageDescriptor =>
699
  standardAssessmentText.narrativeReviewAnswer;
700
701
const frequencyMessages = defineMessages({
702
  [FrequencyId.always]: {
703
    id: "jobBuilder.details.frequencyAlwaysLabel",
704
    defaultMessage: "Almost Always",
705
    description: "The form label displayed on 'always' frequency options.",
706
  },
707
  [FrequencyId.often]: {
708
    id: "jobBuilder.details.frequencyFrequentlyLabel",
709
    defaultMessage: "Frequently",
710
    description: "The form label displayed on 'frequently' frequency options.",
711
  },
712
  [FrequencyId.sometimes]: {
713
    id: "jobBuilder.details.frequencySometimesLabel",
714
    defaultMessage: "Sometimes",
715
    description: "The form label displayed on 'sometimes' frequency options.",
716
  },
717
  [FrequencyId.rarely]: {
718
    id: "jobBuilder.details.frequencyOccasionallyLabel",
719
    defaultMessage: "Occasionally",
720
    description:
721
      "The form label displayed on 'occasionally' frequency options.",
722
  },
723
  [FrequencyId.never]: {
724
    id: "jobBuilder.details.frequencyNeverLabel",
725
    defaultMessage: "Almost Never",
726
    description: "The form label displayed on 'never' frequency options.",
727
  },
728
});
729
730
export const frequencyName = (frequencyId: number): MessageDescriptor =>
731
  getOrThrowError(frequencyMessages, frequencyId, "invalid FrequencyId");
732
733
const overtimeRequirmentDescriptions = defineMessages({
734
  [OvertimeRequirementId.frequently]: {
735
    id: "jobBuilder.details.overtimeFrequentlyLabel",
736
    defaultMessage: "Yes, overtime is frequently required for the position.",
737
    description: "The form label displayed on 'frequently' overtime options",
738
  },
739
  [OvertimeRequirementId.available]: {
740
    id: "jobBuilder.details.overtimeOpportunitiesAvailableLabel",
741
    defaultMessage:
742
      "Yes, overtime opportunities are available for those that are interested.",
743
    description:
744
      "The form label displayed on 'overtime opportunities available' overtime options",
745
  },
746
  [OvertimeRequirementId.none]: {
747
    id: "jobBuilder.details.overtimeNoneRequiredLabel",
748
    defaultMessage: "No, overtime is not required for the position.",
749
    description:
750
      "The form label displayed on 'no overtime required' overtime options",
751
  },
752
});
753
754
export const overtimeRequirementDescription = (
755
  overtimeRequirementId: number,
756
): MessageDescriptor =>
757
  getOrThrowError(
758
    overtimeRequirmentDescriptions,
759
    overtimeRequirementId,
760
    "invalid OvertimeRequirementId",
761
  );
762
763
const travelRequirementDescriptions = defineMessages({
764
  [TravelRequirementId.frequently]: {
765
    id: "jobBuilder.details.travelFrequentlyLabel",
766
    defaultMessage: "Yes, travel is frequently required for the position.",
767
    description: "The form label displayed on 'frequently' travel options",
768
  },
769
  [TravelRequirementId.available]: {
770
    id: "jobBuilder.details.travelOpportunitiesAvailableLabel",
771
    defaultMessage:
772
      "Yes, travel opportunities are available for those that are interested.",
773
    description:
774
      "The form label displayed on 'travel opportunities available' travel options",
775
  },
776
  [TravelRequirementId.none]: {
777
    id: "jobBuilder.details.travelNoneRequiredLabel",
778
    defaultMessage: "No, travel is not required for the position.",
779
    description:
780
      "The form label displayed on 'no travel required' travel options",
781
  },
782
});
783
784
export const travelRequirementDescription = (
785
  travelRequirementId: number,
786
): MessageDescriptor =>
787
  getOrThrowError(
788
    travelRequirementDescriptions,
789
    travelRequirementId,
790
    "invalid TravelRequirementId",
791
  );
792