Skip to content

Commit befa282

Browse files
remibergsmaDaan Hoogland
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.
1 parent 024a292 commit befa282

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
@@ -486,6 +486,9 @@
486486
description: this.path
487487
});
488488
});
489+
items.sort(function(a, b) {
490+
return a.description.localeCompare(b.description);
491+
});
489492
args.response.success({
490493
data: items
491494
});
@@ -1100,6 +1103,9 @@
11001103
description: this.path
11011104
});
11021105
});
1106+
items.sort(function(a, b) {
1107+
return a.description.localeCompare(b.description);
1108+
});
11031109
args.response.success({
11041110
data: items
11051111
});
@@ -1707,6 +1713,9 @@
17071713
description: this.path
17081714
});
17091715
});
1716+
items.sort(function(a, b) {
1717+
return a.description.localeCompare(b.description);
1718+
});
17101719
args.response.success({
17111720
data: items
17121721
});

‎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
@@ -224,6 +224,9 @@
224224
});
225225
}
226226
}
227+
array1.sort(function(a, b) {
228+
return a.description.localeCompare(b.description);
229+
});
227230
args.response.success({
228231
data: array1
229232
});
@@ -1611,6 +1614,9 @@
16111614
});
16121615
}
16131616
}
1617+
array1.sort(function(a, b) {
1618+
return a.description.localeCompare(b.description);
1619+
});
16141620
args.response.success({
16151621
data: array1
16161622
});

‎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
});
@@ -5196,6 +5202,9 @@
51965202
});
51975203
}
51985204
}
5205+
array1.sort(function(a, b) {
5206+
return a.description.localeCompare(b.description);
5207+
});
51995208
args.response.success({
52005209
data: array1
52015210
});

‎ui/scripts/projects.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,9 @@
723723
});
724724
}
725725
}
726+
array1.sort(function(a, b) {
727+
return a.description.localeCompare(b.description);
728+
});
726729
args.response.success({
727730
data: array1
728731
});

‎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
@@ -430,6 +430,9 @@ var addGuestNetworkDialog = {
430430
}
431431
});
432432
}
433+
items.sort(function(a, b) {
434+
return a.description.localeCompare(b.description);
435+
});
433436
args.response.success({
434437
data: items
435438
});

‎ui/scripts/storage.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,9 @@
431431
});
432432
}
433433
}
434+
array1.sort(function(a, b) {
435+
return a.description.localeCompare(b.description);
436+
});
434437
args.response.success({
435438
data: array1
436439
});
@@ -1572,6 +1575,9 @@
15721575
});
15731576
}
15741577
}
1578+
array1.sort(function(a, b) {
1579+
return a.description.localeCompare(b.description);
1580+
});
15751581
args.response.success({
15761582
data: array1
15771583
});

‎ui/scripts/system.js‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7283,7 +7283,10 @@
72837283
description: this.name
72847284
});
72857285
});
7286-
7286+
items.sort(function(a, b) {
7287+
return a.description.localeCompare(b.description);
7288+
});
7289+
72877290
args.response.success({
72887291
data: items
72897292
});
@@ -12107,6 +12110,9 @@
1210712110
description: this.name
1210812111
});
1210912112
});
12113+
items.sort(function(a, b) {
12114+
return a.description.localeCompare(b.description);
12115+
});
1211012116

1211112117
args.response.success({
1211212118
data: items
@@ -12322,7 +12328,10 @@
1232212328
description: this.name
1232312329
});
1232412330
});
12325-
12331+
items.sort(function(a, b) {
12332+
return a.description.localeCompare(b.description);
12333+
});
12334+
1232612335
args.response.success({
1232712336
data: items
1232812337
});
@@ -12922,7 +12931,10 @@
1292212931
description: this.name
1292312932
});
1292412933
});
12925-
12934+
items.sort(function(a, b) {
12935+
return a.description.localeCompare(b.description);
12936+
});
12937+
1292612938
args.response.success({
1292712939
data: items
1292812940
});
@@ -13458,6 +13470,9 @@
1345813470
description: this.name
1345913471
});
1346013472
});
13473+
items.sort(function(a, b) {
13474+
return a.description.localeCompare(b.description);
13475+
});
1346113476

1346213477
args.response.success({
1346313478
data: items
@@ -14291,6 +14306,9 @@
1429114306
description: this.name
1429214307
});
1429314308
});
14309+
items.sort(function(a, b) {
14310+
return a.description.localeCompare(b.description);
14311+
});
1429414312

1429514313
args.response.success({
1429614314
data: items
@@ -14573,6 +14591,9 @@
1457314591
description: this.name
1457414592
});
1457514593
});
14594+
items.sort(function(a, b) {
14595+
return a.description.localeCompare(b.description);
14596+
});
1457614597

1457714598
args.response.success({
1457814599
data: items

0 commit comments

Comments
 (0)