add link adding to instance/show, add envs for neo4j connection

integration-tests
Josha von Gizycki 5 years ago
parent 59755dc041
commit 833347b198

@ -15,10 +15,15 @@
#"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" %)) #"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" %))
(def conn (def conn
(delay (db/connect (let [env #(or (System/getenv %1) %2)
"bolt://localhost:7687" port (env "NEO4J_PORT" "7687")
"neo4j" host (env "NEO4J_HOST" "localhost")
"b"))) user (env "NEO4J_USER" "neo4j")
pass (env "NEO4J_PASS" "b")]
(delay (db/connect
(str "bolt://" host ":" port)
user
pass))))
(defmacro defquery [& args] `(db/defquery ~@args)) (defmacro defquery [& args] `(db/defquery ~@args))

@ -45,7 +45,9 @@
:starred :starred
(domain/is-starred! uuid (domain/is-starred! uuid
user-uuid))] user-uuid))]
(view/show! instance req))) (view/show! instance
(domain-schema/accessible-schemas! user-uuid)
req)))
(defn form! [uuid attrs] (defn form! [uuid attrs]
(forms-inst/with-attributes attrs)) (forms-inst/with-attributes attrs))

@ -61,7 +61,7 @@
[:td (prettify-dt (:updated_at instance))] [:td (prettify-dt (:updated_at instance))]
[:td (prettify-dt (:created_at instance))]])]]])) [:td (prettify-dt (:created_at instance))]])]]]))
(defn show! [instance req] (defn show! [instance schemas req]
(view/layout! (view/layout!
:request req :request req
:content :content
@ -158,7 +158,16 @@
[:td [:a {:href (path :instance-list [:td [:a {:href (path :instance-list
{:schema-uuid (:uuid schema)})} {:schema-uuid (:uuid schema)})}
(h (:name schema))]] (h (:name schema))]]
[:td (prettify-dt (:created_at link))]])]]])])) [:td (prettify-dt (:created_at link))]])]]])
[:section.link-instance
[:h2 "Link Instance with Instance of Schema..."]
[:ul
(for [schema schemas]
[:li
[:a {:href (path :instance-link-selection
{:uuid (:uuid instance)
:schema-uuid (:uuid schema)})}
(h (:name schema))]])]]]))
(defn edit! [instance form form-data schemas req] (defn edit! [instance form form-data schemas req]
(view/layout! (view/layout!

Loading…
Cancel
Save