Skip to content

Commit e860ee2

Browse files
mguetta1web-flow
authored andcommitted
✨ Update stakeholders table to use ActionsColumn (#1923)
Part of #1318 ![image](https://github.com/konveyor/tackle2-ui/assets/60384172/48c3ec10-2aee-4adc-9652-9e72a4474b8e) UI Tests PR: 1201 Signed-off-by: Maayan Hadasi <mguetta@redhat.com> Signed-off-by: Cherry Picker <noreply@github.com>
1 parent 3236f07 commit e860ee2

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

client/src/app/pages/controls/stakeholders/stakeholders.tsx

+19-13
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";
3232
import CubesIcon from "@patternfly/react-icons/dist/esm/icons/cubes-icon";
3333

3434
import { AppPlaceholder } from "@app/components/AppPlaceholder";
35-
import { AppTableActionButtons } from "@app/components/AppTableActionButtons";
3635
import { ConditionalRender } from "@app/components/ConditionalRender";
3736
import { ConfirmDialog } from "@app/components/ConfirmDialog";
3837
import { getAxiosErrorMessage } from "@app/utils/utils";
@@ -51,6 +50,8 @@ import {
5150
TableRowContentWithControls,
5251
} from "@app/components/TableControls";
5352
import { StakeholderForm } from "./components/stakeholder-form";
53+
import { controlsWriteScopes, RBAC, RBAC_TYPE } from "@app/rbac";
54+
import { ControlTableActionButtons } from "../ControlTableActionButtons";
5455

5556
export const Stakeholders: React.FC = () => {
5657
const { t } = useTranslation();
@@ -210,17 +211,22 @@ export const Stakeholders: React.FC = () => {
210211
<ToolbarContent>
211212
<FilterToolbar {...filterToolbarProps} />
212213
<ToolbarGroup variant="button-group">
213-
<ToolbarItem>
214-
<Button
215-
type="button"
216-
id="create-stakeholder"
217-
aria-label="Create new stakeholder"
218-
variant={ButtonVariant.primary}
219-
onClick={() => setCreateUpdateModalState("create")}
220-
>
221-
{t("actions.createNew")}
222-
</Button>
223-
</ToolbarItem>
214+
<RBAC
215+
allowedPermissions={controlsWriteScopes}
216+
rbacType={RBAC_TYPE.Scope}
217+
>
218+
<ToolbarItem>
219+
<Button
220+
type="button"
221+
id="create-stakeholder"
222+
aria-label="Create new stakeholder"
223+
variant={ButtonVariant.primary}
224+
onClick={() => setCreateUpdateModalState("create")}
225+
>
226+
{t("actions.createNew")}
227+
</Button>
228+
</ToolbarItem>
229+
</RBAC>
224230
</ToolbarGroup>
225231
<ToolbarItem {...paginationToolbarItemProps}>
226232
<SimplePagination
@@ -299,7 +305,7 @@ export const Stakeholders: React.FC = () => {
299305
>
300306
{stakeholder.stakeholderGroups?.length}
301307
</Td>
302-
<AppTableActionButtons
308+
<ControlTableActionButtons
303309
onEdit={() =>
304310
setCreateUpdateModalState(stakeholder)
305311
}

0 commit comments

Comments
 (0)