Upgrade frontend toolchain to latest majors

Bump React 19.2, Relay 21, React Router 8, Vite 8 with
@vitejs/plugin-react 6, ESLint 10, GraphQL 17, TypeScript 6,
@types/node 24, and Tailwind 4.3 across the workspaces.

vite-plugin-react 6 (Vite 8) no longer runs Babel, so the Relay
tagged-template transform now runs through @rolldown/plugin-babel
in the console and trust Vite configs.

Relay 21 ships first-party types and enables the ambiguous-alias
check by default; disable that flag to preserve existing queries
and add explicit usePreloadedQuery type arguments where the new
types no longer infer the operation. TypeScript 6 deprecations and
stricter inference are addressed in tsconfigs and call sites.

Keep n8n-node on ESLint 9 and eslint-plugin-react on 7.37.5, the
newest releases compatible with their toolchains.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-06-18 19:10:00 +02:00
parent f1fc2dc0e0
commit f98b73f073
130 changed files with 2228 additions and 1763 deletions

View File

@@ -23,34 +23,35 @@
"@probo/ui": "1.0.0", "@probo/ui": "1.0.0",
"@tanstack/react-query": "^5.76.1", "@tanstack/react-query": "^5.76.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"react": "^19.1.0", "react": "^19.2.7",
"react-dom": "^19.1.0", "react-dom": "^19.2.7",
"react-dropzone": "^14.3.8", "react-dropzone": "^14.3.8",
"react-error-boundary": "^6.0.0", "react-error-boundary": "^6.0.0",
"react-hook-form": "^7.56.4", "react-hook-form": "^7.56.4",
"react-pdf": "^10.3.0", "react-pdf": "^10.3.0",
"react-relay": "^20.1.1", "react-relay": "^21.0.1",
"react-router": "^7.17.0", "react-router": "^8.0.0",
"relay-runtime": "^20.1.1", "relay-runtime": "^21.0.1",
"use-debounce": "^10.0.5", "use-debounce": "^10.0.5",
"usehooks-ts": "^3.1.1", "usehooks-ts": "^3.1.1",
"zod": "^3.25.17" "zod": "^3.25.17"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.29.0",
"@probo/eslint-config": "1.0.0", "@probo/eslint-config": "1.0.0",
"@probo/eslint-plugin-relay-types": "^1.0.0", "@probo/eslint-plugin-relay-types": "^1.0.0",
"@tailwindcss/vite": "^4.1.7", "@rolldown/plugin-babel": "^0.2.3",
"@types/node": "^22.15.21", "@tailwindcss/vite": "^4.3.1",
"@types/react": "^19.1.2", "@types/babel__core": "^7.20.5",
"@types/react-dom": "^19.1.2", "@types/node": "^24",
"@types/react-relay": "^18.2.1", "@types/react": "^19.2.17",
"@types/relay-runtime": "^20.1.1", "@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.4", "@vitejs/plugin-react": "^6.0.2",
"babel-plugin-relay": "^20.1.1", "babel-plugin-relay": "^21.0.1",
"eslint": "^9.39.2", "eslint": "^10.5.0",
"graphql": "^16.11.0", "graphql": "^17.0.1",
"tailwindcss": "^4.1.7", "tailwindcss": "^4.3.1",
"typescript": "~5.8.3", "typescript": "~6.0.3",
"vite": "^7.3.2" "vite": "^8.0.16"
} }
} }

View File

@@ -39,12 +39,15 @@ export type Order = {
const defaultPageSize = 50; const defaultPageSize = 50;
export const SortableContext = createContext({ export const SortableContext = createContext<{
order: Order;
changeOrder: (order: Order) => void;
}>({
order: { order: {
direction: "DESC", direction: "DESC",
field: "CREATED_AT", field: "CREATED_AT",
}, },
changeOrder: (() => {}) as (order: Order) => void, changeOrder: () => {},
}); });
const defaultOrder = { const defaultOrder = {

View File

@@ -25,7 +25,7 @@ import {
} from "@probo/ui"; } from "@probo/ui";
import { clsx } from "clsx"; import { clsx } from "clsx";
import { type ReactNode } from "react"; import { type ReactNode } from "react";
import type { KeyType, KeyTypeData } from "react-relay/relay-hooks/helpers"; import type { KeyType, KeyTypeData } from "react-relay/ReactRelayTypes";
import type { usePaginationFragmentHookType } from "react-relay/relay-hooks/usePaginationFragment"; import type { usePaginationFragmentHookType } from "react-relay/relay-hooks/usePaginationFragment";
import type { GraphQLTaggedNode, OperationType } from "relay-runtime"; import type { GraphQLTaggedNode, OperationType } from "relay-runtime";
import { z } from "zod"; import { z } from "zod";

View File

@@ -39,18 +39,21 @@ type Order = {
export const defaultPageSize = 50; export const defaultPageSize = 50;
export const SortableContext = createContext({ export const SortableContext = createContext<{
order: Order;
onOrderChange: (order: Order) => void;
}>({
order: { order: {
direction: "DESC", direction: "DESC",
field: "CREATED_AT", field: "CREATED_AT",
}, },
onOrderChange: (() => {}) as (order: Order) => void, onOrderChange: () => {},
}); });
const defaultOrder = { const defaultOrder = {
direction: "DESC", direction: "DESC",
field: "CREATED_AT", field: "CREATED_AT",
} as Order; };
export function SortableDataTable({ export function SortableDataTable({
refetch, refetch,

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { useToast } from "@probo/ui"; import { useToast } from "@probo/ui";
import { useCallback } from "react"; import { useCallback } from "react";
@@ -60,7 +60,7 @@ export function useMutationWithIncrement<T extends MutationParameters>(
const errorTitle = options.errorMessage ?? __("Failed to commit this operation"); const errorTitle = options.errorMessage ?? __("Failed to commit this operation");
toast({ toast({
title: __("Error"), title: __("Error"),
description: formatError(errorTitle, error as GraphQLError[]), description: formatError(errorTitle, error),
variant: "error", variant: "error",
}); });
} else { } else {
@@ -78,7 +78,7 @@ export function useMutationWithIncrement<T extends MutationParameters>(
const errorTitle = options.errorMessage ?? __("Failed to commit this operation"); const errorTitle = options.errorMessage ?? __("Failed to commit this operation");
toast({ toast({
title: __("Error"), title: __("Error"),
description: formatError(errorTitle, error as GraphQLError), description: formatError(errorTitle, error),
variant: "error", variant: "error",
}); });
queryOptions.onError?.(error); queryOptions.onError?.(error);
@@ -100,7 +100,7 @@ export function updateStoreCounter(
) { ) {
commitLocalUpdate(relayEnv, (store) => { commitLocalUpdate(relayEnv, (store) => {
const node = store?.get(recordId)?.getLinkedRecord(nodeName); const node = store?.get(recordId)?.getLinkedRecord(nodeName);
const previousValue = node?.getValue(fieldName); const previousValue: unknown = node?.getValue(fieldName);
if (node && typeof previousValue === "number") { if (node && typeof previousValue === "number") {
node.setValue(previousValue + value, fieldName); node.setValue(previousValue + value, fieldName);
} }

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { useToast } from "@probo/ui"; import { useToast } from "@probo/ui";
import { useCallback } from "react"; import { useCallback } from "react";
@@ -50,7 +50,7 @@ export function useMutationWithToasts<T extends MutationParameters>(
const errorTitle = options.errorMessage ?? __("Failed to commit this operation"); const errorTitle = options.errorMessage ?? __("Failed to commit this operation");
toast({ toast({
title: __("Error"), title: __("Error"),
description: formatError(errorTitle, error as GraphQLError[]), description: formatError(errorTitle, error),
variant: "error", variant: "error",
}); });
reject(new Error(errorTitle)); reject(new Error(errorTitle));
@@ -74,7 +74,7 @@ export function useMutationWithToasts<T extends MutationParameters>(
const errorTitle = options.errorMessage ?? __("Failed to commit this operation"); const errorTitle = options.errorMessage ?? __("Failed to commit this operation");
toast({ toast({
title: __("Error"), title: __("Error"),
description: formatError(errorTitle, error as GraphQLError), description: formatError(errorTitle, error),
variant: "error", variant: "error",
}); });
reject(error); reject(error);

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatDate, formatError, type GraphQLError } from "@probo/helpers"; import { formatDate, formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { Button, Spinner, Td, Tr, useConfirm, useToast } from "@probo/ui"; import { Button, Spinner, Td, Tr, useConfirm, useToast } from "@probo/ui";
import { clsx } from "clsx"; import { clsx } from "clsx";
@@ -81,7 +81,7 @@ export function PersonalAPIKeyRow(props: {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to revoke API key."), __("Failed to revoke API key."),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -160,7 +160,7 @@ export default function ConsentPage(props: {
const { toast } = useToast(); const { toast } = useToast();
const [deviceResult, setDeviceResult] = useState<"authorized" | "denied" | null>(null); const [deviceResult, setDeviceResult] = useState<"authorized" | "denied" | null>(null);
const data = usePreloadedQuery(consentPageQuery, props.queryRef); const data = usePreloadedQuery<ConsentPageQuery>(consentPageQuery, props.queryRef);
usePageTitle(__("Authorize Application")); usePageTitle(__("Authorize Application"));
const { node: consent } = data; const { node: consent } = data;

View File

@@ -55,7 +55,7 @@ export default function DeviceActivationPage(props: {
const navigate = useNavigate(); const navigate = useNavigate();
const [searchParams] = useSearchParams(); const [searchParams] = useSearchParams();
usePreloadedQuery(deviceActivationPageQuery, props.queryRef); usePreloadedQuery<DeviceActivationPageQuery>(deviceActivationPageQuery, props.queryRef);
usePageTitle(__("Device Activation")); usePageTitle(__("Device Activation"));
const preset = (searchParams.get("user_code") ?? "").replace(/-/g, ""); const preset = (searchParams.get("user_code") ?? "").replace(/-/g, "");

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { usePageTitle } from "@probo/hooks"; import { usePageTitle } from "@probo/hooks";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { Button, Field, useToast } from "@probo/ui"; import { Button, Field, useToast } from "@probo/ui";
@@ -92,7 +92,7 @@ export default function ResetPasswordPage() {
title: __("Reset failed"), title: __("Reset failed"),
description: formatError( description: formatError(
__("Password reset failed"), __("Password reset failed"),
e as GraphQLError, e,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { Button, Field, IconChevronLeft, useToast } from "@probo/ui"; import { Button, Field, IconChevronLeft, useToast } from "@probo/ui";
import type { FormEventHandler } from "react"; import type { FormEventHandler } from "react";
@@ -71,7 +71,7 @@ export default function PasswordSignInPage() {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to login"), __("Failed to login"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -175,7 +175,7 @@ export function AuditLogSettingsPage(props: {
}) { }) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const { organization } = usePreloadedQuery( const { organization } = usePreloadedQuery<AuditLogSettingsPageQuery>(
auditLogSettingsPageQuery, auditLogSettingsPageQuery,
props.queryRef, props.queryRef,
); );

View File

@@ -60,7 +60,7 @@ export function SAMLSettingsPage(props: {
const { __ } = useTranslate(); const { __ } = useTranslate();
const { organization } = usePreloadedQuery(samlSettingsPageQuery, queryRef); const { organization } = usePreloadedQuery<SAMLSettingsPageQuery>(samlSettingsPageQuery, queryRef);
if (organization.__typename !== "Organization") { if (organization.__typename !== "Organization") {
throw new Error("invalid node type"); throw new Error("invalid node type");
} }

View File

@@ -72,7 +72,7 @@ export function SCIMSettingsPage(props: {
const connectorId = searchParams.get("connector_id"); const connectorId = searchParams.get("connector_id");
const mutationTriggeredRef = useRef(false); const mutationTriggeredRef = useRef(false);
const { organization } = usePreloadedQuery(scimSettingsPageQuery, queryRef); const { organization } = usePreloadedQuery<SCIMSettingsPageQuery>(scimSettingsPageQuery, queryRef);
if (organization.__typename !== "Organization") { if (organization.__typename !== "Organization") {
throw new Error("invalid node type"); throw new Error("invalid node type");
} }

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { usePageTitle } from "@probo/hooks"; import { usePageTitle } from "@probo/hooks";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
@@ -70,7 +70,7 @@ export default function CreateCsvAccessReviewSourcePage({
usePageTitle(__("Add CSV Access Source")); usePageTitle(__("Add CSV Access Source"));
const { organization } = usePreloadedQuery(createCsvAccessReviewSourcePageQuery, queryRef); const { organization } = usePreloadedQuery<CreateCsvAccessReviewSourcePageQuery>(createCsvAccessReviewSourcePageQuery, queryRef);
if (organization.__typename !== "Organization") { if (organization.__typename !== "Organization") {
throw new Error("Organization not found"); throw new Error("Organization not found");
} }
@@ -112,7 +112,7 @@ export default function CreateCsvAccessReviewSourcePage({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to create access source"), __("Failed to create access source"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -130,7 +130,7 @@ export default function CreateCsvAccessReviewSourcePage({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to create access source"), __("Failed to create access source"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatDate, formatError, type GraphQLError, sprintf } from "@probo/helpers"; import { formatDate, formatError, sprintf } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
ActionDropdown, ActionDropdown,
@@ -147,7 +147,7 @@ export function AccessReviewSourceRow({ fKey, connectionId, organizationId }: Pr
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete access source"), __("Failed to delete access source"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -158,7 +158,7 @@ export function AccessReviewSourceRow({ fKey, connectionId, organizationId }: Pr
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete access source"), __("Failed to delete access source"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -188,7 +188,7 @@ export function AccessReviewSourceRow({ fKey, connectionId, organizationId }: Pr
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to configure source"), __("Failed to configure source"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -205,7 +205,7 @@ export function AccessReviewSourceRow({ fKey, connectionId, organizationId }: Pr
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to configure source"), __("Failed to configure source"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Badge, Badge,
@@ -79,7 +79,7 @@ export function EntryDecisionActions({ entryId, decision }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to record decision"), __("Failed to record decision"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -95,7 +95,7 @@ export function EntryDecisionActions({ entryId, decision }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to record decision"), __("Failed to record decision"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { Badge, Checkbox, useToast } from "@probo/ui"; import { Badge, Checkbox, useToast } from "@probo/ui";
import * as Popover from "@radix-ui/react-popover"; import * as Popover from "@radix-ui/react-popover";
@@ -83,7 +83,7 @@ export function EntryFlagSelect({ entryId, currentFlags }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to flag entry"), __("Failed to flag entry"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -94,7 +94,7 @@ export function EntryFlagSelect({ entryId, currentFlags }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to flag entry"), __("Failed to flag entry"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError, sprintf } from "@probo/helpers"; import { formatError, sprintf } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
ActionDropdown, ActionDropdown,
@@ -106,7 +106,7 @@ export default function AccessReviewCampaignsTab({ queryRef }: Props) {
const confirm = useConfirm(); const confirm = useConfirm();
const { toast } = useToast(); const { toast } = useToast();
const { organization } = usePreloadedQuery(accessReviewCampaignsTabQuery, queryRef); const { organization } = usePreloadedQuery<AccessReviewCampaignsTabQuery>(accessReviewCampaignsTabQuery, queryRef);
if (organization.__typename !== "Organization") { if (organization.__typename !== "Organization") {
throw new Error("Organization not found"); throw new Error("Organization not found");
} }
@@ -143,7 +143,7 @@ export default function AccessReviewCampaignsTab({ queryRef }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete campaign"), __("Failed to delete campaign"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -160,7 +160,7 @@ export default function AccessReviewCampaignsTab({ queryRef }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete campaign"), __("Failed to delete campaign"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatDate, formatError, type GraphQLError, sprintf } from "@probo/helpers"; import { formatDate, formatError, sprintf } from "@probo/helpers";
import { useList } from "@probo/hooks"; import { useList } from "@probo/hooks";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
@@ -199,7 +199,7 @@ export default function CampaignDetailPage({ queryRef }: Props) {
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const navigate = useNavigate(); const navigate = useNavigate();
const environment = useRelayEnvironment(); const environment = useRelayEnvironment();
const data = usePreloadedQuery(campaignDetailPageQuery, queryRef); const data = usePreloadedQuery<CampaignDetailPageQuery>(campaignDetailPageQuery, queryRef);
if (data.node.__typename !== "AccessReviewCampaign") { if (data.node.__typename !== "AccessReviewCampaign") {
throw new Error("Campaign not found"); throw new Error("Campaign not found");
@@ -269,7 +269,7 @@ export default function CampaignDetailPage({ queryRef }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to start campaign"), __("Failed to start campaign"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -286,7 +286,7 @@ export default function CampaignDetailPage({ queryRef }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to start campaign"), __("Failed to start campaign"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -315,7 +315,7 @@ export default function CampaignDetailPage({ queryRef }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete campaign"), __("Failed to delete campaign"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -335,7 +335,7 @@ export default function CampaignDetailPage({ queryRef }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete campaign"), __("Failed to delete campaign"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -368,7 +368,7 @@ export default function CampaignDetailPage({ queryRef }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to complete campaign"), __("Failed to complete campaign"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -387,7 +387,7 @@ export default function CampaignDetailPage({ queryRef }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to complete campaign"), __("Failed to complete campaign"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -524,7 +524,7 @@ function CampaignSourceCard({ source, isPendingActions }: { source: CampaignSour
input: { input: {
decisions: selection.map(id => ({ decisions: selection.map(id => ({
accessReviewEntryId: id, accessReviewEntryId: id,
decision: "APPROVED" as AccessReviewEntryDecision, decision: "APPROVED",
})), })),
}, },
}, },
@@ -534,7 +534,7 @@ function CampaignSourceCard({ source, isPendingActions }: { source: CampaignSour
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to record decisions"), __("Failed to record decisions"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -552,7 +552,7 @@ function CampaignSourceCard({ source, isPendingActions }: { source: CampaignSour
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to record decisions"), __("Failed to record decisions"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -877,7 +877,7 @@ function CampaignSourceCard({ source, isPendingActions }: { source: CampaignSour
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to record decisions"), __("Failed to record decisions"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -898,7 +898,7 @@ function CampaignSourceCard({ source, isPendingActions }: { source: CampaignSour
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to record decisions"), __("Failed to record decisions"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError, sprintf } from "@probo/helpers"; import { formatError, sprintf } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
ActionDropdown, ActionDropdown,
@@ -337,7 +337,7 @@ export function AddAccessReviewSourceDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to create access source"), __("Failed to create access source"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -356,7 +356,7 @@ export function AddAccessReviewSourceDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to create access source"), __("Failed to create access source"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Breadcrumb, Breadcrumb,
@@ -128,7 +128,7 @@ export function AddCampaignSourceDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to add source"), __("Failed to add source"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -147,7 +147,7 @@ export function AddCampaignSourceDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to add source"), __("Failed to add source"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Breadcrumb, Breadcrumb,
@@ -129,7 +129,7 @@ export function CreateAccessReviewCampaignDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to create campaign"), __("Failed to create campaign"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -149,7 +149,7 @@ export function CreateAccessReviewCampaignDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to create campaign"), __("Failed to create campaign"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Button, Button,
@@ -102,7 +102,7 @@ export default function AccessReviewSourcesTab({ queryRef }: Props) {
const [searchParams, setSearchParams] = useSearchParams(); const [searchParams, setSearchParams] = useSearchParams();
const processedConnectorIdRef = useRef<string | null>(null); const processedConnectorIdRef = useRef<string | null>(null);
const { organization, accessReviewDrivers } = usePreloadedQuery(accessReviewSourcesTabQuery, queryRef); const { organization, accessReviewDrivers } = usePreloadedQuery<AccessReviewSourcesTabQuery>(accessReviewSourcesTabQuery, queryRef);
if (organization.__typename !== "Organization") { if (organization.__typename !== "Organization") {
throw new Error("Organization not found"); throw new Error("Organization not found");
} }
@@ -186,7 +186,7 @@ export default function AccessReviewSourcesTab({ queryRef }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to create access source"), __("Failed to create access source"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -214,7 +214,7 @@ export default function AccessReviewSourcesTab({ queryRef }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to create access source"), __("Failed to create access source"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Button, Button,
@@ -117,7 +117,7 @@ export function PublishAssetListDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to publish asset list"), __("Failed to publish asset list"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -109,7 +109,7 @@ export default function AuditsPage(props: Props) {
const { toast } = useToast(); const { toast } = useToast();
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const data = usePreloadedQuery(auditsQuery, props.queryRef); const data = usePreloadedQuery<AuditGraphListQuery>(auditsQuery, props.queryRef);
// eslint-disable-next-line relay/generated-typescript-types // eslint-disable-next-line relay/generated-typescript-types
const pagination = usePaginationFragment( const pagination = usePaginationFragment(
paginatedAuditsFragment, paginatedAuditsFragment,

View File

@@ -47,7 +47,7 @@ function ContextPageQueryLoader() {
} }
function ContextPageInner({ queryRef }: { queryRef: PreloadedQuery<ContextPageLoaderQuery> }) { function ContextPageInner({ queryRef }: { queryRef: PreloadedQuery<ContextPageLoaderQuery> }) {
const data = usePreloadedQuery(contextPageQuery, queryRef); const data = usePreloadedQuery<ContextPageLoaderQuery>(contextPageQuery, queryRef);
return <ContextPage organization={data.organization} />; return <ContextPage organization={data.organization} />;
} }

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { usePageTitle } from "@probo/hooks"; import { usePageTitle } from "@probo/hooks";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
@@ -87,7 +87,7 @@ export default function NewCookieBannerPage() {
onError(error) { onError(error) {
toast({ toast({
title: __("Error"), title: __("Error"),
description: formatError(__("Failed to create cookie banner"), error as GraphQLError), description: formatError(__("Failed to create cookie banner"), error),
variant: "error", variant: "error",
}); });
}, },

View File

@@ -13,7 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { ClipboardTextIcon, CodeIcon, MagnifyingGlassIcon } from "@phosphor-icons/react"; import { ClipboardTextIcon, CodeIcon, MagnifyingGlassIcon } from "@phosphor-icons/react";
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Badge, Badge,
@@ -112,7 +112,7 @@ export default function CookieBannerConfigLayout({ queryRef }: CookieBannerConfi
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const { cookieBannerId } = useParams<{ cookieBannerId: string }>(); const { cookieBannerId } = useParams<{ cookieBannerId: string }>();
const data = usePreloadedQuery(cookieBannerConfigLayoutQuery, queryRef); const data = usePreloadedQuery<CookieBannerConfigLayoutQuery>(cookieBannerConfigLayoutQuery, queryRef);
if (data.node.__typename !== "CookieBanner") { if (data.node.__typename !== "CookieBanner") {
throw new Error("invalid type for node"); throw new Error("invalid type for node");
} }
@@ -133,7 +133,7 @@ export default function CookieBannerConfigLayout({ queryRef }: CookieBannerConfi
toast({ title: __("Success"), description: __("Banner deactivated"), variant: "success" }); toast({ title: __("Success"), description: __("Banner deactivated"), variant: "success" });
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to deactivate"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to deactivate"), error), variant: "error" });
}, },
}); });
} else { } else {
@@ -143,7 +143,7 @@ export default function CookieBannerConfigLayout({ queryRef }: CookieBannerConfi
toast({ title: __("Success"), description: __("Banner activated"), variant: "success" }); toast({ title: __("Success"), description: __("Banner activated"), variant: "success" });
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to activate"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to activate"), error), variant: "error" });
}, },
}); });
} }
@@ -156,7 +156,7 @@ export default function CookieBannerConfigLayout({ queryRef }: CookieBannerConfi
toast({ title: __("Success"), description: __("Version published"), variant: "success" }); toast({ title: __("Success"), description: __("Version published"), variant: "success" });
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to publish"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to publish"), error), variant: "error" });
}, },
}); });
}; };

View File

@@ -77,7 +77,7 @@ export default function CookieBannerConsentRecordPage({
}: CookieBannerConsentRecordPageProps) { }: CookieBannerConsentRecordPageProps) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const data = usePreloadedQuery(cookieBannerConsentRecordPageQuery, queryRef); const data = usePreloadedQuery<CookieBannerConsentRecordPageQuery>(cookieBannerConsentRecordPageQuery, queryRef);
if (data.node.__typename !== "CookieConsentRecord") { if (data.node.__typename !== "CookieConsentRecord") {
throw new Error("invalid type for node"); throw new Error("invalid type for node");

View File

@@ -100,7 +100,7 @@ export default function CookieBannerConsentRecordsPage({
queryRef, queryRef,
}: CookieBannerConsentRecordsPageProps) { }: CookieBannerConsentRecordsPageProps) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const data = usePreloadedQuery(cookieBannerConsentRecordsPageQuery, queryRef); const data = usePreloadedQuery<CookieBannerConsentRecordsPageQuery>(cookieBannerConsentRecordsPageQuery, queryRef);
if (data.node.__typename !== "CookieBanner") { if (data.node.__typename !== "CookieBanner") {
throw new Error("invalid type for node"); throw new Error("invalid type for node");

View File

@@ -56,7 +56,7 @@ export default function CookieBannerDisplayPage({
queryRef, queryRef,
}: CookieBannerDisplayPageProps) { }: CookieBannerDisplayPageProps) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const data = usePreloadedQuery(cookieBannerDisplayPageQuery, queryRef); const data = usePreloadedQuery<CookieBannerDisplayPageQuery>(cookieBannerDisplayPageQuery, queryRef);
if (data.node.__typename !== "CookieBanner") { if (data.node.__typename !== "CookieBanner") {
throw new Error("invalid type for node"); throw new Error("invalid type for node");

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Button, Button,
@@ -118,7 +118,7 @@ export function CategoryDialog({
onOpenChange(false); onOpenChange(false);
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to create category"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to create category"), error), variant: "error" });
}, },
}); });
}; };

View File

@@ -340,7 +340,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to update category"), __("Failed to update category"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -388,7 +388,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to add cookie"), __("Failed to add cookie"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -432,7 +432,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to update cookie"), __("Failed to update cookie"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -463,7 +463,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to update cookie"), __("Failed to update cookie"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -501,7 +501,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete cookie"), __("Failed to delete cookie"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -542,7 +542,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
resolve(); resolve();
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to delete category"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to delete category"), error), variant: "error" });
resolve(); resolve();
}, },
}); });
@@ -566,7 +566,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
} }
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to reorder"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to reorder"), error), variant: "error" });
}, },
}); });
}; };
@@ -582,7 +582,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
} }
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to reorder"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to reorder"), error), variant: "error" });
}, },
}); });
}; };
@@ -647,7 +647,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to move cookie"), __("Failed to move cookie"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -97,7 +97,7 @@ export default function CookieBannerResourcesPage({
queryRef, queryRef,
}: CookieBannerResourcesPageProps) { }: CookieBannerResourcesPageProps) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const data = usePreloadedQuery(cookieBannerResourcesPageQuery, queryRef); const data = usePreloadedQuery<CookieBannerResourcesPageQuery>(cookieBannerResourcesPageQuery, queryRef);
if (data.node.__typename !== "CookieBanner") { if (data.node.__typename !== "CookieBanner") {
throw new Error("invalid type for node"); throw new Error("invalid type for node");

View File

@@ -13,7 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { EyeIcon, EyeSlashIcon } from "@phosphor-icons/react"; import { EyeIcon, EyeSlashIcon } from "@phosphor-icons/react";
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
ActionDropdown, ActionDropdown,
@@ -176,7 +176,7 @@ export function TrackerResourceRow({ resourceKey, connectionId }: TrackerResourc
resolve(); resolve();
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to delete resource"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to delete resource"), error), variant: "error" });
resolve(); resolve();
}, },
}); });
@@ -216,7 +216,7 @@ export function TrackerResourceRow({ resourceKey, connectionId }: TrackerResourc
toast({ title: __("Success"), description: __("Resource moved"), variant: "success" }); toast({ title: __("Success"), description: __("Resource moved"), variant: "success" });
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to move resource"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to move resource"), error), variant: "error" });
}, },
}); });
}; };
@@ -236,7 +236,7 @@ export function TrackerResourceRow({ resourceKey, connectionId }: TrackerResourc
} }
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to update resource"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to update resource"), error), variant: "error" });
}, },
}); });
}; };
@@ -259,7 +259,7 @@ export function TrackerResourceRow({ resourceKey, connectionId }: TrackerResourc
setIsEditing(false); setIsEditing(false);
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to update resource"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to update resource"), error), variant: "error" });
}, },
}); });
}; };

View File

@@ -38,7 +38,7 @@ interface CookieBannerSettingsPageProps {
export default function CookieBannerSettingsPage({ export default function CookieBannerSettingsPage({
queryRef, queryRef,
}: CookieBannerSettingsPageProps) { }: CookieBannerSettingsPageProps) {
const data = usePreloadedQuery(cookieBannerSettingsPageQuery, queryRef); const data = usePreloadedQuery<CookieBannerSettingsPageQuery>(cookieBannerSettingsPageQuery, queryRef);
if (data.node.__typename !== "CookieBanner") { if (data.node.__typename !== "CookieBanner") {
throw new Error("invalid type for node"); throw new Error("invalid type for node");

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { Button, Card, Field, Input, Label, Option, Select, useToast } from "@probo/ui"; import { Button, Card, Field, Input, Label, Option, Select, useToast } from "@probo/ui";
import { Controller, useForm } from "react-hook-form"; import { Controller, useForm } from "react-hook-form";
@@ -100,7 +100,7 @@ export function BannerSettingsForm({ cookieBannerKey }: BannerSettingsFormProps)
toast({ title: __("Success"), description: __("Banner settings updated"), variant: "success" }); toast({ title: __("Success"), description: __("Banner settings updated"), variant: "success" });
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to update"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to update"), error), variant: "error" });
}, },
}); });
}; };

View File

@@ -121,7 +121,7 @@ export default function CookieBannerTrackersPage({
queryRef, queryRef,
}: CookieBannerTrackersPageProps) { }: CookieBannerTrackersPageProps) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const data = usePreloadedQuery(cookieBannerTrackersPageQuery, queryRef); const data = usePreloadedQuery<CookieBannerTrackersPageQuery>(cookieBannerTrackersPageQuery, queryRef);
if (data.node.__typename !== "CookieBanner") { if (data.node.__typename !== "CookieBanner") {
throw new Error("invalid type for node"); throw new Error("invalid type for node");

View File

@@ -55,7 +55,7 @@ export default function TrackerPatternDetailPage({
}: TrackerPatternDetailPageProps) { }: TrackerPatternDetailPageProps) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const data = usePreloadedQuery(trackerPatternDetailPageQuery, queryRef); const data = usePreloadedQuery<TrackerPatternDetailPageQuery>(trackerPatternDetailPageQuery, queryRef);
if (data.cookieBanner.__typename !== "CookieBanner") { if (data.cookieBanner.__typename !== "CookieBanner") {
throw new Error("invalid type for cookieBanner node"); throw new Error("invalid type for cookieBanner node");

View File

@@ -47,7 +47,7 @@ export function MoveToCategoryDropdown({
onMove, onMove,
}: MoveToCategoryDropdownProps) { }: MoveToCategoryDropdownProps) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const data = usePreloadedQuery(moveToCategoryDropdownQuery, queryRef); const data = usePreloadedQuery<MoveToCategoryDropdownQuery>(moveToCategoryDropdownQuery, queryRef);
if (data.node.__typename !== "CookieBanner") { if (data.node.__typename !== "CookieBanner") {
return null; return null;

View File

@@ -80,7 +80,7 @@ interface MoveToCategoryOptionsProps {
function MoveToCategoryOptions({ queryRef }: MoveToCategoryOptionsProps) { function MoveToCategoryOptions({ queryRef }: MoveToCategoryOptionsProps) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const data = usePreloadedQuery(moveToCategoryDropdownQuery, queryRef); const data = usePreloadedQuery<MoveToCategoryDropdownQuery>(moveToCategoryDropdownQuery, queryRef);
if (data.node.__typename !== "CookieBanner") { if (data.node.__typename !== "CookieBanner") {
return null; return null;

View File

@@ -13,7 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { DownloadSimpleIcon, EyeIcon, EyeSlashIcon } from "@phosphor-icons/react"; import { DownloadSimpleIcon, EyeIcon, EyeSlashIcon } from "@phosphor-icons/react";
import { formatError, getTrackerSourceBadge, getTrackerTypeBadge, type GraphQLError, humanizeSeconds } from "@probo/helpers"; import { formatError, getTrackerSourceBadge, getTrackerTypeBadge, humanizeSeconds } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
ActionDropdown, ActionDropdown,
@@ -191,7 +191,7 @@ export function TrackerPatternRow({ patternKey, connectionId }: TrackerPatternRo
resolve(); resolve();
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to delete cookie"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to delete cookie"), error), variant: "error" });
resolve(); resolve();
}, },
}); });
@@ -223,7 +223,7 @@ export function TrackerPatternRow({ patternKey, connectionId }: TrackerPatternRo
toast({ title: __("Success"), description: __("Cookie moved"), variant: "success" }); toast({ title: __("Success"), description: __("Cookie moved"), variant: "success" });
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to move cookie"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to move cookie"), error), variant: "error" });
}, },
}); });
}; };
@@ -243,7 +243,7 @@ export function TrackerPatternRow({ patternKey, connectionId }: TrackerPatternRo
} }
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to update cookie"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to update cookie"), error), variant: "error" });
}, },
}); });
}; };
@@ -286,7 +286,7 @@ export function TrackerPatternRow({ patternKey, connectionId }: TrackerPatternRo
toast({ title: __("Success"), description: __("Third party imported"), variant: "success" }); toast({ title: __("Success"), description: __("Third party imported"), variant: "success" });
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to import third party"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to import third party"), error), variant: "error" });
}, },
}); });
}; };
@@ -309,7 +309,7 @@ export function TrackerPatternRow({ patternKey, connectionId }: TrackerPatternRo
setIsEditing(false); setIsEditing(false);
}, },
onError(error) { onError(error) {
toast({ title: __("Error"), description: formatError(__("Failed to update cookie"), error as GraphQLError), variant: "error" }); toast({ title: __("Error"), description: formatError(__("Failed to update cookie"), error), variant: "error" });
}, },
}); });
}; };

View File

@@ -60,7 +60,7 @@ export default function CookieBannerTranslationsPage({
queryRef, queryRef,
}: CookieBannerTranslationsPageProps) { }: CookieBannerTranslationsPageProps) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const data = usePreloadedQuery(cookieBannerTranslationsPageQuery, queryRef); const data = usePreloadedQuery<CookieBannerTranslationsPageQuery>(cookieBannerTranslationsPageQuery, queryRef);
if (data.node.__typename !== "CookieBanner") { if (data.node.__typename !== "CookieBanner") {
throw new Error("invalid type for node"); throw new Error("invalid type for node");

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { Button, useToast } from "@probo/ui"; import { Button, useToast } from "@probo/ui";
import { useMemo } from "react"; import { useMemo } from "react";
@@ -150,7 +150,7 @@ export function TranslationEditor({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to save translation"), __("Failed to save translation"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError, sprintf } from "@probo/helpers"; import { formatError, sprintf } from "@probo/helpers";
import { usePageTitle } from "@probo/hooks"; import { usePageTitle } from "@probo/hooks";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
@@ -84,7 +84,7 @@ export function CookieBannersOverviewPage({ queryRef }: CookieBannersOverviewPag
usePageTitle(__("Cookie Banners")); usePageTitle(__("Cookie Banners"));
const { organization } = usePreloadedQuery(cookieBannersOverviewPageQuery, queryRef); const { organization } = usePreloadedQuery<CookieBannersOverviewPageQuery>(cookieBannersOverviewPageQuery, queryRef);
if (organization.__typename !== "Organization") { if (organization.__typename !== "Organization") {
throw new Error("invalid type for node"); throw new Error("invalid type for node");
} }
@@ -125,7 +125,7 @@ export function CookieBannersOverviewPage({ queryRef }: CookieBannersOverviewPag
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete cookie banner"), __("Failed to delete cookie banner"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Button, Button,
@@ -117,7 +117,7 @@ export function PublishDataListDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to publish data list"), __("Failed to publish data list"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -69,7 +69,7 @@ export function DocumentVersionsDropdownMenu(props: {
} }
const lastVersion = document.lastVersion?.edges[0].node; const lastVersion = document.lastVersion?.edges[0].node;
const currentVersion = lastVersion ?? version as NonNullable<typeof lastVersion | typeof version>; const currentVersion = lastVersion ?? version;
return ( return (
<> <>
@@ -77,7 +77,7 @@ export function DocumentVersionsDropdownMenu(props: {
<DocumentVersionsDropdownItem <DocumentVersionsDropdownItem
key={version.id} key={version.id}
fragmentRef={version} fragmentRef={version}
active={version.id === currentVersion.id} active={version.id === currentVersion?.id}
currentTab={currentTab} currentTab={currentTab}
/> />
))} ))}

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatDate, formatError, type GraphQLError } from "@probo/helpers"; import { formatDate, formatError } from "@probo/helpers";
import { usePageTitle } from "@probo/hooks"; import { usePageTitle } from "@probo/hooks";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
@@ -468,7 +468,7 @@ function DocumentApproveContent({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to load PDF"), __("Failed to load PDF"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -485,7 +485,7 @@ function DocumentApproveContent({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to load PDF"), __("Failed to load PDF"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -96,7 +96,10 @@ export function DocumentDescriptionPage(props: {
} }
const lastVersion = document.lastVersion?.edges[0].node; const lastVersion = document.lastVersion?.edges[0].node;
const currentVersion = lastVersion ?? version as NonNullable<typeof lastVersion | typeof version>; const currentVersion = lastVersion ?? version;
if (!currentVersion) {
throw new Error("Document version not found");
}
const [updateContent] = useMutation<DocumentDescriptionPage_updateContentMutation>(updateContentMutation); const [updateContent] = useMutation<DocumentDescriptionPage_updateContentMutation>(updateContentMutation);

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { usePageTitle } from "@probo/hooks"; import { usePageTitle } from "@probo/hooks";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { Card, Spinner, useToast } from "@probo/ui"; import { Card, Spinner, useToast } from "@probo/ui";
@@ -180,7 +180,7 @@ function DocumentSignatureContent({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to sign document"), __("Failed to sign document"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -203,7 +203,7 @@ function DocumentSignatureContent({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to load PDF"), __("Failed to load PDF"),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -220,7 +220,7 @@ function DocumentSignatureContent({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to load PDF"), __("Failed to load PDF"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -18,7 +18,6 @@ import {
getStatusLabel, getStatusLabel,
getStatusOptions, getStatusOptions,
getStatusVariant, getStatusVariant,
type GraphQLError,
sprintf, sprintf,
} from "@probo/helpers"; } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
@@ -209,7 +208,7 @@ export default function FindingDetailsPage(props: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete finding"), __("Failed to delete finding"),
error as GraphQLError[], error,
), ),
variant: "error", variant: "error",
}); });
@@ -227,7 +226,7 @@ export default function FindingDetailsPage(props: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete finding"), __("Failed to delete finding"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -294,7 +293,7 @@ export default function FindingDetailsPage(props: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to update finding"), __("Failed to update finding"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -18,7 +18,6 @@ import {
getStatusLabel, getStatusLabel,
getStatusOptions, getStatusOptions,
getStatusVariant, getStatusVariant,
type GraphQLError,
sprintf, sprintf,
} from "@probo/helpers"; } from "@probo/helpers";
import { usePageTitle } from "@probo/hooks"; import { usePageTitle } from "@probo/hooks";
@@ -176,7 +175,7 @@ export default function FindingsPage({ queryRef }: FindingsPageProps) {
usePageTitle(__("Findings")); usePageTitle(__("Findings"));
const navigate = useNavigate(); const navigate = useNavigate();
const organization = usePreloadedQuery(findingsPageQuery, queryRef); const organization = usePreloadedQuery<FindingsPageListQuery>(findingsPageQuery, queryRef);
const defaultApproverIds = (organization.node.findingsDocument?.defaultApprovers ?? []).map(a => a.id); const defaultApproverIds = (organization.node.findingsDocument?.defaultApprovers ?? []).map(a => a.id);
const [isPending, startTransition] = useTransition(); const [isPending, startTransition] = useTransition();
@@ -451,7 +450,7 @@ function FindingRow(props: FindingRowProps) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete finding"), __("Failed to delete finding"),
error as GraphQLError[], error,
), ),
variant: "error", variant: "error",
}); });
@@ -469,7 +468,7 @@ function FindingRow(props: FindingRowProps) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete finding"), __("Failed to delete finding"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -16,7 +16,6 @@ import {
formatDatetime, formatDatetime,
formatError, formatError,
getStatusOptions, getStatusOptions,
type GraphQLError,
} from "@probo/helpers"; } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
@@ -171,7 +170,7 @@ export function CreateFindingDialog({
onError(error) { onError(error) {
toast({ toast({
title: __("Error"), title: __("Error"),
description: formatError(__("Failed to create finding"), error as GraphQLError), description: formatError(__("Failed to create finding"), error),
variant: "error", variant: "error",
}); });
}, },

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Button, Button,
@@ -117,7 +117,7 @@ export function PublishFindingListDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to publish finding list"), __("Failed to publish finding list"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -15,7 +15,6 @@
import { import {
formatError, formatError,
getControlMaturityLevelLabel, getControlMaturityLevelLabel,
type GraphQLError,
} from "@probo/helpers"; } from "@probo/helpers";
import { promisifyMutation } from "@probo/helpers"; import { promisifyMutation } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
@@ -183,7 +182,7 @@ export default function FrameworkControlPage({ queryRef }: Props) {
framework: FrameworkDetailPageFragment$data; framework: FrameworkDetailPageFragment$data;
}>(); }>();
const connectionId = framework.controls.__id; const connectionId = framework.controls.__id;
const control = usePreloadedQuery(frameworkControlNodeQuery, queryRef).node; const control = usePreloadedQuery<FrameworkGraphControlNodeQuery>(frameworkControlNodeQuery, queryRef).node;
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const confirm = useConfirm(); const confirm = useConfirm();
const navigate = useNavigate(); const navigate = useNavigate();
@@ -249,7 +248,7 @@ export default function FrameworkControlPage({ queryRef }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
errorMessage, errorMessage,
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -261,7 +260,7 @@ export default function FrameworkControlPage({ queryRef }: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
errorMessage, errorMessage,
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -69,7 +69,7 @@ const importFrameworkMutation = graphql`
export default function FrameworksPage(props: Props) { export default function FrameworksPage(props: Props) {
const { __ } = useTranslate(); const { __ } = useTranslate();
usePageTitle(__("Frameworks")); usePageTitle(__("Frameworks"));
const data = usePreloadedQuery(frameworksQuery, props.queryRef); const data = usePreloadedQuery<FrameworkGraphListQuery>(frameworksQuery, props.queryRef);
const connectionId = data.organization.frameworks!.__id; const connectionId = data.organization.frameworks!.__id;
const frameworks const frameworks
= data.organization.frameworks?.edges.map(edge => edge.node) ?? []; = data.organization.frameworks?.edges.map(edge => edge.node) ?? [];

View File

@@ -137,7 +137,7 @@ type Props = {
export default function MeasureDetailPage(props: Props) { export default function MeasureDetailPage(props: Props) {
const { measureId } = useParams<{ measureId: string }>(); const { measureId } = useParams<{ measureId: string }>();
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const data = usePreloadedQuery(measureNodeQuery, props.queryRef); const data = usePreloadedQuery<MeasureDetailPageNodeQuery>(measureNodeQuery, props.queryRef);
const measure = data.node; const measure = data.node;
const { __ } = useTranslate(); const { __ } = useTranslate();
const [deleteMeasure] = useDeleteMeasureMutation(); const [deleteMeasure] = useDeleteMeasureMutation();

View File

@@ -15,7 +15,6 @@
import { import {
formatError, formatError,
getMeasureStateLabel, getMeasureStateLabel,
type GraphQLError,
sprintf, sprintf,
} from "@probo/helpers"; } from "@probo/helpers";
import { usePageTitle } from "@probo/hooks"; import { usePageTitle } from "@probo/hooks";
@@ -174,7 +173,7 @@ export default function MeasuresPage({ queryRef }: MeasuresPageProps) {
usePageTitle(__("Measures")); usePageTitle(__("Measures"));
const { organization } = usePreloadedQuery(measuresPageQuery, queryRef); const { organization } = usePreloadedQuery<MeasuresPageListQuery>(measuresPageQuery, queryRef);
if (organization.__typename !== "Organization") { if (organization.__typename !== "Organization") {
throw new Error("invalid node type"); throw new Error("invalid node type");
} }
@@ -455,7 +454,7 @@ function MeasureRow(props: MeasureRowProps) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete measure"), __("Failed to delete measure"),
error as GraphQLError[], error,
), ),
variant: "error", variant: "error",
}); });
@@ -473,7 +472,7 @@ function MeasureRow(props: MeasureRowProps) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete measure"), __("Failed to delete measure"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -115,7 +115,7 @@ export default function ObligationsPage({ queryRef }: ObligationsPageProps) {
usePageTitle(__("Obligations")); usePageTitle(__("Obligations"));
const organization = usePreloadedQuery(obligationsQuery, queryRef); const organization = usePreloadedQuery<ObligationGraphListQuery>(obligationsQuery, queryRef);
const defaultApproverIds = (organization.node.obligationsDocument?.defaultApprovers ?? []).map(a => a.id); const defaultApproverIds = (organization.node.obligationsDocument?.defaultApprovers ?? []).map(a => a.id);
const { const {

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Button, Button,
@@ -117,7 +117,7 @@ export function PublishObligationListDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to publish obligation list"), __("Failed to publish obligation list"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -196,7 +196,7 @@ export default function ProcessingActivitiesPage({
usePageTitle(__("Processing Activities")); usePageTitle(__("Processing Activities"));
const organization = usePreloadedQuery(processingActivitiesQuery, queryRef); const organization = usePreloadedQuery<ProcessingActivityGraphListQuery>(processingActivitiesQuery, queryRef);
const paDocument = organization.node.processingActivitiesDocument; const paDocument = organization.node.processingActivitiesDocument;
const dpiaDocument = organization.node.dataProtectionImpactAssessmentsDocument; const dpiaDocument = organization.node.dataProtectionImpactAssessmentsDocument;

View File

@@ -244,7 +244,7 @@ export default function ProcessingActivityDetailsPage(props: Props) {
activity?.dataProtectionImpactAssessment?.potentialRisk || "", activity?.dataProtectionImpactAssessment?.potentialRisk || "",
mitigations: activity?.dataProtectionImpactAssessment?.mitigations || "", mitigations: activity?.dataProtectionImpactAssessment?.mitigations || "",
residualRisk: (activity?.dataProtectionImpactAssessment?.residualRisk residualRisk: (activity?.dataProtectionImpactAssessment?.residualRisk
|| "") as ProcessingActivityDPIAResidualRisk | "", || ""),
}, },
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Button, Button,
@@ -117,7 +117,7 @@ export function PublishDataProtectionImpactAssessmentListDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to publish Data Protection Impact Assessments"), __("Failed to publish Data Protection Impact Assessments"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Button, Button,
@@ -117,7 +117,7 @@ export function PublishProcessingActivityListDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to publish processing activities"), __("Failed to publish processing activities"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Button, Button,
@@ -117,7 +117,7 @@ export function PublishTransferImpactAssessmentListDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to publish Transfer Impact Assessments"), __("Failed to publish Transfer Impact Assessments"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatDate, formatError, type GraphQLError } from "@probo/helpers"; import { formatDate, formatError } from "@probo/helpers";
import { usePageTitle } from "@probo/hooks"; import { usePageTitle } from "@probo/hooks";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
@@ -89,7 +89,7 @@ export default function RiskAssessmentDetailPage({ queryRef }: RiskAssessmentDet
const navigate = useNavigate(); const navigate = useNavigate();
const confirm = useConfirm(); const confirm = useConfirm();
const { toast } = useToast(); const { toast } = useToast();
const data = usePreloadedQuery(riskAssessmentDetailPageQuery, queryRef); const data = usePreloadedQuery<RiskAssessmentDetailPageQuery>(riskAssessmentDetailPageQuery, queryRef);
const ra = data.node; const ra = data.node;
const [deleteRiskAssessment] = useMutation<RiskAssessmentDetailPageDeleteMutation>(deleteMutation); const [deleteRiskAssessment] = useMutation<RiskAssessmentDetailPageDeleteMutation>(deleteMutation);
@@ -133,7 +133,7 @@ export default function RiskAssessmentDetailPage({ queryRef }: RiskAssessmentDet
onError(error) { onError(error) {
toast({ toast({
title: __("Error"), title: __("Error"),
description: formatError(__("Failed to delete risk assessment"), error as GraphQLError), description: formatError(__("Failed to delete risk assessment"), error),
variant: "error", variant: "error",
}); });
reject(error); reject(error);

View File

@@ -95,7 +95,7 @@ export default function RiskAssessmentsPage({ queryRef }: RiskAssessmentsPagePro
const { __ } = useTranslate(); const { __ } = useTranslate();
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const data = usePreloadedQuery(riskAssessmentsPageQuery, queryRef); const data = usePreloadedQuery<RiskAssessmentsPageQuery>(riskAssessmentsPageQuery, queryRef);
const { data: fragmentData, ...pagination } = usePaginationFragment< const { data: fragmentData, ...pagination } = usePaginationFragment<
RiskAssessmentsPageRefetchQuery, RiskAssessmentsPageRefetchQuery,
RiskAssessmentsPageFragment$key RiskAssessmentsPageFragment$key

View File

@@ -107,7 +107,7 @@ export default function RiskDetailLayout(props: RiskDetailLayoutProps) {
} }
const { __ } = useTranslate(); const { __ } = useTranslate();
const data = usePreloadedQuery(riskDetailLayoutQuery, props.queryRef); const data = usePreloadedQuery<RiskDetailLayoutQuery>(riskDetailLayoutQuery, props.queryRef);
if (data.node?.__typename !== "Risk") { if (data.node?.__typename !== "Risk") {
throw new Error("Risk not found"); throw new Error("Risk not found");
} }

View File

@@ -110,7 +110,7 @@ export default function RisksPage(props: RisksPageProps) {
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const navigate = useNavigate(); const navigate = useNavigate();
const queryData = usePreloadedQuery(risksPageQuery, props.queryRef); const queryData = usePreloadedQuery<RisksPageQuery>(risksPageQuery, props.queryRef);
const { data: fragmentData, ...pagination } = usePaginationFragment< const { data: fragmentData, ...pagination } = usePaginationFragment<
RisksPageRefetchQuery, RisksPageRefetchQuery,
RisksPageFragment$key RisksPageFragment$key

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, getRiskImpacts, getRiskLikelihoods, type GraphQLError } from "@probo/helpers"; import { formatError, getRiskImpacts, getRiskLikelihoods } from "@probo/helpers";
import { useToggle } from "@probo/hooks"; import { useToggle } from "@probo/hooks";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
@@ -180,7 +180,7 @@ export function FormRiskDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to update risk"), __("Failed to update risk"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -212,7 +212,7 @@ export function FormRiskDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to create risk"), __("Failed to create risk"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -123,7 +123,7 @@ type ContentProps = Omit<LinkScenarioDialogProps, "children"> & {
}; };
function LinkScenarioDialogContent(props: ContentProps) { function LinkScenarioDialogContent(props: ContentProps) {
const query = usePreloadedQuery(scenariosQuery, props.queryRef); const query = usePreloadedQuery<LinkScenarioDialogQuery>(scenariosQuery, props.queryRef);
const { data, loadNext, hasNext, isLoadingNext } const { data, loadNext, hasNext, isLoadingNext }
= usePaginationFragment<LinkScenarioDialogQuery_fragment, LinkScenarioDialogFragment$key>( = usePaginationFragment<LinkScenarioDialogQuery_fragment, LinkScenarioDialogFragment$key>(
scenariosFragment, scenariosFragment,

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Button, Button,
@@ -118,7 +118,7 @@ export function PublishRiskListDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to publish risks"), __("Failed to publish risks"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, getTreatment, type GraphQLError, sprintf } from "@probo/helpers"; import { formatError, getTreatment, sprintf } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
ActionDropdown, ActionDropdown,
@@ -95,7 +95,7 @@ export function RiskRow(props: RiskRowProps) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to delete risk"), __("Failed to delete risk"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -81,7 +81,7 @@ interface RiskControlsPageProps {
export default function RiskControlsPage(props: RiskControlsPageProps) { export default function RiskControlsPage(props: RiskControlsPageProps) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const data = usePreloadedQuery(riskControlsPageQuery, props.queryRef); const data = usePreloadedQuery<RiskControlsPageQuery>(riskControlsPageQuery, props.queryRef);
if (data.node?.__typename !== "Risk") { if (data.node?.__typename !== "Risk") {
throw new Error("Risk not found"); throw new Error("Risk not found");
} }

View File

@@ -76,7 +76,7 @@ interface RiskDocumentsPageProps {
} }
export default function RiskDocumentsPage(props: RiskDocumentsPageProps) { export default function RiskDocumentsPage(props: RiskDocumentsPageProps) {
const data = usePreloadedQuery(riskDocumentsPageQuery, props.queryRef); const data = usePreloadedQuery<RiskDocumentsPageQuery>(riskDocumentsPageQuery, props.queryRef);
if (data.node?.__typename !== "Risk") { if (data.node?.__typename !== "Risk") {
throw new Error("Risk not found"); throw new Error("Risk not found");
} }

View File

@@ -76,7 +76,7 @@ interface RiskMeasuresPageProps {
} }
export default function RiskMeasuresPage(props: RiskMeasuresPageProps) { export default function RiskMeasuresPage(props: RiskMeasuresPageProps) {
const data = usePreloadedQuery(riskMeasuresPageQuery, props.queryRef); const data = usePreloadedQuery<RiskMeasuresPageQuery>(riskMeasuresPageQuery, props.queryRef);
if (data.node?.__typename !== "Risk") { if (data.node?.__typename !== "Risk") {
throw new Error("Risk not found"); throw new Error("Risk not found");
} }

View File

@@ -76,7 +76,7 @@ interface RiskObligationsPageProps {
} }
export default function RiskObligationsPage(props: RiskObligationsPageProps) { export default function RiskObligationsPage(props: RiskObligationsPageProps) {
const data = usePreloadedQuery(riskObligationsPageQuery, props.queryRef); const data = usePreloadedQuery<RiskObligationsPageQuery>(riskObligationsPageQuery, props.queryRef);
if (data.node?.__typename !== "Risk") { if (data.node?.__typename !== "Risk") {
throw new Error("Risk not found"); throw new Error("Risk not found");
} }

View File

@@ -37,7 +37,7 @@ interface RiskOverviewPageProps {
} }
export default function RiskOverviewPage(props: RiskOverviewPageProps) { export default function RiskOverviewPage(props: RiskOverviewPageProps) {
const data = usePreloadedQuery(riskOverviewPageQuery, props.queryRef); const data = usePreloadedQuery<RiskOverviewPageQuery>(riskOverviewPageQuery, props.queryRef);
if (data.node?.__typename !== "Risk") { if (data.node?.__typename !== "Risk") {
throw new Error("Risk not found"); throw new Error("Risk not found");
} }

View File

@@ -94,7 +94,7 @@ interface RiskScenariosPageProps {
export default function RiskScenariosPage(props: RiskScenariosPageProps) { export default function RiskScenariosPage(props: RiskScenariosPageProps) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const data = usePreloadedQuery(riskScenariosPageQuery, props.queryRef); const data = usePreloadedQuery<RiskScenariosPageQuery>(riskScenariosPageQuery, props.queryRef);
if (data.node?.__typename !== "Risk") { if (data.node?.__typename !== "Risk") {
throw new Error("Risk not found"); throw new Error("Risk not found");
} }

View File

@@ -138,7 +138,7 @@ export default function StatementOfApplicabilityDetailPage(props: Props) {
statementOfApplicabilityId: string; statementOfApplicabilityId: string;
}>(); }>();
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const data = usePreloadedQuery(statementOfApplicabilityDetailPageQuery, props.queryRef); const data = usePreloadedQuery<StatementOfApplicabilityDetailPageQuery>(statementOfApplicabilityDetailPageQuery, props.queryRef);
const statementOfApplicability = data.node; const statementOfApplicability = data.node;
const { __ } = useTranslate(); const { __ } = useTranslate();
const navigate = useNavigate(); const navigate = useNavigate();
@@ -244,7 +244,7 @@ export default function StatementOfApplicabilityDetailPage(props: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to update Statement of Applicability"), __("Failed to update Statement of Applicability"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });
@@ -300,7 +300,7 @@ export default function StatementOfApplicabilityDetailPage(props: Props) {
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to update approvers"), __("Failed to update approvers"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -92,7 +92,7 @@ export default function StatementsOfApplicabilityPage({
usePageTitle(__("Statements of Applicability")); usePageTitle(__("Statements of Applicability"));
const { organization } = usePreloadedQuery(statementsOfApplicabilityPageQuery, queryRef); const { organization } = usePreloadedQuery<StatementsOfApplicabilityPageQuery>(statementsOfApplicabilityPageQuery, queryRef);
if (organization.__typename !== "Organization") { if (organization.__typename !== "Organization") {
throw new Error("Organization not found"); throw new Error("Organization not found");

View File

@@ -376,7 +376,7 @@ function AddApplicabilityStatementDialogContent({
applicabilityStatementId: applicability?.id ?? null, applicabilityStatementId: applicability?.id ?? null,
applicability: applicability?.applicability ?? null, applicability: applicability?.applicability ?? null,
justification: applicability?.justification ?? null, justification: applicability?.justification ?? null,
} as ControlWithStatement; };
}); });
}, [data.organization?.controls, applicabilityMap]); }, [data.organization?.controls, applicabilityMap]);

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Breadcrumb, Breadcrumb,
@@ -113,7 +113,7 @@ export function CreateStatementOfApplicabilityDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to create statement of applicability"), __("Failed to create statement of applicability"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -332,7 +332,7 @@ function LinkControlDialogContent({
applicabilityStatementId: applicability?.id ?? null, applicabilityStatementId: applicability?.id ?? null,
applicability: applicability?.applicability ?? null, applicability: applicability?.applicability ?? null,
justification: applicability?.justification ?? null, justification: applicability?.justification ?? null,
} as Control; };
}); });
}, [data.organization?.controls, applicabilityMap]); }, [data.organization?.controls, applicabilityMap]);

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Button, Button,
@@ -119,7 +119,7 @@ export function PublishStatementOfApplicabilityDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to publish Statement of Applicability"), __("Failed to publish Statement of Applicability"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -18,7 +18,6 @@ import { Button, IconPlusLarge, PageHeader } from "@probo/ui";
import { type PreloadedQuery, usePreloadedQuery } from "react-relay"; import { type PreloadedQuery, usePreloadedQuery } from "react-relay";
import { graphql } from "relay-runtime"; import { graphql } from "relay-runtime";
import type { TasksCardOrganizationFragment$key } from "#/__generated__/core/TasksCardOrganizationFragment.graphql";
import type { TasksPageQuery } from "#/__generated__/core/TasksPageQuery.graphql"; import type { TasksPageQuery } from "#/__generated__/core/TasksPageQuery.graphql";
import TaskFormDialog from "#/components/tasks/TaskFormDialog"; import TaskFormDialog from "#/components/tasks/TaskFormDialog";
import { OrganizationTasksCard } from "#/components/tasks/TasksCard"; import { OrganizationTasksCard } from "#/components/tasks/TasksCard";
@@ -39,13 +38,13 @@ interface Props {
export default function TasksPage({ queryRef }: Props) { export default function TasksPage({ queryRef }: Props) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const query = usePreloadedQuery(tasksPageQuery, queryRef); const query = usePreloadedQuery<TasksPageQuery>(tasksPageQuery, queryRef);
usePageTitle(__("Tasks")); usePageTitle(__("Tasks"));
return ( return (
<div className="space-y-6"> <div className="space-y-6">
<OrganizationTasksCard <OrganizationTasksCard
organizationRef={query.organization as TasksCardOrganizationFragment$key} organizationRef={query.organization}
header={({ connectionId, canCreateTask, refetch }) => ( header={({ connectionId, canCreateTask, refetch }) => (
<PageHeader <PageHeader
title={__("Tasks")} title={__("Tasks")}

View File

@@ -73,7 +73,7 @@ export default function ThirdPartiesPage(props: Props) {
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const navigate = useNavigate(); const navigate = useNavigate();
const data = usePreloadedQuery(thirdPartiesQuery, props.queryRef); const data = usePreloadedQuery<ThirdPartyGraphListQuery>(thirdPartiesQuery, props.queryRef);
// eslint-disable-next-line relay/generated-typescript-types // eslint-disable-next-line relay/generated-typescript-types
const pagination = usePaginationFragment( const pagination = usePaginationFragment(
paginatedThirdPartiesFragment, paginatedThirdPartiesFragment,

View File

@@ -58,7 +58,7 @@ type Props = {
export default function ThirdPartyDetailPage(props: Props) { export default function ThirdPartyDetailPage(props: Props) {
const environment = useRelayEnvironment(); const environment = useRelayEnvironment();
const { node: thirdParty } = usePreloadedQuery(thirdPartyNodeQuery, props.queryRef); const { node: thirdParty } = usePreloadedQuery<ThirdPartyGraphNodeQuery>(thirdPartyNodeQuery, props.queryRef);
const { __ } = useTranslate(); const { __ } = useTranslate();
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();
const thirdPartyIdRef = useRef(thirdParty.id); const thirdPartyIdRef = useRef(thirdParty.id);

View File

@@ -90,7 +90,7 @@ export function CommonThirdPartyCombobox({
onSelect, onSelect,
excludeNames, excludeNames,
}: CommonThirdPartyComboboxProps) { }: CommonThirdPartyComboboxProps) {
const data = usePreloadedQuery(commonThirdPartiesQuery, queryRef); const data = usePreloadedQuery<CommonThirdPartyComboboxQuery>(commonThirdPartiesQuery, queryRef);
const items = excludeNames const items = excludeNames
? data.commonThirdParties.filter(tp => !excludeNames.has(tp.name.toLowerCase())) ? data.commonThirdParties.filter(tp => !excludeNames.has(tp.name.toLowerCase()))

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Button, Button,
@@ -118,7 +118,7 @@ export function PublishThirdPartyListDialog({
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to publish third parties"), __("Failed to publish third parties"),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers"; import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n"; import { useTranslate } from "@probo/i18n";
import { import {
Button, Button,
@@ -85,7 +85,7 @@ export function VettingDialog({ thirdPartyId, websiteUrl, children }: VettingDia
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to start vetting."), __("Failed to start vetting."),
errors as GraphQLError[], errors,
), ),
variant: "error", variant: "error",
}); });
@@ -104,7 +104,7 @@ export function VettingDialog({ thirdPartyId, websiteUrl, children }: VettingDia
title: __("Error"), title: __("Error"),
description: formatError( description: formatError(
__("Failed to start vetting."), __("Failed to start vetting."),
error as GraphQLError, error,
), ),
variant: "error", variant: "error",
}); });

View File

@@ -126,7 +126,7 @@ interface Props {
} }
export default function ThirdPartyThirdPartiesPage({ queryRef }: Props) { export default function ThirdPartyThirdPartiesPage({ queryRef }: Props) {
const { node } = usePreloadedQuery(thirdPartyThirdPartiesPageQuery, queryRef); const { node } = usePreloadedQuery<ThirdPartyThirdPartiesPageQuery>(thirdPartyThirdPartiesPageQuery, queryRef);
const thirdParty = node.__typename === "ThirdParty" ? node : null; const thirdParty = node.__typename === "ThirdParty" ? node : null;
const { __ } = useTranslate(); const { __ } = useTranslate();
const organizationId = useOrganizationId(); const organizationId = useOrganizationId();

View File

@@ -14,9 +14,8 @@
"moduleDetection": "force", "moduleDetection": "force",
"noEmit": true, "noEmit": true,
"jsx": "react-jsx", "jsx": "react-jsx",
"baseUrl": ".",
"paths": { "paths": {
"#/*": ["src/*"] "#/*": ["./src/*"]
}, },
/* Linting */ /* Linting */

View File

@@ -15,42 +15,45 @@
import { createRequire } from "node:module"; import { createRequire } from "node:module";
import { fileURLToPath, URL } from "node:url"; import { fileURLToPath, URL } from "node:url";
import babel from "@rolldown/plugin-babel";
import tailwindcss from "@tailwindcss/vite"; import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import { defineConfig } from "vite"; import { defineConfig } from "vite";
const require = createRequire(import.meta.url); const require = createRequire(import.meta.url);
// @vitejs/plugin-react@6 (Vite 8) no longer runs Babel, so the Relay tagged
// template transform is applied via @rolldown/plugin-babel instead. The iam
// pages and the rest of the app compile against separate artifact directories.
const iamFiles = /src[/\\]pages[/\\]iam[/\\]/;
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
react({ react(),
exclude: ["src/pages/iam/**/*"], babel({
babel: { exclude: [/[/\\]node_modules[/\\]/, /\0rolldown[/\\]runtime\.js/, iamFiles],
plugins: [ plugins: [
[ [
"relay", "relay",
{ {
eagerEsModules: true, eagerEsModules: true,
artifactDirectory: "src/__generated__/core", artifactDirectory: "src/__generated__/core",
}, },
],
], ],
}, ],
}), }),
react({ babel({
include: ["src/pages/iam/**/*"], include: /src[/\\]pages[/\\]iam[/\\].*\.[jt]sx?(?:$|\?)/,
babel: { plugins: [
plugins: [ [
[ "relay",
"relay", {
{ eagerEsModules: true,
eagerEsModules: true, artifactDirectory: "src/__generated__/iam",
artifactDirectory: "src/__generated__/iam", },
},
],
], ],
}, ],
}), }),
tailwindcss(), tailwindcss(),
], ],

View File

@@ -18,33 +18,34 @@
"@probo/routes": "^1.0.0", "@probo/routes": "^1.0.0",
"@probo/ui": "1.0.0", "@probo/ui": "1.0.0",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"react": "^19.1.0", "react": "^19.2.7",
"react-dom": "^19.1.0", "react-dom": "^19.2.7",
"react-error-boundary": "^6.0.0", "react-error-boundary": "^6.0.0",
"react-hook-form": "^7.56.4", "react-hook-form": "^7.56.4",
"react-pdf": "^10.3.0", "react-pdf": "^10.3.0",
"react-relay": "^20.1.1", "react-relay": "^21.0.1",
"react-router": "^7.17.0", "react-router": "^8.0.0",
"relay-runtime": "^20.1.1", "relay-runtime": "^21.0.1",
"usehooks-ts": "^3.1.1", "usehooks-ts": "^3.1.1",
"zod": "^3.25.71" "zod": "^3.25.71"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.29.0",
"@probo/eslint-config": "1.0.0", "@probo/eslint-config": "1.0.0",
"@probo/eslint-plugin-relay-types": "^1.0.0", "@probo/eslint-plugin-relay-types": "^1.0.0",
"@tailwindcss/vite": "^4.1.7", "@rolldown/plugin-babel": "^0.2.3",
"@types/node": "^22.15.21", "@tailwindcss/vite": "^4.3.1",
"@types/react": "^19.1.2", "@types/babel__core": "^7.20.5",
"@types/react-dom": "^19.1.2", "@types/node": "^24",
"@types/react-relay": "^18.2.1", "@types/react": "^19.2.17",
"@types/relay-runtime": "^20.1.1", "@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.4", "@vitejs/plugin-react": "^6.0.2",
"babel-plugin-relay": "^20.1.1", "babel-plugin-relay": "^21.0.1",
"eslint": "^9.39.2", "eslint": "^10.5.0",
"graphql": "^16.11.0", "graphql": "^17.0.1",
"tailwindcss": "^4.1.7", "tailwindcss": "^4.3.1",
"typescript": "~5.8.3", "typescript": "~6.0.3",
"vite": "^7.3.2" "vite": "^8.0.16"
}, },
"volta": { "volta": {
"node": "24.4.0" "node": "24.4.0"

View File

@@ -30,7 +30,7 @@ type Props = {
export function MainLayout(props: Props) { export function MainLayout(props: Props) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const data = usePreloadedQuery(currentTrustGraphQuery, props.queryRef); const data = usePreloadedQuery<TrustGraphCurrentQuery>(currentTrustGraphQuery, props.queryRef);
const trustCenter = data.currentTrustCenter; const trustCenter = data.currentTrustCenter;
const isAuthenticated = data.viewer != null; const isAuthenticated = data.viewer != null;

View File

@@ -218,7 +218,7 @@ export function DocumentPage({ queryRef }: Props) {
const [fileData, setFileData] = useState<string | null>(null); const [fileData, setFileData] = useState<string | null>(null);
const [exportError, setExportError] = useState<string | null>(null); const [exportError, setExportError] = useState<string | null>(null);
const data = usePreloadedQuery(documentPageQuery, queryRef); const data = usePreloadedQuery<DocumentPageQueryType>(documentPageQuery, queryRef);
const trustCenter = data.currentTrustCenter; const trustCenter = data.currentTrustCenter;
const node = data.node; const node = data.node;

View File

@@ -104,7 +104,7 @@ export function NDAPage(props: {
const isMobile = width < 1100; const isMobile = width < 1100;
const isDesktop = !isMobile; const isDesktop = !isMobile;
const queryData = usePreloadedQuery(ndaPageQuery, props.queryRef); const queryData = usePreloadedQuery<NDAPageQueryType>(ndaPageQuery, props.queryRef);
const trustCenter = queryData.currentTrustCenter; const trustCenter = queryData.currentTrustCenter;
const viewer = queryData.viewer; const viewer = queryData.viewer;

View File

@@ -27,7 +27,7 @@ type Props = {
export function SubprocessorsPage({ queryRef }: Props) { export function SubprocessorsPage({ queryRef }: Props) {
const { __ } = useTranslate(); const { __ } = useTranslate();
const data = usePreloadedQuery(currentTrustSubprocessorsQuery, queryRef); const data = usePreloadedQuery<TrustGraphCurrentSubprocessorsQuery>(currentTrustSubprocessorsQuery, queryRef);
const subprocessors const subprocessors
= data.currentTrustCenter?.subprocessors.edges.map(edge => edge.node) ?? []; = data.currentTrustCenter?.subprocessors.edges.map(edge => edge.node) ?? [];

Some files were not shown because too many files have changed in this diff Show More