marmelab / ng-admin

Add an AngularJS admin GUI to any RESTful API
http://ng-admin-book.marmelab.com/
MIT License
3.95k stars 728 forks source link

Batch selections logic: find selected items by their identifierValue #1386

Closed artemkobets closed 4 years ago

artemkobets commented 6 years ago

There's currently a bug present in example app, generated by make run, and on the demo page . Steps to reproduce:

  1. Go to any resource page, and select several items there (for example, with id 1 and 2).
  2. Go to a different page of this resource, then go back and undo selection of items you selected.
  3. You will see that instead of removing items from selection, they were re-added (I selected 2 items, tried to remove them and now there's 4 items in the selection - [1, 2, 1, 2]). This can result in admin deleting the items he unselected.

This commit fixes it, by tracking items in selection by their unique identifierValue.