Update console for compliance portal
Point compliance-page screens and Relay graphs at the renamed Compliance Portal API fields and mutations. Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -123,7 +123,7 @@ export const CompliancePageReferenceDialog = forwardRef<CompliancePageReferenceD
|
||||
await createReference({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId: compliancePageId,
|
||||
compliancePortalId: compliancePageId,
|
||||
name: data.name,
|
||||
description: data.description || null,
|
||||
websiteUrl: data.websiteUrl,
|
||||
|
||||
@@ -26,9 +26,9 @@ import type { CompliancePageGraphUploadNDAMutation } from "#/__generated__/core/
|
||||
import { useMutation } from "#/lib/relay/useMutation";
|
||||
|
||||
const updateCompliancePageMutation = graphql`
|
||||
mutation CompliancePageGraphUpdateMutation($input: UpdateTrustCenterInput!) {
|
||||
updateTrustCenter(input: $input) {
|
||||
trustCenter {
|
||||
mutation CompliancePageGraphUpdateMutation($input: UpdateCompliancePortalInput!) {
|
||||
updateCompliancePortal(input: $input) {
|
||||
compliancePortal {
|
||||
id
|
||||
active
|
||||
searchEngineIndexing
|
||||
@@ -55,10 +55,10 @@ export function useUpdateCompliancePageMutation() {
|
||||
|
||||
const uploadCompliancePageNDAMutation = graphql`
|
||||
mutation CompliancePageGraphUploadNDAMutation(
|
||||
$input: UploadTrustCenterNDAInput!
|
||||
$input: UploadCompliancePortalNDAInput!
|
||||
) {
|
||||
uploadTrustCenterNDA(input: $input) {
|
||||
trustCenter {
|
||||
uploadCompliancePortalNDA(input: $input) {
|
||||
compliancePortal {
|
||||
id
|
||||
nda {
|
||||
fileName
|
||||
@@ -79,10 +79,10 @@ export function useUploadCompliancePageNDAMutation() {
|
||||
|
||||
const deleteCompliancePageNDAMutation = graphql`
|
||||
mutation CompliancePageGraphDeleteNDAMutation(
|
||||
$input: DeleteTrustCenterNDAInput!
|
||||
$input: DeleteCompliancePortalNDAInput!
|
||||
) {
|
||||
deleteTrustCenterNDA(input: $input) {
|
||||
trustCenter {
|
||||
deleteCompliancePortalNDA(input: $input) {
|
||||
compliancePortal {
|
||||
id
|
||||
nda {
|
||||
fileName
|
||||
|
||||
@@ -22,10 +22,10 @@ import { graphql } from "react-relay";
|
||||
|
||||
/* eslint-disable relay/unused-fields */
|
||||
|
||||
export const trustCenterByIdQuery = graphql`
|
||||
query TrustCenterAccessTokenGraphQuery($trustCenterId: ID!) {
|
||||
node(id: $trustCenterId) {
|
||||
... on TrustCenter {
|
||||
export const compliancePortalByIdQuery = graphql`
|
||||
query CompliancePortalAccessTokenGraphQuery($compliancePortalId: ID!) {
|
||||
node(id: $compliancePortalId) {
|
||||
... on CompliancePortal {
|
||||
id
|
||||
active
|
||||
organization {
|
||||
@@ -34,7 +34,7 @@ export const compliancePageLayoutQuery = graphql`
|
||||
organization: node(id: $organizationId) {
|
||||
__typename
|
||||
... on Organization {
|
||||
compliancePage: trustCenter {
|
||||
compliancePage: compliancePortal {
|
||||
id
|
||||
active
|
||||
publicUrl
|
||||
|
||||
@@ -28,11 +28,11 @@ import { useMutation } from "#/lib/relay/useMutation";
|
||||
|
||||
export const createCompliancePageReferenceMutation = graphql`
|
||||
mutation compliancePageReferenceMutationsCreateMutation(
|
||||
$input: CreateTrustCenterReferenceInput!
|
||||
$input: CreateCompliancePortalReferenceInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
createTrustCenterReference(input: $input) {
|
||||
trustCenterReferenceEdge @appendEdge(connections: $connections) {
|
||||
createCompliancePortalReference(input: $input) {
|
||||
compliancePortalReferenceEdge @appendEdge(connections: $connections) {
|
||||
cursor
|
||||
node {
|
||||
id
|
||||
@@ -55,10 +55,10 @@ export const createCompliancePageReferenceMutation = graphql`
|
||||
|
||||
export const updateCompliancePageReferenceMutation = graphql`
|
||||
mutation compliancePageReferenceMutationsUpdateMutation(
|
||||
$input: UpdateTrustCenterReferenceInput!
|
||||
$input: UpdateCompliancePortalReferenceInput!
|
||||
) {
|
||||
updateTrustCenterReference(input: $input) {
|
||||
trustCenterReference {
|
||||
updateCompliancePortalReference(input: $input) {
|
||||
compliancePortalReference {
|
||||
id
|
||||
name
|
||||
description
|
||||
@@ -78,11 +78,11 @@ export const updateCompliancePageReferenceMutation = graphql`
|
||||
|
||||
export const deleteCompliancePageReferenceMutation = graphql`
|
||||
mutation compliancePageReferenceMutationsDeleteMutation(
|
||||
$input: DeleteTrustCenterReferenceInput!
|
||||
$input: DeleteCompliancePortalReferenceInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
deleteTrustCenterReference(input: $input) {
|
||||
deletedTrustCenterReferenceId @deleteEdge(connections: $connections)
|
||||
deleteCompliancePortalReference(input: $input) {
|
||||
deletedCompliancePortalReferenceId @deleteEdge(connections: $connections)
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -109,10 +109,10 @@ export function useUpdateCompliancePageReferenceMutation() {
|
||||
|
||||
export const updateCompliancePageReferenceRankMutation = graphql`
|
||||
mutation compliancePageReferenceMutationsUpdateRankMutation(
|
||||
$input: UpdateTrustCenterReferenceInput!
|
||||
$input: UpdateCompliancePortalReferenceInput!
|
||||
) {
|
||||
updateTrustCenterReference(input: $input) {
|
||||
trustCenterReference {
|
||||
updateCompliancePortalReference(input: $input) {
|
||||
compliancePortalReference {
|
||||
id
|
||||
rank
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export const compliancePageAccessPageQuery = graphql`
|
||||
organization: node(id: $organizationId) {
|
||||
__typename
|
||||
... on Organization {
|
||||
compliancePage: trustCenter @required(action: THROW) {
|
||||
compliancePage: compliancePortal @required(action: THROW) {
|
||||
# eslint-disable-next-line relay/unused-fields
|
||||
id
|
||||
...CompliancePageAccessListFragment
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import type { TrustCenterDocumentAccessStatus } from "@probo/coredata";
|
||||
import type { CompliancePortalDocumentAccessStatus } from "@probo/coredata";
|
||||
import type { CompliancePageDocumentAccessInfo } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import {
|
||||
@@ -45,7 +45,7 @@ import { CompliancePageDocumentAccessList } from "#/pages/organizations/complian
|
||||
import { ElectronicSignatureSection } from "#/pages/organizations/compliance-page/access/_components/ElectronicSignatureSection";
|
||||
|
||||
const documentAccessFragment = graphql`
|
||||
fragment CompliancePageAccessEditDialogDocumentAccessFragment on TrustCenterDocumentAccess @inline {
|
||||
fragment CompliancePageAccessEditDialogDocumentAccessFragment on CompliancePortalDocumentAccess @inline {
|
||||
id
|
||||
status
|
||||
document {
|
||||
@@ -68,7 +68,7 @@ const documentAccessFragment = graphql`
|
||||
name
|
||||
}
|
||||
}
|
||||
trustCenterFile {
|
||||
compliancePortalFile {
|
||||
id
|
||||
name
|
||||
category
|
||||
@@ -112,15 +112,15 @@ function toDocumentAccessInfo(
|
||||
status: node.status,
|
||||
};
|
||||
}
|
||||
if (node.trustCenterFile) {
|
||||
if (node.compliancePortalFile) {
|
||||
return {
|
||||
persisted: node.id !== node.trustCenterFile.id,
|
||||
persisted: node.id !== node.compliancePortalFile.id,
|
||||
variant: "highlight",
|
||||
name: node.trustCenterFile.name,
|
||||
name: node.compliancePortalFile.name,
|
||||
type: "file",
|
||||
typeLabel: __("File"),
|
||||
category: node.trustCenterFile.category,
|
||||
id: node.trustCenterFile.id,
|
||||
category: node.compliancePortalFile.category,
|
||||
id: node.compliancePortalFile.id,
|
||||
status: node.status,
|
||||
};
|
||||
}
|
||||
@@ -130,7 +130,7 @@ function toDocumentAccessInfo(
|
||||
const compliancePageAccessEditDialogQuery = graphql`
|
||||
query CompliancePageAccessEditDialogQuery($accessId: ID!) {
|
||||
node(id: $accessId) {
|
||||
... on TrustCenterAccess {
|
||||
... on CompliancePortalAccess {
|
||||
id
|
||||
ndaSignature {
|
||||
...ElectronicSignatureSectionFragment
|
||||
@@ -152,10 +152,10 @@ const compliancePageAccessEditDialogQuery = graphql`
|
||||
|
||||
const updateAccessMutation = graphql`
|
||||
mutation CompliancePageAccessEditDialogUpdateMutation(
|
||||
$input: UpdateTrustCenterAccessInput!
|
||||
$input: UpdateCompliancePortalAccessInput!
|
||||
) {
|
||||
updateTrustCenterAccess(input: $input) {
|
||||
trustCenterAccess {
|
||||
updateCompliancePortalAccess(input: $input) {
|
||||
compliancePortalAccess {
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
@@ -224,7 +224,7 @@ function CompliancePageAccessEditForm(props: {
|
||||
getCompliancePageDocumentAccessInfo(edge.node, __),
|
||||
) ?? [];
|
||||
const initialStatusByID = initialDocumentAccesses.reduce<
|
||||
Record<string, TrustCenterDocumentAccessStatus>
|
||||
Record<string, CompliancePortalDocumentAccessStatus>
|
||||
>((acc, docAccess) => {
|
||||
acc[docAccess.id] = docAccess.status;
|
||||
return acc;
|
||||
@@ -236,7 +236,7 @@ function CompliancePageAccessEditForm(props: {
|
||||
const handleUpdateDocumentAccessStatus = useCallback(
|
||||
(
|
||||
documentAccess: CompliancePageDocumentAccessInfo,
|
||||
status: TrustCenterDocumentAccessStatus,
|
||||
status: CompliancePortalDocumentAccessStatus,
|
||||
) => {
|
||||
setDocumentAccesses((prev) => {
|
||||
const nextDocumentAccesses = [...prev];
|
||||
@@ -278,13 +278,13 @@ function CompliancePageAccessEditForm(props: {
|
||||
);
|
||||
|
||||
const handleSubmit = async () => {
|
||||
const documents: { id: string; status: TrustCenterDocumentAccessStatus }[]
|
||||
const documents: { id: string; status: CompliancePortalDocumentAccessStatus }[]
|
||||
= [];
|
||||
const reports: { id: string; status: TrustCenterDocumentAccessStatus }[]
|
||||
const reports: { id: string; status: CompliancePortalDocumentAccessStatus }[]
|
||||
= [];
|
||||
const compliancePageFiles: {
|
||||
id: string;
|
||||
status: TrustCenterDocumentAccessStatus;
|
||||
status: CompliancePortalDocumentAccessStatus;
|
||||
}[] = [];
|
||||
|
||||
for (const docAccess of documentAccesses) {
|
||||
@@ -312,7 +312,7 @@ function CompliancePageAccessEditForm(props: {
|
||||
id: access.id,
|
||||
documents,
|
||||
reports,
|
||||
trustCenterFiles: compliancePageFiles,
|
||||
compliancePortalFiles: compliancePageFiles,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -29,11 +29,11 @@ import type { CompliancePageAccessListQuery } from "#/__generated__/core/Complia
|
||||
import { CompliancePageAccessListItem } from "./CompliancePageAccessListItem";
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageAccessListFragment on TrustCenter
|
||||
fragment CompliancePageAccessListFragment on CompliancePortal
|
||||
@argumentDefinitions(
|
||||
first: { type: Int, defaultValue: 10 }
|
||||
after: { type: CursorKey, defaultValue: null }
|
||||
order: { type: TrustCenterAccessOrder, defaultValue: { field: CREATED_AT, direction: DESC } }
|
||||
order: { type: CompliancePortalAccessOrder, defaultValue: { field: CREATED_AT, direction: DESC } }
|
||||
)
|
||||
@refetchable(queryName: "CompliancePageAccessListQuery") {
|
||||
accesses(
|
||||
|
||||
@@ -31,7 +31,7 @@ import { CompliancePageAccessEditDialog } from "./CompliancePageAccessEditDialog
|
||||
import { NdaSignatureBadge } from "./NdaSignatureBadge";
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageAccessListItemFragment on TrustCenterAccess {
|
||||
fragment CompliancePageAccessListItemFragment on CompliancePortalAccess {
|
||||
id
|
||||
createdAt
|
||||
profile {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import type { TrustCenterDocumentAccessStatus } from "@probo/coredata";
|
||||
import type { CompliancePortalDocumentAccessStatus } from "@probo/coredata";
|
||||
import type { CompliancePageDocumentAccessInfo } from "@probo/helpers";
|
||||
import { getCompliancePageDocumentAccessStatusBadgeVariant, getCompliancePageDocumentAccessStatusLabel } from "@probo/helpers";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
@@ -26,10 +26,10 @@ import { Badge, Button, Table, Tbody, Td, Th, Thead, Tr } from "@probo/ui";
|
||||
|
||||
interface CompliancePageDocumentAccessListProps {
|
||||
documentAccesses: CompliancePageDocumentAccessInfo[];
|
||||
initialStatusByID: Record<string, TrustCenterDocumentAccessStatus>;
|
||||
initialStatusByID: Record<string, CompliancePortalDocumentAccessStatus>;
|
||||
onGrantAll: () => void;
|
||||
onRejectOrRevokeAll: () => void;
|
||||
onUpdateStatus: (docAccess: CompliancePageDocumentAccessInfo, status: TrustCenterDocumentAccessStatus) => void;
|
||||
onUpdateStatus: (docAccess: CompliancePageDocumentAccessInfo, status: CompliancePortalDocumentAccessStatus) => void;
|
||||
}
|
||||
|
||||
export function CompliancePageDocumentAccessList(props: CompliancePageDocumentAccessListProps) {
|
||||
|
||||
@@ -29,7 +29,7 @@ import { CompliancePageAuditListItem } from "./CompliancePageAuditListItem";
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageAuditListFragment on Organization {
|
||||
compliancePage: trustCenter @required(action: THROW) {
|
||||
compliancePage: compliancePortal @required(action: THROW) {
|
||||
...CompliancePageAuditListItem_compliancePageFragment
|
||||
}
|
||||
audits(first: 100) {
|
||||
|
||||
@@ -32,7 +32,7 @@ import { useOrganizationId } from "#/hooks/useOrganizationId";
|
||||
import { useMutation } from "#/lib/relay/useMutation";
|
||||
|
||||
const compliancePageFragment = graphql`
|
||||
fragment CompliancePageAuditListItem_compliancePageFragment on TrustCenter {
|
||||
fragment CompliancePageAuditListItem_compliancePageFragment on CompliancePortal {
|
||||
canUpdate: permission(action: "compliance-portal:portal:update")
|
||||
}
|
||||
`;
|
||||
@@ -46,7 +46,7 @@ const auditFragment = graphql`
|
||||
}
|
||||
validUntil
|
||||
state
|
||||
compliancePageVisibility: trustCenterVisibility
|
||||
compliancePageVisibility: compliancePortalVisibility
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -92,7 +92,7 @@ export function CompliancePageAuditListItem(props: {
|
||||
variables: {
|
||||
input: {
|
||||
id: audit.id,
|
||||
trustCenterVisibility: typedValue,
|
||||
compliancePortalVisibility: typedValue,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -34,7 +34,7 @@ export const compliancePageBrandPageQuery = graphql`
|
||||
__typename
|
||||
... on Organization {
|
||||
...CompliancePageDomainsSection_organizationFragment
|
||||
compliancePage: trustCenter @required(action: THROW) {
|
||||
compliancePage: compliancePortal @required(action: THROW) {
|
||||
...CompliancePageProfileSection_compliancePageFragment
|
||||
...CompliancePageVisualIdentitySection_compliancePageFragment
|
||||
...CompliancePageCustomLinksSection_compliancePageFragment
|
||||
|
||||
@@ -144,7 +144,7 @@ export const CompliancePageCustomLinkDialog = forwardRef<CompliancePageCustomLin
|
||||
if (mode === "create") {
|
||||
await create({
|
||||
variables: {
|
||||
input: { trustCenterId: compliancePageId, name: data.name, url: data.url },
|
||||
input: { compliancePortalId: compliancePageId, name: data.name, url: data.url },
|
||||
},
|
||||
updater: (store) => {
|
||||
const payload = store.getRootField("createComplianceCustomLink");
|
||||
|
||||
@@ -27,7 +27,7 @@ import { CompliancePageCustomLinkDialog, type CompliancePageCustomLinkDialogRef
|
||||
import { CompliancePageCustomLinkListItem } from "./CompliancePageCustomLinkListItem";
|
||||
|
||||
const compliancePageFragment = graphql`
|
||||
fragment CompliancePageCustomLinkList_compliancePageFragment on TrustCenter
|
||||
fragment CompliancePageCustomLinkList_compliancePageFragment on CompliancePortal
|
||||
@refetchable(queryName: "CompliancePageCustomLinkList_compliancePageRefetchQuery")
|
||||
@argumentDefinitions(
|
||||
first: { type: Int, defaultValue: 500 }
|
||||
|
||||
@@ -21,7 +21,7 @@ import type { CompliancePageCustomLinksSection_compliancePageFragment$key } from
|
||||
import { CompliancePageCustomLinkList } from "./CompliancePageCustomLinkList";
|
||||
|
||||
const compliancePageFragment = graphql`
|
||||
fragment CompliancePageCustomLinksSection_compliancePageFragment on TrustCenter {
|
||||
fragment CompliancePageCustomLinksSection_compliancePageFragment on CompliancePortal {
|
||||
...CompliancePageCustomLinkList_compliancePageFragment
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -25,7 +25,7 @@ import { NewCompliancePageDomainDialog } from "../../domain/_components/NewCompl
|
||||
const organizationFragment = graphql`
|
||||
fragment CompliancePageDomainsSection_organizationFragment on Organization {
|
||||
canCreateCustomDomain: permission(action: "compliance-portal:custom-domain:create")
|
||||
compliancePage: trustCenter @required(action: THROW) {
|
||||
compliancePage: compliancePortal @required(action: THROW) {
|
||||
id
|
||||
defaultDomain {
|
||||
id
|
||||
|
||||
@@ -23,7 +23,7 @@ import { useUpdateCompliancePageMutation } from "#/hooks/graph/CompliancePageGra
|
||||
import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||
|
||||
const compliancePageFragment = graphql`
|
||||
fragment CompliancePageProfileSection_compliancePageFragment on TrustCenter {
|
||||
fragment CompliancePageProfileSection_compliancePageFragment on CompliancePortal {
|
||||
id
|
||||
title
|
||||
description
|
||||
@@ -72,7 +72,7 @@ export function CompliancePageProfileSection(props: {
|
||||
await updateCompliancePage({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId: compliancePage.id,
|
||||
compliancePortalId: compliancePage.id,
|
||||
title: data.title,
|
||||
description: data.description || null,
|
||||
websiteUrl: data.websiteUrl || null,
|
||||
|
||||
@@ -31,7 +31,7 @@ import type { CompliancePageVisualIdentitySection_updateMutation } from "#/__gen
|
||||
import { useMutation } from "#/lib/relay/useMutation";
|
||||
|
||||
const compliancePageFragment = graphql`
|
||||
fragment CompliancePageVisualIdentitySection_compliancePageFragment on TrustCenter {
|
||||
fragment CompliancePageVisualIdentitySection_compliancePageFragment on CompliancePortal {
|
||||
id
|
||||
logo {
|
||||
downloadUrl
|
||||
@@ -44,9 +44,9 @@ const compliancePageFragment = graphql`
|
||||
`;
|
||||
|
||||
const updateMutation = graphql`
|
||||
mutation CompliancePageVisualIdentitySection_updateMutation($input: UpdateTrustCenterBrandInput!) {
|
||||
updateTrustCenterBrand(input: $input) {
|
||||
trustCenter {
|
||||
mutation CompliancePageVisualIdentitySection_updateMutation($input: UpdateCompliancePortalBrandInput!) {
|
||||
updateCompliancePortalBrand(input: $input) {
|
||||
compliancePortal {
|
||||
id
|
||||
logo {
|
||||
downloadUrl
|
||||
@@ -115,7 +115,7 @@ export function CompliancePageVisualIdentitySection(props: CompliancePageVisualI
|
||||
void updateBrand({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId: compliancePageId,
|
||||
compliancePortalId: compliancePageId,
|
||||
logoFile: null,
|
||||
},
|
||||
},
|
||||
@@ -137,7 +137,7 @@ export function CompliancePageVisualIdentitySection(props: CompliancePageVisualI
|
||||
void updateBrand({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId: compliancePageId,
|
||||
compliancePortalId: compliancePageId,
|
||||
darkLogoFile: null,
|
||||
},
|
||||
},
|
||||
@@ -154,7 +154,7 @@ export function CompliancePageVisualIdentitySection(props: CompliancePageVisualI
|
||||
await updateBrand({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId: compliancePageId,
|
||||
compliancePortalId: compliancePageId,
|
||||
logoFile: null,
|
||||
},
|
||||
},
|
||||
@@ -167,7 +167,7 @@ export function CompliancePageVisualIdentitySection(props: CompliancePageVisualI
|
||||
await updateBrand({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId: compliancePageId,
|
||||
compliancePortalId: compliancePageId,
|
||||
darkLogoFile: null,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -29,7 +29,7 @@ export const compliancePageCommitmentsPageQuery = graphql`
|
||||
organization: node(id: $organizationId) {
|
||||
__typename
|
||||
... on Organization {
|
||||
compliancePage: trustCenter @required(action: THROW) {
|
||||
compliancePage: compliancePortal @required(action: THROW) {
|
||||
id
|
||||
canCreateGroup: permission(action: "core:compliance-portal-commitment-group:create")
|
||||
...CompliancePageCommitmentGroupListFragment
|
||||
@@ -53,7 +53,7 @@ export function CompliancePageCommitmentsPage(props: { queryRef: PreloadedQuery<
|
||||
return (
|
||||
<CompliancePageCommitmentGroupList
|
||||
fragmentRef={organization.compliancePage}
|
||||
trustCenterId={organization.compliancePage.id}
|
||||
compliancePortalId={organization.compliancePage.id}
|
||||
canCreate={organization.compliancePage.canCreateGroup}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -70,7 +70,7 @@ const groupSchema = z.object({
|
||||
type GroupFormData = z.infer<typeof groupSchema>;
|
||||
|
||||
export type CompliancePageCommitmentGroupDialogRef = {
|
||||
openCreate: (trustCenterId: string) => void;
|
||||
openCreate: (compliancePortalId: string) => void;
|
||||
openEdit: (group: CompliancePageCommitmentGroupListItemFragment$data) => void;
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ export const CompliancePageCommitmentGroupDialog = forwardRef<
|
||||
const { __ } = useTranslate();
|
||||
const dialogRef = useDialogRef();
|
||||
const [mode, setMode] = useState<"create" | "edit">("create");
|
||||
const [trustCenterId, setTrustCenterId] = useState<string>("");
|
||||
const [compliancePortalId, setCompliancePortalId] = useState<string>("");
|
||||
const [groupId, setGroupId] = useState<string>("");
|
||||
|
||||
const [createGroup, isCreating] = useMutationWithToasts<CompliancePageCommitmentGroupDialogCreateMutation>(
|
||||
@@ -100,7 +100,7 @@ export const CompliancePageCommitmentGroupDialog = forwardRef<
|
||||
useImperativeHandle(ref, () => ({
|
||||
openCreate: (tId: string) => {
|
||||
setMode("create");
|
||||
setTrustCenterId(tId);
|
||||
setCompliancePortalId(tId);
|
||||
reset({ title: "", description: "" });
|
||||
dialogRef.current?.open();
|
||||
},
|
||||
@@ -115,7 +115,7 @@ export const CompliancePageCommitmentGroupDialog = forwardRef<
|
||||
const onSubmit = async (data: GroupFormData) => {
|
||||
if (mode === "create") {
|
||||
await createGroup({
|
||||
variables: { input: { trustCenterId, title: data.title, description: data.description } },
|
||||
variables: { input: { compliancePortalId, title: data.title, description: data.description } },
|
||||
onSuccess: () => {
|
||||
reset();
|
||||
dialogRef.current?.close();
|
||||
|
||||
@@ -33,7 +33,7 @@ import { CompliancePageCommitmentGroupDialog, type CompliancePageCommitmentGroup
|
||||
import { CompliancePageCommitmentGroupListItem } from "./CompliancePageCommitmentGroupListItem";
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageCommitmentGroupListFragment on TrustCenter
|
||||
fragment CompliancePageCommitmentGroupListFragment on CompliancePortal
|
||||
@refetchable(queryName: "CompliancePageCommitmentGroupListRefetchQuery") {
|
||||
commitmentGroups(first: 100, orderBy: { field: RANK, direction: ASC }) {
|
||||
edges {
|
||||
@@ -62,10 +62,10 @@ const updateRankMutation = graphql`
|
||||
|
||||
export function CompliancePageCommitmentGroupList(props: {
|
||||
fragmentRef: CompliancePageCommitmentGroupListFragment$key;
|
||||
trustCenterId: string;
|
||||
compliancePortalId: string;
|
||||
canCreate: boolean;
|
||||
}) {
|
||||
const { fragmentRef, trustCenterId, canCreate } = props;
|
||||
const { fragmentRef, compliancePortalId, canCreate } = props;
|
||||
|
||||
const { __ } = useTranslate();
|
||||
const dialogRef = useRef<CompliancePageCommitmentGroupDialogRef>(null);
|
||||
@@ -106,7 +106,7 @@ export function CompliancePageCommitmentGroupList(props: {
|
||||
</p>
|
||||
</div>
|
||||
{canCreate && (
|
||||
<Button icon={IconPlusLarge} onClick={() => dialogRef.current?.openCreate(trustCenterId)}>
|
||||
<Button icon={IconPlusLarge} onClick={() => dialogRef.current?.openCreate(compliancePortalId)}>
|
||||
{__("Add Group")}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -29,7 +29,7 @@ import { CompliancePageDocumentListItem } from "./CompliancePageDocumentListItem
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageDocumentListFragment on Organization {
|
||||
compliancePage: trustCenter @required(action: THROW) {
|
||||
compliancePage: compliancePortal @required(action: THROW) {
|
||||
...CompliancePageDocumentListItem_compliancePageFragment
|
||||
}
|
||||
documents(first: 100 filter: { status: [ACTIVE] }) {
|
||||
|
||||
@@ -34,7 +34,7 @@ import { useMutation } from "#/lib/relay/useMutation";
|
||||
import { CompliancePageAliasField } from "../../_components/CompliancePageAliasField";
|
||||
|
||||
const compliancePageFragment = graphql`
|
||||
fragment CompliancePageDocumentListItem_compliancePageFragment on TrustCenter {
|
||||
fragment CompliancePageDocumentListItem_compliancePageFragment on CompliancePortal {
|
||||
canUpdate: permission(action: "compliance-portal:portal:update")
|
||||
}
|
||||
`;
|
||||
@@ -45,7 +45,7 @@ const documentFragment = graphql`
|
||||
alias
|
||||
canSetAlias: permission(action: "resourcealias:alias:set")
|
||||
canRemoveAlias: permission(action: "resourcealias:alias:remove")
|
||||
compliancePageVisibility: trustCenterVisibility
|
||||
compliancePageVisibility: compliancePortalVisibility
|
||||
latestPublishedVersion: versions(
|
||||
first: 1
|
||||
orderBy: { field: CREATED_AT, direction: DESC }
|
||||
@@ -107,7 +107,7 @@ export function CompliancePageDocumentListItem(props: {
|
||||
variables: {
|
||||
input: {
|
||||
id: document.id,
|
||||
trustCenterVisibility: typedValue,
|
||||
compliancePortalVisibility: typedValue,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -106,7 +106,7 @@ export function NewCompliancePageDomainDialog(props: PropsWithChildren<{ complia
|
||||
await createCustomDomain({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId: compliancePageId,
|
||||
compliancePortalId: compliancePageId,
|
||||
domain: normalizedDomain,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -33,10 +33,10 @@ import { EditCompliancePageFileDialog } from "./EditCompliancePageFileDialog";
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageFileListFragment on Organization {
|
||||
compliancePage: trustCenter @required(action: THROW) {
|
||||
compliancePage: compliancePortal @required(action: THROW) {
|
||||
...CompliancePageFileListItem_compliancePageFragment
|
||||
}
|
||||
compliancePageFiles: trustCenterFiles(first: 100)
|
||||
compliancePageFiles: compliancePortalFiles(first: 100)
|
||||
@connection(key: "CompliancePageFileList_compliancePageFiles") {
|
||||
__id
|
||||
edges {
|
||||
|
||||
@@ -33,13 +33,13 @@ import { useMutation } from "#/lib/relay/useMutation";
|
||||
import { CompliancePageAliasField } from "../../_components/CompliancePageAliasField";
|
||||
|
||||
const compliancePageFragment = graphql`
|
||||
fragment CompliancePageFileListItem_compliancePageFragment on TrustCenter {
|
||||
fragment CompliancePageFileListItem_compliancePageFragment on CompliancePortal {
|
||||
canUpdate: permission(action: "compliance-portal:portal:update")
|
||||
}
|
||||
`;
|
||||
|
||||
const fileFragment = graphql`
|
||||
fragment CompliancePageFileListItem_fileFragment on TrustCenterFile {
|
||||
fragment CompliancePageFileListItem_fileFragment on CompliancePortalFile {
|
||||
id
|
||||
name
|
||||
alias
|
||||
@@ -49,7 +49,7 @@ const fileFragment = graphql`
|
||||
file {
|
||||
downloadUrl
|
||||
}
|
||||
compliancePageVisibility: trustCenterVisibility
|
||||
compliancePageVisibility: compliancePortalVisibility
|
||||
createdAt
|
||||
canUpdate: permission(action: "compliance-portal:portal-file:update")
|
||||
canDelete: permission(action: "compliance-portal:portal-file:delete")
|
||||
@@ -57,9 +57,9 @@ const fileFragment = graphql`
|
||||
`;
|
||||
|
||||
const updateCompliancePageFileMutation = graphql`
|
||||
mutation CompliancePageFileListItemMutation($input: UpdateTrustCenterFileInput!) {
|
||||
updateTrustCenterFile(input: $input) {
|
||||
trustCenterFile {
|
||||
mutation CompliancePageFileListItemMutation($input: UpdateCompliancePortalFileInput!) {
|
||||
updateCompliancePortalFile(input: $input) {
|
||||
compliancePortalFile {
|
||||
...CompliancePageFileListItem_fileFragment
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ export function CompliancePageFileListItem(props: {
|
||||
variables: {
|
||||
input: {
|
||||
id: file.id,
|
||||
trustCenterVisibility: typedValue,
|
||||
compliancePortalVisibility: typedValue,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -28,11 +28,11 @@ import { useMutation } from "#/lib/relay/useMutation";
|
||||
|
||||
const deleteCompliancePageFileMutation = graphql`
|
||||
mutation DeleteCompliancePageFileDialogMutation(
|
||||
$input: DeleteTrustCenterFileInput!
|
||||
$input: DeleteCompliancePortalFileInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
deleteTrustCenterFile(input: $input) {
|
||||
deletedTrustCenterFileId @deleteEdge(connections: $connections)
|
||||
deleteCompliancePortalFile(input: $input) {
|
||||
deletedCompliancePortalFileId @deleteEdge(connections: $connections)
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -29,9 +29,9 @@ import { useFormWithSchema } from "#/hooks/useFormWithSchema";
|
||||
import { useMutation } from "#/lib/relay/useMutation";
|
||||
|
||||
const updateCompliancePageFileMutation = graphql`
|
||||
mutation EditCompliancePageFileDialogMutation($input: UpdateTrustCenterFileInput!) {
|
||||
updateTrustCenterFile(input: $input) {
|
||||
trustCenterFile {
|
||||
mutation EditCompliancePageFileDialogMutation($input: UpdateCompliancePortalFileInput!) {
|
||||
updateCompliancePortalFile(input: $input) {
|
||||
compliancePortalFile {
|
||||
...CompliancePageFileListItem_fileFragment
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,11 +49,11 @@ const acceptedFileTypes = {
|
||||
|
||||
const createCompliancePageFileMutation = graphql`
|
||||
mutation NewCompliancePageFileDialog_createMutation(
|
||||
$input: CreateTrustCenterFileInput!
|
||||
$input: CreateCompliancePortalFileInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
createTrustCenterFile(input: $input) {
|
||||
trustCenterFileEdge @prependEdge(connections: $connections) {
|
||||
createCompliancePortalFile(input: $input) {
|
||||
compliancePortalFileEdge @prependEdge(connections: $connections) {
|
||||
node {
|
||||
...CompliancePageFileListItem_fileFragment
|
||||
}
|
||||
@@ -122,7 +122,7 @@ export function NewCompliancePageFileDialog(props: {
|
||||
organizationId,
|
||||
name: data.name,
|
||||
category: data.category,
|
||||
trustCenterVisibility: data.compliancePageVisibility,
|
||||
compliancePortalVisibility: data.compliancePageVisibility,
|
||||
file: null,
|
||||
},
|
||||
connections: connectionId ? [connectionId] : [],
|
||||
|
||||
@@ -38,7 +38,7 @@ export const compliancePageMailingListPageQuery = graphql`
|
||||
organization: node(id: $organizationId) {
|
||||
__typename
|
||||
... on Organization {
|
||||
compliancePage: trustCenter @required(action: THROW) {
|
||||
compliancePage: compliancePortal @required(action: THROW) {
|
||||
id
|
||||
mailingList {
|
||||
id
|
||||
|
||||
@@ -40,7 +40,7 @@ const deleteMutation = graphql`
|
||||
`;
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageMailingListFragment on TrustCenter
|
||||
fragment CompliancePageMailingListFragment on CompliancePortal
|
||||
@argumentDefinitions(
|
||||
first: { type: Int, defaultValue: 20 }
|
||||
after: { type: CursorKey, defaultValue: null }
|
||||
|
||||
@@ -32,7 +32,7 @@ export const compliancePageOverviewPageQuery = graphql`
|
||||
query CompliancePageOverviewPageQuery($organizationId: ID!) {
|
||||
organization: node(id: $organizationId) {
|
||||
... on Organization {
|
||||
compliancePage: trustCenter {
|
||||
compliancePage: compliancePortal {
|
||||
canGetNDA: permission(action: "compliance-portal:portal:get-nda")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import type { CompliancePageFrameworkList_compliancePageRefetchQuery } from "#/_
|
||||
import { CompliancePageFrameworkListItem } from "./CompliancePageFrameworkListItem";
|
||||
|
||||
const compliancePageFragment = graphql`
|
||||
fragment CompliancePageFrameworkList_compliancePageFragment on TrustCenter
|
||||
fragment CompliancePageFrameworkList_compliancePageFragment on CompliancePortal
|
||||
@refetchable(queryName: "CompliancePageFrameworkList_compliancePageRefetchQuery")
|
||||
@argumentDefinitions(
|
||||
first: { type: Int, defaultValue: 100 }
|
||||
|
||||
@@ -42,7 +42,7 @@ export const compliancePageFrameworkListItemFragment = graphql`
|
||||
`;
|
||||
|
||||
const compliancePageFragment = graphql`
|
||||
fragment CompliancePageFrameworkListItem_compliancePage on TrustCenter {
|
||||
fragment CompliancePageFrameworkListItem_compliancePage on CompliancePortal {
|
||||
id
|
||||
canUpdate: permission(action: "compliance-portal:portal:update")
|
||||
}
|
||||
@@ -86,7 +86,7 @@ export function CompliancePageFrameworkListItem(props: CompliancePageFrameworkLi
|
||||
);
|
||||
const compliancePage = useFragment(compliancePageFragment, compliancePageKey);
|
||||
const canUpdate = compliancePage.canUpdate;
|
||||
const trustCenterId = compliancePage.id;
|
||||
const compliancePortalId = compliancePage.id;
|
||||
const { id, visibility, framework } = complianceFramework;
|
||||
|
||||
const serverPublic = visibility === "PUBLIC";
|
||||
@@ -137,7 +137,7 @@ export function CompliancePageFrameworkListItem(props: CompliancePageFrameworkLi
|
||||
await createComplianceFramework({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId,
|
||||
compliancePortalId,
|
||||
frameworkId: framework.id,
|
||||
},
|
||||
},
|
||||
@@ -161,7 +161,7 @@ export function CompliancePageFrameworkListItem(props: CompliancePageFrameworkLi
|
||||
id,
|
||||
onRefetch,
|
||||
createComplianceFramework,
|
||||
trustCenterId,
|
||||
compliancePortalId,
|
||||
framework.id,
|
||||
]);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import { CompliancePageFrameworkList } from "./CompliancePageFrameworkList";
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageFrameworksSectionFragment on Organization {
|
||||
compliancePage: trustCenter {
|
||||
compliancePage: compliancePortal {
|
||||
...CompliancePageFrameworkList_compliancePageFragment
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import { graphql } from "relay-runtime";
|
||||
import type { CompliancePageNDACard_compliancePage$key } from "#/__generated__/core/CompliancePageNDACard_compliancePage.graphql";
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageNDACard_compliancePage on TrustCenter {
|
||||
fragment CompliancePageNDACard_compliancePage on CompliancePortal {
|
||||
nda {
|
||||
fileName
|
||||
downloadUrl
|
||||
|
||||
@@ -31,7 +31,7 @@ import { CompliancePageNDACard } from "./CompliancePageNDACard";
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageNDASectionFragment on Organization {
|
||||
compliancePage: trustCenter {
|
||||
compliancePage: compliancePortal {
|
||||
id
|
||||
nda {
|
||||
fileName
|
||||
@@ -72,7 +72,7 @@ export function CompliancePageNDASection(props: CompliancePageNDASectionProps) {
|
||||
await uploadNDA({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId: organization.compliancePage.id,
|
||||
compliancePortalId: organization.compliancePage.id,
|
||||
fileName: file.name,
|
||||
file: null,
|
||||
},
|
||||
@@ -111,8 +111,8 @@ export function CompliancePageNDASection(props: CompliancePageNDASectionProps) {
|
||||
};
|
||||
|
||||
const handleNDADelete = () => {
|
||||
const trustCenterId = organization.compliancePage?.id;
|
||||
if (!trustCenterId) {
|
||||
const compliancePortalId = organization.compliancePage?.id;
|
||||
if (!compliancePortalId) {
|
||||
toast({
|
||||
title: __("Error"),
|
||||
description: __("Compliance page not found"),
|
||||
@@ -122,7 +122,7 @@ export function CompliancePageNDASection(props: CompliancePageNDASectionProps) {
|
||||
}
|
||||
|
||||
confirm(
|
||||
() => deleteNDA({ variables: { input: { trustCenterId } } }),
|
||||
() => deleteNDA({ variables: { input: { compliancePortalId } } }),
|
||||
{
|
||||
title: __("Delete NDA"),
|
||||
message: __("Are you sure you want to delete the NDA file? This action cannot be undone."),
|
||||
|
||||
@@ -28,7 +28,7 @@ import { useUpdateCompliancePageMutation } from "#/hooks/graph/CompliancePageGra
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageStatusSectionFragment on Organization {
|
||||
compliancePage: trustCenter {
|
||||
compliancePage: compliancePortal {
|
||||
id
|
||||
active
|
||||
searchEngineIndexing
|
||||
@@ -65,7 +65,7 @@ export function CompliancePageStatusSection(props: {
|
||||
await updateCompliancePage({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId: organization.compliancePage.id,
|
||||
compliancePortalId: organization.compliancePage.id,
|
||||
active,
|
||||
},
|
||||
},
|
||||
@@ -85,7 +85,7 @@ export function CompliancePageStatusSection(props: {
|
||||
await updateCompliancePage({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId: organization.compliancePage.id,
|
||||
compliancePortalId: organization.compliancePage.id,
|
||||
searchEngineIndexing: indexable ? "INDEXABLE" : "NOT_INDEXABLE",
|
||||
},
|
||||
},
|
||||
|
||||
@@ -34,7 +34,7 @@ export const compliancePageReferencesPageQuery = graphql`
|
||||
organization: node(id: $organizationId) {
|
||||
__typename
|
||||
... on Organization {
|
||||
compliancePage: trustCenter @required(action: THROW) {
|
||||
compliancePage: compliancePortal @required(action: THROW) {
|
||||
id
|
||||
canCreateReference: permission(action: "compliance-portal:portal-reference:create")
|
||||
...CompliancePageReferenceListFragment
|
||||
|
||||
@@ -32,12 +32,12 @@ import { useUpdateCompliancePageReferenceRankMutation } from "#/pages/organizati
|
||||
import { CompliancePageReferenceListItem } from "./CompliancePageReferenceListItem";
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageReferenceListFragment on TrustCenter
|
||||
fragment CompliancePageReferenceListFragment on CompliancePortal
|
||||
@refetchable(queryName: "CompliancePageReferenceListQuery")
|
||||
@argumentDefinitions (
|
||||
first: { type: Int defaultValue: 100 }
|
||||
after: { type: CursorKey defaultValue: null }
|
||||
order: { type: TrustCenterReferenceOrder, defaultValue: { field: RANK, direction: ASC } }
|
||||
order: { type: CompliancePortalReferenceOrder, defaultValue: { field: RANK, direction: ASC } }
|
||||
) {
|
||||
references(first: $first, after: $after, orderBy: $order)
|
||||
@connection(key: "CompliancePageReferenceList_references", filters: ["orderBy"]) {
|
||||
|
||||
@@ -28,7 +28,7 @@ import type { CompliancePageReferenceListItemFragment$data, CompliancePageRefere
|
||||
import { DeleteCompliancePageReferenceDialog } from "#/components/compliancePage/DeleteCompliancePageReferenceDialog";
|
||||
|
||||
const fragment = graphql`
|
||||
fragment CompliancePageReferenceListItemFragment on TrustCenterReference {
|
||||
fragment CompliancePageReferenceListItemFragment on CompliancePortalReference {
|
||||
id
|
||||
logo {
|
||||
downloadUrl
|
||||
|
||||
@@ -33,7 +33,7 @@ const thirdPartyFragment = graphql`
|
||||
id
|
||||
category
|
||||
name
|
||||
showOnCompliancePage: showOnTrustCenter
|
||||
showOnCompliancePage: showOnCompliancePortal
|
||||
canUpdate: permission(action: "core:thirdParty:update")
|
||||
}
|
||||
`;
|
||||
@@ -43,7 +43,7 @@ const updateThirdPartyVisibilityMutation = graphql`
|
||||
updateThirdParty(input: $input) {
|
||||
thirdParty {
|
||||
id
|
||||
showOnTrustCenter
|
||||
showOnCompliancePortal
|
||||
...CompliancePageThirdPartyListItem_thirdPartyFragment
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ export function CompliancePageThirdPartyListItem(props: {
|
||||
variables: {
|
||||
input: {
|
||||
id: thirdParty.id,
|
||||
showOnTrustCenter: !thirdParty.showOnCompliancePage,
|
||||
showOnCompliancePortal: !thirdParty.showOnCompliancePage,
|
||||
},
|
||||
},
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user