Remove useless buttons

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-01-28 22:08:24 +04:00
parent 249d82f0fe
commit e6cea22578
9 changed files with 31 additions and 75 deletions

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<0bf1290a489f4685a6057509b9eaed9c>> * @generated SignedSource<<e625c06ddb883a0e59e945eeda97f519>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -61,7 +61,7 @@ const node: ReaderFragment = {
{ {
"kind": "Literal", "kind": "Literal",
"name": "first", "name": "first",
"value": 1000 "value": 100
} }
], ],
"concreteType": "AuditConnection", "concreteType": "AuditConnection",
@@ -104,13 +104,13 @@ const node: ReaderFragment = {
"storageKey": null "storageKey": null
} }
], ],
"storageKey": "audits(first:1000)" "storageKey": "audits(first:100)"
} }
], ],
"type": "Organization", "type": "Organization",
"abstractKey": null "abstractKey": null
}; };
(node as any).hash = "d307c5c23d18357bc09c1115989dd734"; (node as any).hash = "b66fddcbd57e4fd5af9f2a91663cb65b";
export default node; export default node;

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<9b92fdee29c65d57e35647e37f427be9>> * @generated SignedSource<<109bdc23095ddd764ac63f68d9185ab1>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -134,7 +134,7 @@ return {
{ {
"kind": "Literal", "kind": "Literal",
"name": "first", "name": "first",
"value": 1000 "value": 100
} }
], ],
"concreteType": "AuditConnection", "concreteType": "AuditConnection",
@@ -201,7 +201,7 @@ return {
"storageKey": null "storageKey": null
} }
], ],
"storageKey": "audits(first:1000)" "storageKey": "audits(first:100)"
} }
], ],
"type": "Organization", "type": "Organization",
@@ -214,12 +214,12 @@ return {
] ]
}, },
"params": { "params": {
"cacheID": "4efa36568b452a0075ed29fe7f5ed279", "cacheID": "ebb26dedba5dbbae4d46bcd3a41b201d",
"id": null, "id": null,
"metadata": {}, "metadata": {},
"name": "CompliancePageAuditsPageQuery", "name": "CompliancePageAuditsPageQuery",
"operationKind": "query", "operationKind": "query",
"text": "query CompliancePageAuditsPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ...CompliancePageAuditListFragment\n id\n }\n}\n\nfragment CompliancePageAuditListFragment on Organization {\n compliancePage: trustCenter {\n ...CompliancePageAuditListItem_compliancePageFragment\n id\n }\n audits(first: 1000) {\n edges {\n node {\n id\n ...CompliancePageAuditListItem_auditFragment\n }\n }\n }\n}\n\nfragment CompliancePageAuditListItem_auditFragment on Audit {\n id\n name\n framework {\n name\n id\n }\n validUntil\n state\n trustCenterVisibility\n}\n\nfragment CompliancePageAuditListItem_compliancePageFragment on TrustCenter {\n canUpdate: permission(action: \"core:trust-center:update\")\n}\n" "text": "query CompliancePageAuditsPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ...CompliancePageAuditListFragment\n id\n }\n}\n\nfragment CompliancePageAuditListFragment on Organization {\n compliancePage: trustCenter {\n ...CompliancePageAuditListItem_compliancePageFragment\n id\n }\n audits(first: 100) {\n edges {\n node {\n id\n ...CompliancePageAuditListItem_auditFragment\n }\n }\n }\n}\n\nfragment CompliancePageAuditListItem_auditFragment on Audit {\n id\n name\n framework {\n name\n id\n }\n validUntil\n state\n trustCenterVisibility\n}\n\nfragment CompliancePageAuditListItem_compliancePageFragment on TrustCenter {\n canUpdate: permission(action: \"core:trust-center:update\")\n}\n"
} }
}; };
})(); })();

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<520e633d06f7c68a9270600108ec81da>> * @generated SignedSource<<e02fc31002f54ed30be7e53370069aaa>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -61,7 +61,7 @@ const node: ReaderFragment = {
{ {
"kind": "Literal", "kind": "Literal",
"name": "first", "name": "first",
"value": 1000 "value": 100
} }
], ],
"concreteType": "DocumentConnection", "concreteType": "DocumentConnection",
@@ -104,13 +104,13 @@ const node: ReaderFragment = {
"storageKey": null "storageKey": null
} }
], ],
"storageKey": "documents(first:1000)" "storageKey": "documents(first:100)"
} }
], ],
"type": "Organization", "type": "Organization",
"abstractKey": null "abstractKey": null
}; };
(node as any).hash = "10da8f0838c700d4a2535ec5193844a8"; (node as any).hash = "a8d512034c171dc461a42e6ae6e76f12";
export default node; export default node;

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<d8855e4115fa54daf8305e6427c8e519>> * @generated SignedSource<<ccda9818c715d1b77b33d0114c235cb4>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -127,7 +127,7 @@ return {
{ {
"kind": "Literal", "kind": "Literal",
"name": "first", "name": "first",
"value": 1000 "value": 100
} }
], ],
"concreteType": "DocumentConnection", "concreteType": "DocumentConnection",
@@ -235,7 +235,7 @@ return {
"storageKey": null "storageKey": null
} }
], ],
"storageKey": "documents(first:1000)" "storageKey": "documents(first:100)"
} }
], ],
"type": "Organization", "type": "Organization",
@@ -248,12 +248,12 @@ return {
] ]
}, },
"params": { "params": {
"cacheID": "675dc82aa65110e99b4ddc51992999c3", "cacheID": "a094d511faa776c9e8d68f53933b3937",
"id": null, "id": null,
"metadata": {}, "metadata": {},
"name": "CompliancePageDocumentsPageQuery", "name": "CompliancePageDocumentsPageQuery",
"operationKind": "query", "operationKind": "query",
"text": "query CompliancePageDocumentsPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ...CompliancePageDocumentListFragment\n id\n }\n}\n\nfragment CompliancePageDocumentListFragment on Organization {\n compliancePage: trustCenter {\n ...CompliancePageDocumentListItem_compliancePageFragment\n id\n }\n documents(first: 1000) {\n edges {\n node {\n id\n ...CompliancePageDocumentListItem_documentFragment\n }\n }\n }\n}\n\nfragment CompliancePageDocumentListItem_compliancePageFragment on TrustCenter {\n canUpdate: permission(action: \"core:trust-center:update\")\n}\n\nfragment CompliancePageDocumentListItem_documentFragment on Document {\n id\n documentType\n title\n trustCenterVisibility\n lastVersion: versions(first: 1, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n" "text": "query CompliancePageDocumentsPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ...CompliancePageDocumentListFragment\n id\n }\n}\n\nfragment CompliancePageDocumentListFragment on Organization {\n compliancePage: trustCenter {\n ...CompliancePageDocumentListItem_compliancePageFragment\n id\n }\n documents(first: 100) {\n edges {\n node {\n id\n ...CompliancePageDocumentListItem_documentFragment\n }\n }\n }\n}\n\nfragment CompliancePageDocumentListItem_compliancePageFragment on TrustCenter {\n canUpdate: permission(action: \"core:trust-center:update\")\n}\n\nfragment CompliancePageDocumentListItem_documentFragment on Document {\n id\n documentType\n title\n trustCenterVisibility\n lastVersion: versions(first: 1, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n"
} }
}; };
})(); })();

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<6d08eaab8a421f1908e103b1343e72ac>> * @generated SignedSource<<6805840d2d78dff0dc2281278cf21757>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -168,6 +168,6 @@ const node: ReaderFragment = {
"abstractKey": null "abstractKey": null
}; };
(node as any).hash = "ebbed925b4bbca03e906f63a2d18ab7b"; (node as any).hash = "2d91d06498ed17aca44a1eea3d3605ea";
export default node; export default node;

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<43d75c2e4c035f883790d1d854b60bfc>> * @generated SignedSource<<94259096753f254d67dba23309f3c17b>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -70,7 +70,7 @@ v5 = [
{ {
"kind": "Literal", "kind": "Literal",
"name": "first", "name": "first",
"value": 1000 "value": 100
} }
]; ];
return { return {
@@ -290,7 +290,7 @@ return {
] ]
} }
], ],
"storageKey": "trustCenterFiles(first:1000)" "storageKey": "trustCenterFiles(first:100)"
}, },
{ {
"alias": null, "alias": null,
@@ -312,12 +312,12 @@ return {
] ]
}, },
"params": { "params": {
"cacheID": "115af8c7555ab3ab0277f16c8ec7ea6d", "cacheID": "dfdca184d1fbe4ccaeddda2c71e86958",
"id": null, "id": null,
"metadata": {}, "metadata": {},
"name": "CompliancePageFilesPageQuery", "name": "CompliancePageFilesPageQuery",
"operationKind": "query", "operationKind": "query",
"text": "query CompliancePageFilesPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n canCreateTrustCenterFile: permission(action: \"core:trust-center-file:create\")\n }\n ...CompliancePageFileListFragment\n id\n }\n}\n\nfragment CompliancePageFileListFragment on Organization {\n compliancePage: trustCenter {\n ...CompliancePageFileListItem_compliancePageFragment\n id\n }\n trustCenterFiles(first: 1000) {\n edges {\n node {\n id\n ...CompliancePageFileListItem_fileFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n\nfragment CompliancePageFileListItem_compliancePageFragment on TrustCenter {\n canUpdate: permission(action: \"core:trust-center:update\")\n}\n\nfragment CompliancePageFileListItem_fileFragment on TrustCenterFile {\n id\n name\n category\n fileUrl\n trustCenterVisibility\n createdAt\n canUpdate: permission(action: \"core:trust-center-file:update\")\n canDelete: permission(action: \"core:trust-center-file:delete\")\n}\n" "text": "query CompliancePageFilesPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n canCreateTrustCenterFile: permission(action: \"core:trust-center-file:create\")\n }\n ...CompliancePageFileListFragment\n id\n }\n}\n\nfragment CompliancePageFileListFragment on Organization {\n compliancePage: trustCenter {\n ...CompliancePageFileListItem_compliancePageFragment\n id\n }\n trustCenterFiles(first: 100) {\n edges {\n node {\n id\n ...CompliancePageFileListItem_fileFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n\nfragment CompliancePageFileListItem_compliancePageFragment on TrustCenter {\n canUpdate: permission(action: \"core:trust-center:update\")\n}\n\nfragment CompliancePageFileListItem_fileFragment on TrustCenterFile {\n id\n name\n category\n fileUrl\n trustCenterVisibility\n createdAt\n canUpdate: permission(action: \"core:trust-center-file:update\")\n canDelete: permission(action: \"core:trust-center-file:delete\")\n}\n"
} }
}; };
})(); })();

View File

@@ -1,7 +1,5 @@
import { sprintf } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { Button, IconChevronDown, Table, Tbody, Td, Th, Thead, Tr } from "@probo/ui"; import { Table, Tbody, Td, Th, Thead, Tr } from "@probo/ui";
import { useState } from "react";
import { useFragment } from "react-relay"; import { useFragment } from "react-relay";
import { graphql } from "relay-runtime"; import { graphql } from "relay-runtime";
@@ -14,7 +12,7 @@ const fragment = graphql`
compliancePage: trustCenter @required(action: THROW) { compliancePage: trustCenter @required(action: THROW) {
...CompliancePageAuditListItem_compliancePageFragment ...CompliancePageAuditListItem_compliancePageFragment
} }
audits(first: 1000) { audits(first: 100) {
edges { edges {
node { node {
id id
@@ -29,12 +27,9 @@ export function CompliancePageAuditList(props: { fragmentRef: CompliancePageAudi
const { fragmentRef } = props; const { fragmentRef } = props;
const { __ } = useTranslate(); const { __ } = useTranslate();
const [limit, setLimit] = useState<number | null>(100);
const { audits, compliancePage } = useFragment<CompliancePageAuditListFragment$key>(fragment, fragmentRef); const { audits, compliancePage } = useFragment<CompliancePageAuditListFragment$key>(fragment, fragmentRef);
const showMoreButton = limit !== null && audits.edges.length > limit;
return ( return (
<div className="space-y-[10px]"> <div className="space-y-[10px]">
<Table> <Table>
@@ -64,16 +59,6 @@ export function CompliancePageAuditList(props: { fragmentRef: CompliancePageAudi
))} ))}
</Tbody> </Tbody>
</Table> </Table>
{showMoreButton && (
<Button
variant="tertiary"
onClick={() => setLimit(null)}
className="mt-3 mx-auto"
icon={IconChevronDown}
>
{sprintf(__("Show %s more"), audits.edges.length - limit)}
</Button>
)}
</div> </div>
); );
} }

View File

@@ -1,7 +1,5 @@
import { sprintf } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { Button, IconChevronDown, Table, Tbody, Td, Th, Thead, Tr } from "@probo/ui"; import { Table, Tbody, Td, Th, Thead, Tr } from "@probo/ui";
import { useState } from "react";
import { useFragment } from "react-relay"; import { useFragment } from "react-relay";
import { graphql } from "relay-runtime"; import { graphql } from "relay-runtime";
@@ -14,7 +12,7 @@ const fragment = graphql`
compliancePage: trustCenter @required(action: THROW) { compliancePage: trustCenter @required(action: THROW) {
...CompliancePageDocumentListItem_compliancePageFragment ...CompliancePageDocumentListItem_compliancePageFragment
} }
documents(first: 1000) { documents(first: 100) {
edges { edges {
node { node {
id id
@@ -32,9 +30,6 @@ export function CompliancePageDocumentList(props: { fragmentRef: CompliancePageD
const { compliancePage, documents } = useFragment<CompliancePageDocumentListFragment$key>(fragment, fragmentRef); const { compliancePage, documents } = useFragment<CompliancePageDocumentListFragment$key>(fragment, fragmentRef);
const [limit, setLimit] = useState<number | null>(100);
const showMoreButton = limit !== null && documents.edges.length > limit;
return ( return (
<div className="space-y-[10px]"> <div className="space-y-[10px]">
<Table> <Table>
@@ -63,16 +58,6 @@ export function CompliancePageDocumentList(props: { fragmentRef: CompliancePageD
))} ))}
</Tbody> </Tbody>
</Table> </Table>
{showMoreButton && (
<Button
variant="tertiary"
onClick={() => setLimit(null)}
className="mt-3 mx-auto"
icon={IconChevronDown}
>
{sprintf(__("Show %s more"), documents.edges.length - limit)}
</Button>
)}
</div> </div>
); );
}; };

View File

@@ -1,6 +1,5 @@
import { sprintf } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { Button, IconChevronDown, Table, Tbody, Td, Th, Thead, Tr, useDialogRef } from "@probo/ui"; import { Table, Tbody, Td, Th, Thead, Tr, useDialogRef } from "@probo/ui";
import { useCallback, useState } from "react"; import { useCallback, useState } from "react";
import { useFragment } from "react-relay"; import { useFragment } from "react-relay";
import { graphql } from "relay-runtime"; import { graphql } from "relay-runtime";
@@ -17,7 +16,7 @@ const fragment = graphql`
compliancePage: trustCenter @required(action: THROW) { compliancePage: trustCenter @required(action: THROW) {
...CompliancePageFileListItem_compliancePageFragment ...CompliancePageFileListItem_compliancePageFragment
} }
trustCenterFiles(first: 1000) trustCenterFiles(first: 100)
@connection(key: "CompliancePageFileList_trustCenterFiles") { @connection(key: "CompliancePageFileList_trustCenterFiles") {
__id __id
edges { edges {
@@ -41,9 +40,6 @@ export function CompliancePageFileList(props: { fragmentRef: CompliancePageFileL
trustCenterFiles: files, trustCenterFiles: files,
} = useFragment<CompliancePageFileListFragment$key>(fragment, fragmentRef); } = useFragment<CompliancePageFileListFragment$key>(fragment, fragmentRef);
const [limit, setLimit] = useState<number | null>(100);
const showMoreButton = limit !== null && files.edges.length > limit;
const [editingFile, setEditingFile] = useState< const [editingFile, setEditingFile] = useState<
CompliancePageFileListItem_fileFragment$data | null>(null); CompliancePageFileListItem_fileFragment$data | null>(null);
const [deletingFileId, setDeletingFileId] = useState<string | null>(null); const [deletingFileId, setDeletingFileId] = useState<string | null>(null);
@@ -87,16 +83,6 @@ export function CompliancePageFileList(props: { fragmentRef: CompliancePageFileL
))} ))}
</Tbody> </Tbody>
</Table> </Table>
{showMoreButton && (
<Button
variant="tertiary"
onClick={() => setLimit(null)}
className="mt-3 mx-auto"
icon={IconChevronDown}
>
{sprintf(__("Show %s more"), files.edges.length - limit)}
</Button>
)}
{editingFile {editingFile
&& ( && (