Skip to content

Commit 29c02cc

Browse files
functions and supportedunits are sorted alphabetically
1 parent 0548edc commit 29c02cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/app/device-model/device-model-edit/device-model-edit.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class DeviceModelEditComponent implements OnInit {
3131
controlledPropperties = [];
3232
categories = [];
3333
supportedUnits = new SupportedUnit();
34-
deviceFunctions = [];
34+
deviceFunctions: string[] = [];
3535
energyLimitationClass = new EnergyLimitationClass();
3636
supportedProtocol = [];
3737

@@ -55,12 +55,14 @@ export class DeviceModelEditComponent implements OnInit {
5555
if (deviceModelId) {
5656
this.getDeviceModel(deviceModelId);
5757
}
58+
this.supportedUnits.units.sort((a,b) => a.name.localeCompare(b.name));
5859
}
5960

6061
mapEnumsToArray() {
6162
this.controlledPropperties = Object.values(ControlledPropperty);
6263
this.categories = Object.values(DeviceCategory);
6364
this.deviceFunctions = Object.values(DeviceFunction);
65+
this.deviceFunctions.sort((a: string, b: string) => a.localeCompare(b));
6466
this.supportedProtocol = Object.values(SupportedProtocol);
6567
}
6668

0 commit comments

Comments
 (0)