Conversation
1azyman
left a comment
There was a problem hiding this comment.
Hi, code looks fine, I noticed just one thing with ordering. Please have a look at it, maybe it can be removed and sorting have to take into account "null" order values...which I think it does. Thank you very much.
| return searchItems; | ||
| } | ||
|
|
||
| private static List<SearchItemType> getSearchItemsWithDisplayOrder(SearchItemsType searchItems) { |
There was a problem hiding this comment.
I think it would be a bit safer not to mutate custom search items displayOrder. What if user set order for their items 10, 20, 30? If I understand correctly if this is not done, then some items will have displayOrder=null which means we have to think about it during sorting.
There was a problem hiding this comment.
Method getSearchItemsWithDisplayOrder adds displayOrder to all items in the list, so every item in the list will have non null displayOrder. The sorting itself is able to handle items with displayOrder=null. It will sort such items alphabetically.
|
I've also noticed if I use sample from ticket, reorder xml in this way: given (no display order), email (30), family (20) then order on page is given, family, email...Wasn't it described in schema as null order goes last? could it be because of my previous comment? |
In case item do not have specified displayOrder the displayOrder will be added to it with value of its index in the list. So in your case given (no display order), email (30), family (20) it will add zero as displayOrder for given. Order on page will be than order on page is given(0), family(20), email(30). We assume that user either fill displayOrder for all items or for none of them. In case he specifies only some displayOrder he can not expect consistent experience. For us it is needed to add some displayOrder for each element in initial phase of search box to properly handle adding of new items from More button menu to the end of search items list. |
1azyman
left a comment
There was a problem hiding this comment.
Saved filters are not being sorted correctly. Scenario:
1/ open users using collection defined in issue (given:null, email:30, family:20)
2/ search items are visible in this order: given, family, email
3/ select more, add these: additionalName, badluck (extension attribute)
4/ put "a" to email, "b" to additional, "c" to badluck
5/ hit save filter
6/ logout, login
7/ check user xml, saved filter is there with: email:30, additional: 31, badluck:32
8/ go to user list (system users collection)
9/ load saved filter
10/ now items are in this order: additional, badluck, email
No description provided.