From Alexander Wels <awels(a)redhat.com>:
Alexander Wels has submitted this change and it was merged. (
https://gerrit.ovirt.org/76639 )
Change subject: webadmin: Use default grid item comparator
......................................................................
webadmin: Use default grid item comparator
If a grid has no explicit column sorting applied by the user
(which is the initial state of all grids), use a default item
comparator with following logic:
- first, try to compare by name (lexo-numeric) if the item is
assignable to Nameable interface (this covers most, but not
all, business entities), or treat it as null
- otherwise (for items still considered equal by above rule),
try to compare by queryable ID if the item is assignable to
Queryable interface (this should cover the rest of entities),
or treat it as null
- finally, put "null" items at the end (nulls last strategy)
Above comparator logic is in-line with the general UI design
of having "Name" column with clickable links leading to detail
views for each main grid.
Above comparator is not applied if a grid has been explicitly
sorted by the user (by clicking the given column header).
Change-Id: I4711af76410a16354c38c083130be1c2e033306f
Bug-Url:
https://bugzilla.redhat.com/1445235
Signed-off-by: Vojtech Szocs <vszocs(a)redhat.com>
---
M
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/model/DataBoundTabModelProvider.java
M
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/SearchableListModel.java
M
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/SortedListModel.java
3 files changed, 44 insertions(+), 0 deletions(-)
Approvals:
Alexander Wels: Looks good to me, approved
Jenkins CI: Passed CI tests
Vojtech Szocs: Verified
--
To view, visit
https://gerrit.ovirt.org/76639
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4711af76410a16354c38c083130be1c2e033306f
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vojtech Szocs <vszocs(a)redhat.com>
Gerrit-Reviewer: Alexander Wels <awels(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Greg Sheremeta <gshereme(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Peřina <mperina(a)redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourfali(a)redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan(a)redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vszocs(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>