show incoming links, make node in viz more visible

integration-tests
Josha von Gizycki 6 years ago
parent 5d1aec4aaf
commit b0c7055fa1

@ -67,8 +67,14 @@
[:div {:class (str "instance-content "
"attr-type-" type)}
(render-fn (:value prop))]))])
(when (or (seq (:links-out instance))
(seq (:links-in instance)))
[:section.visualisation
[:h2 "Visualisation"]
[:image {:src (path :instance-link-viz instance)
:alt "SVG Visualisation"}]])
(when (seq (:links-out instance))
[:section.links
[:section.links-out
[:h2 "Outgoing Links"]
[:table
[:thead
@ -90,12 +96,29 @@
{:schema-uuid (:uuid schema)})}
(h (:name schema))]]
[:td (prettify-dt (:created_at link))]])]]])
(when (or (seq (:links-out instance))
(seq (:links-in instance)))
[:section.visualisation
[:h2 "Visualisation"]
[:image {:src (path :instance-link-viz instance)
:alt "SVG Visualisation"}]])]))
(when (seq (:links-in instance))
[:section.links-in
[:h2 "Incoming Links"]
[:table
[:thead
[:tr
[:th "Name"]
[:th "Instance"]
[:th "Schema"]
[:th "Created"]]]
[:tbody
(for [{:keys [link source schema]} (:links-in instance)
:let [name (:name link)
empty (empty? name)
name (if empty [:i "empty"] (h name))]]
[:tr
[:td name]
[:td [:a {:href (path :instance-show source)}
(h (:name source))]]
[:td [:a {:href (path :instance-list
{:schema-uuid (:uuid schema)})}
(h (:name schema))]]
[:td (prettify-dt (:created_at link))]])]]])]))
(defn edit! [instance form form-data schemas req]
(view/layout!
@ -120,7 +143,7 @@
(anti-forgery-field)
(view/delete-btn))
(when (seq (:links-out instance))
[:section.links
[:section.links-out
[:h2 "Outgoing Links"]
[:table
[:thead

@ -18,7 +18,8 @@
[(:uuid source) :> (:uuid instance)
{:label (:name link)}])
(:links-in instance))]
(-> [[(:uuid instance) {:label (:name instance)}]]
(-> [[(:uuid instance) {:label (:name instance)
:shape "cylinder"}]]
(into out-nodes)
(into in-nodes)
(into relationships-out)

Loading…
Cancel
Save