Add create org link

This commit is contained in:
Marina López
2025-12-09 10:28:28 +01:00
committed by Pablo Alba
parent 5d2a7a1b63
commit 936dd645f0
3 changed files with 29 additions and 8 deletions

View File

@@ -280,8 +280,8 @@
(mf/defc teams-selector-dropdown* (mf/defc teams-selector-dropdown*
{::mf/private true} {::mf/private true}
[{:keys [team profile teams show-default-team allow-create] :rest props}] [{:keys [team profile teams show-default-team allow-create-teams allow-create-org] :rest props}]
(let [on-create-click (let [on-create-team-click
(mf/use-fn #(st/emit! (modal/show :team-form {}))) (mf/use-fn #(st/emit! (modal/show :team-form {})))
on-team-click on-team-click
@@ -290,7 +290,13 @@
(let [team-id (-> (dom/get-current-target event) (let [team-id (-> (dom/get-current-target event)
(dom/get-data "value") (dom/get-data "value")
(uuid/parse))] (uuid/parse))]
(st/emit! (dcm/go-to-dashboard-recent :team-id team-id)))))] (st/emit! (dcm/go-to-dashboard-recent :team-id team-id)))))
on-create-org-click
(mf/use-fn
(fn []
;; TODO update when org creation route is ready
(dom/open-new-window "localhost:3000/org/create")))]
[:> dropdown-menu* props [:> dropdown-menu* props
@@ -323,12 +329,19 @@
(when (= (:id team-item) (:id team)) (when (= (:id team-item) (:id team))
tick-icon)]) tick-icon)])
(when allow-create (when allow-create-teams
[:hr {:role "separator" :class (stl/css :team-separator)}] [:hr {:role "separator" :class (stl/css :team-separator)}]
[:> dropdown-menu-item* {:on-click on-create-click [:> dropdown-menu-item* {:on-click on-create-team-click
:class (stl/css :team-dropdown-item :action)} :class (stl/css :team-dropdown-item :action)}
[:span {:class (stl/css :icon-wrapper)} add-icon] [:span {:class (stl/css :icon-wrapper)} add-icon]
[:span {:class (stl/css :team-text)} (tr "dashboard.create-new-team")]])])) [:span {:class (stl/css :team-text)} (tr "dashboard.create-new-team")]])
(when allow-create-org
[:hr {:role "separator" :class (stl/css :team-separator)}]
[:> dropdown-menu-item* {:on-click on-create-org-click
:class (stl/css :team-dropdown-item :action)}
[:span {:class (stl/css :icon-wrapper)} add-icon]
[:span {:class (stl/css :team-text)} (tr "dashboard.create-new-org")]])]))
(mf/defc team-options-dropdown* (mf/defc team-options-dropdown*
{::mf/private true} {::mf/private true}
@@ -542,7 +555,8 @@
:profile profile :profile profile
:teams teams :teams teams
:show-default-team false :show-default-team false
:allow-create false}]])) :allow-create-teams false
:allow-create-org true}]]))
(mf/defc sidebar-team-switch* (mf/defc sidebar-team-switch*
[{:keys [team profile]}] [{:keys [team profile]}]
@@ -660,7 +674,8 @@
:profile profile :profile profile
:teams teams :teams teams
:show-default-team true :show-default-team true
:allow-create true}] :allow-create-teams true
:allow-create-org false}]
[:> team-options-dropdown* {:show show-team-options-menu? [:> team-options-dropdown* {:show show-team-options-menu?
:on-close close-team-options-menu :on-close close-team-options-menu

View File

@@ -421,6 +421,9 @@ msgstr "(copy)"
msgid "dashboard.create-new-team" msgid "dashboard.create-new-team"
msgstr "Create new team" msgstr "Create new team"
msgid "dashboard.create-new-org"
msgstr "Create new org"
#: src/app/main/ui/workspace/main_menu.cljs:664 #: src/app/main/ui/workspace/main_menu.cljs:664
msgid "dashboard.create-version-menu" msgid "dashboard.create-version-menu"
msgstr "Pin this version" msgstr "Pin this version"

View File

@@ -430,6 +430,9 @@ msgstr "(copia)"
msgid "dashboard.create-new-team" msgid "dashboard.create-new-team"
msgstr "Crear nuevo equipo" msgstr "Crear nuevo equipo"
msgid "dashboard.create-new-org"
msgstr "Crear nueva organización"
#: src/app/main/ui/workspace/main_menu.cljs:664 #: src/app/main/ui/workspace/main_menu.cljs:664
msgid "dashboard.create-version-menu" msgid "dashboard.create-version-menu"
msgstr "Guardar esta versión" msgstr "Guardar esta versión"