mirror of
https://github.com/penpot/penpot.git
synced 2026-03-22 10:23:43 +00:00
✨ Open create org modal in Nitrate
This commit is contained in:
@@ -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")))
|
||||
|
||||
@@ -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)}
|
||||
|
||||
@@ -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?)
|
||||
|
||||
Reference in New Issue
Block a user