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;