Skip to content

The open alternative to Salesforce, designed for AI.

Add Toast updates and status naming (#27846)

Raphaël Bosid9bafd4f0ca2
diff --git a/packages/twenty-companion/src/renderer/components/Notification.tsx b/packages/twenty-companion/src/renderer/components/Notification.tsx
index fadbebb8595..1e7a68010a6 100644
--- a/packages/twenty-companion/src/renderer/components/Notification.tsx
+++ b/packages/twenty-companion/src/renderer/components/Notification.tsx
@@ -15,7 +15,7 @@ export const Notification = ({
return (
<Toast
className={styles.container}
- variant="info"
+ status="info"
duration={6000}
closeLabel={closeLabel}
onClose={onClose}
diff --git a/packages/twenty-docs/snippets/ui/generated/components/feedback/toast.mdx b/packages/twenty-docs/snippets/ui/generated/components/feedback/toast.mdx
index 4eecc706741..2f60a827654 100644
--- a/packages/twenty-docs/snippets/ui/generated/components/feedback/toast.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/components/feedback/toast.mdx
@@ -12,55 +12,65 @@
*/}
<ParamField body="action" type="ReactNode">
- Content rendered in the footer, such as an action button.
+ Optional footer node, such as a Button with a caller-owned action.
</ParamField>
-<ParamField body="cancelLabel" type="string" default="Cancel">
- Label of the cancel button.
+<ParamField body="cancelLabel" type="ReactNode" default="Cancel">
+ Cancel button content node. Defaults to Cancel. Pass null to hide the control.
+</ParamField>
+
+<ParamField body="children" type="ReactNode">
+ Main message node. Callers own its content and accessible text.
+</ParamField>
+
+<ParamField body="className" type="string">
+ Additional class names merged onto the root.
</ParamField>
<ParamField body="closeLabel" type="string" default="Close">
- Accessible name of the close button.
+ Accessible name of the close button. Defaults to Close.
</ParamField>
<ParamField body="description" type="ReactNode">
- Supporting content rendered below the message.
+ Optional supporting content node rendered below the message.
</ParamField>
<ParamField body="duration" type="number" default="6000">
- Milliseconds before `onClose` is called. The countdown pauses while the
- pointer is over the toast or keyboard focus is inside it.
+ Milliseconds before onClose is called. The countdown pauses while the pointer is over the toast or keyboard focus is inside it.
</ParamField>
<ParamField body="icon" type="ReactNode">
- Replaces the variant's icon.
+ Leading icon node. Defaults to the status icon. Pass null to omit it.
</ParamField>
<ParamField body="iconLabel" type="string">
- Accessible name of the default icon. Without it, the icon is hidden from
- assistive technology.
+ Accessible name of the default icon. Without it, the icon is decorative.
</ParamField>
<ParamField body="onCancel" type="(() =&gt; void)">
- Called when the cancel button is clicked. The button renders only when
- this callback is provided.
+ Called when the cancel button is clicked. Providing it and renderable cancelLabel content shows the button.
</ParamField>
<ParamField body="onClose" type="(() =&gt; void)">
- Called when the close button is clicked or the countdown completes. The
- button renders only when this callback is provided.
+ Called when the close button is clicked or the countdown completes. Providing it shows the close button.
</ParamField>
<ParamField body="progress" type="number">
- Completion percentage shown in the progress bar. When set, the countdown
- is disabled.
+ Completion percentage. Providing it disables the countdown.
+</ParamField>
+
+<ParamField body="ref" type="Ref&lt;HTMLDivElement&gt;">
+ Ref to the root div, or the element supplied through render.
</ParamField>
<ParamField body="render" type="RenderProp&lt;Record&lt;string, unknown&gt;&gt;">
- Replaces the rendered element or composes it with another component.
- Accepts a React element or a function that returns the element to render.
+ Element or callback composition for the root. Native props and the ref target the rendered element.
+</ParamField>
+
+<ParamField body="status" type="&quot;error&quot; | &quot;info&quot; | &quot;neutral&quot; | &quot;success&quot; | &quot;warning&quot;" default="neutral">
+ Feedback meaning: neutral, info, success, warning, or error. Defaults to neutral and selects the icon and theme palette.
</ParamField>
-<ParamField body="variant" type="&quot;default&quot; | &quot;error&quot; | &quot;info&quot; | &quot;success&quot; | &quot;warning&quot;" default="default">
- Visual variant that selects the icon and colors.
+<ParamField body="style" type="CSSProperties">
+ Inline styles forwarded to the root.
</ParamField>
diff --git a/packages/twenty-docs/ui/components/feedback/toast.mdx b/packages/twenty-docs/ui/components/feedback/toast.mdx
index e50c019f60d..4219519c5f3 100644
--- a/packages/twenty-docs/ui/components/feedback/toast.mdx
+++ b/packages/twenty-docs/ui/components/feedback/toast.mdx
@@ -37,7 +37,7 @@ const SaveNotificationButton = () => {
onClick={() =>
enqueueToast({
children: 'Record saved',
- variant: 'success',
+ status: 'success',
dedupeKey: 'record-saved',
})
}
@@ -55,10 +55,64 @@ export const Notifications = () => (
);
```
-`enqueueToast` accepts Toast props and an optional `dedupeKey`, and returns the notification ID. A matching visible key returns the existing ID without adding another notification. `closeToast(id)` dismisses one notification; `closeToast()` dismisses all visible notifications in the provider.
+`enqueueToast` accepts Toast props and an optional `dedupeKey`, and returns the notification ID. A matching visible key returns the existing ID without adding another notification. `updateToast({ id, ...changes })` patches that live notification. `closeToast(id)` dismisses one notification; `closeToast()` dismisses all visible notifications in the provider.
The provider defaults to three visible notifications. Adding another dismisses the oldest visible ones. The toaster handles dismissal and exit animations. `container` overrides its portal destination; `null` defers rendering. `getToastProps` customizes each notification, while the toaster retains its ID and dismissal handler. Set `aria-label` on `Toaster` to localize its default region name, "Notifications".
+## Update a live notification
+
+Use the ID returned by `enqueueToast` to update content, feedback status, actions, or callbacks in place. Updates preserve the notification's ID and position. Unknown or dismissed IDs have no effect, including while the dismissal animation runs. Each `useToast()` call targets its closest provider.
+
+<StoryEmbed
+ storyId="ui-feedback-toaster--updates-documentation"
+ title="Update a live notification"
+ height={380}
+/>
+
+```tsx
+import { useToast } from 'twenty-ui/components/feedback';
+import { Button } from 'twenty-ui/primitives/input';
+
+type SaveButtonProps = {
+ saveRecord: () => Promise<void>;
+ onViewRecord: () => void;
+};
+
+export const SaveButton = ({ saveRecord, onViewRecord }: SaveButtonProps) => {
+ const { enqueueToast, updateToast } = useToast();
+
+ const save = async () => {
+ const id = enqueueToast({
+ children: 'Saving record',
+ status: 'info',
+ progress: 0,
+ });
+
+ try {
+ await saveRecord();
+ updateToast({
+ id,
+ children: 'Record saved',
+ status: 'success',
+ progress: undefined,
+ action: <Button onClick={onViewRecord}>View record</Button>,
+ });
+ } catch {
+ updateToast({
+ id,
+ children: 'Record could not be saved',
+ status: 'error',
+ progress: undefined,
+ });
+ }
+ };
+
+ return <Button onClick={save}>Save record</Button>;
+};
+```
+
+`ToastUpdate` requires `id` and accepts partial Toast options. Omitted fields keep their current values. Explicit `undefined` clears an optional field or restores its component default, such as `progress: undefined` or `status: undefined`. Pass `null` to remove a content slot, including `description`, `icon`, or `action`. Setting `cancelLabel: null` hides the cancel control while preserving its callback. Callback changes take effect on the existing notification. `dedupeKey` belongs to enqueueing and cannot be updated.
+
## Dismissible notification
```tsx
@@ -74,7 +128,7 @@ export const SaveNotification = () => {
<Button onClick={() => setVisible(true)}>Show saved notification</Button>
{visible && (
<Toast
- variant="success"
+ status="success"
description="Your changes are available to your team."
duration={6000}
onClose={() => setVisible(false)}
@@ -98,7 +152,7 @@ type ImportProgressProps = { progress: number; onCancel: () => void };
export const ImportProgress = ({ progress, onCancel }: ImportProgressProps) => (
<Toast
- variant="info"
+ status="info"
progress={progress}
description="You can continue working while the import runs."
onCancel={onCancel}
@@ -109,17 +163,17 @@ export const ImportProgress = ({ progress, onCancel }: ImportProgressProps) => (
);
```
-Passing `progress` supplies a percentage and disables the countdown. Cancellation invokes `onCancel`; the parent owns cancellation and removal. `action` accepts a React node for a footer action.
+Passing `progress` supplies a percentage and disables the countdown. Cancellation invokes `onCancel`; the parent owns cancellation and removal. `cancelLabel` accepts a React node for the button content. Children, `description`, `icon`, and `action` also accept caller-owned React nodes. Use Twenty UI controls for interactive actions and provide their accessible names.
## Appearance and announcements
-`variant` accepts `default`, `error`, `success`, `info`, or `warning`. Each variant supplies an icon and theme colors. Use `icon` to replace the icon and `iconLabel` when the default icon needs its own accessible name.
+`status` accepts `neutral`, `info`, `success`, `warning`, or `error` and defaults to `neutral`. It expresses feedback meaning and selects the icon and theme palette. Toast has one supported appearance, so it exposes no appearance `variant` or palette `color` option. Use `icon` to replace the icon, `icon={null}` to omit it, and `iconLabel` when the default icon needs its own accessible name.
The default role is `status` with polite announcements. Use `role="alert"` for urgent feedback. Set `cancelLabel` and `closeLabel` to localize the controls, and allow enough time to read the content or interact with its actions.
## Props
-The reference is generated from the public component types. Native attributes, including accessible names and event handlers, are also accepted on parts that render elements.
+The reference is generated from the public component types. Native attributes, styles, class names, event handlers, and refs target the root. Use `render` to compose another element or component while retaining those props and the ref. Toaster portals inherit the surrounding theme and text direction.
<ToastReference />
diff --git a/packages/twenty-front-component-renderer/src/__stories__/host-api/host-api-snackbar.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/host-api/host-api-snackbar.front-component.tsx
index e047dfd1f86..252c5b3b09c 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/host-api/host-api-snackbar.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/host-api/host-api-snackbar.front-component.tsx
@@ -16,6 +16,9 @@ const HostApiSnackbarFrontComponent = () => {
await enqueueSnackbar({
message: 'Test notification',
variant: 'success',
+ duration: 3000,
+ detailedMessage: 'Changes are available to the team',
+ dedupeKey: 'notification-example',
});
setStatus('snackbar:success');
} catch (error) {
diff --git a/packages/twenty-front-component-renderer/src/__stories__/host-api/snackbar.stories.tsx b/packages/twenty-front-component-renderer/src/__stories__/host-api/snackbar.stories.tsx
index c4e6bb6ee8d..3cea33a32fb 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/host-api/snackbar.stories.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/host-api/snackbar.stories.tsx
@@ -26,38 +26,52 @@ export default meta;
type Story = StoryObj<typeof FrontComponentRenderer>;
+const playSnackbar: NonNullable<Story['play']> = async ({
+ canvasElement,
+ args,
+}) => {
+ const canvas = within(canvasElement);
+ const api = args.frontComponentHostCommunicationApi;
+
+ if (!isDefined(api)) {
+ throw new Error('frontComponentHostCommunicationApi is required');
+ }
+
+ await expectFrontComponentMounted(canvas);
+
+ const subject = await canvas.findByTestId('subject');
+
+ await userEvent.click(subject);
+
+ await waitFor(
+ () => {
+ expect(api.enqueueSnackbar).toHaveBeenCalledWith({
+ message: 'Test notification',
+ variant: 'success',
+ duration: 3000,
+ detailedMessage: 'Changes are available to the team',
+ dedupeKey: 'notification-example',
+ });
+ },
+ { timeout: HOST_API_TIMEOUT },
+ );
+
+ expect(
+ await canvas.findByText(
+ 'snackbar:success',
+ {},
+ { timeout: INTERACTION_TIMEOUT },
+ ),
+ ).toBeVisible();
+};
+
export const Snackbar: Story = runFrontComponentStory({
frontComponentBundleName: 'host-api-snackbar',
- play: async ({ canvasElement, args }) => {
- const canvas = within(canvasElement);
- const api = args.frontComponentHostCommunicationApi;
-
- if (!isDefined(api)) {
- throw new Error('frontComponentHostCommunicationApi is required');
- }
-
- await expectFrontComponentMounted(canvas);
-
- const subject = await canvas.findByTestId('subject');
-
- await userEvent.click(subject);
-
- await waitFor(
- () => {
- expect(api.enqueueSnackbar).toHaveBeenCalledWith({
- message: 'Test notification',
- variant: 'success',
- });
- },
- { timeout: HOST_API_TIMEOUT },
- );
-
- expect(
- await canvas.findByText(
- 'snackbar:success',
- {},
- { timeout: INTERACTION_TIMEOUT },
- ),
- ).toBeVisible();
- },
+ play: playSnackbar,
+});
+
+export const SnackbarPreact: Story = runFrontComponentStory({
+ frontComponentBundleName: 'host-api-snackbar',
+ runtime: 'preact',
+ play: playSnackbar,
});
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-toast-countdown.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-toast-countdown.front-component.tsx
index 610966b1388..0f93b7ec822 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-toast-countdown.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-toast-countdown.front-component.tsx
@@ -17,7 +17,7 @@ const ToastCountdownExample = () => {
</Button>
{isVisible && (
<Toast
- variant="success"
+ status="success"
duration={1200}
onClose={() => {
setCloseCount((count) => count + 1);
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-toast.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-toast.front-component.tsx
index 2961ca235c7..792e3ebb6a4 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-toast.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-toast.front-component.tsx
@@ -12,7 +12,7 @@ const ToastExample = () => {
<TwentyUiGalleryCard title="Toast">
{!closed && (
<Toast
- variant="success"
+ status="success"
progress={100}
description="Your changes are available to the team"
onClose={() => setClosed(true)}
diff --git a/packages/twenty-front/src/hooks/__tests__/useCopyToClipboard.test.tsx b/packages/twenty-front/src/hooks/__tests__/useCopyToClipboard.test.tsx
index 29e379be068..7ad0418c118 100644
--- a/packages/twenty-front/src/hooks/__tests__/useCopyToClipboard.test.tsx
+++ b/packages/twenty-front/src/hooks/__tests__/useCopyToClipboard.test.tsx
@@ -48,7 +48,7 @@ describe('useCopyToClipboard', () => {
expect(mockWriteText).toHaveBeenCalledWith('hello clipboard');
expect(mockEnqueueToast).toHaveBeenCalledWith(
expect.objectContaining({
- variant: 'success',
+ status: 'success',
children: 'Copied to clipboard',
}),
);
@@ -63,7 +63,7 @@ describe('useCopyToClipboard', () => {
expect(mockEnqueueToast).toHaveBeenCalledWith(
expect.objectContaining({
- variant: 'success',
+ status: 'success',
children: 'Email copied',
}),
);
@@ -95,7 +95,7 @@ describe('useCopyToClipboard', () => {
expect(mockEnqueueToast).toHaveBeenCalledWith(
expect.objectContaining({
- variant: 'error',
+ status: 'error',
children: "Couldn't copy to clipboard",
}),
);
@@ -112,7 +112,7 @@ describe('useCopyToClipboard', () => {
expect(mockWriteText).not.toHaveBeenCalled();
expect(mockEnqueueToast).toHaveBeenCalledWith(
- expect.objectContaining({ variant: 'error' }),
+ expect.objectContaining({ status: 'error' }),
);
});
});
diff --git a/packages/twenty-front/src/hooks/useCopyToClipboard.tsx b/packages/twenty-front/src/hooks/useCopyToClipboard.tsx
index 23060407d01..61074844450 100644
--- a/packages/twenty-front/src/hooks/useCopyToClipboard.tsx
+++ b/packages/twenty-front/src/hooks/useCopyToClipboard.tsx
@@ -14,7 +14,7 @@ export const useCopyToClipboard = () => {
) => {
if (!window.isSecureContext) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Clipboard requires a secure connection (HTTPS). Please access this app over HTTPS to enable copying.`,
icon: <IconExclamationCircle size={16} color="red" />,
duration: 6000,
@@ -31,14 +31,14 @@ export const useCopyToClipboard = () => {
}
enqueueToast({
- variant: 'success',
+ status: 'success',
children: successMessage,
icon: <IconCopy size={theme.icon.size.md} />,
duration: 2000,
});
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Couldn't copy to clipboard`,
icon: <IconExclamationCircle size={16} color="red" />,
duration: 2000,
diff --git a/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventComposer.ts b/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventComposer.ts
index 421edeba88c..9b1d5729885 100644
--- a/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventComposer.ts
+++ b/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventComposer.ts
@@ -274,7 +274,7 @@ export const useCalendarEventComposer = ({
await refetchTimelineCalendarEvents();
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to link the related records to this event`,
});
}
diff --git a/packages/twenty-front/src/modules/activities/calendar/hooks/useCreateCalendarEvent.ts b/packages/twenty-front/src/modules/activities/calendar/hooks/useCreateCalendarEvent.ts
index f0463451e22..5165ec707e0 100644
--- a/packages/twenty-front/src/modules/activities/calendar/hooks/useCreateCalendarEvent.ts
+++ b/packages/twenty-front/src/modules/activities/calendar/hooks/useCreateCalendarEvent.ts
@@ -28,7 +28,7 @@ export const useCreateCalendarEvent = () => {
if (!result.data?.createCalendarEvent.success) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
result.data?.createCalendarEvent.error ??
t`Failed to create calendar event`,
@@ -38,7 +38,7 @@ export const useCreateCalendarEvent = () => {
}
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Calendar event created successfully`,
});
@@ -51,7 +51,7 @@ export const useCreateCalendarEvent = () => {
};
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to create calendar event`,
});
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/__tests__/useEmailComposerState.test.tsx b/packages/twenty-front/src/modules/activities/emails/hooks/__tests__/useEmailComposerState.test.tsx
index 64e5caa1244..b08272d973f 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/__tests__/useEmailComposerState.test.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/__tests__/useEmailComposerState.test.tsx
@@ -117,7 +117,7 @@ describe('useEmailComposerState', () => {
expect(onSent).toHaveBeenCalledWith('message-thread-1');
expect(mockEnqueueToast).not.toHaveBeenCalledWith(
- expect.objectContaining({ variant: 'error' }),
+ expect.objectContaining({ status: 'error' }),
);
});
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useCancelMessageCampaign.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useCancelMessageCampaign.ts
index ab1b3114c9c..da4c7b427ec 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/useCancelMessageCampaign.ts
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useCancelMessageCampaign.ts
@@ -39,7 +39,7 @@ export const useCancelMessageCampaign = () => {
if (!isDefined(canceled)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to cancel campaign`,
});
@@ -61,7 +61,7 @@ export const useCancelMessageCampaign = () => {
if (wasScheduled) {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Campaign unscheduled and back in your drafts`,
});
@@ -69,7 +69,7 @@ export const useCancelMessageCampaign = () => {
}
enqueueToast({
- variant: 'success',
+ status: 'success',
children: plural(canceled.canceledMessageCount, {
one: `Campaign canceled, ${canceled.canceledMessageCount} pending email stopped`,
other: `Campaign canceled, ${canceled.canceledMessageCount} pending emails stopped`,
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/usePersistedCampaignDraft.ts b/packages/twenty-front/src/modules/activities/emails/hooks/usePersistedCampaignDraft.ts
index f32c45db4df..5f51c135edf 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/usePersistedCampaignDraft.ts
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/usePersistedCampaignDraft.ts
@@ -31,7 +31,7 @@ export const usePersistedCampaignDraft = <TDraft extends object>({
updateOneRecordInput: toUpdateOneRecordInput(nextDraft),
}).catch(() =>
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to save the campaign`,
}),
);
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useSendEmail.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useSendEmail.ts
index 6bd65b1a450..1e08b46e79e 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/useSendEmail.ts
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useSendEmail.ts
@@ -62,7 +62,7 @@ export const useSendEmail = () => {
if (result.data?.sendEmail.success) {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Email sent successfully`,
});
@@ -82,13 +82,13 @@ export const useSendEmail = () => {
}
enqueueToast({
- variant: 'error',
+ status: 'error',
children: result.data?.sendEmail.error ?? t`Failed to send email`,
});
return { success: false, messageThreadId: null };
} catch {
- enqueueToast({ variant: 'error', children: t`Failed to send email` });
+ enqueueToast({ status: 'error', children: t`Failed to send email` });
return { success: false, messageThreadId: null };
}
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaign.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaign.ts
index 065cebed412..0220be549b5 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaign.ts
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaign.ts
@@ -50,7 +50,7 @@ export const useSendMessageCampaign = () => {
if (!queued) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to send campaign`,
});
@@ -88,14 +88,14 @@ export const useSendMessageCampaign = () => {
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: wasAlreadyScheduled
? t`Campaign moved to ${sendTime}`
: t`Campaign scheduled for ${sendTime}`,
});
} else if (queuedCount === 0) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`No recipients to send to (${skipReasons})`,
});
} else {
@@ -105,7 +105,7 @@ export const useSendMessageCampaign = () => {
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children:
skipReasons.length > 0
? t`${queuedMessage}, skipping ${skipReasons}`
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaignTest.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaignTest.ts
index c60cfb9fef3..2adb6717988 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaignTest.ts
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaignTest.ts
@@ -35,7 +35,7 @@ export const useSendMessageCampaignTest = () => {
if (!result.data?.sendMessageCampaignTest) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to send test email`,
});
@@ -43,7 +43,7 @@ export const useSendMessageCampaignTest = () => {
}
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Test email sent to ${params.toAddress}`,
});
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useUploadEmailAttachment.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useUploadEmailAttachment.ts
index b355316fe4d..e054e802e40 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/useUploadEmailAttachment.ts
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useUploadEmailAttachment.ts
@@ -22,7 +22,7 @@ export const useUploadEmailAttachment = () => {
const maxUploadSize = formatFileSize(MAX_ATTACHMENT_SIZE);
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`File "${fileName}" exceeds ${maxUploadSize}`,
});
@@ -41,7 +41,7 @@ export const useUploadEmailAttachment = () => {
const fileName = file.name;
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`File "${fileName}" uploaded successfully`,
});
@@ -52,7 +52,7 @@ export const useUploadEmailAttachment = () => {
const fileNameForError = file.name;
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to upload "${fileNameForError}"`,
});
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useUploadEmailImage.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useUploadEmailImage.ts
index 1ca3e3fd8cd..81716670c93 100644
--- a/packages/twenty-front/src/modules/activities/emails/hooks/useUploadEmailImage.ts
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useUploadEmailImage.ts
@@ -19,7 +19,7 @@ export const useUploadEmailImage = () => {
file.type as (typeof EMAIL_IMAGE_MIME_TYPES)[number],
)
) {
- enqueueToast({ variant: 'error', children: t`Unsupported image format` });
+ enqueueToast({ status: 'error', children: t`Unsupported image format` });
throw new Error(`Unsupported email image MIME type: ${file.type}`);
}
@@ -29,7 +29,7 @@ export const useUploadEmailImage = () => {
const maxUploadSize = formatFileSize(MAX_ATTACHMENT_SIZE);
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Image "${fileName}" exceeds ${maxUploadSize}`,
});
@@ -47,7 +47,7 @@ export const useUploadEmailImage = () => {
logError(`Failed to upload email image "${fileName}": ${error}`);
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to upload "${fileName}"`,
});
diff --git a/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientChipMenuContent.tsx b/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientChipMenuContent.tsx
index 55b6b13d8dc..69b32d2d052 100644
--- a/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientChipMenuContent.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientChipMenuContent.tsx
@@ -55,7 +55,7 @@ export const EmailRecipientChipMenuContent = ({
});
if (isDefined(createdPerson)) {
- enqueueToast({ variant: 'success', children: t`Person created` });
+ enqueueToast({ status: 'success', children: t`Person created` });
}
};
diff --git a/packages/twenty-front/src/modules/ai/dictation/components/AiChatDictationEffect.tsx b/packages/twenty-front/src/modules/ai/dictation/components/AiChatDictationEffect.tsx
index 01e661dee73..fe9422307fe 100644
--- a/packages/twenty-front/src/modules/ai/dictation/components/AiChatDictationEffect.tsx
+++ b/packages/twenty-front/src/modules/ai/dictation/components/AiChatDictationEffect.tsx
@@ -87,7 +87,7 @@ export const AiChatDictationEffect = ({
setHasWebSpeechProvenSilent(true);
}
enqueueToast({
- variant: 'error',
+ status: 'error',
children: getDictationFailureMessage(event.reason),
});
break;
diff --git a/packages/twenty-front/src/modules/ai/hooks/useAgentChat.ts b/packages/twenty-front/src/modules/ai/hooks/useAgentChat.ts
index 4ff593f19a0..77fb952de7d 100644
--- a/packages/twenty-front/src/modules/ai/hooks/useAgentChat.ts
+++ b/packages/twenty-front/src/modules/ai/hooks/useAgentChat.ts
@@ -90,7 +90,7 @@ export const useAgentChat = () => {
if (aiModels.length === 0) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`No AI provider is configured on this instance.`,
});
diff --git a/packages/twenty-front/src/modules/ai/hooks/useAiChatFileUpload.ts b/packages/twenty-front/src/modules/ai/hooks/useAiChatFileUpload.ts
index 0e47ff47111..5064226e678 100644
--- a/packages/twenty-front/src/modules/ai/hooks/useAiChatFileUpload.ts
+++ b/packages/twenty-front/src/modules/ai/hooks/useAiChatFileUpload.ts
@@ -42,7 +42,7 @@ export const useAiChatFileUpload = () => {
} catch {
const fileName = file.name;
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to upload file: ${fileName}`,
});
return null;
diff --git a/packages/twenty-front/src/modules/ai/hooks/useWarnAboutParticipantMentionsNotAdded.ts b/packages/twenty-front/src/modules/ai/hooks/useWarnAboutParticipantMentionsNotAdded.ts
index 4c9cd916dbc..01f7eb872d5 100644
--- a/packages/twenty-front/src/modules/ai/hooks/useWarnAboutParticipantMentionsNotAdded.ts
+++ b/packages/twenty-front/src/modules/ai/hooks/useWarnAboutParticipantMentionsNotAdded.ts
@@ -26,7 +26,7 @@ export const useWarnAboutParticipantMentionsNotAdded = () => {
if (isNonEmptyString(notAddedLabels)) {
enqueueToast({
- variant: 'warning',
+ status: 'warning',
children: t`${notAddedLabels} could not be added to this chat because they can't reply in it.`,
});
}
diff --git a/packages/twenty-front/src/modules/apollo/hooks/useApolloFactory.ts b/packages/twenty-front/src/modules/apollo/hooks/useApolloFactory.ts
index bf1c31c8226..8518c4f8e4e 100644
--- a/packages/twenty-front/src/modules/apollo/hooks/useApolloFactory.ts
+++ b/packages/twenty-front/src/modules/apollo/hooks/useApolloFactory.ts
@@ -89,14 +89,14 @@ export const useApolloFactory = (options: Partial<Options> = {}) => {
},
onAppVersionMismatch: (message) => {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: message,
dedupeKey: 'app-version-mismatch',
});
},
onPayloadTooLarge: (message) => {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: message,
dedupeKey: 'payload-too-large',
});
diff --git a/packages/twenty-front/src/modules/auth/components/TwoFactorAuthenticationProvisionEffect.tsx b/packages/twenty-front/src/modules/auth/components/TwoFactorAuthenticationProvisionEffect.tsx
index 9885af035e3..936a0946a8f 100644
--- a/packages/twenty-front/src/modules/auth/components/TwoFactorAuthenticationProvisionEffect.tsx
+++ b/packages/twenty-front/src/modules/auth/components/TwoFactorAuthenticationProvisionEffect.tsx
@@ -40,7 +40,7 @@ export const TwoFactorAuthenticationSetupEffect = () => {
try {
if (!loginToken) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Login token missing. Two Factor Authentication setup can not be initiated.`,
dedupeKey: 'invalid-session-dedupe-key',
});
diff --git a/packages/twenty-front/src/modules/auth/components/VerifyEmailEffect.tsx b/packages/twenty-front/src/modules/auth/components/VerifyEmailEffect.tsx
index 6fc70aaf502..d8a3bb74616 100644
--- a/packages/twenty-front/src/modules/auth/components/VerifyEmailEffect.tsx
+++ b/packages/twenty-front/src/modules/auth/components/VerifyEmailEffect.tsx
@@ -54,7 +54,7 @@ export const VerifyEmailEffect = ({ onError }: VerifyEmailEffectProps) => {
const verifyEmailToken = async () => {
if (!email || !emailVerificationToken) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Invalid email verification link.`,
dedupeKey: 'email-verification-link-dedupe-key',
});
@@ -62,7 +62,7 @@ export const VerifyEmailEffect = ({ onError }: VerifyEmailEffectProps) => {
}
const successToastOptions = {
- variant: 'success',
+ status: 'success',
children: t`Email verified.`,
dedupeKey: 'email-verification-dedupe-key',
} satisfies ToastOptions;
@@ -106,7 +106,7 @@ export const VerifyEmailEffect = ({ onError }: VerifyEmailEffectProps) => {
dedupeKey: EMAIL_VERIFICATION_ERROR_DEDUPE_KEY,
})
: {
- variant: 'error',
+ status: 'error',
children: t`Email verification failed`,
dedupeKey: EMAIL_VERIFICATION_ERROR_DEDUPE_KEY,
},
diff --git a/packages/twenty-front/src/modules/auth/components/__tests__/TwoFactorAuthenticationProvisionEffect.test.tsx b/packages/twenty-front/src/modules/auth/components/__tests__/TwoFactorAuthenticationProvisionEffect.test.tsx
index 23cbc330fd2..fdf7b7e80fe 100644
--- a/packages/twenty-front/src/modules/auth/components/__tests__/TwoFactorAuthenticationProvisionEffect.test.tsx
+++ b/packages/twenty-front/src/modules/auth/components/__tests__/TwoFactorAuthenticationProvisionEffect.test.tsx
@@ -104,7 +104,7 @@ describe('TwoFactorAuthenticationSetupEffect', () => {
);
expect(mockEnqueueToast).toHaveBeenCalledWith(
expect.objectContaining({
- variant: 'error',
+ status: 'error',
children:
'Ask a workspace admin for a new recovery code to finish setting up two-factor authentication.',
}),
diff --git a/packages/twenty-front/src/modules/auth/components/__tests__/VerifyEmail.test.tsx b/packages/twenty-front/src/modules/auth/components/__tests__/VerifyEmail.test.tsx
index 8cbee125da4..968ef58d506 100644
--- a/packages/twenty-front/src/modules/auth/components/__tests__/VerifyEmail.test.tsx
+++ b/packages/twenty-front/src/modules/auth/components/__tests__/VerifyEmail.test.tsx
@@ -117,7 +117,7 @@ describe('VerifyEmail', () => {
expect(navigateMock).toHaveBeenCalledWith(AppPath.SignInUp);
});
expect(mockEnqueueToast).toHaveBeenCalledWith(
- expect.objectContaining({ variant: 'success' }),
+ expect.objectContaining({ status: 'success' }),
);
});
@@ -130,7 +130,7 @@ describe('VerifyEmail', () => {
await waitFor(() => {
expect(mockEnqueueToast).toHaveBeenCalledWith(
- expect.objectContaining({ variant: 'error' }),
+ expect.objectContaining({ status: 'error' }),
);
});
expect(navigateMock).not.toHaveBeenCalledWith(AppPath.SignInUp);
diff --git a/packages/twenty-front/src/modules/auth/hooks/__tests__/useRedeemSsoExchangeToken.test.ts b/packages/twenty-front/src/modules/auth/hooks/__tests__/useRedeemSsoExchangeToken.test.ts
index c20130fbbe1..2e23322e428 100644
--- a/packages/twenty-front/src/modules/auth/hooks/__tests__/useRedeemSsoExchangeToken.test.ts
+++ b/packages/twenty-front/src/modules/auth/hooks/__tests__/useRedeemSsoExchangeToken.test.ts
@@ -113,7 +113,7 @@ describe('useRedeemSsoExchangeToken', () => {
await result.current.redeemSsoExchangeToken('sso-exchange-token');
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'Invalid SSO exchange token',
});
expect(jotaiStore.get(isAppEffectRedirectEnabledState.atom)).toBe(true);
diff --git a/packages/twenty-front/src/modules/auth/hooks/__tests__/useVerifyLogin.test.ts b/packages/twenty-front/src/modules/auth/hooks/__tests__/useVerifyLogin.test.ts
index 31d2f8a1972..6e09c008c3b 100644
--- a/packages/twenty-front/src/modules/auth/hooks/__tests__/useVerifyLogin.test.ts
+++ b/packages/twenty-front/src/modules/auth/hooks/__tests__/useVerifyLogin.test.ts
@@ -78,7 +78,7 @@ describe('useVerifyLogin', () => {
await result.current.verifyLoginToken('test-token');
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'Authentication failed',
});
expect(mockNavigate).toHaveBeenCalledWith(AppPath.SignInUp);
@@ -103,7 +103,7 @@ describe('useVerifyLogin', () => {
await result.current.verifyLoginToken('test-token');
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'Your session has expired. Please sign in again.',
});
expect(mockNavigate).toHaveBeenCalledWith(AppPath.SignInUp);
diff --git a/packages/twenty-front/src/modules/auth/hooks/useVerifyLogin.ts b/packages/twenty-front/src/modules/auth/hooks/useVerifyLogin.ts
index 178473c9a89..c03cd71e957 100644
--- a/packages/twenty-front/src/modules/auth/hooks/useVerifyLogin.ts
+++ b/packages/twenty-front/src/modules/auth/hooks/useVerifyLogin.ts
@@ -26,7 +26,7 @@ export const useVerifyLogin = () => {
enqueueToast(
CombinedGraphQLErrors.is(error)
? getToastOptionsFromError({ error })
- : { variant: 'error', children: t`Authentication failed` },
+ : { status: 'error', children: t`Authentication failed` },
);
navigate(AppPath.SignInUp);
} finally {
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationRecovery.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationRecovery.tsx
index 832e4cb7262..eb5ed087eb9 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationRecovery.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationRecovery.tsx
@@ -61,7 +61,7 @@ export const SignInUpTwoFactorAuthenticationRecovery = () => {
if (!isCaptchaReady) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Captcha (anti-bot check) is still loading, try again`,
});
return;
@@ -88,7 +88,7 @@ export const SignInUpTwoFactorAuthenticationRecovery = () => {
}
enqueueToast({
- variant: 'info',
+ status: 'info',
children: t`Two-factor authentication was reset for this workspace. Set it up again from Settings, Profile.`,
});
} catch (error) {
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationVerification.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationVerification.tsx
index 97b9788c7c2..7e0a36fc7b1 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationVerification.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpTwoFactorAuthenticationVerification.tsx
@@ -186,7 +186,7 @@ export const SignInUpTOTPVerification = () => {
try {
if (!isCaptchaReady) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Captcha (anti-bot check) is still loading, try again`,
});
setIsLoading(false);
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/__tests__/SignInUpTwoFactorAuthenticationRecovery.test.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/__tests__/SignInUpTwoFactorAuthenticationRecovery.test.tsx
index 107c797e933..ed96bf1c850 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/__tests__/SignInUpTwoFactorAuthenticationRecovery.test.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/__tests__/SignInUpTwoFactorAuthenticationRecovery.test.tsx
@@ -110,7 +110,7 @@ describe('SignInUpTwoFactorAuthenticationRecovery', () => {
'captcha-token',
);
expect(mockEnqueueToast).toHaveBeenCalledWith(
- expect.objectContaining({ variant: 'info' }),
+ expect.objectContaining({ status: 'info' }),
);
});
@@ -146,7 +146,7 @@ describe('SignInUpTwoFactorAuthenticationRecovery', () => {
expect(mockEnqueueToast).toHaveBeenCalledWith(
expect.objectContaining({
- variant: 'error',
+ status: 'error',
children: 'Invalid or expired recovery code.',
}),
);
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useHandleResetPassword.test.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useHandleResetPassword.test.ts
index dff3dcba490..e1b15b76c39 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useHandleResetPassword.test.ts
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useHandleResetPassword.test.ts
@@ -77,7 +77,7 @@ describe('useHandleResetPassword', () => {
await act(() => result.current.handleResetPassword('')());
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'Invalid email',
});
});
@@ -98,7 +98,7 @@ describe('useHandleResetPassword', () => {
},
});
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'success',
+ status: 'success',
children:
'If this email is registered, a password reset link has been sent',
});
@@ -119,7 +119,7 @@ describe('useHandleResetPassword', () => {
},
});
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'success',
+ status: 'success',
children:
'If this email is registered, a password reset link has been sent',
});
@@ -132,7 +132,7 @@ describe('useHandleResetPassword', () => {
await act(() => result.current.handleResetPassword('[email protected]')());
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'Captcha (anti-bot check) is still loading, try again',
});
expect(emailPasswordResetLinkMock).not.toHaveBeenCalled();
@@ -147,7 +147,7 @@ describe('useHandleResetPassword', () => {
await act(() => result.current.handleResetPassword('[email protected]')());
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'An error occurred.',
});
});
@@ -160,7 +160,7 @@ describe('useHandleResetPassword', () => {
await act(() => result.current.handleResetPassword('[email protected]')());
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: errorMessage,
});
});
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useSso.test.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useSso.test.tsx
index 6cf1bae5196..0ba3705dfb4 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useSso.test.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useSso.test.tsx
@@ -84,7 +84,7 @@ describe('useSso', () => {
await result.current.redirectToSsoLoginPage(identityProviderId);
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'An error occurred.',
});
});
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useHandleResendEmailVerificationToken.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useHandleResendEmailVerificationToken.ts
index dce9bcbc242..2f16ddd0357 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useHandleResendEmailVerificationToken.ts
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useHandleResendEmailVerificationToken.ts
@@ -18,7 +18,7 @@ export const useHandleResendEmailVerificationToken = () => {
(email: string | null) => {
return async () => {
if (!email) {
- enqueueToast({ variant: 'error', children: t`Invalid email` });
+ enqueueToast({ status: 'error', children: t`Invalid email` });
return;
}
@@ -32,11 +32,11 @@ export const useHandleResendEmailVerificationToken = () => {
if (data?.resendEmailVerificationToken?.success === true) {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Email verification link resent!`,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
} catch (error) {
enqueueToast(getToastOptionsFromError({ error }));
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useHandleResetPassword.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useHandleResetPassword.ts
index 904a87a61aa..3eecb5f7cda 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useHandleResetPassword.ts
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useHandleResetPassword.ts
@@ -25,13 +25,13 @@ export const useHandleResetPassword = () => {
(email = currentUser?.email) => {
return async () => {
if (!email) {
- enqueueToast({ variant: 'error', children: t`Invalid email` });
+ enqueueToast({ status: 'error', children: t`Invalid email` });
return;
}
if (!isCaptchaReady) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Captcha (anti-bot check) is still loading, try again`,
});
return;
@@ -48,11 +48,11 @@ export const useHandleResetPassword = () => {
if (data?.emailPasswordResetLink?.success === true) {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`If this email is registered, a password reset link has been sent`,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
} catch (error) {
enqueueToast(getToastOptionsFromError({ error }));
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUp.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUp.ts
index b4658b1dcec..b3fb1995b9f 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUp.ts
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUp.ts
@@ -73,11 +73,11 @@ export const useSignInUp = (form: UseFormReturn<Form>) => {
const errorMsgUserAlreadyExist = t`An error occurred while checking user existence`;
const continueWithCredentials = useCallback(async () => {
if (!form.getValues('email')) {
- return enqueueToast({ variant: 'error', children: t`Email is required` });
+ return enqueueToast({ status: 'error', children: t`Email is required` });
}
if (!isCaptchaReady) {
return enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Captcha (anti-bot check) is still loading, try again`,
});
}
@@ -102,7 +102,7 @@ export const useSignInUp = (form: UseFormReturn<Form>) => {
);
setSignInUpStep(SignInUpStep.Password);
} catch {
- enqueueToast({ variant: 'error', children: errorMsgUserAlreadyExist });
+ enqueueToast({ status: 'error', children: errorMsgUserAlreadyExist });
}
}, [
readCaptchaToken,
@@ -124,7 +124,7 @@ export const useSignInUp = (form: UseFormReturn<Form>) => {
if (!isCaptchaReady) {
return enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Captcha (anti-bot check) is still loading, try again`,
});
}
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignUpInNewWorkspace.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignUpInNewWorkspace.ts
index 29fab9af7ce..8948ae8ea71 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignUpInNewWorkspace.ts
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignUpInNewWorkspace.ts
@@ -59,7 +59,7 @@ export const useSignUpInNewWorkspace = () => {
enqueueToast(getToastOptionsFromError({ error: logoUploadError }));
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
logoUploadError instanceof Error
? logoUploadError.message
@@ -89,7 +89,7 @@ export const useSignUpInNewWorkspace = () => {
enqueueToast(getToastOptionsFromError({ error }));
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error
? error.message
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useWorkspaceFromInviteHash.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useWorkspaceFromInviteHash.ts
index 79f465d51cf..d46bb546c1d 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useWorkspaceFromInviteHash.ts
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useWorkspaceFromInviteHash.ts
@@ -53,7 +53,7 @@ export const useWorkspaceFromInviteHash = () => {
const workspaceDisplayName = inviteWorkspace.displayName;
initiallyLoggedIn &&
enqueueToast({
- variant: 'info',
+ status: 'info',
children: workspaceDisplayName
? t`You already belong to the workspace ${workspaceDisplayName}`
: t`You already belong to this workspace`,
diff --git a/packages/twenty-front/src/modules/auth/utils/__tests__/getTwoFactorAuthenticationErrorToastOptions.test.ts b/packages/twenty-front/src/modules/auth/utils/__tests__/getTwoFactorAuthenticationErrorToastOptions.test.ts
index e03489bc8fa..2c1ee57a4ef 100644
--- a/packages/twenty-front/src/modules/auth/utils/__tests__/getTwoFactorAuthenticationErrorToastOptions.test.ts
+++ b/packages/twenty-front/src/modules/auth/utils/__tests__/getTwoFactorAuthenticationErrorToastOptions.test.ts
@@ -23,7 +23,7 @@ describe('getTwoFactorAuthenticationErrorToastOptions', () => {
}),
).toEqual(
expect.objectContaining({
- variant: 'error',
+ status: 'error',
children: 'Rate limit reached. Please try again later.',
dedupeKey: 'invalid-otp-dedupe-key-LIMIT_REACHED',
}),
@@ -36,7 +36,7 @@ describe('getTwoFactorAuthenticationErrorToastOptions', () => {
error: new Error('Network error'),
}),
).toEqual({
- variant: 'error',
+ status: 'error',
children: 'Invalid verification code. Please try again.',
dedupeKey: undefined,
});
diff --git a/packages/twenty-front/src/modules/auth/utils/getTwoFactorAuthenticationErrorToastOptions.ts b/packages/twenty-front/src/modules/auth/utils/getTwoFactorAuthenticationErrorToastOptions.ts
index 247c477ba13..cf2224f4af4 100644
--- a/packages/twenty-front/src/modules/auth/utils/getTwoFactorAuthenticationErrorToastOptions.ts
+++ b/packages/twenty-front/src/modules/auth/utils/getTwoFactorAuthenticationErrorToastOptions.ts
@@ -24,7 +24,7 @@ export const getTwoFactorAuthenticationErrorToastOptions = ({
}): ToastOptions | undefined => {
if (!CombinedGraphQLErrors.is(error)) {
return {
- variant: 'error',
+ status: 'error',
children: fallbackMessage,
dedupeKey,
};
diff --git a/packages/twenty-front/src/modules/command-menu-item/display/components/CommandMenuItemErrorBoundary.tsx b/packages/twenty-front/src/modules/command-menu-item/display/components/CommandMenuItemErrorBoundary.tsx
index 9d13c725be6..3f85352c4f3 100644
--- a/packages/twenty-front/src/modules/command-menu-item/display/components/CommandMenuItemErrorBoundary.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/display/components/CommandMenuItemErrorBoundary.tsx
@@ -22,7 +22,7 @@ export const CommandMenuItemErrorBoundary = ({
);
const handleError = async (error: Error) => {
- enqueueToast({ variant: 'error', children: error.message });
+ enqueueToast({ status: 'error', children: error.message });
if (shouldReportToSentry) {
try {
diff --git a/packages/twenty-front/src/modules/command-menu-item/edit/hooks/useResetCommandMenuItemToDefault.ts b/packages/twenty-front/src/modules/command-menu-item/edit/hooks/useResetCommandMenuItemToDefault.ts
index a2439127e04..fcc9a8c91aa 100644
--- a/packages/twenty-front/src/modules/command-menu-item/edit/hooks/useResetCommandMenuItemToDefault.ts
+++ b/packages/twenty-front/src/modules/command-menu-item/edit/hooks/useResetCommandMenuItemToDefault.ts
@@ -57,7 +57,7 @@ export const useResetCommandMenuItemToDefault = () => {
operationType: CrudOperationType.UPDATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
}
},
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/dashboard/components/DuplicateDashboardSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/dashboard/components/DuplicateDashboardSingleRecordCommand.tsx
index 0a22893954b..444d62c6ebd 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/dashboard/components/DuplicateDashboardSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/dashboard/components/DuplicateDashboardSingleRecordCommand.tsx
@@ -26,7 +26,7 @@ export const DuplicateDashboardSingleRecordCommand = () => {
if (isDefined(result) && isNonEmptyString(result.id)) {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Dashboard duplicated successfully`,
});
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-list/components/DuplicateMessageListSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-list/components/DuplicateMessageListSingleRecordCommand.tsx
index 4b6be4c13f1..30f06604b80 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-list/components/DuplicateMessageListSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-list/components/DuplicateMessageListSingleRecordCommand.tsx
@@ -29,7 +29,7 @@ export const DuplicateMessageListSingleRecordCommand = () => {
const memberCount = result.memberCount;
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`List duplicated with ${plural(memberCount, {
one: '# member',
other: '# members',
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-list/hooks/useDuplicateMessageList.ts b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-list/hooks/useDuplicateMessageList.ts
index 45f1246ffaa..9207d3505de 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-list/hooks/useDuplicateMessageList.ts
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/message-list/hooks/useDuplicateMessageList.ts
@@ -45,7 +45,7 @@ export const useDuplicateMessageList = () => {
});
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to duplicate list`,
});
}
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DuplicateWorkflowSingleRecordCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DuplicateWorkflowSingleRecordCommand.tsx
index 04145720c01..ac98cb7780a 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DuplicateWorkflowSingleRecordCommand.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/single-record/workflow/components/DuplicateWorkflowSingleRecordCommand.tsx
@@ -35,7 +35,7 @@ export const DuplicateWorkflowSingleRecordCommand = () => {
if (isDefined(result) && isNonEmptyString(result.workflowId)) {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Workflow duplicated successfully`,
});
@@ -44,7 +44,7 @@ export const DuplicateWorkflowSingleRecordCommand = () => {
});
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to duplicate workflow`,
});
}
diff --git a/packages/twenty-front/src/modules/dashboards/hooks/useDuplicateDashboard.ts b/packages/twenty-front/src/modules/dashboards/hooks/useDuplicateDashboard.ts
index 877807d052b..e93a9662609 100644
--- a/packages/twenty-front/src/modules/dashboards/hooks/useDuplicateDashboard.ts
+++ b/packages/twenty-front/src/modules/dashboards/hooks/useDuplicateDashboard.ts
@@ -40,7 +40,7 @@ export const useDuplicateDashboard = () => {
});
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to duplicate dashboard`,
});
}
diff --git a/packages/twenty-front/src/modules/error-handler/components/ErrorMessageEffect.tsx b/packages/twenty-front/src/modules/error-handler/components/ErrorMessageEffect.tsx
index 72724535ce6..3b91c00f46f 100644
--- a/packages/twenty-front/src/modules/error-handler/components/ErrorMessageEffect.tsx
+++ b/packages/twenty-front/src/modules/error-handler/components/ErrorMessageEffect.tsx
@@ -12,7 +12,7 @@ export const ErrorMessageEffect = () => {
useEffect(() => {
if (isDefined(errorMessage)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: errorMessage,
dedupeKey: 'error-message-dedupe-key',
});
diff --git a/packages/twenty-front/src/modules/error-handler/utils/__tests__/getToastOptionsFromError.test.tsx b/packages/twenty-front/src/modules/error-handler/utils/__tests__/getToastOptionsFromError.test.tsx
index f0a6ca73753..bf3b3552803 100644
--- a/packages/twenty-front/src/modules/error-handler/utils/__tests__/getToastOptionsFromError.test.tsx
+++ b/packages/twenty-front/src/modules/error-handler/utils/__tests__/getToastOptionsFromError.test.tsx
@@ -16,7 +16,7 @@ describe('getToastOptionsFromError', () => {
onClose,
}),
).toEqual({
- variant: 'error',
+ status: 'error',
children: 'Try again later',
description: 'Your changes are still here',
action,
diff --git a/packages/twenty-front/src/modules/error-handler/utils/getToastOptionsFromError.tsx b/packages/twenty-front/src/modules/error-handler/utils/getToastOptionsFromError.tsx
index f4d0911d8e6..e736520edd1 100644
--- a/packages/twenty-front/src/modules/error-handler/utils/getToastOptionsFromError.tsx
+++ b/packages/twenty-front/src/modules/error-handler/utils/getToastOptionsFromError.tsx
@@ -8,7 +8,7 @@ import { type ToastOptions } from 'twenty-ui/components/feedback';
import { getConflictingRecordFromApolloError } from '~/utils/get-conflicting-record-from-apollo-error.util';
import { getErrorMessageFromApolloError } from '~/utils/get-error-message-from-apollo-error.util';
-type GetToastOptionsFromErrorParams = Omit<ToastOptions, 'variant'> & {
+type GetToastOptionsFromErrorParams = Omit<ToastOptions, 'status'> & {
error: unknown;
};
@@ -47,6 +47,6 @@ export const getToastOptionsFromError = ({
{t`View existing record`}
</NavigationButton>
) : undefined),
- variant: 'error',
+ status: 'error',
};
};
diff --git a/packages/twenty-front/src/modules/front-components/components/FrontComponentLoadErrorToastEffect.tsx b/packages/twenty-front/src/modules/front-components/components/FrontComponentLoadErrorToastEffect.tsx
index 2100384d432..391f1bb6f64 100644
--- a/packages/twenty-front/src/modules/front-components/components/FrontComponentLoadErrorToastEffect.tsx
+++ b/packages/twenty-front/src/modules/front-components/components/FrontComponentLoadErrorToastEffect.tsx
@@ -15,7 +15,7 @@ export const FrontComponentLoadErrorToastEffect = ({
useEffect(() => {
if (isDefined(errorMessage)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to load front component: ${errorMessage}`,
});
}
diff --git a/packages/twenty-front/src/modules/front-components/components/FrontComponentRenderer.tsx b/packages/twenty-front/src/modules/front-components/components/FrontComponentRenderer.tsx
index d3248a16b9d..4267153bd69 100644
--- a/packages/twenty-front/src/modules/front-components/components/FrontComponentRenderer.tsx
+++ b/packages/twenty-front/src/modules/front-components/components/FrontComponentRenderer.tsx
@@ -159,7 +159,7 @@ const FrontComponentRendererContent = ({
}
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to load front component: ${error.message}`,
});
},
diff --git a/packages/twenty-front/src/modules/front-components/hooks/__tests__/useFrontComponentExecutionContext.test.tsx b/packages/twenty-front/src/modules/front-components/hooks/__tests__/useFrontComponentExecutionContext.test.tsx
index e6d6458f93a..50137c5b46b 100644
--- a/packages/twenty-front/src/modules/front-components/hooks/__tests__/useFrontComponentExecutionContext.test.tsx
+++ b/packages/twenty-front/src/modules/front-components/hooks/__tests__/useFrontComponentExecutionContext.test.tsx
@@ -1063,7 +1063,7 @@ describe('useFrontComponentExecutionContext', () => {
expect(mockEnqueueToast).toHaveBeenCalledWith({
children: `${variant} message`,
- variant,
+ status: variant,
duration: 3000,
description: 'details',
dedupeKey: 'key-1',
diff --git a/packages/twenty-front/src/modules/front-components/hooks/useFrontComponentExecutionContext.ts b/packages/twenty-front/src/modules/front-components/hooks/useFrontComponentExecutionContext.ts
index 12f6c0328df..8b72d6ba802 100644
--- a/packages/twenty-front/src/modules/front-components/hooks/useFrontComponentExecutionContext.ts
+++ b/packages/twenty-front/src/modules/front-components/hooks/useFrontComponentExecutionContext.ts
@@ -440,7 +440,7 @@ export const useFrontComponentExecutionContext = ({
}: EnqueueSnackbarParams) => {
enqueueToast({
children: message,
- variant,
+ status: variant,
duration,
description: detailedMessage,
dedupeKey,
diff --git a/packages/twenty-front/src/modules/layout-customization/hooks/useEnterLayoutCustomizationMode.ts b/packages/twenty-front/src/modules/layout-customization/hooks/useEnterLayoutCustomizationMode.ts
index 5ea732c9489..8e11ee291fa 100644
--- a/packages/twenty-front/src/modules/layout-customization/hooks/useEnterLayoutCustomizationMode.ts
+++ b/packages/twenty-front/src/modules/layout-customization/hooks/useEnterLayoutCustomizationMode.ts
@@ -54,7 +54,7 @@ export const useEnterLayoutCustomizationMode = () => {
if (isDashboardInEditMode) {
enqueueToast({
- variant: 'warning',
+ status: 'warning',
children: t`Save or cancel dashboard changes before editing the layout.`,
});
diff --git a/packages/twenty-front/src/modules/layout-customization/hooks/useSaveLayoutCustomization.ts b/packages/twenty-front/src/modules/layout-customization/hooks/useSaveLayoutCustomization.ts
index 807e334e632..2af670471bb 100644
--- a/packages/twenty-front/src/modules/layout-customization/hooks/useSaveLayoutCustomization.ts
+++ b/packages/twenty-front/src/modules/layout-customization/hooks/useSaveLayoutCustomization.ts
@@ -184,7 +184,7 @@ export const useSaveLayoutCustomization = () => {
if (hasAnyFailure) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Some layout changes could not be saved`,
});
return;
@@ -194,7 +194,7 @@ export const useSaveLayoutCustomization = () => {
} catch (error) {
logError(error);
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to save layout customization`,
});
} finally {
diff --git a/packages/twenty-front/src/modules/log-console/components/LogConsole.tsx b/packages/twenty-front/src/modules/log-console/components/LogConsole.tsx
index 607b495764c..249b34e9d39 100644
--- a/packages/twenty-front/src/modules/log-console/components/LogConsole.tsx
+++ b/packages/twenty-front/src/modules/log-console/components/LogConsole.tsx
@@ -537,7 +537,7 @@ export const LogConsole = () => {
setLogConsoleDisplayMode('closed');
setIsLogConsoleFullScreen(false);
enqueueToast({
- variant: 'info',
+ status: 'info',
children: t`Logs console hidden. Press ${toggleHotkeyLabel} to open it again.`,
});
};
diff --git a/packages/twenty-front/src/modules/logic-functions/hooks/usePersistLogicFunction.ts b/packages/twenty-front/src/modules/logic-functions/hooks/usePersistLogicFunction.ts
index 0cd93624b2c..bac0afb5e26 100644
--- a/packages/twenty-front/src/modules/logic-functions/hooks/usePersistLogicFunction.ts
+++ b/packages/twenty-front/src/modules/logic-functions/hooks/usePersistLogicFunction.ts
@@ -67,7 +67,7 @@ export const usePersistLogicFunction = () => {
operationType: CrudOperationType.CREATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return {
@@ -103,7 +103,7 @@ export const usePersistLogicFunction = () => {
operationType: CrudOperationType.UPDATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return {
@@ -143,7 +143,7 @@ export const usePersistLogicFunction = () => {
operationType: CrudOperationType.DELETE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return {
diff --git a/packages/twenty-front/src/modules/marketplace/hooks/__tests__/useInstallMarketplaceApp.test.tsx b/packages/twenty-front/src/modules/marketplace/hooks/__tests__/useInstallMarketplaceApp.test.tsx
index 8cd47a251d7..6ac5c67bcc6 100644
--- a/packages/twenty-front/src/modules/marketplace/hooks/__tests__/useInstallMarketplaceApp.test.tsx
+++ b/packages/twenty-front/src/modules/marketplace/hooks/__tests__/useInstallMarketplaceApp.test.tsx
@@ -96,7 +96,7 @@ describe('useInstallMarketplaceApp', () => {
await waitFor(() => expect(result.current.isInstalling).toBe(false));
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'Manifest validation failed',
});
});
diff --git a/packages/twenty-front/src/modules/marketplace/hooks/__tests__/useUpgradeApplication.test.tsx b/packages/twenty-front/src/modules/marketplace/hooks/__tests__/useUpgradeApplication.test.tsx
index ee46694089a..850aa710707 100644
--- a/packages/twenty-front/src/modules/marketplace/hooks/__tests__/useUpgradeApplication.test.tsx
+++ b/packages/twenty-front/src/modules/marketplace/hooks/__tests__/useUpgradeApplication.test.tsx
@@ -102,7 +102,7 @@ describe('useUpgradeApplication', () => {
await waitFor(() => expect(result.current.isUpgrading).toBe(false));
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'success',
+ status: 'success',
children: 'Application upgraded successfully.',
});
expect(onCompleted).toHaveBeenCalledTimes(1);
@@ -137,7 +137,7 @@ describe('useUpgradeApplication', () => {
await waitFor(() => expect(result.current.isUpgrading).toBe(false));
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'Upgrade failed for this application.',
});
expect(onCompleted).not.toHaveBeenCalled();
diff --git a/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceApp.ts b/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceApp.ts
index ff8c05ee6f8..ecb594c1995 100644
--- a/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceApp.ts
+++ b/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceApp.ts
@@ -62,7 +62,7 @@ export const useInstallMarketplaceApp = ({
async (jobStatus: TrackedJobStatus, trackedUniversalIdentifier: string) => {
if (jobStatus.state === JobState.FAILED) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: isNonEmptyString(jobStatus.failedReason)
? jobStatus.failedReason
: t`Failed to install the application.`,
@@ -82,7 +82,7 @@ export const useInstallMarketplaceApp = ({
installedApplication = result.data?.findOneApplication;
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to load the application.`,
});
return;
@@ -90,7 +90,7 @@ export const useInstallMarketplaceApp = ({
if (!isDefined(installedApplication)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to load the application.`,
});
return;
@@ -111,7 +111,7 @@ export const useInstallMarketplaceApp = ({
);
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Application installed successfully.`,
});
onCompleted?.(installedApplication);
@@ -143,7 +143,7 @@ export const useInstallMarketplaceApp = ({
const graphqlMessage = error instanceof Error ? error.message : undefined;
enqueueToast({
- variant: 'error',
+ status: 'error',
children: graphqlMessage ?? t`Failed to install the application.`,
});
}
diff --git a/packages/twenty-front/src/modules/marketplace/hooks/useUpgradeApplication.ts b/packages/twenty-front/src/modules/marketplace/hooks/useUpgradeApplication.ts
index ea46d33cd4d..789d7a06536 100644
--- a/packages/twenty-front/src/modules/marketplace/hooks/useUpgradeApplication.ts
+++ b/packages/twenty-front/src/modules/marketplace/hooks/useUpgradeApplication.ts
@@ -51,7 +51,7 @@ export const useUpgradeApplication = ({
(jobStatus: TrackedJobStatus) => {
if (jobStatus.state === JobState.FAILED) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: isNonEmptyString(jobStatus.failedReason)
? jobStatus.failedReason
: t`Failed to upgrade the application.`,
@@ -60,7 +60,7 @@ export const useUpgradeApplication = ({
}
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Application upgraded successfully.`,
});
onCompleted?.();
@@ -92,7 +92,7 @@ export const useUpgradeApplication = ({
const graphqlMessage = error instanceof Error ? error.message : undefined;
enqueueToast({
- variant: 'error',
+ status: 'error',
children: graphqlMessage ?? t`Failed to upgrade the application.`,
});
}
diff --git a/packages/twenty-front/src/modules/metadata-error-handler/hooks/useMetadataErrorHandler.ts b/packages/twenty-front/src/modules/metadata-error-handler/hooks/useMetadataErrorHandler.ts
index 91732bd8e74..7175161cfe5 100644
--- a/packages/twenty-front/src/modules/metadata-error-handler/hooks/useMetadataErrorHandler.ts
+++ b/packages/twenty-front/src/modules/metadata-error-handler/hooks/useMetadataErrorHandler.ts
@@ -89,7 +89,7 @@ export const useMetadataErrorHandler = () => {
targetErrors.forEach((entityError) => {
entityError.errors.forEach((validationError) =>
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
validationError.userFriendlyMessage ??
validationError.message,
@@ -110,7 +110,7 @@ export const useMetadataErrorHandler = () => {
.join(', ');
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to ${translatedOperationType} ${translatedMetadataName}. Related ${relatedEntityNames} validation failed. Please check your configuration and try again.`,
});
}
@@ -120,7 +120,7 @@ export const useMetadataErrorHandler = () => {
relatedFailingMetadataNames.length === 0
) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to ${translatedOperationType} ${translatedMetadataName}. Please try again.`,
});
}
@@ -135,7 +135,7 @@ export const useMetadataErrorHandler = () => {
? t`An internal error occurred while validating your changes. Please contact support.`
: t`An internal error occurred while applying your changes. Please contact support and try again later.`;
- enqueueToast({ variant: 'error', children: errorMessage });
+ enqueueToast({ status: 'error', children: errorMessage });
break;
}
}
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/edit/hooks/useNavigationMenuItemEditController.ts b/packages/twenty-front/src/modules/navigation-menu-item/edit/hooks/useNavigationMenuItemEditController.ts
index 20d63fc9918..0fde8e398f1 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/edit/hooks/useNavigationMenuItemEditController.ts
+++ b/packages/twenty-front/src/modules/navigation-menu-item/edit/hooks/useNavigationMenuItemEditController.ts
@@ -117,13 +117,13 @@ export const useNavigationMenuItemEditController = (
},
]).catch(() =>
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Couldn't add to favorites`,
}),
);
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Couldn't add to favorites`,
});
}
@@ -149,7 +149,7 @@ export const useNavigationMenuItemEditController = (
try {
await updateManyNavigationMenuItems([{ id, update }]);
} catch {
- enqueueToast({ variant: 'error', children: t`Couldn't update favorite` });
+ enqueueToast({ status: 'error', children: t`Couldn't update favorite` });
}
};
@@ -166,7 +166,7 @@ export const useNavigationMenuItemEditController = (
try {
await deleteManyNavigationMenuItems(ids);
} catch {
- enqueueToast({ variant: 'error', children: t`Couldn't remove favorite` });
+ enqueueToast({ status: 'error', children: t`Couldn't remove favorite` });
}
};
diff --git a/packages/twenty-front/src/modules/object-core/agents/hooks/useCoreAgentSave.ts b/packages/twenty-front/src/modules/object-core/agents/hooks/useCoreAgentSave.ts
index 8c294d5c621..f827698da53 100644
--- a/packages/twenty-front/src/modules/object-core/agents/hooks/useCoreAgentSave.ts
+++ b/packages/twenty-front/src/modules/object-core/agents/hooks/useCoreAgentSave.ts
@@ -54,7 +54,7 @@ export const useCoreAgentSave = ({
const errorMessage =
error instanceof Error ? error.message : String(error);
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to save role permissions: ${errorMessage}`,
});
}
diff --git a/packages/twenty-front/src/modules/object-core/agents/hooks/useCreateCoreAgent.ts b/packages/twenty-front/src/modules/object-core/agents/hooks/useCreateCoreAgent.ts
index e454b5802d2..c607ec957d9 100644
--- a/packages/twenty-front/src/modules/object-core/agents/hooks/useCreateCoreAgent.ts
+++ b/packages/twenty-front/src/modules/object-core/agents/hooks/useCreateCoreAgent.ts
@@ -54,7 +54,7 @@ export const useCreateCoreAgent = () => {
} catch (error) {
logError(error);
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to create agent`,
});
@@ -65,7 +65,7 @@ export const useCreateCoreAgent = () => {
if (!isDefined(coreAgentId)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to create agent`,
});
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCreateCoreWorkflow.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCreateCoreWorkflow.ts
index b792d9ed4ef..45f1d6563c2 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCreateCoreWorkflow.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCreateCoreWorkflow.ts
@@ -53,7 +53,7 @@ export const useCreateCoreWorkflow = () => {
} catch (error) {
logError(error);
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to create workflow`,
});
@@ -64,7 +64,7 @@ export const useCreateCoreWorkflow = () => {
if (!isDefined(coreWorkflowId)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to create workflow`,
});
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows.ts
index c2fb52c4791..9f6b45c959b 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useDeleteSelectedCoreWorkflows.ts
@@ -75,7 +75,7 @@ export const useDeleteSelectedCoreWorkflows = () => {
} catch (error) {
logError(error);
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to delete workflows`,
});
@@ -84,7 +84,7 @@ export const useDeleteSelectedCoreWorkflows = () => {
if (!isNonEmptyArray(deletedCoreWorkflows)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`No workflows were deleted`,
});
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useRenameCoreWorkflow.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useRenameCoreWorkflow.ts
index 0e3b18b2454..4a34b5a675f 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/useRenameCoreWorkflow.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useRenameCoreWorkflow.ts
@@ -29,7 +29,7 @@ export const useRenameCoreWorkflow = ({
return true;
} catch (mutationError) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
mutationError instanceof Error
? mutationError.message
diff --git a/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useRestoreCoreWorkflowVersionAsDraft.ts b/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useRestoreCoreWorkflowVersionAsDraft.ts
index 1932f6c62bb..522e84fab88 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useRestoreCoreWorkflowVersionAsDraft.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/versions/hooks/useRestoreCoreWorkflowVersionAsDraft.ts
@@ -47,7 +47,7 @@ export const useRestoreCoreWorkflowVersionAsDraft = ({
if (!isDefined(draftWorkflowVersionId)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Could not restore this version as draft.`,
});
@@ -58,7 +58,7 @@ export const useRestoreCoreWorkflowVersionAsDraft = ({
navigate(AppPath.WorkflowCoreShowPage, { coreWorkflowId: workflowId });
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Could not restore this version as draft.`,
});
} finally {
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneFieldMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneFieldMetadataItem.ts
index e63e5654023..7056b7b3db1 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneFieldMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneFieldMetadataItem.ts
@@ -67,7 +67,7 @@ export const useCreateOneFieldMetadataItem = () => {
operationType: CrudOperationType.CREATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return {
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneIndexMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneIndexMetadataItem.ts
index f3615a7de90..d99ba5e00b3 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneIndexMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneIndexMetadataItem.ts
@@ -75,7 +75,7 @@ export const useCreateOneIndexMetadataItem = () => {
operationType: CrudOperationType.CREATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return {
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneObjectMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneObjectMetadataItem.ts
index 820fc7434fb..ba0a95a6b0d 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneObjectMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useCreateOneObjectMetadataItem.ts
@@ -140,7 +140,7 @@ export const useCreateOneObjectMetadataItem = () => {
operationType: CrudOperationType.CREATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return {
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneFieldMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneFieldMetadataItem.ts
index 2c137848323..cb75f0f9ade 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneFieldMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneFieldMetadataItem.ts
@@ -82,7 +82,7 @@ export const useDeleteOneFieldMetadataItem = () => {
operationType: CrudOperationType.DELETE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return {
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneIndexMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneIndexMetadataItem.ts
index 1b1cc11b9f8..01e8511a68b 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneIndexMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneIndexMetadataItem.ts
@@ -48,7 +48,7 @@ export const useDeleteOneIndexMetadataItem = () => {
operationType: CrudOperationType.DELETE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return {
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneObjectMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneObjectMetadataItem.ts
index f7d065ed3b1..90bfffe26bd 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneObjectMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useDeleteOneObjectMetadataItem.ts
@@ -54,7 +54,7 @@ export const useDeleteOneObjectMetadataItem = () => {
operationType: CrudOperationType.DELETE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return {
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneFieldMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneFieldMetadataItem.ts
index 38c3bc29cba..5c7eaf3ab12 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneFieldMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneFieldMetadataItem.ts
@@ -97,7 +97,7 @@ export const useUpdateOneFieldMetadataItem = () => {
operationType: CrudOperationType.UPDATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return {
diff --git a/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneObjectMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneObjectMetadataItem.ts
index 5b38014673e..cd9b0a279e9 100644
--- a/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneObjectMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/hooks/useUpdateOneObjectMetadataItem.ts
@@ -88,7 +88,7 @@ export const useUpdateOneObjectMetadataItem = () => {
operationType: CrudOperationType.UPDATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return {
diff --git a/packages/twenty-front/src/modules/object-record/hooks/useBatchCreateManyRecords.ts b/packages/twenty-front/src/modules/object-record/hooks/useBatchCreateManyRecords.ts
index 2cf013d1604..15ca52d2896 100644
--- a/packages/twenty-front/src/modules/object-record/hooks/useBatchCreateManyRecords.ts
+++ b/packages/twenty-front/src/modules/object-record/hooks/useBatchCreateManyRecords.ts
@@ -87,7 +87,7 @@ export const useBatchCreateManyRecords = <
) {
const formattedCreatedRecordsCount = formatNumber(createdRecordsCount);
enqueueToast({
- variant: 'warning',
+ status: 'warning',
children: t`Record creation stopped. ${formattedCreatedRecordsCount} records created.`,
duration: 5000,
});
diff --git a/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarDragDropContext.tsx b/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarDragDropContext.tsx
index 34690893197..6e355f1febe 100644
--- a/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarDragDropContext.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarDragDropContext.tsx
@@ -46,7 +46,7 @@ export const RecordCalendarDragDropContext = ({
void processCalendarCardDrop(result).catch((error) => {
logError(error);
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to move record`,
});
});
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordPicker.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordPicker.tsx
index 503566ac16b..83645b33ba4 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordPicker.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordPicker.tsx
@@ -139,7 +139,7 @@ export const FormMultiRecordPicker = ({
if (selectedRecordCount >= QUERY_MAX_RECORDS) {
enqueueToast({
- variant: 'warning',
+ status: 'warning',
children: t`You can select at most ${QUERY_MAX_RECORDS} records.`,
});
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormRecordRichTextFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormRecordRichTextFieldInput.tsx
index e4084ff6964..ed773e7d67a 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormRecordRichTextFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormRecordRichTextFieldInput.tsx
@@ -98,7 +98,7 @@ export const FormRecordRichTextFieldInput = ({
const handleUploadFile = async (): Promise<string> => {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Save the record before attaching a file`,
});
@@ -146,7 +146,7 @@ export const FormRecordRichTextFieldInput = ({
useEffect(() => {
if (hasUnreadableStoredValue) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`This content was saved in an older format and cannot be edited here`,
});
}
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useCreateJunctionRecordWithNestedTarget.ts b/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useCreateJunctionRecordWithNestedTarget.ts
index 9228ee0cfb8..627bfb887ab 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useCreateJunctionRecordWithNestedTarget.ts
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useCreateJunctionRecordWithNestedTarget.ts
@@ -76,7 +76,7 @@ export const useCreateJunctionRecordWithNestedTarget = ({
!isDefined(sourceJoinColumnName)
) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`The relation configuration could not be resolved.`,
});
return undefined;
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/hooks/useUploadFilesFieldFile.ts b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/hooks/useUploadFilesFieldFile.ts
index 39afa9d6ce0..e64a7919537 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/hooks/useUploadFilesFieldFile.ts
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/hooks/useUploadFilesFieldFile.ts
@@ -20,7 +20,7 @@ export const useUploadFilesFieldFile = () => {
const fileName = file.name;
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`File "${fileName}" uploaded successfully`,
});
@@ -34,7 +34,7 @@ export const useUploadFilesFieldFile = () => {
const fileNameForError = file.name;
const errorMessage = String(error);
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to upload "${fileNameForError}"`,
});
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/FilesFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/FilesFieldInput.tsx
index 027062e11e8..85c22071c19 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/FilesFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/FilesFieldInput.tsx
@@ -85,7 +85,7 @@ export const FilesFieldInput = () => {
files.length > 0
) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Cannot upload more than ${maxNumberOfValues} files`,
});
return;
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/hooks/useOpenFilesFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/hooks/useOpenFilesFieldInput.tsx
index 48a129ae9d0..1675f852547 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/hooks/useOpenFilesFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/hooks/useOpenFilesFieldInput.tsx
@@ -89,7 +89,7 @@ export const useOpenFilesFieldInput = () => {
onUpload: async (selectedFiles: File[]) => {
if (selectedFiles.length + currentFileCount > maxNumberOfValues) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Cannot upload more than ${maxNumberOfValues} files`,
});
diff --git a/packages/twenty-front/src/modules/object-record/record-list/components/RecordListAddNew.tsx b/packages/twenty-front/src/modules/object-record/record-list/components/RecordListAddNew.tsx
index aa65083f09a..e7ecf5add03 100644
--- a/packages/twenty-front/src/modules/object-record/record-list/components/RecordListAddNew.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-list/components/RecordListAddNew.tsx
@@ -92,7 +92,7 @@ export const RecordListAddNew = () => {
});
} catch (error) {
logError(error);
- enqueueToast({ variant: 'error', children: t`Failed to create record` });
+ enqueueToast({ status: 'error', children: t`Failed to create record` });
}
};
diff --git a/packages/twenty-front/src/modules/object-record/record-merge/hooks/useMergeRecordsActions.ts b/packages/twenty-front/src/modules/object-record/record-merge/hooks/useMergeRecordsActions.ts
index aa630873079..10a20529dd2 100644
--- a/packages/twenty-front/src/modules/object-record/record-merge/hooks/useMergeRecordsActions.ts
+++ b/packages/twenty-front/src/modules/object-record/record-merge/hooks/useMergeRecordsActions.ts
@@ -49,7 +49,7 @@ export const useMergeRecordsActions = ({
const recordCount = selectedRecords.length;
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Successfully merged ${recordCount} records`,
});
closeSidePanelMenu();
@@ -60,7 +60,7 @@ export const useMergeRecordsActions = ({
});
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error
? error.message
diff --git a/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetJunctionAddNewRow.tsx b/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetJunctionAddNewRow.tsx
index d7f3f33d167..5a354a3d84f 100644
--- a/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetJunctionAddNewRow.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetJunctionAddNewRow.tsx
@@ -54,7 +54,7 @@ export const RecordTableWidgetJunctionAddNewRow = ({
const handleTargetRecordSelected = (targetRecordId: string) => {
createJunctionRecord(targetRecordId).catch((error) => {
logError(error);
- enqueueToast({ variant: 'error', children: t`Failed to add record` });
+ enqueueToast({ status: 'error', children: t`Failed to add record` });
});
};
diff --git a/packages/twenty-front/src/modules/object-record/record-update-multiple/components/UpdateMultipleRecordsContainer.tsx b/packages/twenty-front/src/modules/object-record/record-update-multiple/components/UpdateMultipleRecordsContainer.tsx
index 9e3242f23c9..f9b0aa59349 100644
--- a/packages/twenty-front/src/modules/object-record/record-update-multiple/components/UpdateMultipleRecordsContainer.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-update-multiple/components/UpdateMultipleRecordsContainer.tsx
@@ -74,7 +74,7 @@ export const UpdateMultipleRecordsContainer = ({
closeSidePanelMenu();
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error
? error.message
diff --git a/packages/twenty-front/src/modules/onboarding/components/OnboardingProfilePictureUploader.tsx b/packages/twenty-front/src/modules/onboarding/components/OnboardingProfilePictureUploader.tsx
index 9baa8fd964d..0c5972b86ed 100644
--- a/packages/twenty-front/src/modules/onboarding/components/OnboardingProfilePictureUploader.tsx
+++ b/packages/twenty-front/src/modules/onboarding/components/OnboardingProfilePictureUploader.tsx
@@ -79,7 +79,7 @@ export const OnboardingProfilePictureUploader = ({
);
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error ? error.message : t`Failed to upload picture`,
});
diff --git a/packages/twenty-front/src/modules/onboarding/components/__tests__/BookCallOnboardingStepActions.test.tsx b/packages/twenty-front/src/modules/onboarding/components/__tests__/BookCallOnboardingStepActions.test.tsx
index 0e9b5505e96..a658895d33d 100644
--- a/packages/twenty-front/src/modules/onboarding/components/__tests__/BookCallOnboardingStepActions.test.tsx
+++ b/packages/twenty-front/src/modules/onboarding/components/__tests__/BookCallOnboardingStepActions.test.tsx
@@ -113,7 +113,7 @@ describe('BookCallOnboardingStepActions', () => {
expect(skipButton).not.toBeDisabled();
expect(mockEnqueueToast).toHaveBeenCalledWith(
- expect.objectContaining({ variant: 'error', children: 'network error' }),
+ expect.objectContaining({ status: 'error', children: 'network error' }),
);
});
diff --git a/packages/twenty-front/src/modules/onboarding/hooks/__tests__/useGoBackToPreviousOnboardingStep.test.tsx b/packages/twenty-front/src/modules/onboarding/hooks/__tests__/useGoBackToPreviousOnboardingStep.test.tsx
index 843e076c306..b7dd23e4d6b 100644
--- a/packages/twenty-front/src/modules/onboarding/hooks/__tests__/useGoBackToPreviousOnboardingStep.test.tsx
+++ b/packages/twenty-front/src/modules/onboarding/hooks/__tests__/useGoBackToPreviousOnboardingStep.test.tsx
@@ -186,7 +186,7 @@ describe('useGoBackToPreviousOnboardingStep', () => {
});
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'An error occurred.',
});
});
diff --git a/packages/twenty-front/src/modules/onboarding/hooks/__tests__/useInviteTeam.test.ts b/packages/twenty-front/src/modules/onboarding/hooks/__tests__/useInviteTeam.test.ts
index eadc4fe9d74..a9463a9981e 100644
--- a/packages/twenty-front/src/modules/onboarding/hooks/__tests__/useInviteTeam.test.ts
+++ b/packages/twenty-front/src/modules/onboarding/hooks/__tests__/useInviteTeam.test.ts
@@ -307,7 +307,7 @@ describe('useInviteTeam', () => {
expect(mockEnqueueToast).toHaveBeenCalledTimes(1);
expect(mockEnqueueToast).toHaveBeenCalledWith(
expect.objectContaining({
- variant: 'error',
+ status: 'error',
children: '[email protected] already invited',
}),
);
diff --git a/packages/twenty-front/src/modules/onboarding/hooks/useInviteTeam.ts b/packages/twenty-front/src/modules/onboarding/hooks/useInviteTeam.ts
index 69b3f20364e..9efa92be959 100644
--- a/packages/twenty-front/src/modules/onboarding/hooks/useInviteTeam.ts
+++ b/packages/twenty-front/src/modules/onboarding/hooks/useInviteTeam.ts
@@ -190,7 +190,7 @@ export const useInviteTeam = () => {
isNonEmptyArray(invitationErrors)
) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: invitationErrors.join(', '),
duration: 5000,
});
@@ -198,7 +198,7 @@ export const useInviteTeam = () => {
if (sentInvitationsCount > 0) {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Invite link sent to email addresses`,
duration: 2000,
});
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useResetPageLayoutTabToDefault.ts b/packages/twenty-front/src/modules/page-layout/hooks/useResetPageLayoutTabToDefault.ts
index bf47f636f54..d86c74e8841 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useResetPageLayoutTabToDefault.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useResetPageLayoutTabToDefault.ts
@@ -31,7 +31,7 @@ export const useResetPageLayoutTabToDefault = (
operationType: CrudOperationType.UPDATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
}
},
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useResetPageLayoutToDefault.ts b/packages/twenty-front/src/modules/page-layout/hooks/useResetPageLayoutToDefault.ts
index 9c6b9d3e70a..dfcdee5e96e 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useResetPageLayoutToDefault.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useResetPageLayoutToDefault.ts
@@ -41,7 +41,7 @@ export const useResetPageLayoutToDefault = () => {
operationType: CrudOperationType.UPDATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
}
},
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useResetPageLayoutWidgetToDefault.ts b/packages/twenty-front/src/modules/page-layout/hooks/useResetPageLayoutWidgetToDefault.ts
index be373a709e9..54307678edb 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useResetPageLayoutWidgetToDefault.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useResetPageLayoutWidgetToDefault.ts
@@ -31,7 +31,7 @@ export const useResetPageLayoutWidgetToDefault = (
operationType: CrudOperationType.UPDATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
}
},
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWidgetsIsActive.ts b/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWidgetsIsActive.ts
index e6c61dcf28c..82acece78d7 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWidgetsIsActive.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWidgetsIsActive.ts
@@ -52,7 +52,7 @@ export const useUpdatePageLayoutWidgetsIsActive = () => {
operationType: CrudOperationType.UPDATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return { status: 'failed' };
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWithTabsAndWidgets.ts b/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWithTabsAndWidgets.ts
index d2f721a0866..385f16348c6 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWithTabsAndWidgets.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useUpdatePageLayoutWithTabsAndWidgets.ts
@@ -47,7 +47,7 @@ export const useUpdatePageLayoutWithTabsAndWidgets = () => {
operationType: CrudOperationType.UPDATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return {
diff --git a/packages/twenty-front/src/modules/settings/accounts/hooks/useImapSmtpCaldavConnectionForm.ts b/packages/twenty-front/src/modules/settings/accounts/hooks/useImapSmtpCaldavConnectionForm.ts
index d2ae8812872..3d55b34fb62 100644
--- a/packages/twenty-front/src/modules/settings/accounts/hooks/useImapSmtpCaldavConnectionForm.ts
+++ b/packages/twenty-front/src/modules/settings/accounts/hooks/useImapSmtpCaldavConnectionForm.ts
@@ -183,7 +183,7 @@ export const useImapSmtpCaldavConnectionForm = ({
? t`Connection successfully updated`
: t`Connection successfully created`;
- enqueueToast({ variant: 'success', children: successMessage });
+ enqueueToast({ status: 'success', children: successMessage });
const { connectedAccountId: returnedConnectedAccountId } =
data?.saveImapSmtpCaldavAccount ?? {};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx b/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx
index 7e3775655c6..3bbb399187c 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx
@@ -153,7 +153,7 @@ export const SettingsAdminAI = () => {
await refetchClientConfig();
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to update default model`,
});
}
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/apps/components/SettingsAdminApps.tsx b/packages/twenty-front/src/modules/settings/admin-panel/apps/components/SettingsAdminApps.tsx
index 755bcacb58a..53355414e71 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/apps/components/SettingsAdminApps.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/apps/components/SettingsAdminApps.tsx
@@ -120,12 +120,12 @@ export const SettingsAdminApps = () => {
try {
await syncMarketplaceCatalog();
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Marketplace catalog synchronization started.`,
});
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to synchronize the marketplace catalog.`,
});
}
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/chats/hooks/useAdminChatThreads.ts b/packages/twenty-front/src/modules/settings/admin-panel/chats/hooks/useAdminChatThreads.ts
index b918151bebb..1ce86b0e54e 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/chats/hooks/useAdminChatThreads.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/chats/hooks/useAdminChatThreads.ts
@@ -104,7 +104,7 @@ export const useAdminChatThreads = () => {
});
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to load more chats.`,
});
}
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
index b79e3717b8e..fc09d360ba2 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
@@ -125,7 +125,7 @@ export const SettingsAdminServerAdminAccess = ({
});
await refetch();
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Server administrator access updated.`,
});
} catch (error) {
@@ -133,7 +133,7 @@ export const SettingsAdminServerAdminAccess = ({
CombinedGraphQLErrors.is(error)
? getToastOptionsFromError({ error })
: {
- variant: 'error',
+ status: 'error',
children: t`Failed to update server administrator access.`,
},
);
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantModal.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantModal.tsx
index dcd8cad0aa0..a622d948d6a 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantModal.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantModal.tsx
@@ -122,7 +122,7 @@ export const SettingsAdminWorkspaceCreditGrantModal = ({
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Granted ${parsedAmount} credits to this workspace.`,
});
handleClose();
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantsTable.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantsTable.tsx
index 30ad9f91f87..8dc489f7fe2 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantsTable.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantsTable.tsx
@@ -101,7 +101,7 @@ export const SettingsAdminWorkspaceCreditGrantsTable = ({
variables: { workspaceId, creditGrantId },
});
- enqueueToast({ variant: 'success', children: t`Credit grant revoked.` });
+ enqueueToast({ status: 'success', children: t`Credit grant revoked.` });
} catch (error) {
enqueueToast(getToastOptionsFromError({ error }));
} finally {
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceUsageLimitModal.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceUsageLimitModal.tsx
index 368f77fc603..e7f024f9dd3 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceUsageLimitModal.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceUsageLimitModal.tsx
@@ -141,7 +141,7 @@ export const SettingsAdminWorkspaceUsageLimitModal = ({
}
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Limit saved for this workspace.`,
});
handleClose();
@@ -162,7 +162,7 @@ export const SettingsAdminWorkspaceUsageLimitModal = ({
if (data?.deleteWorkspaceUsageLimit !== true) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`This override no longer exists. Reload to see the current limit.`,
});
handleClose();
@@ -171,7 +171,7 @@ export const SettingsAdminWorkspaceUsageLimitModal = ({
}
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Limit reset to the default.`,
});
handleClose();
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useDeleteJobs.ts b/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useDeleteJobs.ts
index 88594856153..a943f303d97 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useDeleteJobs.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useDeleteJobs.ts
@@ -42,14 +42,14 @@ export const useDeleteJobs = ({
if (deletedCount > 0) {
if (failedResults.length > 0) {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: plural(deletedCount, {
one: `Successfully deleted ${deletedCount} job`,
other: `Successfully deleted ${deletedCount} jobs`,
}),
});
enqueueToast({
- variant: 'error',
+ status: 'error',
children: plural(failedResults.length, {
one: `# job could not be deleted`,
other: `# jobs could not be deleted`,
@@ -57,7 +57,7 @@ export const useDeleteJobs = ({
});
} else {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: plural(deletedCount, {
one: `Successfully deleted ${deletedCount} job`,
other: `Successfully deleted ${deletedCount} jobs`,
@@ -74,14 +74,14 @@ export const useDeleteJobs = ({
errorMessages.length > 0 ? `: ${errorMessages[0]}` : '';
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`No jobs were deleted${errorDetails}`,
});
}
}
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: CombinedGraphQLErrors.is(error)
? getErrorMessageFromApolloError(error)
: t`Failed to delete jobs. Please try again later.`,
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useRetryJobs.ts b/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useRetryJobs.ts
index f3656609799..fdaffd4e2fc 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useRetryJobs.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useRetryJobs.ts
@@ -41,20 +41,20 @@ export const useRetryJobs = ({
if (retriedCount === -1) {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`All failed jobs have been retried`,
});
} else if (retriedCount > 0) {
if (failedResults.length > 0) {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: plural(retriedCount, {
one: `Successfully retried ${retriedCount} job`,
other: `Successfully retried ${retriedCount} jobs`,
}),
});
enqueueToast({
- variant: 'error',
+ status: 'error',
children: plural(failedResults.length, {
one: `# job could not be retried`,
other: `# jobs could not be retried`,
@@ -62,7 +62,7 @@ export const useRetryJobs = ({
});
} else {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: plural(retriedCount, {
one: `Successfully retried ${retriedCount} job`,
other: `Successfully retried ${retriedCount} jobs`,
@@ -77,7 +77,7 @@ export const useRetryJobs = ({
errorMessages.length > 0 ? `: ${errorMessages[0]}` : '';
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`No jobs were retried${errorDetails}`,
});
}
@@ -86,7 +86,7 @@ export const useRetryJobs = ({
}
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: CombinedGraphQLErrors.is(error)
? getErrorMessageFromApolloError(error)
: t`Failed to retry jobs. Please try again later.`,
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx
index 7a19fc09e9b..c05a3ba6533 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx
@@ -97,7 +97,7 @@ export const SettingsAdminMaintenanceMode = () => {
});
} catch (error: unknown) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error
? error.message
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useHandleImpersonate.ts b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useHandleImpersonate.ts
index c89166505bc..33971970bb9 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useHandleImpersonate.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useHandleImpersonate.ts
@@ -28,7 +28,7 @@ export const useHandleImpersonate = () => {
const handleImpersonate = async (userId: string, workspaceId: string) => {
if (!isDefined(currentUser?.id) || userId === currentUser.id) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`You cannot impersonate your own account`,
});
@@ -58,7 +58,7 @@ export const useHandleImpersonate = () => {
},
onError: (error) => {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: `Failed to impersonate user. ${error.message}`,
});
},
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/signing-keys/hooks/useRevokeSigningKey.ts b/packages/twenty-front/src/modules/settings/admin-panel/signing-keys/hooks/useRevokeSigningKey.ts
index 63cba361bbf..cbb0880ce8e 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/signing-keys/hooks/useRevokeSigningKey.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/signing-keys/hooks/useRevokeSigningKey.ts
@@ -26,11 +26,11 @@ export const useRevokeSigningKey = (onSuccess?: () => void) => {
awaitRefetchQueries: true,
});
- enqueueToast({ variant: 'success', children: t`Signing key revoked` });
+ enqueueToast({ status: 'success', children: t`Signing key revoked` });
onSuccess?.();
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: CombinedGraphQLErrors.is(error)
? getErrorMessageFromApolloError(error)
: t`Failed to revoke signing key. Please try again later.`,
diff --git a/packages/twenty-front/src/modules/settings/applications/hooks/__tests__/useUninstallApplication.test.tsx b/packages/twenty-front/src/modules/settings/applications/hooks/__tests__/useUninstallApplication.test.tsx
index 238004b199e..0b498e64817 100644
--- a/packages/twenty-front/src/modules/settings/applications/hooks/__tests__/useUninstallApplication.test.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/hooks/__tests__/useUninstallApplication.test.tsx
@@ -84,7 +84,7 @@ describe('useUninstallApplication', () => {
await waitFor(() => expect(result.current.isUninstalling).toBe(false));
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'success',
+ status: 'success',
children: 'Application successfully uninstalled.',
});
expect(onCompleted).toHaveBeenCalledTimes(1);
@@ -117,7 +117,7 @@ describe('useUninstallApplication', () => {
await waitFor(() => expect(result.current.isUninstalling).toBe(false));
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'This application cannot be uninstalled.',
});
});
diff --git a/packages/twenty-front/src/modules/settings/applications/hooks/useUninstallApplication.ts b/packages/twenty-front/src/modules/settings/applications/hooks/useUninstallApplication.ts
index faa7b487ec2..10a577893e0 100644
--- a/packages/twenty-front/src/modules/settings/applications/hooks/useUninstallApplication.ts
+++ b/packages/twenty-front/src/modules/settings/applications/hooks/useUninstallApplication.ts
@@ -54,7 +54,7 @@ export const useUninstallApplication = ({
(jobStatus: TrackedJobStatus, trackedUninstallIdentifier: string) => {
if (jobStatus.state === JobState.FAILED) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: isNonEmptyString(jobStatus.failedReason)
? jobStatus.failedReason
: t`Error uninstalling application.`,
@@ -77,7 +77,7 @@ export const useUninstallApplication = ({
);
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Application successfully uninstalled.`,
});
onCompleted?.();
@@ -109,7 +109,7 @@ export const useUninstallApplication = ({
const graphqlMessage = error instanceof Error ? error.message : undefined;
enqueueToast({
- variant: 'error',
+ status: 'error',
children: graphqlMessage ?? t`Error uninstalling application.`,
});
}
diff --git a/packages/twenty-front/src/modules/settings/billing/components/AddPaymentMethodForm.tsx b/packages/twenty-front/src/modules/settings/billing/components/AddPaymentMethodForm.tsx
index ba8c40e3880..225a2c32159 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/AddPaymentMethodForm.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/AddPaymentMethodForm.tsx
@@ -82,7 +82,7 @@ const AddPaymentMethodFormContent = ({
const { error: submitError } = await elements.submit();
if (isDefined(submitError)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
submitError.message ??
t`Your payment details are incomplete. Please review and retry.`,
@@ -97,7 +97,7 @@ const AddPaymentMethodFormContent = ({
data?.createBillingPaymentMethodSetupIntent?.clientSecret;
if (!isDefined(clientSecret)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Subscription error. Please retry or contact Twenty team`,
});
setIsSubmitting(false);
@@ -113,7 +113,7 @@ const AddPaymentMethodFormContent = ({
if (isDefined(error)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error.message ??
t`We couldn't confirm your payment method. Please retry.`,
@@ -130,7 +130,7 @@ const AddPaymentMethodFormContent = ({
enqueueToast(getToastOptionsFromError({ error }));
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Subscription error. Please retry or contact Twenty team`,
});
}
diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitEditForm.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitEditForm.tsx
index 3d6d3f9d0b5..882204bc7f0 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitEditForm.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitEditForm.tsx
@@ -54,11 +54,11 @@ export const SettingsBillingLimitEditForm = ({
const handleDelete = async () => {
try {
await deleteUsageLimit({ variables: { usageLimitId } });
- enqueueToast({ variant: 'success', children: t`Limit deleted.` });
+ enqueueToast({ status: 'success', children: t`Limit deleted.` });
navigate(SettingsPath.BillingLimits);
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to delete the limit.`,
});
} finally {
@@ -76,7 +76,7 @@ export const SettingsBillingLimitEditForm = ({
variables: { input: { id: usageLimitId, payload: input } },
});
- enqueueToast({ variant: 'success', children: t`Limit updated.` });
+ enqueueToast({ status: 'success', children: t`Limit updated.` });
navigate(SettingsPath.BillingLimits);
} catch (error) {
const serverMessage =
@@ -85,7 +85,7 @@ export const SettingsBillingLimitEditForm = ({
: undefined;
enqueueToast({
- variant: 'error',
+ status: 'error',
children: serverMessage ?? t`Failed to update the limit.`,
});
}
diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingSubscriptionInfo.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingSubscriptionInfo.tsx
index 98c3ce33a99..70afa72d42d 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingSubscriptionInfo.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingSubscriptionInfo.tsx
@@ -363,9 +363,9 @@ export const SettingsBillingSubscriptionInfo = ({
try {
await action();
- enqueueToast({ variant: 'success', children: getSuccessMessage() });
+ enqueueToast({ status: 'success', children: getSuccessMessage() });
} catch (error) {
- enqueueToast({ variant: 'error', children: getErrorMessage() });
+ enqueueToast({ status: 'error', children: getErrorMessage() });
if (!CombinedGraphQLErrors.is(error)) {
throw error;
diff --git a/packages/twenty-front/src/modules/settings/billing/components/UpdatePaymentMethodModal.tsx b/packages/twenty-front/src/modules/settings/billing/components/UpdatePaymentMethodModal.tsx
index 86acbf6dc9d..1d87d16fa09 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/UpdatePaymentMethodModal.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/UpdatePaymentMethodModal.tsx
@@ -41,13 +41,13 @@ export const UpdatePaymentMethodModal = ({
markBillingPaymentMethodAsAdded();
if (!isSubscriptionPaymentOverdue(subscriptionStatus)) {
- enqueueToast({ variant: 'success', children: t`Payment method added.` });
+ enqueueToast({ status: 'success', children: t`Payment method added.` });
return;
}
enqueueToast({
- variant: 'info',
+ status: 'info',
children: t`Payment method added. Retrying your payment...`,
});
diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsx
index 588a2f988f8..78e18196b23 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsx
@@ -307,13 +307,13 @@ export const ResourceCreditPriceSelector = ({
},
);
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Resource credits updated.`,
});
setSelectedPriceId(undefined);
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to update resource credits.`,
});
diff --git a/packages/twenty-front/src/modules/settings/billing/effect-components/EndTrialAfterPaymentMethodEffect.tsx b/packages/twenty-front/src/modules/settings/billing/effect-components/EndTrialAfterPaymentMethodEffect.tsx
index 21cec3bca2f..eae6cb7fce0 100644
--- a/packages/twenty-front/src/modules/settings/billing/effect-components/EndTrialAfterPaymentMethodEffect.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/effect-components/EndTrialAfterPaymentMethodEffect.tsx
@@ -60,7 +60,7 @@ export const EndTrialAfterPaymentMethodEffect = () => {
}
} else if (hasPaymentMethod === false) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`No payment method found. Please update your billing details.`,
});
}
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useApplyBillingSubscriptionChange.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useApplyBillingSubscriptionChange.ts
index 8d5df2d64cc..d64bf8c4a0c 100644
--- a/packages/twenty-front/src/modules/settings/billing/hooks/useApplyBillingSubscriptionChange.ts
+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useApplyBillingSubscriptionChange.ts
@@ -135,13 +135,13 @@ export const useApplyBillingSubscriptionChange = () => {
);
if (!isBillingUpdateApplied) {
- enqueueToast({ variant: 'error', children: getErrorMessage(change) });
+ enqueueToast({ status: 'error', children: getErrorMessage(change) });
return;
}
- enqueueToast({ variant: 'success', children: getSuccessMessage(change) });
+ enqueueToast({ status: 'success', children: getSuccessMessage(change) });
} catch (error) {
- enqueueToast({ variant: 'error', children: getErrorMessage(change) });
+ enqueueToast({ status: 'error', children: getErrorMessage(change) });
if (!CombinedGraphQLErrors.is(error)) {
throw error;
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useBillingPortalSession.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useBillingPortalSession.ts
index c1ef54928bd..058876150a4 100644
--- a/packages/twenty-front/src/modules/settings/billing/hooks/useBillingPortalSession.ts
+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useBillingPortalSession.ts
@@ -25,7 +25,7 @@ export const useBillingPortalSession = (returnUrlPath: string) => {
const showBillingPortalSessionError = () => {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Billing portal session error. Please retry or contact Twenty team`,
});
};
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useCreditUpgradeAction.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useCreditUpgradeAction.ts
index 696a972e8d5..15f2a9448a6 100644
--- a/packages/twenty-front/src/modules/settings/billing/hooks/useCreditUpgradeAction.ts
+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useCreditUpgradeAction.ts
@@ -45,7 +45,7 @@ export const useCreditUpgradeAction = () => {
}
try {
- enqueueToast({ variant: 'info', children: t`Upgrading subscription...` });
+ enqueueToast({ status: 'info', children: t`Upgrading subscription...` });
const { data } = await setResourceCreditSubscriptionPrice({
variables: { priceId: nextPrice.stripePriceId },
@@ -69,10 +69,10 @@ export const useCreditUpgradeAction = () => {
},
);
- enqueueToast({ variant: 'success', children: t`Credit plan upgraded.` });
+ enqueueToast({ status: 'success', children: t`Credit plan upgraded.` });
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to upgrade credit plan.`,
});
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useEndSubscriptionTrialPeriod.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useEndSubscriptionTrialPeriod.ts
index 7608976ad1b..ca8432bc341 100644
--- a/packages/twenty-front/src/modules/settings/billing/hooks/useEndSubscriptionTrialPeriod.ts
+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useEndSubscriptionTrialPeriod.ts
@@ -66,7 +66,7 @@ export const useEndSubscriptionTrialPeriod = () => {
}
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`No payment method found. Please update your billing details.`,
});
};
@@ -80,7 +80,7 @@ export const useEndSubscriptionTrialPeriod = () => {
if (options?.skipPaymentMethodRedirect === true) {
enqueueToast({
- variant: 'info',
+ status: 'info',
children: t`Activating subscription...`,
});
}
@@ -154,14 +154,14 @@ export const useEndSubscriptionTrialPeriod = () => {
);
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Subscription activated.`,
});
return { success: true, hasPaymentMethod: true };
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Error while ending trial period. Please contact Twenty team.`,
});
return { success: false };
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useHandleCheckoutSession.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useHandleCheckoutSession.ts
index a5275558828..261a1cf1733 100644
--- a/packages/twenty-front/src/modules/settings/billing/hooks/useHandleCheckoutSession.ts
+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useHandleCheckoutSession.ts
@@ -44,7 +44,7 @@ export const useHandleCheckoutSession = ({
});
if (!data?.checkoutSession.url) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Checkout session error. Please retry or contact Twenty team`,
});
return;
@@ -59,7 +59,7 @@ export const useHandleCheckoutSession = ({
enqueueToast(
toastOptions ?? {
- variant: 'error',
+ status: 'error',
children: t`Checkout session error. Please retry or contact Twenty team`,
},
);
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useSubmitSubscriptionPayment.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useSubmitSubscriptionPayment.ts
index 83b370ce2ba..2dc96296b3e 100644
--- a/packages/twenty-front/src/modules/settings/billing/hooks/useSubmitSubscriptionPayment.ts
+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useSubmitSubscriptionPayment.ts
@@ -44,7 +44,7 @@ export const useSubmitSubscriptionPayment = ({
const { error: submitError } = await elements.submit();
if (isDefined(submitError)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
submitError.message ??
t`Your payment details are incomplete. Please review and retry.`,
@@ -61,7 +61,7 @@ export const useSubmitSubscriptionPayment = ({
const paymentIntent = data?.createSubscriptionPaymentIntent;
if (!isDefined(paymentIntent?.clientSecret)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Subscription error. Please retry or contact Twenty team`,
});
setIsSubmitting(false);
@@ -88,7 +88,7 @@ export const useSubmitSubscriptionPayment = ({
if (isDefined(error)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error.message ??
t`We couldn't confirm your payment method. Please retry.`,
@@ -100,7 +100,7 @@ export const useSubmitSubscriptionPayment = ({
enqueueToast(getToastOptionsFromError({ error }));
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Subscription error. Please retry or contact Twenty team`,
});
}
diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useWaitForPaymentRecovery.tsx b/packages/twenty-front/src/modules/settings/billing/hooks/useWaitForPaymentRecovery.tsx
index 731a4eaf25a..cca1ce4eecf 100644
--- a/packages/twenty-front/src/modules/settings/billing/hooks/useWaitForPaymentRecovery.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useWaitForPaymentRecovery.tsx
@@ -46,7 +46,7 @@ export const useWaitForPaymentRecovery = () => {
if (recovery.outcome !== 'recovered') {
enqueueToast({
- variant: 'warning',
+ status: 'warning',
children: t`Your card was saved, but the payment still needs attention.`,
action: (
<NavigationButton
@@ -79,7 +79,7 @@ export const useWaitForPaymentRecovery = () => {
// The payment method webhook can still be in flight
markBillingPaymentMethodAsAdded();
- enqueueToast({ variant: 'success', children: t`Payment successful.` });
+ enqueueToast({ status: 'success', children: t`Payment successful.` });
};
return { waitForPaymentRecovery };
diff --git a/packages/twenty-front/src/modules/settings/config-variables/components/ConfigVariableEdit.tsx b/packages/twenty-front/src/modules/settings/config-variables/components/ConfigVariableEdit.tsx
index 2dc7ec44a3b..b1fa72e91d0 100644
--- a/packages/twenty-front/src/modules/settings/config-variables/components/ConfigVariableEdit.tsx
+++ b/packages/twenty-front/src/modules/settings/config-variables/components/ConfigVariableEdit.tsx
@@ -71,11 +71,11 @@ export const ConfigVariableEdit = ({
setIsSubmitting(true);
await onSave?.();
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Variable ${title} updated`,
});
} catch {
- enqueueToast({ variant: 'error', children: t`Error updating variable` });
+ enqueueToast({ status: 'error', children: t`Error updating variable` });
} finally {
setIsSubmitting(false);
setIsEditing(false);
@@ -87,11 +87,11 @@ export const ConfigVariableEdit = ({
setIsSubmitting(true);
await onConfirmReset?.();
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Variable ${title} reset`,
});
} catch {
- enqueueToast({ variant: 'error', children: t`Error resetting variable` });
+ enqueueToast({ status: 'error', children: t`Error resetting variable` });
} finally {
setIsSubmitting(false);
setIsEditing(false);
diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/ObjectSettings.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/ObjectSettings.tsx
index fa96a3d11bf..c79e71ccdef 100644
--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/ObjectSettings.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/ObjectSettings.tsx
@@ -130,7 +130,7 @@ export const ObjectSettings = ({
const result = await deleteOneObjectMetadataItem(objectMetadataItem.id);
if (result.status === 'successful') {
- enqueueToast({ variant: 'success', children: t`Object deleted` });
+ enqueueToast({ status: 'success', children: t`Object deleted` });
closeDialog(DELETE_OBJECT_MODAL_ID);
navigate(SettingsPath.Objects);
return;
diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectIndexesSection.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectIndexesSection.tsx
index 53d32b4971e..4828779f7c4 100644
--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectIndexesSection.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectIndexesSection.tsx
@@ -155,7 +155,7 @@ export const SettingsObjectIndexesSection = ({
closeDialog(DELETE_INDEX_MODAL_ID);
if (result.status === 'successful') {
- enqueueToast({ variant: 'success', children: t`Index deleted` });
+ enqueueToast({ status: 'success', children: t`Index deleted` });
setPendingDelete(null);
}
};
diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx
index c2cf0cab31a..228b0149d20 100644
--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx
@@ -173,7 +173,7 @@ export const SettingsObjectSearchSection = ({
if (result.status === 'successful') {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: value
? t`Field added to search`
: t`Field removed from search`,
diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectValidationRulesSection.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectValidationRulesSection.tsx
index 08b59df4238..cf3c5a49aa8 100644
--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectValidationRulesSection.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectValidationRulesSection.tsx
@@ -109,7 +109,7 @@ export const SettingsObjectValidationRulesSection = ({
}
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
getValidationRuleSaveErrorMessage(error) ??
t`Failed to create the rule.`,
diff --git a/packages/twenty-front/src/modules/settings/developers/hooks/__tests__/useWebhookForm.test.tsx b/packages/twenty-front/src/modules/settings/developers/hooks/__tests__/useWebhookForm.test.tsx
index b9057886101..6f1c876bd0f 100644
--- a/packages/twenty-front/src/modules/settings/developers/hooks/__tests__/useWebhookForm.test.tsx
+++ b/packages/twenty-front/src/modules/settings/developers/hooks/__tests__/useWebhookForm.test.tsx
@@ -172,7 +172,7 @@ describe('useWebhookForm', () => {
});
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'success',
+ status: 'success',
children: 'Webhook https://test.com/webhook created successfully',
});
});
@@ -218,7 +218,7 @@ describe('useWebhookForm', () => {
});
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'An error occurred.',
});
});
@@ -256,7 +256,7 @@ describe('useWebhookForm', () => {
});
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'success',
+ status: 'success',
children: 'Webhook https://test.com/webhook created successfully',
});
});
@@ -315,7 +315,7 @@ describe('useWebhookForm', () => {
});
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'success',
+ status: 'success',
children: 'Webhook https://updated.com/webhook updated successfully',
});
});
@@ -369,7 +369,7 @@ describe('useWebhookForm', () => {
});
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'An error occurred.',
});
});
@@ -444,7 +444,7 @@ describe('useWebhookForm', () => {
});
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'success',
+ status: 'success',
children: 'Webhook deleted successfully',
});
});
@@ -460,7 +460,7 @@ describe('useWebhookForm', () => {
});
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'Webhook ID is required for deletion',
});
});
@@ -498,7 +498,7 @@ describe('useWebhookForm', () => {
});
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'An error occurred.',
});
});
diff --git a/packages/twenty-front/src/modules/settings/developers/hooks/useWebhookForm.ts b/packages/twenty-front/src/modules/settings/developers/hooks/useWebhookForm.ts
index 42936b8c4a5..c2fac3d3862 100644
--- a/packages/twenty-front/src/modules/settings/developers/hooks/useWebhookForm.ts
+++ b/packages/twenty-front/src/modules/settings/developers/hooks/useWebhookForm.ts
@@ -101,7 +101,7 @@ export const useWebhookForm = ({ webhookId, mode }: UseWebhookFormProps) => {
: '';
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Webhook ${targetUrl} created successfully`,
});
@@ -122,7 +122,7 @@ export const useWebhookForm = ({ webhookId, mode }: UseWebhookFormProps) => {
const handleUpdate = async (formValues: WebhookFormValues) => {
if (!webhookId) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Webhook ID is required for updates`,
});
return;
@@ -142,7 +142,7 @@ export const useWebhookForm = ({ webhookId, mode }: UseWebhookFormProps) => {
: '';
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Webhook ${targetUrl} updated successfully`,
});
} catch (error) {
@@ -186,7 +186,7 @@ export const useWebhookForm = ({ webhookId, mode }: UseWebhookFormProps) => {
const handleDelete = async () => {
if (!webhookId) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Webhook ID is required for deletion`,
});
return;
@@ -197,7 +197,7 @@ export const useWebhookForm = ({ webhookId, mode }: UseWebhookFormProps) => {
variables: { id: webhookId },
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Webhook deleted successfully`,
});
diff --git a/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomain.tsx b/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomain.tsx
index 7327b00f683..a7b26a0836c 100644
--- a/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomain.tsx
+++ b/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomain.tsx
@@ -125,7 +125,7 @@ export const SettingPublicDomain = () => {
variables: { domain: selectedPublicDomain.domain },
onCompleted: async () => {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Custom domain successfully deleted`,
});
await refetchPublicDomains();
@@ -158,7 +158,7 @@ export const SettingPublicDomain = () => {
},
onCompleted: async () => {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Custom domain successfully created`,
});
await refetchPublicDomains();
diff --git a/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomainRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomainRowDropdownMenu.tsx
index 672037d9b1e..0d03d5dfe9b 100644
--- a/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomainRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomainRowDropdownMenu.tsx
@@ -38,7 +38,7 @@ export const SettingPublicDomainRowDropdownMenu = ({
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Custom domain successfully deleted`,
});
diff --git a/packages/twenty-front/src/modules/settings/domains/hooks/useSettingsCustomDomain.ts b/packages/twenty-front/src/modules/settings/domains/hooks/useSettingsCustomDomain.ts
index 35ebef52324..c21b2ded7e6 100644
--- a/packages/twenty-front/src/modules/settings/domains/hooks/useSettingsCustomDomain.ts
+++ b/packages/twenty-front/src/modules/settings/domains/hooks/useSettingsCustomDomain.ts
@@ -65,7 +65,7 @@ export const useSettingsCustomDomain = () => {
customDomain: domainValue,
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Custom domain updated`,
});
setIsSubmitting(false);
diff --git a/packages/twenty-front/src/modules/settings/domains/hooks/useSettingsSubdomain.ts b/packages/twenty-front/src/modules/settings/domains/hooks/useSettingsSubdomain.ts
index 26cb2a4d90f..082960f04ed 100644
--- a/packages/twenty-front/src/modules/settings/domains/hooks/useSettingsSubdomain.ts
+++ b/packages/twenty-front/src/modules/settings/domains/hooks/useSettingsSubdomain.ts
@@ -81,7 +81,7 @@ export const useSettingsSubdomain = () => {
).hostname.replace(currentWorkspace.subdomain, subdomain);
setCurrentWorkspace({ ...currentWorkspace, subdomain });
- enqueueToast({ variant: 'success', children: t`Subdomain updated` });
+ enqueueToast({ status: 'success', children: t`Subdomain updated` });
setIsSubmitting(false);
await redirectToWorkspaceDomain(currentUrl.toString());
diff --git a/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainVerifyButton.tsx b/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainVerifyButton.tsx
index 1c4a9d864aa..1b78ef39daf 100644
--- a/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainVerifyButton.tsx
+++ b/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainVerifyButton.tsx
@@ -24,7 +24,7 @@ export const SettingsEmailingDomainVerifyButton = ({
try {
await verifyEmailingDomain({ variables: { id: emailingDomainId } });
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Started verification process`,
});
} catch (error) {
diff --git a/packages/twenty-front/src/modules/settings/enterprise/components/EnterprisePlanModal.tsx b/packages/twenty-front/src/modules/settings/enterprise/components/EnterprisePlanModal.tsx
index 6138791a6d1..c8bc927e0c4 100644
--- a/packages/twenty-front/src/modules/settings/enterprise/components/EnterprisePlanModal.tsx
+++ b/packages/twenty-front/src/modules/settings/enterprise/components/EnterprisePlanModal.tsx
@@ -136,13 +136,13 @@ export const EnterprisePlanModal = () => {
closeDialog(ENTERPRISE_PLAN_MODAL_ID);
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Could not open Stripe. Please contact support.`,
});
}
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: CombinedGraphQLErrors.is(error)
? getErrorMessageFromApolloError(error)
: t`Error opening Stripe`,
diff --git a/packages/twenty-front/src/modules/settings/legal/components/SettingsDpaAgreementsTable.tsx b/packages/twenty-front/src/modules/settings/legal/components/SettingsDpaAgreementsTable.tsx
index 15735c1d428..8e6606ebf7a 100644
--- a/packages/twenty-front/src/modules/settings/legal/components/SettingsDpaAgreementsTable.tsx
+++ b/packages/twenty-front/src/modules/settings/legal/components/SettingsDpaAgreementsTable.tsx
@@ -40,7 +40,7 @@ export const SettingsDpaAgreementsTable = ({
);
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Could not download the document.`,
});
}
diff --git a/packages/twenty-front/src/modules/settings/mcp-and-apis/hooks/useOpenPlayground.ts b/packages/twenty-front/src/modules/settings/mcp-and-apis/hooks/useOpenPlayground.ts
index 86ca8c25833..9e713dc3aeb 100644
--- a/packages/twenty-front/src/modules/settings/mcp-and-apis/hooks/useOpenPlayground.ts
+++ b/packages/twenty-front/src/modules/settings/mcp-and-apis/hooks/useOpenPlayground.ts
@@ -29,7 +29,7 @@ export const useOpenPlayground = () => {
{
onError: () => {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Could not open the API playground`,
});
},
diff --git a/packages/twenty-front/src/modules/settings/members/components/MemberPermissionsTab.tsx b/packages/twenty-front/src/modules/settings/members/components/MemberPermissionsTab.tsx
index 0a2ab6eff1e..ef9b3675af9 100644
--- a/packages/twenty-front/src/modules/settings/members/components/MemberPermissionsTab.tsx
+++ b/packages/twenty-front/src/modules/settings/members/components/MemberPermissionsTab.tsx
@@ -92,12 +92,12 @@ export const MemberPermissionsTab = ({
refetchQueries: ['GetRoles'],
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Role updated successfully`,
});
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error ? error.message : t`Failed to update role`,
});
diff --git a/packages/twenty-front/src/modules/settings/members/components/MemberTwoFactorAuthenticationRecoverySection.tsx b/packages/twenty-front/src/modules/settings/members/components/MemberTwoFactorAuthenticationRecoverySection.tsx
index 9be2b2d88da..568539c7e42 100644
--- a/packages/twenty-front/src/modules/settings/members/components/MemberTwoFactorAuthenticationRecoverySection.tsx
+++ b/packages/twenty-front/src/modules/settings/members/components/MemberTwoFactorAuthenticationRecoverySection.tsx
@@ -103,7 +103,7 @@ export const MemberTwoFactorAuthenticationRecoverySection = ({
clearGeneratedRecoveryCode();
await refetch();
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Recovery code revoked.`,
});
} catch (error) {
diff --git a/packages/twenty-front/src/modules/settings/members/components/__tests__/MemberTwoFactorAuthenticationRecoverySection.test.tsx b/packages/twenty-front/src/modules/settings/members/components/__tests__/MemberTwoFactorAuthenticationRecoverySection.test.tsx
index c55da4bf9c2..05406d4a5a9 100644
--- a/packages/twenty-front/src/modules/settings/members/components/__tests__/MemberTwoFactorAuthenticationRecoverySection.test.tsx
+++ b/packages/twenty-front/src/modules/settings/members/components/__tests__/MemberTwoFactorAuthenticationRecoverySection.test.tsx
@@ -137,6 +137,6 @@ it('shows a pending code and revokes it', async () => {
);
expect(revoke).toHaveBeenCalledTimes(1);
expect(enqueueToast).toHaveBeenCalledWith(
- expect.objectContaining({ variant: 'success' }),
+ expect.objectContaining({ status: 'success' }),
);
});
diff --git a/packages/twenty-front/src/modules/settings/profile/components/DeleteAccount.tsx b/packages/twenty-front/src/modules/settings/profile/components/DeleteAccount.tsx
index 5c8127ee7df..557ed23589f 100644
--- a/packages/twenty-front/src/modules/settings/profile/components/DeleteAccount.tsx
+++ b/packages/twenty-front/src/modules/settings/profile/components/DeleteAccount.tsx
@@ -54,7 +54,7 @@ export const DeleteAccount = () => {
const leaveWorkspace = async () => {
if (!isDefined(currentWorkspaceMemberId)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Current workspace member not found.`,
});
return;
diff --git a/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx
index 138489aff0f..2fd4f381d1d 100644
--- a/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx
@@ -28,10 +28,10 @@ export const SettingsDeviceSessionRowDropdownMenu = ({
const handleRevokeSession = async () => {
try {
await revokeUserSession({ variables: { userSessionId } });
- enqueueToast({ variant: 'success', children: t`Device logged out` });
+ enqueueToast({ status: 'success', children: t`Device logged out` });
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to log out this device`,
});
}
diff --git a/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsProfileDevicesSection.tsx b/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsProfileDevicesSection.tsx
index 703184e525d..d686ae93e08 100644
--- a/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsProfileDevicesSection.tsx
+++ b/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsProfileDevicesSection.tsx
@@ -58,13 +58,13 @@ export const SettingsProfileDevicesSection = () => {
try {
await revokeAllOtherUserSessions();
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Logged out all other devices`,
});
await refetch();
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to log out other devices`,
});
}
diff --git a/packages/twenty-front/src/modules/settings/profile/hooks/useUpdateEmail.ts b/packages/twenty-front/src/modules/settings/profile/hooks/useUpdateEmail.ts
index 7c7c8ce8a8c..466bebac2c0 100644
--- a/packages/twenty-front/src/modules/settings/profile/hooks/useUpdateEmail.ts
+++ b/packages/twenty-front/src/modules/settings/profile/hooks/useUpdateEmail.ts
@@ -29,7 +29,7 @@ export const useUpdateEmail = () => {
});
enqueueToast({
- variant: 'info',
+ status: 'info',
children: t`Check your inbox to verify your new email address.`,
});
} catch (error) {
diff --git a/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx b/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx
index 2a4d7d7d0ce..cd6ec9094fc 100644
--- a/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role/components/SettingsRole.tsx
@@ -116,7 +116,7 @@ export const SettingsRole = ({ roleId, isCreateMode }: SettingsRoleProps) => {
const handleSave = async () => {
if (isDefined(dirtyFields.label) && dirtyFields.label === '') {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Role name cannot be empty`,
});
return;
diff --git a/packages/twenty-front/src/modules/settings/roles/role/components/__tests__/SettingsRole.test.tsx b/packages/twenty-front/src/modules/settings/roles/role/components/__tests__/SettingsRole.test.tsx
index 68cae973c62..a209a34f700 100644
--- a/packages/twenty-front/src/modules/settings/roles/role/components/__tests__/SettingsRole.test.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role/components/__tests__/SettingsRole.test.tsx
@@ -212,7 +212,7 @@ describe('SettingsRole', () => {
expect(mockEnqueueToast).toHaveBeenCalledWith(
expect.objectContaining({
- variant: 'error',
+ status: 'error',
children: 'Role name cannot be empty',
}),
);
@@ -265,7 +265,7 @@ describe('SettingsRole', () => {
expect(mockEnqueueToast).toHaveBeenCalledTimes(1);
});
expect(mockEnqueueToast).toHaveBeenCalledWith(
- expect.objectContaining({ variant: 'error' }),
+ expect.objectContaining({ status: 'error' }),
);
expect(mockLoadCurrentUser).not.toHaveBeenCalled();
expect(saveButton).not.toHaveAttribute('aria-busy', 'true');
diff --git a/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityAuthProvidersOptionsList.tsx b/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityAuthProvidersOptionsList.tsx
index db68e819b18..7866c777e35 100644
--- a/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityAuthProvidersOptionsList.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityAuthProvidersOptionsList.tsx
@@ -88,7 +88,7 @@ export const SettingsSecurityAuthProvidersOptionsList = () => {
1
) {
return enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`At least one authentication method must be enabled`,
});
}
diff --git a/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityEditableProfileFields.tsx b/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityEditableProfileFields.tsx
index 1d19e0e638e..d141c475445 100644
--- a/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityEditableProfileFields.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityEditableProfileFields.tsx
@@ -80,7 +80,7 @@ export const SettingsSecurityEditableProfileFields = () => {
const toggleField = (field: string) => {
if (!currentWorkspace?.id) {
- enqueueToast({ variant: 'error', children: t`User is not logged in` });
+ enqueueToast({ status: 'error', children: t`User is not logged in` });
return;
}
diff --git a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx
index 804a8552bcf..bcece13730f 100644
--- a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx
@@ -47,7 +47,7 @@ export const SettingsSecurityApprovedAccessDomainRowDropdownMenu = ({
});
if (isDefined(result.error)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Could not delete approved access domain`,
duration: 2000,
});
diff --git a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainValidationEffect.tsx b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainValidationEffect.tsx
index 07a0ae4ee0d..89239cab136 100644
--- a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainValidationEffect.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainValidationEffect.tsx
@@ -38,14 +38,14 @@ export const SettingsSecurityApprovedAccessDomainValidationEffect = () => {
})),
);
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Approved access domain validated`,
dedupeKey: 'approved-access-domain-validation-dedupe-key',
});
},
onError: (error) => {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: error?.message
? error.message
: t`Error validating approved access domain`,
diff --git a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSecuritySsoRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSecuritySsoRowDropdownMenu.tsx
index e7554cfebff..3c980e03d4b 100644
--- a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSecuritySsoRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSecuritySsoRowDropdownMenu.tsx
@@ -34,7 +34,7 @@ export const SettingsSecuritySsoRowDropdownMenu = ({
});
if (isDefined(result.error)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Error deleting SSO Identity Provider`,
duration: 2000,
});
@@ -53,7 +53,7 @@ export const SettingsSecuritySsoRowDropdownMenu = ({
});
if (isDefined(result.error)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Error editing SSO Identity Provider`,
duration: 2000,
});
diff --git a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoSamlForm.tsx b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoSamlForm.tsx
index 58cfc88ea9e..cf9d961ee55 100644
--- a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoSamlForm.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoSamlForm.tsx
@@ -64,7 +64,7 @@ export const SettingsSsoSamlForm = () => {
e.target.value = '';
if (!samlMetadataParsed.success) {
return enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Invalid file: ${samlMetadataParsed.reason}`,
duration: 5000,
});
@@ -101,7 +101,7 @@ export const SettingsSsoSamlForm = () => {
);
if (!response.ok) {
return enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Metadata file generation failed`,
duration: 2000,
});
diff --git a/packages/twenty-front/src/modules/settings/two-factor-authentication/components/DeleteTwoFactorAuthenticationMethod.tsx b/packages/twenty-front/src/modules/settings/two-factor-authentication/components/DeleteTwoFactorAuthenticationMethod.tsx
index 8b6b8d178ad..248c31739d4 100644
--- a/packages/twenty-front/src/modules/settings/two-factor-authentication/components/DeleteTwoFactorAuthenticationMethod.tsx
+++ b/packages/twenty-front/src/modules/settings/two-factor-authentication/components/DeleteTwoFactorAuthenticationMethod.tsx
@@ -51,7 +51,7 @@ export const DeleteTwoFactorAuthentication = () => {
)
) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Invalid 2FA information.`,
dedupeKey: '2fa-dedupe-key',
});
@@ -68,7 +68,7 @@ export const DeleteTwoFactorAuthentication = () => {
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`2FA Method has been deleted successfully.`,
dedupeKey: '2fa-dedupe-key',
});
diff --git a/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useTwoFactorVerificationForSettings.ts b/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useTwoFactorVerificationForSettings.ts
index 4126687c44e..dc851a3a0a3 100644
--- a/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useTwoFactorVerificationForSettings.ts
+++ b/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useTwoFactorVerificationForSettings.ts
@@ -34,7 +34,7 @@ export const useTwoFactorVerificationForSettings = () => {
const handleVerificationSuccess = async () => {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Two-factor authentication setup completed successfully!`,
});
diff --git a/packages/twenty-front/src/modules/settings/workspace-member/components/WorkspaceMemberPictureUploader.tsx b/packages/twenty-front/src/modules/settings/workspace-member/components/WorkspaceMemberPictureUploader.tsx
index 911455911e5..725706b9809 100644
--- a/packages/twenty-front/src/modules/settings/workspace-member/components/WorkspaceMemberPictureUploader.tsx
+++ b/packages/twenty-front/src/modules/settings/workspace-member/components/WorkspaceMemberPictureUploader.tsx
@@ -93,7 +93,7 @@ export const WorkspaceMemberPictureUploader = ({
const message =
error instanceof Error ? error.message : t`Failed to upload picture`;
setErrorMessage(t`An error occurred while uploading the picture.`);
- enqueueToast({ variant: 'error', children: message });
+ enqueueToast({ status: 'error', children: message });
} finally {
setIsUploading(false);
}
@@ -122,7 +122,7 @@ export const WorkspaceMemberPictureUploader = ({
const message =
error instanceof Error ? error.message : t`Failed to remove picture`;
setErrorMessage(t`An error occurred while removing the picture.`);
- enqueueToast({ variant: 'error', children: message });
+ enqueueToast({ status: 'error', children: message });
} finally {
setIsRemoving(false);
}
diff --git a/packages/twenty-front/src/modules/settings/workspace/components/WorkspaceLogoUploader.tsx b/packages/twenty-front/src/modules/settings/workspace/components/WorkspaceLogoUploader.tsx
index baf72182294..b687b509ff7 100644
--- a/packages/twenty-front/src/modules/settings/workspace/components/WorkspaceLogoUploader.tsx
+++ b/packages/twenty-front/src/modules/settings/workspace/components/WorkspaceLogoUploader.tsx
@@ -44,7 +44,7 @@ export const WorkspaceLogoUploader = () => {
const message =
error instanceof Error ? error.message : t`Failed to upload picture`;
setErrorMessage(t`An error occurred while uploading the picture.`);
- enqueueToast({ variant: 'error', children: message });
+ enqueueToast({ status: 'error', children: message });
} finally {
setIsUploading(false);
}
@@ -76,7 +76,7 @@ export const WorkspaceLogoUploader = () => {
const message =
error instanceof Error ? error.message : t`Failed to remove picture`;
setErrorMessage(t`An error occurred while removing the picture.`);
- enqueueToast({ variant: 'error', children: message });
+ enqueueToast({ status: 'error', children: message });
} finally {
setIsRemoving(false);
}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/add-to-message-list/hooks/useAddPeopleToMessageList.ts b/packages/twenty-front/src/modules/side-panel/pages/add-to-message-list/hooks/useAddPeopleToMessageList.ts
index d58d7c89e6a..b106457860e 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/add-to-message-list/hooks/useAddPeopleToMessageList.ts
+++ b/packages/twenty-front/src/modules/side-panel/pages/add-to-message-list/hooks/useAddPeopleToMessageList.ts
@@ -32,14 +32,14 @@ export const useAddPeopleToMessageList = ({
(jobStatus: TrackedJobStatus) => {
if (jobStatus.state === JobState.FAILED) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to add people to the list. Please try again.`,
});
return;
}
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`People added to the list.`,
});
onCompleted();
@@ -68,7 +68,7 @@ export const useAddPeopleToMessageList = ({
}
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: CombinedGraphQLErrors.is(error)
? getErrorMessageFromApolloError(error)
: t`Failed to add people to the list. Please try again.`,
diff --git a/packages/twenty-front/src/modules/side-panel/pages/compose-calendar-event/components/SidePanelComposeCalendarEventPage.tsx b/packages/twenty-front/src/modules/side-panel/pages/compose-calendar-event/components/SidePanelComposeCalendarEventPage.tsx
index 0a7627e9ce2..14e85bb84f4 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/compose-calendar-event/components/SidePanelComposeCalendarEventPage.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/compose-calendar-event/components/SidePanelComposeCalendarEventPage.tsx
@@ -75,7 +75,7 @@ export const SidePanelComposeCalendarEventPage = () => {
});
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to reconnect calendar account`,
});
}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/record-creation-form/components/__tests__/SidePanelRecordCreationFormPage.test.tsx b/packages/twenty-front/src/modules/side-panel/pages/record-creation-form/components/__tests__/SidePanelRecordCreationFormPage.test.tsx
index 8fa19d16deb..15325e0e749 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/record-creation-form/components/__tests__/SidePanelRecordCreationFormPage.test.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/record-creation-form/components/__tests__/SidePanelRecordCreationFormPage.test.tsx
@@ -470,7 +470,7 @@ describe('SidePanelRecordCreationFormPage', () => {
expect(mockEnqueueToast).toHaveBeenCalledTimes(1);
expect(mockEnqueueToast).toHaveBeenCalledWith(
- expect.objectContaining({ variant: 'error', children: 'Network error' }),
+ expect.objectContaining({ status: 'error', children: 'Network error' }),
);
expect(screen.queryByRole('alert')).not.toBeInTheDocument();
});
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/SpreadsheetImportStepper.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/SpreadsheetImportStepper.tsx
index bac63591f1e..ddc67e10b4f 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/SpreadsheetImportStepper.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/SpreadsheetImportStepper.tsx
@@ -38,7 +38,7 @@ export const SpreadsheetImportStepper = ({
const handleError = useCallback(
(description: string) => {
- enqueueToast({ variant: 'error', children: description });
+ enqueueToast({ status: 'error', children: description });
},
[enqueueToast],
);
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/UploadStep/components/DropZone.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/UploadStep/components/DropZone.tsx
index 238d0419850..d5844f454b6 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/UploadStep/components/DropZone.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/UploadStep/components/DropZone.tsx
@@ -137,7 +137,7 @@ export const DropZone = ({ onContinue, isLoading }: DropZoneProps) => {
fileRejections.forEach((fileRejection) => {
const fileName = fileRejection.file.name;
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`${fileName} upload rejected`,
description: fileRejection.errors[0].message,
});
diff --git a/packages/twenty-front/src/modules/ui/feedback/toast/components/__tests__/AppToaster.test.tsx b/packages/twenty-front/src/modules/ui/feedback/toast/components/__tests__/AppToaster.test.tsx
index 99d8b91f258..45dba04b445 100644
--- a/packages/twenty-front/src/modules/ui/feedback/toast/components/__tests__/AppToaster.test.tsx
+++ b/packages/twenty-front/src/modules/ui/feedback/toast/components/__tests__/AppToaster.test.tsx
@@ -36,7 +36,7 @@ describe('AppToaster', () => {
act(() => {
result.current.enqueueToast({
- variant: 'success',
+ status: 'success',
children: 'Record saved',
description: 'Your changes are available',
action: (
@@ -127,7 +127,7 @@ describe('AppToaster', () => {
act(() => {
result.current.enqueueToast({
- variant: 'success',
+ status: 'success',
children: 'Record saved',
onClose,
onCancel,
diff --git a/packages/twenty-front/src/modules/ui/feedback/toast/utils/__tests__/getLocalizedToastProps.test.tsx b/packages/twenty-front/src/modules/ui/feedback/toast/utils/__tests__/getLocalizedToastProps.test.tsx
new file mode 100644
index 00000000000..78574cf4da2
--- /dev/null
+++ b/packages/twenty-front/src/modules/ui/feedback/toast/utils/__tests__/getLocalizedToastProps.test.tsx
@@ -0,0 +1,46 @@
+import { setupI18n } from '@lingui/core';
+
+import { getLocalizedToastProps } from '@/ui/feedback/toast/utils/getLocalizedToastProps';
+
+const i18n = setupI18n({ locale: 'en', messages: { en: {} } });
+
+describe('getLocalizedToastProps', () => {
+ it('uses the neutral accessible name when the status is omitted', () => {
+ expect(getLocalizedToastProps({ toast: {}, i18n })).toEqual({
+ iconLabel: 'Alert',
+ title: 'Alert',
+ cancelLabel: 'Cancel',
+ closeLabel: 'Close',
+ });
+ });
+
+ it('preserves caller-owned labels and rich cancel content', () => {
+ const cancelLabel = <strong>Stop import</strong>;
+
+ expect(
+ getLocalizedToastProps({
+ toast: {
+ status: 'success',
+ children: <strong>Import complete</strong>,
+ iconLabel: 'Completed import',
+ title: 'Import details',
+ cancelLabel,
+ closeLabel: 'Dismiss import',
+ },
+ i18n,
+ }),
+ ).toEqual({
+ iconLabel: 'Completed import',
+ title: 'Import details',
+ cancelLabel,
+ closeLabel: 'Dismiss import',
+ });
+ });
+
+ it('preserves an explicitly cleared cancel label', () => {
+ expect(
+ getLocalizedToastProps({ toast: { cancelLabel: null }, i18n })
+ .cancelLabel,
+ ).toBeNull();
+ });
+});
diff --git a/packages/twenty-front/src/modules/ui/feedback/toast/utils/getLocalizedToastProps.ts b/packages/twenty-front/src/modules/ui/feedback/toast/utils/getLocalizedToastProps.ts
index addfa6ea860..fd85fc4d659 100644
--- a/packages/twenty-front/src/modules/ui/feedback/toast/utils/getLocalizedToastProps.ts
+++ b/packages/twenty-front/src/modules/ui/feedback/toast/utils/getLocalizedToastProps.ts
@@ -1,16 +1,16 @@
import { type I18n } from '@lingui/core';
import { msg } from '@lingui/core/macro';
-import { isString } from '@sniptt/guards';
+import { isString, isUndefined } from '@sniptt/guards';
import {
type ToastProps,
- type ToastVariant,
+ type ToastStatus,
} from 'twenty-ui/components/feedback';
-const DEFAULT_ARIA_LABEL_BY_VARIANT: Record<
- ToastVariant,
+const DEFAULT_ARIA_LABEL_BY_STATUS: Record<
+ ToastStatus,
ReturnType<typeof msg>
> = {
- default: msg`Alert`,
+ neutral: msg`Alert`,
error: msg`Error`,
info: msg`Info`,
success: msg`Success`,
@@ -26,13 +26,15 @@ export const getLocalizedToastProps = ({
}) => {
const iconLabel =
toast.iconLabel ??
- i18n._(DEFAULT_ARIA_LABEL_BY_VARIANT[toast.variant ?? 'default']);
+ i18n._(DEFAULT_ARIA_LABEL_BY_STATUS[toast.status ?? 'neutral']);
return {
iconLabel,
title:
toast.title ?? (isString(toast.children) ? toast.children : iconLabel),
- cancelLabel: toast.cancelLabel ?? i18n._(msg`Cancel`),
+ cancelLabel: isUndefined(toast.cancelLabel)
+ ? i18n._(msg`Cancel`)
+ : toast.cancelLabel,
closeLabel: toast.closeLabel ?? i18n._(msg`Close`),
};
};
diff --git a/packages/twenty-front/src/modules/validation-rules/components/SettingsValidationRuleEditForm.tsx b/packages/twenty-front/src/modules/validation-rules/components/SettingsValidationRuleEditForm.tsx
index 811af92b50c..04614f59772 100644
--- a/packages/twenty-front/src/modules/validation-rules/components/SettingsValidationRuleEditForm.tsx
+++ b/packages/twenty-front/src/modules/validation-rules/components/SettingsValidationRuleEditForm.tsx
@@ -97,7 +97,7 @@ export const SettingsValidationRuleEditForm = ({
},
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: validationRule.isActive
? t`Rule updated.`
: t`Rule activated.`,
@@ -105,7 +105,7 @@ export const SettingsValidationRuleEditForm = ({
navigateToObjectValidationRules();
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
getValidationRuleSaveErrorMessage(error) ??
t`Failed to update the rule.`,
@@ -121,13 +121,13 @@ export const SettingsValidationRuleEditForm = ({
variables: { input: { id: validationRule.id, update: { isActive } } },
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: isActive ? t`Rule enabled.` : t`Rule disabled.`,
});
navigateToObjectValidationRules();
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
getValidationRuleSaveErrorMessage(error) ??
t`Failed to update the rule.`,
@@ -138,11 +138,11 @@ export const SettingsValidationRuleEditForm = ({
const handleDelete = async () => {
try {
await deleteValidationRule({ variables: { id: validationRule.id } });
- enqueueToast({ variant: 'success', children: t`Rule deleted.` });
+ enqueueToast({ status: 'success', children: t`Rule deleted.` });
navigateToObjectValidationRules();
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to delete the rule.`,
});
} finally {
diff --git a/packages/twenty-front/src/modules/views/hooks/internal/usePerformViewApiUpdate.ts b/packages/twenty-front/src/modules/views/hooks/internal/usePerformViewApiUpdate.ts
index 0e1d6480717..d534d1b8392 100644
--- a/packages/twenty-front/src/modules/views/hooks/internal/usePerformViewApiUpdate.ts
+++ b/packages/twenty-front/src/modules/views/hooks/internal/usePerformViewApiUpdate.ts
@@ -113,7 +113,7 @@ export const usePerformViewApiUpdate = () => {
operationType: CrudOperationType.UPDATE,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
return {
diff --git a/packages/twenty-front/src/modules/views/hooks/internal/usePerformViewEntityApiPersistOperation.ts b/packages/twenty-front/src/modules/views/hooks/internal/usePerformViewEntityApiPersistOperation.ts
index 07380df1b0a..059935c25dd 100644
--- a/packages/twenty-front/src/modules/views/hooks/internal/usePerformViewEntityApiPersistOperation.ts
+++ b/packages/twenty-front/src/modules/views/hooks/internal/usePerformViewEntityApiPersistOperation.ts
@@ -51,7 +51,7 @@ export const usePerformViewEntityApiPersistOperation = (
operationType,
});
} else {
- enqueueToast({ variant: 'error', children: t`An error occurred.` });
+ enqueueToast({ status: 'error', children: t`An error occurred.` });
}
},
[handleMetadataError, enqueueToast, metadataName],
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/__tests__/useUpdateWorkflowVersionStep.test.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/__tests__/useUpdateWorkflowVersionStep.test.ts
index 2b77404cbdf..54c3aba0b16 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/__tests__/useUpdateWorkflowVersionStep.test.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/hooks/__tests__/useUpdateWorkflowVersionStep.test.ts
@@ -168,7 +168,7 @@ describe('useUpdateWorkflowVersionStep', () => {
);
expect(mockEnqueueToast).toHaveBeenCalledWith(
expect.objectContaining({
- variant: 'error',
+ status: 'error',
children: 'Core save failed',
}),
);
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/hooks/useWorkflowAiAgentPermissionActions.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/hooks/useWorkflowAiAgentPermissionActions.ts
index 7137c716862..a8a3dd767f2 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/hooks/useWorkflowAiAgentPermissionActions.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/hooks/useWorkflowAiAgentPermissionActions.ts
@@ -295,7 +295,7 @@ export const useWorkflowAiAgentPermissionActions = ({
if (isDefined(permissionLabel)) {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`${permissionLabel} Permission removed`,
});
}
@@ -355,7 +355,7 @@ export const useWorkflowAiAgentPermissionActions = ({
if (isDefined(permissionLabel)) {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`${permissionLabel} permission removed`,
});
}
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useUploadWorkflowFile.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useUploadWorkflowFile.ts
index 7344f0f8aa1..3ed47812364 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useUploadWorkflowFile.ts
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/hooks/useUploadWorkflowFile.ts
@@ -20,7 +20,7 @@ export const useUploadWorkflowFile = () => {
const fileName = file.name;
const maxUploadSize = formatFileSize(MAX_ATTACHMENT_SIZE);
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`File "${fileName}" exceeds ${maxUploadSize}`,
});
return null;
@@ -39,7 +39,7 @@ export const useUploadWorkflowFile = () => {
const fileName = file.name;
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`File "${fileName}" uploaded successfully`,
});
@@ -49,7 +49,7 @@ export const useUploadWorkflowFile = () => {
const fileNameForError = file.name;
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to upload "${fileNameForError}"`,
});
diff --git a/packages/twenty-front/src/modules/workspace-member/hooks/__tests__/useColorScheme.test.tsx b/packages/twenty-front/src/modules/workspace-member/hooks/__tests__/useColorScheme.test.tsx
index 42dadf9f7ae..ab34189c0d5 100644
--- a/packages/twenty-front/src/modules/workspace-member/hooks/__tests__/useColorScheme.test.tsx
+++ b/packages/twenty-front/src/modules/workspace-member/hooks/__tests__/useColorScheme.test.tsx
@@ -119,7 +119,7 @@ describe('useColorScheme', () => {
);
expect(store.get(persistedColorSchemeState.atom)).toBe('Light');
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'You do not have permission to update this workspace member.',
});
},
@@ -190,7 +190,7 @@ describe('useColorScheme', () => {
expect(result.current.colorScheme).toBe('System');
expect(mockEnqueueToast).toHaveBeenCalledWith({
- variant: 'error',
+ status: 'error',
children: 'An error occurred.',
});
});
diff --git a/packages/twenty-front/src/modules/workspace/components/WorkspaceInviteTeam.tsx b/packages/twenty-front/src/modules/workspace/components/WorkspaceInviteTeam.tsx
index 5ab9b3e8841..305e31c68f6 100644
--- a/packages/twenty-front/src/modules/workspace/components/WorkspaceInviteTeam.tsx
+++ b/packages/twenty-front/src/modules/workspace/components/WorkspaceInviteTeam.tsx
@@ -148,7 +148,7 @@ export const WorkspaceInviteTeam = ({ roles }: WorkspaceInviteTeamProps) => {
if (data.sendInvitations.result.length > 0) {
const invitationCount = data.sendInvitations.result.length;
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`${invitationCount} invitations sent`,
duration: 2000,
});
@@ -158,7 +158,7 @@ export const WorkspaceInviteTeam = ({ roles }: WorkspaceInviteTeamProps) => {
if (!data.sendInvitations.success) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: data.sendInvitations.errors.join(', '),
duration: 5000,
});
diff --git a/packages/twenty-front/src/pages/auth/PasswordReset.tsx b/packages/twenty-front/src/pages/auth/PasswordReset.tsx
index 07acb785df0..df8fe6b000e 100644
--- a/packages/twenty-front/src/pages/auth/PasswordReset.tsx
+++ b/packages/twenty-front/src/pages/auth/PasswordReset.tsx
@@ -157,7 +157,7 @@ export const PasswordReset = () => {
if (!data?.updatePasswordViaResetToken.success) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`There was an error while updating password.`,
});
return;
@@ -173,14 +173,14 @@ export const PasswordReset = () => {
);
if (isLogged) {
- enqueueToast({ variant: 'success', children: successMessage });
+ enqueueToast({ status: 'success', children: successMessage });
navigate(AppPath.Index);
return;
}
if (!isCaptchaReady) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Captcha (anti-bot check) is still loading, try again`,
});
return;
diff --git a/packages/twenty-front/src/pages/onboarding/PaymentSuccess.tsx b/packages/twenty-front/src/pages/onboarding/PaymentSuccess.tsx
index 1def38cd33f..b4446f889ec 100644
--- a/packages/twenty-front/src/pages/onboarding/PaymentSuccess.tsx
+++ b/packages/twenty-front/src/pages/onboarding/PaymentSuccess.tsx
@@ -60,7 +60,7 @@ export const PaymentSuccess = () => {
if (attempts >= SUBSCRIPTION_CONFIRMATION_MAX_ATTEMPTS) {
setHasTimedOut(true);
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`We're still waiting for a confirmation from our payment provider (Stripe). Please refresh in a few seconds.`,
});
return;
diff --git a/packages/twenty-front/src/pages/settings/accounts/SettingsAccountsConfiguration.tsx b/packages/twenty-front/src/pages/settings/accounts/SettingsAccountsConfiguration.tsx
index 60e6f59d2e8..1448bc69ba6 100644
--- a/packages/twenty-front/src/pages/settings/accounts/SettingsAccountsConfiguration.tsx
+++ b/packages/twenty-front/src/pages/settings/accounts/SettingsAccountsConfiguration.tsx
@@ -72,7 +72,7 @@ export const SettingsAccountsConfiguration = () => {
},
onCompleted: () => {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Account added successfully. Sync started.`,
});
navigate(getSettingsPath(SettingsPath.Accounts));
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminAiProviderDetail.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminAiProviderDetail.tsx
index e2bbe6a69c7..30efef08017 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminAiProviderDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminAiProviderDetail.tsx
@@ -103,13 +103,13 @@ export const SettingsAdminAiProviderDetail = () => {
],
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Provider "${provider?.label ?? providerName}" removed`,
});
navigate(AI_ADMIN_PATH);
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to remove provider`,
});
}
@@ -133,12 +133,12 @@ export const SettingsAdminAiProviderDetail = () => {
});
await refetchClientConfig();
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Model "${modelToRemove.label}" removed`,
});
setModelToRemove(null);
} catch {
- enqueueToast({ variant: 'error', children: t`Failed to remove model` });
+ enqueueToast({ status: 'error', children: t`Failed to remove model` });
}
};
@@ -187,7 +187,7 @@ export const SettingsAdminAiProviderDetail = () => {
await refetchClientConfig();
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to update model availability`,
});
}
@@ -382,7 +382,7 @@ export const SettingsAdminAiProviderDetail = () => {
});
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to update model availability`,
});
} finally {
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminApplicationRegistrationDangerZone.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminApplicationRegistrationDangerZone.tsx
index 2cfd6697b58..70ce608be41 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminApplicationRegistrationDangerZone.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminApplicationRegistrationDangerZone.tsx
@@ -130,11 +130,11 @@ export const SettingsAdminApplicationRegistrationDangerZone = ({
}
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`App deleted successfully`,
});
} catch {
- enqueueToast({ variant: 'error', children: t`Error deleting app` });
+ enqueueToast({ status: 'error', children: t`Error deleting app` });
} finally {
setIsLoading(false);
}
@@ -156,14 +156,14 @@ export const SettingsAdminApplicationRegistrationDangerZone = ({
},
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Ownership transferred successfully`,
});
setTransferSubdomain('');
navigate(SettingsPath.Applications);
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to transfer ownership. Check that the subdomain is correct.`,
});
} finally {
@@ -178,13 +178,13 @@ export const SettingsAdminApplicationRegistrationDangerZone = ({
variables: { applicationRegistrationId },
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Ownership claimed successfully`,
});
closeDialog(CLAIM_OWNERSHIP_MODAL_ID);
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to claim ownership.`,
});
} finally {
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInferredVersion.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInferredVersion.tsx
index 233d10eef2c..92519ad79e1 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInferredVersion.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInferredVersion.tsx
@@ -50,12 +50,12 @@ export const SettingsAdminInferredVersion = () => {
await refreshUpgradeStatus();
await refetch();
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Upgrade status refreshed`,
});
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error
? error.message
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInstanceStatus.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInstanceStatus.tsx
index f08240b18a7..6a9df7242fd 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInstanceStatus.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminInstanceStatus.tsx
@@ -80,12 +80,12 @@ export const SettingsAdminInstanceStatus = () => {
await refreshUpgradeStatus();
await refetch();
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Upgrade status refreshed`,
});
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error
? error.message
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminNewAiModel.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminNewAiModel.tsx
index 7d8be734fe6..d92673a9f05 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminNewAiModel.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminNewAiModel.tsx
@@ -304,12 +304,12 @@ export const SettingsAdminNewAiModel = () => {
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Model "${values.label.trim()}" added`,
});
navigate(providerDetailPath);
} catch {
- enqueueToast({ variant: 'error', children: t`Failed to add model` });
+ enqueueToast({ status: 'error', children: t`Failed to add model` });
} finally {
setIsSubmitting(false);
}
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminNewAiProvider.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminNewAiProvider.tsx
index 72d71953de0..33260b1be1a 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminNewAiProvider.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminNewAiProvider.tsx
@@ -249,12 +249,12 @@ export const SettingsAdminNewAiProvider = () => {
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Provider "${values.label.trim()}" added`,
});
navigate(AI_ADMIN_PATH);
} catch {
- enqueueToast({ variant: 'error', children: t`Failed to add provider` });
+ enqueueToast({ status: 'error', children: t`Failed to add provider` });
} finally {
setIsSubmitting(false);
}
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
index c51b711744e..0f076d679b6 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
@@ -170,7 +170,7 @@ export const SettingsAdminWorkspaceDetail = () => {
updateFeatureFlagState(workspaceId, featureFlag, previousValue);
}
enqueueToast({
- variant: 'error',
+ status: 'error',
children: `Failed to update feature flag. ${error.message}`,
});
},
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspacesStatus.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspacesStatus.tsx
index e02a022e5bf..63d7a68e744 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspacesStatus.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspacesStatus.tsx
@@ -56,12 +56,12 @@ export const SettingsAdminWorkspacesStatus = () => {
await refreshUpgradeStatus();
await refetch();
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Upgrade status refreshed`,
});
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error
? error.message
diff --git a/packages/twenty-front/src/pages/settings/ai/SettingsToolDetail.tsx b/packages/twenty-front/src/pages/settings/ai/SettingsToolDetail.tsx
index 62a209cf75b..f94b90c9072 100644
--- a/packages/twenty-front/src/pages/settings/ai/SettingsToolDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/SettingsToolDetail.tsx
@@ -158,10 +158,10 @@ export const SettingsToolDetail = () => {
});
if (result.status === 'successful') {
- enqueueToast({ variant: 'success', children: t`Tool deleted` });
+ enqueueToast({ status: 'success', children: t`Tool deleted` });
navigate(getSettingsPath(SettingsPath.AI, undefined, undefined, 'tools'));
} else {
- enqueueToast({ variant: 'error', children: t`Failed to delete tool` });
+ enqueueToast({ status: 'error', children: t`Failed to delete tool` });
}
setIsDeleting(false);
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentSkillsTab.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentSkillsTab.tsx
index 5ed11b4933c..f12431fd56b 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentSkillsTab.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentSkillsTab.tsx
@@ -99,20 +99,20 @@ export const SettingsAgentSkillsTab = () => {
const handleActivate = async (skillId: string) => {
try {
await activateSkill({ variables: { id: skillId } });
- enqueueToast({ variant: 'success', children: t`Skill activated` });
+ enqueueToast({ status: 'success', children: t`Skill activated` });
refetch();
} catch {
- enqueueToast({ variant: 'error', children: t`Failed to activate skill` });
+ enqueueToast({ status: 'error', children: t`Failed to activate skill` });
}
};
const handleDelete = async (skillId: string) => {
try {
await deleteSkill({ variables: { id: skillId } });
- enqueueToast({ variant: 'success', children: t`Skill deleted` });
+ enqueueToast({ status: 'success', children: t`Skill deleted` });
refetch();
} catch {
- enqueueToast({ variant: 'error', children: t`Failed to delete skill` });
+ enqueueToast({ status: 'error', children: t`Failed to delete skill` });
}
};
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiOverviewTab.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiOverviewTab.tsx
index b14cdaedc18..a32275087a7 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiOverviewTab.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiOverviewTab.tsx
@@ -70,7 +70,7 @@ export const SettingsAiOverviewTab = () => {
enqueueToast(getToastOptionsFromError({ error }));
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to save workspace instructions`,
});
}
diff --git a/packages/twenty-front/src/pages/settings/ai/hooks/useCreateTool.ts b/packages/twenty-front/src/pages/settings/ai/hooks/useCreateTool.ts
index 50849d7f76e..82ad756ac37 100644
--- a/packages/twenty-front/src/pages/settings/ai/hooks/useCreateTool.ts
+++ b/packages/twenty-front/src/pages/settings/ai/hooks/useCreateTool.ts
@@ -32,7 +32,7 @@ export const useCreateTool = () => {
}
const newLogicFunction = result.response.data.createOneLogicFunction;
- enqueueToast({ variant: 'success', children: t`Tool created` });
+ enqueueToast({ status: 'success', children: t`Tool created` });
const applicationId = newLogicFunction.applicationId;
if (isDefined(applicationId)) {
diff --git a/packages/twenty-front/src/pages/settings/ai/hooks/useNavigateToNotFoundOnLoadFailure.ts b/packages/twenty-front/src/pages/settings/ai/hooks/useNavigateToNotFoundOnLoadFailure.ts
index 88e7641a2c6..6ebc455e193 100644
--- a/packages/twenty-front/src/pages/settings/ai/hooks/useNavigateToNotFoundOnLoadFailure.ts
+++ b/packages/twenty-front/src/pages/settings/ai/hooks/useNavigateToNotFoundOnLoadFailure.ts
@@ -27,7 +27,7 @@ export const useNavigateToNotFoundOnLoadFailure = ({
enqueueToast(
isDefined(error)
? getToastOptionsFromError({ error })
- : { variant: 'error', children: notFoundMessage },
+ : { status: 'error', children: notFoundMessage },
);
navigateApp(AppPath.NotFound);
}, [hasFailedToLoad, error, notFoundMessage, enqueueToast, navigateApp]);
diff --git a/packages/twenty-front/src/pages/settings/ai/hooks/useSettingsAiModelsActions.ts b/packages/twenty-front/src/pages/settings/ai/hooks/useSettingsAiModelsActions.ts
index f4e3adce3fe..1e825b4aa12 100644
--- a/packages/twenty-front/src/pages/settings/ai/hooks/useSettingsAiModelsActions.ts
+++ b/packages/twenty-front/src/pages/settings/ai/hooks/useSettingsAiModelsActions.ts
@@ -46,7 +46,7 @@ export const useSettingsAiModelsActions = () => {
} catch {
setCurrentWorkspace(previousWorkspace);
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to update model settings`,
});
}
diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsClaimApplicationSection.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsClaimApplicationSection.tsx
index ca4c5ea0cf7..d9093d725e6 100644
--- a/packages/twenty-front/src/pages/settings/applications/components/SettingsClaimApplicationSection.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/components/SettingsClaimApplicationSection.tsx
@@ -150,7 +150,7 @@ export const SettingsClaimApplicationSection = () => {
}
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error ? error.message : t`Could not run the lookup`,
});
@@ -176,7 +176,7 @@ export const SettingsClaimApplicationSection = () => {
window.location.href = authorizationUrl;
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error
? error.message
@@ -189,12 +189,12 @@ export const SettingsClaimApplicationSection = () => {
try {
await syncCatalog();
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Catalog sync started. Try your lookup again in a moment.`,
});
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error
? error.message
diff --git a/packages/twenty-front/src/pages/settings/applications/hooks/useApplicationTimelineActivityTypes.ts b/packages/twenty-front/src/pages/settings/applications/hooks/useApplicationTimelineActivityTypes.ts
index da1efce50da..e716fd335a3 100644
--- a/packages/twenty-front/src/pages/settings/applications/hooks/useApplicationTimelineActivityTypes.ts
+++ b/packages/twenty-front/src/pages/settings/applications/hooks/useApplicationTimelineActivityTypes.ts
@@ -42,7 +42,7 @@ export const useApplicationTimelineActivityTypes = ({
try {
await mutation();
} catch {
- enqueueToast({ variant: 'error', children: errorMessage });
+ enqueueToast({ status: 'error', children: errorMessage });
} finally {
setMutatingTimelineActivityTypeIds((currentIds) => {
const nextIds = new Set(currentIds);
diff --git a/packages/twenty-front/src/pages/settings/applications/hooks/useApplicationVariablesDraft.ts b/packages/twenty-front/src/pages/settings/applications/hooks/useApplicationVariablesDraft.ts
index 8dc2511e7a3..82d43336367 100644
--- a/packages/twenty-front/src/pages/settings/applications/hooks/useApplicationVariablesDraft.ts
+++ b/packages/twenty-front/src/pages/settings/applications/hooks/useApplicationVariablesDraft.ts
@@ -87,7 +87,7 @@ export const useApplicationVariablesDraft = ({
);
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to save the app settings.`,
});
} finally {
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationAutoUpdateSection.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationAutoUpdateSection.tsx
index 4b3bf8a4c88..cbb64261974 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationAutoUpdateSection.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationAutoUpdateSection.tsx
@@ -29,7 +29,7 @@ export const SettingsApplicationAutoUpdateSection = ({
});
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to update auto-upgrade setting.`,
});
}
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationRegistrationOAuthTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationRegistrationOAuthTab.tsx
index 5487c61f341..133b8cd0675 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationRegistrationOAuthTab.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationRegistrationOAuthTab.tsx
@@ -72,11 +72,11 @@ export const SettingsApplicationRegistrationOAuthTab = ({
},
},
});
- enqueueToast({ variant: 'success', children: t`Redirect URIs updated` });
+ enqueueToast({ status: 'success', children: t`Redirect URIs updated` });
setFormRedirectUris(newFormRedirectUris);
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Error updating redirect URIs`,
});
} finally {
@@ -96,13 +96,13 @@ export const SettingsApplicationRegistrationOAuthTab = ({
if (isNonEmptyString(secret)) {
setRotatedSecret(secret);
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Client secret rotated. Copy it now — it won't be shown again.`,
});
}
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Error rotating client secret`,
});
} finally {
diff --git a/packages/twenty-front/src/pages/settings/billing/SettingsBillingNewLimit.tsx b/packages/twenty-front/src/pages/settings/billing/SettingsBillingNewLimit.tsx
index 0d11b0264f4..7fb7a1a1b50 100644
--- a/packages/twenty-front/src/pages/settings/billing/SettingsBillingNewLimit.tsx
+++ b/packages/twenty-front/src/pages/settings/billing/SettingsBillingNewLimit.tsx
@@ -39,7 +39,7 @@ export const SettingsBillingNewLimit = () => {
try {
await createUsageLimit({ variables: { input } });
- enqueueToast({ variant: 'success', children: t`Limit created.` });
+ enqueueToast({ status: 'success', children: t`Limit created.` });
navigate(SettingsPath.BillingLimits);
} catch (error) {
const serverMessage =
@@ -48,7 +48,7 @@ export const SettingsBillingNewLimit = () => {
: undefined;
enqueueToast({
- variant: 'error',
+ status: 'error',
children: serverMessage ?? t`Failed to create the limit.`,
});
}
diff --git a/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceCommunicationGroupChannelDetail.tsx b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceCommunicationGroupChannelDetail.tsx
index 12cd7a800c2..cb13da53017 100644
--- a/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceCommunicationGroupChannelDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceCommunicationGroupChannelDetail.tsx
@@ -118,7 +118,7 @@ export const SettingsWorkspaceCommunicationGroupChannelDetail = () => {
);
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to update sender name.`,
});
} finally {
@@ -132,7 +132,7 @@ export const SettingsWorkspaceCommunicationGroupChannelDetail = () => {
navigateSettings(SettingsPath.WorkspaceCommunications);
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to delete email channel.`,
});
}
diff --git a/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceNewUnsubscribeTopic.tsx b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceNewUnsubscribeTopic.tsx
index 611e06470e1..9f62f9e55a9 100644
--- a/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceNewUnsubscribeTopic.tsx
+++ b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceNewUnsubscribeTopic.tsx
@@ -65,7 +65,7 @@ export const SettingsWorkspaceNewUnsubscribeTopic = () => {
}
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to create unsubscribe topic.`,
});
}
diff --git a/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceUnsubscribeTopicDetail.tsx b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceUnsubscribeTopicDetail.tsx
index 7a5cf7874d1..a90e10422ed 100644
--- a/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceUnsubscribeTopicDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceUnsubscribeTopicDetail.tsx
@@ -74,7 +74,7 @@ export const SettingsWorkspaceUnsubscribeTopicDetail = () => {
await updateUnsubscribeTopic(input);
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to update unsubscribe topic.`,
});
}
@@ -113,7 +113,7 @@ export const SettingsWorkspaceUnsubscribeTopicDetail = () => {
);
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to delete unsubscribe topic.`,
});
}
diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectFieldEdit.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectFieldEdit.tsx
index 7d3611c37d8..0776870bb87 100644
--- a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectFieldEdit.tsx
+++ b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectFieldEdit.tsx
@@ -313,7 +313,7 @@ export const SettingsObjectFieldEdit = () => {
});
if (deleteResult.status === 'successful') {
- enqueueToast({ variant: 'success', children: t`Field deleted` });
+ enqueueToast({ status: 'success', children: t`Field deleted` });
closeDialog(DELETE_FIELD_MODAL_ID);
navigateSettings(SettingsPath.ObjectDetail, {
objectNamePlural,
diff --git a/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldConfigure.tsx b/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldConfigure.tsx
index d1acb4b01c0..7846dae3794 100644
--- a/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldConfigure.tsx
+++ b/packages/twenty-front/src/pages/settings/data-model/new-field/SettingsObjectNewFieldConfigure.tsx
@@ -178,7 +178,7 @@ export const SettingsObjectNewFieldConfigure = () => {
}
default: {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Please select at least one destination object for this relation.`,
});
return setIsSaving(false);
diff --git a/packages/twenty-front/src/pages/settings/data-model/new-index/SettingsObjectNewIndex.tsx b/packages/twenty-front/src/pages/settings/data-model/new-index/SettingsObjectNewIndex.tsx
index 6a94b5467cf..eb7847582ee 100644
--- a/packages/twenty-front/src/pages/settings/data-model/new-index/SettingsObjectNewIndex.tsx
+++ b/packages/twenty-front/src/pages/settings/data-model/new-index/SettingsObjectNewIndex.tsx
@@ -115,7 +115,7 @@ export const SettingsObjectNewIndex = () => {
});
if (result.status === 'successful') {
- enqueueToast({ variant: 'success', children: t`Index created` });
+ enqueueToast({ status: 'success', children: t`Index created` });
navigate(SettingsPath.ObjectDetail, { objectNamePlural });
}
};
diff --git a/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx b/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx
index 79e9e90145f..75ab0a31c16 100644
--- a/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx
@@ -122,12 +122,12 @@ export const SettingsDevelopersApiKeyDetail = () => {
},
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Role updated successfully`,
});
setSelectedRoleId(roleId);
} catch {
- enqueueToast({ variant: 'error', children: t`Error updating role` });
+ enqueueToast({ status: 'error', children: t`Error updating role` });
} finally {
setIsLoading(false);
}
@@ -154,7 +154,7 @@ export const SettingsDevelopersApiKeyDetail = () => {
);
}
} catch {
- enqueueToast({ variant: 'error', children: t`Error deleting api key.` });
+ enqueueToast({ status: 'error', children: t`Error deleting api key.` });
} finally {
setIsLoading(false);
}
@@ -168,7 +168,7 @@ export const SettingsDevelopersApiKeyDetail = () => {
if (!roleIdToUse) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`A role must be selected for the API key`,
});
return;
@@ -212,7 +212,7 @@ export const SettingsDevelopersApiKeyDetail = () => {
if (isDefined(apiKey)) {
if (!isNonEmptyString(apiKeyName)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`API key name cannot be empty`,
});
return;
@@ -233,7 +233,7 @@ export const SettingsDevelopersApiKeyDetail = () => {
}
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Error regenerating api key.`,
});
} finally {
diff --git a/packages/twenty-front/src/pages/settings/enterprise/SettingsEnterprise.tsx b/packages/twenty-front/src/pages/settings/enterprise/SettingsEnterprise.tsx
index e0a40b3f776..6ebbcea43c0 100644
--- a/packages/twenty-front/src/pages/settings/enterprise/SettingsEnterprise.tsx
+++ b/packages/twenty-front/src/pages/settings/enterprise/SettingsEnterprise.tsx
@@ -277,7 +277,7 @@ export const SettingsEnterprise = ({
if (result.data?.setEnterpriseKey.isValid === true) {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Organization license activated successfully`,
});
setEnterpriseKey('');
@@ -287,7 +287,7 @@ export const SettingsEnterprise = ({
await loadCurrentUser();
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Failed to activate Organization license. Please check your key or contact support.`,
});
}
@@ -313,7 +313,7 @@ export const SettingsEnterprise = ({
enqueueToast(getToastOptionsFromError({ error, duration: 10000 }));
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Error activating Organization license`,
});
}
@@ -345,13 +345,13 @@ export const SettingsEnterprise = ({
openUrlInNewTab(portalUrl);
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Could not open billing portal. Please check your Organization key is present, or contact support.`,
});
}
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Error opening billing portal`,
});
}
@@ -370,13 +370,13 @@ export const SettingsEnterprise = ({
if (data?.refreshEnterpriseValidityToken === true) {
setIsBoundToAnotherServer(false);
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Validity token refreshed successfully`,
});
await loadCurrentUser();
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Could not refresh validity token. Please contact support.`,
});
}
@@ -399,7 +399,7 @@ export const SettingsEnterprise = ({
enqueueToast(getToastOptionsFromError({ error, duration: 10000 }));
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Error refreshing validity token. Please contact support.`,
});
}
@@ -417,7 +417,7 @@ export const SettingsEnterprise = ({
if (result.data?.releaseEnterpriseServerBinding.isValid === true) {
setIsBoundToAnotherServer(false);
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Organization key transferred to this server`,
});
const { data: statusData } = await fetchSubscriptionStatus();
@@ -426,19 +426,19 @@ export const SettingsEnterprise = ({
await loadCurrentUser();
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Could not transfer the Organization key. Please contact support.`,
});
}
} catch (error) {
if (isGraphqlErrorOfType(error, 'ENTERPRISE_RELEASE_RATE_LIMITED')) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`You have reached the maximum number of server transfers allowed in the last 30 days for this Organization key. Please try again later or contact support.`,
});
} else {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Error transferring the Organization key`,
});
}
@@ -472,7 +472,7 @@ export const SettingsEnterprise = ({
await loadCurrentUser();
enqueueToast({
- variant: 'success',
+ status: 'success',
children:
nextInstanceType === ENTERPRISE_INSTANCE_TYPE.DEVELOPMENT
? t`Registered as a development instance. This instance will not be billed.`
@@ -484,7 +484,7 @@ export const SettingsEnterprise = ({
} catch {
if (!instanceUpdateSuccess) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Could not update the instance type`,
});
}
@@ -500,12 +500,12 @@ export const SettingsEnterprise = ({
setIsInstanceTypeFromDb(previousIsInstanceTypeFromDb);
await loadCurrentUser();
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Could not refresh validity token - reverted the instance type change.`,
});
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Could not refresh validity token and could not revert the instance type change.`,
});
}
diff --git a/packages/twenty-front/src/pages/settings/legal/SettingsLegalDpaNew.tsx b/packages/twenty-front/src/pages/settings/legal/SettingsLegalDpaNew.tsx
index 26c40710f55..2751bab867c 100644
--- a/packages/twenty-front/src/pages/settings/legal/SettingsLegalDpaNew.tsx
+++ b/packages/twenty-front/src/pages/settings/legal/SettingsLegalDpaNew.tsx
@@ -96,13 +96,13 @@ export const SettingsLegalDpaNew = () => {
);
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Signed DPA generated and downloaded`,
});
navigateSettings(SettingsPath.LegalDpa);
} catch {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Could not generate the signed DPA. Please try again.`,
});
} finally {
diff --git a/packages/twenty-front/src/pages/settings/members/SettingsWorkspaceMember.tsx b/packages/twenty-front/src/pages/settings/members/SettingsWorkspaceMember.tsx
index 62921a707bb..4c9f6f53a1b 100644
--- a/packages/twenty-front/src/pages/settings/members/SettingsWorkspaceMember.tsx
+++ b/packages/twenty-front/src/pages/settings/members/SettingsWorkspaceMember.tsx
@@ -109,7 +109,7 @@ export const SettingsWorkspaceMember = () => {
});
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error
? error.message
@@ -127,14 +127,14 @@ export const SettingsWorkspaceMember = () => {
variables: { workspaceMemberIdToDelete: member.id },
});
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Member removed from workspace`,
});
closeDialog(DELETE_MEMBER_MODAL_ID);
navigateSettings(SettingsPath.WorkspaceMembersPage);
} catch (error) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children:
error instanceof Error
? error.message
@@ -146,7 +146,7 @@ export const SettingsWorkspaceMember = () => {
const handleImpersonate = async () => {
if (!member?.userId || !currentWorkspace?.id) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Cannot impersonate selected user`,
duration: 2000,
});
@@ -155,7 +155,7 @@ export const SettingsWorkspaceMember = () => {
if (!isDefined(currentUser?.id) || member.userId === currentUser.id) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`You cannot impersonate your own account`,
duration: 2000,
});
@@ -175,7 +175,7 @@ export const SettingsWorkspaceMember = () => {
},
onError: () => {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Cannot impersonate selected user`,
duration: 2000,
});
diff --git a/packages/twenty-front/src/pages/settings/members/tabs/SettingsWorkspaceMembersInviteTab.tsx b/packages/twenty-front/src/pages/settings/members/tabs/SettingsWorkspaceMembersInviteTab.tsx
index 109a990e3b3..faf4b5e0c0a 100644
--- a/packages/twenty-front/src/pages/settings/members/tabs/SettingsWorkspaceMembersInviteTab.tsx
+++ b/packages/twenty-front/src/pages/settings/members/tabs/SettingsWorkspaceMembersInviteTab.tsx
@@ -93,7 +93,7 @@ export const SettingsWorkspaceMembersInviteTab = () => {
const result = await deleteWorkspaceInvitation({ appTokenId });
if (isDefined(result.error)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Error deleting invitation`,
duration: 2000,
});
@@ -104,7 +104,7 @@ export const SettingsWorkspaceMembersInviteTab = () => {
const result = await resendInvitation({ appTokenId });
if (isDefined(result.error)) {
enqueueToast({
- variant: 'error',
+ status: 'error',
children: t`Error resending invitation`,
duration: 2000,
});
diff --git a/packages/twenty-front/src/pages/settings/security/SettingsSecurityApprovedAccessDomain.tsx b/packages/twenty-front/src/pages/settings/security/SettingsSecurityApprovedAccessDomain.tsx
index e6584066709..7f28d76a770 100644
--- a/packages/twenty-front/src/pages/settings/security/SettingsSecurityApprovedAccessDomain.tsx
+++ b/packages/twenty-front/src/pages/settings/security/SettingsSecurityApprovedAccessDomain.tsx
@@ -63,7 +63,7 @@ export const SettingsSecurityApprovedAccessDomain = () => {
},
onCompleted: () => {
enqueueToast({
- variant: 'success',
+ status: 'success',
children: t`Please check your email for a verification link.`,
});
navigate(SettingsPath.WorkspaceMembersPage);
diff --git a/packages/twenty-ui/docs/components.ts b/packages/twenty-ui/docs/components.ts
index ed20b75e216..bdfe0161114 100644
--- a/packages/twenty-ui/docs/components.ts
+++ b/packages/twenty-ui/docs/components.ts
@@ -17,6 +17,7 @@ import { STACK_ICON_PROP_DESCRIPTIONS } from './stackIconPropDescriptions';
import { TINTED_ICON_TILE_PROP_DESCRIPTIONS } from './tintedIconTilePropDescriptions';
import { CALLOUT_PROP_DESCRIPTIONS } from './calloutPropDescriptions';
import { INLINE_BANNER_PROP_DESCRIPTIONS } from './inlineBannerPropDescriptions';
+import { TOAST_PROP_DESCRIPTIONS } from './toastPropDescriptions';
import { TOAST_PROVIDER_PROP_DESCRIPTIONS } from './toastProviderPropDescriptions';
import { TOASTER_PROP_DESCRIPTIONS } from './toasterPropDescriptions';
import { RADIO_PROP_DESCRIPTIONS } from './radioPropDescriptions';
@@ -673,6 +674,7 @@ export const DOCUMENTED_COMPONENTS = [
source: 'components/feedback/Toast/Toast.tsx',
entryPoint: 'twenty-ui/components/feedback',
slug: 'components/feedback/toast',
+ propDescriptions: TOAST_PROP_DESCRIPTIONS,
},
{
name: 'Text',
diff --git a/packages/twenty-ui/docs/label-ownership.md b/packages/twenty-ui/docs/label-ownership.md
index 4b29cba70e7..5737a90ad9e 100644
--- a/packages/twenty-ui/docs/label-ownership.md
+++ b/packages/twenty-ui/docs/label-ownership.md
@@ -16,7 +16,7 @@ This covers production exports under components, primitives, and icons, includin
| CountrySelect | `searchLabel`, `noCountryLabel`, and `noResultsLabel` default to `Search`, `No country`, and `No results`. The search label names the search input and is its placeholder. Applications supply `label` or native accessible names and the country labels, including translated strings. |
| PhoneCountryPicker | Callers supply country labels and the trigger accessible name. The popup takes the trigger name unless a `Dropdown.Title` or an explicit `Dropdown.Content` label names it, and the selected country label describes the trigger. `searchLabel` defaults to `Search`; `emptyLabel` defaults to `No results`. Calling codes are supplied as data without a leading plus sign. |
| ImageInput | `uploadLabel`, `removeLabel`, and `abortLabel` default to `Upload`, `Remove`, and `Abort`. The upload label names the visible upload button, preview button, and hidden file input. Native accessible attributes can supply names and descriptions for the file input. Applications supply `helperText` and `errorMessage`, including validation instructions and translated strings. |
-| Toast and Toaster | Children, description and action slots, `iconLabel`, `cancelLabel` (default `Cancel`), and `closeLabel` (default `Close`). Toaster accepts native accessible attributes over its `Notifications` region default. |
+| Toast and Toaster | Caller-owned children, description, icon, action, and `cancelLabel` nodes (default `Cancel`), plus `iconLabel` and `closeLabel` (default `Close`). Live updates replace only supplied fields. Toaster accepts native accessible attributes over its `Notifications` region default. |
| Chip and Avatar | Chip content, translated fallbacks and interactive accessible names belong to the caller. Missing children add no label. Avatar's image and default fallback are decorative. `name` supplies the visual initial and colors. Explicit `imageProps.alt` labels the image and default fallback; caller fallback semantics take precedence. Composed buttons and links own their labels and interaction handlers. |
| JsonTree | Callers supply empty string, array, and object labels and expanded/collapsed arrow names. JSON booleans, null, property names, and values are data. |
| ResizeHandle and CodeEditor | ResizeHandle accepts native labels over `Resize`. Hosts supply a contextual label, `aria-controls`, and the focus destination when collapsing a panel removes its handle. CodeEditor exposes `resizeLabel` (default `Resize editor`) and Monaco `options`, including its editor accessible label. The loading indicator adds no text. Monaco owns its internal editor messages. |
diff --git a/packages/twenty-ui/docs/public-exports.json b/packages/twenty-ui/docs/public-exports.json
index 196edccbfc9..f3582104425 100644
--- a/packages/twenty-ui/docs/public-exports.json
+++ b/packages/twenty-ui/docs/public-exports.json
@@ -81,7 +81,8 @@
"ToastOptions": "components/feedback/Toast/types/ToastOptions",
"ToastProps": "components/feedback/Toast/types/ToastProps",
"ToastProviderProps": "components/feedback/Toast/types/ToastProviderProps",
- "ToastVariant": "components/feedback/Toast/types/ToastVariant"
+ "ToastStatus": "components/feedback/Toast/types/ToastStatus",
+ "ToastUpdate": "components/feedback/Toast/types/ToastUpdate"
}
},
"components/input": {
diff --git a/packages/twenty-ui/docs/toastPropDescriptions.ts b/packages/twenty-ui/docs/toastPropDescriptions.ts
new file mode 100644
index 00000000000..d922fc00bea
--- /dev/null
+++ b/packages/twenty-ui/docs/toastPropDescriptions.ts
@@ -0,0 +1,29 @@
+import { type ComponentProps } from 'react';
+
+import { type Toast } from '../src/components/feedback/Toast/Toast';
+
+export const TOAST_PROP_DESCRIPTIONS = {
+ children: 'Main message node. Callers own its content and accessible text.',
+ status:
+ 'Feedback meaning: neutral, info, success, warning, or error. Defaults to neutral and selects the icon and theme palette.',
+ description: 'Optional supporting content node rendered below the message.',
+ icon: 'Leading icon node. Defaults to the status icon. Pass null to omit it.',
+ iconLabel:
+ 'Accessible name of the default icon. Without it, the icon is decorative.',
+ action: 'Optional footer node, such as a Button with a caller-owned action.',
+ progress: 'Completion percentage. Providing it disables the countdown.',
+ duration:
+ 'Milliseconds before onClose is called. The countdown pauses while the pointer is over the toast or keyboard focus is inside it.',
+ onCancel:
+ 'Called when the cancel button is clicked. Providing it and renderable cancelLabel content shows the button.',
+ onClose:
+ 'Called when the close button is clicked or the countdown completes. Providing it shows the close button.',
+ cancelLabel:
+ 'Cancel button content node. Defaults to Cancel. Pass null to hide the control.',
+ closeLabel: 'Accessible name of the close button. Defaults to Close.',
+ className: 'Additional class names merged onto the root.',
+ style: 'Inline styles forwarded to the root.',
+ ref: 'Ref to the root div, or the element supplied through render.',
+ render:
+ 'Element or callback composition for the root. Native props and the ref target the rendered element.',
+} satisfies Partial<Record<keyof ComponentProps<typeof Toast>, string>>;
diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.json
index ae855ad1907..cec6d4a52b9 100644
--- a/packages/twenty-ui/generated/components.docs.json
+++ b/packages/twenty-ui/generated/components.docs.json
@@ -9838,84 +9838,112 @@
"type": "ReactNode",
"required": false,
"defaultValue": null,
- "description": "Content rendered in the footer, such as an action button."
+ "description": "Optional footer node, such as a Button with a caller-owned action."
},
{
"name": "cancelLabel",
- "type": "string",
+ "type": "ReactNode",
"required": false,
"defaultValue": "Cancel",
- "description": "Label of the cancel button."
+ "description": "Cancel button content node. Defaults to Cancel. Pass null to hide the control."
+ },
+ {
+ "name": "children",
+ "type": "ReactNode",
+ "required": false,
+ "defaultValue": null,
+ "description": "Main message node. Callers own its content and accessible text."
+ },
+ {
+ "name": "className",
+ "type": "string",
+ "required": false,
+ "defaultValue": null,
+ "description": "Additional class names merged onto the root."
},
{
"name": "closeLabel",
"type": "string",
"required": false,
"defaultValue": "Close",
- "description": "Accessible name of the close button."
+ "description": "Accessible name of the close button. Defaults to Close."
},
{
"name": "description",
"type": "ReactNode",
"required": false,
"defaultValue": null,
- "description": "Supporting content rendered below the message."
+ "description": "Optional supporting content node rendered below the message."
},
{
"name": "duration",
"type": "number",
"required": false,
"defaultValue": "6000",
- "description": "Milliseconds before `onClose` is called. The countdown pauses while the\npointer is over the toast or keyboard focus is inside it."
+ "description": "Milliseconds before onClose is called. The countdown pauses while the pointer is over the toast or keyboard focus is inside it."
},
{
"name": "icon",
"type": "ReactNode",
"required": false,
"defaultValue": null,
- "description": "Replaces the variant's icon."
+ "description": "Leading icon node. Defaults to the status icon. Pass null to omit it."
},
{
"name": "iconLabel",
"type": "string",
"required": false,
"defaultValue": null,
- "description": "Accessible name of the default icon. Without it, the icon is hidden from\nassistive technology."
+ "description": "Accessible name of the default icon. Without it, the icon is decorative."
},
{
"name": "onCancel",
"type": "(() => void)",
"required": false,
"defaultValue": null,
- "description": "Called when the cancel button is clicked. The button renders only when\nthis callback is provided."
+ "description": "Called when the cancel button is clicked. Providing it and renderable cancelLabel content shows the button."
},
{
"name": "onClose",
"type": "(() => void)",
"required": false,
"defaultValue": null,
- "description": "Called when the close button is clicked or the countdown completes. The\nbutton renders only when this callback is provided."
+ "description": "Called when the close button is clicked or the countdown completes. Providing it shows the close button."
},
{
"name": "progress",
"type": "number",
"required": false,
"defaultValue": null,
- "description": "Completion percentage shown in the progress bar. When set, the countdown\nis disabled."
+ "description": "Completion percentage. Providing it disables the countdown."
+ },
+ {
+ "name": "ref",
+ "type": "Ref<HTMLDivElement>",
+ "required": false,
+ "defaultValue": null,
+ "description": "Ref to the root div, or the element supplied through render."
},
{
"name": "render",
"type": "RenderProp<Record<string, unknown>>",
"required": false,
"defaultValue": null,
- "description": "Replaces the rendered element or composes it with another component.\nAccepts a React element or a function that returns the element to render."
+ "description": "Element or callback composition for the root. Native props and the ref target the rendered element."
},
{
- "name": "variant",
- "type": "\"default\" | \"error\" | \"info\" | \"success\" | \"warning\"",
+ "name": "status",
+ "type": "\"error\" | \"info\" | \"neutral\" | \"success\" | \"warning\"",
"required": false,
- "defaultValue": "default",
- "description": "Visual variant that selects the icon and colors."
+ "defaultValue": "neutral",
+ "description": "Feedback meaning: neutral, info, success, warning, or error. Defaults to neutral and selects the icon and theme palette."
+ },
+ {
+ "name": "style",
+ "type": "CSSProperties",
+ "required": false,
+ "defaultValue": null,
+ "description": "Inline styles forwarded to the root."
}
]
},
diff --git a/packages/twenty-ui/src/components/feedback/Toast/Toast.tsx b/packages/twenty-ui/src/components/feedback/Toast/Toast.tsx
index 9b892831374..d0ca60743e5 100644
--- a/packages/twenty-ui/src/components/feedback/Toast/Toast.tsx
+++ b/packages/twenty-ui/src/components/feedback/Toast/Toast.tsx
@@ -1,4 +1,5 @@
import { useRender } from '@base-ui/react/use-render';
+import { isUndefined } from '@sniptt/guards';
import { clsx } from 'clsx';
import { type FocusEvent, type MouseEvent, useState } from 'react';
@@ -11,20 +12,21 @@ import {
import { Button } from '@ui/primitives/input/Button/Button';
import { Separator } from '@ui/primitives/layout/Separator/Separator';
import { useTheme } from '@ui/theme';
+import { isRenderableSlot } from '@ui/utilities/internal/isRenderableSlot';
import { isDefined } from '@ui/utilities/utils/isDefined';
import styles from './Toast.module.scss';
import { ToastProgress } from './internal/components/ToastProgress';
import { type ToastProps } from './types/ToastProps';
-import { type ToastVariant } from './types/ToastVariant';
+import { type ToastStatus } from './types/ToastStatus';
const TOAST_ICONS = {
- default: IconAlertTriangle,
+ neutral: IconAlertTriangle,
error: IconAlertTriangle,
success: IconSquareRoundedCheck,
info: IconInfoCircle,
warning: IconAlertTriangle,
-} satisfies Record<ToastVariant, typeof IconAlertTriangle>;
+} satisfies Record<ToastStatus, typeof IconAlertTriangle>;
export const Toast = ({
children,
@@ -38,7 +40,7 @@ export const Toast = ({
onClose,
cancelLabel = 'Cancel',
closeLabel = 'Close',
- variant = 'default',
+ status = 'neutral',
role = 'status',
className,
onMouseEnter,
@@ -52,7 +54,18 @@ export const Toast = ({
const theme = useTheme();
const [isHovered, setIsHovered] = useState(false);
const [isFocused, setIsFocused] = useState(false);
- const Icon = TOAST_ICONS[variant];
+ const Icon = TOAST_ICONS[status];
+ const toastColors = theme.snackBar[status === 'neutral' ? 'default' : status];
+ const toastIcon = isUndefined(icon) ? (
+ <Icon
+ aria-label={iconLabel}
+ aria-hidden={!isDefined(iconLabel)}
+ color={toastColors.color}
+ size={theme.icon.size.md}
+ />
+ ) : (
+ icon
+ );
return useRender({
render,
@@ -89,7 +102,7 @@ export const Toast = ({
<>
<div className={styles.progress} aria-hidden>
<ToastProgress
- barColor={theme.snackBar[variant].backgroundColor}
+ barColor={toastColors.backgroundColor}
progress={progress}
duration={duration}
isPaused={isHovered || isFocused}
@@ -97,19 +110,12 @@ export const Toast = ({
/>
</div>
<div className={styles.header}>
- <div className={styles.icon}>
- {icon ?? (
- <Icon
- aria-label={iconLabel}
- aria-hidden={!isDefined(iconLabel)}
- color={theme.snackBar[variant].color}
- size={theme.icon.size.md}
- />
- )}
- </div>
+ {isRenderableSlot(toastIcon) && (
+ <div className={styles.icon}>{toastIcon}</div>
+ )}
<div className={styles.message}>{children}</div>
<div className={styles.actions}>
- {isDefined(onCancel) && (
+ {isDefined(onCancel) && isRenderableSlot(cancelLabel) && (
<Button
onClick={onCancel}
size="sm"
@@ -132,10 +138,10 @@ export const Toast = ({
)}
</div>
</div>
- {isDefined(description) && (
+ {isRenderableSlot(description) && (
<div className={styles.description}>{description}</div>
)}
- {isDefined(action) && (
+ {isRenderableSlot(action) && (
<div className={styles.footer}>
<Separator />
<div className={styles.footerAction}>{action}</div>
diff --git a/packages/twenty-ui/src/components/feedback/Toast/__stories__/Toast.stories.tsx b/packages/twenty-ui/src/components/feedback/Toast/__stories__/Toast.stories.tsx
index 1953e059c8d..5af3eda2ca3 100644
--- a/packages/twenty-ui/src/components/feedback/Toast/__stories__/Toast.stories.tsx
+++ b/packages/twenty-ui/src/components/feedback/Toast/__stories__/Toast.stories.tsx
@@ -13,7 +13,7 @@ import {
import { Toast } from '../Toast';
import { type ToastProps } from '../types/ToastProps';
-import { type ToastVariant } from '../types/ToastVariant';
+import { type ToastStatus } from '../types/ToastStatus';
const meta: Meta<typeof Toast> = {
id: 'ui-feedback-toast',
@@ -27,7 +27,7 @@ type Story = StoryObj<typeof Toast>;
export const Default: Story = {
decorators: [ComponentDecorator],
- args: { variant: 'success', onClose: fn() },
+ args: { status: 'success', onClose: fn() },
play: async ({ canvasElement, args }) => {
const canvas = within(canvasElement);
expect(canvas.getByRole('status')).toHaveTextContent('Changes saved');
@@ -48,10 +48,10 @@ export const WithDescriptionAndAction: Story = {
args: {
children: 'Record deleted',
description: 'You can undo this action.',
- variant: 'info',
+ status: 'info',
onCancel: fn(),
onClose: fn(),
- cancelLabel: 'Annuler',
+ cancelLabel: <span>Annuler</span>,
closeLabel: 'Fermer',
},
render: (args) => (
@@ -105,7 +105,7 @@ export const CustomIconAndLink: Story = {
export const Alert: Story = {
...Default,
- args: { role: 'alert', variant: 'error', children: 'Unable to save' },
+ args: { role: 'alert', status: 'error', children: 'Unable to save' },
play: async ({ canvasElement }) => {
expect(within(canvasElement).getByRole('alert')).toHaveAttribute(
'aria-live',
@@ -273,15 +273,15 @@ export const Catalog: CatalogStory<Story, typeof Toast> = {
props: () => ({}),
},
{
- name: 'variant',
+ name: 'status',
values: [
- 'default',
+ 'neutral',
'success',
'error',
'info',
'warning',
- ] satisfies ToastVariant[],
- props: (variant: ToastVariant) => ({ variant }),
+ ] satisfies ToastStatus[],
+ props: (status: ToastStatus) => ({ status }),
},
],
options: { elementContainer: { style: { width: 310 } } },
@@ -294,3 +294,34 @@ export const CatalogDark: CatalogStory<Story, typeof Toast> = {
tags: ['!autodocs'],
globals: { colorScheme: 'dark' },
};
+
+const nativeToastRef = fn();
+const nativeToastFocus = fn();
+
+export const NativeComposition: Story = {
+ ...Default,
+ args: {
+ status: 'neutral',
+ children: <strong>Composed notification</strong>,
+ cancelLabel: <span>Undo changes</span>,
+ onCancel: fn(),
+ onFocus: fn(),
+ ref: nativeToastRef,
+ render: <section data-native-toast onFocus={nativeToastFocus} />,
+ 'aria-label': 'Save feedback',
+ tabIndex: 0,
+ },
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement);
+ const toast = canvas.getByRole('status', { name: 'Save feedback' });
+ expect(toast.tagName).toBe('SECTION');
+ expect(toast).toHaveAttribute('data-native-toast');
+ expect(toast).toHaveAttribute('tabindex', '0');
+ expect(nativeToastRef).toHaveBeenCalledWith(toast);
+ await userEvent.click(canvas.getByText('Composed notification'));
+ expect(nativeToastFocus).toHaveBeenCalledOnce();
+ expect(args.onFocus).toHaveBeenCalledOnce();
+ await userEvent.click(canvas.getByRole('button', { name: 'Undo changes' }));
+ expect(args.onCancel).toHaveBeenCalledOnce();
+ },
+};
diff --git a/packages/twenty-ui/src/components/feedback/Toast/hooks/useToast.ts b/packages/twenty-ui/src/components/feedback/Toast/hooks/useToast.ts
index 7c35cf35587..fc4cdbd5eda 100644
--- a/packages/twenty-ui/src/components/feedback/Toast/hooks/useToast.ts
+++ b/packages/twenty-ui/src/components/feedback/Toast/hooks/useToast.ts
@@ -1,9 +1,11 @@
import { useCloseToast } from '../internal/hooks/useCloseToast';
import { useEnqueueToast } from '../internal/hooks/useEnqueueToast';
+import { useUpdateToast } from '../internal/hooks/useUpdateToast';
export const useToast = () => {
const { closeToast } = useCloseToast();
const { enqueueToast } = useEnqueueToast();
+ const { updateToast } = useUpdateToast();
- return { enqueueToast, closeToast };
+ return { enqueueToast, closeToast, updateToast };
};
diff --git a/packages/twenty-ui/src/components/feedback/Toast/internal/hooks/useUpdateToast.ts b/packages/twenty-ui/src/components/feedback/Toast/internal/hooks/useUpdateToast.ts
new file mode 100644
index 00000000000..eb072b093f5
--- /dev/null
+++ b/packages/twenty-ui/src/components/feedback/Toast/internal/hooks/useUpdateToast.ts
@@ -0,0 +1,15 @@
+import { useCallback } from 'react';
+
+import { type ToastUpdate } from '../../types/ToastUpdate';
+import { updateToastInStore } from '../utils/updateToastInStore';
+import { useToastContext } from './useToastContext';
+
+export const useUpdateToast = () => {
+ const store = useToastContext();
+ const updateToast = useCallback(
+ (changes: ToastUpdate) => updateToastInStore({ store, ...changes }),
+ [store],
+ );
+
+ return { updateToast };
+};
diff --git a/packages/twenty-ui/src/components/feedback/Toast/internal/utils/__tests__/updateToastInStore.test.ts b/packages/twenty-ui/src/components/feedback/Toast/internal/utils/__tests__/updateToastInStore.test.ts
new file mode 100644
index 00000000000..b4ff296b679
--- /dev/null
+++ b/packages/twenty-ui/src/components/feedback/Toast/internal/utils/__tests__/updateToastInStore.test.ts
@@ -0,0 +1,152 @@
+import { expect, it, vi } from 'vitest';
+
+import { createToastStore } from '../../stores/createToastStore';
+import { completeToastExit } from '../completeToastExit';
+import { dismissToasts } from '../dismissToasts';
+import { updateToastInStore } from '../updateToastInStore';
+
+const createStoreWithToasts = () => {
+ const store = createToastStore();
+ const onClose = vi.fn();
+ store.set('toasts', [
+ {
+ notification: {
+ id: 'first',
+ children: 'Uploading',
+ description: 'Keep this description',
+ status: 'info',
+ duration: 6000,
+ onClose,
+ },
+ dedupeKey: 'upload',
+ status: 'visible',
+ },
+ { notification: { id: 'second', children: 'Second' }, status: 'visible' },
+ ]);
+
+ return { store, onClose };
+};
+
+it('patches a live notification without moving it or changing unrelated fields', () => {
+ const { store, onClose } = createStoreWithToasts();
+ const secondToast = store.state.toasts[1];
+
+ updateToastInStore({
+ store,
+ id: 'first',
+ children: 'Uploaded',
+ status: 'success',
+ });
+
+ expect(store.state.toasts[0]).toEqual({
+ notification: {
+ id: 'first',
+ children: 'Uploaded',
+ description: 'Keep this description',
+ status: 'success',
+ duration: 6000,
+ onClose,
+ },
+ dedupeKey: 'upload',
+ status: 'visible',
+ });
+ expect(store.state.toasts[1]).toBe(secondToast);
+ expect(onClose).not.toHaveBeenCalled();
+});
+
+it('applies successive patches to the latest notification and uses the latest close callback', () => {
+ const { store, onClose } = createStoreWithToasts();
+ const updatedClose = vi.fn();
+
+ updateToastInStore({
+ store,
+ id: 'first',
+ children: 'Updated',
+ onClose: updatedClose,
+ });
+ updateToastInStore({
+ store,
+ id: 'first',
+ description: 'New description',
+ progress: 50,
+ });
+
+ expect(store.state.toasts[0]?.notification).toMatchObject({
+ id: 'first',
+ children: 'Updated',
+ description: 'New description',
+ progress: 50,
+ onClose: updatedClose,
+ });
+ dismissToasts({ store, toastsToClose: [store.state.toasts[0]!] });
+ expect(updatedClose).toHaveBeenCalledOnce();
+ expect(onClose).not.toHaveBeenCalled();
+});
+
+it('clears optional fields explicitly while preserving omitted fields', () => {
+ const { store, onClose } = createStoreWithToasts();
+
+ updateToastInStore({
+ store,
+ id: 'first',
+ children: null,
+ description: null,
+ status: undefined,
+ duration: undefined,
+ onClose: undefined,
+ });
+
+ expect(store.state.toasts[0]?.notification).toEqual({
+ id: 'first',
+ children: null,
+ description: null,
+ status: undefined,
+ duration: undefined,
+ onClose: undefined,
+ });
+ dismissToasts({ store, toastsToClose: [store.state.toasts[0]!] });
+ expect(onClose).not.toHaveBeenCalled();
+});
+
+it('ignores unknown, exiting and removed IDs without publishing or calling callbacks', () => {
+ const { store, onClose } = createStoreWithToasts();
+ store.set('mountedToasterCount', 1);
+ dismissToasts({ store, toastsToClose: [store.state.toasts[0]!] });
+ const exitingToast = store.state.toasts[0]!;
+ const snapshot = store.state.toasts;
+ const listener = vi.fn();
+ store.subscribe(listener);
+
+ updateToastInStore({ store, id: 'missing', children: 'Missing' });
+ updateToastInStore({
+ store,
+ id: 'first',
+ children: 'Resurrected',
+ onClose: vi.fn(),
+ });
+
+ expect(store.state.toasts).toBe(snapshot);
+ expect(listener).not.toHaveBeenCalled();
+ expect(onClose).toHaveBeenCalledOnce();
+
+ completeToastExit({ store, toast: exitingToast });
+ const removedSnapshot = store.state.toasts;
+ listener.mockClear();
+ updateToastInStore({ store, id: 'first', children: 'Resurrected' });
+ expect(store.state.toasts).toBe(removedSnapshot);
+ expect(listener).not.toHaveBeenCalled();
+});
+
+it('does not publish empty patches but keeps explicit unchanged duration updates observable', () => {
+ const { store } = createStoreWithToasts();
+ const snapshot = store.state.toasts;
+ const listener = vi.fn();
+ store.subscribe(listener);
+
+ updateToastInStore({ store, id: 'first' });
+ expect(store.state.toasts).toBe(snapshot);
+ expect(listener).not.toHaveBeenCalled();
+
+ updateToastInStore({ store, id: 'first', duration: 6000 });
+ expect(listener).toHaveBeenCalledOnce();
+});
diff --git a/packages/twenty-ui/src/components/feedback/Toast/internal/utils/updateToastInStore.ts b/packages/twenty-ui/src/components/feedback/Toast/internal/utils/updateToastInStore.ts
new file mode 100644
index 00000000000..8f79b5bd744
--- /dev/null
+++ b/packages/twenty-ui/src/components/feedback/Toast/internal/utils/updateToastInStore.ts
@@ -0,0 +1,33 @@
+import { isNonEmptyArray } from '@sniptt/guards';
+
+import { isDefined } from '@ui/utilities/utils/isDefined';
+
+import { type ToastUpdate } from '../../types/ToastUpdate';
+import { type createToastStore } from '../stores/createToastStore';
+import { isToastVisible } from './isToastVisible';
+
+export const updateToastInStore = ({
+ store,
+ id,
+ ...changes
+}: ToastUpdate & { store: ReturnType<typeof createToastStore> }) => {
+ const toastToUpdate = store.state.toasts.find(
+ (toast) => toast.notification.id === id && isToastVisible(toast),
+ );
+
+ if (!isDefined(toastToUpdate) || !isNonEmptyArray(Object.keys(changes))) {
+ return;
+ }
+
+ store.set(
+ 'toasts',
+ store.state.toasts.map((toast) =>
+ toast === toastToUpdate
+ ? {
+ ...toast,
+ notification: { ...toast.notification, ...changes, id },
+ }
+ : toast,
+ ),
+ );
+};
diff --git a/packages/twenty-ui/src/components/feedback/Toast/types/ToastProps.ts b/packages/twenty-ui/src/components/feedback/Toast/types/ToastProps.ts
index 8cf2090513b..0ba83c41636 100644
--- a/packages/twenty-ui/src/components/feedback/Toast/types/ToastProps.ts
+++ b/packages/twenty-ui/src/components/feedback/Toast/types/ToastProps.ts
@@ -1,19 +1,17 @@
import { type useRender } from '@base-ui/react/use-render';
import { type ComponentPropsWithRef, type ReactNode } from 'react';
-import { type ToastVariant } from './ToastVariant';
+import { type ToastStatus } from './ToastStatus';
-export type ToastProps = ComponentPropsWithRef<'div'> & {
+export type ToastProps = Omit<ComponentPropsWithRef<'div'>, 'color'> & {
/**
* Replaces the rendered element or composes it with another component.
* Accepts a React element or a function that returns the element to render.
*/
render?: useRender.RenderProp;
- /** Visual variant that selects the icon and colors. */
- variant?: ToastVariant;
+ status?: ToastStatus;
/** Supporting content rendered below the message. */
description?: ReactNode;
- /** Replaces the variant's icon. */
icon?: ReactNode;
/**
* Accessible name of the default icon. Without it, the icon is hidden from
@@ -43,7 +41,7 @@ export type ToastProps = ComponentPropsWithRef<'div'> & {
*/
onClose?: () => void;
/** Label of the cancel button. */
- cancelLabel?: string;
+ cancelLabel?: ReactNode;
/** Accessible name of the close button. */
closeLabel?: string;
};
diff --git a/packages/twenty-ui/src/components/feedback/Toast/types/ToastStatus.ts b/packages/twenty-ui/src/components/feedback/Toast/types/ToastStatus.ts
new file mode 100644
index 00000000000..8ba4f2b7127
--- /dev/null
+++ b/packages/twenty-ui/src/components/feedback/Toast/types/ToastStatus.ts
@@ -0,0 +1 @@
+export type ToastStatus = 'neutral' | 'info' | 'success' | 'warning' | 'error';
diff --git a/packages/twenty-ui/src/components/feedback/Toast/types/ToastUpdate.ts b/packages/twenty-ui/src/components/feedback/Toast/types/ToastUpdate.ts
new file mode 100644
index 00000000000..7502c6ed6ce
--- /dev/null
+++ b/packages/twenty-ui/src/components/feedback/Toast/types/ToastUpdate.ts
@@ -0,0 +1,5 @@
+import { type ToastOptions } from './ToastOptions';
+
+export type ToastUpdate = Partial<Omit<ToastOptions, 'dedupeKey'>> & {
+ id: string;
+};
diff --git a/packages/twenty-ui/src/components/feedback/Toast/types/ToastVariant.ts b/packages/twenty-ui/src/components/feedback/Toast/types/ToastVariant.ts
deleted file mode 100644
index ac55b56d95c..00000000000
--- a/packages/twenty-ui/src/components/feedback/Toast/types/ToastVariant.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type ToastVariant = 'default' | 'error' | 'success' | 'info' | 'warning';
diff --git a/packages/twenty-ui/src/components/feedback/Toaster/__stories__/ToastControls.tsx b/packages/twenty-ui/src/components/feedback/Toaster/__stories__/ToastControls.tsx
index bcdda81df33..7ae33a5fd58 100644
--- a/packages/twenty-ui/src/components/feedback/Toaster/__stories__/ToastControls.tsx
+++ b/packages/twenty-ui/src/components/feedback/Toaster/__stories__/ToastControls.tsx
@@ -1,5 +1,8 @@
import { useState } from 'react';
+import { Button } from '@ui/primitives/input/Button/Button';
+import { Text } from '@ui/primitives/typography/Text/Text';
+
import { useToast } from '@ui/components/feedback/Toast/hooks/useToast';
import { type ToastOptions } from '@ui/components/feedback/Toast/types/ToastOptions';
@@ -8,7 +11,7 @@ type ToastControlsProps = {
};
export const ToastControls = ({ onClose }: ToastControlsProps) => {
- const { enqueueToast, closeToast } = useToast();
+ const { enqueueToast, closeToast, updateToast } = useToast();
const [count, setCount] = useState(1);
const [toastId, setToastId] = useState('');
@@ -22,8 +25,16 @@ export const ToastControls = ({ onClose }: ToastControlsProps) => {
};
return (
- <div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}>
- <button
+ <div
+ style={{
+ display: 'flex',
+ gap: 8,
+ flexWrap: 'wrap',
+ backgroundColor: 'var(--t-background-primary)',
+ color: 'var(--t-font-color-primary)',
+ }}
+ >
+ <Button
type="button"
onClick={() => {
enqueueExampleToast({ children: `Notification ${count}` });
@@ -31,16 +42,16 @@ export const ToastControls = ({ onClose }: ToastControlsProps) => {
}}
>
Add notification
- </button>
- <button
+ </Button>
+ <Button
type="button"
onClick={() =>
enqueueExampleToast({ children: 'Already saved', dedupeKey: 'saved' })
}
>
Add duplicate
- </button>
- <button
+ </Button>
+ <Button
type="button"
onClick={() =>
enqueueExampleToast({
@@ -51,14 +62,24 @@ export const ToastControls = ({ onClose }: ToastControlsProps) => {
}
>
Add timed notification
- </button>
- <button type="button" onClick={() => closeToast(toastId)}>
+ </Button>
+ <Button type="button" onClick={() => closeToast(toastId)}>
Close last notification
- </button>
- <button type="button" onClick={() => closeToast()}>
+ </Button>
+ <Button type="button" onClick={() => closeToast()}>
Close all notifications
- </button>
- <span aria-label="Last notification ID">{toastId}</span>
+ </Button>
+ <Button
+ type="button"
+ onClick={() =>
+ updateToast({ id: toastId, children: 'Updated notification' })
+ }
+ >
+ Update last notification
+ </Button>
+ <Text role="note" aria-label="Last notification ID">
+ {toastId}
+ </Text>
</div>
);
};
diff --git a/packages/twenty-ui/src/components/feedback/Toaster/__stories__/ToastUpdateControls.tsx b/packages/twenty-ui/src/components/feedback/Toaster/__stories__/ToastUpdateControls.tsx
new file mode 100644
index 00000000000..ccb2bf91dc1
--- /dev/null
+++ b/packages/twenty-ui/src/components/feedback/Toaster/__stories__/ToastUpdateControls.tsx
@@ -0,0 +1,162 @@
+import { useState } from 'react';
+
+import { useToast } from '@ui/components/feedback/Toast/hooks/useToast';
+import { IconBell, IconSquareRoundedCheck } from '@ui/icon';
+import { Button } from '@ui/primitives/input/Button/Button';
+import { Text } from '@ui/primitives/typography/Text/Text';
+
+import { type ToasterUpdateExampleProps } from './ToasterUpdateExampleProps';
+
+export const ToastUpdateControls = ({
+ onAction,
+ onCancel,
+ onClose,
+ onUpdatedAction,
+ onUpdatedCancel,
+ onUpdatedClose,
+}: ToasterUpdateExampleProps) => {
+ const { enqueueToast, updateToast, closeToast } = useToast();
+ const [toastId, setToastId] = useState('');
+ const [revision, setRevision] = useState(1);
+
+ return (
+ <div
+ style={{
+ display: 'flex',
+ gap: 8,
+ flexWrap: 'wrap',
+ backgroundColor: 'var(--t-background-primary)',
+ color: 'var(--t-font-color-primary)',
+ }}
+ >
+ <Button
+ onClick={() =>
+ setToastId(
+ enqueueToast({
+ children: <strong>Draft notification</strong>,
+ description: <span>Editing the draft</span>,
+ status: 'info',
+ progress: 25,
+ icon: <IconBell aria-label="Draft notification icon" />,
+ iconLabel: 'Default feedback icon',
+ action: <Button onClick={onAction}>Open draft</Button>,
+ cancelLabel: <span>Cancel draft</span>,
+ closeLabel: 'Dismiss draft',
+ onCancel,
+ onClose,
+ }),
+ )
+ }
+ >
+ Add editable notification
+ </Button>
+ <Button
+ onClick={() =>
+ enqueueToast({ children: 'Following notification', progress: 100 })
+ }
+ >
+ Add following notification
+ </Button>
+ <Button
+ onClick={() => {
+ updateToast({
+ id: toastId,
+ children: <strong>{`Draft update ${revision}`}</strong>,
+ });
+ setRevision(revision + 1);
+ }}
+ >
+ Update content
+ </Button>
+ <Button
+ onClick={() =>
+ updateToast({
+ id: toastId,
+ children: <strong>Saved notification</strong>,
+ description: <span>Synced with the workspace</span>,
+ status: 'success',
+ progress: 100,
+ icon: (
+ <IconSquareRoundedCheck aria-label="Saved notification icon" />
+ ),
+ action: (
+ <Button onClick={onUpdatedAction}>Open saved record</Button>
+ ),
+ cancelLabel: <span>Revert save</span>,
+ closeLabel: 'Dismiss saved record',
+ onCancel: onUpdatedCancel,
+ onClose: onUpdatedClose,
+ })
+ }
+ >
+ Update actions
+ </Button>
+ <Button onClick={() => updateToast({ id: toastId, cancelLabel: null })}>
+ Clear cancel label
+ </Button>
+ <Button
+ onClick={() =>
+ updateToast({
+ id: toastId,
+ description: null,
+ icon: null,
+ action: null,
+ cancelLabel: null,
+ onCancel: undefined,
+ onClose: undefined,
+ })
+ }
+ >
+ Clear optional content
+ </Button>
+ <Button
+ onClick={() =>
+ updateToast({
+ id: toastId,
+ status: undefined,
+ icon: undefined,
+ cancelLabel: undefined,
+ closeLabel: undefined,
+ onCancel: onUpdatedCancel,
+ })
+ }
+ >
+ Restore defaults
+ </Button>
+ <Button
+ onClick={() =>
+ updateToast({
+ id: 'missing-notification',
+ children: 'Unexpected notification',
+ })
+ }
+ >
+ Update unknown notification
+ </Button>
+ <Button
+ onClick={() => {
+ closeToast(toastId);
+ updateToast({
+ id: toastId,
+ children: 'Dismissed notification updated',
+ });
+ }}
+ >
+ Dismiss and update notification
+ </Button>
+ <Button
+ onClick={() =>
+ updateToast({
+ id: toastId,
+ children: 'Dismissed notification updated',
+ })
+ }
+ >
+ Update dismissed notification
+ </Button>
+ <Text role="note" aria-label="Editable notification ID">
+ {toastId}
+ </Text>
+ </div>
+ );
+};
diff --git a/packages/twenty-ui/src/components/feedback/Toaster/__stories__/Toaster.stories.tsx b/packages/twenty-ui/src/components/feedback/Toaster/__stories__/Toaster.stories.tsx
index b3d3c21134b..c6d66d1d6c9 100644
--- a/packages/twenty-ui/src/components/feedback/Toaster/__stories__/Toaster.stories.tsx
+++ b/packages/twenty-ui/src/components/feedback/Toaster/__stories__/Toaster.stories.tsx
@@ -3,6 +3,8 @@ import { StrictMode, useState } from 'react';
import { expect, fn, userEvent, waitFor, within } from 'storybook/test';
import { ToastProvider } from '@ui/components/feedback/Toast/ToastProvider';
+import { Button } from '@ui/primitives/input/Button/Button';
+import { DirectionProvider } from '@ui/primitives/layout/DirectionProvider/DirectionProvider';
import { ComponentDecorator } from '@ui/testing';
import { ThemeProvider } from '@ui/theme/ThemeProvider';
@@ -10,8 +12,10 @@ import { Toaster } from '../Toaster';
import { ToastControls } from './ToastControls';
import { ToasterExample } from './ToasterExample';
import { type ToasterExampleProps } from './ToasterExampleProps';
+import { ToasterUpdateExample } from './ToasterUpdateExample';
+import { type ToasterUpdateExampleProps } from './ToasterUpdateExampleProps';
-const meta: Meta<typeof ToasterExample> = {
+const meta: Meta<ToasterUpdateExampleProps> = {
id: 'ui-feedback-toaster',
title: 'UI/Components/Feedback/Toaster',
component: ToasterExample,
@@ -19,7 +23,7 @@ const meta: Meta<typeof ToasterExample> = {
};
export default meta;
-type Story = StoryObj<typeof ToasterExample>;
+type Story = StoryObj<ToasterUpdateExampleProps>;
const isMotionEnabled = () =>
!window.matchMedia('(prefers-reduced-motion: reduce)').matches;
@@ -166,9 +170,9 @@ const RemountingToaster = ({ onClose }: ToasterExampleProps) => {
return (
<ToastProvider>
<ToastControls onClose={onClose} />
- <button type="button" onClick={() => setScreen('workspace')}>
+ <Button type="button" onClick={() => setScreen('workspace')}>
Enter workspace
- </button>
+ </Button>
<Toaster key={screen} aria-label={`${screen} notifications`} />
</ToastProvider>
);
@@ -236,9 +240,9 @@ const DeferredToaster = () => {
return (
<ToastProvider>
<ToastControls />
- <button type="button" onClick={() => setIsAttached(true)}>
+ <Button type="button" onClick={() => setIsAttached(true)}>
Attach viewport
- </button>
+ </Button>
{isAttached && <div ref={setContainer} data-testid="toast-container" />}
<Toaster container={container} />
</ToastProvider>
@@ -354,6 +358,15 @@ export const ProviderIsolation: Story = {
expect(firstToaster.getByRole('status')).toBeVisible();
expect(secondToaster.getByRole('status')).toBeVisible();
});
+ await userEvent.click(
+ first.getByRole('button', { name: 'Update last notification' }),
+ );
+ expect(firstToaster.getByRole('status')).toHaveTextContent(
+ 'Updated notification',
+ );
+ expect(secondToaster.getByRole('status')).toHaveTextContent(
+ 'Notification 1',
+ );
await userEvent.click(
first.getByRole('button', { name: 'Close all notifications' }),
);
@@ -454,3 +467,291 @@ export const ReopenDuringExit: Story = {
expect(args.onClose).toHaveBeenCalledOnce();
},
};
+
+export const UpdatesInPlace: Story = {
+ ...Default,
+ args: { onAction: fn(), onCancel: fn(), onClose: fn() },
+ render: (args) => <ToasterUpdateExample {...args} />,
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement);
+ const body = within(canvasElement.ownerDocument.body);
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Add editable notification' }),
+ );
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Add following notification' }),
+ );
+ const notifications = body.getAllByRole('status');
+ const first = notifications[0]!;
+ const following = notifications[1]!;
+ const id = canvas.getByLabelText('Editable notification ID').textContent;
+ expect(first.id).toBe(id);
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Update content' }),
+ );
+ expect(body.getAllByRole('status')).toHaveLength(2);
+ expect(body.getAllByRole('status')[0]).toBe(first);
+ expect(body.getAllByRole('status')[1]).toBe(following);
+ expect(first).toHaveTextContent('Draft update 1');
+ expect(first).toHaveTextContent('Editing the draft');
+ expect(
+ within(first).getByRole('button', { name: 'Open draft' }),
+ ).toBeVisible();
+ expect(
+ within(first).getByRole('progressbar', { hidden: true }),
+ ).toHaveAttribute('aria-valuenow', '25');
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Update content' }),
+ );
+ expect(body.getAllByRole('status')).toHaveLength(2);
+ expect(body.getAllByRole('status')[0]).toBe(first);
+ expect(body.getAllByRole('status')[1]).toBe(following);
+ expect(first.id).toBe(id);
+ expect(first).toHaveTextContent('Draft update 2');
+ await userEvent.click(
+ within(first).getByRole('button', { name: 'Open draft' }),
+ );
+ await userEvent.click(
+ within(first).getByRole('button', { name: 'Cancel draft' }),
+ );
+ expect(args.onAction).toHaveBeenCalledOnce();
+ expect(args.onCancel).toHaveBeenCalledOnce();
+ expect(args.onClose).not.toHaveBeenCalled();
+ },
+};
+
+export const UpdatesDocumentation: Story = {
+ decorators: Default.decorators,
+ parameters: Default.parameters,
+ render: (args) => <ToasterUpdateExample {...args} />,
+};
+
+export const UpdatedActions: Story = {
+ ...UpdatesInPlace,
+ args: {
+ onAction: fn(),
+ onCancel: fn(),
+ onClose: fn(),
+ onUpdatedAction: fn(),
+ onUpdatedCancel: fn(),
+ onUpdatedClose: fn(),
+ },
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement);
+ const body = within(canvasElement.ownerDocument.body);
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Add editable notification' }),
+ );
+ const toast = body.getByRole('status');
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Update actions' }),
+ );
+ expect(body.getByRole('status')).toBe(toast);
+ expect(toast).toHaveTextContent('Saved notification');
+ expect(toast).toHaveTextContent('Synced with the workspace');
+ await waitFor(() =>
+ expect(
+ within(toast).getByLabelText('Saved notification icon'),
+ ).toBeVisible(),
+ );
+ expect(
+ within(toast).getByRole('progressbar', { hidden: true }),
+ ).toHaveAttribute('aria-valuenow', '100');
+ expect(
+ within(toast).queryByRole('button', { name: 'Open draft' }),
+ ).not.toBeInTheDocument();
+ await userEvent.click(
+ within(toast).getByRole('button', { name: 'Open saved record' }),
+ );
+ await userEvent.click(
+ within(toast).getByRole('button', { name: 'Revert save' }),
+ );
+ await userEvent.click(
+ within(toast).getByRole('button', { name: 'Dismiss saved record' }),
+ );
+ expect(args.onUpdatedAction).toHaveBeenCalledOnce();
+ expect(args.onUpdatedCancel).toHaveBeenCalledOnce();
+ expect(args.onUpdatedClose).toHaveBeenCalledOnce();
+ expect(args.onAction).not.toHaveBeenCalled();
+ expect(args.onCancel).not.toHaveBeenCalled();
+ expect(args.onClose).not.toHaveBeenCalled();
+ await waitFor(() => expect(toast).not.toBeInTheDocument());
+ },
+};
+
+export const ClearUpdatedContent: Story = {
+ ...UpdatedActions,
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement);
+ const body = within(canvasElement.ownerDocument.body);
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Add editable notification' }),
+ );
+ const toast = body.getByRole('status');
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Update actions' }),
+ );
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Clear optional content' }),
+ );
+ expect(body.getByRole('status')).toBe(toast);
+ expect(toast).toHaveTextContent('Saved notification');
+ expect(
+ within(toast).queryByText('Synced with the workspace'),
+ ).not.toBeInTheDocument();
+ expect(
+ within(toast).queryByLabelText('Saved notification icon'),
+ ).not.toBeInTheDocument();
+ expect(
+ within(toast).queryByLabelText('Default feedback icon'),
+ ).not.toBeInTheDocument();
+ expect(
+ within(toast).queryByRole('button', { name: 'Open saved record' }),
+ ).not.toBeInTheDocument();
+ expect(
+ within(toast).queryByRole('button', { name: 'Revert save' }),
+ ).not.toBeInTheDocument();
+ await userEvent.click(
+ within(toast).getByRole('button', { name: 'Dismiss saved record' }),
+ );
+ expect(args.onUpdatedClose).not.toHaveBeenCalled();
+ expect(args.onClose).not.toHaveBeenCalled();
+ await waitFor(() => expect(toast).not.toBeInTheDocument());
+ },
+};
+
+export const ResetDefaults: Story = {
+ ...UpdatedActions,
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement);
+ const body = within(canvasElement.ownerDocument.body);
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Add editable notification' }),
+ );
+ const toast = body.getByRole('status');
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Update actions' }),
+ );
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Clear cancel label' }),
+ );
+ expect(
+ within(toast).queryByRole('button', { name: 'Revert save' }),
+ ).not.toBeInTheDocument();
+ expect(args.onUpdatedCancel).not.toHaveBeenCalled();
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Clear optional content' }),
+ );
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Restore defaults' }),
+ );
+ expect(body.getByRole('status')).toBe(toast);
+ expect(toast).toHaveTextContent('Saved notification');
+ expect(within(toast).getByLabelText('Default feedback icon')).toBeVisible();
+ expect(within(toast).getByRole('button', { name: 'Close' })).toBeVisible();
+ await userEvent.click(
+ within(toast).getByRole('button', { name: 'Cancel' }),
+ );
+ expect(args.onUpdatedCancel).toHaveBeenCalledOnce();
+ expect(args.onCancel).not.toHaveBeenCalled();
+ },
+};
+
+export const StaleUpdates: Story = {
+ ...UpdatesInPlace,
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement);
+ const body = within(canvasElement.ownerDocument.body);
+ const unknownUpdate = canvas.getByRole('button', {
+ name: 'Update unknown notification',
+ });
+ await userEvent.click(unknownUpdate);
+ expect(body.queryByRole('status')).not.toBeInTheDocument();
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Add editable notification' }),
+ );
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Add following notification' }),
+ );
+ const toast = body.getAllByRole('status')[0]!;
+ const following = body.getAllByRole('status')[1]!;
+ const region = body.getByRole('region', { name: 'Notifications' });
+ await waitFor(() =>
+ expect(region.getAnimations({ subtree: true })).toHaveLength(0),
+ );
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Dismiss and update notification' }),
+ );
+ expect(toast).toHaveTextContent('Draft notification');
+ expect(args.onClose).toHaveBeenCalledOnce();
+ await waitFor(() => expect(toast).not.toBeInTheDocument());
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Update dismissed notification' }),
+ );
+ await userEvent.click(unknownUpdate);
+ expect(body.getAllByRole('status')).toHaveLength(1);
+ expect(body.getByRole('status')).toBe(following);
+ expect(
+ body.queryByText('Dismissed notification updated'),
+ ).not.toBeInTheDocument();
+ expect(body.queryByText('Unexpected notification')).not.toBeInTheDocument();
+ expect(args.onClose).toHaveBeenCalledOnce();
+ },
+};
+
+const nativeToasterRef = fn();
+const nativeToasterFocus = fn();
+const nativeNotificationFocus = fn();
+
+export const NativeComposition: Story = {
+ ...Default,
+ render: (args) => (
+ <ThemeProvider colorScheme="dark" applyToRoot={false}>
+ <DirectionProvider direction="rtl">
+ <ToastProvider>
+ <ToastControls onClose={args.onClose} />
+ <Toaster
+ aria-label="Composed notifications"
+ data-native-viewport
+ ref={nativeToasterRef}
+ render={<section onFocus={nativeToasterFocus} />}
+ getToastProps={() => ({
+ render: (
+ <section
+ data-native-notification
+ onFocus={nativeNotificationFocus}
+ />
+ ),
+ tabIndex: 0,
+ })}
+ />
+ </ToastProvider>
+ </DirectionProvider>
+ </ThemeProvider>
+ ),
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ const body = within(canvasElement.ownerDocument.body);
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Add notification' }),
+ );
+ const region = body.getByRole('region', { name: 'Composed notifications' });
+ const toast = within(region).getByRole('status');
+ expect(region.tagName).toBe('SECTION');
+ expect(region).toHaveAttribute('data-native-viewport');
+ expect(region).toHaveAttribute('dir', 'rtl');
+ expect(nativeToasterRef).toHaveBeenCalledWith(region);
+ expect(toast.tagName).toBe('SECTION');
+ expect(toast).toHaveAttribute('data-native-notification');
+ expect(toast).toHaveAttribute('tabindex', '0');
+ expect(toast.closest('.dark')).not.toBeNull();
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Update last notification' }),
+ );
+ expect(within(region).getByRole('status')).toBe(toast);
+ expect(toast).toHaveTextContent('Updated notification');
+ await userEvent.click(within(toast).getByText('Updated notification'));
+ expect(nativeNotificationFocus).toHaveBeenCalledOnce();
+ expect(nativeToasterFocus).toHaveBeenCalledOnce();
+ },
+};
diff --git a/packages/twenty-ui/src/components/feedback/Toaster/__stories__/ToasterUpdateExample.tsx b/packages/twenty-ui/src/components/feedback/Toaster/__stories__/ToasterUpdateExample.tsx
new file mode 100644
index 00000000000..0f09628a120
--- /dev/null
+++ b/packages/twenty-ui/src/components/feedback/Toaster/__stories__/ToasterUpdateExample.tsx
@@ -0,0 +1,12 @@
+import { ToastProvider } from '@ui/components/feedback/Toast/ToastProvider';
+
+import { Toaster } from '../Toaster';
+import { ToastUpdateControls } from './ToastUpdateControls';
+import { type ToasterUpdateExampleProps } from './ToasterUpdateExampleProps';
+
+export const ToasterUpdateExample = (props: ToasterUpdateExampleProps) => (
+ <ToastProvider>
+ <ToastUpdateControls {...props} />
+ <Toaster />
+ </ToastProvider>
+);
diff --git a/packages/twenty-ui/src/components/feedback/Toaster/__stories__/ToasterUpdateExampleProps.ts b/packages/twenty-ui/src/components/feedback/Toaster/__stories__/ToasterUpdateExampleProps.ts
new file mode 100644
index 00000000000..56032b28b48
--- /dev/null
+++ b/packages/twenty-ui/src/components/feedback/Toaster/__stories__/ToasterUpdateExampleProps.ts
@@ -0,0 +1,9 @@
+import { type ToasterExampleProps } from './ToasterExampleProps';
+
+export type ToasterUpdateExampleProps = ToasterExampleProps & {
+ onAction?: () => void;
+ onCancel?: () => void;
+ onUpdatedAction?: () => void;
+ onUpdatedCancel?: () => void;
+ onUpdatedClose?: () => void;
+};
diff --git a/packages/twenty-ui/src/components/feedback/index.ts b/packages/twenty-ui/src/components/feedback/index.ts
index 9ea31542ba9..ad6381b5688 100644
--- a/packages/twenty-ui/src/components/feedback/index.ts
+++ b/packages/twenty-ui/src/components/feedback/index.ts
@@ -24,6 +24,7 @@ export type { ToastNotification } from './Toast/types/ToastNotification';
export type { ToastOptions } from './Toast/types/ToastOptions';
export type { ToastProps } from './Toast/types/ToastProps';
export type { ToastProviderProps } from './Toast/types/ToastProviderProps';
-export type { ToastVariant } from './Toast/types/ToastVariant';
+export type { ToastStatus } from './Toast/types/ToastStatus';
+export type { ToastUpdate } from './Toast/types/ToastUpdate';
export { Toaster } from './Toaster/Toaster';
export type { ToasterProps } from './Toaster/types/ToasterProps';