diff --git a/apps/taiga-lumbermill/src/dashboards/iot/components/Cost/cost.component.html b/apps/taiga-lumbermill/src/dashboards/iot/components/Cost/cost.component.html
index 110fefdca..08a40d872 100644
--- a/apps/taiga-lumbermill/src/dashboards/iot/components/Cost/cost.component.html
+++ b/apps/taiga-lumbermill/src/dashboards/iot/components/Cost/cost.component.html
@@ -23,13 +23,13 @@
diff --git a/apps/taiga-lumbermill/src/dashboards/iot/components/Cost/cost.component.ts b/apps/taiga-lumbermill/src/dashboards/iot/components/Cost/cost.component.ts
index ac814e76e..11d9a56ff 100644
--- a/apps/taiga-lumbermill/src/dashboards/iot/components/Cost/cost.component.ts
+++ b/apps/taiga-lumbermill/src/dashboards/iot/components/Cost/cost.component.ts
@@ -2,7 +2,8 @@ import {CommonModule} from '@angular/common';
import {ChangeDetectionStrategy, Component, inject} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {TuiAxes, TuiBarChart} from '@taiga-ui/addon-charts';
-import {TuiAppearance, TuiHint} from '@taiga-ui/core';
+import type {TuiContext} from '@taiga-ui/cdk';
+import {TuiAppearance, tuiFormatNumber, TuiHint} from '@taiga-ui/core';
import {TuiDataListWrapper} from '@taiga-ui/kit';
import {TuiCardLarge} from '@taiga-ui/layout';
import {TuiSelectModule} from '@taiga-ui/legacy';
@@ -29,5 +30,9 @@ import {CostService} from './cost.service';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CostComponent {
- protected costService = inject(CostService);
+ protected costService = inject(CostService).costData;
+ protected hint = ({$implicit}: TuiContext): string =>
+ this.costService.value
+ .reduce((result, set) => `${result}$${tuiFormatNumber(set[$implicit])}\n`, '')
+ .trim();
}
diff --git a/apps/taiga-lumbermill/src/dashboards/iot/components/Cost/cost.service.ts b/apps/taiga-lumbermill/src/dashboards/iot/components/Cost/cost.service.ts
index be5fa416b..eb57d9ffe 100644
--- a/apps/taiga-lumbermill/src/dashboards/iot/components/Cost/cost.service.ts
+++ b/apps/taiga-lumbermill/src/dashboards/iot/components/Cost/cost.service.ts
@@ -1,11 +1,9 @@
import {Injectable} from '@angular/core';
-import type {TuiContext} from '@taiga-ui/cdk';
-import {tuiFormatNumber} from '@taiga-ui/core';
interface CostData {
- value: number[][];
- labelsX: string[];
- labelsY: string[];
+ readonly value: number[][];
+ readonly labelsX: string[];
+ readonly labelsY: string[];
}
const INITIAL_DATA: CostData = {
@@ -22,8 +20,4 @@ const INITIAL_DATA: CostData = {
})
export class CostService {
public readonly costData = INITIAL_DATA;
- public hint = ({$implicit}: TuiContext): string =>
- this.costData.value
- .reduce((result, set) => `${result}$${tuiFormatNumber(set[$implicit])}\n`, '')
- .trim();
}
diff --git a/apps/taiga-lumbermill/src/dashboards/iot/components/Lighting/lighting.component.html b/apps/taiga-lumbermill/src/dashboards/iot/components/Lighting/lighting.component.html
index b155b56e0..c160de0ad 100644
--- a/apps/taiga-lumbermill/src/dashboards/iot/components/Lighting/lighting.component.html
+++ b/apps/taiga-lumbermill/src/dashboards/iot/components/Lighting/lighting.component.html
@@ -28,7 +28,7 @@
[formControl]="control"
[style.display]="'none'"
/>
- {{ lightingService.lightingData[ind].room }}
+ {{ lightingService[ind].room }}
new FormControl(item.state)),
+ this.lightingService.map((item) => new FormControl(item.state)),
);
}
diff --git a/apps/taiga-lumbermill/src/dashboards/iot/components/Safety/safety.component.html b/apps/taiga-lumbermill/src/dashboards/iot/components/Safety/safety.component.html
index c515e0887..5d43a0bf7 100644
--- a/apps/taiga-lumbermill/src/dashboards/iot/components/Safety/safety.component.html
+++ b/apps/taiga-lumbermill/src/dashboards/iot/components/Safety/safety.component.html
@@ -20,7 +20,7 @@
*ngFor="let control of safetyForm['controls']; let ind = index"
tuiBlock
>
- {{ safetyService.safetyData[ind].name }}
+ {{ safetyService[ind].name }}
new FormControl(item.state)),
+ this.safetyService.map((item) => new FormControl(item.state)),
);
}
diff --git a/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.html b/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.html
index 029be1116..5842bb235 100644
--- a/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.html
+++ b/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.html
@@ -13,7 +13,7 @@
{{ input.name }}
diff --git a/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.ts b/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.ts
index 8beb359b2..52f0f3864 100644
--- a/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.ts
+++ b/apps/taiga-lumbermill/src/dashboards/iot/components/climate-control/climate-control.component.ts
@@ -30,5 +30,5 @@ import {ClimateControlService} from './climate-control.service';
],
})
export class ClimateControlComponent {
- protected climateControlService = inject(ClimateControlService);
+ protected climateControlService = inject(ClimateControlService).climateControlData;
}
diff --git a/apps/taiga-lumbermill/src/dashboards/iot/components/control-panel/control-panel.component.html b/apps/taiga-lumbermill/src/dashboards/iot/components/control-panel/control-panel.component.html
index 4c5e3be39..585ef57c6 100644
--- a/apps/taiga-lumbermill/src/dashboards/iot/components/control-panel/control-panel.component.html
+++ b/apps/taiga-lumbermill/src/dashboards/iot/components/control-panel/control-panel.component.html
@@ -1,16 +1,9 @@
-