Skip to content
Snippets Groups Projects
Unverified Commit 81d2d240 authored by dpsutton's avatar dpsutton Committed by GitHub
Browse files

Exclude archived collections from tree view (#19609)


* Exclude archived collections from tree view

This is a bit more nuanced that it might first appear. The bug report is
the permissions editor for collections is showing child collections
which are archived. But the api sends back ALL collections, regardless
of archival state. So the FE knows to omit top-level archived
collections but not archived child collections.

So we thought about just having the FE remove all archived ones, but
best to remove it from the response. One worry is that we're not sure if
any callers want archived collections in the tree view or not. So right
now they are removed with a `?exclude-archived=true` query param, but if
we can demonstrate that no callers of the tree api ever want archived
items we can make this the behavior, rather than an optional behavior.

To verify that the tree api is sending back all collections, you can
check

```clj
collection=> (collection/collections->tree
               {}
               [{:archived false
                 :name "foo"
                 :id 1
                 :location "/"}
                {:archived true
                 :name "foo"
                 :id 2
                 :location "/1/"}
                {:archived true
                 :name "its archived"
                 :location "/"
                 :id 3}])
;; we have always sent back archived collections, both top level and children
({:archived false,
  :name "foo",
  :id 1,
  :location "/",
  :children ({:archived true,
              :name "foo",
              :id 2,
              :location "/1/",
              :children ()})}
 {:archived true,
  :name "its archived",
  :location "/",
  :id 3,
  :children ()})
```

* hide archived collections from the collections permissions page (#19616)

* fix incorrect issue number

Co-authored-by: default avatarAlexander Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: default avatarAleksandr Lesnenko <alxnddr@gmail.com>
parent e32de618
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment