Location sensitive model tab pages sorting #1281
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR performs the following changes when sorting items displayed in the model tab pages:
When sorting 2 locations (Locations tab), sorting is first performed according to the ancestors widgetOrder, so that locations within the same parent appear grouped according to the choice of the administrator, then use the widgetOrder among all locations of the same parent, before finally using lexicographical comparison.
When sorting 2 equipment (Equipment tab) or 2 properties (Properties tab), sorting is performed according to the widgetOrder. If undefined (or equal), sorting is performed according to the location (taking into account all ancestors). then only if undefined/equal does lexicographical comparison takes place.
Performance measurement on sample installation with 600 items in model yields no measurable difference (using
performance.now()
, 2.3GHz intel Core i9: average model data processing ~150ms).