From f10c0548bc2b4ebbb1425cbe965b2ed59d4f3629 Mon Sep 17 00:00:00 2001 From: Matt Nigh Date: Tue, 3 Dec 2024 14:31:09 -0500 Subject: [PATCH 1/6] Remove ongoing jobs/recruitment --- api/app/Enums/PublishingGroup.php | 1 - api/app/Models/PoolCandidate.php | 1 - api/database/factories/PoolFactory.php | 5 +- api/database/seeders/PoolTestSeeder.php | 2 +- api/lang/en/publishing_group.php | 1 - api/lang/fr/publishing_group.php | 1 - api/storage/app/lighthouse-schema.graphql | 1 - api/tests/Feature/ApplicantTest.php | 10 +- .../Feature/CountPoolCandidatesByPoolTest.php | 11 - .../PoolCandidatesTable.tsx | 2 +- .../QualifiedRecruitmentCard.tsx | 4 +- apps/web/src/constants/pool.ts | 4 - apps/web/src/lang/fr.json | 44 +- .../web/src/messages/poolCandidateMessages.ts | 5 - .../ApplicationSuccessPage.tsx | 5 +- .../BrowsePoolsPage.stories.tsx | 24 - .../Pools/BrowsePoolsPage/BrowsePoolsPage.tsx | 19 +- .../OngoingRecruitmentSection.test.tsx | 95 -- .../OngoingRecruitmentSection.tsx | 1206 ----------------- apps/web/src/utils/poolCandidate.ts | 9 - apps/web/src/utils/poolUtils.tsx | 6 - 21 files changed, 14 insertions(+), 1442 deletions(-) delete mode 100644 apps/web/src/constants/pool.ts delete mode 100644 apps/web/src/pages/Pools/BrowsePoolsPage/components/OngoingRecruitmentSection/OngoingRecruitmentSection.test.tsx delete mode 100644 apps/web/src/pages/Pools/BrowsePoolsPage/components/OngoingRecruitmentSection/OngoingRecruitmentSection.tsx diff --git a/api/app/Enums/PublishingGroup.php b/api/app/Enums/PublishingGroup.php index 799ddd623ca..3013f64f700 100644 --- a/api/app/Enums/PublishingGroup.php +++ b/api/app/Enums/PublishingGroup.php @@ -10,7 +10,6 @@ enum PublishingGroup case IAP; case IT_JOBS; - case IT_JOBS_ONGOING; case EXECUTIVE_JOBS; case OTHER; diff --git a/api/app/Models/PoolCandidate.php b/api/app/Models/PoolCandidate.php index 615e38f6a0a..8de0998f051 100644 --- a/api/app/Models/PoolCandidate.php +++ b/api/app/Models/PoolCandidate.php @@ -398,7 +398,6 @@ public static function scopePublishingGroups(Builder $query, ?array $publishingG public static function scopeInTalentSearchablePublishingGroup(Builder $query) { $query = self::scopePublishingGroups($query, [ - PublishingGroup::IT_JOBS_ONGOING->name, PublishingGroup::IT_JOBS->name, PublishingGroup::OTHER->name, ]); diff --git a/api/database/factories/PoolFactory.php b/api/database/factories/PoolFactory.php index 282fc8461d4..aef95dc2269 100644 --- a/api/database/factories/PoolFactory.php +++ b/api/database/factories/PoolFactory.php @@ -297,10 +297,7 @@ public function candidatesAvailableInSearch() { return $this->published()->state(function () { return [ - 'publishing_group' => $this->faker->randomElement([ - PublishingGroup::IT_JOBS->name, - PublishingGroup::IT_JOBS_ONGOING->name, - ]), + 'publishing_group' => PublishingGroup::IT_JOBS->name ]; }); } diff --git a/api/database/seeders/PoolTestSeeder.php b/api/database/seeders/PoolTestSeeder.php index d4b4134e234..c3faad53223 100644 --- a/api/database/seeders/PoolTestSeeder.php +++ b/api/database/seeders/PoolTestSeeder.php @@ -144,7 +144,7 @@ public function run() 'community_id' => $digitalCommunityId, 'published_at' => config('constants.past_date'), 'closing_date' => config('constants.far_future_date'), - 'publishing_group' => PublishingGroup::IT_JOBS_ONGOING->name, + 'publishing_group' => PublishingGroup::IT_JOBS->name, 'stream' => PoolStream::BUSINESS_ADVISORY_SERVICES->name, ]); diff --git a/api/lang/en/publishing_group.php b/api/lang/en/publishing_group.php index 3912968572a..354f45c5058 100644 --- a/api/lang/en/publishing_group.php +++ b/api/lang/en/publishing_group.php @@ -6,6 +6,5 @@ 'executive_jobs' => 'Executive Jobs', 'iap' => 'IAP', 'it_jobs' => 'IT Jobs', - 'it_jobs_ongoing' => 'IT Jobs (ongoing)', 'other' => Lang::get('common.other', [], 'en'), ]; diff --git a/api/lang/fr/publishing_group.php b/api/lang/fr/publishing_group.php index 5932f25fbda..bed23ff9179 100644 --- a/api/lang/fr/publishing_group.php +++ b/api/lang/fr/publishing_group.php @@ -6,6 +6,5 @@ 'executive_jobs' => 'Postes de direction', 'iap' => 'PAPA', 'it_jobs' => 'Emplois en TI', - 'it_jobs_ongoing' => 'Emplois en TI (en cours)', 'other' => Lang::get('common.other', [], 'fr'), ]; diff --git a/api/storage/app/lighthouse-schema.graphql b/api/storage/app/lighthouse-schema.graphql index aaf9921f32f..d3239fbd18e 100755 --- a/api/storage/app/lighthouse-schema.graphql +++ b/api/storage/app/lighthouse-schema.graphql @@ -3266,7 +3266,6 @@ enum ProvinceOrTerritory { enum PublishingGroup { IAP IT_JOBS - IT_JOBS_ONGOING EXECUTIVE_JOBS OTHER } diff --git a/api/tests/Feature/ApplicantTest.php b/api/tests/Feature/ApplicantTest.php index c4e7e0a9214..d6464888513 100644 --- a/api/tests/Feature/ApplicantTest.php +++ b/api/tests/Feature/ApplicantTest.php @@ -61,7 +61,7 @@ public function testCountApplicantsQuery(): void $user = User::all()->first(); $ITPool1 = Pool::factory()->candidatesAvailableInSearch()->create([ 'user_id' => $user['id'], - 'publishing_group' => PublishingGroup::IT_JOBS_ONGOING->name, + 'publishing_group' => PublishingGroup::IT_JOBS->name, ]); $ITPool2 = Pool::factory()->candidatesAvailableInSearch()->create([ 'user_id' => $user['id'], @@ -1736,12 +1736,6 @@ public function testOnlyITJobsAppear() PoolCandidate::factory()->availableInSearch()->create([ 'pool_id' => $itPool->id, ]); - $itOngoingPool = Pool::factory()->published()->candidatesAvailableInSearch()->create([ - 'user_id' => $this->adminUser->id, - ]); - PoolCandidate::factory()->availableInSearch()->create([ - 'pool_id' => $itOngoingPool->id, - ]); $execPool = Pool::factory()->published()->create([ 'user_id' => $this->adminUser->id, 'publishing_group' => PublishingGroup::EXECUTIVE_JOBS->name, @@ -1762,7 +1756,7 @@ public function testOnlyITJobsAppear() ] )->assertJson([ 'data' => [ - 'countApplicants' => 2, + 'countApplicants' => 1, ], ]); } diff --git a/api/tests/Feature/CountPoolCandidatesByPoolTest.php b/api/tests/Feature/CountPoolCandidatesByPoolTest.php index 1de6d431e50..0566e8175bd 100644 --- a/api/tests/Feature/CountPoolCandidatesByPoolTest.php +++ b/api/tests/Feature/CountPoolCandidatesByPoolTest.php @@ -630,12 +630,6 @@ public function testOnlyItJobsAppear() ]); PoolCandidate::factory()->create($this->poolCandidateData($itPool, $user, true)); - $itOngoingPool = Pool::factory()->create([ - ...$this->poolData(), - 'publishing_group' => PublishingGroup::IT_JOBS_ONGOING->name, - ]); - PoolCandidate::factory()->create($this->poolCandidateData($itOngoingPool, $user, true)); - // Note: Should not appear in results $execPool = Pool::factory()->create([ ...$this->poolData(), @@ -657,7 +651,6 @@ public function testOnlyItJobsAppear() 'where' => [ 'pools' => [ ['id' => $itPool->id], - ['id' => $itOngoingPool->id], ['id' => $execPool->id], // Should not show up ], ], @@ -665,10 +658,6 @@ public function testOnlyItJobsAppear() )->assertSimilarJson([ 'data' => [ 'countPoolCandidatesByPool' => [ - [ - 'pool' => ['id' => $itOngoingPool->id], - 'candidateCount' => 1, - ], [ 'pool' => ['id' => $itPool->id], 'candidateCount' => 1, diff --git a/apps/web/src/components/PoolCandidatesTable/PoolCandidatesTable.tsx b/apps/web/src/components/PoolCandidatesTable/PoolCandidatesTable.tsx index a3d44bfde29..f7540789ed9 100644 --- a/apps/web/src/components/PoolCandidatesTable/PoolCandidatesTable.tsx +++ b/apps/web/src/components/PoolCandidatesTable/PoolCandidatesTable.tsx @@ -450,7 +450,7 @@ const defaultState = { }, poolCandidateStatus: [], priorityWeight: [], - publishingGroups: [PublishingGroup.ItJobs, PublishingGroup.ItJobsOngoing], + publishingGroups: [PublishingGroup.ItJobs], }, }; diff --git a/apps/web/src/components/QualifiedRecruitmentCard/QualifiedRecruitmentCard.tsx b/apps/web/src/components/QualifiedRecruitmentCard/QualifiedRecruitmentCard.tsx index cb6a69478a1..5dd72de1c43 100644 --- a/apps/web/src/components/QualifiedRecruitmentCard/QualifiedRecruitmentCard.tsx +++ b/apps/web/src/components/QualifiedRecruitmentCard/QualifiedRecruitmentCard.tsx @@ -27,7 +27,7 @@ import { } from "@gc-digital-talent/graphql"; import { categorizeSkill, filterPoolSkillsByType } from "~/utils/skillUtils"; -import { getRecruitmentType } from "~/utils/poolCandidate"; +import poolCandidateMessages from "~/messages/poolCandidateMessages"; import RecruitmentAvailabilityDialog from "../RecruitmentAvailabilityDialog/RecruitmentAvailabilityDialog"; import { getQualifiedRecruitmentInfo } from "./utils"; @@ -180,7 +180,7 @@ const QualifiedRecruitmentCard = ({ data-h2-color="base(secondary.darker)" data-h2-margin="base(x.25 0 x1 0)" > - {getRecruitmentType(candidate.pool.publishingGroup?.value, intl)} + {intl.formatMessage(poolCandidateMessages.targetedRecruitment)}

diff --git a/apps/web/src/constants/pool.ts b/apps/web/src/constants/pool.ts deleted file mode 100644 index e801d1da078..00000000000 --- a/apps/web/src/constants/pool.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { PublishingGroup } from "@gc-digital-talent/graphql"; - -// eslint-disable-next-line import/prefer-default-export -export const ONGOING_PUBLISHING_GROUPS = [PublishingGroup.ItJobsOngoing]; diff --git a/apps/web/src/lang/fr.json b/apps/web/src/lang/fr.json index 8a18b10dcba..b10f2db89af 100644 --- a/apps/web/src/lang/fr.json +++ b/apps/web/src/lang/fr.json @@ -551,10 +551,6 @@ "defaultMessage": "Tâches de travail (anglais)", "description": "Label for a process' English work tasks" }, - "0lDq3P": { - "defaultMessage": "La liste n’est pas filtrée. ", - "description": "Announcement that the job stream filter is not active." - }, "0nP0Wj": { "defaultMessage": "Selon la définition de Statistique Canada, ce groupe :", "description": "Link to Statistics Canada's employment equity definitions" @@ -3895,10 +3891,6 @@ "defaultMessage": "Les conditions d’emploi sélectionnées seront comparées à celles choisies par les candidats dans leur demande.", "description": "Message describing the operational requirements filter in the search form." }, - "ITLoHV": { - "defaultMessage": "Nous proposons également des processus de recrutement passif qui nous permettent de trouver rapidement des talents lorsque la demande se fait sentir. Bien qu’il n’y ait aucune garantie qu’un emploi résultera des possibilités ci-dessous, il s’agit d’un moyen facile pour permettre aux gestionnaires de trouver votre nom et votre parcours professionnel le moment venu. N’hésitez pas à soumettre votre nom à toute filière correspondant à vos compétences.", - "description": "instructions for section with ongoing pool advertisements" - }, "IUoUqs": { "defaultMessage": "Modification de l’état", "description": "Title for the request status last changed at date block." @@ -4511,10 +4503,6 @@ "defaultMessage": "Questions de présélection (au moment de la candidature) - {skillName}", "description": "Header for application screening decision dialog." }, - "LFYdXR": { - "defaultMessage": "Recommandé selon vos compétences", - "description": "Tip that your skills match this section well and so it is recommended" - }, "LGSw+f": { "defaultMessage": "Tous les apprentis seront appuyés par des pairs et des mentors soigneusement sélectionnés. Les apprentis seront également invités à se joindre à un Réseau d’apprentissage pour les Autochtones, où ils auront des occasions de communiquer avec d’autres employés autochtones du gouvernement du Canada et avec d’autres apprentis autochtones qui participent à ce programme.", "description": "Learn more dialog question two paragraph two" @@ -4655,6 +4643,10 @@ "defaultMessage": "Une fois l’apprentissage terminé avec succès, les diplômés reçoivent un certificat numérique ainsi qu’un certificat vérifiable portable. Il est approuvé par le, la dirigeant·e principal·e de l’information du Canada et officiellement reconnu comme répondant à l‘alternative aux exigences d’études de la norme de qualification minimale du GC pour le groupe professionnel IT.", "description": "Paragraph 1 of the 'Digital certificate credential' subsection" }, + "M+5+nP": { + "defaultMessage": "Exploiter d’autres occasions", + "description": "Link text for browse jobs page" + }, "M051tF": { "defaultMessage": "Retirer une compétence", "description": "Message in skills in details section to remove skill from the experience." @@ -5683,10 +5675,6 @@ "defaultMessage": "Télécharger une copie de ce formulaire", "description": "Button text to download this form" }, - "RBsGRp": { - "defaultMessage": "Postulez au recrutement en cours", - "description": "title for section with ongoing pool advertisements" - }, "RDAVsP": { "defaultMessage": "Lire la Directive", "description": "Link text to read the entire directive." @@ -6023,10 +6011,6 @@ "defaultMessage": "Le travail est-il attribué à la sous-traitance parce qu’il comprend l’apport de ce qui suit :", "description": "Context for _technological change_ section, paragraph 1, in the _digital services contracting questionnaire_" }, - "SypvZP": { - "defaultMessage": "La liste est filtrée vers le {jobStream} volet du travail.", - "description": "Announcement that the job stream filter is active." - }, "T+fhB+": { "defaultMessage": "Décision finale annulée", "description": "Message displayed when a pool candidate final decision has been updated by an admin" @@ -6394,18 +6378,10 @@ "defaultMessage": "Ce à quoi s’attendre après l’admission", "description": "Title for the what to expect post admission section" }, - "Uxw5DB": { - "defaultMessage": "Recrutement en cours", - "description": "Label for an ongoing qualified recruitment" - }, "Uy5Dg2": { "defaultMessage": "Participation de la collectivité", "description": "Title for community experience section" }, - "Uzx5dR": { - "defaultMessage": "Vous ne voyez pas de processus de recrutement actif correspondant à vos compétences ? Pas de problème, nous voulons toujours avoir de vos nouvelles.", - "description": "summary for section with ongoing pool advertisements" - }, "V0U95l": { "defaultMessage": "Vous n'avez pas encore ajouté de compétences essentielles", "description": "Null message title for essential skills table." @@ -6990,10 +6966,6 @@ "defaultMessage": "Oui, j'ai un droit de priorité.", "description": "Label displayed does have priority entitlement option" }, - "XnvXtO": { - "defaultMessage": "Tous", - "description": "All" - }, "XoGKAf": { "defaultMessage": "À qui s’adresse le recrutement pour les cadres?", "description": "Heading for EXposition eligibility" @@ -8074,10 +8046,6 @@ "defaultMessage": "Publiez votre annonce pour commencer à recevoir des candidatures", "description": "Instructions on a draft process on how to start getting applicants" }, - "dJXjhw": { - "defaultMessage": "Sélectionnez un volet", - "description": "Placeholder for stream filter in browse opportunities form." - }, "dSfDu1": { "defaultMessage": "Aidez les gestionnaires à comprendre les domaines dans lesquels vous souhaitez améliorer des compétences comportementales. Vous pouvez modifier cette vitrine à tout moment et vous êtes libre de mettre les compétences dans l’ordre qui vous convient. Les compétences que vous ajoutez à la vitrine qui ne sont pas déjà dans votre bibliothèque seront ajoutées automatiquement.", "description": "Page blurb for the improve behavioural skills page" @@ -10278,10 +10246,6 @@ "defaultMessage": "Supprimer le processus", "description": "Title to delete a process" }, - "nc5GGm": { - "defaultMessage": "Exploiter d’autres occasions", - "description": "Link text to the ongoing recruitments section on the browse page" - }, "ndW6vI": { "defaultMessage": "En attente d’une évaluation", "description": "Message displayed when candidate is on hold at a specific assessment step" diff --git a/apps/web/src/messages/poolCandidateMessages.ts b/apps/web/src/messages/poolCandidateMessages.ts index 0ff9075909a..8b234c76fb9 100644 --- a/apps/web/src/messages/poolCandidateMessages.ts +++ b/apps/web/src/messages/poolCandidateMessages.ts @@ -23,11 +23,6 @@ const messages = defineMessages({ id: "uIWFvk", description: "Message displayed when a user is appearing in a recruitment", }, - ongoingRecruitment: { - defaultMessage: "Ongoing recruitment", - id: "Uxw5DB", - description: "Label for an ongoing qualified recruitment", - }, targetedRecruitment: { defaultMessage: "Targeted recruitment", id: "04smVa", diff --git a/apps/web/src/pages/Applications/ApplicationSuccessPage/ApplicationSuccessPage.tsx b/apps/web/src/pages/Applications/ApplicationSuccessPage/ApplicationSuccessPage.tsx index 0ea54da519e..8e3d81dfd82 100644 --- a/apps/web/src/pages/Applications/ApplicationSuccessPage/ApplicationSuccessPage.tsx +++ b/apps/web/src/pages/Applications/ApplicationSuccessPage/ApplicationSuccessPage.tsx @@ -133,9 +133,8 @@ const ApplicationSuccess = ({ application }: ApplicationPageProps) => { > {intl.formatMessage({ defaultMessage: "Browse for other opportunities", - id: "nc5GGm", - description: - "Link text to the ongoing recruitments section on the browse page", + id: "M+5+nP", + description: "Link text for browse jobs page", })} diff --git a/apps/web/src/pages/Pools/BrowsePoolsPage/BrowsePoolsPage.stories.tsx b/apps/web/src/pages/Pools/BrowsePoolsPage/BrowsePoolsPage.stories.tsx index 56353a1faa6..aa6a5e3df83 100644 --- a/apps/web/src/pages/Pools/BrowsePoolsPage/BrowsePoolsPage.stories.tsx +++ b/apps/web/src/pages/Pools/BrowsePoolsPage/BrowsePoolsPage.stories.tsx @@ -15,12 +15,6 @@ const mockPools = fakePools(3).map((advert) => ({ status: toLocalizedEnum(PoolStatus.Published), })); -const mockPoolsOngoing = fakePools(2).map((advert) => ({ - ...advert, - publishingGroup: toLocalizedEnum(PublishingGroup.ItJobsOngoing), - status: toLocalizedEnum(PoolStatus.Published), -})); - export default { component: BrowsePools, decorators: [MockGraphqlDecorator], @@ -45,21 +39,3 @@ Default.parameters = { }, }, }; - -export const OngoingRecruitment = Template.bind({}); -OngoingRecruitment.parameters = { - chromatic: { viewports: CHROMATIC_VIEWPORTS }, - apiResponsesConfig: { - latency: { - min: 0, - max: 0, - }, - }, - apiResponses: { - BrowsePoolsPage: { - data: { - publishedPools: mockPoolsOngoing, - }, - }, - }, -}; diff --git a/apps/web/src/pages/Pools/BrowsePoolsPage/BrowsePoolsPage.tsx b/apps/web/src/pages/Pools/BrowsePoolsPage/BrowsePoolsPage.tsx index 9a92d0a5093..21dd5907035 100644 --- a/apps/web/src/pages/Pools/BrowsePoolsPage/BrowsePoolsPage.tsx +++ b/apps/web/src/pages/Pools/BrowsePoolsPage/BrowsePoolsPage.tsx @@ -32,7 +32,6 @@ import flourishBottomLight from "~/assets/img/browse_bottom_light.webp"; import flourishTopDark from "~/assets/img/browse_top_dark.webp"; import flourishBottomDark from "~/assets/img/browse_bottom_dark.webp"; -import OngoingRecruitmentSection from "./components/OngoingRecruitmentSection/OngoingRecruitmentSection"; import ActiveRecruitmentSection from "./components/ActiveRecruitmentSection/ActiveRecruitmentSection"; const getFlourishStyles = (isTop: boolean) => ({ @@ -65,7 +64,6 @@ const BrowsePoolsPage_Query = graphql(/* GraphQL */ ` ...ActiveRecruitmentSectionPool } - ...OngoingRecruitmentSection } `); @@ -109,15 +107,8 @@ export const Component = () => { p.publishingGroup?.value === PublishingGroup.ExecutiveJobs), ); - const ongoingRecruitmentPools = pools.filter( - (p) => - p.status?.value === PoolStatus.Published && // list jobs which have the PUBLISHED PoolStatus - p.publishingGroup?.value === PublishingGroup.ItJobsOngoing, // and which are meant to be published on the IT Jobs page - ); - // a different footer message is displayed if there are opportunities showing, otherwise a null state message is used - const areOpportunitiesShowing = - activeRecruitmentPools.length || ongoingRecruitmentPools.length; + const areOpportunitiesShowing = activeRecruitmentPools.length; const profileLink = { href: loggedIn ? paths.profile() : paths.login(), @@ -166,14 +157,6 @@ export const Component = () => {
- {ongoingRecruitmentPools.length > 0 && ( -
- -
- )}
{ - const mockClient = { - executeQuery: () => - fromValue({ - data: { - me: undefined, - }, - }), - } as never; // Satisfy type for mocking - - return renderWithProviders( - - - , - ); -}; - -describe("BrowsePoolsPage", () => { - it("should have no accessibility errors", async () => { - const { container } = renderBrowsePoolsPage({ - pools: [publishedPool], - }); - await axeTest(container); - }); - - // sort logic: by expiry date whichever one expires first should appear first on the list - // sort logic: if they have the same expiry date, whichever one was published first should appear first - it("should properly sort jobs", () => { - // should appear first: it expires first even though it was published later - const closesFirst = { - ...publishedPool, - id: "closesFirst", - closingDate: "2999-01-01 00:00:00", - }; - - // should appear second: tie for expiring second, has first publish date - const closesSecond = { - ...publishedPool, - id: "closesSecond", - closingDate: "2999-02-01 00:00:00", - }; - - renderBrowsePoolsPage({ - // pass data to the page in an intentionally reversed order - pools: [closesSecond, closesFirst], - }); - - fireEvent.click( - screen.getByRole("button", { - name: /business line advisory services/i, - }), - ); - - // find the rendered links - const links = screen.queryAllByRole("link", { - name: /apply for technician opportunities/i, - }); - - // ensure there are the right number and in the right order - expect(links).toHaveLength(1); - expect(links[0]).toHaveAttribute( - "href", - expect.stringContaining(closesSecond.id), - ); - }); -}); diff --git a/apps/web/src/pages/Pools/BrowsePoolsPage/components/OngoingRecruitmentSection/OngoingRecruitmentSection.tsx b/apps/web/src/pages/Pools/BrowsePoolsPage/components/OngoingRecruitmentSection/OngoingRecruitmentSection.tsx deleted file mode 100644 index 30a22ffef9c..00000000000 --- a/apps/web/src/pages/Pools/BrowsePoolsPage/components/OngoingRecruitmentSection/OngoingRecruitmentSection.tsx +++ /dev/null @@ -1,1206 +0,0 @@ -import CpuChipIcon from "@heroicons/react/24/outline/CpuChipIcon"; -import { useIntl } from "react-intl"; -import { useLocation } from "react-router"; -import CheckIcon from "@heroicons/react/20/solid/CheckIcon"; -import ChevronDownIcon from "@heroicons/react/24/solid/ChevronDownIcon"; -import { Fragment, ReactNode, useEffect, useState } from "react"; - -import { - Accordion, - Link, - Chip, - Heading, - DropdownMenu, - Button, -} from "@gc-digital-talent/ui"; -import { FAR_FUTURE_DATE } from "@gc-digital-talent/date-helpers"; -import { getId, notEmpty, uniqueItems } from "@gc-digital-talent/helpers"; -import { - graphql, - PoolStream, - Skill, - Pool, - getFragment, - FragmentType, - PoolSkillType, -} from "@gc-digital-talent/graphql"; -import { getLocalizedEnumStringByValue } from "@gc-digital-talent/i18n"; - -import useRoutes from "~/hooks/useRoutes"; -import { wrapAbbr } from "~/utils/nameUtils"; -import { filterPoolSkillsByType } from "~/utils/skillUtils"; - -import messages from "../../messages"; - -// the shape of the data model to populate this component -interface StreamViewModel { - key: PoolStream; - title: ReactNode; - label: ReactNode; - summary: ReactNode; - classifications: { - key: string; - title: ReactNode; - description: ReactNode; - pool: Pool | undefined; - applyMessage: ReactNode; - }[]; -} - -// choose a pool from a collection of pools for association with a stream, classification group, and classification level -const selectPoolForSection = ( - pools: Pool[], - stream: PoolStream, - group: string, - level: number, -): Pool | undefined => { - return ( - pools - // last closing date first to be selected - .sort((p1, p2) => - (p1.closingDate ?? FAR_FUTURE_DATE) < - (p2.closingDate ?? FAR_FUTURE_DATE) - ? 1 - : -1, - ) - .find( - (p) => - // must match section stream - p.stream?.value === stream && - // must include section classification group and level - !!( - p.classification?.group === group && - p.classification.level === level - ), - ) - ); -}; - -// Stream is recommended if any of the classifications match condition. -// Every essential skill in the classification is present in the user's skills. -const streamIsRecommended = ( - stream: StreamViewModel, - userSkillIds: Skill["id"][], -): boolean => - stream.classifications.some((classification) => { - const essentialSkills = filterPoolSkillsByType( - classification.pool?.poolSkills, - PoolSkillType.Essential, - ); - - return essentialSkills.every((skill) => userSkillIds.includes(skill.id)); - }); - -const OngoingRecruitmentSection_QueryFragment = graphql(/* GraphQL */ ` - fragment OngoingRecruitmentSection on Query { - me { - experiences { - id - skills { - id - } - } - } - streams: localizedEnumStrings(enumName: "PoolStream") { - value - label { - en - fr - } - } - } -`); - -export interface OngoingRecruitmentSectionProps { - pools: Pool[]; - query?: FragmentType; -} - -const OngoingRecruitmentSection = ({ - pools, - query, -}: OngoingRecruitmentSectionProps) => { - const intl = useIntl(); - const paths = useRoutes(); - const { hash } = useLocation(); - - /** - * Scroll to this section if there is a hash and ID that matches - */ - useEffect(() => { - if (hash) { - const target = document.getElementById(hash.substring(1)); - if (target) { - setTimeout(() => { - target.scrollIntoView({ - block: "start", - }); - }, 10); - } - } - }, [hash]); - - // is either a PoolStream or has a value of "ALL" which is the default and matches with no filtering - const [quickFilterStream, setQuickFilterStream] = useState< - PoolStream | "ALL" - >("ALL"); - - const data = getFragment(OngoingRecruitmentSection_QueryFragment, query); - // const pools = - // data?.publishedPools.filter( - // (pool) => typeof pool !== `undefined` && !!pool, - // ) ?? []; - const mySkillIdsWithDuplicates = data?.me?.experiences - ?.flatMap((e) => e?.skills) - .filter(notEmpty) - .map(getId); - const mySkillIds = uniqueItems(mySkillIdsWithDuplicates ?? []); - - const abbreviation = (text: ReactNode) => wrapAbbr(text, intl); - - // this great big object is all the data to populate the accordions - const streams: StreamViewModel[] = [ - // IT business line advisory services - { - key: PoolStream.BusinessAdvisoryServices, - title: intl.formatMessage(messages.businessAdvisoryServicesTitle, { - abbreviation, - }), - label: intl.formatMessage(messages.businessAdvisoryServicesLabel), - summary: intl.formatMessage(messages.businessAdvisoryServicesSummary, { - abbreviation, - }), - classifications: [ - { - key: "ba-it01", - title: intl.formatMessage(messages.it01Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it01Description), - pool: selectPoolForSection( - pools, - PoolStream.BusinessAdvisoryServices, - "IT", - 1, - ), - applyMessage: intl.formatMessage(messages.it01ApplyMessage, { - name: intl.formatMessage(messages.businessAdvisoryServicesTitle, { - abbreviation, - }), - }), - }, - { - key: "ba-it02", - title: intl.formatMessage(messages.it02Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it02Description), - pool: selectPoolForSection( - pools, - PoolStream.BusinessAdvisoryServices, - "IT", - 2, - ), - applyMessage: intl.formatMessage(messages.it02ApplyMessage, { - name: intl.formatMessage(messages.businessAdvisoryServicesTitle, { - abbreviation, - }), - }), - }, - { - key: "ba-it03", - title: intl.formatMessage(messages.it03Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it03Description1)} -

-

- {intl.formatMessage(messages.it03Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.BusinessAdvisoryServices, - "IT", - 3, - ), - applyMessage: intl.formatMessage(messages.it03ApplyMessage, { - name: intl.formatMessage(messages.businessAdvisoryServicesTitle, { - abbreviation, - }), - }), - }, - { - key: "ba-it04", - title: intl.formatMessage(messages.it04Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it04Description1, { - abbreviation, - })} -

-

- {intl.formatMessage(messages.it04Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.BusinessAdvisoryServices, - "IT", - 4, - ), - applyMessage: intl.formatMessage(messages.it04ApplyMessage, { - name: intl.formatMessage(messages.businessAdvisoryServicesTitle, { - abbreviation, - }), - }), - }, - ], - }, - // IT database management - { - key: PoolStream.DatabaseManagement, - title: intl.formatMessage(messages.databaseManagementTitle, { - abbreviation, - }), - label: intl.formatMessage(messages.databaseManagementLabel), - summary: intl.formatMessage(messages.databaseManagementSummary), - classifications: [ - { - key: "dm-it01", - title: intl.formatMessage(messages.it01Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it01Description), - pool: selectPoolForSection( - pools, - PoolStream.DatabaseManagement, - "IT", - 1, - ), - applyMessage: intl.formatMessage(messages.it01ApplyMessage, { - name: intl.formatMessage(messages.databaseManagementTitle, { - abbreviation, - }), - }), - }, - { - key: "dm-it02", - title: intl.formatMessage(messages.it02Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it02Description), - pool: selectPoolForSection( - pools, - PoolStream.DatabaseManagement, - "IT", - 2, - ), - applyMessage: intl.formatMessage(messages.it02ApplyMessage, { - name: intl.formatMessage(messages.databaseManagementTitle, { - abbreviation, - }), - }), - }, - { - key: "dm-it03", - title: intl.formatMessage(messages.it03Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it03Description1)} -

-

- {intl.formatMessage(messages.it03Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.DatabaseManagement, - "IT", - 3, - ), - applyMessage: intl.formatMessage(messages.it03ApplyMessage, { - name: intl.formatMessage(messages.databaseManagementTitle, { - abbreviation, - }), - }), - }, - { - key: "dm-it04", - title: intl.formatMessage(messages.it04Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it04Description1, { - abbreviation, - })} -

-

- {intl.formatMessage(messages.it04Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.DatabaseManagement, - "IT", - 4, - ), - applyMessage: intl.formatMessage(messages.it04ApplyMessage, { - name: intl.formatMessage(messages.databaseManagementTitle, { - abbreviation, - }), - }), - }, - ], - }, - // IT enterprise architecture - { - key: PoolStream.EnterpriseArchitecture, - title: intl.formatMessage(messages.enterpriseArchitectureTitle, { - abbreviation, - }), - label: intl.formatMessage(messages.enterpriseArchitectureLabel), - summary: intl.formatMessage(messages.enterpriseArchitectureSummary, { - abbreviation, - }), - classifications: [ - { - key: "ea-it01", - title: intl.formatMessage(messages.it01Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it01Description), - pool: selectPoolForSection( - pools, - PoolStream.EnterpriseArchitecture, - "IT", - 1, - ), - applyMessage: intl.formatMessage(messages.it01ApplyMessage, { - name: intl.formatMessage(messages.enterpriseArchitectureTitle, { - abbreviation, - }), - }), - }, - { - key: "ea-it02", - title: intl.formatMessage(messages.it02Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it02Description), - pool: selectPoolForSection( - pools, - PoolStream.EnterpriseArchitecture, - "IT", - 2, - ), - applyMessage: intl.formatMessage(messages.it02ApplyMessage, { - name: intl.formatMessage(messages.enterpriseArchitectureTitle, { - abbreviation, - }), - }), - }, - { - key: "ea-it03", - title: intl.formatMessage(messages.it03Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it03Description1)} -

-

- {intl.formatMessage(messages.it03Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.EnterpriseArchitecture, - "IT", - 3, - ), - applyMessage: intl.formatMessage(messages.it03ApplyMessage, { - name: intl.formatMessage(messages.enterpriseArchitectureTitle, { - abbreviation, - }), - }), - }, - { - key: "ea-it04", - title: intl.formatMessage(messages.it04Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it04Description1, { - abbreviation, - })} -

-

- {intl.formatMessage(messages.it04Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.EnterpriseArchitecture, - "IT", - 4, - ), - applyMessage: intl.formatMessage(messages.it04ApplyMessage, { - name: intl.formatMessage(messages.enterpriseArchitectureTitle, { - abbreviation, - }), - }), - }, - ], - }, - // IT infrastructure operations - { - key: PoolStream.InfrastructureOperations, - title: intl.formatMessage(messages.infrastructureOperationsTitle, { - abbreviation, - }), - label: intl.formatMessage(messages.infrastructureOperationsLabel), - summary: intl.formatMessage(messages.infrastructureOperationsSummary, { - abbreviation, - }), - classifications: [ - { - key: "io-it01", - title: intl.formatMessage(messages.it01Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it01Description), - pool: selectPoolForSection( - pools, - PoolStream.InfrastructureOperations, - "IT", - 1, - ), - applyMessage: intl.formatMessage(messages.it01ApplyMessage, { - name: intl.formatMessage(messages.infrastructureOperationsTitle, { - abbreviation, - }), - }), - }, - { - key: "io-it02", - title: intl.formatMessage(messages.it02Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it02Description), - pool: selectPoolForSection( - pools, - PoolStream.InfrastructureOperations, - "IT", - 2, - ), - applyMessage: intl.formatMessage(messages.it02ApplyMessage, { - name: intl.formatMessage(messages.infrastructureOperationsTitle, { - abbreviation, - }), - }), - }, - { - key: "io-it03", - title: intl.formatMessage(messages.it03Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it03Description1)} -

-

- {intl.formatMessage(messages.it03Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.InfrastructureOperations, - "IT", - 3, - ), - applyMessage: intl.formatMessage(messages.it03ApplyMessage, { - name: intl.formatMessage(messages.infrastructureOperationsTitle, { - abbreviation, - }), - }), - }, - { - key: "io-it04", - title: intl.formatMessage(messages.it04Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it04Description1, { - abbreviation, - })} -

-

- {intl.formatMessage(messages.it04Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.InfrastructureOperations, - "IT", - 4, - ), - applyMessage: intl.formatMessage(messages.it04ApplyMessage, { - name: intl.formatMessage(messages.infrastructureOperationsTitle, { - abbreviation, - }), - }), - }, - ], - }, - // IT planning and reporting - { - key: PoolStream.PlanningAndReporting, - title: intl.formatMessage(messages.planningAndReportingTitle, { - abbreviation, - }), - label: intl.formatMessage(messages.planningAndReportingLabel), - summary: intl.formatMessage(messages.planningAndReportingSummary, { - abbreviation, - }), - classifications: [ - { - key: "pr-it01", - title: intl.formatMessage(messages.it01Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it01Description), - pool: selectPoolForSection( - pools, - PoolStream.PlanningAndReporting, - "IT", - 1, - ), - applyMessage: intl.formatMessage(messages.it01ApplyMessage, { - name: intl.formatMessage(messages.planningAndReportingTitle, { - abbreviation, - }), - }), - }, - { - key: "pr-it02", - title: intl.formatMessage(messages.it02Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it02Description), - pool: selectPoolForSection( - pools, - PoolStream.PlanningAndReporting, - "IT", - 2, - ), - applyMessage: intl.formatMessage(messages.it02ApplyMessage, { - name: intl.formatMessage(messages.planningAndReportingTitle, { - abbreviation, - }), - }), - }, - { - key: "pr-it03", - title: intl.formatMessage(messages.it03Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it03Description1)} -

-

- {intl.formatMessage(messages.it03Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.PlanningAndReporting, - "IT", - 3, - ), - applyMessage: intl.formatMessage(messages.it03ApplyMessage, { - name: intl.formatMessage(messages.planningAndReportingTitle, { - abbreviation, - }), - }), - }, - { - key: "pr-it04", - title: intl.formatMessage(messages.it04Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it04Description1, { - abbreviation, - })} -

-

- {intl.formatMessage(messages.it04Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.PlanningAndReporting, - "IT", - 4, - ), - applyMessage: intl.formatMessage(messages.it04ApplyMessage, { - name: intl.formatMessage(messages.planningAndReportingTitle, { - abbreviation, - }), - }), - }, - ], - }, - // IT project portfolio management - { - key: PoolStream.ProjectPortfolioManagement, - title: intl.formatMessage(messages.projectPortfolioManagementTitle, { - abbreviation, - }), - label: intl.formatMessage(messages.projectPortfolioManagementLabel), - summary: intl.formatMessage(messages.projectPortfolioSummary, { - abbreviation, - }), - classifications: [ - { - key: "ppm-it01", - title: intl.formatMessage(messages.it01Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it01Description), - pool: selectPoolForSection( - pools, - PoolStream.ProjectPortfolioManagement, - "IT", - 1, - ), - applyMessage: intl.formatMessage(messages.it01ApplyMessage, { - name: intl.formatMessage(messages.projectPortfolioManagementTitle, { - abbreviation, - }), - }), - }, - { - key: "ppm-it02", - title: intl.formatMessage(messages.it02Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it02Description), - pool: selectPoolForSection( - pools, - PoolStream.ProjectPortfolioManagement, - "IT", - 2, - ), - applyMessage: intl.formatMessage(messages.it02ApplyMessage, { - name: intl.formatMessage(messages.projectPortfolioManagementTitle, { - abbreviation, - }), - }), - }, - { - key: "ppm-it03", - title: intl.formatMessage(messages.it03Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it03Description1)} -

-

- {intl.formatMessage(messages.it03Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.ProjectPortfolioManagement, - "IT", - 3, - ), - applyMessage: intl.formatMessage(messages.it03ApplyMessage, { - name: intl.formatMessage(messages.projectPortfolioManagementTitle, { - abbreviation, - }), - }), - }, - { - key: "ppm-it04", - title: intl.formatMessage(messages.it04Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it04Description1, { - abbreviation, - })} -

-

- {intl.formatMessage(messages.it04Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.ProjectPortfolioManagement, - "IT", - 4, - ), - applyMessage: intl.formatMessage(messages.it04ApplyMessage, { - name: intl.formatMessage(messages.projectPortfolioManagementTitle, { - abbreviation, - }), - }), - }, - ], - }, - // IT security - { - key: PoolStream.Security, - title: intl.formatMessage(messages.securityTitle, { - abbreviation, - }), - label: intl.formatMessage(messages.securityLabel), - summary: intl.formatMessage(messages.securitySummary), - classifications: [ - { - key: "s-it01", - title: intl.formatMessage(messages.it01Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it01Description), - pool: selectPoolForSection(pools, PoolStream.Security, "IT", 1), - applyMessage: intl.formatMessage(messages.it01ApplyMessage, { - name: intl.formatMessage(messages.securityTitle, { - abbreviation, - }), - }), - }, - { - key: "s-it02", - title: intl.formatMessage(messages.it02Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it02Description), - pool: selectPoolForSection(pools, PoolStream.Security, "IT", 2), - applyMessage: intl.formatMessage(messages.it02ApplyMessage, { - name: intl.formatMessage(messages.securityTitle, { - abbreviation, - }), - }), - }, - { - key: "s-it03", - title: intl.formatMessage(messages.it03Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it03Description1)} -

-

- {intl.formatMessage(messages.it03Description2)} -

- - ), - pool: selectPoolForSection(pools, PoolStream.Security, "IT", 3), - applyMessage: intl.formatMessage(messages.it03ApplyMessage, { - name: intl.formatMessage(messages.securityTitle, { - abbreviation, - }), - }), - }, - { - key: "s-it04", - title: intl.formatMessage(messages.it04Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it04Description1, { - abbreviation, - })} -

-

- {intl.formatMessage(messages.it04Description2)} -

- - ), - pool: selectPoolForSection(pools, PoolStream.Security, "IT", 4), - - applyMessage: intl.formatMessage(messages.it04ApplyMessage, { - name: intl.formatMessage(messages.securityTitle, { - abbreviation, - }), - }), - }, - ], - }, - // IT software solutions - { - key: PoolStream.SoftwareSolutions, - title: intl.formatMessage(messages.softwareSolutionsTitle, { - abbreviation, - }), - label: intl.formatMessage(messages.softwareSolutionsLabel), - summary: intl.formatMessage(messages.softwareSolutionsSummary), - classifications: [ - { - key: "ss-it01", - title: intl.formatMessage(messages.it01Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it01Description), - pool: selectPoolForSection( - pools, - PoolStream.SoftwareSolutions, - "IT", - 1, - ), - applyMessage: intl.formatMessage(messages.it01ApplyMessage, { - name: intl.formatMessage(messages.softwareSolutionsTitle, { - abbreviation, - }), - }), - }, - { - key: "ss-it02", - title: intl.formatMessage(messages.it02Title, { - abbreviation, - }), - description: intl.formatMessage(messages.it02Description), - pool: selectPoolForSection( - pools, - PoolStream.SoftwareSolutions, - "IT", - 2, - ), - applyMessage: intl.formatMessage(messages.it02ApplyMessage, { - name: intl.formatMessage(messages.softwareSolutionsTitle, { - abbreviation, - }), - }), - }, - { - key: "ss-it03", - title: intl.formatMessage(messages.it03Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it03Description1)} -

-

- {intl.formatMessage(messages.it03Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.SoftwareSolutions, - "IT", - 3, - ), - applyMessage: intl.formatMessage(messages.it03ApplyMessage, { - name: intl.formatMessage(messages.softwareSolutionsTitle, { - abbreviation, - }), - }), - }, - { - key: "ss-it04", - title: intl.formatMessage(messages.it04Title, { - abbreviation, - }), - description: ( - <> -

- {intl.formatMessage(messages.it04Description1, { - abbreviation, - })} -

-

- {intl.formatMessage(messages.it04Description2)} -

- - ), - pool: selectPoolForSection( - pools, - PoolStream.SoftwareSolutions, - "IT", - 4, - ), - applyMessage: intl.formatMessage(messages.it04ApplyMessage, { - name: intl.formatMessage(messages.softwareSolutionsTitle, { - abbreviation, - }), - }), - }, - ], - }, - ]; - - // filter to only streams with classifications with a pool ID to apply to - const streamsWithAvailablePools = streams.filter( - (stream) => - !!stream.classifications.find( - (classification) => classification.pool?.id, - ), - ); - - // stream options for the - const options = [ - ...streamsWithAvailablePools.map((stream) => ({ - value: stream.key, - label: stream.label, - })), - ]; - - // if the quick filter is not "ALL", only show the filtered stream - const streamsToShow = - quickFilterStream !== "ALL" - ? streamsWithAvailablePools.filter((s) => s.key === quickFilterStream) - : streamsWithAvailablePools; - - // sort list so that recommended streams come first - streamsToShow.sort((s1, s2) => { - const a = streamIsRecommended(s1, mySkillIds) ? 1 : 0; - const b = streamIsRecommended(s2, mySkillIds) ? 1 : 0; - return b - a; - }); - - return ( - <> - - {intl.formatMessage({ - defaultMessage: "Apply to ongoing recruitment", - id: "RBsGRp", - description: "title for section with ongoing pool advertisements", - })} - -

- {intl.formatMessage({ - id: "Uzx5dR", - defaultMessage: - "Not seeing an active recruitment process that matches your skillset? No problem, we still want to hear from you.", - description: "summary for section with ongoing pool advertisements", - })} -

-

- {intl.formatMessage({ - id: "ITLoHV", - defaultMessage: - "We also offer passive recruitment processes that allow us to find talent fast when the demand arises. While there’s no guarantee a job will result from the opportunities below, it’s an easy way for your name and career timeline to be found by managers when the time comes. Feel free to submit your name to any stream that matches your skills.", - description: - "instructions for section with ongoing pool advertisements", - })} -

-

- {intl.formatMessage({ - defaultMessage: "Select a job stream", - id: "dJXjhw", - description: - "Placeholder for stream filter in browse opportunities form.", - })} -

-
- - - - - -
- - - { - setQuickFilterStream("ALL"); - }} - > - - - - - {intl.formatMessage({ - defaultMessage: "All", - id: "XnvXtO", - description: "All", - })} - - - - {options.map((option, index) => ( - - { - setQuickFilterStream(option.value); - }} - > - - - - {option.label} - - - {index + 1 < options.length && } - - ))} - -
-
-
-
-

- {quickFilterStream !== "ALL" - ? intl.formatMessage( - { - defaultMessage: - "The list is filtered to the {jobStream} job stream.", - id: "SypvZP", - description: - "Announcement that the job stream filter is active.", - }, - { - jobStream: streams.find((s) => s.key === quickFilterStream) - ?.title, - }, - ) - : intl.formatMessage({ - defaultMessage: "The list is not filtered.", - id: "0lDq3P", - description: - "Announcement that the job stream filter is not active.", - })} -

- {streamsToShow.length ? ( - - {streamsToShow.map((stream) => ( - - - - {intl.formatMessage({ - defaultMessage: "Recommended based on your skills", - id: "LFYdXR", - description: - "Tip that your skills match this section well and so it is recommended", - })} - - - ) : undefined - } - > - {stream.title} - - -
- {stream.classifications - .filter( - // filter to only classifications with a pool ID that can be applied to - (classification) => classification.pool?.id, - ) - .map((classification) => ( -
-

- {classification.title} -

-
- {classification.description} -
- {classification.pool?.id && ( - - {classification.applyMessage} - - )} -
- ))} -
-
-
- ))} -
- ) : null} - - ); -}; - -export default OngoingRecruitmentSection; diff --git a/apps/web/src/utils/poolCandidate.ts b/apps/web/src/utils/poolCandidate.ts index beda7f5d1fd..1d8774ae22c 100644 --- a/apps/web/src/utils/poolCandidate.ts +++ b/apps/web/src/utils/poolCandidate.ts @@ -39,7 +39,6 @@ import { SCREENED_OUT_STATUSES, } from "~/constants/poolCandidate"; -import { isOngoingPublishingGroup } from "./poolUtils"; import { NullableDecision } from "./assessmentResults"; export const isDisqualifiedStatus = ( @@ -87,14 +86,6 @@ export const isSuspendedStatus = ( return !!(isSuspended && status === PoolCandidateStatus.QualifiedAvailable); }; -export const getRecruitmentType = ( - publishingGroup: Maybe | undefined, - intl: IntlShape, -) => - isOngoingPublishingGroup(publishingGroup) - ? intl.formatMessage(poolCandidateMessages.ongoingRecruitment) - : intl.formatMessage(poolCandidateMessages.targetedRecruitment); - export const isDraft = ( status: Maybe | undefined, ): boolean => { diff --git a/apps/web/src/utils/poolUtils.tsx b/apps/web/src/utils/poolUtils.tsx index a7e3d7a8871..5bf1d60ab40 100644 --- a/apps/web/src/utils/poolUtils.tsx +++ b/apps/web/src/utils/poolUtils.tsx @@ -30,7 +30,6 @@ import { import { PageNavInfo } from "~/types/pages"; import useRoutes from "~/hooks/useRoutes"; import poolMessages from "~/messages/poolMessages"; -import { ONGOING_PUBLISHING_GROUPS } from "~/constants/pool"; import { PageNavKeys, PoolCompleteness } from "~/types/pool"; import messages from "~/messages/adminMessages"; @@ -380,11 +379,6 @@ export const useAdminPoolPages = ( ]); }; -export const isOngoingPublishingGroup = ( - publishingGroup: Maybe | undefined, -): boolean => - publishingGroup ? ONGOING_PUBLISHING_GROUPS.includes(publishingGroup) : false; - export const getAdvertisementStatus = ( pool?: Pick, ): PoolCompleteness => { From a5a591e19639ed700f46c5e43924e1aff45f13f1 Mon Sep 17 00:00:00 2001 From: Matt Nigh Date: Tue, 3 Dec 2024 15:40:42 -0500 Subject: [PATCH 2/6] Remove unused variable --- apps/web/src/utils/poolCandidate.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/src/utils/poolCandidate.ts b/apps/web/src/utils/poolCandidate.ts index 1d8774ae22c..3b91651483d 100644 --- a/apps/web/src/utils/poolCandidate.ts +++ b/apps/web/src/utils/poolCandidate.ts @@ -16,7 +16,6 @@ import { Maybe, PoolCandidate, PoolCandidateStatus, - PublishingGroup, OverallAssessmentStatus, AssessmentResultStatus, ClaimVerificationResult, From 0e10694b5245c6e2de03e189cf7aa9d0f1124de1 Mon Sep 17 00:00:00 2001 From: Matt Nigh Date: Tue, 3 Dec 2024 16:30:59 -0500 Subject: [PATCH 3/6] Update PHP formatting --- api/database/factories/PoolFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/database/factories/PoolFactory.php b/api/database/factories/PoolFactory.php index aef95dc2269..b44a0885c55 100644 --- a/api/database/factories/PoolFactory.php +++ b/api/database/factories/PoolFactory.php @@ -297,7 +297,7 @@ public function candidatesAvailableInSearch() { return $this->published()->state(function () { return [ - 'publishing_group' => PublishingGroup::IT_JOBS->name + 'publishing_group' => PublishingGroup::IT_JOBS->name, ]; }); } From 35c1f3bb2491e0bd4c91c4ec2427cc940a51a0f2 Mon Sep 17 00:00:00 2001 From: Matt Nigh Date: Wed, 4 Dec 2024 14:59:29 -0500 Subject: [PATCH 4/6] Update Message to user when no qualified recruitments have been attached to profile, paragraph two --- apps/web/src/lang/fr.json | 8 ++++---- .../components/QualifiedRecruitmentsSection.tsx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/web/src/lang/fr.json b/apps/web/src/lang/fr.json index b10f2db89af..a89804dbdbf 100644 --- a/apps/web/src/lang/fr.json +++ b/apps/web/src/lang/fr.json @@ -5907,6 +5907,10 @@ "defaultMessage": "Ma situation concorde avec l’option d’expérience de travail appliquée", "description": "Radio group option for education requirement filter in application education form." }, + "SP8yeX": { + "defaultMessage": "Vous pouvez commencer par formuler une demande dans le cadre d’un processus de recrutement.", + "description": "Message to user when no qualified recruitments have been attached to profile, paragraph two." + }, "SQJgGP": { "defaultMessage": "Votre information sur l’annonce et votre plan d'évaluation sont complets.", "description": "Lead-in text on a complete process, ready for publishing" @@ -12254,10 +12258,6 @@ "defaultMessage": "ne respectent pas les principes de la Charte canadienne des droits et libertés, Loi constitutionnelle de 1982", "description": "Comments or contributions list item" }, - "z7FpHz": { - "defaultMessage": "Vous pouvez commencer par formuler une demande dans le cadre d’un processus de recrutement ciblé ou en cours.", - "description": "Message to user when no qualified recruitments have been attached to profile, paragraph two." - }, "z8b14H": { "defaultMessage": "contiennent des renseignements personnels", "description": "Comments or contributions list item" diff --git a/apps/web/src/pages/Profile/CareerTimelineAndRecruitmentPage/components/QualifiedRecruitmentsSection.tsx b/apps/web/src/pages/Profile/CareerTimelineAndRecruitmentPage/components/QualifiedRecruitmentsSection.tsx index af87cf70be7..cd83bd56d95 100644 --- a/apps/web/src/pages/Profile/CareerTimelineAndRecruitmentPage/components/QualifiedRecruitmentsSection.tsx +++ b/apps/web/src/pages/Profile/CareerTimelineAndRecruitmentPage/components/QualifiedRecruitmentsSection.tsx @@ -77,8 +77,8 @@ const QualifiedRecruitmentsSection = ({ {intl.formatMessage({ defaultMessage: - "You can get started by applying to available targeted or ongoing recruitment processes.", - id: "z7FpHz", + "You can get started by applying to available recruitment processes.", + id: "SP8yeX", description: "Message to user when no qualified recruitments have been attached to profile, paragraph two.", })} From 60f2514fb794da4fee6e3878272ed66b1638a472 Mon Sep 17 00:00:00 2001 From: Matt Nigh Date: Wed, 4 Dec 2024 15:12:46 -0500 Subject: [PATCH 5/6] Update Description for the track applications section on the profile and applications, paragraph one. --- apps/web/src/lang/fr.json | 8 ++++---- .../components/TrackApplications/TrackApplications.tsx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/web/src/lang/fr.json b/apps/web/src/lang/fr.json index a89804dbdbf..f71ba292725 100644 --- a/apps/web/src/lang/fr.json +++ b/apps/web/src/lang/fr.json @@ -215,6 +215,10 @@ "defaultMessage": "Fournissez vos renseignements", "description": "How it works, step 2 heading" }, + "/61ANw": { + "defaultMessage": "Les candidatures pour les possibilités de recrutement peuvent être gérées et suivies ici. Vous pourrez voir les dates limites de présentation des candidatures, le statut de votre candidature au fil du temps et les candidatures antérieures.", + "description": "Description for the track applications section on the profile and applications, paragraph one." + }, "/81xCT": { "defaultMessage": "« Je suis métisse ou métis »", "description": "Label text for Métis community declaration" @@ -9286,10 +9290,6 @@ "defaultMessage": "Modifiez les informations sur le groupe de compétences", "description": "Link text to edit a skill family" }, - "igTx2a": { - "defaultMessage": "Les candidatures pour le bassin de talents et les possibilités de recrutement en cours peuvent être gérées et suivies ici. Vous pourrez voir les dates limites de présentation des candidatures, le statut de votre candidature au fil du temps et les candidatures antérieures.", - "description": "Description for the track applications section on the profile and applications, paragraph one." - }, "iiEGjW": { "defaultMessage": "Nous avons bien reçu votre message.", "description": "Support form success title" diff --git a/apps/web/src/pages/ProfileAndApplicationsPage/components/TrackApplications/TrackApplications.tsx b/apps/web/src/pages/ProfileAndApplicationsPage/components/TrackApplications/TrackApplications.tsx index 4289f23f9cf..88f474b6766 100644 --- a/apps/web/src/pages/ProfileAndApplicationsPage/components/TrackApplications/TrackApplications.tsx +++ b/apps/web/src/pages/ProfileAndApplicationsPage/components/TrackApplications/TrackApplications.tsx @@ -78,8 +78,8 @@ const TrackApplications = ({ applicationsQuery }: TrackApplicationsProps) => {

{intl.formatMessage({ defaultMessage: - "Applications to talent pool and ongoing recruitment opportunities can be managed and tracked here. You’ll be able to see submission deadlines, your application’s status over time, and past applications.", - id: "igTx2a", + "Applications to recruitment opportunities can be managed and tracked here. You’ll be able to see submission deadlines, your application’s status over time, and past applications.", + id: "/61ANw", description: "Description for the track applications section on the profile and applications, paragraph one.", })} From e5bf64e4a9e1827ae87552dab31a9f18be7746f1 Mon Sep 17 00:00:00 2001 From: Matt Nigh Date: Wed, 4 Dec 2024 16:28:05 -0500 Subject: [PATCH 6/6] Update Summary for the feature about finding manager jobs --- apps/web/src/lang/fr.json | 8 ++++---- .../pages/Home/ExecutiveHomePage/ExecutiveHomePage.tsx | 4 ++-- .../src/pages/Home/ManagerHomePage/ManagerHomePage.tsx | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/web/src/lang/fr.json b/apps/web/src/lang/fr.json index f71ba292725..f675664f682 100644 --- a/apps/web/src/lang/fr.json +++ b/apps/web/src/lang/fr.json @@ -4539,6 +4539,10 @@ "defaultMessage": "Collectivité", "description": "Title for community" }, + "LQbKTy": { + "defaultMessage": "Consultez nos possibilités d'emploi pour trouver un poste de gestionnaire qui vous inspire. Posez votre candidature pour jouer un rôle clé au sein de l'une des équipes de TI du gouvernement du Canada et avoir un impact significatif.", + "description": "Summary for the feature about finding manager jobs" + }, "LTpCFL": { "defaultMessage": "À propos de nous", "description": "Title for about us section on a pool advertisement." @@ -8766,10 +8770,6 @@ "defaultMessage": "Ajoutez une expérience à votre parcours professionnel", "description": "Title for application career timeline add experience" }, - "gURsqG": { - "defaultMessage": "Consultez les processus de recrutement de gestionnaires les plus récents afin de connaître les possibilités d'emploi spécifiques ou posez votre candidature à un processus de recrutement en cours dans l'un des volets de travail génériques des TI. Consultez régulièrement le site pour connaître les nouvelles possibilités d'emploi.", - "description": "Summary for the feature about finding manager jobs" - }, "gUb3PY": { "defaultMessage": "Demande créée avec succès!", "description": "Message displayed to user after a pool candidate request is created successfully." diff --git a/apps/web/src/pages/Home/ExecutiveHomePage/ExecutiveHomePage.tsx b/apps/web/src/pages/Home/ExecutiveHomePage/ExecutiveHomePage.tsx index 1915e2c38a5..92288ebead9 100644 --- a/apps/web/src/pages/Home/ExecutiveHomePage/ExecutiveHomePage.tsx +++ b/apps/web/src/pages/Home/ExecutiveHomePage/ExecutiveHomePage.tsx @@ -237,8 +237,8 @@ export const HomePage = ({ pools }: HomePageProps) => {

{intl.formatMessage({ defaultMessage: - "Check out the most recent manager recruitment processes for specific opportunities or apply to ongoing recruitment in any of the IT generic work streams. Check back often for new opportunities.", - id: "gURsqG", + "Check out our job opportunities to find a manager position that inspires you. Apply to play a key role in one of the IT teams at the Government of Canada and make a meaningful impact.", + id: "LQbKTy", description: "Summary for the feature about finding manager jobs", })} diff --git a/apps/web/src/pages/Home/ManagerHomePage/ManagerHomePage.tsx b/apps/web/src/pages/Home/ManagerHomePage/ManagerHomePage.tsx index d99e0733de0..e537910368a 100644 --- a/apps/web/src/pages/Home/ManagerHomePage/ManagerHomePage.tsx +++ b/apps/web/src/pages/Home/ManagerHomePage/ManagerHomePage.tsx @@ -336,8 +336,8 @@ const ManagerHomePage = () => {

{intl.formatMessage({ defaultMessage: - "Check out the most recent manager recruitment processes for specific opportunities or apply to ongoing recruitment in any of the IT generic work streams. Check back often for new opportunities.", - id: "gURsqG", + "Check out our job opportunities to find a manager position that inspires you. Apply to play a key role in one of the IT teams at the Government of Canada and make a meaningful impact.", + id: "LQbKTy", description: "Summary for the feature about finding manager jobs", })}