From 0c3d5560567a47a4f9a49c52d9ddebd504b1b59a Mon Sep 17 00:00:00 2001 From: Eduard M <4310497+edisile@users.noreply.github.com> Date: Thu, 9 Oct 2025 12:14:33 +0200 Subject: [PATCH 1/2] chore: move signing keys page to Publisher layout --- static/js/publisher/index.tsx | 7 +- .../pages/SigningKeys/SigningKeys.tsx | 232 +++++++++--------- 2 files changed, 119 insertions(+), 120 deletions(-) diff --git a/static/js/publisher/index.tsx b/static/js/publisher/index.tsx index 08edeaa515..b9a067b216 100644 --- a/static/js/publisher/index.tsx +++ b/static/js/publisher/index.tsx @@ -94,6 +94,11 @@ root.render( } /> } /> } /> + } /> + } + /> {/* END publisher routes */} @@ -108,8 +113,6 @@ root.render( path="models/:model_id/policies/create" element={} /> - } /> - } /> {/* END brand store routes */} diff --git a/static/js/publisher/pages/SigningKeys/SigningKeys.tsx b/static/js/publisher/pages/SigningKeys/SigningKeys.tsx index aed4f9d3ef..7b712fa9f0 100644 --- a/static/js/publisher/pages/SigningKeys/SigningKeys.tsx +++ b/static/js/publisher/pages/SigningKeys/SigningKeys.tsx @@ -18,20 +18,17 @@ import { } from "../../state/signingKeysState"; import { policiesListState } from "../../state/policiesState"; import { brandIdState, brandStoreState } from "../../state/brandStoreState"; - import Filter from "../../components/Filter"; import SigningKeysTable from "./SigningKeysTable"; import CreateSigningKeyForm from "./CreateSigningKeyForm"; -import Navigation from "../../components/Navigation"; - import { isClosedPanel, setPageTitle, sortByDateDescending, getPolicies, } from "../../utils"; - import type { SigningKey, Model } from "../../types/shared"; +import { PortalEntry } from "../Portals/Portals"; function SigningKeys(): React.JSX.Element { const { id } = useParams(); @@ -95,124 +92,123 @@ function SigningKeys(): React.JSX.Element { }, [models]); return ( -
- -
-
-
-
-

Signing keys

-
- {showNotification && ( -
- { - setShowNotification(false); - }} - > - New signing key created - -
- )} - {errorMessage && ( -
- { - setErrorMessage(""); - }} - > - {errorMessage} - -
- )} - {showDisableSuccessNotification && ( -
- { - setShowDisableSuccessNotification(false); - }} - > - Signing key successfully deactivated - -
- )} - - - - - - - Create new signing key - - - -
- {isError && error && ( - - Error: {error.message} - - )} - {isLoading ? ( -

- -  Fetching signing keys... -

- ) : ( -
- -
- )} -
+ <> +
+

Signing keys

+
+ + + + + + + Create new signing key + + + +
+ {isError && error && ( + + Error: {error.message} + + )} + {isLoading ? ( +

+ +  Fetching signing keys... +

+ ) : ( +
+ +
+ )} +
+ + + {showNotification && ( +
+ { + setShowNotification(false); + }} + > + New signing key created + +
+ )} + {errorMessage && ( +
+ { + setErrorMessage(""); + }} + > + {errorMessage} +
-
-
-
{ - navigate(`/admin/${id}/signing-keys`); - setNewSigningKey({ name: "" }); - setErrorMessage(""); - }} - onKeyDown={(e) => { - if (e.key === "Enter" || e.key === " ") { + )} + {showDisableSuccessNotification && ( +
+ { + setShowDisableSuccessNotification(false); + }} + > + Signing key successfully deactivated + +
+ )} + + + +
{ navigate(`/admin/${id}/signing-keys`); setNewSigningKey({ name: "" }); setErrorMessage(""); - } - }} - role="button" - tabIndex={0} - aria-label="Navigate to signing keys" - >
- -
+ }} + onKeyDown={(e) => { + if (e.key === "Enter" || e.key === " ") { + navigate(`/admin/${id}/signing-keys`); + setNewSigningKey({ name: "" }); + setErrorMessage(""); + } + }} + role="button" + tabIndex={0} + aria-label="Navigate to signing keys" + >
+ + + ); } From 754f3476a7434e31368b79e0b03bc75011ccf6af Mon Sep 17 00:00:00 2001 From: Eduard M <4310497+edisile@users.noreply.github.com> Date: Thu, 9 Oct 2025 12:58:38 +0200 Subject: [PATCH 2/2] fix: test --- .../pages/SigningKeys/__tests__/SigningKeys.test.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/js/publisher/pages/SigningKeys/__tests__/SigningKeys.test.tsx b/static/js/publisher/pages/SigningKeys/__tests__/SigningKeys.test.tsx index afeb70968a..2b4b4faee8 100644 --- a/static/js/publisher/pages/SigningKeys/__tests__/SigningKeys.test.tsx +++ b/static/js/publisher/pages/SigningKeys/__tests__/SigningKeys.test.tsx @@ -14,6 +14,11 @@ vi.mock("react-router-dom", async (importOriginal) => ({ useSearchParams: () => [new URLSearchParams({ filter: mockFilterQuery })], })); +vi.mock("../../Portals/Portals", async (importOriginal) => ({ + ...(await importOriginal()), + PortalEntry: ({ children }: { children: React.ReactNode }) => <>{children}, +})); + const queryClient = new QueryClient({ defaultOptions: { queries: {