-
- Downloads
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:
adam-james <21064735+adam-james-v@users.noreply.github.com>
Showing
- e2e/support/cypress_sample_instance_data.js 5 additions, 0 deletionse2e/support/cypress_sample_instance_data.js
- e2e/test/scenarios/collections/archive.cy.spec.js 49 additions, 1 deletione2e/test/scenarios/collections/archive.cy.spec.js
- frontend/src/metabase-types/api/collection.ts 1 addition, 0 deletionsfrontend/src/metabase-types/api/collection.ts
- frontend/src/metabase/archive/containers/ArchiveApp.tsx 20 additions, 13 deletionsfrontend/src/metabase/archive/containers/ArchiveApp.tsx
- frontend/src/metabase/entities/search.js 9 additions, 0 deletionsfrontend/src/metabase/entities/search.js
- src/metabase/api/search.clj 20 additions, 12 deletionssrc/metabase/api/search.clj
- test/metabase/api/search_test.clj 18 additions, 0 deletionstest/metabase/api/search_test.clj
Loading
Please register or sign in to comment