Add vendor contacts

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-08-13 19:41:21 +02:00
parent 3839d2000d
commit 52f24a503d
26 changed files with 4917 additions and 41 deletions

View File

@@ -152,6 +152,7 @@ export const vendorNodeQuery = graphql`
websiteUrl
...useVendorFormFragment
...VendorComplianceTabFragment
...VendorContactsTabFragment
...VendorRiskAssessmentTabFragment
...VendorOverviewTabBusinessAssociateAgreementFragment
}

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<9174011c1abd05e499786607130d0c82>>
* @generated SignedSource<<da74b0f7535be59a3442b643c71931d7>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -19,7 +19,7 @@ export type VendorGraphNodeQuery$data = {
readonly id?: string;
readonly name?: string;
readonly websiteUrl?: string | null | undefined;
readonly " $fragmentSpreads": FragmentRefs<"VendorComplianceTabFragment" | "VendorOverviewTabBusinessAssociateAgreementFragment" | "VendorRiskAssessmentTabFragment" | "useVendorFormFragment">;
readonly " $fragmentSpreads": FragmentRefs<"VendorComplianceTabFragment" | "VendorContactsTabFragment" | "VendorOverviewTabBusinessAssociateAgreementFragment" | "VendorRiskAssessmentTabFragment" | "useVendorFormFragment">;
};
readonly viewer: {
readonly user: {
@@ -156,6 +156,21 @@ v16 = {
"storageKey": null
},
v17 = {
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
(v13/*: any*/),
(v14/*: any*/),
(v15/*: any*/),
(v16/*: any*/)
],
"storageKey": null
},
v18 = {
"kind": "ClientExtension",
"selections": [
{
@@ -167,9 +182,23 @@ v17 = {
}
]
},
v18 = [
v19 = [
"orderBy"
];
],
v20 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
v21 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
};
return {
"fragment": {
"argumentDefinitions": [
@@ -204,6 +233,11 @@ return {
"kind": "FragmentSpread",
"name": "VendorComplianceTabFragment"
},
{
"args": null,
"kind": "FragmentSpread",
"name": "VendorContactsTabFragment"
},
{
"args": null,
"kind": "FragmentSpread",
@@ -425,34 +459,97 @@ return {
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
(v13/*: any*/),
(v14/*: any*/),
(v15/*: any*/),
(v16/*: any*/)
],
"storageKey": null
},
(v17/*: any*/)
(v17/*: any*/),
(v18/*: any*/)
],
"storageKey": "complianceReports(first:50)"
},
{
"alias": null,
"args": (v9/*: any*/),
"filters": (v18/*: any*/),
"filters": (v19/*: any*/),
"handle": "connection",
"key": "VendorComplianceTabFragment_complianceReports",
"kind": "LinkedHandle",
"name": "complianceReports"
},
{
"alias": null,
"args": (v9/*: any*/),
"concreteType": "VendorContactConnection",
"kind": "LinkedField",
"name": "contacts",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorContactEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorContact",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v3/*: any*/),
(v20/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "email",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "phone",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "role",
"storageKey": null
},
(v21/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
},
(v8/*: any*/)
],
"storageKey": null
},
(v12/*: any*/)
],
"storageKey": null
},
(v17/*: any*/),
(v18/*: any*/)
],
"storageKey": "contacts(first:50)"
},
{
"alias": null,
"args": (v9/*: any*/),
"filters": (v19/*: any*/),
"handle": "connection",
"key": "VendorContactsTabFragment_contacts",
"kind": "LinkedHandle",
"name": "contacts"
},
{
"alias": null,
"args": (v9/*: any*/),
@@ -494,13 +591,7 @@ return {
"plural": false,
"selections": [
(v3/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
}
(v20/*: any*/)
],
"storageKey": null
},
@@ -555,14 +646,14 @@ return {
],
"storageKey": null
},
(v17/*: any*/)
(v18/*: any*/)
],
"storageKey": "riskAssessments(first:50)"
},
{
"alias": null,
"args": (v9/*: any*/),
"filters": (v18/*: any*/),
"filters": (v19/*: any*/),
"handle": "connection",
"key": "VendorRiskAssessmentTabFragment_riskAssessments",
"kind": "LinkedHandle",
@@ -593,13 +684,7 @@ return {
"storageKey": null
},
(v10/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
}
(v21/*: any*/)
],
"storageKey": null
}
@@ -638,16 +723,16 @@ return {
]
},
"params": {
"cacheID": "95f9f21af1253d08c97dfd7d2f65f2e3",
"cacheID": "506d89b503073e18cbf657aec5d62c71",
"id": null,
"metadata": {},
"name": "VendorGraphNodeQuery",
"operationKind": "query",
"text": "query VendorGraphNodeQuery(\n $vendorId: ID!\n $organizationId: ID!\n) {\n node(id: $vendorId) {\n __typename\n ... on Vendor {\n id\n name\n websiteUrl\n ...useVendorFormFragment\n ...VendorComplianceTabFragment\n ...VendorRiskAssessmentTabFragment\n ...VendorOverviewTabBusinessAssociateAgreementFragment\n }\n id\n }\n viewer {\n user {\n people(organizationId: $organizationId) {\n id\n }\n id\n }\n id\n }\n}\n\nfragment VendorComplianceTabFragment on Vendor {\n complianceReports(first: 50) {\n edges {\n node {\n id\n ...VendorComplianceTabFragment_report\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n fileUrl\n fileSize\n}\n\nfragment VendorOverviewTabBusinessAssociateAgreementFragment on Vendor {\n businessAssociateAgreement {\n id\n fileName\n fileUrl\n validFrom\n validUntil\n createdAt\n }\n}\n\nfragment VendorRiskAssessmentTabFragment on Vendor {\n id\n riskAssessments(first: 50) {\n edges {\n node {\n id\n ...VendorRiskAssessmentTabFragment_assessment\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n hasPreviousPage\n startCursor\n }\n }\n}\n\nfragment VendorRiskAssessmentTabFragment_assessment on VendorRiskAssessment {\n id\n assessedAt\n assessedBy {\n id\n fullName\n }\n expiresAt\n dataSensitivity\n businessImpact\n notes\n}\n\nfragment useVendorFormFragment on Vendor {\n id\n name\n description\n statusPageUrl\n termsOfServiceUrl\n privacyPolicyUrl\n serviceLevelAgreementUrl\n dataProcessingAgreementUrl\n websiteUrl\n legalName\n headquarterAddress\n certifications\n securityPageUrl\n trustPageUrl\n businessOwner {\n id\n }\n securityOwner {\n id\n }\n}\n"
"text": "query VendorGraphNodeQuery(\n $vendorId: ID!\n $organizationId: ID!\n) {\n node(id: $vendorId) {\n __typename\n ... on Vendor {\n id\n name\n websiteUrl\n ...useVendorFormFragment\n ...VendorComplianceTabFragment\n ...VendorContactsTabFragment\n ...VendorRiskAssessmentTabFragment\n ...VendorOverviewTabBusinessAssociateAgreementFragment\n }\n id\n }\n viewer {\n user {\n people(organizationId: $organizationId) {\n id\n }\n id\n }\n id\n }\n}\n\nfragment VendorComplianceTabFragment on Vendor {\n complianceReports(first: 50) {\n edges {\n node {\n id\n ...VendorComplianceTabFragment_report\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n fileUrl\n fileSize\n}\n\nfragment VendorContactsTabFragment on Vendor {\n contacts(first: 50) {\n edges {\n node {\n id\n ...VendorContactsTabFragment_contact\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n}\n\nfragment VendorOverviewTabBusinessAssociateAgreementFragment on Vendor {\n businessAssociateAgreement {\n id\n fileName\n fileUrl\n validFrom\n validUntil\n createdAt\n }\n}\n\nfragment VendorRiskAssessmentTabFragment on Vendor {\n id\n riskAssessments(first: 50) {\n edges {\n node {\n id\n ...VendorRiskAssessmentTabFragment_assessment\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n hasPreviousPage\n startCursor\n }\n }\n}\n\nfragment VendorRiskAssessmentTabFragment_assessment on VendorRiskAssessment {\n id\n assessedAt\n assessedBy {\n id\n fullName\n }\n expiresAt\n dataSensitivity\n businessImpact\n notes\n}\n\nfragment useVendorFormFragment on Vendor {\n id\n name\n description\n statusPageUrl\n termsOfServiceUrl\n privacyPolicyUrl\n serviceLevelAgreementUrl\n dataProcessingAgreementUrl\n websiteUrl\n legalName\n headquarterAddress\n certifications\n securityPageUrl\n trustPageUrl\n businessOwner {\n id\n }\n securityOwner {\n id\n }\n}\n"
}
};
})();
(node as any).hash = "c80a167ea096212995f1d3261bc2bf57";
(node as any).hash = "b5ea2120ec2f0f09ed29e19bbf232622";
export default node;

View File

@@ -112,6 +112,11 @@ export default function VendorDetailPage(props: Props) {
>
{__("Risk Assessment")}
</TabLink>
<TabLink
to={`/organizations/${organizationId}/vendors/${vendor.id}/contacts`}
>
{__("Contacts")}
</TabLink>
</Tabs>
<Outlet context={{ vendor, peopleId: data.viewer.user.people!.id }} />

View File

@@ -0,0 +1,143 @@
import { useTranslate } from "@probo/i18n";
import {
Breadcrumb,
Button,
Dialog,
DialogContent,
DialogFooter,
Field,
useDialogRef,
} from "@probo/ui";
import { cleanFormData } from "@probo/helpers";
import { type ReactNode } from "react";
import { graphql } from "relay-runtime";
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
import { z } from "zod";
import { useFormWithSchema } from "/hooks/useFormWithSchema";
type Props = {
children: ReactNode;
connectionId: string;
vendorId: string;
};
const createContactMutation = graphql`
mutation CreateContactDialogMutation(
$input: CreateVendorContactInput!
$connections: [ID!]!
) {
createVendorContact(input: $input) {
vendorContactEdge @prependEdge(connections: $connections) {
node {
...VendorContactsTabFragment_contact
}
}
}
}
`;
const phoneRegex = /^\+[0-9]{8,15}$/;
export function CreateContactDialog({
children,
connectionId,
vendorId,
}: Props) {
const { __ } = useTranslate();
const schema = z.object({
fullName: z.string().optional(),
email: z.string().email(__("Please enter a valid email address")).optional().or(z.literal("")),
phone: z.string().regex(phoneRegex, __("Phone number must be in international format (e.g., +1234567890)")).optional().or(z.literal("")),
role: z.string().optional(),
});
const { register, handleSubmit, formState, reset } = useFormWithSchema(
schema,
{
defaultValues: {
fullName: "",
email: "",
phone: "",
role: "",
},
}
);
const [createContact, isLoading] = useMutationWithToasts(
createContactMutation,
{
successMessage: __("Contact created successfully."),
errorMessage: __("Failed to create contact. Please try again."),
}
);
const onSubmit = handleSubmit((data) => {
const cleanData = cleanFormData(data);
createContact({
variables: {
input: {
vendorId,
...cleanData,
},
connections: [connectionId],
},
onSuccess: () => {
dialogRef.current?.close();
reset();
},
});
});
const dialogRef = useDialogRef();
return (
<Dialog
className="max-w-lg"
ref={dialogRef}
trigger={children}
title={
<Breadcrumb items={[__("Contacts"), __("New Contact")]} />
}
>
<form onSubmit={onSubmit}>
<DialogContent padded className="space-y-4">
<Field
label={__("Name")}
{...register("fullName")}
type="text"
error={formState.errors.fullName?.message}
placeholder={__("Contact's full name")}
/>
<Field
label={__("Email")}
{...register("email")}
type="email"
error={formState.errors.email?.message}
placeholder={__("contact@example.com")}
/>
<Field
label={__("Phone")}
{...register("phone")}
type="text"
error={formState.errors.phone?.message}
placeholder={__("e.g., +1234567890")}
help={__("Use international format starting with +")}
/>
<Field
label={__("Role")}
{...register("role")}
type="text"
error={formState.errors.role?.message}
placeholder={__("e.g., Account Manager, Technical Support")}
/>
</DialogContent>
<DialogFooter>
<Button type="submit" disabled={isLoading}>
{__("Create")}
</Button>
</DialogFooter>
</form>
</Dialog>
);
}

View File

@@ -0,0 +1,142 @@
import { useTranslate } from "@probo/i18n";
import {
Breadcrumb,
Button,
Dialog,
DialogContent,
DialogFooter,
Field,
useDialogRef,
} from "@probo/ui";
import { cleanFormData } from "@probo/helpers";
import { useEffect } from "react";
import { graphql } from "relay-runtime";
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
import { z } from "zod";
import { useFormWithSchema } from "/hooks/useFormWithSchema";
type Props = {
contactId: string;
contact: {
fullName?: string | null;
email?: string | null;
phone?: string | null;
role?: string | null;
};
onClose: () => void;
};
const updateContactMutation = graphql`
mutation EditContactDialogUpdateMutation($input: UpdateVendorContactInput!) {
updateVendorContact(input: $input) {
vendorContact {
...VendorContactsTabFragment_contact
}
}
}
`;
const phoneRegex = /^\+[0-9]{8,15}$/;
export function EditContactDialog({ contactId, contact, onClose }: Props) {
const { __ } = useTranslate();
const schema = z.object({
fullName: z.string().optional(),
email: z.string().email(__("Please enter a valid email address")).optional().or(z.literal("")),
phone: z.string().regex(phoneRegex, __("Phone number must be in international format (e.g., +1234567890)")).optional().or(z.literal("")),
role: z.string().optional(),
});
const { register, handleSubmit, formState } = useFormWithSchema(
schema,
{
defaultValues: {
fullName: contact.fullName || "",
email: contact.email || "",
phone: contact.phone || "",
role: contact.role || "",
},
}
);
const [updateContact, isLoading] = useMutationWithToasts(
updateContactMutation,
{
successMessage: __("Contact updated successfully."),
errorMessage: __("Failed to update contact. Please try again."),
}
);
const onSubmit = handleSubmit((data) => {
const cleanData = cleanFormData(data);
updateContact({
variables: {
input: {
id: contactId,
...cleanData,
},
},
onSuccess: () => {
onClose();
},
});
});
const dialogRef = useDialogRef();
useEffect(() => {
dialogRef.current?.open();
}, []);
return (
<Dialog
className="max-w-lg"
ref={dialogRef}
onClose={onClose}
title={
<Breadcrumb items={[__("Contacts"), __("Edit Contact")]} />
}
>
<form onSubmit={onSubmit}>
<DialogContent padded className="space-y-4">
<Field
label={__("Name")}
{...register("fullName")}
type="text"
error={formState.errors.fullName?.message}
placeholder={__("Contact's full name")}
/>
<Field
label={__("Email")}
{...register("email")}
type="email"
error={formState.errors.email?.message}
placeholder={__("contact@example.com")}
/>
<Field
label={__("Phone")}
{...register("phone")}
type="text"
error={formState.errors.phone?.message}
placeholder={__("e.g., +1234567890")}
help={__("Use international format starting with +")}
/>
<Field
label={__("Role")}
{...register("role")}
type="text"
error={formState.errors.role?.message}
placeholder={__("e.g., Account Manager, Technical Support")}
/>
</DialogContent>
<DialogFooter>
<Button type="submit" disabled={isLoading}>
{__("Save")}
</Button>
</DialogFooter>
</form>
</Dialog>
);
}

View File

@@ -0,0 +1,230 @@
/**
* @generated SignedSource<<843a80b3503ff276081e69b558dcce81>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type CreateVendorContactInput = {
email?: string | null | undefined;
fullName?: string | null | undefined;
phone?: string | null | undefined;
role?: string | null | undefined;
vendorId: string;
};
export type CreateContactDialogMutation$variables = {
connections: ReadonlyArray<string>;
input: CreateVendorContactInput;
};
export type CreateContactDialogMutation$data = {
readonly createVendorContact: {
readonly vendorContactEdge: {
readonly node: {
readonly " $fragmentSpreads": FragmentRefs<"VendorContactsTabFragment_contact">;
};
};
};
};
export type CreateContactDialogMutation = {
response: CreateContactDialogMutation$data;
variables: CreateContactDialogMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "connections"
},
v1 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
},
v2 = [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
];
return {
"fragment": {
"argumentDefinitions": [
(v0/*: any*/),
(v1/*: any*/)
],
"kind": "Fragment",
"metadata": null,
"name": "CreateContactDialogMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "CreateVendorContactPayload",
"kind": "LinkedField",
"name": "createVendorContact",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorContactEdge",
"kind": "LinkedField",
"name": "vendorContactEdge",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorContact",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
{
"args": null,
"kind": "FragmentSpread",
"name": "VendorContactsTabFragment_contact"
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": [
(v1/*: any*/),
(v0/*: any*/)
],
"kind": "Operation",
"name": "CreateContactDialogMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "CreateVendorContactPayload",
"kind": "LinkedField",
"name": "createVendorContact",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorContactEdge",
"kind": "LinkedField",
"name": "vendorContactEdge",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorContact",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "email",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "phone",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "role",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"filters": null,
"handle": "prependEdge",
"key": "",
"kind": "LinkedHandle",
"name": "vendorContactEdge",
"handleArgs": [
{
"kind": "Variable",
"name": "connections",
"variableName": "connections"
}
]
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "dac4774aa797162239a60596464811d8",
"id": null,
"metadata": {},
"name": "CreateContactDialogMutation",
"operationKind": "mutation",
"text": "mutation CreateContactDialogMutation(\n $input: CreateVendorContactInput!\n) {\n createVendorContact(input: $input) {\n vendorContactEdge {\n node {\n ...VendorContactsTabFragment_contact\n id\n }\n }\n }\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n}\n"
}
};
})();
(node as any).hash = "f44f76bce42470683c55db50426d3f7b";
export default node;

View File

@@ -0,0 +1,180 @@
/**
* @generated SignedSource<<d22f20fafedcdddc50cd21917a8a5c28>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type UpdateVendorContactInput = {
email?: string | null | undefined;
fullName?: string | null | undefined;
id: string;
phone?: string | null | undefined;
role?: string | null | undefined;
};
export type EditContactDialogUpdateMutation$variables = {
input: UpdateVendorContactInput;
};
export type EditContactDialogUpdateMutation$data = {
readonly updateVendorContact: {
readonly vendorContact: {
readonly " $fragmentSpreads": FragmentRefs<"VendorContactsTabFragment_contact">;
};
};
};
export type EditContactDialogUpdateMutation = {
response: EditContactDialogUpdateMutation$data;
variables: EditContactDialogUpdateMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "EditContactDialogUpdateMutation",
"selections": [
{
"alias": null,
"args": (v1/*: any*/),
"concreteType": "UpdateVendorContactPayload",
"kind": "LinkedField",
"name": "updateVendorContact",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorContact",
"kind": "LinkedField",
"name": "vendorContact",
"plural": false,
"selections": [
{
"args": null,
"kind": "FragmentSpread",
"name": "VendorContactsTabFragment_contact"
}
],
"storageKey": null
}
],
"storageKey": null
}
],
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "EditContactDialogUpdateMutation",
"selections": [
{
"alias": null,
"args": (v1/*: any*/),
"concreteType": "UpdateVendorContactPayload",
"kind": "LinkedField",
"name": "updateVendorContact",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorContact",
"kind": "LinkedField",
"name": "vendorContact",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "email",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "phone",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "role",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "bacc163156572b5da49705a27084f5c9",
"id": null,
"metadata": {},
"name": "EditContactDialogUpdateMutation",
"operationKind": "mutation",
"text": "mutation EditContactDialogUpdateMutation(\n $input: UpdateVendorContactInput!\n) {\n updateVendorContact(input: $input) {\n vendorContact {\n ...VendorContactsTabFragment_contact\n id\n }\n }\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n}\n"
}
};
})();
(node as any).hash = "845750bb920bd01ed91bbae1531aaaf0";
export default node;

View File

@@ -0,0 +1,251 @@
import { useOutletContext } from "react-router";
import { graphql } from "relay-runtime";
import type { VendorContactsTabFragment$key } from "./__generated__/VendorContactsTabFragment.graphql";
import { useTranslate } from "@probo/i18n";
import { usePageTitle } from "@probo/hooks";
import {
ActionDropdown,
Button,
DropdownItem,
IconPlusLarge,
IconTrashCan,
IconPencil,
PageHeader,
Tbody,
Td,
Th,
Thead,
Tr,
useConfirm,
} from "@probo/ui";
import { useFragment, useRefetchableFragment } from "react-relay";
import type { VendorContactsTabFragment_contact$key } from "./__generated__/VendorContactsTabFragment_contact.graphql";
import { useMutationWithToasts } from "/hooks/useMutationWithToasts";
import { sprintf } from "@probo/helpers";
import { SortableTable, SortableTh } from "/components/SortableTable";
import { CreateContactDialog } from "../dialogs/CreateContactDialog";
import { EditContactDialog } from "../dialogs/EditContactDialog";
import { useState } from "react";
export const vendorContactsFragment = graphql`
fragment VendorContactsTabFragment on Vendor
@refetchable(queryName: "VendorContactsListQuery")
@argumentDefinitions(
first: { type: "Int", defaultValue: 50 }
order: { type: "VendorContactOrder", defaultValue: null }
after: { type: "CursorKey", defaultValue: null }
before: { type: "CursorKey", defaultValue: null }
last: { type: "Int", defaultValue: null }
) {
contacts(
first: $first
after: $after
last: $last
before: $before
orderBy: $order
) @connection(key: "VendorContactsTabFragment_contacts") {
__id
edges {
node {
id
...VendorContactsTabFragment_contact
}
}
}
}
`;
const contactFragment = graphql`
fragment VendorContactsTabFragment_contact on VendorContact {
id
fullName
email
phone
role
createdAt
updatedAt
}
`;
const deleteContactMutation = graphql`
mutation VendorContactsTabDeleteContactMutation(
$input: DeleteVendorContactInput!
$connections: [ID!]!
) {
deleteVendorContact(input: $input) {
deletedVendorContactId @deleteEdge(connections: $connections)
}
}
`;
export default function VendorContactsTab() {
const { vendor } = useOutletContext<{
vendor: VendorContactsTabFragment$key & { name: string; id: string };
}>();
const [data, refetch] = useRefetchableFragment(
vendorContactsFragment,
vendor
);
const connectionId = data.contacts.__id;
const contacts = data.contacts.edges.map((edge) => edge.node);
const { __ } = useTranslate();
const [editingContact, setEditingContact] = useState<{
id: string;
fullName?: string | null;
email?: string | null;
phone?: string | null;
role?: string | null;
} | null>(null);
usePageTitle(vendor.name + " - " + __("Contacts"));
return (
<div className="space-y-6">
<PageHeader
title={__("Contacts")}
description={__("Manage vendor contacts and their information.")}
>
<CreateContactDialog
vendorId={vendor.id}
connectionId={connectionId}
>
<Button icon={IconPlusLarge}>{__("Add contact")}</Button>
</CreateContactDialog>
</PageHeader>
<SortableTable refetch={refetch}>
<Thead>
<Tr>
<SortableTh field="FULL_NAME">{__("Name")}</SortableTh>
<SortableTh field="EMAIL">{__("Email")}</SortableTh>
<Th>{__("Phone")}</Th>
<Th>{__("Role")}</Th>
<SortableTh field="CREATED_AT">{__("Created")}</SortableTh>
<Th>{__("Actions")}</Th>
</Tr>
</Thead>
<Tbody>
{contacts.map((contact) => (
<ContactRow
key={contact.id}
contactKey={contact}
connectionId={connectionId}
onEdit={setEditingContact}
/>
))}
</Tbody>
</SortableTable>
{editingContact && (
<EditContactDialog
contactId={editingContact.id}
contact={editingContact}
onClose={() => setEditingContact(null)}
/>
)}
</div>
);
}
type ContactRowProps = {
contactKey: VendorContactsTabFragment_contact$key;
connectionId: string;
onEdit: (contact: {
id: string;
fullName?: string | null;
email?: string | null;
phone?: string | null;
role?: string | null;
}) => void;
};
function ContactRow(props: ContactRowProps) {
const { __ } = useTranslate();
const contact = useFragment<VendorContactsTabFragment_contact$key>(
contactFragment,
props.contactKey
);
const { dateFormat } = useTranslate();
const confirm = useConfirm();
const [deleteContact] = useMutationWithToasts(deleteContactMutation, {
successMessage: __("Contact deleted successfully"),
errorMessage: __("Failed to delete contact"),
});
const handleDelete = () => {
confirm(
() =>
deleteContact({
variables: {
connections: [props.connectionId],
input: {
vendorContactId: contact.id,
},
},
}),
{
message: sprintf(
__(
'This will permanently delete the contact "%s". This action cannot be undone.'
),
contact.fullName || contact.email || __("Unnamed contact")
),
}
);
};
return (
<Tr>
<Td>{contact.fullName || __("—")}</Td>
<Td>
{contact.email ? (
<a
href={`mailto:${contact.email}`}
className="text-primary-600 hover:text-primary-800"
>
{contact.email}
</a>
) : (
__("—")
)}
</Td>
<Td>
{contact.phone ? (
<a
href={`tel:${contact.phone}`}
className="text-primary-600 hover:text-primary-800"
>
{contact.phone}
</a>
) : (
__("—")
)}
</Td>
<Td>{contact.role || __("—")}</Td>
<Td>{dateFormat(contact.createdAt)}</Td>
<Td width={50} className="text-end">
<ActionDropdown>
<DropdownItem
icon={IconPencil}
onClick={() => props.onEdit({
id: contact.id,
fullName: contact.fullName,
email: contact.email,
phone: contact.phone,
role: contact.role,
})}
>
{__("Edit")}
</DropdownItem>
<DropdownItem
icon={IconTrashCan}
onClick={handleDelete}
variant="danger"
>
{__("Delete")}
</DropdownItem>
</ActionDropdown>
</Td>
</Tr>
);
}

View File

@@ -0,0 +1,358 @@
/**
* @generated SignedSource<<65134b167a4268ed8064021f2c608899>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type OrderDirection = "ASC" | "DESC";
export type VendorContactOrderField = "CREATED_AT" | "EMAIL" | "FULL_NAME";
export type VendorContactOrder = {
direction: OrderDirection;
field: VendorContactOrderField;
};
export type VendorContactsListQuery$variables = {
after?: any | null | undefined;
before?: any | null | undefined;
first?: number | null | undefined;
id: string;
last?: number | null | undefined;
order?: VendorContactOrder | null | undefined;
};
export type VendorContactsListQuery$data = {
readonly node: {
readonly " $fragmentSpreads": FragmentRefs<"VendorContactsTabFragment">;
};
};
export type VendorContactsListQuery = {
response: VendorContactsListQuery$data;
variables: VendorContactsListQuery$variables;
};
const node: ConcreteRequest = (function(){
var v0 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "after"
},
v1 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "before"
},
v2 = {
"defaultValue": 50,
"kind": "LocalArgument",
"name": "first"
},
v3 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "id"
},
v4 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "last"
},
v5 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "order"
},
v6 = [
{
"kind": "Variable",
"name": "id",
"variableName": "id"
}
],
v7 = {
"kind": "Variable",
"name": "after",
"variableName": "after"
},
v8 = {
"kind": "Variable",
"name": "before",
"variableName": "before"
},
v9 = {
"kind": "Variable",
"name": "first",
"variableName": "first"
},
v10 = {
"kind": "Variable",
"name": "last",
"variableName": "last"
},
v11 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
v12 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
v13 = [
(v7/*: any*/),
(v8/*: any*/),
(v9/*: any*/),
(v10/*: any*/),
{
"kind": "Variable",
"name": "orderBy",
"variableName": "order"
}
];
return {
"fragment": {
"argumentDefinitions": [
(v0/*: any*/),
(v1/*: any*/),
(v2/*: any*/),
(v3/*: any*/),
(v4/*: any*/),
(v5/*: any*/)
],
"kind": "Fragment",
"metadata": null,
"name": "VendorContactsListQuery",
"selections": [
{
"alias": null,
"args": (v6/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
{
"args": [
(v7/*: any*/),
(v8/*: any*/),
(v9/*: any*/),
(v10/*: any*/),
{
"kind": "Variable",
"name": "order",
"variableName": "order"
}
],
"kind": "FragmentSpread",
"name": "VendorContactsTabFragment"
}
],
"storageKey": null
}
],
"type": "Query",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": [
(v0/*: any*/),
(v1/*: any*/),
(v2/*: any*/),
(v4/*: any*/),
(v5/*: any*/),
(v3/*: any*/)
],
"kind": "Operation",
"name": "VendorContactsListQuery",
"selections": [
{
"alias": null,
"args": (v6/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v11/*: any*/),
(v12/*: any*/),
{
"kind": "InlineFragment",
"selections": [
{
"alias": null,
"args": (v13/*: any*/),
"concreteType": "VendorContactConnection",
"kind": "LinkedField",
"name": "contacts",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorContactEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorContact",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v12/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "email",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "phone",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "role",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
},
(v11/*: any*/)
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "endCursor",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasNextPage",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasPreviousPage",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "startCursor",
"storageKey": null
}
],
"storageKey": null
},
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
}
],
"storageKey": null
},
{
"alias": null,
"args": (v13/*: any*/),
"filters": [
"orderBy"
],
"handle": "connection",
"key": "VendorContactsTabFragment_contacts",
"kind": "LinkedHandle",
"name": "contacts"
}
],
"type": "Vendor",
"abstractKey": null
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "bc07b88571f6a7fbb20595cbf442d3b8",
"id": null,
"metadata": {},
"name": "VendorContactsListQuery",
"operationKind": "query",
"text": "query VendorContactsListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 50\n $last: Int = null\n $order: VendorContactOrder = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...VendorContactsTabFragment_16fISc\n id\n }\n}\n\nfragment VendorContactsTabFragment_16fISc on Vendor {\n contacts(first: $first, after: $after, last: $last, before: $before, orderBy: $order) {\n edges {\n node {\n id\n ...VendorContactsTabFragment_contact\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n}\n"
}
};
})();
(node as any).hash = "aa8ba87386ba04dd624566661fe0a524";
export default node;

View File

@@ -0,0 +1,132 @@
/**
* @generated SignedSource<<3824bce11d22a60d1e50f53c699611c5>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type DeleteVendorContactInput = {
vendorContactId: string;
};
export type VendorContactsTabDeleteContactMutation$variables = {
connections: ReadonlyArray<string>;
input: DeleteVendorContactInput;
};
export type VendorContactsTabDeleteContactMutation$data = {
readonly deleteVendorContact: {
readonly deletedVendorContactId: string;
};
};
export type VendorContactsTabDeleteContactMutation = {
response: VendorContactsTabDeleteContactMutation$data;
variables: VendorContactsTabDeleteContactMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "connections"
},
v1 = {
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
},
v2 = [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "deletedVendorContactId",
"storageKey": null
};
return {
"fragment": {
"argumentDefinitions": [
(v0/*: any*/),
(v1/*: any*/)
],
"kind": "Fragment",
"metadata": null,
"name": "VendorContactsTabDeleteContactMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "DeleteVendorContactPayload",
"kind": "LinkedField",
"name": "deleteVendorContact",
"plural": false,
"selections": [
(v3/*: any*/)
],
"storageKey": null
}
],
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": [
(v1/*: any*/),
(v0/*: any*/)
],
"kind": "Operation",
"name": "VendorContactsTabDeleteContactMutation",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "DeleteVendorContactPayload",
"kind": "LinkedField",
"name": "deleteVendorContact",
"plural": false,
"selections": [
(v3/*: any*/),
{
"alias": null,
"args": null,
"filters": null,
"handle": "deleteEdge",
"key": "",
"kind": "ScalarHandle",
"name": "deletedVendorContactId",
"handleArgs": [
{
"kind": "Variable",
"name": "connections",
"variableName": "connections"
}
]
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "806c0b076e6da2ac4841d172047c8655",
"id": null,
"metadata": {},
"name": "VendorContactsTabDeleteContactMutation",
"operationKind": "mutation",
"text": "mutation VendorContactsTabDeleteContactMutation(\n $input: DeleteVendorContactInput!\n) {\n deleteVendorContact(input: $input) {\n deletedVendorContactId\n }\n}\n"
}
};
})();
(node as any).hash = "f0595bed2e2e7527eeac8737a0640a4d";
export default node;

View File

@@ -0,0 +1,225 @@
/**
* @generated SignedSource<<6aea0078adcf4d7180d89dbf964eaceb>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type VendorContactsTabFragment$data = {
readonly contacts: {
readonly __id: string;
readonly edges: ReadonlyArray<{
readonly node: {
readonly id: string;
readonly " $fragmentSpreads": FragmentRefs<"VendorContactsTabFragment_contact">;
};
}>;
};
readonly id: string;
readonly " $fragmentType": "VendorContactsTabFragment";
};
export type VendorContactsTabFragment$key = {
readonly " $data"?: VendorContactsTabFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"VendorContactsTabFragment">;
};
import VendorContactsListQuery_graphql from './VendorContactsListQuery.graphql';
const node: ReaderFragment = (function(){
var v0 = [
"contacts"
],
v1 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
};
return {
"argumentDefinitions": [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "after"
},
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "before"
},
{
"defaultValue": 50,
"kind": "LocalArgument",
"name": "first"
},
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "last"
},
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "order"
}
],
"kind": "Fragment",
"metadata": {
"connection": [
{
"count": null,
"cursor": null,
"direction": "bidirectional",
"path": (v0/*: any*/)
}
],
"refetch": {
"connection": {
"forward": {
"count": "first",
"cursor": "after"
},
"backward": {
"count": "last",
"cursor": "before"
},
"path": (v0/*: any*/)
},
"fragmentPathInResult": [
"node"
],
"operation": VendorContactsListQuery_graphql,
"identifierInfo": {
"identifierField": "id",
"identifierQueryVariableName": "id"
}
}
},
"name": "VendorContactsTabFragment",
"selections": [
{
"alias": "contacts",
"args": [
{
"kind": "Variable",
"name": "orderBy",
"variableName": "order"
}
],
"concreteType": "VendorContactConnection",
"kind": "LinkedField",
"name": "__VendorContactsTabFragment_contacts_connection",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorContactEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "VendorContact",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v1/*: any*/),
{
"args": null,
"kind": "FragmentSpread",
"name": "VendorContactsTabFragment_contact"
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "endCursor",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasNextPage",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasPreviousPage",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "startCursor",
"storageKey": null
}
],
"storageKey": null
},
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
}
],
"storageKey": null
},
(v1/*: any*/)
],
"type": "Vendor",
"abstractKey": null
};
})();
(node as any).hash = "aa8ba87386ba04dd624566661fe0a524";
export default node;

View File

@@ -0,0 +1,90 @@
/**
* @generated SignedSource<<28eef433ba6749a95468492e8ac9d1a6>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type VendorContactsTabFragment_contact$data = {
readonly createdAt: any;
readonly email: string | null | undefined;
readonly fullName: string | null | undefined;
readonly id: string;
readonly phone: string | null | undefined;
readonly role: string | null | undefined;
readonly updatedAt: any;
readonly " $fragmentType": "VendorContactsTabFragment_contact";
};
export type VendorContactsTabFragment_contact$key = {
readonly " $data"?: VendorContactsTabFragment_contact$data;
readonly " $fragmentSpreads": FragmentRefs<"VendorContactsTabFragment_contact">;
};
const node: ReaderFragment = {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"name": "VendorContactsTabFragment_contact",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "email",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "phone",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "role",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
}
],
"type": "VendorContact",
"abstractKey": null
};
(node as any).hash = "9c3e5b8b262263249160f5fd3708162a";
export default node;

View File

@@ -61,6 +61,14 @@ export const vendorRoutes = [
)
),
},
{
path: "contacts",
fallback: LinkCardSkeleton,
Component: lazy(
() =>
import("../pages/organizations/vendors/tabs/VendorContactsTab")
),
},
],
},
] satisfies AppRoute[];