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 ActionsColumn to Job Functions table #2101

Merged
merged 8 commits into from
Nov 4, 2024
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
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
Loading