Skip to content

Button to unselect elements by corpus

https://redmine.teklia.com/issues/7882

The removeSelection API helper should be modified to take an optional object instead, with an optional id or an optional corpus. Both options cannot be set at the same time.

The clearSelection API helper should be removed as is it now replaced with removeSelection().

In the selection store, a new unselectCorpus action should take a corpus ID, call removeSelection with the corpus filter, and delete selection[corpusId] to remove all selected elements of this corpus. When an API error occurs, an error notification should be shown the elements should not be removed from the store. Two unit tests should test this action, one for a successful execution and one for an API error.

In the selection page (/elements/selected), a new Unselect option in the Actions dropdown should call this new unselectCorpus action.

Edited by Erwan Rouchet