Skip to content

Commit

Permalink
Sorting in PropertyChecker now takes layer's caption into account.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwod committed Nov 24, 2023
1 parent 6caccdf commit 8df1b92
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions new-client/src/plugins/PropertyChecker/views/PropertyItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,12 @@ function PropertyItem({
const bid = b.get("id");
// If we've got nice strings, let's user localeCompare to sort. Else
// just assume the elements are equal.
return typeof aid === "string" && typeof bid === "string"
? aid.localeCompare(bid)
: 0;
return (
a.get("caption").localeCompare(b.get("caption")) || // First, sort on caption.
(typeof aid === "string" && typeof bid === "string" // Next, group by layer ID.
? aid.localeCompare(bid)
: 0)
);
})
.map((f, j) => {
const olLayer = olMap
Expand Down

0 comments on commit 8df1b92

Please sign in to comment.