Add new console compliance page brand tab

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-01-29 16:22:23 +04:00
parent 65deef5d29
commit 8b5b9e732f
11 changed files with 610 additions and 98 deletions

View File

@@ -0,0 +1,167 @@
/**
* @generated SignedSource<<be7955648260f44b4b42a2b342db2b05>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type CompliancePageBrandPageQuery$variables = {
organizationId: string;
};
export type CompliancePageBrandPageQuery$data = {
readonly organization: {
readonly compliancePage?: {
readonly darkLogoFileUrl: string | null | undefined;
readonly logoFileUrl: string | null | undefined;
} | null | undefined;
};
};
export type CompliancePageBrandPageQuery = {
response: CompliancePageBrandPageQuery$data;
variables: CompliancePageBrandPageQuery$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "organizationId"
}
],
v1 = [
{
"kind": "Variable",
"name": "id",
"variableName": "organizationId"
}
],
v2 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "logoFileUrl",
"storageKey": null
},
v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "darkLogoFileUrl",
"storageKey": null
},
v4 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
};
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "CompliancePageBrandPageQuery",
"selections": [
{
"alias": "organization",
"args": (v1/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
{
"kind": "InlineFragment",
"selections": [
{
"alias": "compliancePage",
"args": null,
"concreteType": "TrustCenter",
"kind": "LinkedField",
"name": "trustCenter",
"plural": false,
"selections": [
(v2/*: any*/),
(v3/*: any*/)
],
"storageKey": null
}
],
"type": "Organization",
"abstractKey": null
}
],
"storageKey": null
}
],
"type": "Query",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "CompliancePageBrandPageQuery",
"selections": [
{
"alias": "organization",
"args": (v1/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
{
"kind": "InlineFragment",
"selections": [
{
"alias": "compliancePage",
"args": null,
"concreteType": "TrustCenter",
"kind": "LinkedField",
"name": "trustCenter",
"plural": false,
"selections": [
(v2/*: any*/),
(v3/*: any*/),
(v4/*: any*/)
],
"storageKey": null
}
],
"type": "Organization",
"abstractKey": null
},
(v4/*: any*/)
],
"storageKey": null
}
]
},
"params": {
"cacheID": "17e4be042ed0e09a4b299d38f33dff32",
"id": null,
"metadata": {},
"name": "CompliancePageBrandPageQuery",
"operationKind": "query",
"text": "query CompliancePageBrandPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n compliancePage: trustCenter {\n logoFileUrl\n darkLogoFileUrl\n id\n }\n }\n id\n }\n}\n"
}
};
})();
(node as any).hash = "3364d36a8dd77d39d00d50f451a027a7";
export default node;

View File

@@ -1,6 +1,6 @@
import { usePageTitle } from "@probo/hooks";
import { useTranslate } from "@probo/i18n";
import { Badge, IconCheckmark1, IconFolder2, IconMedal, IconPageTextLine, IconPeopleAdd, IconSettingsGear2, IconStore, PageHeader, TabLink, Tabs } from "@probo/ui";
import { Badge, IconCheckmark1, IconFolder2, IconMedal, IconPageTextLine, IconPencil, IconPeopleAdd, IconSettingsGear2, IconStore, PageHeader, TabLink, Tabs } from "@probo/ui";
import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
import { Outlet } from "react-router";
import { graphql } from "relay-runtime";
@@ -52,6 +52,10 @@ export function CompliancePageLayout(props: { queryRef: PreloadedQuery<Complianc
<IconSettingsGear2 className="size-4" />
{__("Overview")}
</TabLink>
<TabLink to={`/organizations/${organizationId}/compliance-page/brand`}>
<IconPencil className="size-4" />
{__("Brand")}
</TabLink>
<TabLink to={`/organizations/${organizationId}/compliance-page/domain`}>
<IconStore className="size-4" />
{__("Domain")}

View File

@@ -0,0 +1,25 @@
import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
import { graphql } from "relay-runtime";
import type { CompliancePageBrandPageQuery } from "#/__generated__/core/CompliancePageBrandPageQuery.graphql";
export const compliancePageBrandPageQuery = graphql`
query CompliancePageBrandPageQuery($organizationId: ID!) {
organization: node(id: $organizationId) {
... on Organization {
compliancePage: trustCenter {
logoFileUrl
darkLogoFileUrl
}
}
}
}
`;
export function CompliancePageBrandPage(props: { queryRef: PreloadedQuery<CompliancePageBrandPageQuery> }) {
const { queryRef } = props;
const { organization } = usePreloadedQuery<CompliancePageBrandPageQuery>(compliancePageBrandPageQuery, queryRef);
return <pre>{JSON.stringify(organization, null, 2)}</pre>;
}

View File

@@ -0,0 +1,32 @@
import { useEffect } from "react";
import { useQueryLoader } from "react-relay";
import type { CompliancePageBrandPageQuery } from "#/__generated__/core/CompliancePageBrandPageQuery.graphql";
import { LinkCardSkeleton } from "#/components/skeletons/LinkCardSkeleton";
import { useOrganizationId } from "#/hooks/useOrganizationId";
import { CoreRelayProvider } from "#/providers/CoreRelayProvider";
import { CompliancePageBrandPage, compliancePageBrandPageQuery } from "./CompliancePageBrandPage";
function CompliancePageBrandPageQueryLoader() {
const organizationId = useOrganizationId();
const [queryRef, loadQuery] = useQueryLoader<CompliancePageBrandPageQuery>(compliancePageBrandPageQuery);
useEffect(() => {
if (!queryRef) {
loadQuery({ organizationId });
}
});
if (!queryRef) return <LinkCardSkeleton />;
return <CompliancePageBrandPage queryRef={queryRef} />;
}
export default function CompliancePageBrandPageLoader() {
return (
<CoreRelayProvider>
<CompliancePageBrandPageQueryLoader />
</CoreRelayProvider>
);
}

View File

@@ -22,6 +22,11 @@ export const compliancePageRoutes = [
import("#/pages/organizations/compliance-page/domain/CompliancePageDomainPageLoader"),
),
},
{
path: "brand",
Fallback: LinkCardSkeleton,
Component: lazy(() => import("#/pages/organizations/compliance-page/brand/CompliancePageBrandPageLoader")),
},
{
path: "references",
Fallback: LinkCardSkeleton,