From 975efd80cbc28b11d9c428b1c19a8a540ffaf7e8 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 22 Jul 2024 13:13:40 +0200 Subject: [PATCH] :sparkles: Add maintenance predefined notification --- frontend/src/app/main/data/common.cljs | 14 ++++++++++++++ frontend/translations/en.po | 4 ++++ frontend/translations/es.po | 4 ++++ 3 files changed, 22 insertions(+) diff --git a/frontend/src/app/main/data/common.cljs b/frontend/src/app/main/data/common.cljs index 4bab615e9..839dd5c29 100644 --- a/frontend/src/app/main/data/common.cljs +++ b/frontend/src/app/main/data/common.cljs @@ -13,6 +13,7 @@ [app.main.data.modal :as modal] [app.main.features :as features] [app.main.repo :as rp] + [app.main.store :as st] [app.util.i18n :refer [tr]] [beicon.v2.core :as rx] [potok.v2.core :as ptk])) @@ -58,6 +59,10 @@ [] (.reload js/location)) +(defn hide-notifications! + [] + (st/emit! msg/hide)) + (defn handle-notification [{:keys [message code level] :as params}] (ptk/reify ::show-notification @@ -75,6 +80,15 @@ :actions [{:label "Refresh" :callback force-reload!}] :tag :notification))) + :maintenance + (rx/of (msg/dialog + :content (tr "notifications.by-code.maintenance") + :controls :inline-actions + :type level + :actions [{:label (tr "labels.accept") + :callback hide-notifications!}] + :tag :notification)) + (rx/of (msg/dialog :content message :controls :close diff --git a/frontend/translations/en.po b/frontend/translations/en.po index 7a972067d..cc72e0264 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -2209,6 +2209,10 @@ msgstr "Update a component in a shared library" msgid "notifications.by-code.upgrade-version" msgstr "A new version is available, please refresh the page" +#: src/app/main/data/common.cljs +msgid "notifications.by-code.maintenance" +msgstr "Maintenance break: we will be down for a short maintenance within 5 minutes." + #: src/app/main/ui/dashboard/team.cljs msgid "notifications.invitation-email-sent" msgstr "Invitation sent successfully" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index 3b9bd101d..b511d8f65 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -2285,6 +2285,10 @@ msgstr "Actualizar un componente en biblioteca" msgid "notifications.by-code.upgrade-version" msgstr "Una nueva versión está disponible, por favor actualiza la página" +#: src/app/main/data/common.cljs +msgid "notifications.by-code.maintenance" +msgstr "Pausa de mantenimiento: en los próximos 5 minutos estaremos fuera de servicio por un breve mantenimiento." + #: src/app/main/ui/dashboard/team.cljs msgid "notifications.invitation-email-sent" msgstr "Invitación enviada con éxito"