Skip to content

Commit

Permalink
[Debt] Move admin dashboard to index route (#9770)
Browse files Browse the repository at this point in the history
* move admin dashboard to index route

* update routes for admin dashboard

* remove unused code

* clean translation files

* fix tests with new url

* fix additional test
  • Loading branch information
esizer authored Mar 19, 2024
1 parent fcf7528 commit 221fc58
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 428 deletions.
2 changes: 1 addition & 1 deletion apps/e2e/cypress/e2e/admin/admin-workflows.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("Admin Workflow Tests", () => {
cy.findByRole("heading", { name: /welcome back/i })
.should("exist")
.and("be.visible");
cy.url().should("contain", "/dashboard");
cy.url().should("contain", "/admin");
};

const searchForUser = (name, expectedEmail) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/playwright/tests/admin/accessibility.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { loginBySub } from "~/utils/auth";
test.describe("Admin accessibility", () => {
test("Dashboard", async ({ appPage, makeAxeBuilder }) => {
await loginBySub(appPage.page, "[email protected]");
await appPage.page.goto("/en/admin/dashboard");
await appPage.page.goto("/en/admin");
await appPage.waitForGraphqlResponse("AdminDashboard_Query");

const accessibilityScanResults = await makeAxeBuilder().analyze();
Expand Down
2 changes: 1 addition & 1 deletion apps/playwright/tests/admin/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function expectAuthCookies(cookies: AuthCookies) {
}

const restrictedPaths = [
"/en/admin/dashboard",
"/en/admin",
"/en/admin/talent-requests",
"/en/admin/users",
"/en/admin/settings/classifications",
Expand Down
14 changes: 1 addition & 13 deletions apps/web/src/components/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,6 @@ const IAPManagerHomePage = React.lazy(() =>
);

/** Admin */
const AdminHomePage = React.lazy(() =>
lazyRetry(
() =>
import(
/* webpackChunkName: "adminAdminHomePage" */ "../pages/Home/AdminHomePage/AdminHomePage"
),
),
);
const AdminErrorPage = React.lazy(() =>
lazyRetry(
() =>
Expand Down Expand Up @@ -1269,11 +1261,7 @@ const createRoute = (
errorElement: <AdminErrorPage />,
children: [
{
path: "",
element: <AdminHomePage />,
},
{
path: "dashboard",
index: true,
element: (
<RequireAuth
roles={[
Expand Down
3 changes: 1 addition & 2 deletions apps/web/src/hooks/useRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ const getRoutes = (lang: Locales) => {
skills: () => path.join(baseUrl, "skills"),

// Admin
admin: () => adminUrl,
adminDashboard: () => path.join(adminUrl, "dashboard"),
adminDashboard: () => adminUrl,

// Admin - Pools
poolTable: () => path.join(adminUrl, "pools"),
Expand Down
12 changes: 0 additions & 12 deletions apps/web/src/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1451,10 +1451,6 @@
"defaultMessage": "Découvrez un talent en vous servant d’un jeu de filtres détaillés, y compris la classification, les langues et les compétences.",
"description": "Subtitle for the search page"
},
"6EOrWk": {
"defaultMessage": "Accueil",
"description": "Title for homepage on the talent cloud admin portal."
},
"6G1ESr": {
"defaultMessage": "Opérations d’infrastructure de la <abbreviation>TI</abbreviation>",
"description": "Title for the 'infrastructure operations' IT work stream"
Expand Down Expand Up @@ -3375,10 +3371,6 @@
"defaultMessage": "1 million de dollars à 2,5 millions de dollars",
"description": "Contract value range between one-million and two-point-five-million"
},
"HNe+Yh": {
"defaultMessage": "Bienvenue sur le site du <abbreviation>Talent numérique</abbreviation> du GC, veuillez vous connecter pour continuer",
"description": "Instructional text for the talent cloud pool manager portal home page."
},
"HPDqDV": {
"defaultMessage": "Je suis bilingue (anglais et français) et <strong>j'ai</strong> complété une <languageEvaluationPageLink></languageEvaluationPageLink> officielle en <strong>ANGLAIS</strong>.",
"description": "Message for the completed english bilingual evaluation option"
Expand Down Expand Up @@ -10174,10 +10166,6 @@
"defaultMessage": "Vos 10 principales compétences techniques",
"description": "Page title for the top technical skills page"
},
"u6GmEz": {
"defaultMessage": "Portail du gestionnaire de portail",
"description": "Title for the pool manager login link."
},
"u7IbDO": {
"defaultMessage": "Comment le programme fonctionne",
"description": "Title of the 'How the program works' section"
Expand Down
78 changes: 0 additions & 78 deletions apps/web/src/pages/Home/AdminHomePage/AdminHomePage.tsx

This file was deleted.

1 change: 0 additions & 1 deletion axe-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ global-components:
AlertDialog.Content: div[role="alertdialog"]
Dialog.Content: div[role="dialog"]
Link: a
CardLink: a
ExternalLink: a
IconLink: a
MenuLink: a
Expand Down
152 changes: 0 additions & 152 deletions packages/ui/src/components/CardLink/CardLink.stories.tsx

This file was deleted.

Loading

0 comments on commit 221fc58

Please sign in to comment.