Skip to content

Commit 97853fa

Browse files
committed
Improve device model edit typing
1 parent 29c02cc commit 97853fa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ import { SupportedUnit } from '../supported-unit.model';
2222
})
2323
export class DeviceModelEditComponent implements OnInit {
2424

25-
public errorMessages: any;
25+
public errorMessages: string[];
2626
public errorFields: string[];
2727
public deviceModel: DeviceModel = new DeviceModel();
2828
public backButton: BackButton = { label: '', routerLink: '/device-model' };
2929
public title = '';
3030
public formFailedSubmit = false;
31-
controlledPropperties = [];
32-
categories = [];
31+
controlledPropperties: ControlledPropperty[] = [];
32+
categories: DeviceCategory[] = [];
3333
supportedUnits = new SupportedUnit();
34-
deviceFunctions: string[] = [];
34+
deviceFunctions: DeviceFunction[] = [];
3535
energyLimitationClass = new EnergyLimitationClass();
36-
supportedProtocol = [];
36+
supportedProtocol: SupportedProtocol[] = [];
3737

3838
constructor(
3939
private translate: TranslateService,
@@ -55,14 +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));
58+
this.supportedUnits.units.sort((a, b) => a.name.localeCompare(b.name));
59+
this.deviceFunctions.sort((a, b) => a.localeCompare(b));
5960
}
6061

6162
mapEnumsToArray() {
6263
this.controlledPropperties = Object.values(ControlledPropperty);
6364
this.categories = Object.values(DeviceCategory);
6465
this.deviceFunctions = Object.values(DeviceFunction);
65-
this.deviceFunctions.sort((a: string, b: string) => a.localeCompare(b));
6666
this.supportedProtocol = Object.values(SupportedProtocol);
6767
}
6868

0 commit comments

Comments
 (0)