From 19b9b3cbd96cbc21d9594de8c82f0e52d27fa162 Mon Sep 17 00:00:00 2001 From: AzazelN28 Date: Fri, 22 Nov 2024 13:31:17 +0100 Subject: [PATCH] :bug: Fix missing main menu entry version history --- .../src/app/main/ui/workspace/main_menu.cljs | 26 +++++++++++++++++-- frontend/translations/en.po | 4 +++ frontend/translations/es.po | 4 +++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/main_menu.cljs b/frontend/src/app/main/ui/workspace/main_menu.cljs index 08af2ff30..6d01606fc 100644 --- a/frontend/src/app/main/ui/workspace/main_menu.cljs +++ b/frontend/src/app/main/ui/workspace/main_menu.cljs @@ -524,6 +524,19 @@ (when (kbd/enter? event) (on-add-shared event)))) + on-show-version-history + (mf/use-fn + (mf/deps file-id) + (fn [_] + (st/emit! (dw/toggle-layout-flag :document-history)))) + + on-show-version-history-key-down + (mf/use-fn + (mf/deps on-show-version-history) + (fn [event] + (when (kbd/enter? event) + (on-show-version-history event)))) + on-export-shapes (mf/use-fn #(st/emit! (de/show-workspace-export-dialog {:origin "workspace:menu"}))) @@ -575,14 +588,23 @@ :on-click on-remove-shared :on-key-down on-remove-shared-key-down :id "file-menu-remove-shared"} - [:span {:class (stl/css :item-name)} (tr "dashboard.unpublish-shared")]]) + [:span {:class (stl/css :item-name)} + (tr "dashboard.unpublish-shared")]]) (when can-edit [:> dropdown-menu-item* {:class (stl/css :submenu-item) :on-click on-add-shared :on-key-down on-add-shared-key-down :id "file-menu-add-shared"} - [:span {:class (stl/css :item-name)} (tr "dashboard.add-shared")]])) + [:span {:class (stl/css :item-name)} + (tr "dashboard.add-shared")]])) + + [:> dropdown-menu-item* {:class (stl/css :submenu-item) + :on-click on-show-version-history + :on-key-down on-show-version-history-key-down + :id "file-menu-show-version-history"} + [:span {:class (stl/css :item-name)} + (tr "dashboard.show-version-history")]] [:> dropdown-menu-item* {:class (stl/css :submenu-item) :on-click on-export-shapes diff --git a/frontend/translations/en.po b/frontend/translations/en.po index 0f46d1bca..3b7441229 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -396,6 +396,10 @@ msgstr "The token has no expiration date" msgid "dashboard.add-shared" msgstr "Add as Shared Library" +#: src/app/main/ui/workspace/main_menu.cljs:607 +msgid "dashboard.show-version-history" +msgstr "Version history" + #: src/app/main/ui/settings/profile.cljs:72 msgid "dashboard.change-email" msgstr "Change email" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index bfa886662..0c09c0a44 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -398,6 +398,10 @@ msgstr "El token no tiene fecha de expiración" msgid "dashboard.add-shared" msgstr "Añadir como Biblioteca Compartida" +#: src/app/main/ui/workspace/main_menu.cljs:607 +msgid "dashboard.show-version-history" +msgstr "Histórico de versiones" + #: src/app/main/ui/settings/profile.cljs:72 msgid "dashboard.change-email" msgstr "Cambiar correo"