Skip to content

Commit

Permalink
✨ Add ActionsColumn to Job Functions table (#2101)
Browse files Browse the repository at this point in the history
Update the Actions column in the Job Functions table to use PatternFly 5
controls, replacing the PatternFly 4 controls.

Relates to #1318

---------

Signed-off-by: DvoraShechter1 <[email protected]>
  • Loading branch information
DvoraShechter1 authored Nov 4, 2024
1 parent 2bc6eb1 commit 7ffaf98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
"blockedDeleteApplication": "Cannot delete {{what}} because it is associated with an application.",
"blockedDeleteTarget": "Cannot delete {{what}} because it is associated with a target.",
"defaultBlockedDelete": "Cannot delete {{what}} because it is associated with another object.",
"cannotDeleteJobFunctionWithStakeholders": "Cannot remove a Job function associated with stakeholder(s)",
"cannotDeleteApplicationsAssignedToMigrationWave": "Cannot delete applications that are assigned to a migration wave.",
"cannotDeleteNonEmptyTagCategory": "Cannot delete a tag category that contains tags.",
"continueConfirmation": "Yes, continue",
Expand Down
8 changes: 5 additions & 3 deletions client/src/app/pages/controls/job-functions/job-functions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
import { Table, Tbody, Td, Th, Thead, Tr } from "@patternfly/react-table";

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 @@ -37,6 +36,7 @@ import {
import { useLocalTableControls } from "@app/hooks/table-controls";
import { CubesIcon } from "@patternfly/react-icons";
import { RBAC, RBAC_TYPE, controlsWriteScopes } from "@app/rbac";
import { ControlTableActionButtons } from "../ControlTableActionButtons";

export const JobFunctions: React.FC = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -215,9 +215,11 @@ export const JobFunctions: React.FC = () => {
<Td width={90} {...getTdProps({ columnKey: "name" })}>
{jobFunction.name}
</Td>
<AppTableActionButtons
<ControlTableActionButtons
isDeleteEnabled={!!jobFunction.stakeholders}
tooltipMessage="Cannot remove a Job function associated with stakeholder(s)"
deleteTooltipMessage={t(
"message.cannotDeleteJobFunctionWithStakeholders"
)}
onEdit={() => setCreateUpdateModalState(jobFunction)}
onDelete={() => deleteRow(jobFunction)}
/>
Expand Down

0 comments on commit 7ffaf98

Please sign in to comment.