Add document version on document list

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-10-13 22:45:06 +02:00
parent 0c4a7169df
commit eedb4861d2
6 changed files with 54 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<655af0293c63115d54c7351c67f5391f>>
* @generated SignedSource<<dadd56cf5c824a11fde8900650f5b9aa>>
* @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"
}
};
})();

View File

@@ -202,6 +202,7 @@ export default function DocumentsPage(props: Props) {
</Th>
<SortableTh field="TITLE" className="min-w-0">{__("Name")}</SortableTh>
<Th className="w-24">{__("Status")}</Th>
<Th className="w-20">{__("Version")}</Th>
<SortableTh field="DOCUMENT_TYPE" className="w-28">{__("Type")}</SortableTh>
<Th className="w-60">{__("Owner")}</Th>
<Th className="w-60">{__("Last update")}</Th>
@@ -210,7 +211,7 @@ export default function DocumentsPage(props: Props) {
</Tr>
) : (
<Tr>
<Th colspan={8} compact>
<Th colspan={9} compact>
<div className="flex justify-between items-center h-8">
<div className="flex gap-2 items-center">
{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")}
</Badge>
</Td>
<Td className="w-20">v{lastVersion.version}</Td>
<Td className="w-28">{getDocumentTypeLabel(__, document.documentType)}</Td>
<Td className="w-60">
<div className="flex gap-2 items-center">

View File

@@ -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"
}
};
})();

View File

@@ -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;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<b4a59b6243c579d023e7ab12cc037f20>>
* @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"
}
};
})();

View File

@@ -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"
}
};
})();