From e106f66ac639e5450e91a03e3c229ddf925d118d Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Tue, 14 Jan 2025 15:50:58 +0100 Subject: [PATCH] :sparkles: Keep plugin url when user is not logged --- frontend/src/app/main/ui/dashboard.cljs | 7 ++++--- frontend/src/app/main/ui/routes.cljs | 7 +++++-- frontend/translations/en.po | 9 +++++++++ frontend/translations/es.po | 9 +++++++++ 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/main/ui/dashboard.cljs b/frontend/src/app/main/ui/dashboard.cljs index 2c1a33a0f..635cd13df 100644 --- a/frontend/src/app/main/ui/dashboard.cljs +++ b/frontend/src/app/main/ui/dashboard.cljs @@ -170,7 +170,7 @@ (let [data (with-meta {:project-id project-id - :name (dm/str "Try plugin: " (:name plugin))} + :name (dm/str (tr "dashboard.plugins.try-plugin") (:name plugin))} {:on-success (partial navegate-file! plugin)})] (-> (dd/create-file data) (with-meta {::ev/origin "plugin-try-out"}))))) @@ -207,9 +207,9 @@ (do (st/emit! (ptk/event ::ev/event {::ev/name "install-plugin" :name (:name plugin) :url plugin-url})) (open-permissions-dialog plugin)) - (st/emit! (notif/error "Cannot parser the plugin manifest")))) + (st/emit! (notif/error (tr "dashboard.plugins.parse-error"))))) (fn [_] - (st/emit! (notif/error "The plugin URL is incorrect"))))))))) + (st/emit! (notif/error (tr "dashboard.plugins.bad-url")))))))))) (defn use-templates-import [can-edit? template-url default-project-id] @@ -262,6 +262,7 @@ can-edit? (dm/get-in team [:permissions :can-edit]) template-url (or template-url (:template-url storage/session)) + plugin-url (or plugin-url (:plugin-url storage/session)) default-project (mf/with-memo [projects] diff --git a/frontend/src/app/main/ui/routes.cljs b/frontend/src/app/main/ui/routes.cljs index 68b9acd10..03fa26bb8 100644 --- a/frontend/src/app/main/ui/routes.cljs +++ b/frontend/src/app/main/ui/routes.cljs @@ -78,11 +78,14 @@ (defn- store-session-params - [{:keys [template]}] + [{:keys [template plugin]}] (binding [storage/*sync* true] (when (some? template) (swap! storage/session assoc - :template-url template)))) + :template-url template)) + (when (some? plugin) + (swap! storage/session assoc + :plugin-url plugin)))) (defn on-navigate [router path] diff --git a/frontend/translations/en.po b/frontend/translations/en.po index edb8c149c..87da87bba 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -6975,6 +6975,15 @@ msgstr "Import failed. The template URL is incorrect" msgid "dashboard.import.no-perms" msgstr "You don’t have permission to import to this team" +msgid "dashboard.plugins.try-plugin" +msgstr "Try plugin: " + +msgid "dashboard.plugins.parse-error" +msgstr "Cannot parser the plugin manifest" + +msgid "dashboard.plugins.bad-url" +msgstr "The plugin URL is incorrect" + msgid "labels.notifications" msgstr "Notifications" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index 33c030f30..569f3ab33 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -6932,6 +6932,15 @@ msgstr "La importación ha fallado. La URL de la plantilla es incorrecta" msgid "dashboard.import.no-perms" msgstr "No tienes permisos para importar en este equipo" +msgid "dashboard.plugins.try-plugin" +msgstr "Prueba la extensión: " + +msgid "dashboard.plugins.parse-error" +msgstr "No se puede analizar el manifiest de la extensión" + +msgid "dashboard.plugins.bad-url" +msgstr "La URL de la extensión es incorrecta" + msgid "labels.notifications" msgstr "Notificaciones"