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