Sort list of templates, serviceOfferings, diskOfferings etc in the deploy VM wizard - #3336
Conversation
…ps, sshkeyPairs, vpcs, networkOfferings in the deploy VM wizard
|
LGTM |
There was a problem hiding this comment.
This overrides the order in which we set the "sort_key" param is used by backend to return a pre-configured list of entities. That is not desirable.
For templates we don't support sort_key on backend yet and hence we need to sort alphabetically for the time being.
CC/ @rhtyd , @rafaelweingartner , @borisstoyanov
Actually I think that might be more efficient however in Templates view table there is a column that "Order". Order function does not work right now but if I add sort functionality which sort every result by name, than this might be misleading. One may think it is done in purpose. Beside, the change is not only about sorting the templates in Create VM screen. diskOfferings, vmtemplates etc all need to be sorted as well. |
|
Some resources have a sort order defined, it's not right to enforce general alphabetical order. |
|
@anuragaw can you advise which resources are sortable from backend (i..e have a sort order), for rest this PR can be used. |
|
apologies - lost track of this due to misconfigured github notification, and will update the list of resources before end of day tomorrow. Alternately one can search for "sortKey" API Param in |
|
I am afraid most of the entities targetted in the PR description have their own sortkey fields now in code after some recent PRs EXCEPT below-
|
yadvr
left a comment
There was a problem hiding this comment.
@smlshn there were other PRs that implement a sortOrder feature for various entities, can you fix your PR to only sort for the following resources:
- affinityGroups by name
- sshkeyPairs by name
- network: vpcs by name, networkOfferings by name
yadvr
left a comment
There was a problem hiding this comment.
Sort order enforced only for
affinityGroups by name
sshkeyPairs by name
network: vpcs by name, networkOfferings by name
shwstppr
left a comment
There was a problem hiding this comment.
LGTM. Tested locally, working for desired entities.
|
|
||
| $vpcSelect.val(-1); | ||
|
|
||
| sortArrayByKey(args.data.networkOfferings, 'name'); |
There was a problem hiding this comment.
Network offerings also has a support for sort_key param in database. We should not sort this.
There was a problem hiding this comment.
I had missed this earlier in my list. Apologies for that.
anuragaw
left a comment
There was a problem hiding this comment.
LGTM but had minor suggestion.

Description
Adds functionality to sort the data that is available on each in the deploy VM wizard's step by their suitable fields i.e
Fixes: #3050
Types of changes
Screenshots (if appropriate):
How Has This Been Tested?
Run client
Instances > Add Instance
See previous non sorted data in the browser's console
After sort function run see sorted data in the browser's console
See sorted results in the deploy VM wizard as well