From 83e16453f15dbdef3a5b78580265ef7881a23d00 Mon Sep 17 00:00:00 2001 From: Allan Lasser Date: Tue, 26 Nov 2024 15:49:35 -0500 Subject: [PATCH] Removes toast from enhanced form handlers --- src/lib/components/forms/AddOnDispatch.svelte | 2 -- src/lib/components/forms/ConfirmDelete.svelte | 4 ---- src/lib/components/forms/ConfirmRedaction.svelte | 5 ----- src/lib/components/forms/UserFeedback.svelte | 5 ----- src/lib/components/forms/stories/UserFeedback.stories.svelte | 5 ----- 5 files changed, 21 deletions(-) diff --git a/src/lib/components/forms/AddOnDispatch.svelte b/src/lib/components/forms/AddOnDispatch.svelte index 6a2b7fc6c..8390898ed 100644 --- a/src/lib/components/forms/AddOnDispatch.svelte +++ b/src/lib/components/forms/AddOnDispatch.svelte @@ -30,7 +30,6 @@ import { autofield } from "../inputs/generator"; import { schedules } from "$lib/api/addons"; import { getCurrentUser } from "$lib/utils/permissions"; - import { toast } from "../layouts/Toaster.svelte"; export let properties: any = {}; export let required: string[] = []; @@ -110,7 +109,6 @@ const { type, data } = result; if (type === "success") { created = data.type === "event" ? data.event : data.run; - toast($_("addonDispatchDialog.success"), { status: "success" }); dispatch("dispatch", data); } update(result); diff --git a/src/lib/components/forms/ConfirmDelete.svelte b/src/lib/components/forms/ConfirmDelete.svelte index 51bb927f1..98c31d421 100644 --- a/src/lib/components/forms/ConfirmDelete.svelte +++ b/src/lib/components/forms/ConfirmDelete.svelte @@ -15,7 +15,6 @@ Confirm deletion or one or more documents. import { canonicalUrl, deleted } from "$lib/api/documents"; import { getCurrentUser } from "$lib/utils/permissions"; - import { toast } from "../layouts/Toaster.svelte"; const me = getCurrentUser(); @@ -43,9 +42,6 @@ Confirm deletion or one or more documents. return ({ result, update }) => { if (result.type === "success") { ids.forEach((d) => $deleted.add(String(d))); - toast($_("delete.success", { values: { n: count } }), { - status: "success", - }); dispatch("close"); } else { console.error(result); diff --git a/src/lib/components/forms/ConfirmRedaction.svelte b/src/lib/components/forms/ConfirmRedaction.svelte index df0edf8b7..7f84750c3 100644 --- a/src/lib/components/forms/ConfirmRedaction.svelte +++ b/src/lib/components/forms/ConfirmRedaction.svelte @@ -22,7 +22,6 @@ This almost certainly lives in a modal. redactions, } from "$lib/components/viewer/RedactionLayer.svelte"; import { canonicalUrl } from "$lib/api/documents"; - import { toast } from "../layouts/Toaster.svelte"; export let document: Document; @@ -40,16 +39,12 @@ This almost certainly lives in a modal. // `result` is an `ActionResult` object if (result.type === "failure") { error = result.data.error; - toast($_("redact.error") + `: ${error}`, { - status: "error", - }); } if (result.type === "success") { // need to invalidate before navigating await invalidate(`document:${document.id}`); $pending = result.data.redactions; - toast($_("redact.success"), { status: "success" }); goto("?mode=document"); dispatch("close"); } diff --git a/src/lib/components/forms/UserFeedback.svelte b/src/lib/components/forms/UserFeedback.svelte index a87f1a293..6912d3886 100644 --- a/src/lib/components/forms/UserFeedback.svelte +++ b/src/lib/components/forms/UserFeedback.svelte @@ -7,7 +7,6 @@ import Button from "../common/Button.svelte"; import Flex from "../common/Flex.svelte"; import Avatar from "../accounts/Avatar.svelte"; - import { toast } from "../layouts/Toaster.svelte"; import { APP_URL } from "@/config/config"; import { getUserName } from "$lib/api/accounts"; @@ -54,13 +53,9 @@ return async ({ result }) => { if (result.type === "success") { status = "success"; - toast($_("feedback.success"), { - status: "success", - }); dispatch("close"); } else if (result.type === "failure") { status = "error"; - toast(result.error, { status: "error" }); } }; } diff --git a/src/lib/components/forms/stories/UserFeedback.stories.svelte b/src/lib/components/forms/stories/UserFeedback.stories.svelte index c91f94ef4..4606896a6 100644 --- a/src/lib/components/forms/stories/UserFeedback.stories.svelte +++ b/src/lib/components/forms/stories/UserFeedback.stories.svelte @@ -3,7 +3,6 @@ import UserFeedbackForm from "../UserFeedback.svelte"; import { me } from "@/test/fixtures/accounts"; import { feedback } from "@/test/handlers/feedback"; - import Toaster from "../../layouts/Toaster.svelte"; export const meta = { title: "Forms / User Feedback", @@ -20,27 +19,23 @@
-
-
-
-