From c68a0d3967999503237fea17695f74ac4eebeca9 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 5 Dec 2024 13:15:46 +0100 Subject: [PATCH] :sparkles: Add autosaved versions warning --- .../main/ui/workspace/sidebar/versions.cljs | 14 ++++++++++++- .../main/ui/workspace/sidebar/versions.scss | 21 +++++++++++++++++++ frontend/translations/en.po | 7 +++++++ frontend/translations/es.po | 7 +++++++ 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/versions.cljs b/frontend/src/app/main/ui/workspace/sidebar/versions.cljs index b96e99924..f940022ca 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/versions.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/versions.cljs @@ -31,6 +31,8 @@ (def versions (l/derived :workspace-versions st/state)) +(def versions-stored-days 7) + (defn group-snapshots [data] (->> (concat @@ -388,4 +390,14 @@ :on-restore-snapshot handle-restore-version-snapshot :on-pin-snapshot handle-pin-version}] - nil))])])])) + nil))]) + + [:div {:class (stl/css :autosave-warning)} + [:div {:class (stl/css :autosave-warning-text)} + (tr "workspace.versions.warning.text" versions-stored-days)] + + [:div {:class (stl/css :autosave-warning-subtext)} + [:> i18n/tr-html* + {:tag-name "div" + :content (tr "workspace.versions.warning.subtext" + "mailto:support@penpot.app")}]]]])])) diff --git a/frontend/src/app/main/ui/workspace/sidebar/versions.scss b/frontend/src/app/main/ui/workspace/sidebar/versions.scss index a924ae31d..4ab415408 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/versions.scss +++ b/frontend/src/app/main/ui/workspace/sidebar/versions.scss @@ -230,3 +230,24 @@ .version-snapshot-menu-btn { visibility: hidden; } + +.autosave-warning { + display: flex; + flex-direction: column; + gap: $s-8; + padding: $s-16; +} + +.autosave-warning-text { + color: var(--color-foreground-primary); + font-size: $fs-12; + text-transform: uppercase; +} + +.autosave-warning-subtext { + color: var(--color-foreground-secondary); + font-size: $fs-12; + a { + color: var(--color-accent-primary); + } +} diff --git a/frontend/translations/en.po b/frontend/translations/en.po index f28d24983..a5e4a7e2d 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -6560,6 +6560,13 @@ msgstr "Loading..." msgid "workspace.versions.restore-warning" msgstr "Do you want to restore this version?" +msgid "workspace.versions.warning.text" +msgstr "Autosaved versions will be kept for %s days." + +#, markdown +msgid "workspace.versions.warning.subtext" +msgstr "If you'd like to increase this limit, write to us at [support@penpot.app](%s)" + #: src/app/main/ui/workspace/sidebar/versions.cljs:207 msgid "workspace.versions.snapshot-menu" msgstr "Open snapshot menu" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index c28bc92d5..cadaff917 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -6555,6 +6555,13 @@ msgstr "Cargando..." msgid "workspace.versions.restore-warning" msgstr "¿Quieres restaurar esta versión?" +msgid "workspace.versions.warning.text" +msgstr "Los autoguardados duran %s días." + +#, markdown +msgid "workspace.versions.warning.subtext" +msgstr "Si quieres aumentar este límite, contáctanos en [support@penpot.app](%s)" + #: src/app/main/ui/workspace/sidebar/versions.cljs:207 msgid "workspace.versions.snapshot-menu" msgstr "Abrir menu de versiones"