diff --git a/apps/console/src/hooks/graph/__generated__/DocumentGraphListQuery.graphql.ts b/apps/console/src/hooks/graph/__generated__/DocumentGraphListQuery.graphql.ts index cbdcc9af0..1a160dbfd 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<> + * @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" } }; })(); diff --git a/apps/console/src/pages/organizations/documents/DocumentsPage.tsx b/apps/console/src/pages/organizations/documents/DocumentsPage.tsx index b1da4fee1..eeb19a5b3 100644 --- a/apps/console/src/pages/organizations/documents/DocumentsPage.tsx +++ b/apps/console/src/pages/organizations/documents/DocumentsPage.tsx @@ -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) { - {__("Name")} + {__("Name")} {__("Status")} - {__("Type")} + {__("Type")} {__("Owner")} {__("Last update")} {__("Signatures")} 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 666282df7..2b2e7edec 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<<7ebb9cf96131d4b0b2670e63ab60e0d6>> + * @generated SignedSource<> * @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; diff --git a/apps/console/src/pages/organizations/documents/__generated__/DocumentsPageListFragment.graphql.ts b/apps/console/src/pages/organizations/documents/__generated__/DocumentsPageListFragment.graphql.ts index 99da9ad4c..d04a96b61 100644 --- a/apps/console/src/pages/organizations/documents/__generated__/DocumentsPageListFragment.graphql.ts +++ b/apps/console/src/pages/organizations/documents/__generated__/DocumentsPageListFragment.graphql.ts @@ -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;