Fix continual improvements pages permissions handling
Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<05cc2f7b3bf513e9a1f1e192950c011e>>
|
* @generated SignedSource<<a63771cb94fb0efc99bb250d7cd8a052>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -29,6 +29,8 @@ export type ContinualImprovementGraphCreateMutation$data = {
|
|||||||
readonly createContinualImprovement: {
|
readonly createContinualImprovement: {
|
||||||
readonly continualImprovementEdge: {
|
readonly continualImprovementEdge: {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
|
readonly canDelete: boolean;
|
||||||
|
readonly canUpdate: boolean;
|
||||||
readonly createdAt: any;
|
readonly createdAt: any;
|
||||||
readonly description: string | null | undefined;
|
readonly description: string | null | undefined;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
@@ -159,6 +161,32 @@ v4 = {
|
|||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "createdAt",
|
"name": "createdAt",
|
||||||
"storageKey": null
|
"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
|
"storageKey": null
|
||||||
@@ -232,16 +260,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "8789a6fab51997d85cbc98481c047b9c",
|
"cacheID": "5894da3b2ddc1c4a16c030770fae53bb",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "ContinualImprovementGraphCreateMutation",
|
"name": "ContinualImprovementGraphCreateMutation",
|
||||||
"operationKind": "mutation",
|
"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;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<bf69bf053e5fe5b3c0cc88a80e164325>>
|
* @generated SignedSource<<4e8617c8aeee3cf066e40053ba260a61>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -16,6 +16,7 @@ export type ContinualImprovementGraphListQuery$variables = {
|
|||||||
};
|
};
|
||||||
export type ContinualImprovementGraphListQuery$data = {
|
export type ContinualImprovementGraphListQuery$data = {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
|
readonly canCreateContinualImprovement?: boolean;
|
||||||
readonly " $fragmentSpreads": FragmentRefs<"ContinualImprovementsPageFragment">;
|
readonly " $fragmentSpreads": FragmentRefs<"ContinualImprovementsPageFragment">;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -44,30 +45,43 @@ v1 = [
|
|||||||
"variableName": "organizationId"
|
"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",
|
"kind": "Variable",
|
||||||
"name": "snapshotId",
|
"name": "snapshotId",
|
||||||
"variableName": "snapshotId"
|
"variableName": "snapshotId"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
v3 = {
|
v4 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "__typename",
|
"name": "__typename",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v4 = {
|
v5 = {
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
v5 = [
|
v6 = [
|
||||||
{
|
{
|
||||||
"fields": (v2/*: any*/),
|
"fields": (v3/*: any*/),
|
||||||
"kind": "ObjectValue",
|
"kind": "ObjectValue",
|
||||||
"name": "filter"
|
"name": "filter"
|
||||||
},
|
},
|
||||||
@@ -95,8 +109,9 @@ return {
|
|||||||
{
|
{
|
||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
|
(v2/*: any*/),
|
||||||
{
|
{
|
||||||
"args": (v2/*: any*/),
|
"args": (v3/*: any*/),
|
||||||
"kind": "FragmentSpread",
|
"kind": "FragmentSpread",
|
||||||
"name": "ContinualImprovementsPageFragment"
|
"name": "ContinualImprovementsPageFragment"
|
||||||
}
|
}
|
||||||
@@ -125,14 +140,15 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v3/*: any*/),
|
|
||||||
(v4/*: any*/),
|
(v4/*: any*/),
|
||||||
|
(v5/*: any*/),
|
||||||
{
|
{
|
||||||
"kind": "InlineFragment",
|
"kind": "InlineFragment",
|
||||||
"selections": [
|
"selections": [
|
||||||
|
(v2/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v5/*: any*/),
|
"args": (v6/*: any*/),
|
||||||
"concreteType": "ContinualImprovementConnection",
|
"concreteType": "ContinualImprovementConnection",
|
||||||
"kind": "LinkedField",
|
"kind": "LinkedField",
|
||||||
"name": "continualImprovements",
|
"name": "continualImprovements",
|
||||||
@@ -161,7 +177,7 @@ return {
|
|||||||
"name": "node",
|
"name": "node",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v4/*: any*/),
|
(v5/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -226,7 +242,7 @@ return {
|
|||||||
"name": "owner",
|
"name": "owner",
|
||||||
"plural": false,
|
"plural": false,
|
||||||
"selections": [
|
"selections": [
|
||||||
(v4/*: any*/),
|
(v5/*: any*/),
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -251,7 +267,33 @@ return {
|
|||||||
"name": "updatedAt",
|
"name": "updatedAt",
|
||||||
"storageKey": null
|
"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
|
"storageKey": null
|
||||||
},
|
},
|
||||||
@@ -307,7 +349,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": (v5/*: any*/),
|
"args": (v6/*: any*/),
|
||||||
"filters": [
|
"filters": [
|
||||||
"filter"
|
"filter"
|
||||||
],
|
],
|
||||||
@@ -326,16 +368,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "b1263b33f1cc0a63fd27a238626279c8",
|
"cacheID": "5f5124da6649b145ef6fddcf1009e95c",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "ContinualImprovementGraphListQuery",
|
"name": "ContinualImprovementGraphListQuery",
|
||||||
"operationKind": "query",
|
"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;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<69ae0bb47f8fefd6ded7233a78427acc>>
|
* @generated SignedSource<<eb936356e9504b1cd4eefb80b699987f>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -16,6 +16,8 @@ export type ContinualImprovementGraphNodeQuery$variables = {
|
|||||||
};
|
};
|
||||||
export type ContinualImprovementGraphNodeQuery$data = {
|
export type ContinualImprovementGraphNodeQuery$data = {
|
||||||
readonly node: {
|
readonly node: {
|
||||||
|
readonly canDelete?: boolean;
|
||||||
|
readonly canUpdate?: boolean;
|
||||||
readonly createdAt?: any;
|
readonly createdAt?: any;
|
||||||
readonly description?: string | null | undefined;
|
readonly description?: string | null | undefined;
|
||||||
readonly id?: string;
|
readonly id?: string;
|
||||||
@@ -171,6 +173,32 @@ v14 = {
|
|||||||
"kind": "ScalarField",
|
"kind": "ScalarField",
|
||||||
"name": "updatedAt",
|
"name": "updatedAt",
|
||||||
"storageKey": null
|
"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 {
|
return {
|
||||||
"fragment": {
|
"fragment": {
|
||||||
@@ -202,7 +230,9 @@ return {
|
|||||||
(v11/*: any*/),
|
(v11/*: any*/),
|
||||||
(v12/*: any*/),
|
(v12/*: any*/),
|
||||||
(v13/*: any*/),
|
(v13/*: any*/),
|
||||||
(v14/*: any*/)
|
(v14/*: any*/),
|
||||||
|
(v15/*: any*/),
|
||||||
|
(v16/*: any*/)
|
||||||
],
|
],
|
||||||
"type": "ContinualImprovement",
|
"type": "ContinualImprovement",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -250,7 +280,9 @@ return {
|
|||||||
(v11/*: any*/),
|
(v11/*: any*/),
|
||||||
(v12/*: any*/),
|
(v12/*: any*/),
|
||||||
(v13/*: any*/),
|
(v13/*: any*/),
|
||||||
(v14/*: any*/)
|
(v14/*: any*/),
|
||||||
|
(v15/*: any*/),
|
||||||
|
(v16/*: any*/)
|
||||||
],
|
],
|
||||||
"type": "ContinualImprovement",
|
"type": "ContinualImprovement",
|
||||||
"abstractKey": null
|
"abstractKey": null
|
||||||
@@ -261,16 +293,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "51e532cd66309a275af46ecaca65f0a6",
|
"cacheID": "c5fa96253fe8c3e8e8307936ca76704d",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "ContinualImprovementGraphNodeQuery",
|
"name": "ContinualImprovementGraphNodeQuery",
|
||||||
"operationKind": "query",
|
"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;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<3065b6b41135aa2dcbb45cdafae94503>>
|
* @generated SignedSource<<0ddcefe367b8dfd3bb64b1891afc7e2e>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -17,6 +17,8 @@ export type ContinualImprovementsPageFragment$data = {
|
|||||||
readonly __id: string;
|
readonly __id: string;
|
||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
readonly node: {
|
readonly node: {
|
||||||
|
readonly canDelete: boolean;
|
||||||
|
readonly canUpdate: boolean;
|
||||||
readonly createdAt: any;
|
readonly createdAt: any;
|
||||||
readonly description: string | null | undefined;
|
readonly description: string | null | undefined;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
@@ -244,6 +246,32 @@ return {
|
|||||||
"name": "updatedAt",
|
"name": "updatedAt",
|
||||||
"storageKey": null
|
"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,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -310,6 +338,6 @@ return {
|
|||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "44e30d3febc79c6df7236567d85e9ca8";
|
(node as any).hash = "ec045ffacd206a4854cb864eadf3ef50";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<908fcf894c6d8a46a122991d388a4cb7>>
|
* @generated SignedSource<<7c33b43cf4643af5c173b4cabd2047a8>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -275,6 +275,32 @@ return {
|
|||||||
"name": "updatedAt",
|
"name": "updatedAt",
|
||||||
"storageKey": null
|
"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*/)
|
(v8/*: any*/)
|
||||||
],
|
],
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
@@ -350,16 +376,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "277ed3aedb8b99e9ec291997ba0d0943",
|
"cacheID": "a0a9ad9d08da13436195a49ac3fce89c",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "ContinualImprovementsPageRefetchQuery",
|
"name": "ContinualImprovementsPageRefetchQuery",
|
||||||
"operationKind": "query",
|
"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;
|
export default node;
|
||||||
|
|||||||
@@ -5,12 +5,19 @@ import { useTranslate } from "@probo/i18n";
|
|||||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||||
|
|
||||||
export const ContinualImprovementsConnectionKey = "ContinualImprovementsPage_continualImprovements";
|
export const ContinualImprovementsConnectionKey =
|
||||||
|
"ContinualImprovementsPage_continualImprovements";
|
||||||
|
|
||||||
export const continualImprovementsQuery = graphql`
|
export const continualImprovementsQuery = graphql`
|
||||||
query ContinualImprovementGraphListQuery($organizationId: ID!, $snapshotId: ID) {
|
query ContinualImprovementGraphListQuery(
|
||||||
|
$organizationId: ID!
|
||||||
|
$snapshotId: ID
|
||||||
|
) {
|
||||||
node(id: $organizationId) {
|
node(id: $organizationId) {
|
||||||
... on Organization {
|
... on Organization {
|
||||||
|
canCreateContinualImprovement: permission(
|
||||||
|
action: "core:continual-improvement:create"
|
||||||
|
)
|
||||||
...ContinualImprovementsPageFragment @arguments(snapshotId: $snapshotId)
|
...ContinualImprovementsPageFragment @arguments(snapshotId: $snapshotId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -40,6 +47,8 @@ export const continualImprovementNodeQuery = graphql`
|
|||||||
}
|
}
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
|
canUpdate: permission(action: "core:continual-improvement:update")
|
||||||
|
canDelete: permission(action: "core:continual-improvement:delete")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,6 +74,8 @@ export const createContinualImprovementMutation = graphql`
|
|||||||
fullName
|
fullName
|
||||||
}
|
}
|
||||||
createdAt
|
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`
|
export const updateContinualImprovementMutation = graphql`
|
||||||
mutation ContinualImprovementGraphUpdateMutation($input: UpdateContinualImprovementInput!) {
|
mutation ContinualImprovementGraphUpdateMutation(
|
||||||
|
$input: UpdateContinualImprovementInput!
|
||||||
|
) {
|
||||||
updateContinualImprovement(input: $input) {
|
updateContinualImprovement(input: $input) {
|
||||||
continualImprovement {
|
continualImprovement {
|
||||||
id
|
id
|
||||||
@@ -105,7 +118,7 @@ export const deleteContinualImprovementMutation = graphql`
|
|||||||
|
|
||||||
export const useDeleteContinualImprovement = (
|
export const useDeleteContinualImprovement = (
|
||||||
improvement: { id: string; referenceId: string },
|
improvement: { id: string; referenceId: string },
|
||||||
connectionId: string
|
connectionId: string,
|
||||||
) => {
|
) => {
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const [mutate] = useMutationWithToasts(deleteContinualImprovementMutation, {
|
const [mutate] = useMutationWithToasts(deleteContinualImprovementMutation, {
|
||||||
@@ -128,11 +141,11 @@ export const useDeleteContinualImprovement = (
|
|||||||
{
|
{
|
||||||
message: sprintf(
|
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;
|
priority: string;
|
||||||
}) => {
|
}) => {
|
||||||
if (!input.organizationId) {
|
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) {
|
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) {
|
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)({
|
return promisifyMutation(mutate)({
|
||||||
@@ -194,7 +213,9 @@ export const useUpdateContinualImprovement = () => {
|
|||||||
priority?: string;
|
priority?: string;
|
||||||
}) => {
|
}) => {
|
||||||
if (!input.id) {
|
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)({
|
return promisifyMutation(mutate)({
|
||||||
|
|||||||
@@ -40,8 +40,6 @@ import {
|
|||||||
} from "@probo/helpers";
|
} from "@probo/helpers";
|
||||||
import { SnapshotBanner } from "/components/SnapshotBanner";
|
import { SnapshotBanner } from "/components/SnapshotBanner";
|
||||||
import type { ContinualImprovementGraphNodeQuery } from "/__generated__/core/ContinualImprovementGraphNodeQuery.graphql";
|
import type { ContinualImprovementGraphNodeQuery } from "/__generated__/core/ContinualImprovementGraphNodeQuery.graphql";
|
||||||
import { use } from "react";
|
|
||||||
import { PermissionsContext } from "/providers/PermissionsContext";
|
|
||||||
|
|
||||||
const updateImprovementSchema = z.object({
|
const updateImprovementSchema = z.object({
|
||||||
referenceId: z.string().min(1, "Reference ID is required"),
|
referenceId: z.string().min(1, "Reference ID is required"),
|
||||||
@@ -58,17 +56,16 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function ContinualImprovementDetailsPage(props: Props) {
|
export default function ContinualImprovementDetailsPage(props: Props) {
|
||||||
const data = usePreloadedQuery<ContinualImprovementGraphNodeQuery>(
|
const { node: improvement } =
|
||||||
continualImprovementNodeQuery,
|
usePreloadedQuery<ContinualImprovementGraphNodeQuery>(
|
||||||
props.queryRef,
|
continualImprovementNodeQuery,
|
||||||
);
|
props.queryRef,
|
||||||
const improvement = data.node;
|
);
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const organizationId = useOrganizationId();
|
const organizationId = useOrganizationId();
|
||||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||||
const isSnapshotMode = Boolean(snapshotId);
|
const isSnapshotMode = Boolean(snapshotId);
|
||||||
const { isAuthorized } = use(PermissionsContext);
|
|
||||||
|
|
||||||
validateSnapshotConsistency(improvement, snapshotId);
|
validateSnapshotConsistency(improvement, snapshotId);
|
||||||
|
|
||||||
@@ -163,17 +160,13 @@ export default function ContinualImprovementDetailsPage(props: Props) {
|
|||||||
{ label: improvement.referenceId! },
|
{ label: improvement.referenceId! },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
{!isSnapshotMode &&
|
{!isSnapshotMode && improvement.canDelete && (
|
||||||
isAuthorized(
|
<ActionDropdown>
|
||||||
"ContinualImprovement",
|
<DropdownItem onClick={deleteImprovement} variant="danger">
|
||||||
"deleteContinualImprovement",
|
{__("Delete")}
|
||||||
) && (
|
</DropdownItem>
|
||||||
<ActionDropdown>
|
</ActionDropdown>
|
||||||
<DropdownItem onClick={deleteImprovement} variant="danger">
|
)}
|
||||||
{__("Delete")}
|
|
||||||
</DropdownItem>
|
|
||||||
</ActionDropdown>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Card>
|
<Card>
|
||||||
@@ -315,10 +308,7 @@ export default function ContinualImprovementDetailsPage(props: Props) {
|
|||||||
|
|
||||||
{!isSnapshotMode && (
|
{!isSnapshotMode && (
|
||||||
<div className="flex justify-end pt-4">
|
<div className="flex justify-end pt-4">
|
||||||
{isAuthorized(
|
{improvement.canUpdate && (
|
||||||
"ContinualImprovement",
|
|
||||||
"updateContinualImprovement",
|
|
||||||
) && (
|
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
variant="primary"
|
variant="primary"
|
||||||
|
|||||||
@@ -46,8 +46,6 @@ import type {
|
|||||||
ContinualImprovementsPageFragment$key,
|
ContinualImprovementsPageFragment$key,
|
||||||
ContinualImprovementsPageFragment$data,
|
ContinualImprovementsPageFragment$data,
|
||||||
} from "/__generated__/core/ContinualImprovementsPageFragment.graphql";
|
} from "/__generated__/core/ContinualImprovementsPageFragment.graphql";
|
||||||
import { use } from "react";
|
|
||||||
import { PermissionsContext } from "/providers/PermissionsContext";
|
|
||||||
import type { ContinualImprovementGraphListQuery } from "/__generated__/core/ContinualImprovementGraphListQuery.graphql";
|
import type { ContinualImprovementGraphListQuery } from "/__generated__/core/ContinualImprovementGraphListQuery.graphql";
|
||||||
|
|
||||||
interface ContinualImprovementsPageProps {
|
interface ContinualImprovementsPageProps {
|
||||||
@@ -91,6 +89,8 @@ const continualImprovementsPageFragment = graphql`
|
|||||||
}
|
}
|
||||||
createdAt
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
|
canUpdate: permission(action: "core:continual-improvement:update")
|
||||||
|
canDelete: permission(action: "core:continual-improvement:delete")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pageInfo {
|
pageInfo {
|
||||||
@@ -108,7 +108,6 @@ export default function ContinualImprovementsPage({
|
|||||||
const organizationId = useOrganizationId();
|
const organizationId = useOrganizationId();
|
||||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||||
const isSnapshotMode = Boolean(snapshotId);
|
const isSnapshotMode = Boolean(snapshotId);
|
||||||
const { isAuthorized } = use(PermissionsContext);
|
|
||||||
|
|
||||||
usePageTitle(__("Continual Improvements"));
|
usePageTitle(__("Continual Improvements"));
|
||||||
|
|
||||||
@@ -129,8 +128,7 @@ export default function ContinualImprovementsPage({
|
|||||||
|
|
||||||
const hasAnyAction =
|
const hasAnyAction =
|
||||||
!isSnapshotMode &&
|
!isSnapshotMode &&
|
||||||
(isAuthorized("ContinualImprovement", "updateContinualImprovement") ||
|
improvements.some(({ canUpdate, canDelete }) => canUpdate || canDelete);
|
||||||
isAuthorized("ContinualImprovement", "deleteContinualImprovement"));
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
@@ -141,17 +139,16 @@ export default function ContinualImprovementsPage({
|
|||||||
title={__("Continual Improvements")}
|
title={__("Continual Improvements")}
|
||||||
description={__("Manage your continual improvements.")}
|
description={__("Manage your continual improvements.")}
|
||||||
>
|
>
|
||||||
{!isSnapshotMode &&
|
{!isSnapshotMode && organization.node.canCreateContinualImprovement && (
|
||||||
isAuthorized("Organization", "createContinualImprovement") && (
|
<CreateContinualImprovementDialog
|
||||||
<CreateContinualImprovementDialog
|
organizationId={organizationId}
|
||||||
organizationId={organizationId}
|
connectionId={connectionId}
|
||||||
connectionId={connectionId}
|
>
|
||||||
>
|
<Button icon={IconPlusLarge}>
|
||||||
<Button icon={IconPlusLarge}>
|
{__("Add continual improvement")}
|
||||||
{__("Add continual improvement")}
|
</Button>
|
||||||
</Button>
|
</CreateContinualImprovementDialog>
|
||||||
</CreateContinualImprovementDialog>
|
)}
|
||||||
)}
|
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
|
|
||||||
{improvements.length > 0 ? (
|
{improvements.length > 0 ? (
|
||||||
@@ -227,7 +224,6 @@ function ImprovementRow({
|
|||||||
const [deleteImprovement] = useMutation(deleteContinualImprovementMutation);
|
const [deleteImprovement] = useMutation(deleteContinualImprovementMutation);
|
||||||
const confirm = useConfirm();
|
const confirm = useConfirm();
|
||||||
const isSnapshotMode = Boolean(snapshotId);
|
const isSnapshotMode = Boolean(snapshotId);
|
||||||
const { isAuthorized } = use(PermissionsContext);
|
|
||||||
|
|
||||||
const handleDelete = () => {
|
const handleDelete = () => {
|
||||||
confirm(
|
confirm(
|
||||||
@@ -296,10 +292,7 @@ function ImprovementRow({
|
|||||||
{hasAnyAction && (
|
{hasAnyAction && (
|
||||||
<Td noLink width={50} className="text-end">
|
<Td noLink width={50} className="text-end">
|
||||||
<ActionDropdown>
|
<ActionDropdown>
|
||||||
{isAuthorized(
|
{improvement.canDelete && (
|
||||||
"ContinualImprovement",
|
|
||||||
"deleteContinualImprovement",
|
|
||||||
) && (
|
|
||||||
<DropdownItem
|
<DropdownItem
|
||||||
icon={IconTrashCan}
|
icon={IconTrashCan}
|
||||||
variant="danger"
|
variant="danger"
|
||||||
|
|||||||
Reference in New Issue
Block a user