+ {toasts.map(
+ ({
+ type,
+ id,
+ className,
+ customTitle,
+ closeOnClick,
+ message,
+ hideSystemLogLinkOnError,
+ hiddenCloseButton,
+ }) => {
+ const title = t(`titles.${type}`);
+ const ariaLabel = typeof message === "string" ? message : undefined;
+ const closeButtonToastTestId =
+ typeof message === "string" ? getTestIdFromText("toast-close-btn", message) : undefined;
+ const toastTestId = typeof message === "string" ? getTestIdFromText("toast", message) : undefined;
+
+ return (
+
handleMouseEnter(id)}
+ onMouseLeave={() => handleMouseLeave(id)}
+ ref={(el) => (toastRefs.current[id] = el)}
+ style={{
+ ...positions[id],
+ transition: "all 0.2s ease-out",
+ }}
+ transition={{ duration: 0.2 }}
>
-
-
{title}
- {message}
- {(type === "error" || type === "warning") && !hideSystemLogLinkOnError ? (
-
-
-
- );
- });
-
- return toasts.length ? renderToasts() : null;
+
+ );
+ }
+ )}
+
+ );
};
diff --git a/src/components/organisms/topbar/project/manualRun/manualRunButtons.tsx b/src/components/organisms/topbar/project/manualRun/manualRunButtons.tsx
index 7c1d417472..2c6788e428 100644
--- a/src/components/organisms/topbar/project/manualRun/manualRunButtons.tsx
+++ b/src/components/organisms/topbar/project/manualRun/manualRunButtons.tsx
@@ -119,14 +119,14 @@ export const ManualRunButtons = () => {
}
addToast({
- message: (
-
- ),
+ message:
,
type: "success",
+ position: "top-right",
+ offset: 50,
+ hiddenCloseButton: true,
+ className: "rounded-2xl p-0 border-2",
+ customTitle: " ",
+ closeOnClick: true,
});
setTimeout(() => {
diff --git a/src/components/organisms/topbar/project/manualRun/manualRunSettingsDrawer.tsx b/src/components/organisms/topbar/project/manualRun/manualRunSettingsDrawer.tsx
index 3c0b2fc885..48a352bae1 100644
--- a/src/components/organisms/topbar/project/manualRun/manualRunSettingsDrawer.tsx
+++ b/src/components/organisms/topbar/project/manualRun/manualRunSettingsDrawer.tsx
@@ -95,14 +95,14 @@ export const ManualRunSettingsDrawer = () => {
}
addToast({
- message: (
-
- ),
+ message:
,
type: "success",
+ position: "top-right",
+ offset: 50,
+ hiddenCloseButton: true,
+ className: "rounded-2xl p-0 border-2",
+ customTitle: " ",
+ closeOnClick: true,
});
if (projectId) {
closeDrawer(projectId, DrawerName.projectManualRunSettings);
diff --git a/src/components/organisms/topbar/project/manualRun/manualRunSuccessToastMessage.tsx b/src/components/organisms/topbar/project/manualRun/manualRunSuccessToastMessage.tsx
index af9b8d3933..b943efe4e1 100644
--- a/src/components/organisms/topbar/project/manualRun/manualRunSuccessToastMessage.tsx
+++ b/src/components/organisms/topbar/project/manualRun/manualRunSuccessToastMessage.tsx
@@ -4,36 +4,22 @@ import { useTranslation } from "react-i18next";
import { useNavigateWithSettings } from "@utilities";
-import { Button } from "@components/atoms";
-
-import { ExternalLinkIcon } from "@assets/image/icons";
-
-export const ManualRunSuccessToastMessage = ({
- deploymentId,
- projectId,
- sessionId,
-}: {
- deploymentId?: string;
- projectId?: string;
- sessionId?: string;
-}) => {
- const { t } = useTranslation("deployments", {
- keyPrefix: "history.manualRun",
- });
+import { FileArrowRightIcon } from "@assets/image/icons";
+export const ManualRunSuccessToastMessage = ({ projectId, sessionId }: { projectId?: string; sessionId?: string }) => {
+ const { t } = useTranslation("deployments", { keyPrefix: "history.manualRun" });
const navigateWithSettings = useNavigateWithSettings();
- const goToSession = () =>
- deploymentId
- ? navigateWithSettings(`/projects/${projectId}/deployments/${deploymentId}/sessions/${sessionId}`)
- : navigateWithSettings(`/projects/${projectId}/sessions/${sessionId}`);
return (
- <>
- {t("executionSucceed")}
-
- {t("showMore")}
-
-
- >
+
navigateWithSettings(`/projects/${projectId}/sessions/${sessionId}`)}
+ >
+ {t("executionSucceed")}
+
+ {t("viewSessionOutput")}
+
+
);
};
diff --git a/src/interfaces/components/toast.interface.ts b/src/interfaces/components/toast.interface.ts
index 032f8b9468..d5a5bb81fb 100644
--- a/src/interfaces/components/toast.interface.ts
+++ b/src/interfaces/components/toast.interface.ts
@@ -1,10 +1,16 @@
-import { ToasterTypes } from "@src/types/components";
+import { ToasterTypes, ToastPosition } from "@src/types/components";
export interface Toast {
id: string;
message: React.ReactNode;
type: ToasterTypes;
hideSystemLogLinkOnError?: boolean;
+ position?: ToastPosition;
+ offset?: number;
+ className?: string;
+ hiddenCloseButton?: boolean;
+ customTitle?: React.ReactNode | string;
+ closeOnClick?: boolean;
}
export interface ToastStore {
diff --git a/src/locales/en/deployments/translation.json b/src/locales/en/deployments/translation.json
index 12dfbc4d50..1576043d37 100644
--- a/src/locales/en/deployments/translation.json
+++ b/src/locales/en/deployments/translation.json
@@ -59,7 +59,7 @@
"executionFailed": "Session execution failed",
"executionFailedExtended": "Session execution failed, projectID - {{projectId}}, error - {{error}}",
"executionSucceed": "Session execution succeed",
- "showMore": "Show more",
+ "viewSessionOutput": "View session output",
"missingActiveDeployment": "Missing last deployment",
"missingnEntrypoint": "Missing entrypoint file or function",
"useJsonEditor": "Use JSON editor"
diff --git a/src/store/useToastStore.ts b/src/store/useToastStore.ts
index 61fc0daf10..65e7235de3 100644
--- a/src/store/useToastStore.ts
+++ b/src/store/useToastStore.ts
@@ -9,7 +9,16 @@ export const useToastStore = create
(
const id = Date.now().toString();
return set((state) => ({
- toasts: [...state.toasts, { ...toast, id }],
+ toasts: [
+ ...state.toasts,
+ {
+ ...toast,
+ id,
+ position: toast.position,
+ offset: toast.offset,
+ className: toast.className,
+ },
+ ],
}));
},
removeToast: (id) =>
diff --git a/src/types/components/index.ts b/src/types/components/index.ts
index 796611c623..8e6c9c3e3b 100644
--- a/src/types/components/index.ts
+++ b/src/types/components/index.ts
@@ -10,7 +10,7 @@ export type { SortableColumns } from "@type/components/tables";
export type { SessionStatsFilterType } from "@type/components/sessionStatsFilter.type";
export type { ApexChartItemType } from "@src/types/components/executionFlowActivitiesChart.type";
export type { GoogleIntegrationType } from "./googleIntegration.type";
-export type { ToasterTypes } from "@src/types/components/toasterTypes.type";
+export type { ToasterTypes, ToastPosition } from "@src/types/components/toasterTypes.type";
export type { LoaderColorType } from "./loader.type";
export type { LogType } from "@src/types/components/log.type";
export type { ProjectActionType, MetadataResult } from "@src/types/components/projectActions.type";
diff --git a/src/types/components/toasterTypes.type.ts b/src/types/components/toasterTypes.type.ts
index cb74353fe0..b616ca801f 100644
--- a/src/types/components/toasterTypes.type.ts
+++ b/src/types/components/toasterTypes.type.ts
@@ -1 +1,3 @@
export type ToasterTypes = "error" | "info" | "success" | "warning";
+
+export type ToastPosition = "top-right" | "default";