Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add edit icon with ActionColumns property in the Archetypes table #2098

Merged
merged 4 commits into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions client/src/app/pages/archetypes/archetypes-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
ToolbarContent,
ToolbarGroup,
ToolbarItem,
Tooltip,
} from "@patternfly/react-core";
import {
Table,
Expand All @@ -27,8 +28,7 @@ import {
Td,
ActionsColumn,
} from "@patternfly/react-table";
import { CubesIcon } from "@patternfly/react-icons";

import { CubesIcon, PencilAltIcon } from "@patternfly/react-icons";
import { AppPlaceholder } from "@app/components/AppPlaceholder";
import { ConditionalRender } from "@app/components/ConditionalRender";
import { FilterToolbar, FilterType } from "@app/components/FilterToolbar";
Expand Down Expand Up @@ -473,6 +473,17 @@ const Archetypes: React.FC = () => {
}
/>
</Td>
{archetypeWriteAccess && (
<Td isActionCell id="pencil-action">
<Tooltip content={t("actions.edit")}>
<Button
variant="plain"
icon={<PencilAltIcon />}
onClick={() => setArchetypeToEdit(archetype)}
/>
</Tooltip>
</Td>
)}
<Td isActionCell>
{(archetypeWriteAccess ||
assessmentWriteAccess ||
Expand Down Expand Up @@ -509,15 +520,6 @@ const Archetypes: React.FC = () => {
},
]
: []),
...(archetypeWriteAccess
? [
{
title: t("actions.edit"),
onClick: () =>
setArchetypeToEdit(archetype),
},
]
: []),
...(archetype?.assessments?.length &&
assessmentWriteAccess
? [
Expand Down
Loading