Skip to content

Commit e27065c

Browse files
removed orderOn so the backend reads it as undefined. Unwrapped elses
1 parent 43ae682 commit e27065c

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

src/app/applications/applications-list/applications-table/applications-table.component.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,16 @@ export class ApplicationsTableComponent implements AfterViewInit, OnInit {
202202

203203
if (valueA === "NONE" && valueB !== "NONE") {
204204
return orderByDirection === "asc" ? 1 : -1;
205-
} else if (valueA !== "NONE" && valueB === "NONE") {
205+
}
206+
if (valueA !== "NONE" && valueB === "NONE") {
206207
return orderByDirection === "asc" ? -1 : 1;
207-
} else {
208-
const translatedA = this.translate.instant("APPLICATION.STATUS." + valueA);
209-
const translatedB = this.translate.instant("APPLICATION.STATUS." + valueB);
210-
211-
return translatedA.localeCompare(translatedB) * (orderByDirection === "asc" ? 1 : -1);
212208
}
209+
const translatedA = this.translate.instant("APPLICATION.STATUS." + valueA);
210+
const translatedB = this.translate.instant("APPLICATION.STATUS." + valueB);
211+
212+
return translatedA.localeCompare(translatedB) * (orderByDirection === "asc" ? 1 : -1);
213213
});
214+
214215
return data;
215216
}
216217
})

src/app/applications/iot-devices/iot-devices-table/iot-devices-table.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ export class IotDevicesTableComponent implements AfterViewInit, OnInit {
185185
})
186186
.pipe(
187187
map((data: IotDevicesResponse) => {
188-
// For some reason, the backend is not capable to sort MQTT_EXTERNAL_BROKER and MQTT_INTERNAL_BROKER.
189-
// Therefore we do it manually in the frontend.
188+
// For some reason, the backend is not capable to sort MQTT_EXTERNAL_BROKER and MQTT_INTERNAL_BROKER.
189+
// Therefore we do it manually in the frontend.
190190
if (orderByColumn !== "type") {
191191
return data;
192192
} else {
@@ -196,11 +196,11 @@ export class IotDevicesTableComponent implements AfterViewInit, OnInit {
196196

197197
if (valueA < valueB) {
198198
return orderByDirection === "asc" ? -1 : 1;
199-
} else if (valueA > valueB) {
199+
}
200+
if (valueA > valueB) {
200201
return orderByDirection === "asc" ? 1 : -1;
201-
} else {
202-
return 0;
203202
}
203+
return 0;
204204
});
205205
return data;
206206
}

src/app/gateway/gateway-overview/gateway-tabs/gateway-map/gateway-map.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export class GatewayMapComponent implements OnInit, OnDestroy, AfterViewInit {
4747
limit: null,
4848
offset: null,
4949
sort: null,
50-
orderOn: null,
5150
})
5251
.subscribe((gateways: GatewayResponseMany) => {
5352
this.gateways = gateways.resultList;
@@ -63,7 +62,6 @@ export class GatewayMapComponent implements OnInit, OnDestroy, AfterViewInit {
6362
limit: null,
6463
offset: null,
6564
sort: null,
66-
orderOn: null,
6765
organizationId: orgId,
6866
})
6967
.subscribe((gateways: GatewayResponseMany) => {

0 commit comments

Comments
 (0)