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 to={`/organizations/${organizationId}/compliance-page/vendors`}>
|
||||
<IconStore className="size-4" />
|
||||
{__("Vendors")}
|
||||
{__("Subprocessors")}
|
||||
</TabLink>
|
||||
<TabLink to={`/organizations/${organizationId}/compliance-page/access`}>
|
||||
<IconPeopleAdd className="size-4" />
|
||||
|
||||
@@ -29,9 +29,9 @@ export function CompliancePageVendorsPage(props: {
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h3 className="text-base font-medium">{__("Vendors")}</h3>
|
||||
<h3 className="text-base font-medium">{__("Subprocessors")}</h3>
|
||||
<p className="text-sm text-txt-tertiary">
|
||||
{__("Manage vendor assessments and third-party risk information")}
|
||||
{__("Manage subprocessor assessments and third-party risk information")}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -42,7 +42,7 @@ export function CompliancePageVendorList(props: { fragmentRef: CompliancePageVen
|
||||
{vendors.edges.length === 0 && (
|
||||
<Tr>
|
||||
<Td colSpan={4} className="text-center text-txt-secondary">
|
||||
{__("No vendors available")}
|
||||
{__("No subprocessors available")}
|
||||
</Td>
|
||||
</Tr>
|
||||
)}
|
||||
|
||||
@@ -47,8 +47,8 @@ export function CompliancePageVendorListItem(props: {
|
||||
>(
|
||||
updateVendorVisibilityMutation,
|
||||
{
|
||||
successMessage: __("Vendor visibility updated successfully."),
|
||||
errorMessage: __("Failed to update vendor visibility"),
|
||||
successMessage: __("Subprocessor visibility updated successfully."),
|
||||
errorMessage: __("Failed to update subprocessor visibility"),
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ import { IconPin } from "@probo/ui";
|
||||
import { useFragment } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { VendorRowFragment$key } from "./__generated__/VendorRowFragment.graphql";
|
||||
import type { SubprocessorRowFragment$key } from "./__generated__/SubprocessorRowFragment.graphql";
|
||||
|
||||
const vendorRowFragment = graphql`
|
||||
fragment VendorRowFragment on Vendor {
|
||||
const subprocessorRowFragment = graphql`
|
||||
fragment SubprocessorRowFragment on Subprocessor {
|
||||
name
|
||||
description
|
||||
websiteUrl
|
||||
@@ -15,9 +15,9 @@ const vendorRowFragment = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export function VendorRow(props: { vendor: VendorRowFragment$key; hasAnyCountries?: boolean }) {
|
||||
const vendor = useFragment(vendorRowFragment, props.vendor);
|
||||
const logo = faviconUrl(vendor.websiteUrl);
|
||||
export function SubprocessorRow(props: { subprocessor: SubprocessorRowFragment$key; hasAnyCountries?: boolean }) {
|
||||
const subprocessor = useFragment(subprocessorRowFragment, props.subprocessor);
|
||||
const logo = faviconUrl(subprocessor.websiteUrl);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (
|
||||
@@ -34,16 +34,16 @@ export function VendorRow(props: { vendor: VendorRowFragment$key; hasAnyCountrie
|
||||
<div className="size-8 flex-none rounded-lg" />
|
||||
)}
|
||||
<div className="flex flex-col gap-2 flex-1">
|
||||
<span className="text-sm">{vendor.name}</span>
|
||||
<div className="text-xs text-txt-secondary w-full">{vendor.description}</div>
|
||||
<span className="text-sm">{subprocessor.name}</span>
|
||||
<div className="text-xs text-txt-secondary w-full">{subprocessor.description}</div>
|
||||
{props.hasAnyCountries
|
||||
&& (
|
||||
<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" />
|
||||
<span>
|
||||
{vendor.countries
|
||||
{subprocessor.countries
|
||||
.map(country => getCountryName(__, country))
|
||||
.join(", ")}
|
||||
</span>
|
||||
@@ -37,7 +37,7 @@ export function MainLayout(props: Props) {
|
||||
<Tabs className="mb-8">
|
||||
<TabLink to="/overview">{__("Overview")}</TabLink>
|
||||
<TabLink to="/documents">{__("Documents")}</TabLink>
|
||||
{trustCenter.vendorInfo.totalCount > 0
|
||||
{trustCenter.subprocessorInfo.totalCount > 0
|
||||
&& <TabLink to="/subprocessors">{__("Subprocessors")}</TabLink>}
|
||||
<TabLink to="/updates">{__("Updates")}</TabLink>
|
||||
</Tabs>
|
||||
|
||||
@@ -15,8 +15,8 @@ import { AuditRow } from "#/components/AuditRow";
|
||||
import { DocumentRow } from "#/components/DocumentRow";
|
||||
import { RowHeader } from "#/components/RowHeader";
|
||||
import { Rows } from "#/components/Rows";
|
||||
import { SubprocessorRow } from "#/components/SubprocessorRow";
|
||||
import { TrustCenterFileRow } from "#/components/TrustCenterFileRow";
|
||||
import { VendorRow } from "#/components/VendorRow";
|
||||
import { documentTypeLabel } from "#/helpers/documents";
|
||||
import type { TrustGraphCurrentQuery$data } from "#/queries/__generated__/TrustGraphCurrentQuery.graphql";
|
||||
|
||||
@@ -37,12 +37,12 @@ const overviewFragment = graphql`
|
||||
}
|
||||
}
|
||||
}
|
||||
vendors(first: 3) {
|
||||
subprocessors(first: 3) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
countries
|
||||
...VendorRowFragment
|
||||
...SubprocessorRowFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ export function OverviewPage() {
|
||||
/>
|
||||
<Subprocessors
|
||||
organizationName={trustCenter.organization.name}
|
||||
vendors={fragment.vendors.edges}
|
||||
subprocessors={fragment.subprocessors.edges}
|
||||
url={getTrustCenterUrl("subprocessors")}
|
||||
/>
|
||||
</div>
|
||||
@@ -163,22 +163,22 @@ function Documents({
|
||||
}
|
||||
|
||||
function Subprocessors({
|
||||
vendors,
|
||||
subprocessors,
|
||||
url,
|
||||
organizationName,
|
||||
}: {
|
||||
vendors: OverviewPageFragment$data["vendors"]["edges"];
|
||||
subprocessors: OverviewPageFragment$data["subprocessors"]["edges"];
|
||||
url: string;
|
||||
organizationName: string;
|
||||
}) {
|
||||
const { __ } = useTranslate();
|
||||
if (vendors.length === 0) {
|
||||
if (subprocessors.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const hasAnyCountries = vendors.some((vendor) => {
|
||||
const vendorData = vendor.node;
|
||||
return vendorData.countries && vendorData.countries.length > 0;
|
||||
const hasAnyCountries = subprocessors.some((subprocessor) => {
|
||||
const subprocessorData = subprocessor.node;
|
||||
return subprocessorData.countries && subprocessorData.countries.length > 0;
|
||||
});
|
||||
|
||||
return (
|
||||
@@ -191,10 +191,10 @@ function Subprocessors({
|
||||
)}
|
||||
</p>
|
||||
<Rows className="mb-8 *:py-5">
|
||||
{vendors.map(vendor => (
|
||||
<VendorRow
|
||||
key={vendor.node.id}
|
||||
vendor={vendor.node}
|
||||
{subprocessors.map(subprocessor => (
|
||||
<SubprocessorRow
|
||||
key={subprocessor.node.id}
|
||||
subprocessor={subprocessor.node}
|
||||
hasAnyCountries={hasAnyCountries}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -3,21 +3,21 @@ import { useTranslate } from "@probo/i18n";
|
||||
import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
|
||||
|
||||
import { Rows } from "#/components/Rows";
|
||||
import { VendorRow } from "#/components/VendorRow";
|
||||
import type { TrustGraphCurrentVendorsQuery } from "#/queries/__generated__/TrustGraphCurrentVendorsQuery.graphql";
|
||||
import { currentTrustVendorsQuery } from "#/queries/TrustGraph";
|
||||
import { SubprocessorRow } from "#/components/SubprocessorRow";
|
||||
import type { TrustGraphCurrentSubprocessorsQuery } from "#/queries/__generated__/TrustGraphCurrentSubprocessorsQuery.graphql";
|
||||
import { currentTrustSubprocessorsQuery } from "#/queries/TrustGraph";
|
||||
|
||||
type Props = {
|
||||
queryRef: PreloadedQuery<TrustGraphCurrentVendorsQuery>;
|
||||
queryRef: PreloadedQuery<TrustGraphCurrentSubprocessorsQuery>;
|
||||
};
|
||||
|
||||
export function SubprocessorsPage({ queryRef }: Props) {
|
||||
const { __ } = useTranslate();
|
||||
const data = usePreloadedQuery(currentTrustVendorsQuery, queryRef);
|
||||
const vendors
|
||||
= data.currentTrustCenter?.vendors.edges.map(edge => edge.node) ?? [];
|
||||
const data = usePreloadedQuery(currentTrustSubprocessorsQuery, queryRef);
|
||||
const subprocessors
|
||||
= 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 (
|
||||
<div>
|
||||
@@ -29,8 +29,8 @@ export function SubprocessorsPage({ queryRef }: Props) {
|
||||
)}
|
||||
</p>
|
||||
<Rows>
|
||||
{vendors.map(vendor => (
|
||||
<VendorRow key={vendor.id} vendor={vendor} hasAnyCountries={hasAnyCountries} />
|
||||
{subprocessors.map(subprocessor => (
|
||||
<SubprocessorRow key={subprocessor.id} subprocessor={subprocessor} hasAnyCountries={hasAnyCountries} />
|
||||
))}
|
||||
</Rows>
|
||||
</div>
|
||||
|
||||
@@ -43,7 +43,7 @@ export const currentTrustGraphQuery = graphql`
|
||||
}
|
||||
}
|
||||
...OverviewPageFragment
|
||||
vendorInfo: vendors(first: 0) {
|
||||
subprocessorInfo: subprocessors(first: 0) {
|
||||
totalCount
|
||||
}
|
||||
audits(first: 50) {
|
||||
@@ -97,19 +97,19 @@ export const currentTrustDocumentsQuery = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const currentTrustVendorsQuery = graphql`
|
||||
query TrustGraphCurrentVendorsQuery {
|
||||
export const currentTrustSubprocessorsQuery = graphql`
|
||||
query TrustGraphCurrentSubprocessorsQuery {
|
||||
currentTrustCenter {
|
||||
id
|
||||
organization {
|
||||
name
|
||||
}
|
||||
vendors(first: 50) {
|
||||
subprocessors(first: 50) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
countries
|
||||
...VendorRowFragment
|
||||
...SubprocessorRowFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import { currentTrustUpdatesQuery, UpdatesPage } from "#/pages/UpdatesPage";
|
||||
import {
|
||||
currentTrustDocumentsQuery,
|
||||
currentTrustGraphQuery,
|
||||
currentTrustVendorsQuery,
|
||||
currentTrustSubprocessorsQuery,
|
||||
} from "#/queries/TrustGraph";
|
||||
|
||||
import { DocumentPageErrorBoundary } from "./components/DocumentPageErrorBoundary";
|
||||
@@ -112,7 +112,7 @@ const routes = [
|
||||
{
|
||||
path: "",
|
||||
loader: loaderFromQueryLoader(() =>
|
||||
loadQuery(consoleEnvironment, currentTrustVendorsQuery, {}),
|
||||
loadQuery(consoleEnvironment, currentTrustSubprocessorsQuery, {}),
|
||||
),
|
||||
Fallback: TabSkeleton,
|
||||
Component: withQueryRef(SubprocessorsPage),
|
||||
|
||||
Reference in New Issue
Block a user