diff --git a/frontend/src/app/main/ui/dashboard/sidebar.cljs b/frontend/src/app/main/ui/dashboard/sidebar.cljs index def4b2e252..0adb11a74c 100644 --- a/frontend/src/app/main/ui/dashboard/sidebar.cljs +++ b/frontend/src/app/main/ui/dashboard/sidebar.cljs @@ -280,8 +280,8 @@ (mf/defc teams-selector-dropdown* {::mf/private true} - [{:keys [team profile teams show-default-team allow-create] :rest props}] - (let [on-create-click + [{:keys [team profile teams show-default-team allow-create-teams allow-create-org] :rest props}] + (let [on-create-team-click (mf/use-fn #(st/emit! (modal/show :team-form {}))) on-team-click @@ -290,7 +290,13 @@ (let [team-id (-> (dom/get-current-target event) (dom/get-data "value") (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 @@ -323,12 +329,19 @@ (when (= (:id team-item) (:id team)) tick-icon)]) - (when allow-create + (when allow-create-teams [: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)} [: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/private true} @@ -542,7 +555,8 @@ :profile profile :teams teams :show-default-team false - :allow-create false}]])) + :allow-create-teams false + :allow-create-org true}]])) (mf/defc sidebar-team-switch* [{:keys [team profile]}] @@ -660,7 +674,8 @@ :profile profile :teams teams :show-default-team true - :allow-create true}] + :allow-create-teams true + :allow-create-org false}] [:> team-options-dropdown* {:show show-team-options-menu? :on-close close-team-options-menu diff --git a/frontend/translations/en.po b/frontend/translations/en.po index 775deb2de8..c4ece59fcd 100644 --- a/frontend/translations/en.po +++ b/frontend/translations/en.po @@ -421,6 +421,9 @@ msgstr "(copy)" msgid "dashboard.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 msgid "dashboard.create-version-menu" msgstr "Pin this version" diff --git a/frontend/translations/es.po b/frontend/translations/es.po index c0ed714dad..cf8b600acc 100644 --- a/frontend/translations/es.po +++ b/frontend/translations/es.po @@ -430,6 +430,9 @@ msgstr "(copia)" msgid "dashboard.create-new-team" msgstr "Crear nuevo equipo" +msgid "dashboard.create-new-org" +msgstr "Crear nueva organización" + #: src/app/main/ui/workspace/main_menu.cljs:664 msgid "dashboard.create-version-menu" msgstr "Guardar esta versión"