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

View File

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

View File

@@ -25,7 +25,7 @@ import {
} from "@probo/ui";
import { clsx } from "clsx";
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 { GraphQLTaggedNode, OperationType } from "relay-runtime";
import { z } from "zod";

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -55,7 +55,7 @@ export default function DeviceActivationPage(props: {
const navigate = useNavigate();
const [searchParams] = useSearchParams();
usePreloadedQuery(deviceActivationPageQuery, props.queryRef);
usePreloadedQuery<DeviceActivationPageQuery>(deviceActivationPageQuery, props.queryRef);
usePageTitle(__("Device Activation"));
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
// PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers";
import { formatError } from "@probo/helpers";
import { usePageTitle } from "@probo/hooks";
import { useTranslate } from "@probo/i18n";
import { Button, Field, useToast } from "@probo/ui";
@@ -92,7 +92,7 @@ export default function ResetPasswordPage() {
title: __("Reset failed"),
description: formatError(
__("Password reset failed"),
e as GraphQLError,
e,
),
variant: "error",
});

View File

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

View File

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

View File

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

View File

@@ -72,7 +72,7 @@ export function SCIMSettingsPage(props: {
const connectorId = searchParams.get("connector_id");
const mutationTriggeredRef = useRef(false);
const { organization } = usePreloadedQuery(scimSettingsPageQuery, queryRef);
const { organization } = usePreloadedQuery<SCIMSettingsPageQuery>(scimSettingsPageQuery, queryRef);
if (organization.__typename !== "Organization") {
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
// PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers";
import { formatError } from "@probo/helpers";
import { usePageTitle } from "@probo/hooks";
import { useTranslate } from "@probo/i18n";
import {
@@ -70,7 +70,7 @@ export default function CreateCsvAccessReviewSourcePage({
usePageTitle(__("Add CSV Access Source"));
const { organization } = usePreloadedQuery(createCsvAccessReviewSourcePageQuery, queryRef);
const { organization } = usePreloadedQuery<CreateCsvAccessReviewSourcePageQuery>(createCsvAccessReviewSourcePageQuery, queryRef);
if (organization.__typename !== "Organization") {
throw new Error("Organization not found");
}
@@ -112,7 +112,7 @@ export default function CreateCsvAccessReviewSourcePage({
title: __("Error"),
description: formatError(
__("Failed to create access source"),
errors as GraphQLError[],
errors,
),
variant: "error",
});
@@ -130,7 +130,7 @@ export default function CreateCsvAccessReviewSourcePage({
title: __("Error"),
description: formatError(
__("Failed to create access source"),
error as GraphQLError,
error,
),
variant: "error",
});

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// 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 {
ActionDropdown,
@@ -147,7 +147,7 @@ export function AccessReviewSourceRow({ fKey, connectionId, organizationId }: Pr
title: __("Error"),
description: formatError(
__("Failed to delete access source"),
errors as GraphQLError[],
errors,
),
variant: "error",
});
@@ -158,7 +158,7 @@ export function AccessReviewSourceRow({ fKey, connectionId, organizationId }: Pr
title: __("Error"),
description: formatError(
__("Failed to delete access source"),
error as GraphQLError,
error,
),
variant: "error",
});
@@ -188,7 +188,7 @@ export function AccessReviewSourceRow({ fKey, connectionId, organizationId }: Pr
title: __("Error"),
description: formatError(
__("Failed to configure source"),
errors as GraphQLError[],
errors,
),
variant: "error",
});
@@ -205,7 +205,7 @@ export function AccessReviewSourceRow({ fKey, connectionId, organizationId }: Pr
title: __("Error"),
description: formatError(
__("Failed to configure source"),
error as GraphQLError,
error,
),
variant: "error",
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -13,7 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
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 {
Badge,
@@ -112,7 +112,7 @@ export default function CookieBannerConfigLayout({ queryRef }: CookieBannerConfi
const organizationId = useOrganizationId();
const { cookieBannerId } = useParams<{ cookieBannerId: string }>();
const data = usePreloadedQuery(cookieBannerConfigLayoutQuery, queryRef);
const data = usePreloadedQuery<CookieBannerConfigLayoutQuery>(cookieBannerConfigLayoutQuery, queryRef);
if (data.node.__typename !== "CookieBanner") {
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" });
},
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 {
@@ -143,7 +143,7 @@ export default function CookieBannerConfigLayout({ queryRef }: CookieBannerConfi
toast({ title: __("Success"), description: __("Banner activated"), variant: "success" });
},
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" });
},
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) {
const { __ } = useTranslate();
const organizationId = useOrganizationId();
const data = usePreloadedQuery(cookieBannerConsentRecordPageQuery, queryRef);
const data = usePreloadedQuery<CookieBannerConsentRecordPageQuery>(cookieBannerConsentRecordPageQuery, queryRef);
if (data.node.__typename !== "CookieConsentRecord") {
throw new Error("invalid type for node");

View File

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

View File

@@ -56,7 +56,7 @@ export default function CookieBannerDisplayPage({
queryRef,
}: CookieBannerDisplayPageProps) {
const { __ } = useTranslate();
const data = usePreloadedQuery(cookieBannerDisplayPageQuery, queryRef);
const data = usePreloadedQuery<CookieBannerDisplayPageQuery>(cookieBannerDisplayPageQuery, queryRef);
if (data.node.__typename !== "CookieBanner") {
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
// PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers";
import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n";
import {
Button,
@@ -118,7 +118,7 @@ export function CategoryDialog({
onOpenChange(false);
},
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"),
description: formatError(
__("Failed to update category"),
error as GraphQLError,
error,
),
variant: "error",
});
@@ -388,7 +388,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
title: __("Error"),
description: formatError(
__("Failed to add cookie"),
error as GraphQLError,
error,
),
variant: "error",
});
@@ -432,7 +432,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
title: __("Error"),
description: formatError(
__("Failed to update cookie"),
error as GraphQLError,
error,
),
variant: "error",
});
@@ -463,7 +463,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
title: __("Error"),
description: formatError(
__("Failed to update cookie"),
error as GraphQLError,
error,
),
variant: "error",
});
@@ -501,7 +501,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
title: __("Error"),
description: formatError(
__("Failed to delete cookie"),
error as GraphQLError,
error,
),
variant: "error",
});
@@ -542,7 +542,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
resolve();
},
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();
},
});
@@ -566,7 +566,7 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr
}
},
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) {
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"),
description: formatError(
__("Failed to move cookie"),
error as GraphQLError,
error,
),
variant: "error",
});

View File

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

View File

@@ -13,7 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
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 {
ActionDropdown,
@@ -176,7 +176,7 @@ export function TrackerResourceRow({ resourceKey, connectionId }: TrackerResourc
resolve();
},
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();
},
});
@@ -216,7 +216,7 @@ export function TrackerResourceRow({ resourceKey, connectionId }: TrackerResourc
toast({ title: __("Success"), description: __("Resource moved"), variant: "success" });
},
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) {
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);
},
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({
queryRef,
}: CookieBannerSettingsPageProps) {
const data = usePreloadedQuery(cookieBannerSettingsPageQuery, queryRef);
const data = usePreloadedQuery<CookieBannerSettingsPageQuery>(cookieBannerSettingsPageQuery, queryRef);
if (data.node.__typename !== "CookieBanner") {
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
// PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers";
import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n";
import { Button, Card, Field, Input, Label, Option, Select, useToast } from "@probo/ui";
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" });
},
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,
}: CookieBannerTrackersPageProps) {
const { __ } = useTranslate();
const data = usePreloadedQuery(cookieBannerTrackersPageQuery, queryRef);
const data = usePreloadedQuery<CookieBannerTrackersPageQuery>(cookieBannerTrackersPageQuery, queryRef);
if (data.node.__typename !== "CookieBanner") {
throw new Error("invalid type for node");

View File

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

View File

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

View File

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

View File

@@ -13,7 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
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 {
ActionDropdown,
@@ -191,7 +191,7 @@ export function TrackerPatternRow({ patternKey, connectionId }: TrackerPatternRo
resolve();
},
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();
},
});
@@ -223,7 +223,7 @@ export function TrackerPatternRow({ patternKey, connectionId }: TrackerPatternRo
toast({ title: __("Success"), description: __("Cookie moved"), variant: "success" });
},
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) {
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" });
},
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);
},
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,
}: CookieBannerTranslationsPageProps) {
const { __ } = useTranslate();
const data = usePreloadedQuery(cookieBannerTranslationsPageQuery, queryRef);
const data = usePreloadedQuery<CookieBannerTranslationsPageQuery>(cookieBannerTranslationsPageQuery, queryRef);
if (data.node.__typename !== "CookieBanner") {
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
// PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers";
import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n";
import { Button, useToast } from "@probo/ui";
import { useMemo } from "react";
@@ -150,7 +150,7 @@ export function TranslationEditor({
title: __("Error"),
description: formatError(
__("Failed to save translation"),
error as GraphQLError,
error,
),
variant: "error",
});

View File

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

View File

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

View File

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

View File

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

View File

@@ -96,7 +96,10 @@ export function DocumentDescriptionPage(props: {
}
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);

View File

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

View File

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

View File

@@ -18,7 +18,6 @@ import {
getStatusLabel,
getStatusOptions,
getStatusVariant,
type GraphQLError,
sprintf,
} from "@probo/helpers";
import { usePageTitle } from "@probo/hooks";
@@ -176,7 +175,7 @@ export default function FindingsPage({ queryRef }: FindingsPageProps) {
usePageTitle(__("Findings"));
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 [isPending, startTransition] = useTransition();
@@ -451,7 +450,7 @@ function FindingRow(props: FindingRowProps) {
title: __("Error"),
description: formatError(
__("Failed to delete finding"),
error as GraphQLError[],
error,
),
variant: "error",
});
@@ -469,7 +468,7 @@ function FindingRow(props: FindingRowProps) {
title: __("Error"),
description: formatError(
__("Failed to delete finding"),
error as GraphQLError,
error,
),
variant: "error",
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -244,7 +244,7 @@ export default function ProcessingActivityDetailsPage(props: Props) {
activity?.dataProtectionImpactAssessment?.potentialRisk || "",
mitigations: activity?.dataProtectionImpactAssessment?.mitigations || "",
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
// PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers";
import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n";
import {
Button,
@@ -117,7 +117,7 @@ export function PublishDataProtectionImpactAssessmentListDialog({
title: __("Error"),
description: formatError(
__("Failed to publish Data Protection Impact Assessments"),
error as GraphQLError,
error,
),
variant: "error",
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// 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 { useTranslate } from "@probo/i18n";
import {
@@ -180,7 +180,7 @@ export function FormRiskDialog({
title: __("Error"),
description: formatError(
__("Failed to update risk"),
error as GraphQLError,
error,
),
variant: "error",
});
@@ -212,7 +212,7 @@ export function FormRiskDialog({
title: __("Error"),
description: formatError(
__("Failed to create risk"),
error as GraphQLError,
error,
),
variant: "error",
});

View File

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

View File

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

View File

@@ -12,7 +12,7 @@
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// 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 {
ActionDropdown,
@@ -95,7 +95,7 @@ export function RiskRow(props: RiskRowProps) {
title: __("Error"),
description: formatError(
__("Failed to delete risk"),
error as GraphQLError,
error,
),
variant: "error",
});

View File

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

View File

@@ -76,7 +76,7 @@ interface 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") {
throw new Error("Risk not found");
}

View File

@@ -76,7 +76,7 @@ interface 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") {
throw new Error("Risk not found");
}

View File

@@ -76,7 +76,7 @@ interface 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") {
throw new Error("Risk not found");
}

View File

@@ -37,7 +37,7 @@ interface 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") {
throw new Error("Risk not found");
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -90,7 +90,7 @@ export function CommonThirdPartyCombobox({
onSelect,
excludeNames,
}: CommonThirdPartyComboboxProps) {
const data = usePreloadedQuery(commonThirdPartiesQuery, queryRef);
const data = usePreloadedQuery<CommonThirdPartyComboboxQuery>(commonThirdPartiesQuery, queryRef);
const items = excludeNames
? 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
// PERFORMANCE OF THIS SOFTWARE.
import { formatError, type GraphQLError } from "@probo/helpers";
import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n";
import {
Button,
@@ -118,7 +118,7 @@ export function PublishThirdPartyListDialog({
title: __("Error"),
description: formatError(
__("Failed to publish third parties"),
error as GraphQLError,
error,
),
variant: "error",
});

View File

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

View File

@@ -126,7 +126,7 @@ interface 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 { __ } = useTranslate();
const organizationId = useOrganizationId();

View File

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

View File

@@ -15,42 +15,45 @@
import { createRequire } from "node:module";
import { fileURLToPath, URL } from "node:url";
import babel from "@rolldown/plugin-babel";
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
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/
export default defineConfig({
plugins: [
react({
exclude: ["src/pages/iam/**/*"],
babel: {
plugins: [
[
"relay",
{
eagerEsModules: true,
artifactDirectory: "src/__generated__/core",
},
],
react(),
babel({
exclude: [/[/\\]node_modules[/\\]/, /\0rolldown[/\\]runtime\.js/, iamFiles],
plugins: [
[
"relay",
{
eagerEsModules: true,
artifactDirectory: "src/__generated__/core",
},
],
},
],
}),
react({
include: ["src/pages/iam/**/*"],
babel: {
plugins: [
[
"relay",
{
eagerEsModules: true,
artifactDirectory: "src/__generated__/iam",
},
],
babel({
include: /src[/\\]pages[/\\]iam[/\\].*\.[jt]sx?(?:$|\?)/,
plugins: [
[
"relay",
{
eagerEsModules: true,
artifactDirectory: "src/__generated__/iam",
},
],
},
],
}),
tailwindcss(),
],

View File

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

View File

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

View File

@@ -218,7 +218,7 @@ export function DocumentPage({ queryRef }: Props) {
const [fileData, setFileData] = 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 node = data.node;

View File

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

View File

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

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