Rename Vendor to Subprocessor in trust API surface
Rename Vendor → Subprocessor, VendorConnection → SubprocessorConnection, and VendorEdge → SubprocessorEdge across the GraphQL schema, Go resolvers, and React frontend components. Internal coredata types remain unchanged. User-facing labels in console app updated to reflect terminology change. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -78,7 +78,7 @@ export function CompliancePageLayout(props: { queryRef: PreloadedQuery<Complianc
|
|||||||
</TabLink>
|
</TabLink>
|
||||||
<TabLink to={`/organizations/${organizationId}/compliance-page/vendors`}>
|
<TabLink to={`/organizations/${organizationId}/compliance-page/vendors`}>
|
||||||
<IconStore className="size-4" />
|
<IconStore className="size-4" />
|
||||||
{__("Vendors")}
|
{__("Subprocessors")}
|
||||||
</TabLink>
|
</TabLink>
|
||||||
<TabLink to={`/organizations/${organizationId}/compliance-page/access`}>
|
<TabLink to={`/organizations/${organizationId}/compliance-page/access`}>
|
||||||
<IconPeopleAdd className="size-4" />
|
<IconPeopleAdd className="size-4" />
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ export function CompliancePageVendorsPage(props: {
|
|||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h3 className="text-base font-medium">{__("Vendors")}</h3>
|
<h3 className="text-base font-medium">{__("Subprocessors")}</h3>
|
||||||
<p className="text-sm text-txt-tertiary">
|
<p className="text-sm text-txt-tertiary">
|
||||||
{__("Manage vendor assessments and third-party risk information")}
|
{__("Manage subprocessor assessments and third-party risk information")}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export function CompliancePageVendorList(props: { fragmentRef: CompliancePageVen
|
|||||||
{vendors.edges.length === 0 && (
|
{vendors.edges.length === 0 && (
|
||||||
<Tr>
|
<Tr>
|
||||||
<Td colSpan={4} className="text-center text-txt-secondary">
|
<Td colSpan={4} className="text-center text-txt-secondary">
|
||||||
{__("No vendors available")}
|
{__("No subprocessors available")}
|
||||||
</Td>
|
</Td>
|
||||||
</Tr>
|
</Tr>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ export function CompliancePageVendorListItem(props: {
|
|||||||
>(
|
>(
|
||||||
updateVendorVisibilityMutation,
|
updateVendorVisibilityMutation,
|
||||||
{
|
{
|
||||||
successMessage: __("Vendor visibility updated successfully."),
|
successMessage: __("Subprocessor visibility updated successfully."),
|
||||||
errorMessage: __("Failed to update vendor visibility"),
|
errorMessage: __("Failed to update subprocessor visibility"),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import { IconPin } from "@probo/ui";
|
|||||||
import { useFragment } from "react-relay";
|
import { useFragment } from "react-relay";
|
||||||
import { graphql } from "relay-runtime";
|
import { graphql } from "relay-runtime";
|
||||||
|
|
||||||
import type { VendorRowFragment$key } from "./__generated__/VendorRowFragment.graphql";
|
import type { SubprocessorRowFragment$key } from "./__generated__/SubprocessorRowFragment.graphql";
|
||||||
|
|
||||||
const vendorRowFragment = graphql`
|
const subprocessorRowFragment = graphql`
|
||||||
fragment VendorRowFragment on Vendor {
|
fragment SubprocessorRowFragment on Subprocessor {
|
||||||
name
|
name
|
||||||
description
|
description
|
||||||
websiteUrl
|
websiteUrl
|
||||||
@@ -15,9 +15,9 @@ const vendorRowFragment = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export function VendorRow(props: { vendor: VendorRowFragment$key; hasAnyCountries?: boolean }) {
|
export function SubprocessorRow(props: { subprocessor: SubprocessorRowFragment$key; hasAnyCountries?: boolean }) {
|
||||||
const vendor = useFragment(vendorRowFragment, props.vendor);
|
const subprocessor = useFragment(subprocessorRowFragment, props.subprocessor);
|
||||||
const logo = faviconUrl(vendor.websiteUrl);
|
const logo = faviconUrl(subprocessor.websiteUrl);
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -34,16 +34,16 @@ export function VendorRow(props: { vendor: VendorRowFragment$key; hasAnyCountrie
|
|||||||
<div className="size-8 flex-none rounded-lg" />
|
<div className="size-8 flex-none rounded-lg" />
|
||||||
)}
|
)}
|
||||||
<div className="flex flex-col gap-2 flex-1">
|
<div className="flex flex-col gap-2 flex-1">
|
||||||
<span className="text-sm">{vendor.name}</span>
|
<span className="text-sm">{subprocessor.name}</span>
|
||||||
<div className="text-xs text-txt-secondary w-full">{vendor.description}</div>
|
<div className="text-xs text-txt-secondary w-full">{subprocessor.description}</div>
|
||||||
{props.hasAnyCountries
|
{props.hasAnyCountries
|
||||||
&& (
|
&& (
|
||||||
<div className="text-xs flex gap-1 items-start text-txt-quaternary">
|
<div className="text-xs flex gap-1 items-start text-txt-quaternary">
|
||||||
{vendor.countries.length > 0 && (
|
{subprocessor.countries.length > 0 && (
|
||||||
<>
|
<>
|
||||||
<IconPin size={16} className="flex-none" />
|
<IconPin size={16} className="flex-none" />
|
||||||
<span>
|
<span>
|
||||||
{vendor.countries
|
{subprocessor.countries
|
||||||
.map(country => getCountryName(__, country))
|
.map(country => getCountryName(__, country))
|
||||||
.join(", ")}
|
.join(", ")}
|
||||||
</span>
|
</span>
|
||||||
@@ -37,7 +37,7 @@ export function MainLayout(props: Props) {
|
|||||||
<Tabs className="mb-8">
|
<Tabs className="mb-8">
|
||||||
<TabLink to="/overview">{__("Overview")}</TabLink>
|
<TabLink to="/overview">{__("Overview")}</TabLink>
|
||||||
<TabLink to="/documents">{__("Documents")}</TabLink>
|
<TabLink to="/documents">{__("Documents")}</TabLink>
|
||||||
{trustCenter.vendorInfo.totalCount > 0
|
{trustCenter.subprocessorInfo.totalCount > 0
|
||||||
&& <TabLink to="/subprocessors">{__("Subprocessors")}</TabLink>}
|
&& <TabLink to="/subprocessors">{__("Subprocessors")}</TabLink>}
|
||||||
<TabLink to="/updates">{__("Updates")}</TabLink>
|
<TabLink to="/updates">{__("Updates")}</TabLink>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ import { AuditRow } from "#/components/AuditRow";
|
|||||||
import { DocumentRow } from "#/components/DocumentRow";
|
import { DocumentRow } from "#/components/DocumentRow";
|
||||||
import { RowHeader } from "#/components/RowHeader";
|
import { RowHeader } from "#/components/RowHeader";
|
||||||
import { Rows } from "#/components/Rows";
|
import { Rows } from "#/components/Rows";
|
||||||
|
import { SubprocessorRow } from "#/components/SubprocessorRow";
|
||||||
import { TrustCenterFileRow } from "#/components/TrustCenterFileRow";
|
import { TrustCenterFileRow } from "#/components/TrustCenterFileRow";
|
||||||
import { VendorRow } from "#/components/VendorRow";
|
|
||||||
import { documentTypeLabel } from "#/helpers/documents";
|
import { documentTypeLabel } from "#/helpers/documents";
|
||||||
import type { TrustGraphCurrentQuery$data } from "#/queries/__generated__/TrustGraphCurrentQuery.graphql";
|
import type { TrustGraphCurrentQuery$data } from "#/queries/__generated__/TrustGraphCurrentQuery.graphql";
|
||||||
|
|
||||||
@@ -37,12 +37,12 @@ const overviewFragment = graphql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
vendors(first: 3) {
|
subprocessors(first: 3) {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
countries
|
countries
|
||||||
...VendorRowFragment
|
...SubprocessorRowFragment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ export function OverviewPage() {
|
|||||||
/>
|
/>
|
||||||
<Subprocessors
|
<Subprocessors
|
||||||
organizationName={trustCenter.organization.name}
|
organizationName={trustCenter.organization.name}
|
||||||
vendors={fragment.vendors.edges}
|
subprocessors={fragment.subprocessors.edges}
|
||||||
url={getTrustCenterUrl("subprocessors")}
|
url={getTrustCenterUrl("subprocessors")}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -163,22 +163,22 @@ function Documents({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Subprocessors({
|
function Subprocessors({
|
||||||
vendors,
|
subprocessors,
|
||||||
url,
|
url,
|
||||||
organizationName,
|
organizationName,
|
||||||
}: {
|
}: {
|
||||||
vendors: OverviewPageFragment$data["vendors"]["edges"];
|
subprocessors: OverviewPageFragment$data["subprocessors"]["edges"];
|
||||||
url: string;
|
url: string;
|
||||||
organizationName: string;
|
organizationName: string;
|
||||||
}) {
|
}) {
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
if (vendors.length === 0) {
|
if (subprocessors.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasAnyCountries = vendors.some((vendor) => {
|
const hasAnyCountries = subprocessors.some((subprocessor) => {
|
||||||
const vendorData = vendor.node;
|
const subprocessorData = subprocessor.node;
|
||||||
return vendorData.countries && vendorData.countries.length > 0;
|
return subprocessorData.countries && subprocessorData.countries.length > 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -191,10 +191,10 @@ function Subprocessors({
|
|||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<Rows className="mb-8 *:py-5">
|
<Rows className="mb-8 *:py-5">
|
||||||
{vendors.map(vendor => (
|
{subprocessors.map(subprocessor => (
|
||||||
<VendorRow
|
<SubprocessorRow
|
||||||
key={vendor.node.id}
|
key={subprocessor.node.id}
|
||||||
vendor={vendor.node}
|
subprocessor={subprocessor.node}
|
||||||
hasAnyCountries={hasAnyCountries}
|
hasAnyCountries={hasAnyCountries}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -3,21 +3,21 @@ import { useTranslate } from "@probo/i18n";
|
|||||||
import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
|
import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
|
||||||
|
|
||||||
import { Rows } from "#/components/Rows";
|
import { Rows } from "#/components/Rows";
|
||||||
import { VendorRow } from "#/components/VendorRow";
|
import { SubprocessorRow } from "#/components/SubprocessorRow";
|
||||||
import type { TrustGraphCurrentVendorsQuery } from "#/queries/__generated__/TrustGraphCurrentVendorsQuery.graphql";
|
import type { TrustGraphCurrentSubprocessorsQuery } from "#/queries/__generated__/TrustGraphCurrentSubprocessorsQuery.graphql";
|
||||||
import { currentTrustVendorsQuery } from "#/queries/TrustGraph";
|
import { currentTrustSubprocessorsQuery } from "#/queries/TrustGraph";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
queryRef: PreloadedQuery<TrustGraphCurrentVendorsQuery>;
|
queryRef: PreloadedQuery<TrustGraphCurrentSubprocessorsQuery>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function SubprocessorsPage({ queryRef }: Props) {
|
export function SubprocessorsPage({ queryRef }: Props) {
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const data = usePreloadedQuery(currentTrustVendorsQuery, queryRef);
|
const data = usePreloadedQuery(currentTrustSubprocessorsQuery, queryRef);
|
||||||
const vendors
|
const subprocessors
|
||||||
= data.currentTrustCenter?.vendors.edges.map(edge => edge.node) ?? [];
|
= data.currentTrustCenter?.subprocessors.edges.map(edge => edge.node) ?? [];
|
||||||
|
|
||||||
const hasAnyCountries = vendors.some(vendor => vendor.countries.length > 0);
|
const hasAnyCountries = subprocessors.some(subprocessor => subprocessor.countries.length > 0);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -29,8 +29,8 @@ export function SubprocessorsPage({ queryRef }: Props) {
|
|||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<Rows>
|
<Rows>
|
||||||
{vendors.map(vendor => (
|
{subprocessors.map(subprocessor => (
|
||||||
<VendorRow key={vendor.id} vendor={vendor} hasAnyCountries={hasAnyCountries} />
|
<SubprocessorRow key={subprocessor.id} subprocessor={subprocessor} hasAnyCountries={hasAnyCountries} />
|
||||||
))}
|
))}
|
||||||
</Rows>
|
</Rows>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export const currentTrustGraphQuery = graphql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
...OverviewPageFragment
|
...OverviewPageFragment
|
||||||
vendorInfo: vendors(first: 0) {
|
subprocessorInfo: subprocessors(first: 0) {
|
||||||
totalCount
|
totalCount
|
||||||
}
|
}
|
||||||
audits(first: 50) {
|
audits(first: 50) {
|
||||||
@@ -97,19 +97,19 @@ export const currentTrustDocumentsQuery = graphql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const currentTrustVendorsQuery = graphql`
|
export const currentTrustSubprocessorsQuery = graphql`
|
||||||
query TrustGraphCurrentVendorsQuery {
|
query TrustGraphCurrentSubprocessorsQuery {
|
||||||
currentTrustCenter {
|
currentTrustCenter {
|
||||||
id
|
id
|
||||||
organization {
|
organization {
|
||||||
name
|
name
|
||||||
}
|
}
|
||||||
vendors(first: 50) {
|
subprocessors(first: 50) {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
countries
|
countries
|
||||||
...VendorRowFragment
|
...SubprocessorRowFragment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { currentTrustUpdatesQuery, UpdatesPage } from "#/pages/UpdatesPage";
|
|||||||
import {
|
import {
|
||||||
currentTrustDocumentsQuery,
|
currentTrustDocumentsQuery,
|
||||||
currentTrustGraphQuery,
|
currentTrustGraphQuery,
|
||||||
currentTrustVendorsQuery,
|
currentTrustSubprocessorsQuery,
|
||||||
} from "#/queries/TrustGraph";
|
} from "#/queries/TrustGraph";
|
||||||
|
|
||||||
import { DocumentPageErrorBoundary } from "./components/DocumentPageErrorBoundary";
|
import { DocumentPageErrorBoundary } from "./components/DocumentPageErrorBoundary";
|
||||||
@@ -112,7 +112,7 @@ const routes = [
|
|||||||
{
|
{
|
||||||
path: "",
|
path: "",
|
||||||
loader: loaderFromQueryLoader(() =>
|
loader: loaderFromQueryLoader(() =>
|
||||||
loadQuery(consoleEnvironment, currentTrustVendorsQuery, {}),
|
loadQuery(consoleEnvironment, currentTrustSubprocessorsQuery, {}),
|
||||||
),
|
),
|
||||||
Fallback: TabSkeleton,
|
Fallback: TabSkeleton,
|
||||||
Component: withQueryRef(SubprocessorsPage),
|
Component: withQueryRef(SubprocessorsPage),
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ enum CountryCode
|
|||||||
ZW @goEnum(value: "go.probo.inc/probo/pkg/coredata.CountryCodeZW")
|
ZW @goEnum(value: "go.probo.inc/probo/pkg/coredata.CountryCodeZW")
|
||||||
}
|
}
|
||||||
|
|
||||||
enum VendorCategory
|
enum SubprocessorCategory
|
||||||
@goModel(model: "go.probo.inc/probo/pkg/coredata.VendorCategory") {
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.VendorCategory") {
|
||||||
ANALYTICS
|
ANALYTICS
|
||||||
@goEnum(value: "go.probo.inc/probo/pkg/coredata.VendorCategoryAnalytics")
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.VendorCategoryAnalytics")
|
||||||
@@ -480,28 +480,28 @@ enum VendorCategory
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
type Vendor implements Node @nda {
|
type Subprocessor implements Node @nda {
|
||||||
id: ID!
|
id: ID!
|
||||||
name: String!
|
name: String!
|
||||||
description: String
|
description: String
|
||||||
category: VendorCategory!
|
category: SubprocessorCategory!
|
||||||
websiteUrl: String
|
websiteUrl: String
|
||||||
privacyPolicyUrl: String
|
privacyPolicyUrl: String
|
||||||
countries: [CountryCode!]!
|
countries: [CountryCode!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
type VendorConnection
|
type SubprocessorConnection
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/server/api/trust/v1/types.VendorConnection"
|
model: "go.probo.inc/probo/pkg/server/api/trust/v1/types.SubprocessorConnection"
|
||||||
) @nda {
|
) @nda {
|
||||||
edges: [VendorEdge!]!
|
edges: [SubprocessorEdge!]!
|
||||||
pageInfo: PageInfo!
|
pageInfo: PageInfo!
|
||||||
totalCount: Int! @goField(forceResolver: true)
|
totalCount: Int! @goField(forceResolver: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
type VendorEdge @nda {
|
type SubprocessorEdge @nda {
|
||||||
cursor: CursorKey!
|
cursor: CursorKey!
|
||||||
node: Vendor!
|
node: Subprocessor!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterReference implements Node @nda {
|
type TrustCenterReference implements Node @nda {
|
||||||
@@ -572,12 +572,12 @@ type TrustCenter implements Node {
|
|||||||
before: CursorKey
|
before: CursorKey
|
||||||
): AuditConnection! @goField(forceResolver: true)
|
): AuditConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
vendors(
|
subprocessors(
|
||||||
first: Int
|
first: Int
|
||||||
after: CursorKey
|
after: CursorKey
|
||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
): VendorConnection! @goField(forceResolver: true)
|
): SubprocessorConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
references(
|
references(
|
||||||
first: Int
|
first: Int
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
VendorConnection struct {
|
SubprocessorConnection struct {
|
||||||
TotalCount int
|
TotalCount int
|
||||||
Edges []*VendorEdge
|
Edges []*SubprocessorEdge
|
||||||
PageInfo PageInfo
|
PageInfo PageInfo
|
||||||
|
|
||||||
Resolver any
|
Resolver any
|
||||||
@@ -31,17 +31,17 @@ type (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewVendorConnection(
|
func NewSubprocessorConnection(
|
||||||
p *page.Page[*coredata.Vendor, coredata.VendorOrderField],
|
p *page.Page[*coredata.Vendor, coredata.VendorOrderField],
|
||||||
parentType any,
|
parentType any,
|
||||||
parentID gid.GID,
|
parentID gid.GID,
|
||||||
) *VendorConnection {
|
) *SubprocessorConnection {
|
||||||
edges := make([]*VendorEdge, len(p.Data))
|
edges := make([]*SubprocessorEdge, len(p.Data))
|
||||||
for i, vendor := range p.Data {
|
for i, vendor := range p.Data {
|
||||||
edges[i] = NewVendorEdge(vendor, p.Cursor.OrderBy.Field)
|
edges[i] = NewSubprocessorEdge(vendor, p.Cursor.OrderBy.Field)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &VendorConnection{
|
return &SubprocessorConnection{
|
||||||
Edges: edges,
|
Edges: edges,
|
||||||
PageInfo: *NewPageInfo(p),
|
PageInfo: *NewPageInfo(p),
|
||||||
|
|
||||||
@@ -50,8 +50,8 @@ func NewVendorConnection(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewVendor(v *coredata.Vendor) *Vendor {
|
func NewSubprocessor(v *coredata.Vendor) *Subprocessor {
|
||||||
return &Vendor{
|
return &Subprocessor{
|
||||||
ID: v.ID,
|
ID: v.ID,
|
||||||
Name: v.Name,
|
Name: v.Name,
|
||||||
Description: v.Description,
|
Description: v.Description,
|
||||||
@@ -62,9 +62,9 @@ func NewVendor(v *coredata.Vendor) *Vendor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewVendorEdge(v *coredata.Vendor, orderField coredata.VendorOrderField) *VendorEdge {
|
func NewSubprocessorEdge(v *coredata.Vendor, orderField coredata.VendorOrderField) *SubprocessorEdge {
|
||||||
return &VendorEdge{
|
return &SubprocessorEdge{
|
||||||
Node: NewVendor(v),
|
Node: NewSubprocessor(v),
|
||||||
Cursor: v.CursorKey(orderField),
|
Cursor: v.CursorKey(orderField),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -932,7 +932,7 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
|
|||||||
r.logger.ErrorCtx(ctx, "cannot get vendor", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get vendor", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
return types.NewVendor(vendor), nil
|
return types.NewSubprocessor(vendor), nil
|
||||||
|
|
||||||
case coredata.TrustCenterEntityType:
|
case coredata.TrustCenterEntityType:
|
||||||
trustCenter, err := trustService.TrustCenters.Get(ctx, id)
|
trustCenter, err := trustService.TrustCenters.Get(ctx, id)
|
||||||
@@ -1071,6 +1071,24 @@ func (r *reportResolver) Access(ctx context.Context, obj *types.Report) (*types.
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TotalCount is the resolver for the totalCount field.
|
||||||
|
func (r *subprocessorConnectionResolver) TotalCount(ctx context.Context, obj *types.SubprocessorConnection) (int, error) {
|
||||||
|
trustService := r.TrustService(ctx, obj.ParentID.TenantID())
|
||||||
|
|
||||||
|
switch obj.Resolver.(type) {
|
||||||
|
case *trustCenterResolver:
|
||||||
|
count, err := trustService.Vendors.CountForTrustCenterId(ctx, obj.ParentID)
|
||||||
|
if err != nil {
|
||||||
|
r.logger.ErrorCtx(ctx, "cannot count subprocessors", log.Error(err))
|
||||||
|
return 0, gqlutils.Internal(ctx)
|
||||||
|
}
|
||||||
|
return count, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
r.logger.ErrorCtx(ctx, "not implemented: TotalCount for parent type")
|
||||||
|
return 0, gqlutils.Internal(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
// LogoFileURL is the resolver for the logoFileUrl field.
|
// LogoFileURL is the resolver for the logoFileUrl field.
|
||||||
func (r *trustCenterResolver) LogoFileURL(ctx context.Context, obj *types.TrustCenter) (*string, error) {
|
func (r *trustCenterResolver) LogoFileURL(ctx context.Context, obj *types.TrustCenter) (*string, error) {
|
||||||
trustService := r.TrustService(ctx, obj.ID.TenantID())
|
trustService := r.TrustService(ctx, obj.ID.TenantID())
|
||||||
@@ -1174,8 +1192,8 @@ func (r *trustCenterResolver) Audits(ctx context.Context, obj *types.TrustCenter
|
|||||||
return types.NewAuditConnection(auditPage), nil
|
return types.NewAuditConnection(auditPage), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vendors is the resolver for the vendors field.
|
// Subprocessors is the resolver for the subprocessors field.
|
||||||
func (r *trustCenterResolver) Vendors(ctx context.Context, obj *types.TrustCenter, first *int, after *page.CursorKey, last *int, before *page.CursorKey) (*types.VendorConnection, error) {
|
func (r *trustCenterResolver) Subprocessors(ctx context.Context, obj *types.TrustCenter, first *int, after *page.CursorKey, last *int, before *page.CursorKey) (*types.SubprocessorConnection, error) {
|
||||||
trustService := r.TrustService(ctx, obj.ID.TenantID())
|
trustService := r.TrustService(ctx, obj.ID.TenantID())
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.VendorOrderField]{
|
pageOrderBy := page.OrderBy[coredata.VendorOrderField]{
|
||||||
@@ -1186,11 +1204,11 @@ func (r *trustCenterResolver) Vendors(ctx context.Context, obj *types.TrustCente
|
|||||||
|
|
||||||
vendorPage, err := trustService.Vendors.ListForOrganizationId(ctx, obj.Organization.ID, cursor)
|
vendorPage, err := trustService.Vendors.ListForOrganizationId(ctx, obj.Organization.ID, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot list public vendors", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot list subprocessors", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewVendorConnection(vendorPage, r, obj.ID), nil
|
return types.NewSubprocessorConnection(vendorPage, r, obj.ID), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// References is the resolver for the references field.
|
// References is the resolver for the references field.
|
||||||
@@ -1398,24 +1416,6 @@ func (r *trustCenterReferenceResolver) LogoURL(ctx context.Context, obj *types.T
|
|||||||
return logoURL, nil
|
return logoURL, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TotalCount is the resolver for the totalCount field.
|
|
||||||
func (r *vendorConnectionResolver) TotalCount(ctx context.Context, obj *types.VendorConnection) (int, error) {
|
|
||||||
trustService := r.TrustService(ctx, obj.ParentID.TenantID())
|
|
||||||
|
|
||||||
switch obj.Resolver.(type) {
|
|
||||||
case *trustCenterResolver:
|
|
||||||
count, err := trustService.Vendors.CountForTrustCenterId(ctx, obj.ParentID)
|
|
||||||
if err != nil {
|
|
||||||
r.logger.ErrorCtx(ctx, "cannot count vendors", log.Error(err))
|
|
||||||
return 0, gqlutils.Internal(ctx)
|
|
||||||
}
|
|
||||||
return count, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
r.logger.ErrorCtx(ctx, "not implemented: TotalCount for parent type")
|
|
||||||
return 0, gqlutils.Internal(ctx)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Audit returns schema.AuditResolver implementation.
|
// Audit returns schema.AuditResolver implementation.
|
||||||
func (r *Resolver) Audit() schema.AuditResolver { return &auditResolver{r} }
|
func (r *Resolver) Audit() schema.AuditResolver { return &auditResolver{r} }
|
||||||
|
|
||||||
@@ -1447,6 +1447,11 @@ func (r *Resolver) Query() schema.QueryResolver { return &queryResolver{r} }
|
|||||||
// Report returns schema.ReportResolver implementation.
|
// Report returns schema.ReportResolver implementation.
|
||||||
func (r *Resolver) Report() schema.ReportResolver { return &reportResolver{r} }
|
func (r *Resolver) Report() schema.ReportResolver { return &reportResolver{r} }
|
||||||
|
|
||||||
|
// SubprocessorConnection returns schema.SubprocessorConnectionResolver implementation.
|
||||||
|
func (r *Resolver) SubprocessorConnection() schema.SubprocessorConnectionResolver {
|
||||||
|
return &subprocessorConnectionResolver{r}
|
||||||
|
}
|
||||||
|
|
||||||
// TrustCenter returns schema.TrustCenterResolver implementation.
|
// TrustCenter returns schema.TrustCenterResolver implementation.
|
||||||
func (r *Resolver) TrustCenter() schema.TrustCenterResolver { return &trustCenterResolver{r} }
|
func (r *Resolver) TrustCenter() schema.TrustCenterResolver { return &trustCenterResolver{r} }
|
||||||
|
|
||||||
@@ -1460,11 +1465,6 @@ func (r *Resolver) TrustCenterReference() schema.TrustCenterReferenceResolver {
|
|||||||
return &trustCenterReferenceResolver{r}
|
return &trustCenterReferenceResolver{r}
|
||||||
}
|
}
|
||||||
|
|
||||||
// VendorConnection returns schema.VendorConnectionResolver implementation.
|
|
||||||
func (r *Resolver) VendorConnection() schema.VendorConnectionResolver {
|
|
||||||
return &vendorConnectionResolver{r}
|
|
||||||
}
|
|
||||||
|
|
||||||
type auditResolver struct{ *Resolver }
|
type auditResolver struct{ *Resolver }
|
||||||
type complianceFrameworkResolver struct{ *Resolver }
|
type complianceFrameworkResolver struct{ *Resolver }
|
||||||
type documentResolver struct{ *Resolver }
|
type documentResolver struct{ *Resolver }
|
||||||
@@ -1474,7 +1474,7 @@ type nonDisclosureAgreementResolver struct{ *Resolver }
|
|||||||
type organizationResolver struct{ *Resolver }
|
type organizationResolver struct{ *Resolver }
|
||||||
type queryResolver struct{ *Resolver }
|
type queryResolver struct{ *Resolver }
|
||||||
type reportResolver struct{ *Resolver }
|
type reportResolver struct{ *Resolver }
|
||||||
|
type subprocessorConnectionResolver struct{ *Resolver }
|
||||||
type trustCenterResolver struct{ *Resolver }
|
type trustCenterResolver struct{ *Resolver }
|
||||||
type trustCenterFileResolver struct{ *Resolver }
|
type trustCenterFileResolver struct{ *Resolver }
|
||||||
type trustCenterReferenceResolver struct{ *Resolver }
|
type trustCenterReferenceResolver struct{ *Resolver }
|
||||||
type vendorConnectionResolver struct{ *Resolver }
|
|
||||||
|
|||||||
Reference in New Issue
Block a user