Skip to content

Commit 9a8ee56

Browse files
remibergsmayadvr
authored andcommitted
CLOUDSTACK-6543 Sort domain lists in UI
As recently discussed on the dev list: This sorts the domain lists based on their path. Especially handy when having a lot of domains, like in a public cloud. Cherry-picked to 4.5 branch since commit exists in 4.4 and master branch. (cherry picked from commit befa282) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent c9fd57f commit 9a8ee56

10 files changed

Lines changed: 69 additions & 3 deletions

File tree

‎ui/scripts/accountsWizard.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@
9292
if (this.level === 0)
9393
rootDomainId = this.id;
9494
});
95+
items.sort(function(a, b) {
96+
return a.description.localeCompare(b.description);
97+
});
9598
args.response.success({
9699
data: items
97100
});

‎ui/scripts/configuration.js‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@
552552
description: this.path
553553
});
554554
});
555+
items.sort(function(a, b) {
556+
return a.description.localeCompare(b.description);
557+
});
555558
args.response.success({
556559
data: items
557560
});
@@ -1192,6 +1195,9 @@
11921195
description: this.path
11931196
});
11941197
});
1198+
items.sort(function(a, b) {
1199+
return a.description.localeCompare(b.description);
1200+
});
11951201
args.response.success({
11961202
data: items
11971203
});
@@ -1857,6 +1863,9 @@
18571863
description: this.path
18581864
});
18591865
});
1866+
items.sort(function(a, b) {
1867+
return a.description.localeCompare(b.description);
1868+
});
18601869
args.response.success({
18611870
data: items
18621871
});

‎ui/scripts/events.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@
301301
});
302302
}
303303
}
304+
array1.sort(function(a, b) {
305+
return a.description.localeCompare(b.description);
306+
});
304307
args.response.success({
305308
data: array1
306309
});

‎ui/scripts/instances.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@
230230
});
231231
}
232232
}
233+
array1.sort(function(a, b) {
234+
return a.description.localeCompare(b.description);
235+
});
233236
args.response.success({
234237
data: array1
235238
});
@@ -1632,6 +1635,9 @@
16321635
});
16331636
}
16341637
}
1638+
array1.sort(function(a, b) {
1639+
return a.description.localeCompare(b.description);
1640+
});
16351641
args.response.success({
16361642
data: array1
16371643
});

‎ui/scripts/network.js‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,9 @@
656656
description: this.path
657657
});
658658
});
659+
items.sort(function(a, b) {
660+
return a.description.localeCompare(b.description);
661+
});
659662
args.response.success({
660663
data: items
661664
});
@@ -830,6 +833,9 @@
830833
});
831834
}
832835
}
836+
array1.sort(function(a, b) {
837+
return a.description.localeCompare(b.description);
838+
});
833839
args.response.success({
834840
data: array1
835841
});
@@ -5222,6 +5228,9 @@
52225228
});
52235229
}
52245230
}
5231+
array1.sort(function(a, b) {
5232+
return a.description.localeCompare(b.description);
5233+
});
52255234
args.response.success({
52265235
data: array1
52275236
});

‎ui/scripts/projects.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,9 @@
734734
});
735735
}
736736
}
737+
array1.sort(function(a, b) {
738+
return a.description.localeCompare(b.description);
739+
});
737740
args.response.success({
738741
data: array1
739742
});

‎ui/scripts/regions.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,9 @@
377377
});
378378
}
379379
}
380+
array1.sort(function(a, b) {
381+
return a.description.localeCompare(b.description);
382+
});
380383
args.response.success({
381384
data: array1
382385
});

‎ui/scripts/sharedFunctions.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ var addGuestNetworkDialog = {
483483
}
484484
});
485485
}
486+
items.sort(function(a, b) {
487+
return a.description.localeCompare(b.description);
488+
});
486489
args.response.success({
487490
data: items
488491
});

‎ui/scripts/storage.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,9 @@
429429
});
430430
}
431431
}
432+
array1.sort(function(a, b) {
433+
return a.description.localeCompare(b.description);
434+
});
432435
args.response.success({
433436
data: array1
434437
});
@@ -1680,6 +1683,9 @@
16801683
});
16811684
}
16821685
}
1686+
array1.sort(function(a, b) {
1687+
return a.description.localeCompare(b.description);
1688+
});
16831689
args.response.success({
16841690
data: array1
16851691
});

‎ui/scripts/system.js‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7920,7 +7920,10 @@
79207920
description: this.name
79217921
});
79227922
});
7923-
7923+
items.sort(function(a, b) {
7924+
return a.description.localeCompare(b.description);
7925+
});
7926+
79247927
args.response.success({
79257928
data: items
79267929
});
@@ -13170,6 +13173,9 @@
1317013173
description: this.name
1317113174
});
1317213175
});
13176+
items.sort(function(a, b) {
13177+
return a.description.localeCompare(b.description);
13178+
});
1317313179

1317413180
args.response.success({
1317513181
data: items
@@ -13385,7 +13391,10 @@
1338513391
description: this.name
1338613392
});
1338713393
});
13388-
13394+
items.sort(function(a, b) {
13395+
return a.description.localeCompare(b.description);
13396+
});
13397+
1338913398
args.response.success({
1339013399
data: items
1339113400
});
@@ -13983,7 +13992,10 @@
1398313992
description: this.name
1398413993
});
1398513994
});
13986-
13995+
items.sort(function(a, b) {
13996+
return a.description.localeCompare(b.description);
13997+
});
13998+
1398713999
args.response.success({
1398814000
data: items
1398914001
});
@@ -14510,6 +14522,9 @@
1451014522
description: this.name
1451114523
});
1451214524
});
14525+
items.sort(function(a, b) {
14526+
return a.description.localeCompare(b.description);
14527+
});
1451314528

1451414529
args.response.success({
1451514530
data: items
@@ -15341,6 +15356,9 @@
1534115356
description: this.name
1534215357
});
1534315358
});
15359+
items.sort(function(a, b) {
15360+
return a.description.localeCompare(b.description);
15361+
});
1534415362

1534515363
args.response.success({
1534615364
data: items
@@ -15655,6 +15673,9 @@
1565515673
description: this.name
1565615674
});
1565715675
});
15676+
items.sort(function(a, b) {
15677+
return a.description.localeCompare(b.description);
15678+
});
1565815679

1565915680
args.response.success({
1566015681
data: items

0 commit comments

Comments
 (0)