Task #3008
closed
Selecting possible original guarantee in the bulk action Replace contract guarantee
Added by Alena Peterová about 3 years ago.
Updated almost 3 years ago.
Description
When using the bulk operation "Replace contract guarantee" for users, we have to specify "Original guarantee". We can select any user in this select box, even if the user is not an actual manager of any of the selected contracts.
When we select incorrect manager, the task still ends with the result of e.g. 1/1 processed items, and the task bar is green.
Please improve the select box so that it contains only the users, who can be really used as "original guarantee". (Intersection, or union of managers of all selected contracts.) If there is only 1 such possible user (our use-case), the user should be selected automatically.
The result should contain correct info about processed and not processed items.
(Feedback (bug report) from our customer.)
- Priority changed from Normal to High
- Assignee changed from Roman Kučera to Tomáš Doischer
- Status changed from New to In Progress
- Status changed from In Progress to Needs feedback
- Assignee changed from Tomáš Doischer to Peter Štrunc
- % Done changed from 0 to 80
- Status changed from Needs feedback to In Progress
- Assignee changed from Peter Štrunc to Tomáš Doischer
- % Done changed from 80 to 90
Hey @doischert, it looks great. I tested it and I haven't found any issues. I see that you are mentioning that the bulk action is not meant for a large number of operations. I think that it would be nice to explicitly say it to the user, who tries to invoke it on such a large dataset. I was thinking something like:
if (number of found guarantees exceeds 200, which is the limit for in clause in SQL query) then display warning to the user (using prevalidate result) and only offer first 200 guarantees to choose from
Maybe we can add this as a future improvement :)
I merged the feature to develop here: https://github.com/bcvsolutions/CzechIdMng/pull/167
Please, update changelog.md to include info about this ticket
Thank you, I updated the changelog and merged it to develop.
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
As for how this was done (in short): when a bulk action is started (before the modal is opened), prevalidate request is started. We added a second request called preprocess which allows you to change the bulk action object on backend based on selected data. What we then do in the bulk action is add the form attributes with the filtered data. Form attributes now have a new field (json only) called forceSearchParameters which is a DataFilter. To it, we set the ids of guarantees for the selected identities (which we have in the bulk action). On frontend, this is then loaded and used in the form for selecting the guarantee to be replaced.
Should we do this in the future for other bulk actions, we simply need to:
- change the bulk action - implement preprocessBulkAction and isSupportsPreprocessing method
- possibly add the endpoint /bulk/preprocess - if this is for another agenda than identities
- Assignee changed from Tomáš Doischer to Roman Kučera
Thank you, merged to develop.
Also available in: Atom
PDF