Rename policy into document

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Jonathan
2025-06-01 21:57:47 +02:00
committed by Sacha Al Himdani
parent 1870e050ce
commit b6aec0b14a
43 changed files with 636 additions and 631 deletions

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<6a680118da31fa610f9638d27a9b48d1>>
* @generated SignedSource<<95aa70195a3e90acb366441fd037c2f2>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -10,9 +10,11 @@
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type VendorCategory = "ANALYTICS" | "CLOUD_MONITORING" | "CLOUD_PROVIDER" | "COLLABORATION" | "CUSTOMER_SUPPORT" | "DATA_STORAGE_AND_PROCESSING" | "DOCUMENT_MANAGEMENT" | "EMPLOYEE_MANAGEMENT" | "ENGINEERING" | "FINANCE" | "IDENTITY_PROVIDER" | "IT" | "MARKETING" | "OFFICE_OPERATIONS" | "OTHER" | "PASSWORD_MANAGEMENT" | "PRODUCT_AND_DESIGN" | "PROFESSIONAL_SERVICES" | "RECRUITING" | "SALES" | "SECURITY" | "VERSION_CONTROL";
export type UpdateVendorInput = {
businessAssociateAgreementUrl?: string | null | undefined;
businessOwnerId?: string | null | undefined;
category?: string | null | undefined;
category?: VendorCategory | null | undefined;
certifications?: ReadonlyArray<string> | null | undefined;
dataProcessingAgreementUrl?: string | null | undefined;
description?: string | null | undefined;
@@ -25,6 +27,7 @@ export type UpdateVendorInput = {
securityPageUrl?: string | null | undefined;
serviceLevelAgreementUrl?: string | null | undefined;
statusPageUrl?: string | null | undefined;
subprocessorsListUrl?: string | null | undefined;
termsOfServiceUrl?: string | null | undefined;
trustPageUrl?: string | null | undefined;
websiteUrl?: string | null | undefined;

View File

@@ -1,12 +1,12 @@
import { z } from "zod";
import { useFormWithSchema } from "../useFormWithSchema";
export const policySchema = z.object({
export const documentSchema = z.object({
title: z.string(),
content: z.string(),
ownerId: z.string(),
});
export const usePolicyForm = () => {
return useFormWithSchema(policySchema, {});
export const useDocumentForm = () => {
return useFormWithSchema(documentSchema, {});
};

View File

@@ -0,0 +1,48 @@
import { useTranslate } from "@probo/i18n";
import { graphql } from "relay-runtime";
import { useMutationWithToasts } from "../useMutationWithToasts";
import type { DocumentGraphDeleteMutation } from "./__generated__/DocumentGraphDeleteMutation.graphql";
export const documentsQuery = graphql`
query DocumentGraphListQuery($organizationId: ID!) {
organization: node(id: $organizationId) {
id
...DocumentsPageListFragment
}
}
`;
export const DocumentsConnectionKey = "DocumentsPageFragment_documents";
const deleteDocumentMutation = graphql`
mutation DocumentGraphDeleteMutation(
$input: DeleteDocumentInput!
$connections: [ID!]!
) {
deleteDocument(input: $input) {
deletedDocumentId @deleteEdge(connections: $connections)
}
}
`;
export function useDeleteDocumentMutation() {
const { __ } = useTranslate();
return useMutationWithToasts<DocumentGraphDeleteMutation>(
deleteDocumentMutation,
{
successMessage: __("Document deleted successfully."),
errorMessage: __("Failed to delete document. Please try again."),
}
);
}
export const documentNodeQuery = graphql`
query DocumentGraphNodeQuery($documentId: ID!) {
node(id: $documentId) {
... on Document {
...DocumentPageDocumentFragment
}
}
}
`;

View File

@@ -40,13 +40,10 @@ export const useDeleteFrameworkMutation = (
framework: { id: string; name: string },
connectionId: string
) => {
const [commitDelete, isDeleting] = useMutationWithToasts(
deleteFrameworkMutation,
{
errorMessage: "Failed to delete framework",
successMessage: "Framework deleted successfully",
}
);
const [commitDelete] = useMutationWithToasts(deleteFrameworkMutation, {
errorMessage: "Failed to delete framework",
successMessage: "Framework deleted successfully",
});
const confirm = useConfirm();
const { __ } = useTranslate();

View File

@@ -1,48 +0,0 @@
import { useTranslate } from "@probo/i18n";
import { graphql } from "relay-runtime";
import { useMutationWithToasts } from "../useMutationWithToasts";
import type { PolicyGraphDeleteMutation } from "./__generated__/PolicyGraphDeleteMutation.graphql";
export const policiesQuery = graphql`
query PolicyGraphListQuery($organizationId: ID!) {
organization: node(id: $organizationId) {
id
...PoliciesPageListFragment
}
}
`;
export const PoliciesConnectionKey = "PoliciesPageFragment_policies";
const deletePolicyMutation = graphql`
mutation PolicyGraphDeleteMutation(
$input: DeletePolicyInput!
$connections: [ID!]!
) {
deletePolicy(input: $input) {
deletedPolicyId @deleteEdge(connections: $connections)
}
}
`;
export function useDeletePolicyMutation() {
const { __ } = useTranslate();
return useMutationWithToasts<PolicyGraphDeleteMutation>(
deletePolicyMutation,
{
successMessage: __("Policy deleted successfully."),
errorMessage: __("Failed to delete policy. Please try again."),
}
);
}
export const policyNodeQuery = graphql`
query PolicyGraphNodeQuery($policyId: ID!) {
node(id: $policyId) {
... on Policy {
...PolicyPagePolicyFragment
}
}
}
`;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<baab5b247999631abac20d0f5ab13925>>
* @generated SignedSource<<64c2c92a2a0806f34243f8fc9904167c>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -9,21 +9,21 @@
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type DeletePolicyInput = {
policyId: string;
export type DeleteDocumentInput = {
documentId: string;
};
export type PolicyGraphDeleteMutation$variables = {
export type DocumentGraphDeleteMutation$variables = {
connections: ReadonlyArray<string>;
input: DeletePolicyInput;
input: DeleteDocumentInput;
};
export type PolicyGraphDeleteMutation$data = {
readonly deletePolicy: {
readonly deletedPolicyId: string;
export type DocumentGraphDeleteMutation$data = {
readonly deleteDocument: {
readonly deletedDocumentId: string;
};
};
export type PolicyGraphDeleteMutation = {
response: PolicyGraphDeleteMutation$data;
variables: PolicyGraphDeleteMutation$variables;
export type DocumentGraphDeleteMutation = {
response: DocumentGraphDeleteMutation$data;
variables: DocumentGraphDeleteMutation$variables;
};
const node: ConcreteRequest = (function(){
@@ -48,7 +48,7 @@ v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "deletedPolicyId",
"name": "deletedDocumentId",
"storageKey": null
};
return {
@@ -59,14 +59,14 @@ return {
],
"kind": "Fragment",
"metadata": null,
"name": "PolicyGraphDeleteMutation",
"name": "DocumentGraphDeleteMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "DeletePolicyPayload",
"concreteType": "DeleteDocumentPayload",
"kind": "LinkedField",
"name": "deletePolicy",
"name": "deleteDocument",
"plural": false,
"selections": [
(v3/*: any*/)
@@ -84,14 +84,14 @@ return {
(v0/*: any*/)
],
"kind": "Operation",
"name": "PolicyGraphDeleteMutation",
"name": "DocumentGraphDeleteMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "DeletePolicyPayload",
"concreteType": "DeleteDocumentPayload",
"kind": "LinkedField",
"name": "deletePolicy",
"name": "deleteDocument",
"plural": false,
"selections": [
(v3/*: any*/),
@@ -102,7 +102,7 @@ return {
"handle": "deleteEdge",
"key": "",
"kind": "ScalarHandle",
"name": "deletedPolicyId",
"name": "deletedDocumentId",
"handleArgs": [
{
"kind": "Variable",
@@ -117,16 +117,16 @@ return {
]
},
"params": {
"cacheID": "d635ed7113bd8ad32056f5b4fbb95b22",
"cacheID": "84c747138470346796393f93a85b7127",
"id": null,
"metadata": {},
"name": "PolicyGraphDeleteMutation",
"name": "DocumentGraphDeleteMutation",
"operationKind": "mutation",
"text": "mutation PolicyGraphDeleteMutation(\n $input: DeletePolicyInput!\n) {\n deletePolicy(input: $input) {\n deletedPolicyId\n }\n}\n"
"text": "mutation DocumentGraphDeleteMutation(\n $input: DeleteDocumentInput!\n) {\n deleteDocument(input: $input) {\n deletedDocumentId\n }\n}\n"
}
};
})();
(node as any).hash = "f5178185f41864d20506abc44b37fa67";
(node as any).hash = "355f3a70caecabb2146075657665633e";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<b9027c9c44291af1bebb38760fd96fc8>>
* @generated SignedSource<<db2f3c23a3ecbb61ac692a46e93da44a>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -10,18 +10,18 @@
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type PolicyGraphListQuery$variables = {
export type DocumentGraphListQuery$variables = {
organizationId: string;
};
export type PolicyGraphListQuery$data = {
export type DocumentGraphListQuery$data = {
readonly organization: {
readonly id: string;
readonly " $fragmentSpreads": FragmentRefs<"PoliciesPageListFragment">;
readonly " $fragmentSpreads": FragmentRefs<"DocumentsPageListFragment">;
};
};
export type PolicyGraphListQuery = {
response: PolicyGraphListQuery$data;
variables: PolicyGraphListQuery$variables;
export type DocumentGraphListQuery = {
response: DocumentGraphListQuery$data;
variables: DocumentGraphListQuery$variables;
};
const node: ConcreteRequest = (function(){
@@ -65,7 +65,7 @@ return {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "PolicyGraphListQuery",
"name": "DocumentGraphListQuery",
"selections": [
{
"alias": "organization",
@@ -79,7 +79,7 @@ return {
{
"args": null,
"kind": "FragmentSpread",
"name": "PoliciesPageListFragment"
"name": "DocumentsPageListFragment"
}
],
"storageKey": null
@@ -92,7 +92,7 @@ return {
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "PolicyGraphListQuery",
"name": "DocumentGraphListQuery",
"selections": [
{
"alias": "organization",
@@ -110,15 +110,15 @@ return {
{
"alias": null,
"args": (v4/*: any*/),
"concreteType": "PolicyConnection",
"concreteType": "DocumentConnection",
"kind": "LinkedField",
"name": "policies",
"name": "documents",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "PolicyEdge",
"concreteType": "DocumentEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
@@ -126,7 +126,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "Policy",
"concreteType": "Document",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -181,7 +181,7 @@ return {
"value": 1
}
],
"concreteType": "PolicyVersionConnection",
"concreteType": "DocumentVersionConnection",
"kind": "LinkedField",
"name": "versions",
"plural": false,
@@ -189,7 +189,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionEdge",
"concreteType": "DocumentVersionEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
@@ -197,7 +197,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersion",
"concreteType": "DocumentVersion",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -213,7 +213,7 @@ return {
{
"alias": null,
"args": (v4/*: any*/),
"concreteType": "PolicyVersionSignatureConnection",
"concreteType": "DocumentVersionSignatureConnection",
"kind": "LinkedField",
"name": "signatures",
"plural": false,
@@ -221,7 +221,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignatureEdge",
"concreteType": "DocumentVersionSignatureEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
@@ -229,7 +229,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignature",
"concreteType": "DocumentVersionSignature",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -312,16 +312,16 @@ return {
]
}
],
"storageKey": "policies(first:100)"
"storageKey": "documents(first:100)"
},
{
"alias": null,
"args": (v4/*: any*/),
"filters": null,
"handle": "connection",
"key": "PoliciesPageFragment_policies",
"key": "DocumentsPageFragment_documents",
"kind": "LinkedHandle",
"name": "policies"
"name": "documents"
}
],
"type": "Organization",
@@ -333,16 +333,16 @@ return {
]
},
"params": {
"cacheID": "b0b3546b418ff2cfd5dd7678d3b0be14",
"cacheID": "d567583accd89d49f0c40fe1bac5ed84",
"id": null,
"metadata": {},
"name": "PolicyGraphListQuery",
"name": "DocumentGraphListQuery",
"operationKind": "query",
"text": "query PolicyGraphListQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n id\n ...PoliciesPageListFragment\n }\n}\n\nfragment PoliciesPageListFragment on Organization {\n policies(first: 100) {\n edges {\n node {\n id\n ...PoliciesPageRowFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n\nfragment PoliciesPageRowFragment on Policy {\n id\n title\n description\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: 100) {\n edges {\n node {\n id\n ...DocumentsPageRowFragment\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n\nfragment DocumentsPageRowFragment on Document {\n id\n title\n description\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 = "29761736de791476004e17ad21659a59";
(node as any).hash = "63de39eb2c87fc45b83eeee047ddd36c";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<b7defae939287f936c1eb687fe2d9bfe>>
* @generated SignedSource<<2cb115c83f67688124df197a8f944329>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -10,17 +10,17 @@
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type PolicyGraphNodeQuery$variables = {
policyId: string;
export type DocumentGraphNodeQuery$variables = {
documentId: string;
};
export type PolicyGraphNodeQuery$data = {
export type DocumentGraphNodeQuery$data = {
readonly node: {
readonly " $fragmentSpreads": FragmentRefs<"PolicyPagePolicyFragment">;
readonly " $fragmentSpreads": FragmentRefs<"DocumentPageDocumentFragment">;
};
};
export type PolicyGraphNodeQuery = {
response: PolicyGraphNodeQuery$data;
variables: PolicyGraphNodeQuery$variables;
export type DocumentGraphNodeQuery = {
response: DocumentGraphNodeQuery$data;
variables: DocumentGraphNodeQuery$variables;
};
const node: ConcreteRequest = (function(){
@@ -28,14 +28,14 @@ var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "policyId"
"name": "documentId"
}
],
v1 = [
{
"kind": "Variable",
"name": "id",
"variableName": "policyId"
"variableName": "documentId"
}
],
v2 = {
@@ -122,7 +122,7 @@ return {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "PolicyGraphNodeQuery",
"name": "DocumentGraphNodeQuery",
"selections": [
{
"alias": null,
@@ -138,10 +138,10 @@ return {
{
"args": null,
"kind": "FragmentSpread",
"name": "PolicyPagePolicyFragment"
"name": "DocumentPageDocumentFragment"
}
],
"type": "Policy",
"type": "Document",
"abstractKey": null
}
],
@@ -155,7 +155,7 @@ return {
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "PolicyGraphNodeQuery",
"name": "DocumentGraphNodeQuery",
"selections": [
{
"alias": null,
@@ -193,7 +193,7 @@ return {
{
"alias": null,
"args": (v5/*: any*/),
"concreteType": "PolicyVersionConnection",
"concreteType": "DocumentVersionConnection",
"kind": "LinkedField",
"name": "versions",
"plural": false,
@@ -201,7 +201,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionEdge",
"concreteType": "DocumentVersionEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
@@ -209,7 +209,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersion",
"concreteType": "DocumentVersion",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -253,7 +253,7 @@ return {
{
"alias": null,
"args": (v6/*: any*/),
"concreteType": "PolicyVersionSignatureConnection",
"concreteType": "DocumentVersionSignatureConnection",
"kind": "LinkedField",
"name": "signatures",
"plural": false,
@@ -261,7 +261,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignatureEdge",
"concreteType": "DocumentVersionSignatureEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
@@ -269,7 +269,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignature",
"concreteType": "DocumentVersionSignature",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -334,7 +334,7 @@ return {
"args": (v6/*: any*/),
"filters": null,
"handle": "connection",
"key": "PolicyPage_signatures",
"key": "DocumentPage_signatures",
"kind": "LinkedHandle",
"name": "signatures"
},
@@ -376,12 +376,12 @@ return {
"args": (v5/*: any*/),
"filters": null,
"handle": "connection",
"key": "PolicyPage_versions",
"key": "DocumentPage_versions",
"kind": "LinkedHandle",
"name": "versions"
}
],
"type": "Policy",
"type": "Document",
"abstractKey": null
}
],
@@ -390,16 +390,16 @@ return {
]
},
"params": {
"cacheID": "e9c0e78ebbf62684edbfa11ac1ee5d25",
"cacheID": "671e1a9b133593847c68af3abd9a721f",
"id": null,
"metadata": {},
"name": "PolicyGraphNodeQuery",
"name": "DocumentGraphNodeQuery",
"operationKind": "query",
"text": "query PolicyGraphNodeQuery(\n $policyId: ID!\n) {\n node(id: $policyId) {\n __typename\n ... on Policy {\n ...PolicyPagePolicyFragment\n }\n id\n }\n}\n\nfragment PolicyPagePolicyFragment on Policy {\n id\n title\n owner {\n id\n fullName\n }\n versions(first: 20) {\n edges {\n node {\n id\n content\n status\n publishedAt\n version\n updatedAt\n signatures(first: 100) {\n edges {\n node {\n id\n state\n signedBy {\n id\n }\n ...PolicySignaturesDialog_signature\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n ...PolicyVersionHistoryDialogFragment\n ...PolicySignaturesDialog_version\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n\nfragment PolicySignaturesDialog_signature on PolicyVersionSignature {\n id\n state\n signedAt\n requestedAt\n signedBy {\n fullName\n primaryEmailAddress\n id\n }\n}\n\nfragment PolicySignaturesDialog_version on PolicyVersion {\n version\n status\n publishedAt\n updatedAt\n}\n\nfragment PolicyVersionHistoryDialogFragment on PolicyVersion {\n id\n version\n status\n content\n changelog\n publishedAt\n updatedAt\n publishedBy {\n fullName\n id\n }\n}\n"
"text": "query DocumentGraphNodeQuery(\n $documentId: ID!\n) {\n node(id: $documentId) {\n __typename\n ... on Document {\n ...DocumentPageDocumentFragment\n }\n id\n }\n}\n\nfragment DocumentPageDocumentFragment on Document {\n id\n title\n owner {\n id\n fullName\n }\n versions(first: 20) {\n edges {\n node {\n id\n content\n status\n publishedAt\n version\n updatedAt\n signatures(first: 100) {\n edges {\n node {\n id\n state\n signedBy {\n id\n }\n ...DocumentSignaturesDialog_signature\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n ...DocumentVersionHistoryDialogFragment\n ...DocumentSignaturesDialog_version\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n\nfragment DocumentSignaturesDialog_signature on DocumentVersionSignature {\n id\n state\n signedAt\n requestedAt\n signedBy {\n fullName\n primaryEmailAddress\n id\n }\n}\n\nfragment DocumentSignaturesDialog_version on DocumentVersion {\n version\n status\n publishedAt\n updatedAt\n}\n\nfragment DocumentVersionHistoryDialogFragment on DocumentVersion {\n id\n version\n status\n content\n changelog\n publishedAt\n updatedAt\n publishedBy {\n fullName\n id\n }\n}\n"
}
};
})();
(node as any).hash = "c06b24e46b33741678e07787ab1c69f3";
(node as any).hash = "d6f55d4636b86d853b97b44e68e435f2";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<bbf8c99c9d2d556129349cfe82d26582>>
* @generated SignedSource<<b798b75c1d930af818109fd819d5cef3>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -12,9 +12,12 @@ import { ConcreteRequest } from 'relay-runtime';
export type PeopleKind = "CONTRACTOR" | "EMPLOYEE" | "SERVICE_ACCOUNT";
export type UpdatePeopleInput = {
additionalEmailAddresses?: ReadonlyArray<string> | null | undefined;
contractEndDate?: any | null | undefined;
contractStartDate?: any | null | undefined;
fullName?: string | null | undefined;
id: string;
kind?: PeopleKind | null | undefined;
position?: string | null | undefined;
primaryEmailAddress?: string | null | undefined;
};
export type PeopleGraphUpdateMutation$variables = {

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<7c5151b921734cd14b58af145eba7267>>
* @generated SignedSource<<6369aba92b58ca2a67d57110a829bde4>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -11,7 +11,7 @@
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type OrderDirection = "ASC" | "DESC";
export type RiskOrderField = "CATEGORY" | "CREATED_AT" | "INITIAL_RISK_SCORE" | "NAME" | "RESIDUAL_RISK_SCORE" | "TREATMENT" | "UPDATED_AT";
export type RiskOrderField = "CATEGORY" | "CREATED_AT" | "INHERENT_RISK_SCORE" | "NAME" | "RESIDUAL_RISK_SCORE" | "TREATMENT" | "UPDATED_AT";
export type RiskOrder = {
direction: OrderDirection;
field: RiskOrderField;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<37dd4db659813ffa6fab65ffec643844>>
* @generated SignedSource<<8ef289e99926f279eb0e2d5ea955cb32>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -9,9 +9,11 @@
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type VendorCategory = "ANALYTICS" | "CLOUD_MONITORING" | "CLOUD_PROVIDER" | "COLLABORATION" | "CUSTOMER_SUPPORT" | "DATA_STORAGE_AND_PROCESSING" | "DOCUMENT_MANAGEMENT" | "EMPLOYEE_MANAGEMENT" | "ENGINEERING" | "FINANCE" | "IDENTITY_PROVIDER" | "IT" | "MARKETING" | "OFFICE_OPERATIONS" | "OTHER" | "PASSWORD_MANAGEMENT" | "PRODUCT_AND_DESIGN" | "PROFESSIONAL_SERVICES" | "RECRUITING" | "SALES" | "SECURITY" | "VERSION_CONTROL";
export type CreateVendorInput = {
businessAssociateAgreementUrl?: string | null | undefined;
businessOwnerId?: string | null | undefined;
category?: string | null | undefined;
category?: VendorCategory | null | undefined;
certifications?: ReadonlyArray<string> | null | undefined;
dataProcessingAgreementUrl?: string | null | undefined;
description?: string | null | undefined;
@@ -24,6 +26,7 @@ export type CreateVendorInput = {
securityPageUrl?: string | null | undefined;
serviceLevelAgreementUrl?: string | null | undefined;
statusPageUrl?: string | null | undefined;
subprocessorsListUrl?: string | null | undefined;
termsOfServiceUrl?: string | null | undefined;
trustPageUrl?: string | null | undefined;
websiteUrl?: string | null | undefined;

View File

@@ -111,9 +111,9 @@ export function MainLayout() {
to={`${prefix}/vendors`}
/>
<SidebarItem
label={__("Policies")}
label={__("Documents")}
icon={IconPageTextLine}
to={`${prefix}/policies`}
to={`${prefix}/documents`}
/>
<SidebarItem
label={__("Settings")}

View File

@@ -1,5 +1,5 @@
import type { PreloadedQuery } from "react-relay";
import type { PolicyGraphNodeQuery } from "/hooks/graph/__generated__/PolicyGraphNodeQuery.graphql";
import type { DocumentGraphNodeQuery } from "/hooks/graph/__generated__/DocumentGraphNodeQuery.graphql";
import {
ConnectionHandler,
graphql,
@@ -8,12 +8,12 @@ import {
usePreloadedQuery,
} from "react-relay";
import {
PoliciesConnectionKey,
policyNodeQuery,
useDeletePolicyMutation,
} from "/hooks/graph/PolicyGraph";
DocumentsConnectionKey,
documentNodeQuery,
useDeleteDocumentMutation,
} from "/hooks/graph/DocumentGraph";
import { usePageTitle } from "@probo/hooks";
import type { PolicyPagePolicyFragment$key } from "./__generated__/PolicyPagePolicyFragment.graphql";
import type { DocumentPageDocumentFragment$key } from "./__generated__/DocumentPageDocumentFragment.graphql";
import { useTranslate } from "@probo/i18n";
import {
PageHeader,
@@ -39,22 +39,22 @@ import { sprintf } from "@probo/helpers";
import { useNavigate } from "react-router";
import UpdateVersionDialog from "./dialogs/UpdateVersionDialog";
import { useRef } from "react";
import { PolicyVersionHistoryDialog } from "./dialogs/PolicyVersionHistoryDialog";
import { PolicySignaturesDialog } from "./dialogs/PolicySignaturesDialog";
import { DocumentVersionHistoryDialog } from "./dialogs/DocumentVersionHistoryDialog";
import { DocumentSignaturesDialog } from "./dialogs/DocumentSignaturesDialog";
type Props = {
queryRef: PreloadedQuery<PolicyGraphNodeQuery>;
queryRef: PreloadedQuery<DocumentGraphNodeQuery>;
};
const policyFragment = graphql`
fragment PolicyPagePolicyFragment on Policy {
const documentFragment = graphql`
fragment DocumentPageDocumentFragment on Document {
id
title
owner {
id
fullName
}
versions(first: 20) @connection(key: "PolicyPage_versions") {
versions(first: 20) @connection(key: "DocumentPage_versions") {
__id
edges {
node {
@@ -64,7 +64,7 @@ const policyFragment = graphql`
publishedAt
version
updatedAt
signatures(first: 100) @connection(key: "PolicyPage_signatures") {
signatures(first: 100) @connection(key: "DocumentPage_signatures") {
__id
edges {
node {
@@ -73,61 +73,61 @@ const policyFragment = graphql`
signedBy {
id
}
...PolicySignaturesDialog_signature
...DocumentSignaturesDialog_signature
}
}
}
...PolicyVersionHistoryDialogFragment
...PolicySignaturesDialog_version
...DocumentVersionHistoryDialogFragment
...DocumentSignaturesDialog_version
}
}
}
}
`;
const publishPolicyVersionMutation = graphql`
mutation PolicyPagePublishMutation($input: PublishPolicyVersionInput!) {
publishPolicyVersion(input: $input) {
policy {
const publishDocumentVersionMutation = graphql`
mutation DocumentPagePublishMutation($input: PublishDocumentVersionInput!) {
publishDocumentVersion(input: $input) {
document {
id
}
}
}
`;
export default function PolicyPage(props: Props) {
const node = usePreloadedQuery(policyNodeQuery, props.queryRef).node;
const policy = useFragment(
policyFragment,
node as PolicyPagePolicyFragment$key
export default function DocumentPage(props: Props) {
const node = usePreloadedQuery(documentNodeQuery, props.queryRef).node;
const document = useFragment(
documentFragment,
node as DocumentPageDocumentFragment$key
);
const { __, dateFormat } = useTranslate();
const organizationId = useOrganizationId();
const navigate = useNavigate();
const lastVersion = policy.versions.edges[0].node;
const lastVersion = document.versions.edges[0].node;
const isDraft = lastVersion.status === "DRAFT";
const [publishPolicyVersion, isPublishing] = useMutationWithToasts(
publishPolicyVersionMutation,
const [publishDocumentVersion, isPublishing] = useMutationWithToasts(
publishDocumentVersionMutation,
{
successMessage: __("Policy published successfully."),
errorMessage: __("Failed to publish policy. Please try again."),
successMessage: __("Document published successfully."),
errorMessage: __("Failed to publish document. Please try again."),
}
);
const [deletePolicy, isDeleting] = useDeletePolicyMutation();
const versionConnectionId = policy.versions.__id;
const [deleteDocument, isDeleting] = useDeleteDocumentMutation();
const versionConnectionId = document.versions.__id;
usePageTitle(policy.title);
usePageTitle(document.title);
const handlePublish = () => {
publishPolicyVersion({
publishDocumentVersion({
variables: {
input: { policyId: policy.id },
input: { documentId: document.id },
},
onSuccess: () => {
// Refresh the whole query to get the new version
loadQuery(
props.queryRef.environment,
policyNodeQuery,
documentNodeQuery,
props.queryRef.variables,
{ fetchPolicy: "network-only" }
);
@@ -143,15 +143,15 @@ export default function PolicyPage(props: Props) {
new Promise<void>((resolve) => {
const connectionId = ConnectionHandler.getConnectionID(
organizationId,
PoliciesConnectionKey
DocumentsConnectionKey
);
deletePolicy({
deleteDocument({
variables: {
input: { policyId: policy.id },
input: { documentId: document.id },
connections: [connectionId],
},
onSuccess() {
navigate(`/organizations/${organizationId}/policies`);
navigate(`/organizations/${organizationId}/documents`);
},
onError: () => resolve(),
});
@@ -159,9 +159,9 @@ export default function PolicyPage(props: Props) {
{
message: sprintf(
__(
'This will permanently delete the policy "%s". This action cannot be undone.'
'This will permanently delete the document "%s". This action cannot be undone.'
),
policy.title
document.title
),
}
);
@@ -173,7 +173,7 @@ export default function PolicyPage(props: Props) {
<>
<UpdateVersionDialog
ref={updateDialogRef}
policy={policy}
document={document}
connectionId={versionConnectionId}
/>
<div className="space-y-6">
@@ -181,11 +181,11 @@ export default function PolicyPage(props: Props) {
<Breadcrumb
items={[
{
label: __("Policies"),
to: `/organizations/${organizationId}/policies`,
label: __("Documents"),
to: `/organizations/${organizationId}/documents`,
},
{
label: policy.title,
label: document.title,
},
]}
/>
@@ -199,23 +199,23 @@ export default function PolicyPage(props: Props) {
{__("Publish")}
</Button>
)}
<PolicyVersionHistoryDialog policy={policy}>
<DocumentVersionHistoryDialog document={document}>
<Button icon={IconClock} variant="secondary">
{__("Version history")}
</Button>
</PolicyVersionHistoryDialog>
<PolicySignaturesDialog policy={policy}>
</DocumentVersionHistoryDialog>
<DocumentSignaturesDialog document={document}>
<Button icon={IconSignature} variant="secondary">
{__("Signatures history")}
</Button>
</PolicySignaturesDialog>
</DocumentSignaturesDialog>
<ActionDropdown variant="secondary">
<DropdownItem
onClick={() => updateDialogRef.current?.open()}
icon={IconPencil}
>
{isDraft ? __("Edit draft policy") : __("Create new draft")}
{isDraft ? __("Edit draft document") : __("Create new draft")}
</DropdownItem>
<DropdownItem
variant="danger"
@@ -228,7 +228,7 @@ export default function PolicyPage(props: Props) {
</ActionDropdown>
</div>
</div>
<PageHeader title={policy.title} />
<PageHeader title={document.title} />
<Markdown content={lastVersion.content} />
</div>
<Drawer>
@@ -237,8 +237,8 @@ export default function PolicyPage(props: Props) {
</div>
<PropertyRow label={__("Owner")}>
<Badge variant="highlight" size="md" className="gap-2">
<Avatar name={policy.owner?.fullName ?? ""} />
{policy.owner?.fullName}
<Avatar name={document.owner?.fullName ?? ""} />
{document.owner?.fullName}
</Badge>
</PropertyRow>
<PropertyRow label={__("Status")}>

View File

@@ -22,25 +22,25 @@ import {
type PreloadedQuery,
} from "react-relay";
import { graphql } from "relay-runtime";
import type { PolicyGraphListQuery } from "/hooks/graph/__generated__/PolicyGraphListQuery.graphql";
import type { DocumentGraphListQuery } from "/hooks/graph/__generated__/DocumentGraphListQuery.graphql";
import {
policiesQuery,
useDeletePolicyMutation,
} from "/hooks/graph/PolicyGraph";
import type { PoliciesPageListFragment$key } from "./__generated__/PoliciesPageListFragment.graphql";
documentsQuery,
useDeleteDocumentMutation,
} from "/hooks/graph/DocumentGraph";
import type { DocumentsPageListFragment$key } from "./__generated__/DocumentsPageListFragment.graphql";
import { usePageTitle } from "@probo/hooks";
import { sprintf } from "@probo/helpers";
import { CreatePolicyDialog } from "./dialogs/CreatePolicyDialog";
import type { PoliciesPageRowFragment$key } from "./__generated__/PoliciesPageRowFragment.graphql";
import { CreateDocumentDialog } from "./dialogs/CreateDocumentDialog";
import type { DocumentsPageRowFragment$key } from "./__generated__/DocumentsPageRowFragment.graphql";
const policiesFragment = graphql`
fragment PoliciesPageListFragment on Organization {
policies(first: 100) @connection(key: "PoliciesPageFragment_policies") {
const documentsFragment = graphql`
fragment DocumentsPageListFragment on Organization {
documents(first: 100) @connection(key: "DocumentsPageFragment_documents") {
__id
edges {
node {
id
...PoliciesPageRowFragment
...DocumentsPageRowFragment
}
}
}
@@ -48,34 +48,34 @@ const policiesFragment = graphql`
`;
type Props = {
queryRef: PreloadedQuery<PolicyGraphListQuery>;
queryRef: PreloadedQuery<DocumentGraphListQuery>;
};
export default function PoliciesPage(props: Props) {
export default function DocumentsPage(props: Props) {
const { __ } = useTranslate();
const organization = usePreloadedQuery(
policiesQuery,
documentsQuery,
props.queryRef
).organization;
const data = useFragment<PoliciesPageListFragment$key>(
policiesFragment,
const data = useFragment<DocumentsPageListFragment$key>(
documentsFragment,
organization
);
const policies = data.policies.edges.map((edge) => edge.node);
const connectionId = data.policies.__id;
usePageTitle(__("Policies"));
const documents = data.documents.edges.map((edge) => edge.node);
const connectionId = data.documents.__id;
usePageTitle(__("Documents"));
return (
<div className="space-y-6">
<PageHeader
title={__("Policies")}
description={__("Manage your organization’s policies")}
title={__("Documents")}
description={__("Manage your organization’s documents")}
>
<CreatePolicyDialog
<CreateDocumentDialog
connection={connectionId}
trigger={<Button icon={IconPlusLarge}>{__("New policy")}</Button>}
trigger={<Button icon={IconPlusLarge}>{__("New document")}</Button>}
/>
</PageHeader>
<Table>
@@ -90,10 +90,10 @@ export default function PoliciesPage(props: Props) {
</Tr>
</Thead>
<Tbody>
{policies.map((policy) => (
<PolicyRow
key={policy.id}
policy={policy}
{documents.map((document) => (
<DocumentRow
key={document.id}
document={document}
organizationId={organization.id}
connectionId={connectionId}
/>
@@ -105,7 +105,7 @@ export default function PoliciesPage(props: Props) {
}
const rowFragment = graphql`
fragment PoliciesPageRowFragment on Policy {
fragment DocumentsPageRowFragment on Document {
id
title
description
@@ -133,61 +133,61 @@ const rowFragment = graphql`
}
`;
function PolicyRow({
policy: policyKey,
function DocumentRow({
document: documentKey,
organizationId,
connectionId,
}: {
policy: PoliciesPageRowFragment$key;
document: DocumentsPageRowFragment$key;
organizationId: string;
connectionId: string;
}) {
const policy = useFragment<PoliciesPageRowFragment$key>(
const document = useFragment<DocumentsPageRowFragment$key>(
rowFragment,
policyKey
documentKey
);
const lastVersion = policy.versions.edges[0].node;
const lastVersion = document.versions.edges[0].node;
const isDraft = lastVersion.status === "DRAFT";
const { __, dateFormat } = useTranslate();
const signatures = lastVersion.signatures.edges.map((edge) => edge.node);
const signedCount = signatures.filter(
(signature) => signature.state === "SIGNED"
).length;
const [deletePolicy, isDeleting] = useDeletePolicyMutation();
const [deleteDocument] = useDeleteDocumentMutation();
const confirm = useConfirm();
const handleDelete = () => {
confirm(
() =>
deletePolicy({
deleteDocument({
variables: {
input: { policyId: policy.id },
input: { documentId: document.id },
connections: [connectionId],
},
}),
{
message: sprintf(
__(
'This will permanently delete the policy "%s". This action cannot be undone.'
'This will permanently delete the document "%s". This action cannot be undone.'
),
policy.title
document.title
),
}
);
};
return (
<Tr to={`/organizations/${organizationId}/policies/${policy.id}`}>
<Tr to={`/organizations/${organizationId}/documents/${document.id}`}>
<Td>
<div className="flex gap-4 items-center">
<img
src="/policy.png"
src="/document.png"
alt=""
width={28}
height={36}
className="border-4 border-highlight rounded box-content"
/>
{policy.title}
{document.title}
</div>
</Td>
<Td>
@@ -197,12 +197,12 @@ function PolicyRow({
</Td>
<Td>
<div className="flex gap-2 items-center">
<Avatar name={policy.owner.fullName} />
{policy.owner.fullName}
<Avatar name={document.owner.fullName} />
{document.owner.fullName}
</div>
</Td>
<Td>
{dateFormat(policy.updatedAt, {
{dateFormat(document.updatedAt, {
year: "numeric",
month: "short",
day: "numeric",

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<088b04713ff854ffccb30532513bb093>>
* @generated SignedSource<<c182ef1b9491681644676e99e0b07ee7>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -9,10 +9,10 @@
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
export type PolicyStatus = "DRAFT" | "PUBLISHED";
export type PolicyVersionSignatureState = "REQUESTED" | "SIGNED";
export type DocumentStatus = "DRAFT" | "PUBLISHED";
export type DocumentVersionSignatureState = "REQUESTED" | "SIGNED";
import { FragmentRefs } from "relay-runtime";
export type PolicyPagePolicyFragment$data = {
export type DocumentPageDocumentFragment$data = {
readonly id: string;
readonly owner: {
readonly fullName: string;
@@ -34,23 +34,23 @@ export type PolicyPagePolicyFragment$data = {
readonly signedBy: {
readonly id: string;
};
readonly state: PolicyVersionSignatureState;
readonly " $fragmentSpreads": FragmentRefs<"PolicySignaturesDialog_signature">;
readonly state: DocumentVersionSignatureState;
readonly " $fragmentSpreads": FragmentRefs<"DocumentSignaturesDialog_signature">;
};
}>;
};
readonly status: PolicyStatus;
readonly status: DocumentStatus;
readonly updatedAt: any;
readonly version: number;
readonly " $fragmentSpreads": FragmentRefs<"PolicySignaturesDialog_version" | "PolicyVersionHistoryDialogFragment">;
readonly " $fragmentSpreads": FragmentRefs<"DocumentSignaturesDialog_version" | "DocumentVersionHistoryDialogFragment">;
};
}>;
};
readonly " $fragmentType": "PolicyPagePolicyFragment";
readonly " $fragmentType": "DocumentPageDocumentFragment";
};
export type PolicyPagePolicyFragment$key = {
readonly " $data"?: PolicyPagePolicyFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"PolicyPagePolicyFragment">;
export type DocumentPageDocumentFragment$key = {
readonly " $data"?: DocumentPageDocumentFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"DocumentPageDocumentFragment">;
};
const node: ReaderFragment = (function(){
@@ -133,7 +133,7 @@ return {
}
]
},
"name": "PolicyPagePolicyFragment",
"name": "DocumentPageDocumentFragment",
"selections": [
(v0/*: any*/),
{
@@ -165,15 +165,15 @@ return {
{
"alias": "versions",
"args": null,
"concreteType": "PolicyVersionConnection",
"concreteType": "DocumentVersionConnection",
"kind": "LinkedField",
"name": "__PolicyPage_versions_connection",
"name": "__DocumentPage_versions_connection",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionEdge",
"concreteType": "DocumentVersionEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
@@ -181,7 +181,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersion",
"concreteType": "DocumentVersion",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -225,15 +225,15 @@ return {
{
"alias": "signatures",
"args": null,
"concreteType": "PolicyVersionSignatureConnection",
"concreteType": "DocumentVersionSignatureConnection",
"kind": "LinkedField",
"name": "__PolicyPage_signatures_connection",
"name": "__DocumentPage_signatures_connection",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignatureEdge",
"concreteType": "DocumentVersionSignatureEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
@@ -241,7 +241,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignature",
"concreteType": "DocumentVersionSignature",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -269,7 +269,7 @@ return {
{
"args": null,
"kind": "FragmentSpread",
"name": "PolicySignaturesDialog_signature"
"name": "DocumentSignaturesDialog_signature"
},
(v1/*: any*/)
],
@@ -287,12 +287,12 @@ return {
{
"args": null,
"kind": "FragmentSpread",
"name": "PolicyVersionHistoryDialogFragment"
"name": "DocumentVersionHistoryDialogFragment"
},
{
"args": null,
"kind": "FragmentSpread",
"name": "PolicySignaturesDialog_version"
"name": "DocumentSignaturesDialog_version"
},
(v1/*: any*/)
],
@@ -308,11 +308,11 @@ return {
"storageKey": null
}
],
"type": "Policy",
"type": "Document",
"abstractKey": null
};
})();
(node as any).hash = "b53b22a05e1abd608ecd688b6a9d5bad";
(node as any).hash = "b42e98e8e26bc94a2d412bd73cd601f2";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<c68450dee24a94b20d5c4985a83511e0>>
* @generated SignedSource<<3ef23505e9378ce7ea92943b394ba290>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -9,22 +9,22 @@
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type PublishPolicyVersionInput = {
policyId: string;
export type PublishDocumentVersionInput = {
documentId: string;
};
export type PolicyPagePublishMutation$variables = {
input: PublishPolicyVersionInput;
export type DocumentPagePublishMutation$variables = {
input: PublishDocumentVersionInput;
};
export type PolicyPagePublishMutation$data = {
readonly publishPolicyVersion: {
readonly policy: {
export type DocumentPagePublishMutation$data = {
readonly publishDocumentVersion: {
readonly document: {
readonly id: string;
};
};
};
export type PolicyPagePublishMutation = {
response: PolicyPagePublishMutation$data;
variables: PolicyPagePublishMutation$variables;
export type DocumentPagePublishMutation = {
response: DocumentPagePublishMutation$data;
variables: DocumentPagePublishMutation$variables;
};
const node: ConcreteRequest = (function(){
@@ -45,17 +45,17 @@ v1 = [
"variableName": "input"
}
],
"concreteType": "PublishPolicyVersionPayload",
"concreteType": "PublishDocumentVersionPayload",
"kind": "LinkedField",
"name": "publishPolicyVersion",
"name": "publishDocumentVersion",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Policy",
"concreteType": "Document",
"kind": "LinkedField",
"name": "policy",
"name": "document",
"plural": false,
"selections": [
{
@@ -77,7 +77,7 @@ return {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "PolicyPagePublishMutation",
"name": "DocumentPagePublishMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
@@ -86,20 +86,20 @@ return {
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "PolicyPagePublishMutation",
"name": "DocumentPagePublishMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "4279dd7a9a12d8d5fb6e07c1875de00a",
"cacheID": "fad75c1a396f60d6d13e1605fe85f33e",
"id": null,
"metadata": {},
"name": "PolicyPagePublishMutation",
"name": "DocumentPagePublishMutation",
"operationKind": "mutation",
"text": "mutation PolicyPagePublishMutation(\n $input: PublishPolicyVersionInput!\n) {\n publishPolicyVersion(input: $input) {\n policy {\n id\n }\n }\n}\n"
"text": "mutation DocumentPagePublishMutation(\n $input: PublishDocumentVersionInput!\n) {\n publishDocumentVersion(input: $input) {\n document {\n id\n }\n }\n}\n"
}
};
})();
(node as any).hash = "8ee6cdf68342db34ec04aab82313eff0";
(node as any).hash = "488029ccd88b4c637b63cd11d1bef986";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<89063899241b0557e2a6df4ff74ecea1>>
* @generated SignedSource<<5d1d855cd444dbaa6fc92493bc333dd4>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -10,21 +10,21 @@
import { ReaderFragment } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type PoliciesPageListFragment$data = {
readonly policies: {
export type DocumentsPageListFragment$data = {
readonly documents: {
readonly __id: string;
readonly edges: ReadonlyArray<{
readonly node: {
readonly id: string;
readonly " $fragmentSpreads": FragmentRefs<"PoliciesPageRowFragment">;
readonly " $fragmentSpreads": FragmentRefs<"DocumentsPageRowFragment">;
};
}>;
};
readonly " $fragmentType": "PoliciesPageListFragment";
readonly " $fragmentType": "DocumentsPageListFragment";
};
export type PoliciesPageListFragment$key = {
readonly " $data"?: PoliciesPageListFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"PoliciesPageListFragment">;
export type DocumentsPageListFragment$key = {
readonly " $data"?: DocumentsPageListFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"DocumentsPageListFragment">;
};
const node: ReaderFragment = {
@@ -37,25 +37,25 @@ const node: ReaderFragment = {
"cursor": null,
"direction": "forward",
"path": [
"policies"
"documents"
]
}
]
},
"name": "PoliciesPageListFragment",
"name": "DocumentsPageListFragment",
"selections": [
{
"alias": "policies",
"alias": "documents",
"args": null,
"concreteType": "PolicyConnection",
"concreteType": "DocumentConnection",
"kind": "LinkedField",
"name": "__PoliciesPageFragment_policies_connection",
"name": "__DocumentsPageFragment_documents_connection",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "PolicyEdge",
"concreteType": "DocumentEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
@@ -63,7 +63,7 @@ const node: ReaderFragment = {
{
"alias": null,
"args": null,
"concreteType": "Policy",
"concreteType": "Document",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -78,7 +78,7 @@ const node: ReaderFragment = {
{
"args": null,
"kind": "FragmentSpread",
"name": "PoliciesPageRowFragment"
"name": "DocumentsPageRowFragment"
},
{
"alias": null,
@@ -145,6 +145,6 @@ const node: ReaderFragment = {
"abstractKey": null
};
(node as any).hash = "1c1fa3340a1fe9de3995ffcb374c9124";
(node as any).hash = "f6098fe2da00c369d0386e3854cd894b";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<3d1854151a950f0b4b85faf16c995c61>>
* @generated SignedSource<<394470df6f042c06c640caad2df537cc>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -9,10 +9,10 @@
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
export type PolicyStatus = "DRAFT" | "PUBLISHED";
export type PolicyVersionSignatureState = "REQUESTED" | "SIGNED";
export type DocumentStatus = "DRAFT" | "PUBLISHED";
export type DocumentVersionSignatureState = "REQUESTED" | "SIGNED";
import { FragmentRefs } from "relay-runtime";
export type PoliciesPageRowFragment$data = {
export type DocumentsPageRowFragment$data = {
readonly description: string;
readonly id: string;
readonly owner: {
@@ -29,19 +29,19 @@ export type PoliciesPageRowFragment$data = {
readonly edges: ReadonlyArray<{
readonly node: {
readonly id: string;
readonly state: PolicyVersionSignatureState;
readonly state: DocumentVersionSignatureState;
};
}>;
};
readonly status: PolicyStatus;
readonly status: DocumentStatus;
};
}>;
};
readonly " $fragmentType": "PoliciesPageRowFragment";
readonly " $fragmentType": "DocumentsPageRowFragment";
};
export type PoliciesPageRowFragment$key = {
readonly " $data"?: PoliciesPageRowFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"PoliciesPageRowFragment">;
export type DocumentsPageRowFragment$key = {
readonly " $data"?: DocumentsPageRowFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"DocumentsPageRowFragment">;
};
const node: ReaderFragment = (function(){
@@ -56,7 +56,7 @@ return {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "PoliciesPageRowFragment",
"name": "DocumentsPageRowFragment",
"selections": [
(v0/*: any*/),
{
@@ -108,7 +108,7 @@ return {
"value": 1
}
],
"concreteType": "PolicyVersionConnection",
"concreteType": "DocumentVersionConnection",
"kind": "LinkedField",
"name": "versions",
"plural": false,
@@ -116,7 +116,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionEdge",
"concreteType": "DocumentVersionEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
@@ -124,7 +124,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersion",
"concreteType": "DocumentVersion",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -146,7 +146,7 @@ return {
"value": 100
}
],
"concreteType": "PolicyVersionSignatureConnection",
"concreteType": "DocumentVersionSignatureConnection",
"kind": "LinkedField",
"name": "signatures",
"plural": false,
@@ -154,7 +154,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignatureEdge",
"concreteType": "DocumentVersionSignatureEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
@@ -162,7 +162,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignature",
"concreteType": "DocumentVersionSignature",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -194,11 +194,11 @@ return {
"storageKey": "versions(first:1)"
}
],
"type": "Policy",
"type": "Document",
"abstractKey": null
};
})();
(node as any).hash = "b50c23e038e757685dfc7535825a389c";
(node as any).hash = "b5339e945b607000f177036cad41e0d4";
export default node;

View File

@@ -15,25 +15,25 @@ import {
import { type ReactNode } from "react";
import { graphql } from "relay-runtime";
import { useOrganizationId } from "/hooks/useOrganizationId";
import { usePolicyForm } from "/hooks/forms/usePolicyForm";
import { useDocumentForm } from "/hooks/forms/useDocumentForm";
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
import { PeopleSelectField } from "/components/form/PeopleSelectField";
import type { CreatePolicyDialogMutation } from "./__generated__/CreatePolicyDialogMutation.graphql";
import type { CreateDocumentDialogMutation } from "./__generated__/CreateDocumentDialogMutation.graphql";
type Props = {
trigger?: ReactNode;
connection: string;
};
const createPolicyMutation = graphql`
mutation CreatePolicyDialogMutation(
$input: CreatePolicyInput!
const createDocumentMutation = graphql`
mutation CreateDocumentDialogMutation(
$input: CreateDocumentInput!
$connections: [ID!]!
) {
createPolicy(input: $input) {
policyEdge @prependEdge(connections: $connections) {
createDocument(input: $input) {
documentEdge @prependEdge(connections: $connections) {
node {
...PoliciesPageRowFragment
...DocumentsPageRowFragment
}
}
}
@@ -41,28 +41,30 @@ const createPolicyMutation = graphql`
`;
/**
* Dialog to create or update a policy
* Dialog to create or update a document
*/
export function CreatePolicyDialog({ trigger, connection }: Props) {
export function CreateDocumentDialog({ trigger, connection }: Props) {
const { __ } = useTranslate();
const organizationId = useOrganizationId();
const { control, handleSubmit, register, formState, reset } = usePolicyForm();
const { control, handleSubmit, register, formState, reset } =
useDocumentForm();
const errors = formState.errors ?? {};
const [createPolicy, isLoading] =
useMutationWithToasts<CreatePolicyDialogMutation>(createPolicyMutation);
const [createDocument, isLoading] =
useMutationWithToasts<CreateDocumentDialogMutation>(createDocumentMutation);
const onSubmit = handleSubmit((data) => {
createPolicy({
createDocument({
variables: {
input: {
...data,
organizationId,
documentType: "POLICY",
},
connections: [connection!],
},
successMessage: __("Policy created successfully."),
errorMessage: __("Failed to create policy. Please try again."),
successMessage: __("Document created successfully."),
errorMessage: __("Failed to create document. Please try again."),
onSuccess: () => {
dialogRef.current?.close();
reset();
@@ -76,7 +78,7 @@ export function CreatePolicyDialog({ trigger, connection }: Props) {
<Dialog
ref={dialogRef}
trigger={trigger}
title={<Breadcrumb items={[__("Policies"), __("New Policy")]} />}
title={<Breadcrumb items={[__("Documents"), __("New Document")]} />}
>
<form onSubmit={onSubmit}>
<DialogContent className="grid grid-cols-[1fr_420px]">
@@ -86,7 +88,7 @@ export function CreatePolicyDialog({ trigger, connection }: Props) {
aria-label={__("Title")}
required
variant="title"
placeholder={__("Policy title")}
placeholder={__("Document title")}
{...register("title")}
/>
<Textarea
@@ -122,7 +124,7 @@ export function CreatePolicyDialog({ trigger, connection }: Props) {
</DialogContent>
<DialogFooter>
<Button type="submit" disabled={isLoading}>
{__("Create policy")}
{__("Create document")}
</Button>
</DialogFooter>
</form>

View File

@@ -8,32 +8,32 @@ import {
DialogTitle,
IconCircleCheck,
IconClock,
PolicyVersionBadge,
DocumentVersionBadge,
Spinner,
} from "@probo/ui";
import { useTranslate } from "@probo/i18n";
import { useState, type ReactNode, Suspense } from "react";
import type { PolicyPagePolicyFragment$data } from "../__generated__/PolicyPagePolicyFragment.graphql";
import type { DocumentPageDocumentFragment$data } from "../__generated__/DocumentPageDocumentFragment.graphql";
import clsx from "clsx";
import type { ItemOf, NodeOf } from "/types";
import { graphql, useFragment } from "react-relay";
import type { PolicySignaturesDialog_version$key } from "./__generated__/PolicySignaturesDialog_version.graphql";
import type { PolicySignaturesDialog_signature$key } from "./__generated__/PolicySignaturesDialog_signature.graphql";
import type { DocumentSignaturesDialog_version$key } from "./__generated__/DocumentSignaturesDialog_version.graphql";
import type { DocumentSignaturesDialog_signature$key } from "./__generated__/DocumentSignaturesDialog_signature.graphql";
import { usePeople } from "/hooks/graph/PeopleGraph.ts";
import { useOrganizationId } from "/hooks/useOrganizationId.ts";
import { useMutationWithToasts } from "/hooks/useMutationWithToasts.ts";
import { sprintf } from "@probo/helpers";
type Props = {
policy: PolicyPagePolicyFragment$data;
document: DocumentPageDocumentFragment$data;
children?: ReactNode;
};
type Version = NodeOf<PolicyPagePolicyFragment$data["versions"]>;
type Version = NodeOf<DocumentPageDocumentFragment$data["versions"]>;
export function PolicySignaturesDialog(props: Props) {
export function DocumentSignaturesDialog(props: Props) {
const { __ } = useTranslate();
const versions = props.policy.versions.edges.map((edge) => edge.node);
const versions = props.document.versions.edges.map((edge) => edge.node);
const [selectedVersionId, setSelectedVersionId] = useState<string>(
versions[0].id
);
@@ -79,7 +79,7 @@ export function PolicySignaturesDialog(props: Props) {
}
const versionFragment = graphql`
fragment PolicySignaturesDialog_version on PolicyVersion {
fragment DocumentSignaturesDialog_version on DocumentVersion {
version
status
publishedAt
@@ -93,7 +93,7 @@ function VersionItem(props: {
onSelect: (v: string) => void;
}) {
const { dateTimeFormat, __ } = useTranslate();
const version = useFragment<PolicySignaturesDialog_version$key>(
const version = useFragment<DocumentSignaturesDialog_version$key>(
versionFragment,
props.version
);
@@ -109,7 +109,7 @@ function VersionItem(props: {
<span>
{__("Version")} {version.version}
</span>
<PolicyVersionBadge state={version.status} />
<DocumentVersionBadge state={version.status} />
</div>
<div className="text-xs text-txt-secondary">
{dateTimeFormat(version.publishedAt ?? version.updatedAt)}
@@ -152,7 +152,7 @@ function SignatureList(props: { version: Version }) {
* Fragments
*/
const signatureFragment = graphql`
fragment PolicySignaturesDialog_signature on PolicyVersionSignature {
fragment DocumentSignaturesDialog_signature on DocumentVersionSignature {
id
state
signedAt
@@ -168,19 +168,19 @@ const signatureFragment = graphql`
* Mutations
*/
const requestSignatureMutation = graphql`
mutation PolicySignaturesDialog_requestSignatureMutation(
mutation DocumentSignaturesDialog_requestSignatureMutation(
$input: RequestSignatureInput!
$connections: [ID!]!
) {
requestSignature(input: $input) {
policyVersionSignatureEdge @prependEdge(connections: $connections) {
documentVersionSignatureEdge @prependEdge(connections: $connections) {
node {
id
state
signedBy {
id
}
...PolicySignaturesDialog_signature
...DocumentSignaturesDialog_signature
}
}
}
@@ -189,7 +189,7 @@ const requestSignatureMutation = graphql`
function SignatureItem(props: {
versionId: string;
signature?: PolicySignaturesDialog_signature$key;
signature?: DocumentSignaturesDialog_signature$key;
people: ItemOf<ReturnType<typeof usePeople>>;
connectionId: string;
}) {
@@ -224,7 +224,7 @@ function SignatureItem(props: {
requestSignature({
variables: {
input: {
policyVersionId: props.versionId,
documentVersionId: props.versionId,
signatoryId: props.people.id,
},
connections: [props.connectionId],

View File

@@ -9,14 +9,14 @@ import {
import { graphql } from "relay-runtime";
import { useTranslate } from "@probo/i18n";
import { useState, type ReactNode } from "react";
import type { PolicyPagePolicyFragment$data } from "../__generated__/PolicyPagePolicyFragment.graphql";
import type { DocumentPageDocumentFragment$data } from "../__generated__/DocumentPageDocumentFragment.graphql";
import { useFragment } from "react-relay";
import type { PolicyVersionHistoryDialogFragment$key } from "./__generated__/PolicyVersionHistoryDialogFragment.graphql";
import type { DocumentVersionHistoryDialogFragment$key } from "./__generated__/DocumentVersionHistoryDialogFragment.graphql";
import clsx from "clsx";
import type { NodeOf } from "/types";
const historyFragment = graphql`
fragment PolicyVersionHistoryDialogFragment on PolicyVersion {
fragment DocumentVersionHistoryDialogFragment on DocumentVersion {
id
version
status
@@ -31,15 +31,15 @@ const historyFragment = graphql`
`;
type Props = {
policy: PolicyPagePolicyFragment$data;
document: DocumentPageDocumentFragment$data;
children?: ReactNode;
};
type Version = NodeOf<PolicyPagePolicyFragment$data["versions"]>;
type Version = NodeOf<DocumentPageDocumentFragment$data["versions"]>;
export function PolicyVersionHistoryDialog(props: Props) {
export function DocumentVersionHistoryDialog(props: Props) {
const { __ } = useTranslate();
const versions = props.policy.versions.edges.map((edge) => edge.node);
const versions = props.document.versions.edges.map((edge) => edge.node);
const [selectedVersion, setSelectedVersion] = useState<Version>(versions[0]);
return (
<Dialog trigger={props.children}>
@@ -51,7 +51,7 @@ export function PolicyVersionHistoryDialog(props: Props) {
{versions.map((version) => (
<VersionItem
key={version.id}
policy={props.policy}
document={props.document}
version={version}
active={selectedVersion === version}
onSelect={setSelectedVersion}
@@ -68,12 +68,12 @@ export function PolicyVersionHistoryDialog(props: Props) {
}
function VersionItem(props: {
policy: PolicyPagePolicyFragment$data;
document: DocumentPageDocumentFragment$data;
version: Version;
active?: boolean;
onSelect: (v: Version) => void;
}) {
const version = useFragment<PolicyVersionHistoryDialogFragment$key>(
const version = useFragment<DocumentVersionHistoryDialogFragment$key>(
historyFragment,
props.version
);
@@ -87,12 +87,12 @@ function VersionItem(props: {
)}
>
<Avatar
name={version.publishedBy?.fullName ?? props.policy.owner.fullName}
name={version.publishedBy?.fullName ?? props.document.owner.fullName}
size="l"
/>
<div className="text-start space-y-[2px] w-full overflow-hidden">
<div className="text-sm text-txt-primary whitespace-nowrap overflow-hidden text-ellipsis">
{version.publishedBy?.fullName ?? props.policy.owner.fullName}
{version.publishedBy?.fullName ?? props.document.owner.fullName}
</div>
<div className="text-xs text-txt-secondary whitespace-nowrap overflow-hidden text-ellipsis">
{dateTimeFormat(version.publishedAt ?? version.updatedAt)}

View File

@@ -13,20 +13,20 @@ import {
import { type RefObject } from "react";
import { graphql } from "relay-runtime";
import { useMutation } from "react-relay";
import type { PolicyPagePolicyFragment$data } from "../__generated__/PolicyPagePolicyFragment.graphql";
import type { DocumentPageDocumentFragment$data } from "../__generated__/DocumentPageDocumentFragment.graphql";
import type { UpdateVersionDialogCreateMutation } from "./__generated__/UpdateVersionDialogCreateMutation.graphql";
import type { UpdateVersionDialogUpdateMutation } from "./__generated__/UpdateVersionDialogUpdateMutation.graphql";
import { z } from "zod";
import { useFormWithSchema } from "/hooks/useFormWithSchema";
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
const createDraftPolicy = graphql`
const createDraftDocument = graphql`
mutation UpdateVersionDialogCreateMutation(
$input: CreateDraftPolicyVersionInput!
$input: CreateDraftDocumentVersionInput!
$connections: [ID!]!
) {
createDraftPolicyVersion(input: $input) {
policyVersionEdge @prependEdge(connections: $connections) {
createDraftDocumentVersion(input: $input) {
documentVersionEdge @prependEdge(connections: $connections) {
node {
id
content
@@ -48,12 +48,12 @@ const createDraftPolicy = graphql`
}
`;
const UpdatePolicyMutation = graphql`
const UpdateDocumentMutation = graphql`
mutation UpdateVersionDialogUpdateMutation(
$input: UpdatePolicyVersionInput!
$input: UpdateDocumentVersionInput!
) {
updatePolicyVersion(input: $input) {
policyVersion {
updateDocumentVersion(input: $input) {
documentVersion {
id
content
}
@@ -62,7 +62,7 @@ const UpdatePolicyMutation = graphql`
`;
type Props = {
policy: PolicyPagePolicyFragment$data;
document: DocumentPageDocumentFragment$data;
connectionId: string;
ref: RefObject<{ open: () => void } | null>;
};
@@ -72,7 +72,7 @@ const versionSchema = z.object({
});
export default function UpdateVersionDialog({
policy,
document,
connectionId,
ref,
}: Props) {
@@ -80,16 +80,16 @@ export default function UpdateVersionDialog({
const { toast } = useToast();
const dialogRef = useDialogRef();
const version = policy.versions.edges[0].node;
const version = document.versions.edges[0].node;
const isDraft = version?.status === "DRAFT";
const [createDraftPolicyVersion, isCreatingDraft] =
useMutation<UpdateVersionDialogCreateMutation>(createDraftPolicy);
const [updatePolicyVersion, isUpdating] =
const [createDraftDocumentVersion, isCreatingDraft] =
useMutation<UpdateVersionDialogCreateMutation>(createDraftDocument);
const [updateDocumentVersion, isUpdating] =
useMutationWithToasts<UpdateVersionDialogUpdateMutation>(
UpdatePolicyMutation,
UpdateDocumentMutation,
{
successMessage: __("Policy updated successfully."),
errorMessage: __("Failed to update policy. Please try again."),
successMessage: __("Document updated successfully."),
errorMessage: __("Failed to update document. Please try again."),
}
);
const { handleSubmit, register } = useFormWithSchema(versionSchema, {
@@ -102,10 +102,10 @@ export default function UpdateVersionDialog({
open: () => {
dialogRef.current?.open();
if (!isDraft) {
createDraftPolicyVersion({
createDraftDocumentVersion({
variables: {
input: {
policyID: policy.id,
documentID: document.id,
},
connections: [connectionId],
},
@@ -131,10 +131,10 @@ export default function UpdateVersionDialog({
}
const onSubmit = handleSubmit((data) => {
updatePolicyVersion({
updateDocumentVersion({
variables: {
input: {
policyVersionId: version.id,
documentVersionId: version.id,
content: data.content,
},
},
@@ -147,7 +147,7 @@ export default function UpdateVersionDialog({
return (
<Dialog
ref={dialogRef}
title={<Breadcrumb items={[__("Policies"), __("Edit policy")]} />}
title={<Breadcrumb items={[__("Documents"), __("Edit document")]} />}
>
{isCreatingDraft && <Spinner centered />}
<form onSubmit={onSubmit}>
@@ -165,7 +165,7 @@ export default function UpdateVersionDialog({
</DialogContent>
<DialogFooter>
<Button disabled={isUpdating} type="submit">
{__("Update policy")}
{__("Update document")}
</Button>
</DialogFooter>
</form>

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<0471409a1735c49fc0b05b5e63e97853>>
* @generated SignedSource<<828dc0f47cb0d218fc437848beac7878>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -10,28 +10,30 @@
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type CreatePolicyInput = {
export type DocumentType = "ISMS" | "OTHER" | "POLICY";
export type CreateDocumentInput = {
content: string;
documentType: DocumentType;
organizationId: string;
ownerId: string;
title: string;
};
export type CreatePolicyDialogMutation$variables = {
export type CreateDocumentDialogMutation$variables = {
connections: ReadonlyArray<string>;
input: CreatePolicyInput;
input: CreateDocumentInput;
};
export type CreatePolicyDialogMutation$data = {
readonly createPolicy: {
readonly policyEdge: {
export type CreateDocumentDialogMutation$data = {
readonly createDocument: {
readonly documentEdge: {
readonly node: {
readonly " $fragmentSpreads": FragmentRefs<"PoliciesPageRowFragment">;
readonly " $fragmentSpreads": FragmentRefs<"DocumentsPageRowFragment">;
};
};
};
};
export type CreatePolicyDialogMutation = {
response: CreatePolicyDialogMutation$data;
variables: CreatePolicyDialogMutation$variables;
export type CreateDocumentDialogMutation = {
response: CreateDocumentDialogMutation$data;
variables: CreateDocumentDialogMutation$variables;
};
const node: ConcreteRequest = (function(){
@@ -67,28 +69,28 @@ return {
],
"kind": "Fragment",
"metadata": null,
"name": "CreatePolicyDialogMutation",
"name": "CreateDocumentDialogMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "CreatePolicyPayload",
"concreteType": "CreateDocumentPayload",
"kind": "LinkedField",
"name": "createPolicy",
"name": "createDocument",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "PolicyEdge",
"concreteType": "DocumentEdge",
"kind": "LinkedField",
"name": "policyEdge",
"name": "documentEdge",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Policy",
"concreteType": "Document",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -96,7 +98,7 @@ return {
{
"args": null,
"kind": "FragmentSpread",
"name": "PoliciesPageRowFragment"
"name": "DocumentsPageRowFragment"
}
],
"storageKey": null
@@ -118,28 +120,28 @@ return {
(v0/*: any*/)
],
"kind": "Operation",
"name": "CreatePolicyDialogMutation",
"name": "CreateDocumentDialogMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "CreatePolicyPayload",
"concreteType": "CreateDocumentPayload",
"kind": "LinkedField",
"name": "createPolicy",
"name": "createDocument",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "PolicyEdge",
"concreteType": "DocumentEdge",
"kind": "LinkedField",
"name": "policyEdge",
"name": "documentEdge",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "Policy",
"concreteType": "Document",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -194,7 +196,7 @@ return {
"value": 1
}
],
"concreteType": "PolicyVersionConnection",
"concreteType": "DocumentVersionConnection",
"kind": "LinkedField",
"name": "versions",
"plural": false,
@@ -202,7 +204,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionEdge",
"concreteType": "DocumentVersionEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
@@ -210,7 +212,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersion",
"concreteType": "DocumentVersion",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -232,7 +234,7 @@ return {
"value": 100
}
],
"concreteType": "PolicyVersionSignatureConnection",
"concreteType": "DocumentVersionSignatureConnection",
"kind": "LinkedField",
"name": "signatures",
"plural": false,
@@ -240,7 +242,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignatureEdge",
"concreteType": "DocumentVersionSignatureEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
@@ -248,7 +250,7 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignature",
"concreteType": "DocumentVersionSignature",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -292,7 +294,7 @@ return {
"handle": "prependEdge",
"key": "",
"kind": "LinkedHandle",
"name": "policyEdge",
"name": "documentEdge",
"handleArgs": [
{
"kind": "Variable",
@@ -307,16 +309,16 @@ return {
]
},
"params": {
"cacheID": "7ca1b2811e06da7ba97064950fb8f632",
"cacheID": "bedd217ae32d45e8ac183a38e5624618",
"id": null,
"metadata": {},
"name": "CreatePolicyDialogMutation",
"name": "CreateDocumentDialogMutation",
"operationKind": "mutation",
"text": "mutation CreatePolicyDialogMutation(\n $input: CreatePolicyInput!\n) {\n createPolicy(input: $input) {\n policyEdge {\n node {\n ...PoliciesPageRowFragment\n id\n }\n }\n }\n}\n\nfragment PoliciesPageRowFragment on Policy {\n id\n title\n description\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 ...DocumentsPageRowFragment\n id\n }\n }\n }\n}\n\nfragment DocumentsPageRowFragment on Document {\n id\n title\n description\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 = "6c749af4def68b742bc5eb80dd120c8a";
(node as any).hash = "f3792f9bd5524dd1e7656908c2774069";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<af123c927212dd99fbaeb81e3b2f2bd9>>
* @generated SignedSource<<fa604130d8725651770072b638fc5926>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -10,32 +10,32 @@
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type PolicyVersionSignatureState = "REQUESTED" | "SIGNED";
export type DocumentVersionSignatureState = "REQUESTED" | "SIGNED";
export type RequestSignatureInput = {
policyVersionId: string;
documentVersionId: string;
signatoryId: string;
};
export type PolicySignaturesDialog_requestSignatureMutation$variables = {
export type DocumentSignaturesDialog_requestSignatureMutation$variables = {
connections: ReadonlyArray<string>;
input: RequestSignatureInput;
};
export type PolicySignaturesDialog_requestSignatureMutation$data = {
export type DocumentSignaturesDialog_requestSignatureMutation$data = {
readonly requestSignature: {
readonly policyVersionSignatureEdge: {
readonly documentVersionSignatureEdge: {
readonly node: {
readonly id: string;
readonly signedBy: {
readonly id: string;
};
readonly state: PolicyVersionSignatureState;
readonly " $fragmentSpreads": FragmentRefs<"PolicySignaturesDialog_signature">;
readonly state: DocumentVersionSignatureState;
readonly " $fragmentSpreads": FragmentRefs<"DocumentSignaturesDialog_signature">;
};
};
};
};
export type PolicySignaturesDialog_requestSignatureMutation = {
response: PolicySignaturesDialog_requestSignatureMutation$data;
variables: PolicySignaturesDialog_requestSignatureMutation$variables;
export type DocumentSignaturesDialog_requestSignatureMutation = {
response: DocumentSignaturesDialog_requestSignatureMutation$data;
variables: DocumentSignaturesDialog_requestSignatureMutation$variables;
};
const node: ConcreteRequest = (function(){
@@ -78,7 +78,7 @@ return {
],
"kind": "Fragment",
"metadata": null,
"name": "PolicySignaturesDialog_requestSignatureMutation",
"name": "DocumentSignaturesDialog_requestSignatureMutation",
"selections": [
{
"alias": null,
@@ -91,15 +91,15 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignatureEdge",
"concreteType": "DocumentVersionSignatureEdge",
"kind": "LinkedField",
"name": "policyVersionSignatureEdge",
"name": "documentVersionSignatureEdge",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignature",
"concreteType": "DocumentVersionSignature",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -121,7 +121,7 @@ return {
{
"args": null,
"kind": "FragmentSpread",
"name": "PolicySignaturesDialog_signature"
"name": "DocumentSignaturesDialog_signature"
}
],
"storageKey": null
@@ -143,7 +143,7 @@ return {
(v0/*: any*/)
],
"kind": "Operation",
"name": "PolicySignaturesDialog_requestSignatureMutation",
"name": "DocumentSignaturesDialog_requestSignatureMutation",
"selections": [
{
"alias": null,
@@ -156,15 +156,15 @@ return {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignatureEdge",
"concreteType": "DocumentVersionSignatureEdge",
"kind": "LinkedField",
"name": "policyVersionSignatureEdge",
"name": "documentVersionSignatureEdge",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignature",
"concreteType": "DocumentVersionSignature",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -224,7 +224,7 @@ return {
"handle": "prependEdge",
"key": "",
"kind": "LinkedHandle",
"name": "policyVersionSignatureEdge",
"name": "documentVersionSignatureEdge",
"handleArgs": [
{
"kind": "Variable",
@@ -239,16 +239,16 @@ return {
]
},
"params": {
"cacheID": "20c460adbc3480622c4c91220a6e54fe",
"cacheID": "6a5413db69a07e0eef99245e949cf4b2",
"id": null,
"metadata": {},
"name": "PolicySignaturesDialog_requestSignatureMutation",
"name": "DocumentSignaturesDialog_requestSignatureMutation",
"operationKind": "mutation",
"text": "mutation PolicySignaturesDialog_requestSignatureMutation(\n $input: RequestSignatureInput!\n) {\n requestSignature(input: $input) {\n policyVersionSignatureEdge {\n node {\n id\n state\n signedBy {\n id\n }\n ...PolicySignaturesDialog_signature\n }\n }\n }\n}\n\nfragment PolicySignaturesDialog_signature on PolicyVersionSignature {\n id\n state\n signedAt\n requestedAt\n signedBy {\n fullName\n primaryEmailAddress\n id\n }\n}\n"
"text": "mutation DocumentSignaturesDialog_requestSignatureMutation(\n $input: RequestSignatureInput!\n) {\n requestSignature(input: $input) {\n documentVersionSignatureEdge {\n node {\n id\n state\n signedBy {\n id\n }\n ...DocumentSignaturesDialog_signature\n }\n }\n }\n}\n\nfragment DocumentSignaturesDialog_signature on DocumentVersionSignature {\n id\n state\n signedAt\n requestedAt\n signedBy {\n fullName\n primaryEmailAddress\n id\n }\n}\n"
}
};
})();
(node as any).hash = "24825b1c4040debb7edda76c8ad3d662";
(node as any).hash = "6c51f681411cd3de162c78a3db20ec30";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<4bda7ac839740680ea31b4c20299d9d4>>
* @generated SignedSource<<71e44f5802c3eaba88dde399af20ed89>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -9,9 +9,9 @@
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
export type PolicyVersionSignatureState = "REQUESTED" | "SIGNED";
export type DocumentVersionSignatureState = "REQUESTED" | "SIGNED";
import { FragmentRefs } from "relay-runtime";
export type PolicySignaturesDialog_signature$data = {
export type DocumentSignaturesDialog_signature$data = {
readonly id: string;
readonly requestedAt: any;
readonly signedAt: any | null | undefined;
@@ -19,19 +19,19 @@ export type PolicySignaturesDialog_signature$data = {
readonly fullName: string;
readonly primaryEmailAddress: string;
};
readonly state: PolicyVersionSignatureState;
readonly " $fragmentType": "PolicySignaturesDialog_signature";
readonly state: DocumentVersionSignatureState;
readonly " $fragmentType": "DocumentSignaturesDialog_signature";
};
export type PolicySignaturesDialog_signature$key = {
readonly " $data"?: PolicySignaturesDialog_signature$data;
readonly " $fragmentSpreads": FragmentRefs<"PolicySignaturesDialog_signature">;
export type DocumentSignaturesDialog_signature$key = {
readonly " $data"?: DocumentSignaturesDialog_signature$data;
readonly " $fragmentSpreads": FragmentRefs<"DocumentSignaturesDialog_signature">;
};
const node: ReaderFragment = {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "PolicySignaturesDialog_signature",
"name": "DocumentSignaturesDialog_signature",
"selections": [
{
"alias": null,
@@ -87,10 +87,10 @@ const node: ReaderFragment = {
"storageKey": null
}
],
"type": "PolicyVersionSignature",
"type": "DocumentVersionSignature",
"abstractKey": null
};
(node as any).hash = "b2e435dc6db3a0df223af98251adcb30";
(node as any).hash = "0db843d4ebd21f44a3d126e85da8cf26";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<efbbec863b7456c271e408fb553f9ea1>>
* @generated SignedSource<<dc19ab6bedc70a5b4546a2edb922b97f>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -9,25 +9,25 @@
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
export type PolicyStatus = "DRAFT" | "PUBLISHED";
export type DocumentStatus = "DRAFT" | "PUBLISHED";
import { FragmentRefs } from "relay-runtime";
export type PolicySignaturesDialog_version$data = {
export type DocumentSignaturesDialog_version$data = {
readonly publishedAt: any | null | undefined;
readonly status: PolicyStatus;
readonly status: DocumentStatus;
readonly updatedAt: any;
readonly version: number;
readonly " $fragmentType": "PolicySignaturesDialog_version";
readonly " $fragmentType": "DocumentSignaturesDialog_version";
};
export type PolicySignaturesDialog_version$key = {
readonly " $data"?: PolicySignaturesDialog_version$data;
readonly " $fragmentSpreads": FragmentRefs<"PolicySignaturesDialog_version">;
export type DocumentSignaturesDialog_version$key = {
readonly " $data"?: DocumentSignaturesDialog_version$data;
readonly " $fragmentSpreads": FragmentRefs<"DocumentSignaturesDialog_version">;
};
const node: ReaderFragment = {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "PolicySignaturesDialog_version",
"name": "DocumentSignaturesDialog_version",
"selections": [
{
"alias": null,
@@ -58,10 +58,10 @@ const node: ReaderFragment = {
"storageKey": null
}
],
"type": "PolicyVersion",
"type": "DocumentVersion",
"abstractKey": null
};
(node as any).hash = "cdec8e3244fd6329a86b5825a4133c44";
(node as any).hash = "564746ce584a834e25a5a341155d6b2c";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<45feb21e3f613b3818af04725831a427>>
* @generated SignedSource<<dd89afd13dd17b29485a3fdaf840cd42>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -9,9 +9,9 @@
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
export type PolicyStatus = "DRAFT" | "PUBLISHED";
export type DocumentStatus = "DRAFT" | "PUBLISHED";
import { FragmentRefs } from "relay-runtime";
export type PolicyVersionHistoryDialogFragment$data = {
export type DocumentVersionHistoryDialogFragment$data = {
readonly changelog: string;
readonly content: string;
readonly id: string;
@@ -19,21 +19,21 @@ export type PolicyVersionHistoryDialogFragment$data = {
readonly publishedBy: {
readonly fullName: string;
} | null | undefined;
readonly status: PolicyStatus;
readonly status: DocumentStatus;
readonly updatedAt: any;
readonly version: number;
readonly " $fragmentType": "PolicyVersionHistoryDialogFragment";
readonly " $fragmentType": "DocumentVersionHistoryDialogFragment";
};
export type PolicyVersionHistoryDialogFragment$key = {
readonly " $data"?: PolicyVersionHistoryDialogFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"PolicyVersionHistoryDialogFragment">;
export type DocumentVersionHistoryDialogFragment$key = {
readonly " $data"?: DocumentVersionHistoryDialogFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"DocumentVersionHistoryDialogFragment">;
};
const node: ReaderFragment = {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "PolicyVersionHistoryDialogFragment",
"name": "DocumentVersionHistoryDialogFragment",
"selections": [
{
"alias": null,
@@ -103,10 +103,10 @@ const node: ReaderFragment = {
"storageKey": null
}
],
"type": "PolicyVersion",
"type": "DocumentVersion",
"abstractKey": null
};
(node as any).hash = "63ce12a876b10889d9ff2e4ee20af968";
(node as any).hash = "947253287039236aa413ee33879a6e4b";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<7b7cbab5e73007ace1e7d07970b633e8>>
* @generated SignedSource<<8c2484ed8e582d28aab0aa0b4cf30ebe>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -9,18 +9,18 @@
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type PolicyStatus = "DRAFT" | "PUBLISHED";
export type PolicyVersionSignatureState = "REQUESTED" | "SIGNED";
export type CreateDraftPolicyVersionInput = {
policyID: string;
export type DocumentStatus = "DRAFT" | "PUBLISHED";
export type DocumentVersionSignatureState = "REQUESTED" | "SIGNED";
export type CreateDraftDocumentVersionInput = {
documentID: string;
};
export type UpdateVersionDialogCreateMutation$variables = {
connections: ReadonlyArray<string>;
input: CreateDraftPolicyVersionInput;
input: CreateDraftDocumentVersionInput;
};
export type UpdateVersionDialogCreateMutation$data = {
readonly createDraftPolicyVersion: {
readonly policyVersionEdge: {
readonly createDraftDocumentVersion: {
readonly documentVersionEdge: {
readonly node: {
readonly content: string;
readonly id: string;
@@ -29,11 +29,11 @@ export type UpdateVersionDialogCreateMutation$data = {
readonly edges: ReadonlyArray<{
readonly node: {
readonly id: string;
readonly state: PolicyVersionSignatureState;
readonly state: DocumentVersionSignatureState;
};
}>;
};
readonly status: PolicyStatus;
readonly status: DocumentStatus;
readonly updatedAt: any;
readonly version: number;
};
@@ -73,15 +73,15 @@ v3 = {
v4 = {
"alias": null,
"args": null,
"concreteType": "PolicyVersionEdge",
"concreteType": "DocumentVersionEdge",
"kind": "LinkedField",
"name": "policyVersionEdge",
"name": "documentVersionEdge",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "PolicyVersion",
"concreteType": "DocumentVersion",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -131,7 +131,7 @@ v4 = {
"value": 100
}
],
"concreteType": "PolicyVersionSignatureConnection",
"concreteType": "DocumentVersionSignatureConnection",
"kind": "LinkedField",
"name": "signatures",
"plural": false,
@@ -139,7 +139,7 @@ v4 = {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignatureEdge",
"concreteType": "DocumentVersionSignatureEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
@@ -147,7 +147,7 @@ v4 = {
{
"alias": null,
"args": null,
"concreteType": "PolicyVersionSignature",
"concreteType": "DocumentVersionSignature",
"kind": "LinkedField",
"name": "node",
"plural": false,
@@ -188,9 +188,9 @@ return {
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "CreateDraftPolicyVersionPayload",
"concreteType": "CreateDraftDocumentVersionPayload",
"kind": "LinkedField",
"name": "createDraftPolicyVersion",
"name": "createDraftDocumentVersion",
"plural": false,
"selections": [
(v4/*: any*/)
@@ -213,9 +213,9 @@ return {
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "CreateDraftPolicyVersionPayload",
"concreteType": "CreateDraftDocumentVersionPayload",
"kind": "LinkedField",
"name": "createDraftPolicyVersion",
"name": "createDraftDocumentVersion",
"plural": false,
"selections": [
(v4/*: any*/),
@@ -226,7 +226,7 @@ return {
"handle": "prependEdge",
"key": "",
"kind": "LinkedHandle",
"name": "policyVersionEdge",
"name": "documentVersionEdge",
"handleArgs": [
{
"kind": "Variable",
@@ -241,16 +241,16 @@ return {
]
},
"params": {
"cacheID": "c5b0f449a70a4043368de55bba176329",
"cacheID": "1a0f515ea5c0ca4fd3ab1ae969025ca0",
"id": null,
"metadata": {},
"name": "UpdateVersionDialogCreateMutation",
"operationKind": "mutation",
"text": "mutation UpdateVersionDialogCreateMutation(\n $input: CreateDraftPolicyVersionInput!\n) {\n createDraftPolicyVersion(input: $input) {\n policyVersionEdge {\n node {\n id\n content\n status\n publishedAt\n version\n updatedAt\n signatures(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n }\n }\n }\n}\n"
"text": "mutation UpdateVersionDialogCreateMutation(\n $input: CreateDraftDocumentVersionInput!\n) {\n createDraftDocumentVersion(input: $input) {\n documentVersionEdge {\n node {\n id\n content\n status\n publishedAt\n version\n updatedAt\n signatures(first: 100) {\n edges {\n node {\n id\n state\n }\n }\n }\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "6a451392a86776d33c376bfdcea7613c";
(node as any).hash = "a78a88558effc43ceab6746d8a4fea46";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<6cbec0c0b675969ecdebebf74c7465ab>>
* @generated SignedSource<<2b90fd4d14e86e5547d7b790a20242c9>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -9,16 +9,16 @@
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type UpdatePolicyVersionInput = {
export type UpdateDocumentVersionInput = {
content: string;
policyVersionId: string;
documentVersionId: string;
};
export type UpdateVersionDialogUpdateMutation$variables = {
input: UpdatePolicyVersionInput;
input: UpdateDocumentVersionInput;
};
export type UpdateVersionDialogUpdateMutation$data = {
readonly updatePolicyVersion: {
readonly policyVersion: {
readonly updateDocumentVersion: {
readonly documentVersion: {
readonly content: string;
readonly id: string;
};
@@ -47,17 +47,17 @@ v1 = [
"variableName": "input"
}
],
"concreteType": "UpdatePolicyVersionPayload",
"concreteType": "UpdateDocumentVersionPayload",
"kind": "LinkedField",
"name": "updatePolicyVersion",
"name": "updateDocumentVersion",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "PolicyVersion",
"concreteType": "DocumentVersion",
"kind": "LinkedField",
"name": "policyVersion",
"name": "documentVersion",
"plural": false,
"selections": [
{
@@ -99,16 +99,16 @@ return {
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "374557bf1319583b7d590f5bea438e63",
"cacheID": "527e45a341f2f991e30e8689ac24403c",
"id": null,
"metadata": {},
"name": "UpdateVersionDialogUpdateMutation",
"operationKind": "mutation",
"text": "mutation UpdateVersionDialogUpdateMutation(\n $input: UpdatePolicyVersionInput!\n) {\n updatePolicyVersion(input: $input) {\n policyVersion {\n id\n content\n }\n }\n}\n"
"text": "mutation UpdateVersionDialogUpdateMutation(\n $input: UpdateDocumentVersionInput!\n) {\n updateDocumentVersion(input: $input) {\n documentVersion {\n id\n content\n }\n }\n}\n"
}
};
})();
(node as any).hash = "d863d893bfa969b02768096e024275a4";
(node as any).hash = "ffd885c021e9fd91522a494e16e6830d";
export default node;

View File

@@ -3,14 +3,10 @@ import { useTranslate } from "@probo/i18n";
import {
ActionDropdown,
Avatar,
Button,
Card,
Dropdown,
DropdownItem,
FileButton,
FrameworkSelector,
IconChevronDown,
IconPlusLarge,
IconTrashCan,
IconUpload,
PageHeader,

View File

@@ -7,13 +7,10 @@ import {
Dialog,
DialogContent,
DialogFooter,
Field,
Input,
Textarea,
useDialogRef,
type DialogRef,
} from "@probo/ui";
import type { RefObject } from "react";
import { z } from "zod";
import { useFormWithSchema } from "/hooks/useFormWithSchema";
@@ -46,12 +43,7 @@ const schema = z.object({
export function CreateFrameworkDialog(props: Props) {
const { __ } = useTranslate();
const {
register,
handleSubmit,
formState: { errors },
reset,
} = useFormWithSchema(schema, {});
const { register, handleSubmit, reset } = useFormWithSchema(schema, {});
const [commitCreate, isCreating] = useMutationWithToasts(
createFrameworkMutation,
{

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<aa74d7b1c9c34a3780220590119aa78f>>
* @generated SignedSource<<fce211be2cfe7f4b313cf2db7f4f127c>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -12,9 +12,12 @@ import { ConcreteRequest } from 'relay-runtime';
export type PeopleKind = "CONTRACTOR" | "EMPLOYEE" | "SERVICE_ACCOUNT";
export type CreatePeopleInput = {
additionalEmailAddresses?: ReadonlyArray<string> | null | undefined;
contractEndDate?: any | null | undefined;
contractStartDate?: any | null | undefined;
fullName: string;
kind: PeopleKind;
organizationId: string;
position?: string | null | undefined;
primaryEmailAddress: string;
};
export type CreatePeopleDialogMutation$variables = {

View File

@@ -37,6 +37,7 @@ export function CreateVendorDialog({
organizationId,
name: vendor,
description: "",
category: null,
}
: {
organizationId,

View File

@@ -26,7 +26,7 @@ export default function VendorOverviewTab() {
[
{ name: "statusPageUrl", label: __("Status page URL") },
{ name: "termsOfServiceUrl", label: __("Terms of service URL") },
{ name: "privacyPolicyUrl", label: __("Privacy policy URL") },
{ name: "privacyPolicyUrl", label: __("Privacy document URL") },
{
name: "serviceLevelAgreementUrl",
label: __("Service level agreement URL"),

View File

@@ -17,7 +17,7 @@ import { loadQuery, type PreloadedQuery } from "react-relay";
import { useCleanup } from "./hooks/useDelayedEffect.ts";
import { riskRoutes } from "./routes/riskRoutes.ts";
import { measureRoutes } from "./routes/measureRoutes.ts";
import { policiesRoutes } from "./routes/policiesRoutes.ts";
import { documentsRoutes } from "./routes/documentsRoutes.ts";
import { vendorRoutes } from "./routes/vendorRoutes.ts";
import { organizationViewQuery } from "./hooks/graph/OrganizationGraph.ts";
import { peopleRoutes } from "./routes/peopleRoutes.ts";
@@ -83,7 +83,7 @@ const routes = [
},
...riskRoutes,
...measureRoutes,
...policiesRoutes,
...documentsRoutes,
...peopleRoutes,
...vendorRoutes,
...frameworkRoutes,

View File

@@ -0,0 +1,28 @@
import { lazy } from "react";
import { loadQuery } from "react-relay";
import type { AppRoute } from "/routes.tsx";
import { relayEnvironment } from "/providers/RelayProviders";
import { documentsQuery } from "/hooks/graph/DocumentGraph";
import { documentNodeQuery } from "/hooks/graph/DocumentGraph";
import { PageSkeleton } from "/components/skeletons/PageSkeleton";
export const documentsRoutes = [
{
path: "documents",
fallback: PageSkeleton,
queryLoader: ({ organizationId }) =>
loadQuery(relayEnvironment, documentsQuery, { organizationId }),
Component: lazy(
() => import("/pages/organizations/documents/DocumentsPage")
),
},
{
path: "documents/:documentId",
fallback: PageSkeleton,
queryLoader: ({ documentId }) =>
loadQuery(relayEnvironment, documentNodeQuery, { documentId }),
Component: lazy(
() => import("/pages/organizations/documents/DocumentPage")
),
},
] satisfies AppRoute[];

View File

@@ -1,24 +0,0 @@
import { lazy } from "react";
import { loadQuery } from "react-relay";
import type { AppRoute } from "/routes.tsx";
import { relayEnvironment } from "/providers/RelayProviders";
import { policiesQuery } from "/hooks/graph/PolicyGraph";
import { policyNodeQuery } from "/hooks/graph/PolicyGraph";
import { PageSkeleton } from "/components/skeletons/PageSkeleton";
export const policiesRoutes = [
{
path: "policies",
fallback: PageSkeleton,
queryLoader: ({ organizationId }) =>
loadQuery(relayEnvironment, policiesQuery, { organizationId }),
Component: lazy(() => import("/pages/organizations/policies/PoliciesPage")),
},
{
path: "policies/:policyId",
fallback: PageSkeleton,
queryLoader: ({ policyId }) =>
loadQuery(relayEnvironment, policyNodeQuery, { policyId }),
Component: lazy(() => import("/pages/organizations/policies/PolicyPage")),
},
] satisfies AppRoute[];

View File

@@ -0,0 +1,21 @@
import { DocumentVersionBadge } from "./DocumentVersionBadge";
import type { Meta, StoryObj } from "@storybook/react";
export default {
title: "Molecules/Badges/DocumentVersionBadge",
component: DocumentVersionBadge,
argTypes: {},
} satisfies Meta<typeof DocumentVersionBadge>;
type Story = StoryObj<typeof DocumentVersionBadge>;
export const Default: Story = {
render() {
return (
<div className="flex gap-2">
<DocumentVersionBadge state="DRAFT" />
<DocumentVersionBadge state="PUBLISHED" />
</div>
);
},
};

View File

@@ -5,7 +5,7 @@ type Props = {
state: "DRAFT" | "PUBLISHED";
};
export function PolicyVersionBadge(props: Props) {
export function DocumentVersionBadge(props: Props) {
const { __ } = useTranslate();
return (
<Badge variant={props.state === "DRAFT" ? "neutral" : "success"}>

View File

@@ -1,21 +0,0 @@
import { PolicyVersionBadge } from "./PolicyVersionBadge";
import type { Meta, StoryObj } from "@storybook/react";
export default {
title: "Molecules/Badges/PolicyVersionBadge",
component: PolicyVersionBadge,
argTypes: {},
} satisfies Meta<typeof PolicyVersionBadge>;
type Story = StoryObj<typeof PolicyVersionBadge>;
export const Default: Story = {
render() {
return (
<div className="flex gap-2">
<PolicyVersionBadge state="DRAFT" />
<PolicyVersionBadge state="PUBLISHED" />
</div>
);
},
};

View File

@@ -52,7 +52,7 @@ export {
export { useConfirm } from "./Molecules/Dialog/ConfirmDialog";
export { RiskBadge } from "./Molecules/Badge/RiskBadge";
export { SeverityBadge } from "./Molecules/Badge/SeverityBadge.tsx";
export { PolicyVersionBadge } from "./Molecules/Badge/PolicyVersionBadge.tsx";
export { DocumentVersionBadge } from "./Molecules/Badge/DocumentVersionBadge.tsx";
export { RisksChart } from "./Molecules/Risks/RisksChart";
export { RiskOverview } from "./Molecules/Risks/RiskOverview";
export { Combobox, ComboboxItem } from "./Molecules/Combobox/Combobox";

View File

@@ -6,28 +6,28 @@
* Category types for vendors
*/
export type VendorCategory =
| 'Analytics'
| 'Cloud monitoring'
| 'Cloud provider'
| 'Collaboration'
| 'Customer support'
| 'Data storage and processing'
| 'Document management'
| 'Employee management'
| 'Engineering'
| 'Finance'
| 'Identity provider'
| 'IT'
| 'Marketing'
| 'Office operations'
| 'Other'
| 'Password management'
| 'Product and design'
| 'Professional services'
| 'Recruiting'
| 'Sales'
| 'Security'
| 'Version control';
| "ANALYTICS"
| "CLOUD_MONITORING"
| "CLOUD_PROVIDER"
| "COLLABORATION"
| "CUSTOMER_SUPPORT"
| "DATA_STORAGE_AND_PROCESSING"
| "DOCUMENT_MANAGEMENT"
| "EMPLOYEE_MANAGEMENT"
| "ENGINEERING"
| "FINANCE"
| "IDENTITY_PROVIDER"
| "IT"
| "MARKETING"
| "OFFICE_OPERATIONS"
| "OTHER"
| "PASSWORD_MANAGEMENT"
| "PRODUCT_AND_DESIGN"
| "PROFESSIONAL_SERVICES"
| "RECRUITING"
| "SALES"
| "SECURITY"
| "VERSION_CONTROL";
/**
* Represents a software vendor or service provider with associated metadata
@@ -35,52 +35,52 @@ export type VendorCategory =
export interface Vendor {
/** Display name of the vendor */
name: string;
/** Legal business name of the vendor */
legalName?: string;
/** Physical headquarters address */
headquarterAddress?: string;
/** Vendor's website URL */
websiteUrl: string;
/** URL to vendor's privacy policy */
privacyPolicyUrl?: string;
/** URL to vendor's terms of service */
termsOfServiceUrl?: string;
/** URL to vendor's service level agreement */
serviceLevelAgreementUrl?: string;
/** URL to service software agreement */
serviceSoftwareAgreementUrl?: string;
/** URL to vendor's data processing agreement */
dataProcessingAgreementUrl?: string;
/** URL to vendor's list of subprocessors */
subprocessorsListUrl?: string;
/** URL to vendor's business associate agreement */
businessAssociateAgreementUrl?: string;
/** Short description of the vendor/service */
description?: string;
/** Primary category for the vendor */
category?: VendorCategory;
/** Security or compliance certifications held by the vendor */
certifications?: string[];
/** URL to vendor's security page */
securityPageUrl?: string;
/** URL to vendor's trust page */
trustPageUrl?: string;
/** URL to vendor's status page */
statusPageUrl?: string;
}
@@ -90,7 +90,6 @@ export interface Vendor {
*/
export type Vendors = Vendor[];
/**
* Default export representing the entire vendor dataset
*/