Fix continual improvements pages permissions handling

Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
Émile Ré
2025-12-31 16:10:46 +01:00
committed by Bryan Frimin
parent da3f9c0692
commit 5b0627b05a
8 changed files with 247 additions and 87 deletions

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<05cc2f7b3bf513e9a1f1e192950c011e>>
* @generated SignedSource<<a63771cb94fb0efc99bb250d7cd8a052>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -29,6 +29,8 @@ export type ContinualImprovementGraphCreateMutation$data = {
readonly createContinualImprovement: {
readonly continualImprovementEdge: {
readonly node: {
readonly canDelete: boolean;
readonly canUpdate: boolean;
readonly createdAt: any;
readonly description: string | null | undefined;
readonly id: string;
@@ -159,6 +161,32 @@ v4 = {
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": "canUpdate",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:continual-improvement:update"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:continual-improvement:update\")"
},
{
"alias": "canDelete",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:continual-improvement:delete"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:continual-improvement:delete\")"
}
],
"storageKey": null
@@ -232,16 +260,16 @@ return {
]
},
"params": {
"cacheID": "8789a6fab51997d85cbc98481c047b9c",
"cacheID": "5894da3b2ddc1c4a16c030770fae53bb",
"id": null,
"metadata": {},
"name": "ContinualImprovementGraphCreateMutation",
"operationKind": "mutation",
"text": "mutation ContinualImprovementGraphCreateMutation(\n $input: CreateContinualImprovementInput!\n) {\n createContinualImprovement(input: $input) {\n continualImprovementEdge {\n node {\n id\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n createdAt\n }\n }\n }\n}\n"
"text": "mutation ContinualImprovementGraphCreateMutation(\n $input: CreateContinualImprovementInput!\n) {\n createContinualImprovement(input: $input) {\n continualImprovementEdge {\n node {\n id\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n createdAt\n canUpdate: permission(action: \"core:continual-improvement:update\")\n canDelete: permission(action: \"core:continual-improvement:delete\")\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "6c6ed7efdb1ebe213fd9e43111f06c7e";
(node as any).hash = "bcf5a1e0b02b6530c327741d4d744917";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<bf69bf053e5fe5b3c0cc88a80e164325>>
* @generated SignedSource<<4e8617c8aeee3cf066e40053ba260a61>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -16,6 +16,7 @@ export type ContinualImprovementGraphListQuery$variables = {
};
export type ContinualImprovementGraphListQuery$data = {
readonly node: {
readonly canCreateContinualImprovement?: boolean;
readonly " $fragmentSpreads": FragmentRefs<"ContinualImprovementsPageFragment">;
};
};
@@ -44,30 +45,43 @@ v1 = [
"variableName": "organizationId"
}
],
v2 = [
v2 = {
"alias": "canCreateContinualImprovement",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:continual-improvement:create"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:continual-improvement:create\")"
},
v3 = [
{
"kind": "Variable",
"name": "snapshotId",
"variableName": "snapshotId"
}
],
v3 = {
v4 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
v4 = {
v5 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
v5 = [
v6 = [
{
"fields": (v2/*: any*/),
"fields": (v3/*: any*/),
"kind": "ObjectValue",
"name": "filter"
},
@@ -95,8 +109,9 @@ return {
{
"kind": "InlineFragment",
"selections": [
(v2/*: any*/),
{
"args": (v2/*: any*/),
"args": (v3/*: any*/),
"kind": "FragmentSpread",
"name": "ContinualImprovementsPageFragment"
}
@@ -125,14 +140,15 @@ return {
"name": "node",
"plural": false,
"selections": [
(v3/*: any*/),
(v4/*: any*/),
(v5/*: any*/),
{
"kind": "InlineFragment",
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": (v5/*: any*/),
"args": (v6/*: any*/),
"concreteType": "ContinualImprovementConnection",
"kind": "LinkedField",
"name": "continualImprovements",
@@ -161,7 +177,7 @@ return {
"name": "node",
"plural": false,
"selections": [
(v4/*: any*/),
(v5/*: any*/),
{
"alias": null,
"args": null,
@@ -226,7 +242,7 @@ return {
"name": "owner",
"plural": false,
"selections": [
(v4/*: any*/),
(v5/*: any*/),
{
"alias": null,
"args": null,
@@ -251,7 +267,33 @@ return {
"name": "updatedAt",
"storageKey": null
},
(v3/*: any*/)
{
"alias": "canUpdate",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:continual-improvement:update"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:continual-improvement:update\")"
},
{
"alias": "canDelete",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:continual-improvement:delete"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:continual-improvement:delete\")"
},
(v4/*: any*/)
],
"storageKey": null
},
@@ -307,7 +349,7 @@ return {
},
{
"alias": null,
"args": (v5/*: any*/),
"args": (v6/*: any*/),
"filters": [
"filter"
],
@@ -326,16 +368,16 @@ return {
]
},
"params": {
"cacheID": "b1263b33f1cc0a63fd27a238626279c8",
"cacheID": "5f5124da6649b145ef6fddcf1009e95c",
"id": null,
"metadata": {},
"name": "ContinualImprovementGraphListQuery",
"operationKind": "query",
"text": "query ContinualImprovementGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ContinualImprovementsPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ContinualImprovementsPageFragment_3iomuz on Organization {\n id\n continualImprovements(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
"text": "query ContinualImprovementGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n canCreateContinualImprovement: permission(action: \"core:continual-improvement:create\")\n ...ContinualImprovementsPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ContinualImprovementsPageFragment_3iomuz on Organization {\n id\n continualImprovements(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:continual-improvement:update\")\n canDelete: permission(action: \"core:continual-improvement:delete\")\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
}
};
})();
(node as any).hash = "8636ad035074fdb0e5b95362ea343eb1";
(node as any).hash = "36a306074f56f6dc2c80987a670f18c3";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<69ae0bb47f8fefd6ded7233a78427acc>>
* @generated SignedSource<<eb936356e9504b1cd4eefb80b699987f>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -16,6 +16,8 @@ export type ContinualImprovementGraphNodeQuery$variables = {
};
export type ContinualImprovementGraphNodeQuery$data = {
readonly node: {
readonly canDelete?: boolean;
readonly canUpdate?: boolean;
readonly createdAt?: any;
readonly description?: string | null | undefined;
readonly id?: string;
@@ -171,6 +173,32 @@ v14 = {
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
},
v15 = {
"alias": "canUpdate",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:continual-improvement:update"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:continual-improvement:update\")"
},
v16 = {
"alias": "canDelete",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:continual-improvement:delete"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:continual-improvement:delete\")"
};
return {
"fragment": {
@@ -202,7 +230,9 @@ return {
(v11/*: any*/),
(v12/*: any*/),
(v13/*: any*/),
(v14/*: any*/)
(v14/*: any*/),
(v15/*: any*/),
(v16/*: any*/)
],
"type": "ContinualImprovement",
"abstractKey": null
@@ -250,7 +280,9 @@ return {
(v11/*: any*/),
(v12/*: any*/),
(v13/*: any*/),
(v14/*: any*/)
(v14/*: any*/),
(v15/*: any*/),
(v16/*: any*/)
],
"type": "ContinualImprovement",
"abstractKey": null
@@ -261,16 +293,16 @@ return {
]
},
"params": {
"cacheID": "51e532cd66309a275af46ecaca65f0a6",
"cacheID": "c5fa96253fe8c3e8e8307936ca76704d",
"id": null,
"metadata": {},
"name": "ContinualImprovementGraphNodeQuery",
"operationKind": "query",
"text": "query ContinualImprovementGraphNodeQuery(\n $continualImprovementId: ID!\n) {\n node(id: $continualImprovementId) {\n __typename\n ... on ContinualImprovement {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
"text": "query ContinualImprovementGraphNodeQuery(\n $continualImprovementId: ID!\n) {\n node(id: $continualImprovementId) {\n __typename\n ... on ContinualImprovement {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n organization {\n id\n name\n }\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:continual-improvement:update\")\n canDelete: permission(action: \"core:continual-improvement:delete\")\n }\n id\n }\n}\n"
}
};
})();
(node as any).hash = "f5ce017ad11fcee598ae3116b668f4b2";
(node as any).hash = "66511af35ced4978629980d5339fc850";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<3065b6b41135aa2dcbb45cdafae94503>>
* @generated SignedSource<<0ddcefe367b8dfd3bb64b1891afc7e2e>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -17,6 +17,8 @@ export type ContinualImprovementsPageFragment$data = {
readonly __id: string;
readonly edges: ReadonlyArray<{
readonly node: {
readonly canDelete: boolean;
readonly canUpdate: boolean;
readonly createdAt: any;
readonly description: string | null | undefined;
readonly id: string;
@@ -244,6 +246,32 @@ return {
"name": "updatedAt",
"storageKey": null
},
{
"alias": "canUpdate",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:continual-improvement:update"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:continual-improvement:update\")"
},
{
"alias": "canDelete",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:continual-improvement:delete"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:continual-improvement:delete\")"
},
{
"alias": null,
"args": null,
@@ -310,6 +338,6 @@ return {
};
})();
(node as any).hash = "44e30d3febc79c6df7236567d85e9ca8";
(node as any).hash = "ec045ffacd206a4854cb864eadf3ef50";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<908fcf894c6d8a46a122991d388a4cb7>>
* @generated SignedSource<<7c33b43cf4643af5c173b4cabd2047a8>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -275,6 +275,32 @@ return {
"name": "updatedAt",
"storageKey": null
},
{
"alias": "canUpdate",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:continual-improvement:update"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:continual-improvement:update\")"
},
{
"alias": "canDelete",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:continual-improvement:delete"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:continual-improvement:delete\")"
},
(v8/*: any*/)
],
"storageKey": null
@@ -350,16 +376,16 @@ return {
]
},
"params": {
"cacheID": "277ed3aedb8b99e9ec291997ba0d0943",
"cacheID": "a0a9ad9d08da13436195a49ac3fce89c",
"id": null,
"metadata": {},
"name": "ContinualImprovementsPageRefetchQuery",
"operationKind": "query",
"text": "query ContinualImprovementsPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ContinualImprovementsPageFragment_35e0S5\n id\n }\n}\n\nfragment ContinualImprovementsPageFragment_35e0S5 on Organization {\n id\n continualImprovements(first: $first, after: $after, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
"text": "query ContinualImprovementsPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ContinualImprovementsPageFragment_35e0S5\n id\n }\n}\n\nfragment ContinualImprovementsPageFragment_35e0S5 on Organization {\n id\n continualImprovements(first: $first, after: $after, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:continual-improvement:update\")\n canDelete: permission(action: \"core:continual-improvement:delete\")\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
}
};
})();
(node as any).hash = "44e30d3febc79c6df7236567d85e9ca8";
(node as any).hash = "ec045ffacd206a4854cb864eadf3ef50";
export default node;

View File

@@ -5,12 +5,19 @@ import { useTranslate } from "@probo/i18n";
import { promisifyMutation, sprintf } from "@probo/helpers";
import { useMutationWithToasts } from "../useMutationWithToasts";
export const ContinualImprovementsConnectionKey = "ContinualImprovementsPage_continualImprovements";
export const ContinualImprovementsConnectionKey =
"ContinualImprovementsPage_continualImprovements";
export const continualImprovementsQuery = graphql`
query ContinualImprovementGraphListQuery($organizationId: ID!, $snapshotId: ID) {
query ContinualImprovementGraphListQuery(
$organizationId: ID!
$snapshotId: ID
) {
node(id: $organizationId) {
... on Organization {
canCreateContinualImprovement: permission(
action: "core:continual-improvement:create"
)
...ContinualImprovementsPageFragment @arguments(snapshotId: $snapshotId)
}
}
@@ -40,6 +47,8 @@ export const continualImprovementNodeQuery = graphql`
}
createdAt
updatedAt
canUpdate: permission(action: "core:continual-improvement:update")
canDelete: permission(action: "core:continual-improvement:delete")
}
}
}
@@ -65,6 +74,8 @@ export const createContinualImprovementMutation = graphql`
fullName
}
createdAt
canUpdate: permission(action: "core:continual-improvement:update")
canDelete: permission(action: "core:continual-improvement:delete")
}
}
}
@@ -72,7 +83,9 @@ export const createContinualImprovementMutation = graphql`
`;
export const updateContinualImprovementMutation = graphql`
mutation ContinualImprovementGraphUpdateMutation($input: UpdateContinualImprovementInput!) {
mutation ContinualImprovementGraphUpdateMutation(
$input: UpdateContinualImprovementInput!
) {
updateContinualImprovement(input: $input) {
continualImprovement {
id
@@ -105,7 +118,7 @@ export const deleteContinualImprovementMutation = graphql`
export const useDeleteContinualImprovement = (
improvement: { id: string; referenceId: string },
connectionId: string
connectionId: string,
) => {
const { __ } = useTranslate();
const [mutate] = useMutationWithToasts(deleteContinualImprovementMutation, {
@@ -128,11 +141,11 @@ export const useDeleteContinualImprovement = (
{
message: sprintf(
__(
"This will permanently delete the continual improvement %s. This action cannot be undone."
"This will permanently delete the continual improvement %s. This action cannot be undone.",
),
improvement.referenceId
improvement.referenceId,
),
}
},
);
};
};
@@ -152,13 +165,19 @@ export const useCreateContinualImprovement = (connectionId: string) => {
priority: string;
}) => {
if (!input.organizationId) {
return alert(__("Failed to create continual improvement: organization is required"));
return alert(
__("Failed to create continual improvement: organization is required"),
);
}
if (!input.referenceId) {
return alert(__("Failed to create continual improvement: reference ID is required"));
return alert(
__("Failed to create continual improvement: reference ID is required"),
);
}
if (!input.ownerId) {
return alert(__("Failed to create continual improvement: owner is required"));
return alert(
__("Failed to create continual improvement: owner is required"),
);
}
return promisifyMutation(mutate)({
@@ -194,7 +213,9 @@ export const useUpdateContinualImprovement = () => {
priority?: string;
}) => {
if (!input.id) {
return alert(__("Failed to update continual improvement: ID is required"));
return alert(
__("Failed to update continual improvement: ID is required"),
);
}
return promisifyMutation(mutate)({

View File

@@ -40,8 +40,6 @@ import {
} from "@probo/helpers";
import { SnapshotBanner } from "/components/SnapshotBanner";
import type { ContinualImprovementGraphNodeQuery } from "/__generated__/core/ContinualImprovementGraphNodeQuery.graphql";
import { use } from "react";
import { PermissionsContext } from "/providers/PermissionsContext";
const updateImprovementSchema = z.object({
referenceId: z.string().min(1, "Reference ID is required"),
@@ -58,17 +56,16 @@ type Props = {
};
export default function ContinualImprovementDetailsPage(props: Props) {
const data = usePreloadedQuery<ContinualImprovementGraphNodeQuery>(
continualImprovementNodeQuery,
props.queryRef,
);
const improvement = data.node;
const { node: improvement } =
usePreloadedQuery<ContinualImprovementGraphNodeQuery>(
continualImprovementNodeQuery,
props.queryRef,
);
const { __ } = useTranslate();
const { toast } = useToast();
const organizationId = useOrganizationId();
const { snapshotId } = useParams<{ snapshotId?: string }>();
const isSnapshotMode = Boolean(snapshotId);
const { isAuthorized } = use(PermissionsContext);
validateSnapshotConsistency(improvement, snapshotId);
@@ -163,17 +160,13 @@ export default function ContinualImprovementDetailsPage(props: Props) {
{ label: improvement.referenceId! },
]}
/>
{!isSnapshotMode &&
isAuthorized(
"ContinualImprovement",
"deleteContinualImprovement",
) && (
<ActionDropdown>
<DropdownItem onClick={deleteImprovement} variant="danger">
{__("Delete")}
</DropdownItem>
</ActionDropdown>
)}
{!isSnapshotMode && improvement.canDelete && (
<ActionDropdown>
<DropdownItem onClick={deleteImprovement} variant="danger">
{__("Delete")}
</DropdownItem>
</ActionDropdown>
)}
</div>
<Card>
@@ -315,10 +308,7 @@ export default function ContinualImprovementDetailsPage(props: Props) {
{!isSnapshotMode && (
<div className="flex justify-end pt-4">
{isAuthorized(
"ContinualImprovement",
"updateContinualImprovement",
) && (
{improvement.canUpdate && (
<Button
type="submit"
variant="primary"

View File

@@ -46,8 +46,6 @@ import type {
ContinualImprovementsPageFragment$key,
ContinualImprovementsPageFragment$data,
} from "/__generated__/core/ContinualImprovementsPageFragment.graphql";
import { use } from "react";
import { PermissionsContext } from "/providers/PermissionsContext";
import type { ContinualImprovementGraphListQuery } from "/__generated__/core/ContinualImprovementGraphListQuery.graphql";
interface ContinualImprovementsPageProps {
@@ -91,6 +89,8 @@ const continualImprovementsPageFragment = graphql`
}
createdAt
updatedAt
canUpdate: permission(action: "core:continual-improvement:update")
canDelete: permission(action: "core:continual-improvement:delete")
}
}
pageInfo {
@@ -108,7 +108,6 @@ export default function ContinualImprovementsPage({
const organizationId = useOrganizationId();
const { snapshotId } = useParams<{ snapshotId?: string }>();
const isSnapshotMode = Boolean(snapshotId);
const { isAuthorized } = use(PermissionsContext);
usePageTitle(__("Continual Improvements"));
@@ -129,8 +128,7 @@ export default function ContinualImprovementsPage({
const hasAnyAction =
!isSnapshotMode &&
(isAuthorized("ContinualImprovement", "updateContinualImprovement") ||
isAuthorized("ContinualImprovement", "deleteContinualImprovement"));
improvements.some(({ canUpdate, canDelete }) => canUpdate || canDelete);
return (
<div className="space-y-6">
@@ -141,17 +139,16 @@ export default function ContinualImprovementsPage({
title={__("Continual Improvements")}
description={__("Manage your continual improvements.")}
>
{!isSnapshotMode &&
isAuthorized("Organization", "createContinualImprovement") && (
<CreateContinualImprovementDialog
organizationId={organizationId}
connectionId={connectionId}
>
<Button icon={IconPlusLarge}>
{__("Add continual improvement")}
</Button>
</CreateContinualImprovementDialog>
)}
{!isSnapshotMode && organization.node.canCreateContinualImprovement && (
<CreateContinualImprovementDialog
organizationId={organizationId}
connectionId={connectionId}
>
<Button icon={IconPlusLarge}>
{__("Add continual improvement")}
</Button>
</CreateContinualImprovementDialog>
)}
</PageHeader>
{improvements.length > 0 ? (
@@ -227,7 +224,6 @@ function ImprovementRow({
const [deleteImprovement] = useMutation(deleteContinualImprovementMutation);
const confirm = useConfirm();
const isSnapshotMode = Boolean(snapshotId);
const { isAuthorized } = use(PermissionsContext);
const handleDelete = () => {
confirm(
@@ -296,10 +292,7 @@ function ImprovementRow({
{hasAnyAction && (
<Td noLink width={50} className="text-end">
<ActionDropdown>
{isAuthorized(
"ContinualImprovement",
"deleteContinualImprovement",
) && (
{improvement.canDelete && (
<DropdownItem
icon={IconTrashCan}
variant="danger"