From ddcfc3350b16bcd3b07433cd10d81fc2be77b4ff Mon Sep 17 00:00:00 2001 From: TalyaNeima Date: Sun, 22 Sep 2024 13:13:51 +0300 Subject: [PATCH] change style of delete & edit buttons on tags table Signed-off-by: TalyaNeima --- .../controls/tags/components/tag-table.tsx | 29 ++++--------------- client/src/app/pages/controls/tags/tags.tsx | 6 ++-- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/client/src/app/pages/controls/tags/components/tag-table.tsx b/client/src/app/pages/controls/tags/components/tag-table.tsx index 40d750387f..d3711a5d77 100644 --- a/client/src/app/pages/controls/tags/components/tag-table.tsx +++ b/client/src/app/pages/controls/tags/components/tag-table.tsx @@ -1,17 +1,10 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { - Table, - Thead, - Tr, - Th, - Tbody, - Td, - ActionsColumn, -} from "@patternfly/react-table"; +import { Table, Thead, Tr, Th, Tbody, Td } from "@patternfly/react-table"; import { Tag, TagCategory } from "@app/api/models"; import "./tag-table.css"; import { universalComparator } from "@app/utils/utils"; +import { ControlTableActionButtons } from "../../ControlTableActionButtons"; export interface TabTableProps { tagCategory: TagCategory; @@ -40,20 +33,10 @@ export const TagTable: React.FC = ({ .map((tag) => ( {tag.name} - - onEdit(tag), - }, - { - title: t("actions.delete"), - onClick: () => onDelete(tag), - }, - ]} - /> - + onEdit(tag)} + onDelete={() => onDelete(tag)} + /> ))} diff --git a/client/src/app/pages/controls/tags/tags.tsx b/client/src/app/pages/controls/tags/tags.tsx index 6698adc124..34d07799cc 100644 --- a/client/src/app/pages/controls/tags/tags.tsx +++ b/client/src/app/pages/controls/tags/tags.tsx @@ -43,7 +43,6 @@ import { COLOR_NAMES_BY_HEX_VALUE } from "@app/Constants"; import { TagForm } from "./components/tag-form"; import { TagCategoryForm } from "./components/tag-category-form"; import { getTagCategoryFallbackColor } from "@app/components/labels/item-tag-label/item-tag-label"; -import { AppTableActionButtons } from "@app/components/AppTableActionButtons"; import { Color } from "@app/components/Color"; import { ConditionalRender } from "@app/components/ConditionalRender"; import { AppPlaceholder } from "@app/components/AppPlaceholder"; @@ -57,6 +56,7 @@ import { import { useLocalTableControls } from "@app/hooks/table-controls"; import { RBAC, controlsWriteScopes, RBAC_TYPE } from "@app/rbac"; import { TagTable } from "./components/tag-table"; +import { ControlTableActionButtons } from "../ControlTableActionButtons"; export const Tags: React.FC = () => { const { t } = useTranslation(); @@ -385,9 +385,9 @@ export const Tags: React.FC = () => { > {tagCategory.tags?.length || 0} - setTagCategoryModalState(tagCategory)}