From 8a1ffb18c12b0a39eb50e96c8d99339c6693a9a4 Mon Sep 17 00:00:00 2001 From: Mike Turley Date: Fri, 1 Sep 2023 15:22:45 -0400 Subject: [PATCH 1/2] :sparkles: Add actions kebab to archetypes table with stub dropdown items Signed-off-by: Mike Turley --- client/public/locales/en/translation.json | 1 + .../app/pages/archetypes/archetypes-page.tsx | 34 +++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/client/public/locales/en/translation.json b/client/public/locales/en/translation.json index db158506a4..c53b6cc3e0 100644 --- a/client/public/locales/en/translation.json +++ b/client/public/locales/en/translation.json @@ -31,6 +31,7 @@ "discardAssessment": "Discard assessment/review", "downloadCsvTemplate": "Download CSV template", "download": "Download {{what}}", + "duplicate": "Duplicate", "edit": "Edit", "export": "Export", "filterBy": "Filter by {{what}}", diff --git a/client/src/app/pages/archetypes/archetypes-page.tsx b/client/src/app/pages/archetypes/archetypes-page.tsx index cda640bb95..a5ba656b24 100644 --- a/client/src/app/pages/archetypes/archetypes-page.tsx +++ b/client/src/app/pages/archetypes/archetypes-page.tsx @@ -18,7 +18,15 @@ import { ToolbarGroup, ToolbarItem, } from "@patternfly/react-core"; -import { Table, Tbody, Th, Thead, Tr, Td } from "@patternfly/react-table"; +import { + Table, + Tbody, + Th, + Thead, + Tr, + Td, + ActionsColumn, +} from "@patternfly/react-table"; import { CubesIcon } from "@patternfly/react-icons"; import { AppPlaceholder } from "@app/components/AppPlaceholder"; @@ -202,7 +210,29 @@ const Archetypes: React.FC = () => { - {/* TODO: Add kebab action menu */} + + alert("TODO"), + }, + { + title: t("actions.edit"), + onClick: () => alert("TODO"), + }, + { + isSeparator: true, + }, + { + title: t("actions.delete"), + onClick: () => alert("TODO"), + isDanger: true, + variant: "danger", + }, + ]} + /> + From 387e0ebfbaa139c99dd363455e86fc93fbc31b64 Mon Sep 17 00:00:00 2001 From: Mike Turley Date: Fri, 1 Sep 2023 15:53:13 -0400 Subject: [PATCH 2/2] Cleanup Signed-off-by: Mike Turley --- client/src/app/pages/archetypes/archetypes-page.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/client/src/app/pages/archetypes/archetypes-page.tsx b/client/src/app/pages/archetypes/archetypes-page.tsx index a5ba656b24..701ea849ba 100644 --- a/client/src/app/pages/archetypes/archetypes-page.tsx +++ b/client/src/app/pages/archetypes/archetypes-page.tsx @@ -221,14 +221,11 @@ const Archetypes: React.FC = () => { title: t("actions.edit"), onClick: () => alert("TODO"), }, - { - isSeparator: true, - }, + { isSeparator: true }, { title: t("actions.delete"), onClick: () => alert("TODO"), isDanger: true, - variant: "danger", }, ]} />