Skip to content
Snippets Groups Projects
Unverified Commit 70c8d96c authored by Jesse Devaney's avatar Jesse Devaney Committed by GitHub
Browse files

Hide read-only items in the Archive (#33602)


* refactor use-list-select hook

- toggleAll(items) felt unintuitive as some items could be selected while simultaneously unselecting others
  - switched to selectOnlyTheseItems(items) to be more explicit on what the function is doing
- updated consumers of useListSelect to use the new API

* convert to functional component

* convert HoC ListSelect to hook useListSelect

* convert redux connects to useSelectors

* refactor ArchiveApp and improve types

* hide read only items in the archive

* verify desired behavior

* refactor beforeEach

* remove unused eslint disable line

* refactor item can_write accessor logic

* Add :can_write key into the search data response. uses `mi/can-write?`

* update archive app for archived search changes

* refactor filtering of list

* replace hard-coded collection ids in spec

* move specific helper outside of generic helpers file

* remove admin gets unfiltered data

* BE sends only can_write true results when search with archived?=true

This change modifies the `check-permissions-for-model` method to check for write access if the SearchContext has
archived true.

This means that the only results sent to the frontend are those results that the user can take actions on, namely,
unarchiving them.

* reomve unused require

* update FE to account for BE changes

---------

Co-authored-by: default avataradam-james <21064735+adam-james-v@users.noreply.github.com>
parent a98530f1
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