Change default document sorting order

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-07-03 08:02:30 +02:00
parent 179fc5b60c
commit c97bc5bce3
4 changed files with 33 additions and 16 deletions

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<d9bda0dcda5063209bf188927b57d117>>
* @generated SignedSource<<655af0293c63115d54c7351c67f5391f>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -58,6 +58,14 @@ v4 = [
"kind": "Literal",
"name": "first",
"value": 50
},
{
"kind": "Literal",
"name": "orderBy",
"value": {
"direction": "ASC",
"field": "TITLE"
}
}
];
return {
@@ -339,7 +347,7 @@ return {
]
}
],
"storageKey": "documents(first:50)"
"storageKey": "documents(first:50,orderBy:{\"direction\":\"ASC\",\"field\":\"TITLE\"})"
},
{
"alias": null,
@@ -362,12 +370,12 @@ return {
]
},
"params": {
"cacheID": "cefd94e1cb5245f2d9852b098653ce53",
"cacheID": "2af85ef46f318852086b498eea618a5b",
"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) {\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 signatures(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n }\n }\n }\n}\n"
}
};
})();

View File

@@ -34,14 +34,17 @@ import { usePageTitle } from "@probo/hooks";
import { sprintf, getDocumentTypeLabel } from "@probo/helpers";
import { CreateDocumentDialog } from "./dialogs/CreateDocumentDialog";
import type { DocumentsPageRowFragment$key } from "./__generated__/DocumentsPageRowFragment.graphql";
import { SortableTable } from "/components/SortableTable";
import { SortableTable, SortableTh } from "/components/SortableTable";
const documentsFragment = graphql`
fragment DocumentsPageListFragment on Organization
@refetchable(queryName: "DocumentsListQuery")
@argumentDefinitions(
first: { type: "Int", defaultValue: 50 }
order: { type: "DocumentOrder", defaultValue: null }
order: {
type: "DocumentOrder"
defaultValue: { field: TITLE, direction: ASC }
}
after: { type: "CursorKey", defaultValue: null }
before: { type: "CursorKey", defaultValue: null }
last: { type: "Int", defaultValue: null }
@@ -117,9 +120,9 @@ export default function DocumentsPage(props: Props) {
<SortableTable {...pagination}>
<Thead>
<Tr>
<Th>{__("Name")}</Th>
<SortableTh field="TITLE">{__("Name")}</SortableTh>
<Th>{__("Status")}</Th>
<Th>{__("Type")}</Th>
<SortableTh field="DOCUMENT_TYPE">{__("Type")}</SortableTh>
<Th>{__("Owner")}</Th>
<Th>{__("Last update")}</Th>
<Th>{__("Signatures")}</Th>

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<7ebb9cf96131d4b0b2670e63ab60e0d6>>
* @generated SignedSource<<b61f74ae791f86da55afd868c68c85e4>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -61,7 +61,10 @@ v4 = {
"name": "last"
},
v5 = {
"defaultValue": null,
"defaultValue": {
"direction": "ASC",
"field": "TITLE"
},
"kind": "LocalArgument",
"name": "order"
},
@@ -442,16 +445,16 @@ return {
]
},
"params": {
"cacheID": "3da7d3804fefec2e77c96b6c33c2cefc",
"cacheID": "4605341c7a59a8b6e030a1f3ef3ce8bd",
"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 = null\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 signatures(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "dc234a4cafbe4da1c1ff4943ff75c32a";
(node as any).hash = "8cda24b1d10caa3f4b83dbb82035365b";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<1082bf950eb1233b6c85c02d89dcd260>>
* @generated SignedSource<<0abee66a5b3a949907293acd4981f05e>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -64,7 +64,10 @@ return {
"name": "last"
},
{
"defaultValue": null,
"defaultValue": {
"direction": "ASC",
"field": "TITLE"
},
"kind": "LocalArgument",
"name": "order"
}
@@ -220,6 +223,6 @@ return {
};
})();
(node as any).hash = "dc234a4cafbe4da1c1ff4943ff75c32a";
(node as any).hash = "8cda24b1d10caa3f4b83dbb82035365b";
export default node;