Task #3008
closedSelecting possible original guarantee in the bulk action Replace contract guarantee
100%
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.)
Updated by Alena Peterová about 3 years ago
- Priority changed from Normal to High
Updated by Roman Kučera about 3 years ago
- Assignee changed from Roman Kučera to Tomáš Doischer
Updated by Tomáš Doischer almost 3 years ago
- Status changed from New to In Progress
Updated by Tomáš Doischer almost 3 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Tomáš Doischer to Peter Štrunc
- % Done changed from 0 to 80
Implemented in https://github.com/bcvsolutions/CzechIdMng/tree/doischer/3008-improve-guarantee-change-bulk-action.
I added the functionality to the Remove contract guarantee bulk action as well.
Documentation updated: https://wiki.czechidm.com/devel/documentation/contracts/adm/contract_guarantee
@sourek, can you please give me feedback.
I'll add a more detailed overview of the changes here tomorrow so that we can easily follow them in the future.
Updated by Peter Štrunc almost 3 years ago
- 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
Updated by Tomáš Doischer almost 3 years ago
Thank you, I updated the changelog and merged it to develop.
Updated by Tomáš Doischer almost 3 years ago
- 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
Updated by Tomáš Doischer almost 3 years ago
- Assignee changed from Tomáš Doischer to Roman Kučera
Upon consultation with @apeterova, I made some more changes.
The bulk action can be used on 500 users in total but this can be increased by changing 'idm.sec.core.filter.check.size.maximum'.
If the selected users have more than 45 contract guarantees, no filtering will be done and the user will see all active identities. This is because without that autocomplete would create a URL which is too long.
I updated the documentation: https://wiki.czechidm.com/devel/documentation/contracts/adm/contract_guarantee#remove_guarantee_bulk_action
Commit: https://github.com/bcvsolutions/CzechIdMng/commit/8be0ca248fbbfe131e2473881113ff77bdf7feb0
@kucerar, can you give me feedback?