Refactor compliance page documents page

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-01-28 16:52:17 +04:00
parent 3e3c3a8ebb
commit 36a936fcf4
17 changed files with 584 additions and 787 deletions

View File

@@ -1,49 +0,0 @@
import { useTranslate } from "@probo/i18n";
import { graphql } from "relay-runtime";
import type { TrustCenterDocumentGraphUpdateMutation } from "#/__generated__/core/TrustCenterDocumentGraphUpdateMutation.graphql";
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
export const trustCenterDocumentsQuery = graphql`
query TrustCenterDocumentGraphQuery($organizationId: ID!) {
organization: node(id: $organizationId) {
... on Organization {
id
documents(first: 100) {
edges {
node {
id
...TrustCenterDocumentsCardFragment
}
}
}
}
}
}
`;
export const updateDocumentVisibilityMutation = graphql`
mutation TrustCenterDocumentGraphUpdateMutation(
$input: UpdateDocumentInput!
) {
updateDocument(input: $input) {
document {
id
trustCenterVisibility
...TrustCenterDocumentsCardFragment
}
}
}
`;
export function useUpdateDocumentVisibilityMutation() {
const { __ } = useTranslate();
return useMutationWithToasts<TrustCenterDocumentGraphUpdateMutation>(
updateDocumentVisibilityMutation,
{
successMessage: __("Document visibility updated successfully."),
errorMessage: __("Failed to update document visibility"),
},
);
}

View File

@@ -32,14 +32,6 @@ export const trustCenterQuery = graphql`
)
canCreateAccess: permission(action: "core:trust-center-access:create")
}
documents(first: 100) {
edges {
node {
id
...TrustCenterDocumentsCardFragment
}
}
}
vendors(first: 100) {
edges {
node {
@@ -58,17 +50,6 @@ export const trustCenterQuery = graphql`
}
}
}
slackConnections(first: 100) {
edges {
node {
id
channel
channelId
createdAt
updatedAt
}
}
}
}
}
}