Open create org modal in Nitrate

This commit is contained in:
Juanfran
2026-03-20 12:30:15 +01:00
parent 02afd805ca
commit e53ff6d20b
3 changed files with 14 additions and 5 deletions

View File

@@ -29,6 +29,10 @@
(u/percent-encode (str organization-id)))]
(st/emit! (rt/nav-raw :href href)))))
(defn go-to-nitrate-cc-create-org
[]
(st/emit! (rt/nav-raw :href "/control-center/?action=create-org")))
(defn go-to-nitrate-billing
[]
(st/emit! (rt/nav-raw :href "/control-center/licenses/billing")))

View File

@@ -307,7 +307,7 @@
(mf/deps profile)
(fn []
(if (dnt/is-valid-license? profile)
(dnt/go-to-nitrate-cc)
(dnt/go-to-nitrate-cc-create-org)
(st/emit! (dnt/show-nitrate-popup :nitrate-form)))))
on-go-to-cc-click
@@ -595,7 +595,9 @@
(map team->org)
(d/index-by :id)))
no-orgs? (= (count orgs) 0)
;; There is always at least one default organization
;; so no-orgs? is true when only that default one exists (count <= 1).
no-orgs? (<= (count orgs) 1)
current-org (team->org team)
@@ -630,7 +632,7 @@
(mf/deps profile)
(fn []
(if (dnt/is-valid-license? profile)
(dnt/go-to-nitrate-cc)
(dnt/go-to-nitrate-cc-create-org)
(st/emit! (dnt/show-nitrate-popup :nitrate-form)))))]
(if no-orgs?
[:div {:class (stl/css :nitrate-selected-org)}

View File

@@ -135,7 +135,10 @@
handle-click
(mf/use-fn
(fn []
(st/emit! (dnt/show-nitrate-popup :nitrate-form))))]
(st/emit! (dnt/show-nitrate-popup :nitrate-form))))
handle-go-to-cc
(mf/use-fn dnt/go-to-nitrate-cc-create-org)]
;; TODO add translations for this texts when we have the definitive ones
(if (and nitrate? no-orgs-created?)
@@ -148,7 +151,7 @@
[:> button* {:variant "primary"
:type "button"
:class (stl/css :nitrate-bottom-button)
:on-click dnt/go-to-nitrate-cc} "CREATE ORGANIZATION"]]]
:on-click handle-go-to-cc} "CREATE ORGANIZATION"]]]
;; Banner for users without nitrate license
(when (not nitrate?)