From eedb4861d2c6f73b979aea16f5a381338f247a70 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Mon, 13 Oct 2025 22:45:06 +0200 Subject: [PATCH] Add document version on document list Signed-off-by: Bryan Frimin --- .../__generated__/DocumentGraphListQuery.graphql.ts | 13 ++++++++++--- .../pages/organizations/documents/DocumentsPage.tsx | 5 ++++- .../__generated__/DocumentsListQuery.graphql.ts | 13 ++++++++++--- .../DocumentsPageRowFragment.graphql.ts | 12 ++++++++++-- .../CreateDocumentDialogMutation.graphql.ts | 13 ++++++++++--- .../PublishDocumentsDialogMutation.graphql.ts | 13 ++++++++++--- 6 files changed, 54 insertions(+), 15 deletions(-) diff --git a/apps/console/src/hooks/graph/__generated__/DocumentGraphListQuery.graphql.ts b/apps/console/src/hooks/graph/__generated__/DocumentGraphListQuery.graphql.ts index 1a160dbfd..2a2a1f4b3 100644 --- a/apps/console/src/hooks/graph/__generated__/DocumentGraphListQuery.graphql.ts +++ b/apps/console/src/hooks/graph/__generated__/DocumentGraphListQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<655af0293c63115d54c7351c67f5391f>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -225,6 +225,13 @@ return { "name": "status", "storageKey": null }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "version", + "storageKey": null + }, { "alias": null, "args": [ @@ -370,12 +377,12 @@ return { ] }, "params": { - "cacheID": "2af85ef46f318852086b498eea618a5b", + "cacheID": "d7102991719b8d6aa2ef4ecd5b763250", "id": null, "metadata": {}, "name": "DocumentGraphListQuery", "operationKind": "query", - "text": "query DocumentGraphListQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ...DocumentsPageListFragment\n }\n}\n\nfragment DocumentsPageListFragment on Organization {\n documents(first: 50, orderBy: {field: TITLE, direction: ASC}) {\n edges {\n node {\n id\n ...DocumentsPageRowFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment DocumentsPageRowFragment on Document {\n id\n title\n description\n documentType\n updatedAt\n owner {\n id\n fullName\n }\n versions(first: 1) {\n edges {\n node {\n id\n status\n signatures(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n }\n }\n }\n}\n" + "text": "query DocumentGraphListQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ...DocumentsPageListFragment\n }\n}\n\nfragment DocumentsPageListFragment on Organization {\n documents(first: 50, orderBy: {field: TITLE, direction: ASC}) {\n edges {\n node {\n id\n ...DocumentsPageRowFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment DocumentsPageRowFragment on Document {\n id\n title\n description\n documentType\n updatedAt\n owner {\n id\n fullName\n }\n versions(first: 1) {\n edges {\n node {\n id\n status\n version\n signatures(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n }\n }\n }\n}\n" } }; })(); diff --git a/apps/console/src/pages/organizations/documents/DocumentsPage.tsx b/apps/console/src/pages/organizations/documents/DocumentsPage.tsx index 5fc4e5dcf..2c8d793a1 100644 --- a/apps/console/src/pages/organizations/documents/DocumentsPage.tsx +++ b/apps/console/src/pages/organizations/documents/DocumentsPage.tsx @@ -202,6 +202,7 @@ export default function DocumentsPage(props: Props) { {__("Name")} {__("Status")} + {__("Version")} {__("Type")} {__("Owner")} {__("Last update")} @@ -210,7 +211,7 @@ export default function DocumentsPage(props: Props) { ) : ( - +
{sprintf(__("%s documents selected"), selection.length)} - @@ -313,6 +314,7 @@ const rowFragment = graphql` node { id status + version signatures(first: 100) { edges { node { @@ -392,6 +394,7 @@ function DocumentRow({ {isDraft ? __("Draft") : __("Published")} + v{lastVersion.version} {getDocumentTypeLabel(__, document.documentType)}
diff --git a/apps/console/src/pages/organizations/documents/__generated__/DocumentsListQuery.graphql.ts b/apps/console/src/pages/organizations/documents/__generated__/DocumentsListQuery.graphql.ts index 2d5f12030..69c326354 100644 --- a/apps/console/src/pages/organizations/documents/__generated__/DocumentsListQuery.graphql.ts +++ b/apps/console/src/pages/organizations/documents/__generated__/DocumentsListQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<9ea096db73885458f35ae718a00ded47>> + * @generated SignedSource<<0b738ecabb86e683a0bae1f31700c0c4>> * @lightSyntaxTransform * @nogrep */ @@ -300,6 +300,13 @@ return { "name": "status", "storageKey": null }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "version", + "storageKey": null + }, { "alias": null, "args": [ @@ -445,12 +452,12 @@ return { ] }, "params": { - "cacheID": "4605341c7a59a8b6e030a1f3ef3ce8bd", + "cacheID": "8cacafcbdbcd2d4f454d43a609aad010", "id": null, "metadata": {}, "name": "DocumentsListQuery", "operationKind": "query", - "text": "query DocumentsListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 50\n $last: Int = null\n $order: DocumentOrder = {field: TITLE, direction: ASC}\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...DocumentsPageListFragment_16fISc\n id\n }\n}\n\nfragment DocumentsPageListFragment_16fISc on Organization {\n documents(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n edges {\n node {\n id\n ...DocumentsPageRowFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment DocumentsPageRowFragment on Document {\n id\n title\n description\n documentType\n updatedAt\n owner {\n id\n fullName\n }\n versions(first: 1) {\n edges {\n node {\n id\n status\n signatures(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n }\n }\n }\n}\n" + "text": "query DocumentsListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 50\n $last: Int = null\n $order: DocumentOrder = {field: TITLE, direction: ASC}\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...DocumentsPageListFragment_16fISc\n id\n }\n}\n\nfragment DocumentsPageListFragment_16fISc on Organization {\n documents(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n edges {\n node {\n id\n ...DocumentsPageRowFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment DocumentsPageRowFragment on Document {\n id\n title\n description\n documentType\n updatedAt\n owner {\n id\n fullName\n }\n versions(first: 1) {\n edges {\n node {\n id\n status\n version\n signatures(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n }\n }\n }\n}\n" } }; })(); diff --git a/apps/console/src/pages/organizations/documents/__generated__/DocumentsPageRowFragment.graphql.ts b/apps/console/src/pages/organizations/documents/__generated__/DocumentsPageRowFragment.graphql.ts index c2d4025ad..af7a275d6 100644 --- a/apps/console/src/pages/organizations/documents/__generated__/DocumentsPageRowFragment.graphql.ts +++ b/apps/console/src/pages/organizations/documents/__generated__/DocumentsPageRowFragment.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<87090235b9f77e1e018ec30e6ff9bacb>> + * @generated SignedSource<<32d1bb469d4ece0eb14b746587eb45a1>> * @lightSyntaxTransform * @nogrep */ @@ -36,6 +36,7 @@ export type DocumentsPageRowFragment$data = { }>; }; readonly status: DocumentStatus; + readonly version: number; }; }>; }; @@ -146,6 +147,13 @@ return { "name": "status", "storageKey": null }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "version", + "storageKey": null + }, { "alias": null, "args": [ @@ -208,6 +216,6 @@ return { }; })(); -(node as any).hash = "c8543275dc108732ad2377806efacfc1"; +(node as any).hash = "3cb482445055e1fea0e36ff3e7255cb5"; export default node; diff --git a/apps/console/src/pages/organizations/documents/dialogs/__generated__/CreateDocumentDialogMutation.graphql.ts b/apps/console/src/pages/organizations/documents/dialogs/__generated__/CreateDocumentDialogMutation.graphql.ts index fb1994326..2556fe79c 100644 --- a/apps/console/src/pages/organizations/documents/dialogs/__generated__/CreateDocumentDialogMutation.graphql.ts +++ b/apps/console/src/pages/organizations/documents/dialogs/__generated__/CreateDocumentDialogMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<4d1e3c4d8c567a0b463ea1a1b7cc02f5>> * @lightSyntaxTransform * @nogrep */ @@ -236,6 +236,13 @@ return { "name": "status", "storageKey": null }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "version", + "storageKey": null + }, { "alias": null, "args": [ @@ -320,12 +327,12 @@ return { ] }, "params": { - "cacheID": "e60a87953e4157e808e0d4ce4436ed3b", + "cacheID": "271b1222b172816daeac0beb08737084", "id": null, "metadata": {}, "name": "CreateDocumentDialogMutation", "operationKind": "mutation", - "text": "mutation CreateDocumentDialogMutation(\n $input: CreateDocumentInput!\n) {\n createDocument(input: $input) {\n documentEdge {\n node {\n id\n ...DocumentsPageRowFragment\n }\n }\n }\n}\n\nfragment DocumentsPageRowFragment on Document {\n id\n title\n description\n documentType\n updatedAt\n owner {\n id\n fullName\n }\n versions(first: 1) {\n edges {\n node {\n id\n status\n signatures(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n }\n }\n }\n}\n" + "text": "mutation CreateDocumentDialogMutation(\n $input: CreateDocumentInput!\n) {\n createDocument(input: $input) {\n documentEdge {\n node {\n id\n ...DocumentsPageRowFragment\n }\n }\n }\n}\n\nfragment DocumentsPageRowFragment on Document {\n id\n title\n description\n documentType\n updatedAt\n owner {\n id\n fullName\n }\n versions(first: 1) {\n edges {\n node {\n id\n status\n version\n signatures(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n }\n }\n }\n}\n" } }; })(); diff --git a/apps/console/src/pages/organizations/documents/dialogs/__generated__/PublishDocumentsDialogMutation.graphql.ts b/apps/console/src/pages/organizations/documents/dialogs/__generated__/PublishDocumentsDialogMutation.graphql.ts index f99faedaf..ae77df0fc 100644 --- a/apps/console/src/pages/organizations/documents/dialogs/__generated__/PublishDocumentsDialogMutation.graphql.ts +++ b/apps/console/src/pages/organizations/documents/dialogs/__generated__/PublishDocumentsDialogMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<2961ff4f50f912f350acab5b0a341042>> + * @generated SignedSource<<63939336fc37ddb7ced322612302c90b>> * @lightSyntaxTransform * @nogrep */ @@ -220,6 +220,13 @@ return { "name": "status", "storageKey": null }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "version", + "storageKey": null + }, { "alias": null, "args": [ @@ -288,12 +295,12 @@ return { ] }, "params": { - "cacheID": "bcc8589071b241670107f00c127f70d0", + "cacheID": "a5266ffa85ab7455c700dfe75ae74956", "id": null, "metadata": {}, "name": "PublishDocumentsDialogMutation", "operationKind": "mutation", - "text": "mutation PublishDocumentsDialogMutation(\n $input: BulkPublishDocumentVersionsInput!\n) {\n bulkPublishDocumentVersions(input: $input) {\n documentEdges {\n node {\n id\n ...DocumentsPageRowFragment\n }\n }\n }\n}\n\nfragment DocumentsPageRowFragment on Document {\n id\n title\n description\n documentType\n updatedAt\n owner {\n id\n fullName\n }\n versions(first: 1) {\n edges {\n node {\n id\n status\n signatures(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n }\n }\n }\n}\n" + "text": "mutation PublishDocumentsDialogMutation(\n $input: BulkPublishDocumentVersionsInput!\n) {\n bulkPublishDocumentVersions(input: $input) {\n documentEdges {\n node {\n id\n ...DocumentsPageRowFragment\n }\n }\n }\n}\n\nfragment DocumentsPageRowFragment on Document {\n id\n title\n description\n documentType\n updatedAt\n owner {\n id\n fullName\n }\n versions(first: 1) {\n edges {\n node {\n id\n status\n version\n signatures(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n }\n }\n }\n}\n" } }; })();