fix instance property creation and single links

integration-tests
Josha von Gizycki 6 years ago
parent c8047eaa42
commit 32c373b5d6

@ -52,7 +52,8 @@
:attr_uuid (:uuid attribute) :attr_uuid (:uuid attribute)
:prop_uuid (neo4j/uuid) :prop_uuid (neo4j/uuid)
:value value :value value
:created_at now}])] :created_at now
:updated_at now}])]
(apply neo4j/exec-queries! (apply neo4j/exec-queries!
(concat [instance-tuple] (concat [instance-tuple]
prop-tuples)))) prop-tuples))))
@ -130,8 +131,7 @@
(neo4j/defquery create-link (neo4j/defquery create-link
"MATCH (i:instance {uuid:{from}}), "MATCH (i:instance {uuid:{from}}),
(u:user {uuid:{by}}), (u:user {uuid:{by}}),
(t:instance) (t:instance {uuid:{target}})
WHERE t.uuid = {target}
CREATE (l:link {uuid:{uuid}})-[:created_by]->(u) CREATE (l:link {uuid:{uuid}})-[:created_by]->(u)
SET l.created_at = {created_at}, SET l.created_at = {created_at},
l.name = {name} l.name = {name}

@ -11,6 +11,7 @@
:instances {:label "Instances" :instances {:label "Instances"
:widget :mselect :widget :mselect
:size (min 40 (count instances)) :size (min 40 (count instances))
:from-req #(if (vector? %) % [%])
:options (map #(vector (:name %) :options (map #(vector (:name %)
(:uuid %)) (:uuid %))
instances)}}}) instances)}}})

@ -63,7 +63,7 @@
render-fn (case type render-fn (case type
"date" #(str (prettify-dt %)) "date" #(str (prettify-dt %))
"markdown" md/md-to-html-string "markdown" md/md-to-html-string
:else #(str "<p>" % "</p>"))]] #(str "<p>" % "</p>"))]]
(list [:h3 (h (:name attr))] (list [:h3 (h (:name attr))]
[:div {:class (str "instance-content " [:div {:class (str "instance-content "
"attr-type-" type)} "attr-type-" type)}

Loading…
Cancel
Save