From 9645ffba40dd4772c1eebf3308fae639f48733aa Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Thu, 29 Feb 2024 16:12:47 +0100 Subject: [PATCH] :bug: Fix upload image alert message --- frontend/src/app/main/data/media.cljs | 1 + frontend/src/app/main/data/workspace/media.cljs | 2 ++ frontend/src/app/main/errors.cljs | 5 +++++ frontend/src/app/main/ui/messages.cljs | 5 ++++- .../src/app/main/ui/notifications/toast_notification.scss | 8 ++++---- frontend/src/app/main/ui/viewer/share_link.cljs | 1 + 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/main/data/media.cljs b/frontend/src/app/main/data/media.cljs index bb1a82e39..e78892bb1 100644 --- a/frontend/src/app/main/data/media.cljs +++ b/frontend/src/app/main/data/media.cljs @@ -47,6 +47,7 @@ (defn notify-start-loading [] (st/emit! (msg/show {:content (tr "media.loading") + :notification-type :toast :type :info :timeout nil}))) diff --git a/frontend/src/app/main/data/workspace/media.cljs b/frontend/src/app/main/data/workspace/media.cljs index 3dc6c8d7a..693207d87 100644 --- a/frontend/src/app/main/data/workspace/media.cljs +++ b/frontend/src/app/main/data/workspace/media.cljs @@ -211,6 +211,7 @@ (watch [_ _ _] (rx/concat (rx/of (msg/show {:content (tr "media.loading") + :notification-type :toast :type :info :timeout nil :tag :media-loading})) @@ -440,6 +441,7 @@ (rx/concat (rx/of (msg/show {:content (tr "media.loading") + :notification-type :toast :type :info :timeout nil :tag :media-loading})) diff --git a/frontend/src/app/main/errors.cljs b/frontend/src/app/main/errors.cljs index a16bd93f0..542b41bce 100644 --- a/frontend/src/app/main/errors.cljs +++ b/frontend/src/app/main/errors.cljs @@ -124,6 +124,7 @@ (let [message (tr "errors.paste-data-validation")] (st/async-emit! (msg/show {:content message + :notification-type :toast :type :error :timeout 3000}))) @@ -138,6 +139,7 @@ [error] (ts/schedule #(st/emit! (msg/show {:content "Internal Assertion Error" + :notification-type :toast :type :error :timeout 3000}))) @@ -153,6 +155,7 @@ (ts/schedule #(st/emit! (msg/show {:content "Something wrong has happened (on worker)." + :notification-type :toast :type :error :timeout 3000}))) @@ -166,6 +169,7 @@ [_] (ts/schedule #(st/emit! (msg/show {:content "SVG is invalid or malformed" + :notification-type :toast :type :error :timeout 3000})))) @@ -174,6 +178,7 @@ [_] (ts/schedule #(st/emit! (msg/show {:content "There was an error with the comment" + :notification-type :toast :type :error :timeout 3000})))) diff --git a/frontend/src/app/main/ui/messages.cljs b/frontend/src/app/main/ui/messages.cljs index 56c481fb2..00df9c3f3 100644 --- a/frontend/src/app/main/ui/messages.cljs +++ b/frontend/src/app/main/ui/messages.cljs @@ -33,6 +33,7 @@ :links (:links message) :content (:content message)} + is-context-msg (and (nil? (:timeout message)) (nil? (:actions message))) is-toast-msg (or (= :toast (:notification-type message)) (some? (:timeout message))) is-inline-msg (or (= :inline (:notification-type message)) (and (some? (:position message)) (= :floating (:position message))))] @@ -42,5 +43,7 @@ [:& toast-notification toast-message] is-inline-msg [:& inline-notification inline-message] + is-context-msg + [:& context-notification context-message] :else - [:& context-notification context-message])))) + [:& toast-notification toast-message])))) diff --git a/frontend/src/app/main/ui/notifications/toast_notification.scss b/frontend/src/app/main/ui/notifications/toast_notification.scss index dfa67bc1e..6626fc119 100644 --- a/frontend/src/app/main/ui/notifications/toast_notification.scss +++ b/frontend/src/app/main/ui/notifications/toast_notification.scss @@ -44,10 +44,10 @@ } .info { - --bg-color: var(--alert-background-color-info); - --fg-color: var(--alert-text-foreground-color-info); - --icon-color: var(--alert-icon-foreground-color-info); - --border-color: var(--alert-border-color-info); + --toast-notification-bg-color: var(--alert-background-color-info); + --toast-notification-fg-color: var(--alert-text-foreground-color-info); + --toast-notification-icon-color: var(--alert-icon-foreground-color-info); + --toast-notification-border-color: var(--alert-border-color-info); } .default { diff --git a/frontend/src/app/main/ui/viewer/share_link.cljs b/frontend/src/app/main/ui/viewer/share_link.cljs index 8a7961a8b..a937eada3 100644 --- a/frontend/src/app/main/ui/viewer/share_link.cljs +++ b/frontend/src/app/main/ui/viewer/share_link.cljs @@ -135,6 +135,7 @@ (fn [_] (wapi/write-to-clipboard current-link) (st/emit! (msg/show {:type :info + :notification-type :toast :content (tr "common.share-link.link-copied-success") :timeout 1000})))