integration-tests
Josha von Gizycki 6 years ago
commit 381ee87d4d

@ -61,6 +61,7 @@
:ring {:handler wanijo.handler/app} :ring {:handler wanijo.handler/app}
:less {:source-paths ["resources/app/stylesheets"] :less {:source-paths ["resources/app/stylesheets"]
:target-path "resources/public/css"} :target-path "resources/public/css"}
:aliases {"uberjar" ["do" ["less" "once"] "uberjar"]} :aliases {"uberjar" ["do" ["less" "once"] "uberjar"]
"compile" ["do" ["less" "once"] "compile"]}
:hiera {:cluster-depth 2} :hiera {:cluster-depth 2}
:eastwood {:namespaces [:source-paths]}) :eastwood {:namespaces [:source-paths]})

@ -108,10 +108,20 @@ img, svg {
grid-area: nav; grid-area: nav;
.accent-border-element; .accent-border-element;
h2::before {
content: "▤ ";
color: @ci-blue;
}
h2 { h2 {
margin-left: -1rem; margin-left: -1rem;
padding-left: 1rem; padding-left: 1rem;
} }
ul {
list-style-type: none;
padding-left: 1.8rem;
}
} }
main { main {

@ -70,14 +70,14 @@
(when authed? (when authed?
(list (list
[:section.schemas [:section.schemas
[:h2 [:span.__icon "▤"] "Schemas"] [:h2 "Schemas"]
[:ul [:ul
(for [schema (:schemas session)] (for [schema (:schemas session)]
[:li [:a {:href (path :instance-list [:li [:a {:href (path :instance-list
{:schema-uuid (:uuid schema)})} {:schema-uuid (:uuid schema)})}
(h (:name schema))]])]] (h (:name schema))]])]]
[:section [:section
[:h2 [:span.__icon "▤"] "Visualisation"] [:h2 "Visualisation"]
[:ul [:ul
[:li [:a {:href (path :vis-all-instances)} [:li [:a {:href (path :vis-all-instances)}
"All Instances"]]]]))] "All Instances"]]]]))]

@ -198,3 +198,15 @@
(outgoing-links! uuid) (outgoing-links! uuid)
:links-in :links-in
(incoming-links! uuid))) (incoming-links! uuid)))
(neo4j/defquery is-starred
"MATCH (u:user {uuid:{user_uuid}}),
(i:instance {uuid:{uuid}})
RETURN EXISTS((i)-[:starred_by]->(u)) AS starred")
(defn is-starred! [uuid user-uuid]
(-> (neo4j/exec-query! is-starred
{:user_uuid user-uuid
:uuid uuid})
first
:starred))

@ -40,7 +40,12 @@
(domain/full-instance-by-uuid! uuid)) (domain/full-instance-by-uuid! uuid))
(defn show! [uuid req] (defn show! [uuid req]
(view/show! (instance! uuid) req)) (let [user-uuid (-> req :session :uuid)
instance (assoc (instance! uuid)
:starred
(domain/is-starred! uuid
user-uuid))]
(view/show! instance req)))
(defn form! [uuid attrs] (defn form! [uuid attrs]
(forms-inst/with-attributes attrs)) (forms-inst/with-attributes attrs))

@ -44,6 +44,9 @@
:request req :request req
:content :content
[[:h1 [[:h1
(if (:starred instance)
"★" "☆")
" "
(h (-> instance :schema :name)) (h (-> instance :schema :name))
" " " "
[:small (h (:name instance))]] [:small (h (:name instance))]]

Loading…
Cancel
Save