Skip to content

Commit

Permalink
✨ Update stakeholders table to use ActionsColumn (#1923) (#2083)
Browse files Browse the repository at this point in the history
Part of #1318

![image](https://github.com/konveyor/tackle2-ui/assets/60384172/48c3ec10-2aee-4adc-9652-9e72a4474b8e)

Backport-of: #1923
Signed-off-by: Maayan Hadasi <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>
  • Loading branch information
konveyor-ci-bot[bot] authored Sep 10, 2024
1 parent 3236f07 commit 34fc937
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions client/src/app/pages/controls/stakeholders/stakeholders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";
import CubesIcon from "@patternfly/react-icons/dist/esm/icons/cubes-icon";

import { AppPlaceholder } from "@app/components/AppPlaceholder";
import { AppTableActionButtons } from "@app/components/AppTableActionButtons";
import { ConditionalRender } from "@app/components/ConditionalRender";
import { ConfirmDialog } from "@app/components/ConfirmDialog";
import { getAxiosErrorMessage } from "@app/utils/utils";
Expand All @@ -51,6 +50,8 @@ import {
TableRowContentWithControls,
} from "@app/components/TableControls";
import { StakeholderForm } from "./components/stakeholder-form";
import { controlsWriteScopes, RBAC, RBAC_TYPE } from "@app/rbac";
import { ControlTableActionButtons } from "../ControlTableActionButtons";

export const Stakeholders: React.FC = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -210,17 +211,22 @@ export const Stakeholders: React.FC = () => {
<ToolbarContent>
<FilterToolbar {...filterToolbarProps} />
<ToolbarGroup variant="button-group">
<ToolbarItem>
<Button
type="button"
id="create-stakeholder"
aria-label="Create new stakeholder"
variant={ButtonVariant.primary}
onClick={() => setCreateUpdateModalState("create")}
>
{t("actions.createNew")}
</Button>
</ToolbarItem>
<RBAC
allowedPermissions={controlsWriteScopes}
rbacType={RBAC_TYPE.Scope}
>
<ToolbarItem>
<Button
type="button"
id="create-stakeholder"
aria-label="Create new stakeholder"
variant={ButtonVariant.primary}
onClick={() => setCreateUpdateModalState("create")}
>
{t("actions.createNew")}
</Button>
</ToolbarItem>
</RBAC>
</ToolbarGroup>
<ToolbarItem {...paginationToolbarItemProps}>
<SimplePagination
Expand Down Expand Up @@ -299,7 +305,7 @@ export const Stakeholders: React.FC = () => {
>
{stakeholder.stakeholderGroups?.length}
</Td>
<AppTableActionButtons
<ControlTableActionButtons
onEdit={() =>
setCreateUpdateModalState(stakeholder)
}
Expand Down

0 comments on commit 34fc937

Please sign in to comment.