diff --git a/apps/web/src/components/Hero/MenuLink.tsx b/apps/web/src/components/Hero/MenuLink.tsx deleted file mode 100644 index 80f5082b533..00000000000 --- a/apps/web/src/components/Hero/MenuLink.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { NavLink, NavLinkProps } from "react-router-dom"; - -import { LinkProps } from "@gc-digital-talent/ui"; - -export type MenuLinkProps = Omit & NavLinkProps; - -const MenuLink = ({ children, ...rest }: MenuLinkProps) => { - return ( - - {children} - - ); -}; - -export default MenuLink; diff --git a/apps/web/src/components/Hero/NavigationMenu.tsx b/apps/web/src/components/Hero/NavigationMenu.tsx deleted file mode 100644 index 16e8d3f897b..00000000000 --- a/apps/web/src/components/Hero/NavigationMenu.tsx +++ /dev/null @@ -1,191 +0,0 @@ -import { useIntl } from "react-intl"; -import { ReactElement, ReactNode } from "react"; - -import { - hasRole, - ROLE_NAME, - useAuthentication, - useAuthorization, -} from "@gc-digital-talent/auth"; -import { navigationMessages } from "@gc-digital-talent/i18n"; -import { unpackMaybes } from "@gc-digital-talent/helpers"; - -import useRoutes from "~/hooks/useRoutes"; -import authMessages from "~/messages/authMessages"; - -import SignOutConfirmation from "../SignOutConfirmation/SignOutConfirmation"; -import LogoutButton from "../Layout/LogoutButton"; -import NotificationDialog from "../NotificationDialog/NotificationDialog"; -import MenuLink from "./MenuLink"; - -interface NavMenuProps { - mainItems: ReactElement[]; - utilityItems?: ReactElement[]; -} - -const ListItem = ({ children }: { children?: ReactNode }) => ( -
  • - - {children} - -
  • -); - -const NavMenuComponent = ({ mainItems, utilityItems }: NavMenuProps) => { - const intl = useIntl(); - const { loggedIn } = useAuthentication(); - return ( -
    -
    -
    -
    - -
    - {utilityItems && utilityItems.length > 0 ? ( - <> -
    -
    - -
    - - ) : null} -
    -
    -
    - ); -}; - -const NavigationMenu = () => { - const intl = useIntl(); - const paths = useRoutes(); - const { userAuthInfo } = useAuthorization(); - const { loggedIn } = useAuthentication(); - - let menuItems = [ - - {intl.formatMessage(navigationMessages.home)} - , - - {intl.formatMessage(navigationMessages.findTalent)} - , - - {intl.formatMessage(navigationMessages.browseJobs)} - , - ]; - let authLinks = [ - - {intl.formatMessage(authMessages.signIn)} - , - - {intl.formatMessage(authMessages.signUp)} - , - ]; - if (loggedIn && userAuthInfo) { - const roleAssignments = unpackMaybes(userAuthInfo?.roleAssignments); - const userRoleNames = roleAssignments.map((a) => a.role?.name); - if ( - [ - ROLE_NAME.PoolOperator, - ROLE_NAME.RequestResponder, - ROLE_NAME.CommunityManager, - ROLE_NAME.PlatformAdmin, - ROLE_NAME.CommunityRecruiter, - ROLE_NAME.CommunityAdmin, - ROLE_NAME.ProcessOperator, - ].some((authorizedRoleName) => - userRoleNames?.includes(authorizedRoleName), - ) - ) { - menuItems = [ - ...menuItems, - - {intl.formatMessage({ - defaultMessage: "Admin", - id: "wHX/8C", - description: "Title tag for Admin site", - })} - , - ]; - } - authLinks = [ - - {intl.formatMessage(authMessages.signOut)} - , - ]; - if (hasRole(ROLE_NAME.Applicant, userAuthInfo.roleAssignments)) { - authLinks = [ - - {intl.formatMessage(navigationMessages.profileAndApplications)} - , - ...authLinks, - ]; - } - } - - return ( - - ); -}; - -export default NavigationMenu; diff --git a/apps/web/src/components/Router.tsx b/apps/web/src/components/Router.tsx index ce397e3152c..cc077759744 100644 --- a/apps/web/src/components/Router.tsx +++ b/apps/web/src/components/Router.tsx @@ -856,6 +856,10 @@ const createRoute = (locale: Locales) => { path: ":skillId", children: [ + { + index: true, + lazy: () => import("../pages/Skills/ViewSkillPage"), + }, { path: "edit", lazy: () => import("../pages/Skills/UpdateSkillPage"), diff --git a/apps/web/src/hooks/useRoutes.ts b/apps/web/src/hooks/useRoutes.ts index 1be2eb81cef..fec8551a500 100644 --- a/apps/web/src/hooks/useRoutes.ts +++ b/apps/web/src/hooks/useRoutes.ts @@ -137,6 +137,8 @@ const getRoutes = (lang: Locales) => { // Admin - Skills skillTable: () => [adminUrl, "settings", "skills"].join("/"), skillCreate: () => [adminUrl, "settings", "skills", "create"].join("/"), + skillView: (skillId: string) => + [adminUrl, "settings", "skills", skillId].join("/"), skillUpdate: (skillId: string) => [adminUrl, "settings", "skills", skillId, "edit"].join("/"), diff --git a/apps/web/src/lang/fr.json b/apps/web/src/lang/fr.json index 981325c60a0..e0784163cf7 100644 --- a/apps/web/src/lang/fr.json +++ b/apps/web/src/lang/fr.json @@ -363,6 +363,10 @@ "defaultMessage": "Expérience supprimée", "description": "Message displayed to user after experience deleted." }, + "/qXiOK": { + "defaultMessage": "Informations sur la compétence", + "description": "Nav tab label for skill information" + }, "/rmunL": { "defaultMessage": "En fonction des besoins", "description": "As and when needed personnel other requirement" @@ -403,6 +407,10 @@ "defaultMessage": "Fonds de formation et de perfectionnement de la collectivité de la TI", "description": "Title for the it training fund page" }, + "04iYYO": { + "defaultMessage": "Créer une compétence", + "description": "Title for Create skill" + }, "04smVa": { "defaultMessage": "Recrutement ciblé", "description": "Label for an targeting (active) qualified recruitment" @@ -419,6 +427,10 @@ "defaultMessage": "Utilisez le bouton \"Créer un processus\" pour commencer.", "description": "Instructions for adding a process item." }, + "08IbRz": { + "defaultMessage": "Informations sur la compétence", + "description": "Heading for the 'view a skill' form" + }, "08rkLr": { "defaultMessage": "Durée de la possibilité", "description": "Label for a process' opportunity employment duration" @@ -507,10 +519,6 @@ "defaultMessage": "Candidats du bassin", "description": "Title for pool candidates" }, - "0VlOQq": { - "defaultMessage": "Modifier - compétence", - "description": "Page title for the edit skill page." - }, "0YZeO0": { "defaultMessage": "Embauché (Temporaire)", "description": "Status for an application that has been hired with a casual contract" @@ -1751,10 +1759,6 @@ "defaultMessage": "Un groupe d’Autochtones qui se tiennent debout avec un tambour à main peint.", "description": "Indigenous Apprenticeship hero image text alternative" }, - "71mPNh": { - "defaultMessage": "Créer une compétence", - "description": "Title for Create skill" - }, "72pd2Z": { "defaultMessage": "gestion de l’information, ou", "description": "List item of experiences required in application education page." @@ -4167,10 +4171,6 @@ "defaultMessage": "Révisez votre candidature", "description": "Page title for the application review page." }, - "JxVREd": { - "defaultMessage": "Familles", - "description": "Label displayed on the skill form families field." - }, "Jz0oC2": { "defaultMessage": "À propos de nous (anglais)", "description": "Label for a process' English about us" @@ -7362,6 +7362,10 @@ "defaultMessage": "Un plan en lien avec talents pour l’initiative numérique a-t-il été soumis précédemment pour cette initiative?", "description": "Label for _digital initiative plan submitted_ fieldset in the _digital services contracting questionnaire_" }, + "aIEKtJ": { + "defaultMessage": "Informations sur la compétence", + "description": "Heading for the 'edit a skill' form" + }, "aIMh6f": { "defaultMessage": "Cinq compétences techniques que vous aimeriez perfectionner", "description": "Page title for the improve technical skills page" @@ -7778,10 +7782,6 @@ "defaultMessage": "Téléchargez le questionnaire : {formName}", "description": "Link text for form download" }, - "cWqtEU": { - "defaultMessage": "Chercher les compétences", - "description": "Label for the skills table search input" - }, "cXszfI": { "defaultMessage": "Sélectionnez l’option qui représente le mieux votre raison pour soumettre la présente demande de talent", "description": "Legend for the options related to the reason for submitting a request." @@ -8166,6 +8166,10 @@ "defaultMessage": "IT-04 : Conseiller principal ou Gestionnaire", "description": "IT-04 classification label including titles" }, + "eJPU4G": { + "defaultMessage": "Modifiez les informations sur la compétence", + "description": "Link to edit the currently viewed skill" + }, "eKPE3F": { "defaultMessage": "Vous ne recevez pas de possibilités découlant de ce recrutement.", "description": "Message displayed when a user has suspended an application to a recruitment" @@ -8442,6 +8446,10 @@ "defaultMessage": "Créer une classification", "description": "Page title for the classification creation page" }, + "fcH4nb": { + "defaultMessage": "Créez la compétence", + "description": "Button label to create a new skill" + }, "fdKtYm": { "defaultMessage": "Description (anglais)", "description": "Label displayed on the update a skill form description (English) field." @@ -10206,6 +10214,14 @@ "defaultMessage": "Vous n'avez aucune expérience liée à cette compétence", "description": "The skill is not attached to any experience" }, + "oCFoWU": { + "defaultMessage": "Informations sur la compétence", + "description": "Heading for the 'create a skill' form" + }, + "oCL/sl": { + "defaultMessage": "Annulez et revenez à l'éditeur de compétence", + "description": "Button label to return to the skills table" + }, "oES0/4": { "defaultMessage": "Les apprenti·es autochtones sont embauché·es par une organisation d’accueil au niveau d’entrée du groupe des TI (IT-01 ou équivalent) pour une période de 24 mois.", "description": "Paragraph 1 of the 'Hired as a term employee' subsection" @@ -10566,6 +10582,10 @@ "defaultMessage": "Réduire tous les filtres avancés", "description": "Button text to hide all advanced filters" }, + "q5j7GV": { + "defaultMessage": "Créer une nouvelle compétence", + "description": "Title for Create skill" + }, "q5rd9x": { "defaultMessage": " Description de l’expérience", "description": "Label displayed on Personal Experience form for experience description input" @@ -11002,6 +11022,10 @@ "defaultMessage": "Informations sur le ministère", "description": "Nav tab label for department information" }, + "spzerx": { + "defaultMessage": "Modifier une compétence", + "description": "Page title for the edit skill page." + }, "sr20Tb": { "defaultMessage": "Citoyenneté", "description": "Citizenship label" @@ -11846,10 +11870,6 @@ "defaultMessage": "{candidateCount, plural, =0 {Il y a actuellement environ {candidateCount} candidats qui répondent à vos critères.} =1 {Il y a actuellement environ {candidateCount} candidat qui répond à vos critères.} other {Il y a actuellement environ {candidateCount} candidats qui répondent à vos critères.} }", "description": "Message for total estimated candidates box next to search form." }, - "xx8yaE": { - "defaultMessage": "Familles", - "description": "Label displayed on the skill form skill families field." - }, "xzSXz9": { "defaultMessage": "Type d’emploi", "description": "Employment type label" diff --git a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx index bd2120a04cf..99be0a55873 100644 --- a/apps/web/src/pages/Departments/CreateDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/CreateDepartmentPage.tsx @@ -210,10 +210,7 @@ const CreateDepartmentPage = () => { <> -
    +
    diff --git a/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx b/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx index 30b05eaba96..68c0e2157ed 100644 --- a/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx +++ b/apps/web/src/pages/Departments/UpdateDepartmentPage.tsx @@ -278,10 +278,7 @@ const UpdateDepartmentPage = () => { <> -
    +
    {departmentData?.department ? ( Promise; + ) => Promise; } export const CreateSkillForm = ({ @@ -97,12 +97,10 @@ export const CreateSkillForm = ({ }, }); - const navigateTo = useReturnPath(paths.skillTable()); - const onSubmit: SubmitHandler = async (values: FormValues) => { return handleCreateSkill(formValuesToSubmitData(values)) - .then(() => { - navigate(navigateTo); + .then((id) => { + navigate(paths.skillView(id)); toast.success( intl.formatMessage({ defaultMessage: "Skill created successfully!", @@ -132,158 +130,198 @@ export const CreateSkillForm = ({ ); return ( -
    - -
    - + + + +
    + + {intl.formatMessage({ + defaultMessage: "Skill information", + id: "oCFoWU", + description: "Heading for the 'create a skill' form", + })} + +
    +
    + + +