Skip to content

Commit 4fa38f0

Browse files
committed
fix(UI-1394): adjust toast error
1 parent 44d9d77 commit 4fa38f0

File tree

8 files changed

+16
-8
lines changed

8 files changed

+16
-8
lines changed
Lines changed: 1 addition & 0 deletions
Loading

src/assets/image/icons/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,5 @@ export { default as WebhookIcon } from "@assets/image/icons/Webhook.svg?react";
8686
export { default as MyOrganizationsIcon } from "@assets/image/icons/myOrganizations.svg?react";
8787
// Taken from: https://fontawesome.com/icons/chevron-down?f=classic&s=solid
8888
export { default as ChevronDownIcon } from "@assets/image/icons/ChevronDown.svg?react";
89+
// Taken from: https://tabler.io/icons/icon/file-arrow-right
90+
export { default as FileArrowRightIcon } from "@assets/image/icons/FileArrowRight.svg?react";

src/components/molecules/toast.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export const Toast = () => {
128128
className = "",
129129
hiddenCloseButton,
130130
customTitle,
131+
closeOnClick,
131132
},
132133
index
133134
) => {
@@ -154,14 +155,15 @@ export const Toast = () => {
154155
<div className="text-white">
155156
{customTitle ? customTitle : <p className={titleStyle(type)}>{title}</p>}
156157

157-
<button onClick={() => removeToast(id)}>{message}</button>
158+
<button onClick={() => closeOnClick && removeToast(id)}>{message}</button>
158159

159160
{type === "error" && !hideSystemLogLinkOnError ? (
160161
<Button
161162
className="cursor-pointer gap-1.5 p-0 font-medium text-error underline"
162-
onClick={() =>
163-
setSystemLogHeight(systemLogHeight > 0 ? systemLogHeight : 20)
164-
}
163+
onClick={() => {
164+
setSystemLogHeight(systemLogHeight > 0 ? systemLogHeight : 20);
165+
closeOnClick && removeToast(id);
166+
}}
165167
>
166168
{t("showMore")}
167169
<ExternalLinkIcon className="size-3.5 fill-error duration-200" />

src/components/organisms/topbar/project/manualRun/manualRunButtons.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export const ManualRunButtons = () => {
6767
hiddenCloseButton: true,
6868
className: "rounded-2xl p-0 border-2",
6969
customTitle: " ",
70+
closeOnClick: true,
7071
});
7172
setTimeout(() => {
7273
fetchDeployments(projectId, true);

src/components/organisms/topbar/project/manualRun/manualRunSettingsDrawer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export const ManualRunSettingsDrawer = () => {
8585
hiddenCloseButton: true,
8686
className: "rounded-2xl p-0 border-2",
8787
customTitle: " ",
88+
closeOnClick: true,
8889
});
8990
closeDrawer(DrawerName.projectManualRunSettings);
9091
};

src/components/organisms/topbar/project/manualRun/manualRunSuccessToastMessage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useNavigate } from "react-router-dom";
55

66
import { Button } from "@components/atoms";
77

8-
import { ExternalLinkIcon } from "@assets/image/icons";
8+
import { FileArrowRightIcon } from "@assets/image/icons";
99

1010
export const ManualRunSuccessToastMessage = ({
1111
deploymentId,
@@ -27,8 +27,8 @@ export const ManualRunSuccessToastMessage = ({
2727
>
2828
<div className="flex flex-col">
2929
<span className="font-semibold text-green-800">{t("executionSucceed")}</span>
30-
<Button className="flex items-center gap-1 p-0 text-green-800 underline">
31-
{t("viewSessionOutput")} <ExternalLinkIcon className="size-3 animate-bounce fill-green-800" />
30+
<Button className="mt-0.5 flex items-center gap-1 p-0 text-green-800 underline">
31+
{t("viewSessionOutput")} <FileArrowRightIcon className="size-4 animate-pulse stroke-green-800" />
3232
</Button>
3333
</div>
3434
</button>

src/interfaces/components/toast.interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface Toast {
88
className?: string;
99
hiddenCloseButton?: boolean;
1010
customTitle?: React.ReactNode | string;
11+
closeOnClick?: boolean;
1112
}
1213

1314
export type ToasterTypes = "error" | "info" | "success";

src/locales/en/deployments/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"executionFailed": "Session execution failed",
6060
"executionFailedExtended": "Session execution failed, projectID - {{projectId}}, error - {{error}}",
6161
"executionSucceed": "Session execution succeed",
62-
"viewSessionOutput": "View Session Output",
62+
"viewSessionOutput": "View session output",
6363
"missingActiveDeployment": "Missing last deployment",
6464
"missingnEntrypoint": "Missing entrypoint file or function",
6565
"useJsonEditor": "Use JSON editor"

0 commit comments

Comments
 (0)