|
|
|
@ -39,6 +39,14 @@
|
|
|
|
|
:from-req #(if (vector? %) % [%])}
|
|
|
|
|
:uuid {:widget :hidden}}})
|
|
|
|
|
|
|
|
|
|
(def schema-connections-form
|
|
|
|
|
{:fields {:connections {:label "Schemas"
|
|
|
|
|
:required false
|
|
|
|
|
:spec ::domain/assigned-to
|
|
|
|
|
:widget :mselect
|
|
|
|
|
:from-req #(if (vector? %) % [%])}
|
|
|
|
|
:uuid {:widget :hidden}}})
|
|
|
|
|
|
|
|
|
|
(defn overview! [req]
|
|
|
|
|
(let [session (:session req)
|
|
|
|
|
uuid (:uuid session)
|
|
|
|
@ -65,7 +73,7 @@
|
|
|
|
|
(form/render-widgets form {} req)
|
|
|
|
|
(hform/submit-button "Create"))])))
|
|
|
|
|
|
|
|
|
|
(defn show-schema! [schema attrs assign-form req]
|
|
|
|
|
(defn show-schema! [schema attrs assign-form conn-form req]
|
|
|
|
|
(view/layout!
|
|
|
|
|
:session (:session req)
|
|
|
|
|
:content
|
|
|
|
@ -77,7 +85,7 @@
|
|
|
|
|
(hform/submit-button "Edit"))
|
|
|
|
|
[:h2 "Permissions"]
|
|
|
|
|
[:h3 "Read permissions"]
|
|
|
|
|
(hform/form-to [:post (path :schema-assign)]
|
|
|
|
|
(hform/form-to [:post (path :schema-assign-users)]
|
|
|
|
|
(form/render-widgets assign-form
|
|
|
|
|
(assoc schema :assigned
|
|
|
|
|
(:assigned-read-users schema))
|
|
|
|
@ -85,13 +93,21 @@
|
|
|
|
|
(hform/hidden-field "permission" "read")
|
|
|
|
|
(hform/submit-button "Assign"))
|
|
|
|
|
[:h3 "Write permissions"]
|
|
|
|
|
(hform/form-to [:post (path :schema-assign)]
|
|
|
|
|
(hform/form-to [:post (path :schema-assign-users)]
|
|
|
|
|
(form/render-widgets assign-form
|
|
|
|
|
(assoc schema :assigned
|
|
|
|
|
(:assigned-write-users schema))
|
|
|
|
|
req)
|
|
|
|
|
(hform/hidden-field "permission" "write")
|
|
|
|
|
(hform/submit-button "Assign"))
|
|
|
|
|
[:h3 "Allowed schema connections"]
|
|
|
|
|
(hform/form-to [:post (path :schema-assign-schemas)]
|
|
|
|
|
(form/render-widgets conn-form
|
|
|
|
|
(assoc schema
|
|
|
|
|
:connections
|
|
|
|
|
(:assigned-schemas schema))
|
|
|
|
|
req)
|
|
|
|
|
(hform/submit-button "Assign"))
|
|
|
|
|
[:h2 "Attributes"]
|
|
|
|
|
[:ul.schema-attributes
|
|
|
|
|
(for [attr attrs]
|
|
|
|
|