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 " [:div {:class (str "instance-content "
"attr-type-" type)} "attr-type-" type)}
(render-fn (:value prop))]))]) (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)) (when (seq (:links-out instance))
[:section.links [:section.links-out
[:h2 "Outgoing Links"] [:h2 "Outgoing Links"]
[:table [:table
[:thead [:thead
@ -90,12 +96,29 @@
{: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))]])]]])
(when (or (seq (:links-out instance)) (when (seq (:links-in instance))
(seq (:links-in instance))) [:section.links-in
[:section.visualisation [:h2 "Incoming Links"]
[:h2 "Visualisation"] [:table
[:image {:src (path :instance-link-viz instance) [:thead
:alt "SVG Visualisation"}]])])) [: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] (defn edit! [instance form form-data schemas req]
(view/layout! (view/layout!
@ -120,7 +143,7 @@
(anti-forgery-field) (anti-forgery-field)
(view/delete-btn)) (view/delete-btn))
(when (seq (:links-out instance)) (when (seq (:links-out instance))
[:section.links [:section.links-out
[:h2 "Outgoing Links"] [:h2 "Outgoing Links"]
[:table [:table
[:thead [:thead

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

Loading…
Cancel
Save