From c01cdb2238267e51692635b018ee23a7f3949e23 Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:44:55 -0400 Subject: [PATCH 01/21] index page --- apps/web/src/messages/pageTitles.ts | 5 ++++ .../pages/Departments/IndexDepartmentPage.tsx | 20 +++++++------ .../components/DepartmentTable.tsx | 28 +++++++++---------- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/apps/web/src/messages/pageTitles.ts b/apps/web/src/messages/pageTitles.ts index 9a10e0525cb..0d073a242a1 100644 --- a/apps/web/src/messages/pageTitles.ts +++ b/apps/web/src/messages/pageTitles.ts @@ -66,4 +66,9 @@ export default defineMessages({ id: "bVQ/rm", description: "Title for the index user page", }, + adminDashboard: { + defaultMessage: "Admin dashboard", + id: "S0RMA8", + description: "Title for the admin dashboard page", + }, }); diff --git a/apps/web/src/pages/Departments/IndexDepartmentPage.tsx b/apps/web/src/pages/Departments/IndexDepartmentPage.tsx index 86f99e0e64e..c8a7d58d282 100644 --- a/apps/web/src/pages/Departments/IndexDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/IndexDepartmentPage.tsx @@ -3,12 +3,11 @@ import { useIntl } from "react-intl"; import { ROLE_NAME } from "@gc-digital-talent/auth"; import SEO from "~/components/SEO/SEO"; -import AdminContentWrapper from "~/components/AdminContentWrapper/AdminContentWrapper"; import useRoutes from "~/hooks/useRoutes"; -import AdminHero from "~/components/HeroDeprecated/AdminHero"; import useBreadcrumbs from "~/hooks/useBreadcrumbs"; import RequireAuth from "~/components/RequireAuth/RequireAuth"; import pageTitles from "~/messages/pageTitles"; +import Hero from "~/components/Hero"; import DepartmentTableApi from "./components/DepartmentTable"; @@ -19,6 +18,10 @@ export const DepartmentPage = () => { const navigationCrumbs = useBreadcrumbs({ crumbs: [ + { + label: intl.formatMessage(pageTitles.adminDashboard), + url: routes.adminDashboard(), + }, { label: formattedPageTitle, url: routes.departmentTable(), @@ -30,13 +33,12 @@ export const DepartmentPage = () => { return ( <> - - - - + +
+
+ +
+
); }; diff --git a/apps/web/src/pages/Departments/components/DepartmentTable.tsx b/apps/web/src/pages/Departments/components/DepartmentTable.tsx index 709677cd6be..80e23c6bae0 100644 --- a/apps/web/src/pages/Departments/components/DepartmentTable.tsx +++ b/apps/web/src/pages/Departments/components/DepartmentTable.tsx @@ -47,30 +47,30 @@ export const DepartmentTable = ({ departmentsQuery, ); const columns = [ - columnHelper.accessor("departmentNumber", { - id: "departmentNumber", - filterFn: "weakEquals", - header: intl.formatMessage({ - defaultMessage: "Department #", - id: "QOvS1b", - description: - "Title displayed for the Department table Department # column.", - }), - }), columnHelper.accessor((row) => getLocalizedName(row.name, intl), { id: "name", sortingFn: normalizedText, header: intl.formatMessage(commonMessages.name), - }), - columnHelper.display({ - id: "edit", - header: intl.formatMessage(commonMessages.edit), cell: ({ row: { original: department } }) => cells.edit( department.id, paths.departmentTable(), getLocalizedName(department.name, intl, true), + getLocalizedName(department.name, intl, true), ), + meta: { + isRowTitle: true, + }, + }), + columnHelper.accessor("departmentNumber", { + id: "departmentNumber", + filterFn: "weakEquals", + header: intl.formatMessage({ + defaultMessage: "Department #", + id: "QOvS1b", + description: + "Title displayed for the Department table Department # column.", + }), }), ] as ColumnDef[]; From 39767350001b9f4815c9b8c0a7c8c86871dc961c Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:49:02 -0400 Subject: [PATCH 02/21] index page labels --- .../Departments/components/DepartmentTable.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/web/src/pages/Departments/components/DepartmentTable.tsx b/apps/web/src/pages/Departments/components/DepartmentTable.tsx index 80e23c6bae0..3c90a484e9c 100644 --- a/apps/web/src/pages/Departments/components/DepartmentTable.tsx +++ b/apps/web/src/pages/Departments/components/DepartmentTable.tsx @@ -95,17 +95,17 @@ export const DepartmentTable = ({ search={{ internal: true, label: intl.formatMessage({ - defaultMessage: "Search departments", - id: "bUyxJi", - description: "Label for the departments table search input", + defaultMessage: "Search by keyword", + id: "PYMFoh", + description: "Label for the keyword search input", }), }} add={{ linkProps: { href: paths.departmentCreate(), label: intl.formatMessage({ - defaultMessage: "Create Department", - id: "ZbpbD6", + defaultMessage: "Create new department", + id: "c7d3np", description: "Heading displayed above the Create Department form.", }), from: currentUrl, @@ -113,8 +113,9 @@ export const DepartmentTable = ({ }} nullMessage={{ description: intl.formatMessage({ - defaultMessage: 'Use the "Create Department" button to get started.', - id: "yat9wx", + defaultMessage: + 'Use the "Create new department" button to get started.', + id: "VpqH38", description: "Instructions for adding a department item.", }), }} From 8886088b70242c3b0f9a1ec15041fe729b978e02 Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:36:52 -0400 Subject: [PATCH 03/21] create page --- .../Departments/CreateDepartmentPage.tsx | 150 ++++++++++++------ apps/web/src/pages/Departments/messages.ts | 19 +++ 2 files changed, 119 insertions(+), 50 deletions(-) create mode 100644 apps/web/src/pages/Departments/messages.ts diff --git a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx index a4d94fb4198..0eee87698d6 100644 --- a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx @@ -2,22 +2,28 @@ import { useNavigate } from "react-router-dom"; import { FormProvider, SubmitHandler, useForm } from "react-hook-form"; import { useIntl } from "react-intl"; import { useMutation } from "urql"; +import IdentificationIcon from "@heroicons/react/24/outline/IdentificationIcon"; import { toast } from "@gc-digital-talent/toast"; import { Input, Submit } from "@gc-digital-talent/forms"; -import { errorMessages } from "@gc-digital-talent/i18n"; +import { + commonMessages, + errorMessages, + formMessages, +} from "@gc-digital-talent/i18n"; import { graphql, CreateDepartmentInput } from "@gc-digital-talent/graphql"; import { ROLE_NAME } from "@gc-digital-talent/auth"; +import { Heading, Link, Separator } from "@gc-digital-talent/ui"; import SEO from "~/components/SEO/SEO"; import useRoutes from "~/hooks/useRoutes"; -import AdminContentWrapper from "~/components/AdminContentWrapper/AdminContentWrapper"; -import AdminHero from "~/components/HeroDeprecated/AdminHero"; -import adminMessages from "~/messages/adminMessages"; import useBreadcrumbs from "~/hooks/useBreadcrumbs"; import RequireAuth from "~/components/RequireAuth/RequireAuth"; import pageTitles from "~/messages/pageTitles"; import useReturnPath from "~/hooks/useReturnPath"; +import Hero from "~/components/Hero"; + +import { labels } from "./messages"; type FormValues = CreateDepartmentInput; @@ -65,53 +71,87 @@ export const CreateDepartmentForm = ({ }; return ( -
+ <> +
+ + {intl.formatMessage({ + defaultMessage: "Department information", + id: "eNTKLK", + description: "Heading for the 'create a department' form", + })} + +
+
- - - + + +
+ +
+ + -
- +
+ + + {intl.formatMessage(commonMessages.cancel)} +
-
+ ); }; @@ -142,6 +182,10 @@ const CreateDepartmentPage = () => { const navigationCrumbs = useBreadcrumbs({ crumbs: [ + { + label: intl.formatMessage(pageTitles.adminDashboard), + url: routes.adminDashboard(), + }, { label: intl.formatMessage(pageTitles.departments), url: routes.departmentTable(), @@ -159,21 +203,27 @@ const CreateDepartmentPage = () => { }); const pageTitle = intl.formatMessage({ - defaultMessage: "Create department", - id: "PRrRRN", + defaultMessage: "Create a department", + id: "ZpYj8o", description: "Page title for the department creation page", }); return ( <> - - - - + +
+ +
+
); }; diff --git a/apps/web/src/pages/Departments/messages.ts b/apps/web/src/pages/Departments/messages.ts new file mode 100644 index 00000000000..bccad3601c5 --- /dev/null +++ b/apps/web/src/pages/Departments/messages.ts @@ -0,0 +1,19 @@ +import { defineMessage } from "react-intl"; + +export const labels = { + nameEn: defineMessage({ + defaultMessage: "Department name (English)", + id: "nZgmOO", + description: "Label for department name in English", + }), + nameFr: defineMessage({ + defaultMessage: "Department name (French)", + id: "8q2dPO", + description: "Label for department name in French", + }), + departmentNumber: defineMessage({ + defaultMessage: "Department number", + id: "66kU6k", + description: "Label for department number", + }), +} as const; From 7cfa953f91a2cc3485e9d4612bcb2013dbc58d09 Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:44:51 -0400 Subject: [PATCH 04/21] fix create department buttons --- .../Departments/CreateDepartmentPage.tsx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx index 0eee87698d6..ed7e2aa793e 100644 --- a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx @@ -6,11 +6,7 @@ import IdentificationIcon from "@heroicons/react/24/outline/IdentificationIcon"; import { toast } from "@gc-digital-talent/toast"; import { Input, Submit } from "@gc-digital-talent/forms"; -import { - commonMessages, - errorMessages, - formMessages, -} from "@gc-digital-talent/i18n"; +import { errorMessages } from "@gc-digital-talent/i18n"; import { graphql, CreateDepartmentInput } from "@gc-digital-talent/graphql"; import { ROLE_NAME } from "@gc-digital-talent/auth"; import { Heading, Link, Separator } from "@gc-digital-talent/ui"; @@ -144,9 +140,19 @@ export const CreateDepartmentForm = ({ data-h2-gap="base(x1)" data-h2-align-items="base(center)" > - + - {intl.formatMessage(commonMessages.cancel)} + {intl.formatMessage({ + defaultMessage: "Cancel and go back to departments", + id: "uqI3Vf", + description: "Button label to return to the departments table", + })} From e23d48f2d78ef2143401cde122576ea17ac172d3 Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:01:40 -0400 Subject: [PATCH 05/21] remove admin dashboard crumb --- apps/web/src/messages/pageTitles.ts | 5 ----- apps/web/src/pages/Departments/CreateDepartmentPage.tsx | 4 ---- apps/web/src/pages/Departments/IndexDepartmentPage.tsx | 4 ---- 3 files changed, 13 deletions(-) diff --git a/apps/web/src/messages/pageTitles.ts b/apps/web/src/messages/pageTitles.ts index 0d073a242a1..9a10e0525cb 100644 --- a/apps/web/src/messages/pageTitles.ts +++ b/apps/web/src/messages/pageTitles.ts @@ -66,9 +66,4 @@ export default defineMessages({ id: "bVQ/rm", description: "Title for the index user page", }, - adminDashboard: { - defaultMessage: "Admin dashboard", - id: "S0RMA8", - description: "Title for the admin dashboard page", - }, }); diff --git a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx index ed7e2aa793e..f8ea26c2745 100644 --- a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx @@ -188,10 +188,6 @@ const CreateDepartmentPage = () => { const navigationCrumbs = useBreadcrumbs({ crumbs: [ - { - label: intl.formatMessage(pageTitles.adminDashboard), - url: routes.adminDashboard(), - }, { label: intl.formatMessage(pageTitles.departments), url: routes.departmentTable(), diff --git a/apps/web/src/pages/Departments/IndexDepartmentPage.tsx b/apps/web/src/pages/Departments/IndexDepartmentPage.tsx index c8a7d58d282..91c8893721f 100644 --- a/apps/web/src/pages/Departments/IndexDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/IndexDepartmentPage.tsx @@ -18,10 +18,6 @@ export const DepartmentPage = () => { const navigationCrumbs = useBreadcrumbs({ crumbs: [ - { - label: intl.formatMessage(pageTitles.adminDashboard), - url: routes.adminDashboard(), - }, { label: formattedPageTitle, url: routes.departmentTable(), From b88aa8706835fa28328d251b85817437801e5c93 Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:12:07 -0400 Subject: [PATCH 06/21] view department page --- apps/web/src/components/Router.tsx | 5 + apps/web/src/hooks/useRoutes.ts | 2 + .../Departments/CreateDepartmentPage.tsx | 13 +- .../pages/Departments/ViewDepartmentPage.tsx | 216 ++++++++++++++++++ .../components/DepartmentTable.tsx | 7 +- apps/web/src/pages/Departments/messages.ts | 19 -- 6 files changed, 232 insertions(+), 30 deletions(-) create mode 100644 apps/web/src/pages/Departments/ViewDepartmentPage.tsx delete mode 100644 apps/web/src/pages/Departments/messages.ts diff --git a/apps/web/src/components/Router.tsx b/apps/web/src/components/Router.tsx index bd7401fd5e7..50422c87b72 100644 --- a/apps/web/src/components/Router.tsx +++ b/apps/web/src/components/Router.tsx @@ -806,6 +806,11 @@ const createRoute = (locale: Locales) => { path: ":departmentId", children: [ + { + index: true, + lazy: () => + import("../pages/Departments/ViewDepartmentPage"), + }, { path: "edit", lazy: () => diff --git a/apps/web/src/hooks/useRoutes.ts b/apps/web/src/hooks/useRoutes.ts index 73c4b56b45a..15b67d7bdd9 100644 --- a/apps/web/src/hooks/useRoutes.ts +++ b/apps/web/src/hooks/useRoutes.ts @@ -146,6 +146,8 @@ const getRoutes = (lang: Locales) => { departmentTable: () => [adminUrl, "settings", "departments"].join("/"), departmentCreate: () => [adminUrl, "settings", "departments", "create"].join("/"), + departmentView: (departmentId: string) => + [adminUrl, "settings", "departments", departmentId].join("/"), departmentUpdate: (departmentId: string) => [adminUrl, "settings", "departments", departmentId, "edit"].join("/"), diff --git a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx index f8ea26c2745..8e1a7d37ae0 100644 --- a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx @@ -18,8 +18,7 @@ import RequireAuth from "~/components/RequireAuth/RequireAuth"; import pageTitles from "~/messages/pageTitles"; import useReturnPath from "~/hooks/useReturnPath"; import Hero from "~/components/Hero"; - -import { labels } from "./messages"; +import adminMessages from "~/messages/adminMessages"; type FormValues = CreateDepartmentInput; @@ -101,7 +100,7 @@ export const CreateDepartmentForm = ({ ; +} + +export const ViewDepartmentForm = ({ query }: ViewDepartmentProps) => { + const intl = useIntl(); + const paths = useRoutes(); + const department = getFragment(DepartmentView_Fragment, query); + + return ( + <> +
+ + {intl.formatMessage({ + defaultMessage: "Department information", + id: "eNTKLK", + description: "Heading for the 'create a department' form", + })} + +
+ +
+ + {department.name.en} + + + {department.name.fr} + +
+ + {department.departmentNumber} + +
+
+ + + {intl.formatMessage({ + defaultMessage: "Edit department information", + id: "os2TYf", + description: "Link to edit the currently viewed department", + })} + +
+ + ); +}; + +interface RouteParams extends Record { + departmentId: Scalars["ID"]["output"]; +} + +const Department_Query = graphql(/* GraphQL */ ` + query ViewDepartmentPage($id: UUID!) { + department(id: $id) { + name { + en + fr + } + ...DepartmentForm + } + } +`); + +const ViewDepartmentPage = () => { + const intl = useIntl(); + const routes = useRoutes(); + const { departmentId } = useRequiredParams("departmentId"); + const [{ data, fetching, error }] = useQuery({ + query: Department_Query, + variables: { id: departmentId }, + }); + + const departmentName = getLocalizedName(data?.department?.name, intl); + + const navigationCrumbs = useBreadcrumbs({ + crumbs: [ + { + label: intl.formatMessage(pageTitles.departments), + url: routes.departmentTable(), + }, + { + label: departmentName, + url: routes.departmentView(departmentId), + }, + ], + isAdmin: true, + }); + + const navTabs = [ + { + url: routes.departmentView(departmentId), + label: intl.formatMessage({ + defaultMessage: "Department information", + id: "sp9OKU", + description: "Nav tab label for department information", + }), + }, + ]; + + return ( + <> + + +
+
+ + {data?.department ? ( + + ) : ( + +

+ {intl.formatMessage( + { + defaultMessage: "Department {departmentId} not found.", + id: "8Otaw9", + description: + "Message displayed for department not found.", + }, + { departmentId }, + )} +

+
+ )} +
+
+
+ + ); +}; + +export const Component = () => ( + + + +); + +Component.displayName = "AdminUpdateDepartmentPage"; + +export default ViewDepartmentPage; diff --git a/apps/web/src/pages/Departments/components/DepartmentTable.tsx b/apps/web/src/pages/Departments/components/DepartmentTable.tsx index 3c90a484e9c..fc63b99304d 100644 --- a/apps/web/src/pages/Departments/components/DepartmentTable.tsx +++ b/apps/web/src/pages/Departments/components/DepartmentTable.tsx @@ -52,12 +52,7 @@ export const DepartmentTable = ({ sortingFn: normalizedText, header: intl.formatMessage(commonMessages.name), cell: ({ row: { original: department } }) => - cells.edit( - department.id, - paths.departmentTable(), - getLocalizedName(department.name, intl, true), - getLocalizedName(department.name, intl, true), - ), + cells.view(department.id, getLocalizedName(department.name, intl)), meta: { isRowTitle: true, }, diff --git a/apps/web/src/pages/Departments/messages.ts b/apps/web/src/pages/Departments/messages.ts deleted file mode 100644 index bccad3601c5..00000000000 --- a/apps/web/src/pages/Departments/messages.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { defineMessage } from "react-intl"; - -export const labels = { - nameEn: defineMessage({ - defaultMessage: "Department name (English)", - id: "nZgmOO", - description: "Label for department name in English", - }), - nameFr: defineMessage({ - defaultMessage: "Department name (French)", - id: "8q2dPO", - description: "Label for department name in French", - }), - departmentNumber: defineMessage({ - defaultMessage: "Department number", - id: "66kU6k", - description: "Label for department number", - }), -} as const; From 66d01f7c27ca70f2d3255332e678b04f6fb57be7 Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:20:41 -0400 Subject: [PATCH 07/21] view department mobile view --- .../pages/Departments/ViewDepartmentPage.tsx | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/apps/web/src/pages/Departments/ViewDepartmentPage.tsx b/apps/web/src/pages/Departments/ViewDepartmentPage.tsx index 35162eefd80..1da312ec730 100644 --- a/apps/web/src/pages/Departments/ViewDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/ViewDepartmentPage.tsx @@ -1,6 +1,6 @@ import { useIntl } from "react-intl"; import { useQuery } from "urql"; -import CloudIcon from "@heroicons/react/24/outline/CloudIcon"; +import IdentificationIcon from "@heroicons/react/24/outline/IdentificationIcon"; import { commonMessages, getLocalizedName } from "@gc-digital-talent/i18n"; import { @@ -58,7 +58,7 @@ export const ViewDepartmentForm = ({ query }: ViewDepartmentProps) => { {intl.formatMessage({ @@ -101,16 +101,21 @@ export const ViewDepartmentForm = ({ query }: ViewDepartmentProps) => { data-h2-margin="base(0)" data-h2-color="base(gray.light)" /> - - {intl.formatMessage({ - defaultMessage: "Edit department information", - id: "os2TYf", - description: "Link to edit the currently viewed department", - })} - + + {intl.formatMessage({ + defaultMessage: "Edit department information", + id: "os2TYf", + description: "Link to edit the currently viewed department", + })} + + ); From 4162b857e131dbefe8f55202617b6eead8d4b99a Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:13:43 -0400 Subject: [PATCH 08/21] update department page --- .../Departments/UpdateDepartmentPage.tsx | 212 ++++++++++++------ .../pages/Departments/ViewDepartmentPage.tsx | 11 +- 2 files changed, 146 insertions(+), 77 deletions(-) diff --git a/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx b/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx index 36a27b2ac0e..abdad79dab1 100644 --- a/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx @@ -3,11 +3,23 @@ import { FormProvider, SubmitHandler, useForm } from "react-hook-form"; import { useIntl } from "react-intl"; import pick from "lodash/pick"; import { useMutation, useQuery } from "urql"; +import IdentificationIcon from "@heroicons/react/24/outline/IdentificationIcon"; import { toast } from "@gc-digital-talent/toast"; import { Input, Submit } from "@gc-digital-talent/forms"; -import { errorMessages, commonMessages } from "@gc-digital-talent/i18n"; -import { Pending, NotFound } from "@gc-digital-talent/ui"; +import { + errorMessages, + commonMessages, + formMessages, + getLocalizedName, +} from "@gc-digital-talent/i18n"; +import { + Pending, + NotFound, + Heading, + Separator, + Link, +} from "@gc-digital-talent/ui"; import { FragmentType, Scalars, @@ -19,14 +31,13 @@ import { ROLE_NAME } from "@gc-digital-talent/auth"; import SEO from "~/components/SEO/SEO"; import useRoutes from "~/hooks/useRoutes"; -import AdminContentWrapper from "~/components/AdminContentWrapper/AdminContentWrapper"; import useRequiredParams from "~/hooks/useRequiredParams"; -import AdminHero from "~/components/HeroDeprecated/AdminHero"; import adminMessages from "~/messages/adminMessages"; import useBreadcrumbs from "~/hooks/useBreadcrumbs"; import RequireAuth from "~/components/RequireAuth/RequireAuth"; import pageTitles from "~/messages/pageTitles"; import useReturnPath from "~/hooks/useReturnPath"; +import Hero from "~/components/Hero"; export const DepartmentForm_Fragment = graphql(/* GraphQL */ ` fragment DepartmentForm on Department { @@ -65,7 +76,7 @@ export const UpdateDepartmentForm = ({ }); const { handleSubmit } = methods; - const navigateTo = useReturnPath(paths.departmentTable()); + const navigateTo = useReturnPath(paths.departmentView(initialDepartment.id)); const onSubmit: SubmitHandler = async (data: FormValues) => { return handleUpdateDepartment(initialDepartment.id, { @@ -96,53 +107,90 @@ export const UpdateDepartmentForm = ({ }; return ( -
+ <> +
+ + {intl.formatMessage({ + defaultMessage: "Department information", + id: "eNTKLK", + description: "Heading for the 'create a department' form", + })} + +
- - - + + +
+ +
+ + -
- +
+ + + {intl.formatMessage(commonMessages.cancel)} +
-
+ ); }; @@ -153,6 +201,10 @@ interface RouteParams extends Record { const Department_Query = graphql(/* GraphQL */ ` query Department($id: UUID!) { department(id: $id) { + name { + en + fr + } ...DepartmentForm } } @@ -191,12 +243,21 @@ const UpdateDepartmentPage = () => { return Promise.reject(new Error(result.error?.toString())); }); + const departmentName = getLocalizedName( + departmentData?.department?.name, + intl, + ); + const navigationCrumbs = useBreadcrumbs({ crumbs: [ { label: intl.formatMessage(pageTitles.departments), url: routes.departmentTable(), }, + { + label: departmentName, + url: routes.departmentView(departmentId), + }, ...(departmentId ? [ { @@ -215,43 +276,48 @@ const UpdateDepartmentPage = () => { }); const pageTitle = intl.formatMessage({ - defaultMessage: "Edit department", - id: "GKo3Df", + defaultMessage: "Edit a department", + id: "y+R3x+", description: "Page title for the department edit page", }); return ( <> - - - - {departmentData?.department ? ( - - ) : ( - -

- {intl.formatMessage( - { - defaultMessage: "Department {departmentId} not found.", - id: "8Otaw9", - description: "Message displayed for department not found.", - }, - { departmentId }, - )} -

-
- )} -
-
+ +
+ + {departmentData?.department ? ( + + ) : ( + +

+ {intl.formatMessage( + { + defaultMessage: "Department {departmentId} not found.", + id: "8Otaw9", + description: + "Message displayed for department not found.", + }, + { departmentId }, + )} +

+
+ )} +
+
+
); }; diff --git a/apps/web/src/pages/Departments/ViewDepartmentPage.tsx b/apps/web/src/pages/Departments/ViewDepartmentPage.tsx index 1da312ec730..0de0fbcb667 100644 --- a/apps/web/src/pages/Departments/ViewDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/ViewDepartmentPage.tsx @@ -141,12 +141,15 @@ const ViewDepartmentPage = () => { const intl = useIntl(); const routes = useRoutes(); const { departmentId } = useRequiredParams("departmentId"); - const [{ data, fetching, error }] = useQuery({ + const [{ data: departmentData, fetching, error }] = useQuery({ query: Department_Query, variables: { id: departmentId }, }); - const departmentName = getLocalizedName(data?.department?.name, intl); + const departmentName = getLocalizedName( + departmentData?.department?.name, + intl, + ); const navigationCrumbs = useBreadcrumbs({ crumbs: [ @@ -184,8 +187,8 @@ const ViewDepartmentPage = () => {
- {data?.department ? ( - + {departmentData?.department ? ( + ) : ( Date: Thu, 24 Oct 2024 13:34:00 -0400 Subject: [PATCH 09/21] fix return navigation --- .../Departments/CreateDepartmentPage.tsx | 21 +++++++++++-------- .../Departments/UpdateDepartmentPage.tsx | 11 +++++----- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx index 8e1a7d37ae0..daf2de7a92a 100644 --- a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx @@ -7,7 +7,11 @@ import IdentificationIcon from "@heroicons/react/24/outline/IdentificationIcon"; import { toast } from "@gc-digital-talent/toast"; import { Input, Submit } from "@gc-digital-talent/forms"; import { errorMessages } from "@gc-digital-talent/i18n"; -import { graphql, CreateDepartmentInput } from "@gc-digital-talent/graphql"; +import { + graphql, + CreateDepartmentInput, + Scalars, +} from "@gc-digital-talent/graphql"; import { ROLE_NAME } from "@gc-digital-talent/auth"; import { Heading, Link, Separator } from "@gc-digital-talent/ui"; @@ -16,14 +20,15 @@ import useRoutes from "~/hooks/useRoutes"; import useBreadcrumbs from "~/hooks/useBreadcrumbs"; import RequireAuth from "~/components/RequireAuth/RequireAuth"; import pageTitles from "~/messages/pageTitles"; -import useReturnPath from "~/hooks/useReturnPath"; import Hero from "~/components/Hero"; import adminMessages from "~/messages/adminMessages"; type FormValues = CreateDepartmentInput; interface CreateDepartmentProps { - handleCreateDepartment: (data: FormValues) => Promise; + handleCreateDepartment: ( + data: FormValues, + ) => Promise; } export const CreateDepartmentForm = ({ @@ -35,15 +40,13 @@ export const CreateDepartmentForm = ({ const methods = useForm(); const { handleSubmit } = methods; - const navigateTo = useReturnPath(paths.departmentTable()); - const onSubmit: SubmitHandler = async (data: FormValues) => { return handleCreateDepartment({ departmentNumber: Number(data.departmentNumber), name: data.name, }) - .then(() => { - navigate(navigateTo); + .then((id) => { + navigate(paths.departmentView(id)); toast.success( intl.formatMessage({ defaultMessage: "Department created successfully!", @@ -183,8 +186,8 @@ const CreateDepartmentPage = () => { const [, executeMutation] = useMutation(CreateDepartment_Mutation); const handleCreateDepartment = (data: CreateDepartmentInput) => executeMutation({ department: data }).then((result) => { - if (result.data?.createDepartment) { - return result.data?.createDepartment; + if (result.data?.createDepartment?.id) { + return result.data.createDepartment.id; } return Promise.reject(new Error(result.error?.toString())); }); diff --git a/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx b/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx index abdad79dab1..7c61252e7d6 100644 --- a/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx @@ -36,7 +36,6 @@ import adminMessages from "~/messages/adminMessages"; import useBreadcrumbs from "~/hooks/useBreadcrumbs"; import RequireAuth from "~/components/RequireAuth/RequireAuth"; import pageTitles from "~/messages/pageTitles"; -import useReturnPath from "~/hooks/useReturnPath"; import Hero from "~/components/Hero"; export const DepartmentForm_Fragment = graphql(/* GraphQL */ ` @@ -76,15 +75,13 @@ export const UpdateDepartmentForm = ({ }); const { handleSubmit } = methods; - const navigateTo = useReturnPath(paths.departmentView(initialDepartment.id)); - const onSubmit: SubmitHandler = async (data: FormValues) => { return handleUpdateDepartment(initialDepartment.id, { departmentNumber: Number(data.departmentNumber), name: data.name, }) .then(() => { - navigate(navigateTo); + navigate(paths.departmentView(initialDepartment.id)); toast.success( intl.formatMessage({ defaultMessage: "Department updated successfully!", @@ -184,7 +181,11 @@ export const UpdateDepartmentForm = ({ data-h2-align-items="base(center)" > - + {intl.formatMessage(commonMessages.cancel)}
From 055cb91c002adb2d9a5713864f247eb0d3a1f44a Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:06:58 -0400 Subject: [PATCH 10/21] add margin below cards --- apps/web/src/pages/Departments/CreateDepartmentPage.tsx | 1 + apps/web/src/pages/Departments/UpdateDepartmentPage.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx index daf2de7a92a..27823780509 100644 --- a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx @@ -226,6 +226,7 @@ const CreateDepartmentPage = () => { data-h2-background-color="base(foreground)" data-h2-padding="base(x2, x1)" data-h2-shadow="base(s)" + data-h2-margin-bottom="base(x3)" > { data-h2-background-color="base(foreground)" data-h2-padding="base(x2, x1)" data-h2-shadow="base(s)" + data-h2-margin-bottom="base(x3)" > {departmentData?.department ? ( From cd696a41c2bac74e57bbd8c9501491e4ad8fc388 Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:21:39 -0400 Subject: [PATCH 11/21] fix index page width --- apps/web/src/pages/Departments/IndexDepartmentPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/pages/Departments/IndexDepartmentPage.tsx b/apps/web/src/pages/Departments/IndexDepartmentPage.tsx index 91c8893721f..1bc1e4386db 100644 --- a/apps/web/src/pages/Departments/IndexDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/IndexDepartmentPage.tsx @@ -30,7 +30,7 @@ export const DepartmentPage = () => { <> -
+
From edf180a01a494c1aef50b0ff04b2e0f11deb5baa Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:31:35 -0400 Subject: [PATCH 12/21] fix department table link --- .../pages/Departments/components/DepartmentTable.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/web/src/pages/Departments/components/DepartmentTable.tsx b/apps/web/src/pages/Departments/components/DepartmentTable.tsx index fc63b99304d..657b879d822 100644 --- a/apps/web/src/pages/Departments/components/DepartmentTable.tsx +++ b/apps/web/src/pages/Departments/components/DepartmentTable.tsx @@ -5,7 +5,7 @@ import { useQuery } from "urql"; import { notEmpty, unpackMaybes } from "@gc-digital-talent/helpers"; import { commonMessages, getLocalizedName } from "@gc-digital-talent/i18n"; -import { Pending } from "@gc-digital-talent/ui"; +import { Link, Pending } from "@gc-digital-talent/ui"; import { graphql, DepartmentTableRowFragment, @@ -15,7 +15,6 @@ import { import useRoutes from "~/hooks/useRoutes"; import Table from "~/components/Table/ResponsiveTable/ResponsiveTable"; -import cells from "~/components/Table/cells"; import { normalizedText } from "~/components/Table/sortingFns"; const columnHelper = createColumnHelper(); @@ -51,8 +50,11 @@ export const DepartmentTable = ({ id: "name", sortingFn: normalizedText, header: intl.formatMessage(commonMessages.name), - cell: ({ row: { original: department } }) => - cells.view(department.id, getLocalizedName(department.name, intl)), + cell: ({ row: { original: department } }) => ( + + {getLocalizedName(department.name, intl)} + + ), meta: { isRowTitle: true, }, From cb741ba864e330f00f983b5429a325b5615015cf Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:39:38 -0400 Subject: [PATCH 13/21] fix table title --- apps/web/src/pages/Departments/components/DepartmentTable.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/pages/Departments/components/DepartmentTable.tsx b/apps/web/src/pages/Departments/components/DepartmentTable.tsx index 657b879d822..159e9da0990 100644 --- a/apps/web/src/pages/Departments/components/DepartmentTable.tsx +++ b/apps/web/src/pages/Departments/components/DepartmentTable.tsx @@ -63,8 +63,8 @@ export const DepartmentTable = ({ id: "departmentNumber", filterFn: "weakEquals", header: intl.formatMessage({ - defaultMessage: "Department #", - id: "QOvS1b", + defaultMessage: "Number", + id: "af1unJ", description: "Title displayed for the Department table Department # column.", }), From 6d27333f5ce547cffb5d8fc3d10bb19c933e4ae1 Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:35:48 -0400 Subject: [PATCH 14/21] CardSectioned component --- .../CardSectioned/CardSectioned.stories.tsx | 34 +++++++++++++ .../Card/CardSectioned/CardSectioned.tsx | 48 +++++++++++++++++++ .../components/Card/CardSectioned/index.ts | 3 ++ packages/ui/src/components/Card/index.ts | 3 +- packages/ui/src/index.tsx | 2 + 5 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 packages/ui/src/components/Card/CardSectioned/CardSectioned.stories.tsx create mode 100644 packages/ui/src/components/Card/CardSectioned/CardSectioned.tsx create mode 100644 packages/ui/src/components/Card/CardSectioned/index.ts diff --git a/packages/ui/src/components/Card/CardSectioned/CardSectioned.stories.tsx b/packages/ui/src/components/Card/CardSectioned/CardSectioned.stories.tsx new file mode 100644 index 00000000000..e36e1ce7126 --- /dev/null +++ b/packages/ui/src/components/Card/CardSectioned/CardSectioned.stories.tsx @@ -0,0 +1,34 @@ +import type { Meta, StoryFn } from "@storybook/react"; + +import { allModes } from "@gc-digital-talent/storybook-helpers"; + +import CardSectioned from "./CardSectioned"; + +export default { + component: CardSectioned.Root, + parameters: { + chromatic: { + modes: { + light: allModes.light, + dark: allModes.dark, + }, + }, + }, +} satisfies Meta; + +const Template: StoryFn = (args) => { + const { children } = args; + + return {children}; +}; + +export const Default = Template.bind({}); +Default.args = { + children: ( + <> + Item 1 + Item 2 + Item 3 + + ), +}; diff --git a/packages/ui/src/components/Card/CardSectioned/CardSectioned.tsx b/packages/ui/src/components/Card/CardSectioned/CardSectioned.tsx new file mode 100644 index 00000000000..fbc8bc5f9ad --- /dev/null +++ b/packages/ui/src/components/Card/CardSectioned/CardSectioned.tsx @@ -0,0 +1,48 @@ +import { ReactElement, ReactNode } from "react"; + +interface ItemProps { + children?: ReactNode; +} + +const Item = ({ children, ...rest }: ItemProps) => { + return ( +
+ {children} +
+ ); +}; + +type ItemElement = ReactElement; + +export interface RootProps { + children: ItemElement | ItemElement[]; +} + +const Root = ({ children }: RootProps) => { + return ( +
+ {children} +
+ ); +}; + +export default { + Root, + Item, +}; diff --git a/packages/ui/src/components/Card/CardSectioned/index.ts b/packages/ui/src/components/Card/CardSectioned/index.ts new file mode 100644 index 00000000000..30d1e7f02b1 --- /dev/null +++ b/packages/ui/src/components/Card/CardSectioned/index.ts @@ -0,0 +1,3 @@ +import CardSectioned from "./CardSectioned"; + +export default CardSectioned; diff --git a/packages/ui/src/components/Card/index.ts b/packages/ui/src/components/Card/index.ts index 3a489cb7132..01da320ef62 100644 --- a/packages/ui/src/components/Card/index.ts +++ b/packages/ui/src/components/Card/index.ts @@ -1,5 +1,6 @@ import CardFlat, { type CardFlatProps } from "./CardFlat"; import CardBasic, { type CardBasicProps } from "./CardBasic/CardBasic"; +import CardSectioned from "./CardSectioned"; -export { CardFlat, CardBasic }; +export { CardFlat, CardBasic, CardSectioned }; export type { CardFlatProps, CardBasicProps }; diff --git a/packages/ui/src/index.tsx b/packages/ui/src/index.tsx index dd0c2bc089a..04654d32aac 100644 --- a/packages/ui/src/index.tsx +++ b/packages/ui/src/index.tsx @@ -21,6 +21,7 @@ import Board from "./components/Board/Board"; import { CardBasic, CardFlat, + CardSectioned, type CardBasicProps, type CardFlatProps, } from "./components/Card"; @@ -148,6 +149,7 @@ export { Button, CardBasic, CardFlat, + CardSectioned, CardRepeater, Chips, Chip, From 7315c764f51d1f20028ee87748027d84c239238a Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:04:12 -0400 Subject: [PATCH 15/21] add sectioned card to pages --- .../Departments/CreateDepartmentPage.tsx | 137 ++++++++---------- .../Departments/UpdateDepartmentPage.tsx | 136 ++++++++--------- .../pages/Departments/ViewDepartmentPage.tsx | 25 +--- 3 files changed, 133 insertions(+), 165 deletions(-) diff --git a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx index 27823780509..5a408561a87 100644 --- a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx @@ -13,7 +13,7 @@ import { Scalars, } from "@gc-digital-talent/graphql"; import { ROLE_NAME } from "@gc-digital-talent/auth"; -import { Heading, Link, Separator } from "@gc-digital-talent/ui"; +import { Heading, Link, CardSectioned } from "@gc-digital-talent/ui"; import SEO from "~/components/SEO/SEO"; import useRoutes from "~/hooks/useRoutes"; @@ -69,78 +69,69 @@ export const CreateDepartmentForm = ({ }; return ( - <> -
- - {intl.formatMessage({ - defaultMessage: "Department information", - id: "eNTKLK", - description: "Heading for the 'create a department' form", - })} - -
- - -
-
- - -
- + + + +
+ + {intl.formatMessage({ + defaultMessage: "Department information", + id: "eNTKLK", + description: "Heading for the 'create a department' form", })} - type="number" + +
+
+ + +
+ +
-
- -
+ -
- - - + + + + ); }; @@ -222,10 +213,6 @@ const CreateDepartmentPage = () => {
-
- - {intl.formatMessage({ - defaultMessage: "Department information", - id: "eNTKLK", - description: "Heading for the 'create a department' form", - })} - -
- -
-
- - -
- + + + +
+ + {intl.formatMessage({ + defaultMessage: "Department information", + id: "eNTKLK", + description: "Heading for the 'create a department' form", })} - type="number" + +
+ +
+ + +
+ +
-
- -
+ {intl.formatMessage(commonMessages.cancel)} -
- - - + + + + ); }; @@ -288,10 +282,6 @@ const UpdateDepartmentPage = () => {
diff --git a/apps/web/src/pages/Departments/ViewDepartmentPage.tsx b/apps/web/src/pages/Departments/ViewDepartmentPage.tsx index 0de0fbcb667..4ae372ac42f 100644 --- a/apps/web/src/pages/Departments/ViewDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/ViewDepartmentPage.tsx @@ -7,9 +7,8 @@ import { Pending, NotFound, Heading, - CardBasic, - Separator, Link, + CardSectioned, } from "@gc-digital-talent/ui"; import { FragmentType, @@ -68,12 +67,8 @@ export const ViewDepartmentForm = ({ query }: ViewDepartmentProps) => { })}
- -
+ { {department.departmentNumber}
-
- -
+ + @@ -115,8 +106,8 @@ export const ViewDepartmentForm = ({ query }: ViewDepartmentProps) => { description: "Link to edit the currently viewed department", })} -
- + + ); }; From 1202cd1febf58a8ff13646975ff5470d5317a859 Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:21:37 -0400 Subject: [PATCH 16/21] reduce bottom padding in new hero --- apps/web/src/components/Hero/Hero.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/Hero/Hero.tsx b/apps/web/src/components/Hero/Hero.tsx index ed48a495a55..6b93e3ece11 100644 --- a/apps/web/src/components/Hero/Hero.tsx +++ b/apps/web/src/components/Hero/Hero.tsx @@ -17,13 +17,13 @@ import NavigationMenu from "./NavigationMenu"; const paddingMap = { default: { - "data-h2-padding": "base(x5.5 0 x4 0)", + "data-h2-padding": "base(x5.5 0 x2 0)", }, image: { - "data-h2-padding": "base(x5.5 0 0 0) p-tablet(x5.5 0 x4 0)", + "data-h2-padding": "base(x5.5 0 0 0) p-tablet(x5.5 0 x2 0)", }, overlap: { - "data-h2-padding": "base(x5.5, 0, x8, 0)", + "data-h2-padding": "base(x5.5, 0, x6, 0)", }, navTabs: { "data-h2-padding": "base(x5.5 0 0 0)", From 52561b3ad7aeb1a2b13a27b1403fe2bca2c840f3 Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:31:18 -0400 Subject: [PATCH 17/21] lint --- apps/web/src/pages/Departments/UpdateDepartmentPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx b/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx index 480428327f3..425e4dfc887 100644 --- a/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx @@ -17,7 +17,6 @@ import { Pending, NotFound, Heading, - Separator, Link, CardSectioned, } from "@gc-digital-talent/ui"; From f416faa5d05907b0b5e10269d6c4c4d9b9b7eba8 Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:23:38 -0400 Subject: [PATCH 18/21] translations --- apps/web/src/lang/fr.json | 72 ++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 28 deletions(-) diff --git a/apps/web/src/lang/fr.json b/apps/web/src/lang/fr.json index 111704381ca..0ca2b780662 100644 --- a/apps/web/src/lang/fr.json +++ b/apps/web/src/lang/fr.json @@ -299,10 +299,6 @@ "defaultMessage": "Vos principales compétences", "description": "Title for the top skills section of a users skill showcase" }, - "/YiBdv": { - "defaultMessage": "Numéro de ministère", - "description": "Label displayed on the create a department form department number field." - }, "/ZPTlP": { "defaultMessage": "Les Procédures obligatoires sur les talents numériques ont été mises à jour pour plus de clarté et afin de réduire les exigences en matière de rapports et mieux les aligner sur d’autres instruments politiques. La directive reste inchangée.", "description": "Description for the mandatory procedures card" @@ -1563,6 +1559,10 @@ "defaultMessage": "Lorsque vous utilisez la fonction « Trouver des talents » pour demander des références pour des embauches potentielles, vos critères et vos notes seront enregistrés comme une demande et suivis dans cette section. Les demandes en cours apparaîtront également sur votre « Tableau de bord du gestionnaire ». Lorsqu'une demande est terminée, elle passe automatiquement de cette section à votre Historique des demandes.", "description": "description of the active requests section on the manager request history page" }, + "66kU6k": { + "defaultMessage": "Numéro de ministère", + "description": "Label for department number" + }, "66qMwD": { "defaultMessage": "« ... réfère à une personne dont les activités quotidiennes sont limitées en raison d'un trouble ou d'une difficulté à accomplir certaines tâches. La seule exception à cet égard concerne les troubles du développement, le répondant qui a reçu un tel diagnostic étant considéré comme ayant une incapacité. »", "description": "Definition of Person with a disability from the StatsCan 'Classification of Status of Disability' page." @@ -3503,10 +3503,6 @@ "defaultMessage": "Niveau", "description": "Label displayed on classification level input" }, - "GKo3Df": { - "defaultMessage": "Mettre à jour un ministère", - "description": "Page title for the department edit page" - }, "GMglI5": { "defaultMessage": "Adresse courriel validée", "description": "The email address has been verified to be owned by user" @@ -5203,10 +5199,6 @@ "defaultMessage": "Créer un regroupement de compétences", "description": "Breadcrumb title for the create skill family page link." }, - "PRrRRN": { - "defaultMessage": "Créer un ministère", - "description": "Page title for the department creation page" - }, "PS/LFb": { "defaultMessage": "Non, je ne suis pas un(e) employé(e) du gouvernement du Canada.", "description": "Label displayed for is not a government employee option" @@ -5391,10 +5383,6 @@ "defaultMessage": "Identifiant de processus copié", "description": "Button text to indicate that a specific qualified recruitment's ID has been copied" }, - "QOvS1b": { - "defaultMessage": "Numéro de ministère", - "description": "Title displayed for the Department table Department # column." - }, "QQXvOh": { "defaultMessage": "Notre engagement à l’égard de l’accessibilité", "description": "Title for the accessibility commitment section." @@ -6402,6 +6390,10 @@ "defaultMessage": "Embauché (Période déterminée)", "description": "Status for an application that has been hired with a term contract" }, + "VpqH38": { + "defaultMessage": "Utilisez le bouton « Créez un nouveau ministère » pour commencer.", + "description": "Instructions for adding a department item." + }, "VrLfLw": { "defaultMessage": "Courriel du conseiller/ère en RH", "description": "Input label asking for the HR advisor's email address." @@ -7186,10 +7178,6 @@ "defaultMessage": "Choisir un statut :", "description": "Third section of text on the change candidate status dialog" }, - "ZbpbD6": { - "defaultMessage": "Créer un ministère", - "description": "Heading displayed above the Create Department form." - }, "Zd02bf": { "defaultMessage": "Bienvenue à la première étape de votre demande. Nous sommes ravis de vous rencontrer!", "description": "Subtitle for the application welcome page" @@ -7202,6 +7190,10 @@ "defaultMessage": "La Commission des relations de travail et de l’emploi dans le secteur public fédéral traite les plaintes de certains employés de la fonction publique fédérale, membres de la Gendarmerie royale du Canada et employés du Parlement.", "description": "Description of complaints to the Federal Public Sector Labour Relations and Employment Board<" }, + "ZpYj8o": { + "defaultMessage": "Créer un ministère", + "description": "Page title for the department creation page" + }, "ZqZc8Z": { "defaultMessage": "La création de votre parcours professionnel est un peu différente sur cette plateforme. Tout d’abord, le travail que vous effectuez ici sera enregistré dans votre profil afin que vous puissiez le réutiliser ultérieurement pour d’autres candidatures.", "description": "Application step to begin working on career timeline, paragraph one" @@ -7354,6 +7346,10 @@ "defaultMessage": "Je suis actuellement actif dans cette expérience.", "description": "Label displayed on Personal Experience form for current experience input" }, + "af1unJ": { + "defaultMessage": "Numéro", + "description": "Title displayed for the Department table Department # column." + }, "agcOO1": { "defaultMessage": "Rendre nos produits accessibles et utilisables par tous", "description": "Heading for the items we consider for accessibility." @@ -7482,10 +7478,6 @@ "defaultMessage": "Vous n'avez pas encore de demandes terminées.", "description": "Title for notice when there are no pool candidate search requests" }, - "bUyxJi": { - "defaultMessage": "Chercher les ministères", - "description": "Label for the departments table search input" - }, "bVQ/rm": { "defaultMessage": "Tous les utilisateurs", "description": "Title for the index user page" @@ -7614,6 +7606,10 @@ "defaultMessage": "Requises", "description": "Label for a required skill" }, + "c7d3np": { + "defaultMessage": "Créez un nouveau ministère", + "description": "Heading displayed above the Create Department form." + }, "cA0iH+": { "defaultMessage": "Renseignements personnels", "description": "Profile and applications card title for profile card" @@ -8094,6 +8090,10 @@ "defaultMessage": "Compte d'utilisateur supprimé", "description": "Title for the alert displayed after a user signs into a deleted account" }, + "eNTKLK": { + "defaultMessage": "Information sur le ministère", + "description": "Heading for the 'create a department' form" + }, "eO9buR": { "defaultMessage": "4. Félicitations! Vous vous êtes connecté avec une CléGC et vous serez redirigé vers la plateforme de talents numériques du GC.", "description": "Text for final sign in step." @@ -9102,6 +9102,10 @@ "defaultMessage": "Ma situation correspond à l’option de deux années d’études postsecondaires.", "description": "Radio group option for education requirement filter in application education form." }, + "j/qPu0": { + "defaultMessage": "Créez le ministère", + "description": "Button label to create a new department" + }, "j12uou": { "defaultMessage": "un nouveau système technologique, logiciel ou matériel d’une nature fondamentalement différente de ceux utilisés précédemment;", "description": "technological change factor - new technological system" @@ -10174,6 +10178,10 @@ "defaultMessage": "Sauvegarder cette question", "description": "Button text to save a general question" }, + "os2TYf": { + "defaultMessage": "Modifiez l'information sur le ministère", + "description": "Link to edit the currently viewed department" + }, "osGGIt": { "defaultMessage": "Programme d’apprentissage en TI pour les personnes autochtones + Portail des talents autochtones", "description": "heading for indigenous talent portal section" @@ -10866,6 +10874,10 @@ "defaultMessage": "Candidat retiré avec succès", "description": "Success message for removing a candidate" }, + "sp9OKU": { + "defaultMessage": "Information sur le ministère", + "description": "Nav tab label for department information" + }, "sr20Tb": { "defaultMessage": "Citoyenneté", "description": "Citizenship label" @@ -11170,6 +11182,10 @@ "defaultMessage": "« Je comprends que je fais partie d'une collectivité qui se fait confiance »", "description": "Signature list item on sign and submit page." }, + "uqI3Vf": { + "defaultMessage": "Annulez et revenez aux ministères", + "description": "Button label to return to the departments table" + }, "uqiPvH": { "defaultMessage": "Suivi de vos candidatures", "description": "Heading for track applications section on the profile and applications." @@ -11694,6 +11710,10 @@ "defaultMessage": "Vous êtes maintenant arrivé(e) à votre page de profil de Talents numériques.", "description": "First paragraph for profile and applications notification welcoming an IAP user" }, + "y+R3x+": { + "defaultMessage": "Modifier un ministère", + "description": "Page title for the department edit page" + }, "y+r+ej": { "defaultMessage": "Groupe et niveau", "description": "Title displayed on the search request table group and level column." @@ -11818,10 +11838,6 @@ "defaultMessage": "Un code d’identification de dossier personnel (CIDP)", "description": "Item 4 in the candidate list in the 'Indigenous talent ready for IT apprenticeships' section" }, - "yat9wx": { - "defaultMessage": "Utilisez le bouton \"Créer un ministère\" pour commencer.", - "description": "Instructions for adding a department item." - }, "ybzxmU": { "defaultMessage": "Membre des FAC", "description": "Veteran/member label" From 7db6149a2ba4163bf270d0abe74a9b61c0edd4de Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Wed, 30 Oct 2024 08:41:12 -0400 Subject: [PATCH 19/21] remove hero nav and padding --- apps/web/src/components/Hero/Hero.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/web/src/components/Hero/Hero.tsx b/apps/web/src/components/Hero/Hero.tsx index 6b93e3ece11..69bf0d13b1a 100644 --- a/apps/web/src/components/Hero/Hero.tsx +++ b/apps/web/src/components/Hero/Hero.tsx @@ -13,20 +13,19 @@ import { uiMessages } from "@gc-digital-talent/i18n"; import BackgroundGraphic from "./BackgroundPattern"; import ButtonLinksArray, { ButtonLinkType } from "./ButtonLinksArray"; -import NavigationMenu from "./NavigationMenu"; const paddingMap = { default: { - "data-h2-padding": "base(x5.5 0 x2 0)", + "data-h2-padding": "base(x2.5 0 x2 0)", }, image: { - "data-h2-padding": "base(x5.5 0 0 0) p-tablet(x5.5 0 x2 0)", + "data-h2-padding": "base(x2.5 0 0 0) p-tablet(x2.5 0 x2 0)", }, overlap: { - "data-h2-padding": "base(x5.5, 0, x6, 0)", + "data-h2-padding": "base(x2.5, 0, x6, 0)", }, navTabs: { - "data-h2-padding": "base(x5.5 0 0 0)", + "data-h2-padding": "base(x2.5 0 0 0)", }, } as const; @@ -107,7 +106,6 @@ const Hero = (props: HeroWithNavTabsProps | HeroWithOverlapProps) => { data-h2-position="base(relative)" {...padding} > -
Date: Wed, 30 Oct 2024 09:53:25 -0400 Subject: [PATCH 20/21] loading title for view page --- apps/web/src/pages/Departments/ViewDepartmentPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/src/pages/Departments/ViewDepartmentPage.tsx b/apps/web/src/pages/Departments/ViewDepartmentPage.tsx index 4ae372ac42f..ff935a97f99 100644 --- a/apps/web/src/pages/Departments/ViewDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/ViewDepartmentPage.tsx @@ -171,7 +171,9 @@ const ViewDepartmentPage = () => { <> From 7e3521cc9933bb4ee66d35952a9c7e66022afaf0 Mon Sep 17 00:00:00 2001 From: Peter Giles <8978655+petertgiles@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:52:46 -0400 Subject: [PATCH 21/21] french tweaks --- apps/web/src/lang/fr.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/lang/fr.json b/apps/web/src/lang/fr.json index 0ca2b780662..5be226ae5d0 100644 --- a/apps/web/src/lang/fr.json +++ b/apps/web/src/lang/fr.json @@ -8091,7 +8091,7 @@ "description": "Title for the alert displayed after a user signs into a deleted account" }, "eNTKLK": { - "defaultMessage": "Information sur le ministère", + "defaultMessage": "Informations sur le ministère", "description": "Heading for the 'create a department' form" }, "eO9buR": { @@ -10179,7 +10179,7 @@ "description": "Button text to save a general question" }, "os2TYf": { - "defaultMessage": "Modifiez l'information sur le ministère", + "defaultMessage": "Modifiez les informations sur le ministère", "description": "Link to edit the currently viewed department" }, "osGGIt": { @@ -10875,7 +10875,7 @@ "description": "Success message for removing a candidate" }, "sp9OKU": { - "defaultMessage": "Information sur le ministère", + "defaultMessage": "Informations sur le ministère", "description": "Nav tab label for department information" }, "sr20Tb": {