Skip to content

Commit

Permalink
✨ addition edit icon out of ActionColumns
Browse files Browse the repository at this point in the history
Signed-off-by: Shevijacobson <[email protected]>
  • Loading branch information
Shevijacobson committed Sep 17, 2024
1 parent de4608e commit e0fec62
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions client/src/app/pages/archetypes/archetypes-page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useHistory } from "react-router-dom";

import {
Button,
ButtonVariant,
Expand All @@ -17,6 +18,7 @@ import {
ToolbarContent,
ToolbarGroup,
ToolbarItem,
Tooltip,
} from "@patternfly/react-core";
import {
Table,
Expand All @@ -27,8 +29,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 +474,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 +521,15 @@ const Archetypes: React.FC = () => {
},
]
: []),
...(archetypeWriteAccess
? [
{
title: t("actions.edit"),
onClick: () =>
setArchetypeToEdit(archetype),
},
]
: []),
// ...(archetypeWriteAccess
// ? [
// {
// title: t("actions.edit"),
// onClick: () =>
// setArchetypeToEdit(archetype),
// },
// ]
// : []),
...(archetype?.assessments?.length &&
assessmentWriteAccess
? [
Expand Down

0 comments on commit e0fec62

Please sign in to comment.