Skip to content
Snippets Groups Projects
Commit 4a654eb4 authored by Tom Robinson's avatar Tom Robinson
Browse files

Change root-collection-with-ui-details to a function so that the name is properly localized

parent b79a1107
Branches
Tags
No related merge requests found
......@@ -134,7 +134,7 @@
;;; -------------------------------------------- GET /api/collection/root --------------------------------------------
(defn- root-collection []
(collection-detail collection/root-collection-with-ui-details))
(collection-detail (collection/root-collection-with-ui-details)))
(api/defendpoint GET "/root"
"Return the 'Root' Collection object with standard details added"
......
......@@ -184,8 +184,9 @@
"Special placeholder object representing the Root Collection, which isn't really a real Collection."
(map->RootCollection {::is-root? true}))
(def ^RootCollection root-collection-with-ui-details
(defn root-collection-with-ui-details
"The special Root Collection placeholder object with some extra details to facilitate displaying it on the FE."
[]
(assoc root-collection
:name (tru "Our analytics")
:id "root"))
......@@ -300,7 +301,7 @@
[collection :- CollectionWithLocationAndIDOrRoot]
(if (is-root-collection? collection)
[]
(filter i/can-read? (cons root-collection-with-ui-details (ancestors collection)))))
(filter i/can-read? (cons (root-collection-with-ui-details) (ancestors collection)))))
(s/defn parent-id :- (s/maybe su/IntGreaterThanZero)
"Get the immediate parent `collection` id, if set."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment