Remove trust center slug config UI
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -5,7 +5,6 @@ export const trustCenterByIdQuery = graphql`
|
||||
node(id: $trustCenterId) {
|
||||
... on TrustCenter {
|
||||
id
|
||||
slug
|
||||
active
|
||||
organization {
|
||||
id
|
||||
|
||||
@@ -15,7 +15,6 @@ export const trustCenterQuery = graphql`
|
||||
trustCenter {
|
||||
id
|
||||
active
|
||||
slug
|
||||
ndaFileName
|
||||
ndaFileUrl
|
||||
createdAt
|
||||
@@ -69,7 +68,6 @@ export const updateTrustCenterMutation = graphql`
|
||||
trustCenter {
|
||||
id
|
||||
active
|
||||
slug
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<6e43a07222fde7acc3d588bac24a8077>>
|
||||
* @generated SignedSource<<04ca9566a32dd6c4ec830303d27040b3>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -20,7 +20,6 @@ export type TrustCenterAccessTokenGraphQuery$data = {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
};
|
||||
readonly slug?: string;
|
||||
};
|
||||
};
|
||||
export type TrustCenterAccessTokenGraphQuery = {
|
||||
@@ -51,20 +50,13 @@ v2 = {
|
||||
"storageKey": null
|
||||
},
|
||||
v3 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "slug",
|
||||
"storageKey": null
|
||||
},
|
||||
v4 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
v5 = {
|
||||
v4 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "Organization",
|
||||
@@ -103,8 +95,7 @@ return {
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
(v3/*: any*/),
|
||||
(v4/*: any*/),
|
||||
(v5/*: any*/)
|
||||
(v4/*: any*/)
|
||||
],
|
||||
"type": "TrustCenter",
|
||||
"abstractKey": null
|
||||
@@ -142,8 +133,7 @@ return {
|
||||
"kind": "InlineFragment",
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
(v4/*: any*/),
|
||||
(v5/*: any*/)
|
||||
(v4/*: any*/)
|
||||
],
|
||||
"type": "TrustCenter",
|
||||
"abstractKey": null
|
||||
@@ -154,16 +144,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "7d3d891944391d31a722364f8b1f1cbb",
|
||||
"cacheID": "3149be57889b4ab4716cf9a8cce2ab8c",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "TrustCenterAccessTokenGraphQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query TrustCenterAccessTokenGraphQuery(\n $trustCenterId: ID!\n) {\n node(id: $trustCenterId) {\n __typename\n ... on TrustCenter {\n id\n slug\n active\n organization {\n id\n name\n }\n }\n id\n }\n}\n"
|
||||
"text": "query TrustCenterAccessTokenGraphQuery(\n $trustCenterId: ID!\n) {\n node(id: $trustCenterId) {\n __typename\n ... on TrustCenter {\n id\n active\n organization {\n id\n name\n }\n }\n id\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "e273d4e8c8b756a5aba5271520df8602";
|
||||
(node as any).hash = "0eff39cd61d08eeff978f26d88a52edf";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<8cd42363722a49fe7e843086be0c6b4f>>
|
||||
* @generated SignedSource<<8e92507c4ea06441e81f19bdcd6d4feb>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -56,7 +56,6 @@ export type TrustCenterGraphQuery$data = {
|
||||
};
|
||||
}>;
|
||||
};
|
||||
readonly slug: string;
|
||||
readonly updatedAt: any;
|
||||
} | null | undefined;
|
||||
readonly vendors?: {
|
||||
@@ -164,13 +163,6 @@ v9 = {
|
||||
"name": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "slug",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -669,16 +661,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "5344c186b2f81c2e3e82e2e7398c477a",
|
||||
"cacheID": "89f1657de6e2c073609a2c69d7b2d747",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "TrustCenterGraphQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query TrustCenterGraphQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n name\n customDomain {\n id\n domain\n }\n trustCenter {\n id\n active\n slug\n ndaFileName\n ndaFileUrl\n createdAt\n updatedAt\n references(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n name\n description\n websiteUrl\n logoUrl\n createdAt\n updatedAt\n }\n }\n }\n }\n documents(first: 100) {\n edges {\n node {\n id\n ...TrustCenterDocumentsCardFragment\n }\n }\n }\n audits(first: 100) {\n edges {\n node {\n id\n ...TrustCenterAuditsCardFragment\n }\n }\n }\n vendors(first: 100) {\n edges {\n node {\n id\n ...TrustCenterVendorsCardFragment\n }\n }\n }\n }\n id\n }\n}\n\nfragment TrustCenterAuditsCardFragment on Audit {\n id\n name\n framework {\n name\n id\n }\n validFrom\n validUntil\n state\n trustCenterVisibility\n createdAt\n}\n\nfragment TrustCenterDocumentsCardFragment on Document {\n id\n title\n createdAt\n documentType\n trustCenterVisibility\n versions(first: 1) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n\nfragment TrustCenterVendorsCardFragment on Vendor {\n id\n name\n category\n description\n showOnTrustCenter\n createdAt\n}\n"
|
||||
"text": "query TrustCenterGraphQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n name\n customDomain {\n id\n domain\n }\n trustCenter {\n id\n active\n ndaFileName\n ndaFileUrl\n createdAt\n updatedAt\n references(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {\n edges {\n node {\n id\n name\n description\n websiteUrl\n logoUrl\n createdAt\n updatedAt\n }\n }\n }\n }\n documents(first: 100) {\n edges {\n node {\n id\n ...TrustCenterDocumentsCardFragment\n }\n }\n }\n audits(first: 100) {\n edges {\n node {\n id\n ...TrustCenterAuditsCardFragment\n }\n }\n }\n vendors(first: 100) {\n edges {\n node {\n id\n ...TrustCenterVendorsCardFragment\n }\n }\n }\n }\n id\n }\n}\n\nfragment TrustCenterAuditsCardFragment on Audit {\n id\n name\n framework {\n name\n id\n }\n validFrom\n validUntil\n state\n trustCenterVisibility\n createdAt\n}\n\nfragment TrustCenterDocumentsCardFragment on Document {\n id\n title\n createdAt\n documentType\n trustCenterVisibility\n versions(first: 1) {\n edges {\n node {\n id\n status\n }\n }\n }\n}\n\nfragment TrustCenterVendorsCardFragment on Vendor {\n id\n name\n category\n description\n showOnTrustCenter\n createdAt\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "e23ad5ad1f1e29900a49be2312244147";
|
||||
(node as any).hash = "60725f4e10d6e720a09a883430854ada";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<c257950f58c4b876a6ff7ef6083f005b>>
|
||||
* @generated SignedSource<<138afd21c62a2f7940b64b40c61e2014>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -11,7 +11,6 @@
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type UpdateTrustCenterInput = {
|
||||
active?: boolean | null | undefined;
|
||||
slug?: string | null | undefined;
|
||||
trustCenterId: string;
|
||||
};
|
||||
export type TrustCenterGraphUpdateMutation$variables = {
|
||||
@@ -22,7 +21,6 @@ export type TrustCenterGraphUpdateMutation$data = {
|
||||
readonly trustCenter: {
|
||||
readonly active: boolean;
|
||||
readonly id: string;
|
||||
readonly slug: string;
|
||||
readonly updatedAt: any;
|
||||
};
|
||||
};
|
||||
@@ -77,13 +75,6 @@ v1 = [
|
||||
"name": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "slug",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
@@ -116,16 +107,16 @@ return {
|
||||
"selections": (v1/*: any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "18e80937923185923d9b427819334337",
|
||||
"cacheID": "4d56330e76f63430b88de2deac6d73ff",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "TrustCenterGraphUpdateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation TrustCenterGraphUpdateMutation(\n $input: UpdateTrustCenterInput!\n) {\n updateTrustCenter(input: $input) {\n trustCenter {\n id\n active\n slug\n updatedAt\n }\n }\n}\n"
|
||||
"text": "mutation TrustCenterGraphUpdateMutation(\n $input: UpdateTrustCenterInput!\n) {\n updateTrustCenter(input: $input) {\n trustCenter {\n id\n active\n updatedAt\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "988f3baf354e729d6cc9482129040898";
|
||||
(node as any).hash = "e5db4ea1986315fc8103885fee2ede5b";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -5,8 +5,6 @@ import {
|
||||
Card,
|
||||
Checkbox,
|
||||
Dropzone,
|
||||
Field,
|
||||
Input,
|
||||
PageHeader,
|
||||
Spinner,
|
||||
useToast,
|
||||
@@ -38,8 +36,6 @@ export default function TrustCenterPage({ queryRef }: Props) {
|
||||
const [uploadNDA, isUploadingNDA] = useUploadTrustCenterNDAMutation();
|
||||
const [deleteNDA, isDeletingNDA] = useDeleteTrustCenterNDAMutation();
|
||||
const [isActive, setIsActive] = useState(organization.trustCenter?.active || false);
|
||||
const [slug, setSlug] = useState(organization.trustCenter?.slug || "");
|
||||
const [isUpdatingSlug, setIsUpdatingSlug] = useState(false);
|
||||
|
||||
usePageTitle(__("Trust Center"));
|
||||
|
||||
@@ -68,44 +64,6 @@ export default function TrustCenterPage({ queryRef }: Props) {
|
||||
});
|
||||
};
|
||||
|
||||
const handleSlugUpdate = async () => {
|
||||
if (!organization.trustCenter?.id) {
|
||||
toast({
|
||||
title: __("Error"),
|
||||
description: __("Trust center not found"),
|
||||
variant: "error",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!slug.trim()) {
|
||||
toast({
|
||||
title: __("Error"),
|
||||
description: __("Slug cannot be empty"),
|
||||
variant: "error",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
setIsUpdatingSlug(true);
|
||||
|
||||
updateTrustCenter({
|
||||
variables: {
|
||||
input: {
|
||||
trustCenterId: organization.trustCenter.id,
|
||||
slug: slug.trim(),
|
||||
},
|
||||
},
|
||||
onCompleted: () => {
|
||||
setIsUpdatingSlug(false);
|
||||
},
|
||||
onError: () => {
|
||||
setIsUpdatingSlug(false);
|
||||
setSlug(organization.trustCenter?.slug || "");
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const handleNDAUpload = async (files: File[]) => {
|
||||
if (!organization.trustCenter?.id) {
|
||||
toast({
|
||||
@@ -233,42 +191,6 @@ export default function TrustCenterPage({ queryRef }: Props) {
|
||||
)}
|
||||
</Card>
|
||||
</div>
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<h2 className="text-base font-medium">{__("Configuration")}</h2>
|
||||
{isUpdatingSlug && <Spinner />}
|
||||
</div>
|
||||
<Card padded className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Field
|
||||
label={__("Slug")}
|
||||
help={__("The unique identifier for your trust center URL")}
|
||||
>
|
||||
<div className="flex items-center space-x-2">
|
||||
<div className="flex items-center">
|
||||
<Input
|
||||
value={slug}
|
||||
onChange={(e) => setSlug(e.target.value)}
|
||||
placeholder={__("your-organization")}
|
||||
className="min-w-[200px]"
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={handleSlugUpdate}
|
||||
disabled={
|
||||
isUpdatingSlug ||
|
||||
!slug.trim() ||
|
||||
slug === organization.trustCenter?.slug
|
||||
}
|
||||
>
|
||||
{__("Update")}
|
||||
</Button>
|
||||
</div>
|
||||
</Field>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
|
||||
@@ -147,7 +147,9 @@ enum AuditState
|
||||
}
|
||||
|
||||
enum TrustCenterVisibility
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.TrustCenterVisibility") {
|
||||
@goModel(
|
||||
model: "github.com/getprobo/probo/pkg/coredata.TrustCenterVisibility"
|
||||
) {
|
||||
NONE
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.TrustCenterVisibilityNone"
|
||||
@@ -943,7 +945,9 @@ enum DocumentType
|
||||
POLICY
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DocumentTypePolicy")
|
||||
PROCEDURE
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DocumentTypeProcedure")
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.DocumentTypeProcedure"
|
||||
)
|
||||
}
|
||||
|
||||
enum AssetType
|
||||
@@ -1131,7 +1135,9 @@ enum TrustCenterAccessOrderField
|
||||
}
|
||||
|
||||
enum TrustCenterDocumentAccessOrderField
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.TrustCenterDocumentAccessOrderField") {
|
||||
@goModel(
|
||||
model: "github.com/getprobo/probo/pkg/coredata.TrustCenterDocumentAccessOrderField"
|
||||
) {
|
||||
CREATED_AT
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.TrustCenterDocumentAccessOrderFieldCreatedAt"
|
||||
@@ -1424,10 +1430,6 @@ input PeopleFilter {
|
||||
excludeContractEnded: Boolean
|
||||
}
|
||||
|
||||
input OrganizationFilter {
|
||||
trustCenterSlug: String
|
||||
}
|
||||
|
||||
input DatumFilter {
|
||||
snapshotId: ID
|
||||
}
|
||||
@@ -1460,7 +1462,6 @@ input VendorFilter {
|
||||
type TrustCenter implements Node {
|
||||
id: ID!
|
||||
active: Boolean!
|
||||
slug: String!
|
||||
ndaFileName: String
|
||||
ndaFileUrl: String @goField(forceResolver: true)
|
||||
createdAt: Datetime!
|
||||
@@ -2202,7 +2203,6 @@ type Viewer {
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: OrganizationOrder
|
||||
filter: OrganizationFilter
|
||||
): OrganizationConnection! @goField(forceResolver: true)
|
||||
}
|
||||
|
||||
@@ -2597,13 +2597,13 @@ type SnapshotEdge {
|
||||
}
|
||||
|
||||
type File {
|
||||
id: ID!
|
||||
mimeType: String!
|
||||
fileName: String!
|
||||
size: BigInt!
|
||||
downloadUrl: String! @goField(forceResolver: true)
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
id: ID!
|
||||
mimeType: String!
|
||||
fileName: String!
|
||||
size: BigInt!
|
||||
downloadUrl: String! @goField(forceResolver: true)
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
}
|
||||
|
||||
# Root Types
|
||||
@@ -2963,7 +2963,6 @@ input DeleteOrganizationInput {
|
||||
input UpdateTrustCenterInput {
|
||||
trustCenterId: ID!
|
||||
active: Boolean
|
||||
slug: String
|
||||
}
|
||||
|
||||
input UploadTrustCenterNDAInput {
|
||||
|
||||
@@ -1202,7 +1202,6 @@ type ComplexityRoot struct {
|
||||
NdaFileURL func(childComplexity int) int
|
||||
Organization func(childComplexity int) int
|
||||
References func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.TrustCenterReferenceOrderField]) int
|
||||
Slug func(childComplexity int) int
|
||||
UpdatedAt func(childComplexity int) int
|
||||
}
|
||||
|
||||
@@ -1575,7 +1574,7 @@ type ComplexityRoot struct {
|
||||
|
||||
Viewer struct {
|
||||
ID func(childComplexity int) int
|
||||
Organizations func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrganizationOrder, filter *types.OrganizationFilter) int
|
||||
Organizations func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrganizationOrder) int
|
||||
User func(childComplexity int) int
|
||||
}
|
||||
}
|
||||
@@ -1951,7 +1950,7 @@ type VendorServiceResolver interface {
|
||||
Vendor(ctx context.Context, obj *types.VendorService) (*types.Vendor, error)
|
||||
}
|
||||
type ViewerResolver interface {
|
||||
Organizations(ctx context.Context, obj *types.Viewer, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrganizationOrder, filter *types.OrganizationFilter) (*types.OrganizationConnection, error)
|
||||
Organizations(ctx context.Context, obj *types.Viewer, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrganizationOrder) (*types.OrganizationConnection, error)
|
||||
}
|
||||
|
||||
type executableSchema struct {
|
||||
@@ -7127,13 +7126,6 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
||||
|
||||
return e.complexity.TrustCenter.References(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.OrderBy[coredata.TrustCenterReferenceOrderField])), true
|
||||
|
||||
case "TrustCenter.slug":
|
||||
if e.complexity.TrustCenter.Slug == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.TrustCenter.Slug(childComplexity), true
|
||||
|
||||
case "TrustCenter.updatedAt":
|
||||
if e.complexity.TrustCenter.UpdatedAt == nil {
|
||||
break
|
||||
@@ -8455,7 +8447,7 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return e.complexity.Viewer.Organizations(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.OrganizationOrder), args["filter"].(*types.OrganizationFilter)), true
|
||||
return e.complexity.Viewer.Organizations(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.OrganizationOrder)), true
|
||||
|
||||
case "Viewer.user":
|
||||
if e.complexity.Viewer.User == nil {
|
||||
@@ -8580,7 +8572,6 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler {
|
||||
ec.unmarshalInputNonconformityOrder,
|
||||
ec.unmarshalInputObligationFilter,
|
||||
ec.unmarshalInputObligationOrder,
|
||||
ec.unmarshalInputOrganizationFilter,
|
||||
ec.unmarshalInputOrganizationOrder,
|
||||
ec.unmarshalInputPeopleFilter,
|
||||
ec.unmarshalInputPeopleOrder,
|
||||
@@ -8882,7 +8873,9 @@ enum AuditState
|
||||
}
|
||||
|
||||
enum TrustCenterVisibility
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.TrustCenterVisibility") {
|
||||
@goModel(
|
||||
model: "github.com/getprobo/probo/pkg/coredata.TrustCenterVisibility"
|
||||
) {
|
||||
NONE
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.TrustCenterVisibilityNone"
|
||||
@@ -9678,7 +9671,9 @@ enum DocumentType
|
||||
POLICY
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DocumentTypePolicy")
|
||||
PROCEDURE
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DocumentTypeProcedure")
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.DocumentTypeProcedure"
|
||||
)
|
||||
}
|
||||
|
||||
enum AssetType
|
||||
@@ -9866,7 +9861,9 @@ enum TrustCenterAccessOrderField
|
||||
}
|
||||
|
||||
enum TrustCenterDocumentAccessOrderField
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.TrustCenterDocumentAccessOrderField") {
|
||||
@goModel(
|
||||
model: "github.com/getprobo/probo/pkg/coredata.TrustCenterDocumentAccessOrderField"
|
||||
) {
|
||||
CREATED_AT
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.TrustCenterDocumentAccessOrderFieldCreatedAt"
|
||||
@@ -10159,10 +10156,6 @@ input PeopleFilter {
|
||||
excludeContractEnded: Boolean
|
||||
}
|
||||
|
||||
input OrganizationFilter {
|
||||
trustCenterSlug: String
|
||||
}
|
||||
|
||||
input DatumFilter {
|
||||
snapshotId: ID
|
||||
}
|
||||
@@ -10195,7 +10188,6 @@ input VendorFilter {
|
||||
type TrustCenter implements Node {
|
||||
id: ID!
|
||||
active: Boolean!
|
||||
slug: String!
|
||||
ndaFileName: String
|
||||
ndaFileUrl: String @goField(forceResolver: true)
|
||||
createdAt: Datetime!
|
||||
@@ -10937,7 +10929,6 @@ type Viewer {
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: OrganizationOrder
|
||||
filter: OrganizationFilter
|
||||
): OrganizationConnection! @goField(forceResolver: true)
|
||||
}
|
||||
|
||||
@@ -11332,13 +11323,13 @@ type SnapshotEdge {
|
||||
}
|
||||
|
||||
type File {
|
||||
id: ID!
|
||||
mimeType: String!
|
||||
fileName: String!
|
||||
size: BigInt!
|
||||
downloadUrl: String! @goField(forceResolver: true)
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
id: ID!
|
||||
mimeType: String!
|
||||
fileName: String!
|
||||
size: BigInt!
|
||||
downloadUrl: String! @goField(forceResolver: true)
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
}
|
||||
|
||||
# Root Types
|
||||
@@ -11698,7 +11689,6 @@ input DeleteOrganizationInput {
|
||||
input UpdateTrustCenterInput {
|
||||
trustCenterId: ID!
|
||||
active: Boolean
|
||||
slug: String
|
||||
}
|
||||
|
||||
input UploadTrustCenterNDAInput {
|
||||
@@ -20855,11 +20845,6 @@ func (ec *executionContext) field_Viewer_organizations_args(ctx context.Context,
|
||||
return nil, err
|
||||
}
|
||||
args["orderBy"] = arg4
|
||||
arg5, err := ec.field_Viewer_organizations_argsFilter(ctx, rawArgs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
args["filter"] = arg5
|
||||
return args, nil
|
||||
}
|
||||
func (ec *executionContext) field_Viewer_organizations_argsFirst(
|
||||
@@ -20927,19 +20912,6 @@ func (ec *executionContext) field_Viewer_organizations_argsOrderBy(
|
||||
return zeroVal, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Viewer_organizations_argsFilter(
|
||||
ctx context.Context,
|
||||
rawArgs map[string]any,
|
||||
) (*types.OrganizationFilter, error) {
|
||||
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter"))
|
||||
if tmp, ok := rawArgs["filter"]; ok {
|
||||
return ec.unmarshalOOrganizationFilter2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐOrganizationFilter(ctx, tmp)
|
||||
}
|
||||
|
||||
var zeroVal *types.OrganizationFilter
|
||||
return zeroVal, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field___Directive_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
|
||||
var err error
|
||||
args := map[string]any{}
|
||||
@@ -30704,8 +30676,6 @@ func (ec *executionContext) fieldContext_DeleteTrustCenterNDAPayload_trustCenter
|
||||
return ec.fieldContext_TrustCenter_id(ctx, field)
|
||||
case "active":
|
||||
return ec.fieldContext_TrustCenter_active(ctx, field)
|
||||
case "slug":
|
||||
return ec.fieldContext_TrustCenter_slug(ctx, field)
|
||||
case "ndaFileName":
|
||||
return ec.fieldContext_TrustCenter_ndaFileName(ctx, field)
|
||||
case "ndaFileUrl":
|
||||
@@ -46804,8 +46774,6 @@ func (ec *executionContext) fieldContext_Organization_trustCenter(_ context.Cont
|
||||
return ec.fieldContext_TrustCenter_id(ctx, field)
|
||||
case "active":
|
||||
return ec.fieldContext_TrustCenter_active(ctx, field)
|
||||
case "slug":
|
||||
return ec.fieldContext_TrustCenter_slug(ctx, field)
|
||||
case "ndaFileName":
|
||||
return ec.fieldContext_TrustCenter_ndaFileName(ctx, field)
|
||||
case "ndaFileUrl":
|
||||
@@ -53381,50 +53349,6 @@ func (ec *executionContext) fieldContext_TrustCenter_active(_ context.Context, f
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _TrustCenter_slug(ctx context.Context, field graphql.CollectedField, obj *types.TrustCenter) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_TrustCenter_slug(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.Slug, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(string)
|
||||
fc.Result = res
|
||||
return ec.marshalNString2string(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_TrustCenter_slug(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "TrustCenter",
|
||||
Field: field,
|
||||
IsMethod: false,
|
||||
IsResolver: false,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
return nil, errors.New("field of type String does not have child fields")
|
||||
},
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _TrustCenter_ndaFileName(ctx context.Context, field graphql.CollectedField, obj *types.TrustCenter) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_TrustCenter_ndaFileName(ctx, field)
|
||||
if err != nil {
|
||||
@@ -55215,8 +55139,6 @@ func (ec *executionContext) fieldContext_TrustCenterEdge_node(_ context.Context,
|
||||
return ec.fieldContext_TrustCenter_id(ctx, field)
|
||||
case "active":
|
||||
return ec.fieldContext_TrustCenter_active(ctx, field)
|
||||
case "slug":
|
||||
return ec.fieldContext_TrustCenter_slug(ctx, field)
|
||||
case "ndaFileName":
|
||||
return ec.fieldContext_TrustCenter_ndaFileName(ctx, field)
|
||||
case "ndaFileUrl":
|
||||
@@ -57159,8 +57081,6 @@ func (ec *executionContext) fieldContext_UpdateTrustCenterPayload_trustCenter(_
|
||||
return ec.fieldContext_TrustCenter_id(ctx, field)
|
||||
case "active":
|
||||
return ec.fieldContext_TrustCenter_active(ctx, field)
|
||||
case "slug":
|
||||
return ec.fieldContext_TrustCenter_slug(ctx, field)
|
||||
case "ndaFileName":
|
||||
return ec.fieldContext_TrustCenter_ndaFileName(ctx, field)
|
||||
case "ndaFileUrl":
|
||||
@@ -57763,8 +57683,6 @@ func (ec *executionContext) fieldContext_UploadTrustCenterNDAPayload_trustCenter
|
||||
return ec.fieldContext_TrustCenter_id(ctx, field)
|
||||
case "active":
|
||||
return ec.fieldContext_TrustCenter_active(ctx, field)
|
||||
case "slug":
|
||||
return ec.fieldContext_TrustCenter_slug(ctx, field)
|
||||
case "ndaFileName":
|
||||
return ec.fieldContext_TrustCenter_ndaFileName(ctx, field)
|
||||
case "ndaFileUrl":
|
||||
@@ -63716,7 +63634,7 @@ func (ec *executionContext) _Viewer_organizations(ctx context.Context, field gra
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return ec.resolvers.Viewer().Organizations(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.OrganizationOrder), fc.Args["filter"].(*types.OrganizationFilter))
|
||||
return ec.resolvers.Viewer().Organizations(rctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.OrganizationOrder))
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
@@ -69953,33 +69871,6 @@ func (ec *executionContext) unmarshalInputObligationOrder(ctx context.Context, o
|
||||
return it, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) unmarshalInputOrganizationFilter(ctx context.Context, obj any) (types.OrganizationFilter, error) {
|
||||
var it types.OrganizationFilter
|
||||
asMap := map[string]any{}
|
||||
for k, v := range obj.(map[string]any) {
|
||||
asMap[k] = v
|
||||
}
|
||||
|
||||
fieldsInOrder := [...]string{"trustCenterSlug"}
|
||||
for _, k := range fieldsInOrder {
|
||||
v, ok := asMap[k]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
switch k {
|
||||
case "trustCenterSlug":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("trustCenterSlug"))
|
||||
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
||||
if err != nil {
|
||||
return it, err
|
||||
}
|
||||
it.TrustCenterSlug = data
|
||||
}
|
||||
}
|
||||
|
||||
return it, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) unmarshalInputOrganizationOrder(ctx context.Context, obj any) (types.OrganizationOrder, error) {
|
||||
var it types.OrganizationOrder
|
||||
asMap := map[string]any{}
|
||||
@@ -71786,7 +71677,7 @@ func (ec *executionContext) unmarshalInputUpdateTrustCenterInput(ctx context.Con
|
||||
asMap[k] = v
|
||||
}
|
||||
|
||||
fieldsInOrder := [...]string{"trustCenterId", "active", "slug"}
|
||||
fieldsInOrder := [...]string{"trustCenterId", "active"}
|
||||
for _, k := range fieldsInOrder {
|
||||
v, ok := asMap[k]
|
||||
if !ok {
|
||||
@@ -71807,13 +71698,6 @@ func (ec *executionContext) unmarshalInputUpdateTrustCenterInput(ctx context.Con
|
||||
return it, err
|
||||
}
|
||||
it.Active = data
|
||||
case "slug":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("slug"))
|
||||
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
||||
if err != nil {
|
||||
return it, err
|
||||
}
|
||||
it.Slug = data
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84523,11 +84407,6 @@ func (ec *executionContext) _TrustCenter(ctx context.Context, sel ast.SelectionS
|
||||
if out.Values[i] == graphql.Null {
|
||||
atomic.AddUint32(&out.Invalids, 1)
|
||||
}
|
||||
case "slug":
|
||||
out.Values[i] = ec._TrustCenter_slug(ctx, field, obj)
|
||||
if out.Values[i] == graphql.Null {
|
||||
atomic.AddUint32(&out.Invalids, 1)
|
||||
}
|
||||
case "ndaFileName":
|
||||
out.Values[i] = ec._TrustCenter_ndaFileName(ctx, field, obj)
|
||||
case "ndaFileUrl":
|
||||
@@ -98146,14 +98025,6 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
func (ec *executionContext) unmarshalOOrganizationFilter2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐOrganizationFilter(ctx context.Context, v any) (*types.OrganizationFilter, error) {
|
||||
if v == nil {
|
||||
return nil, nil
|
||||
}
|
||||
res, err := ec.unmarshalInputOrganizationFilter(ctx, v)
|
||||
return &res, graphql.ErrorOnPath(ctx, err)
|
||||
}
|
||||
|
||||
func (ec *executionContext) unmarshalOOrganizationOrder2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐOrganizationOrder(ctx context.Context, v any) (*types.OrganizationOrder, error) {
|
||||
if v == nil {
|
||||
return nil, nil
|
||||
|
||||
@@ -27,7 +27,6 @@ func NewTrustCenter(tc *coredata.TrustCenter, file *coredata.File) *TrustCenter
|
||||
return &TrustCenter{
|
||||
ID: tc.ID,
|
||||
Active: tc.Active,
|
||||
Slug: tc.Slug,
|
||||
NdaFileName: ndaFileName,
|
||||
CreatedAt: tc.CreatedAt,
|
||||
UpdatedAt: tc.UpdatedAt,
|
||||
|
||||
@@ -1338,10 +1338,6 @@ type OrganizationEdge struct {
|
||||
Node *Organization `json:"node"`
|
||||
}
|
||||
|
||||
type OrganizationFilter struct {
|
||||
TrustCenterSlug *string `json:"trustCenterSlug,omitempty"`
|
||||
}
|
||||
|
||||
type OrganizationOrder struct {
|
||||
Direction page.OrderDirection `json:"direction"`
|
||||
Field coredata.OrganizationOrderField `json:"field"`
|
||||
@@ -1566,7 +1562,6 @@ type TaskEdge struct {
|
||||
type TrustCenter struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Active bool `json:"active"`
|
||||
Slug string `json:"slug"`
|
||||
NdaFileName *string `json:"ndaFileName,omitempty"`
|
||||
NdaFileURL *string `json:"ndaFileUrl,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
@@ -1902,7 +1897,6 @@ type UpdateTrustCenterAccessPayload struct {
|
||||
type UpdateTrustCenterInput struct {
|
||||
TrustCenterID gid.GID `json:"trustCenterId"`
|
||||
Active *bool `json:"active,omitempty"`
|
||||
Slug *string `json:"slug,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateTrustCenterPayload struct {
|
||||
|
||||
@@ -1153,7 +1153,6 @@ func (r *mutationResolver) UpdateTrustCenter(ctx context.Context, input types.Up
|
||||
trustCenter, file, err := prb.TrustCenters.Update(ctx, &probo.UpdateTrustCenterRequest{
|
||||
ID: input.TrustCenterID,
|
||||
Active: input.Active,
|
||||
Slug: input.Slug,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot update trust center: %w", err)
|
||||
@@ -5215,7 +5214,7 @@ func (r *vendorServiceResolver) Vendor(ctx context.Context, obj *types.VendorSer
|
||||
}
|
||||
|
||||
// Organizations is the resolver for the organizations field.
|
||||
func (r *viewerResolver) Organizations(ctx context.Context, obj *types.Viewer, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrganizationOrder, filter *types.OrganizationFilter) (*types.OrganizationConnection, error) {
|
||||
func (r *viewerResolver) Organizations(ctx context.Context, obj *types.Viewer, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrganizationOrder) (*types.OrganizationConnection, error) {
|
||||
user := UserFromContext(ctx)
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.OrganizationOrderField]{
|
||||
|
||||
Reference in New Issue
Block a user