From f03522fb670c94ecb79d5e188f817f4c12240caf Mon Sep 17 00:00:00 2001 From: Hiromasa Ihara Date: Fri, 2 Aug 2024 04:31:10 +0900 Subject: [PATCH] UI: add null type to null initialization variables (#2701) --- .../chpsocchartoverview.component.ts | 7 +++---- ui/src/app/edge/history/chpsoc/widget.component.ts | 7 +++---- .../delayedselltogridchartoverview.component.ts | 5 ++--- .../history/delayedselltogrid/widget.component.ts | 5 ++--- .../fixdigitaloutputchartoverview.component.ts | 4 ++-- .../history/fixdigitaloutput/widget.component.ts | 10 ++++------ .../heatingelementchartoverview.component.ts | 5 ++--- .../edge/history/heatingelement/widget.component.ts | 5 ++--- .../heatpumpchartoverview.component.ts | 5 ++--- ui/src/app/edge/history/heatpump/widget.component.ts | 2 +- ui/src/app/edge/history/history.component.ts | 6 +++--- .../asymmetricpeakshavingchartoverview.component.ts | 5 ++--- .../peakshaving/asymmetric/widget.component.ts | 5 ++--- .../symmetricpeakshavingchartoverview.component.ts | 5 ++--- .../peakshaving/symmetric/widget.component.ts | 5 ++--- .../timeslotpeakshavingchartoverview.component.ts | 5 ++--- .../history/peakshaving/timeslot/widget.component.ts | 5 ++--- .../edge/history/singlethreshold/chart.component.ts | 2 +- .../singlethresholdchartoverview.component.ts | 4 ++-- .../edge/history/singlethreshold/widget.component.ts | 7 +++---- .../edge/history/storage/chargerchart.component.ts | 2 +- .../app/edge/history/storage/esschart.component.ts | 2 +- .../storagechartoverview.component.ts | 6 +++--- ui/src/app/edge/history/storage/widget.component.ts | 4 ++-- ui/src/app/edge/live/Controller/ChpSoc/ChpSoc.ts | 7 +++---- .../live/Controller/Ess/FixActivePower/flat/flat.ts | 2 +- .../Controller/Ess/GridOptimizedCharge/flat/flat.ts | 2 +- .../Ess/GridOptimizedCharge/modal/modal.ts | 4 ++-- .../Evcs/administration/administration.component.ts | 3 +-- ui/src/app/edge/live/Controller/Evcs/flat/flat.ts | 6 +++--- ui/src/app/edge/live/Controller/Evcs/modal/modal.ts | 2 +- .../edge/live/Controller/Io/Heatpump/Io_Heatpump.ts | 2 +- .../live/Io/Api_DigitalInput/Io_Api_DigitalInput.ts | 3 +-- .../Multiple/Evcs_Api_Cluster/Evcs_Api_Cluster.ts | 2 +- .../Evcs_Api_Cluster/modal/evcsCluster-modal.page.ts | 2 +- ui/src/app/edge/live/common/consumption/flat/flat.ts | 2 +- .../live/common/storage/modal/modal.component.ts | 2 +- .../edge/live/common/storage/storage.component.ts | 2 +- .../delayedselltogrid/delayedselltogrid.component.ts | 4 ++-- .../chart/section/abstractsection.component.ts | 4 ++-- .../live/energymonitor/energymonitor.component.ts | 1 - ui/src/app/edge/live/live.component.ts | 7 +++---- .../safe-input/formly-safe-input-modal.component.ts | 2 +- ui/src/app/edge/settings/app/install.component.ts | 2 +- .../app/edge/settings/channels/channels.component.ts | 4 ++-- .../settings/component/install/install.component.ts | 8 ++++---- .../settings/component/update/index.component.ts | 2 +- .../settings/component/update/update.component.ts | 12 ++++++------ .../edge/settings/profile/aliasupdate.component.ts | 7 ++++--- .../app/edge/settings/profile/profile.component.ts | 5 ++--- .../settings/system/executesystemupdate.component.ts | 2 +- .../settings/system/oe-system-update.component.ts | 2 +- .../app/shared/components/abstracthistorywidget.ts | 6 +++--- .../components/chart/abstractHistoryChartOverview.ts | 2 +- .../shared/components/chart/abstracthistorychart.ts | 2 +- .../components/flat/abstract-flat-widget-line.ts | 2 +- .../shared/components/modal/abstract-modal-line.ts | 8 ++++---- ui/src/app/shared/components/modal/abstractModal.ts | 4 ++-- ui/src/app/shared/components/modal/modal.ts | 4 ++-- ui/src/app/shared/service/service.ts | 2 +- 60 files changed, 115 insertions(+), 136 deletions(-) diff --git a/ui/src/app/edge/history/chpsoc/chpsocchartoverview/chpsocchartoverview.component.ts b/ui/src/app/edge/history/chpsoc/chpsocchartoverview/chpsocchartoverview.component.ts index 81ac979518a..da9418c8c68 100644 --- a/ui/src/app/edge/history/chpsoc/chpsocchartoverview/chpsocchartoverview.component.ts +++ b/ui/src/app/edge/history/chpsoc/chpsocchartoverview/chpsocchartoverview.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Edge, EdgeConfig, Service } from '../../../../shared/shared'; @@ -10,9 +9,9 @@ import { Edge, EdgeConfig, Service } from '../../../../shared/shared'; export class ChpSocChartOverviewComponent implements OnInit { private static readonly SELECTOR = "chpsoc-chart-overview"; - public edge: Edge = null; - public config: EdgeConfig = null; - public component: EdgeConfig.Component = null; + public edge: Edge | null = null; + public config: EdgeConfig | null = null; + public component: EdgeConfig.Component | null = null; constructor( public service: Service, diff --git a/ui/src/app/edge/history/chpsoc/widget.component.ts b/ui/src/app/edge/history/chpsoc/widget.component.ts index 1a70a19f3e9..a72c4c2fb34 100644 --- a/ui/src/app/edge/history/chpsoc/widget.component.ts +++ b/ui/src/app/edge/history/chpsoc/widget.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { QueryHistoricTimeseriesDataResponse } from 'src/app/shared/jsonrpc/response/queryHistoricTimeseriesDataResponse'; @@ -18,9 +17,9 @@ export class ChpSocWidgetComponent extends AbstractHistoryWidget implements OnIn @Input({ required: true }) public period!: DefaultTypes.HistoryPeriod; @Input({ required: true }) public componentId!: string; - public activeSecondsOverPeriod: number = null; - public edge: Edge = null; - public component: EdgeConfig.Component = null; + public activeSecondsOverPeriod: number | null = null; + public edge: Edge | null = null; + public component: EdgeConfig.Component | null = null; constructor( public override service: Service, diff --git a/ui/src/app/edge/history/delayedselltogrid/symmetricpeakshavingchartoverview/delayedselltogridchartoverview.component.ts b/ui/src/app/edge/history/delayedselltogrid/symmetricpeakshavingchartoverview/delayedselltogridchartoverview.component.ts index aafcf171fd2..c258d3f48df 100644 --- a/ui/src/app/edge/history/delayedselltogrid/symmetricpeakshavingchartoverview/delayedselltogridchartoverview.component.ts +++ b/ui/src/app/edge/history/delayedselltogrid/symmetricpeakshavingchartoverview/delayedselltogridchartoverview.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Edge, EdgeConfig, Service } from '../../../../shared/shared'; @@ -10,8 +9,8 @@ import { Edge, EdgeConfig, Service } from '../../../../shared/shared'; export class DelayedSellToGridChartOverviewComponent implements OnInit { private static readonly SELECTOR = "symmetricpeakshaving-chart-overview"; - public edge: Edge = null; - public component: EdgeConfig.Component = null; + public edge: Edge | null = null; + public component: EdgeConfig.Component | null = null; constructor( public service: Service, diff --git a/ui/src/app/edge/history/delayedselltogrid/widget.component.ts b/ui/src/app/edge/history/delayedselltogrid/widget.component.ts index e033843add5..5a537af8d69 100644 --- a/ui/src/app/edge/history/delayedselltogrid/widget.component.ts +++ b/ui/src/app/edge/history/delayedselltogrid/widget.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { ActivatedRoute } from '@angular/router'; import { Component, Input, OnInit } from '@angular/core'; import { DefaultTypes } from 'src/app/shared/service/defaulttypes'; @@ -14,8 +13,8 @@ export class DelayedSellToGridWidgetComponent implements OnInit { @Input({ required: true }) public period!: DefaultTypes.HistoryPeriod; @Input({ required: true }) public componentId!: string; - public edge: Edge = null; - public component: EdgeConfig.Component = null; + public edge: Edge | null = null; + public component: EdgeConfig.Component | null = null; constructor( public service: Service, diff --git a/ui/src/app/edge/history/fixdigitaloutput/fixdigitaloutputchartoverview/fixdigitaloutputchartoverview.component.ts b/ui/src/app/edge/history/fixdigitaloutput/fixdigitaloutputchartoverview/fixdigitaloutputchartoverview.component.ts index d62eb1766cd..59d90f56e80 100644 --- a/ui/src/app/edge/history/fixdigitaloutput/fixdigitaloutputchartoverview/fixdigitaloutputchartoverview.component.ts +++ b/ui/src/app/edge/history/fixdigitaloutput/fixdigitaloutputchartoverview/fixdigitaloutputchartoverview.component.ts @@ -11,8 +11,8 @@ export class FixDigitalOutputChartOverviewComponent implements OnInit { private static readonly SELECTOR = "fixdigitaloutput-chart-overview"; - public edge: Edge = null; - public component: EdgeConfig.Component = null; + public edge: Edge | null = null; + public component: EdgeConfig.Component | null = null; public showTotal: boolean = false; public fixDigitalOutputComponents: string[] = []; diff --git a/ui/src/app/edge/history/fixdigitaloutput/widget.component.ts b/ui/src/app/edge/history/fixdigitaloutput/widget.component.ts index bfd90d83a32..7ca50fb8bf5 100644 --- a/ui/src/app/edge/history/fixdigitaloutput/widget.component.ts +++ b/ui/src/app/edge/history/fixdigitaloutput/widget.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { QueryHistoricTimeseriesDataResponse } from 'src/app/shared/jsonrpc/response/queryHistoricTimeseriesDataResponse'; @@ -17,12 +16,11 @@ export class FixDigitalOutputWidgetComponent extends AbstractHistoryWidget imple private static readonly SELECTOR = "fixDigitalOutputWidget"; @Input({ required: true }) public period!: DefaultTypes.HistoryPeriod; @Input({ required: true }) public componentId!: string; - public component: EdgeConfig.Component = null; - public activeSecondsOverPeriod: number = null; - public edge: Edge = null; - private config: EdgeConfig = null; - + public component: EdgeConfig.Component | null = null; + public activeSecondsOverPeriod: number | null = null; + public edge: Edge | null = null; + private config: EdgeConfig | null = null; constructor( public override service: Service, diff --git a/ui/src/app/edge/history/heatingelement/heatingelementchartoverview/heatingelementchartoverview.component.ts b/ui/src/app/edge/history/heatingelement/heatingelementchartoverview/heatingelementchartoverview.component.ts index 7a1602609cb..440eeb2c38b 100644 --- a/ui/src/app/edge/history/heatingelement/heatingelementchartoverview/heatingelementchartoverview.component.ts +++ b/ui/src/app/edge/history/heatingelement/heatingelementchartoverview/heatingelementchartoverview.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Edge, EdgeConfig, Service } from '../../../../shared/shared'; @@ -10,8 +9,8 @@ import { Edge, EdgeConfig, Service } from '../../../../shared/shared'; export class HeatingelementChartOverviewComponent implements OnInit { private static readonly SELECTOR = "heatingelement-chart-overview"; - public edge: Edge = null; - public component: EdgeConfig.Component = null; + public edge: Edge | null = null; + public component: EdgeConfig.Component | null = null; constructor( public service: Service, diff --git a/ui/src/app/edge/history/heatingelement/widget.component.ts b/ui/src/app/edge/history/heatingelement/widget.component.ts index 5b87aa8548e..5f39ae03bd0 100644 --- a/ui/src/app/edge/history/heatingelement/widget.component.ts +++ b/ui/src/app/edge/history/heatingelement/widget.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { QueryHistoricTimeseriesDataResponse } from 'src/app/shared/jsonrpc/response/queryHistoricTimeseriesDataResponse'; @@ -18,13 +17,13 @@ export class HeatingelementWidgetComponent extends AbstractHistoryWidget impleme @Input({ required: true }) public componentId!: string; - public component: EdgeConfig.Component = null; + public component: EdgeConfig.Component | null = null; public activeTimeOverPeriodLevel1: number | null = null; public activeTimeOverPeriodLevel2: number | null = null; public activeTimeOverPeriodLevel3: number | null = null; - public edge: Edge = null; + public edge: Edge | null = null; constructor( public override service: Service, diff --git a/ui/src/app/edge/history/heatpump/heatpumpchartoverview/heatpumpchartoverview.component.ts b/ui/src/app/edge/history/heatpump/heatpumpchartoverview/heatpumpchartoverview.component.ts index 93e94726d5e..16b4085313c 100644 --- a/ui/src/app/edge/history/heatpump/heatpumpchartoverview/heatpumpchartoverview.component.ts +++ b/ui/src/app/edge/history/heatpump/heatpumpchartoverview/heatpumpchartoverview.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { ModalController } from '@ionic/angular'; @@ -12,8 +11,8 @@ export class HeatPumpChartOverviewComponent implements OnInit { private static readonly SELECTOR = "heatpump-chart-overview"; - public edge: Edge = null; - public component: EdgeConfig.Component = null; + public edge: Edge | null = null; + public component: EdgeConfig.Component | null = null; constructor( public service: Service, diff --git a/ui/src/app/edge/history/heatpump/widget.component.ts b/ui/src/app/edge/history/heatpump/widget.component.ts index b4398a8b7e0..30b91ac9062 100644 --- a/ui/src/app/edge/history/heatpump/widget.component.ts +++ b/ui/src/app/edge/history/heatpump/widget.component.ts @@ -24,7 +24,7 @@ export class HeatpumpWidgetComponent extends AbstractHistoryWidget implements On public activeTimeOverPeriodRecommendation: number | null = null; public activeTimeOverPeriodLock: number | null = null; - public edge: Edge = null; + public edge: Edge | null = null; constructor( public override service: Service, diff --git a/ui/src/app/edge/history/history.component.ts b/ui/src/app/edge/history/history.component.ts index 929374c7f3a..b0a4c35e4bf 100644 --- a/ui/src/app/edge/history/history.component.ts +++ b/ui/src/app/edge/history/history.component.ts @@ -24,15 +24,15 @@ export class HistoryComponent implements OnInit { public energyChartHeight: string = "250px"; // holds the Widgets - public widgets: Widgets = null; + public widgets: Widgets | null = null; // holds the current Edge - public edge: Edge = null; + public edge: Edge | null = null; // holds Channelthreshold Components to display effective active time in % // public channelthresholdComponents: string[] = []; - public config: EdgeConfig = null; + public config: EdgeConfig | null = null; protected errorResponse: JsonrpcResponseError | null = null; constructor( diff --git a/ui/src/app/edge/history/peakshaving/asymmetric/asymmetricpeakshavingchartoverview/asymmetricpeakshavingchartoverview.component.ts b/ui/src/app/edge/history/peakshaving/asymmetric/asymmetricpeakshavingchartoverview/asymmetricpeakshavingchartoverview.component.ts index 4bad4684779..3cb22de5eca 100644 --- a/ui/src/app/edge/history/peakshaving/asymmetric/asymmetricpeakshavingchartoverview/asymmetricpeakshavingchartoverview.component.ts +++ b/ui/src/app/edge/history/peakshaving/asymmetric/asymmetricpeakshavingchartoverview/asymmetricpeakshavingchartoverview.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Edge, EdgeConfig, Service } from '../../../../../shared/shared'; @@ -10,8 +9,8 @@ import { Edge, EdgeConfig, Service } from '../../../../../shared/shared'; export class AsymmetricPeakshavingChartOverviewComponent implements OnInit { private static readonly SELECTOR = "asymmetricpeakshaving-chart-overview"; - public edge: Edge = null; - public component: EdgeConfig.Component = null; + public edge: Edge | null = null; + public component: EdgeConfig.Component | null = null; constructor( public service: Service, diff --git a/ui/src/app/edge/history/peakshaving/asymmetric/widget.component.ts b/ui/src/app/edge/history/peakshaving/asymmetric/widget.component.ts index 519a5dd0eb1..85a4b2581e2 100644 --- a/ui/src/app/edge/history/peakshaving/asymmetric/widget.component.ts +++ b/ui/src/app/edge/history/peakshaving/asymmetric/widget.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { ActivatedRoute } from '@angular/router'; import { Component, Input, OnInit } from '@angular/core'; import { DefaultTypes } from 'src/app/shared/service/defaulttypes'; @@ -15,8 +14,8 @@ export class AsymmetricPeakshavingWidgetComponent implements OnInit { @Input({ required: true }) public componentId!: string; - public edge: Edge = null; - public component: EdgeConfig.Component = null; + public edge: Edge | null = null; + public component: EdgeConfig.Component | null = null; constructor( public service: Service, diff --git a/ui/src/app/edge/history/peakshaving/symmetric/symmetricpeakshavingchartoverview/symmetricpeakshavingchartoverview.component.ts b/ui/src/app/edge/history/peakshaving/symmetric/symmetricpeakshavingchartoverview/symmetricpeakshavingchartoverview.component.ts index c799266e6e6..8e578e2b5fa 100644 --- a/ui/src/app/edge/history/peakshaving/symmetric/symmetricpeakshavingchartoverview/symmetricpeakshavingchartoverview.component.ts +++ b/ui/src/app/edge/history/peakshaving/symmetric/symmetricpeakshavingchartoverview/symmetricpeakshavingchartoverview.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Edge, EdgeConfig, Service } from '../../../../../shared/shared'; @@ -11,8 +10,8 @@ export class SymmetricPeakshavingChartOverviewComponent implements OnInit { private static readonly SELECTOR = "symmetricpeakshaving-chart-overview"; - public edge: Edge = null; - public component: EdgeConfig.Component = null; + public edge: Edge | null = null; + public component: EdgeConfig.Component | null = null; constructor( public service: Service, diff --git a/ui/src/app/edge/history/peakshaving/symmetric/widget.component.ts b/ui/src/app/edge/history/peakshaving/symmetric/widget.component.ts index 2e640fd33bf..0ae228ca9f5 100644 --- a/ui/src/app/edge/history/peakshaving/symmetric/widget.component.ts +++ b/ui/src/app/edge/history/peakshaving/symmetric/widget.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, Input, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { DefaultTypes } from 'src/app/shared/service/defaulttypes'; @@ -15,8 +14,8 @@ export class SymmetricPeakshavingWidgetComponent implements OnInit { @Input({ required: true }) public componentId!: string; - public edge: Edge = null; - public component: EdgeConfig.Component = null; + public edge: Edge | null = null; + public component: EdgeConfig.Component | null = null; constructor( public service: Service, diff --git a/ui/src/app/edge/history/peakshaving/timeslot/timeslotpeakshavingchartoverview/timeslotpeakshavingchartoverview.component.ts b/ui/src/app/edge/history/peakshaving/timeslot/timeslotpeakshavingchartoverview/timeslotpeakshavingchartoverview.component.ts index db43d059772..9c83adacd26 100644 --- a/ui/src/app/edge/history/peakshaving/timeslot/timeslotpeakshavingchartoverview/timeslotpeakshavingchartoverview.component.ts +++ b/ui/src/app/edge/history/peakshaving/timeslot/timeslotpeakshavingchartoverview/timeslotpeakshavingchartoverview.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Edge, EdgeConfig, Service } from '../../../../../shared/shared'; @@ -11,8 +10,8 @@ export class TimeslotPeakshavingChartOverviewComponent implements OnInit { private static readonly SELECTOR = "timeslotpeakshaving-chart-overview"; - public edge: Edge = null; - public component: EdgeConfig.Component = null; + public edge: Edge | null = null; + public component: EdgeConfig.Component | null = null; constructor( public service: Service, diff --git a/ui/src/app/edge/history/peakshaving/timeslot/widget.component.ts b/ui/src/app/edge/history/peakshaving/timeslot/widget.component.ts index eb21a9baa36..6903d838553 100644 --- a/ui/src/app/edge/history/peakshaving/timeslot/widget.component.ts +++ b/ui/src/app/edge/history/peakshaving/timeslot/widget.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, Input, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { DefaultTypes } from 'src/app/shared/service/defaulttypes'; @@ -15,8 +14,8 @@ export class TimeslotPeakshavingWidgetComponent implements OnInit { @Input({ required: true }) public componentId!: string; - public edge: Edge = null; - public component: EdgeConfig.Component = null; + public edge: Edge | null = null; + public component: EdgeConfig.Component | null = null; constructor( public service: Service, diff --git a/ui/src/app/edge/history/singlethreshold/chart.component.ts b/ui/src/app/edge/history/singlethreshold/chart.component.ts index 9f72328789a..3165adec062 100644 --- a/ui/src/app/edge/history/singlethreshold/chart.component.ts +++ b/ui/src/app/edge/history/singlethreshold/chart.component.ts @@ -99,7 +99,7 @@ export class SinglethresholdChartComponent extends AbstractHistoryChart implemen }); } if (channel == inputChannel) { - let inputLabel: string = null; + let inputLabel: string | null = null; const address = ChannelAddress.fromString(channel); switch (address.channelId) { case 'GridActivePower': diff --git a/ui/src/app/edge/history/singlethreshold/singlethresholdchartoverview/singlethresholdchartoverview.component.ts b/ui/src/app/edge/history/singlethreshold/singlethresholdchartoverview/singlethresholdchartoverview.component.ts index 611f80251a1..752aafb63ea 100644 --- a/ui/src/app/edge/history/singlethreshold/singlethresholdchartoverview/singlethresholdchartoverview.component.ts +++ b/ui/src/app/edge/history/singlethreshold/singlethresholdchartoverview/singlethresholdchartoverview.component.ts @@ -11,9 +11,9 @@ export class SinglethresholdChartOverviewComponent implements OnInit { private static readonly SELECTOR = "channelthreshold-chart-overview"; - public edge: Edge = null; + public edge: Edge | null = null; - public component: EdgeConfig.Component = null; + public component: EdgeConfig.Component | null = null; public inputChannel: string; // reference to the Utils method to access via html diff --git a/ui/src/app/edge/history/singlethreshold/widget.component.ts b/ui/src/app/edge/history/singlethreshold/widget.component.ts index 8d0aae9052c..c0ba1844e78 100644 --- a/ui/src/app/edge/history/singlethreshold/widget.component.ts +++ b/ui/src/app/edge/history/singlethreshold/widget.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { QueryHistoricTimeseriesDataResponse } from 'src/app/shared/jsonrpc/response/queryHistoricTimeseriesDataResponse'; @@ -19,9 +18,9 @@ export class SinglethresholdWidgetComponent extends AbstractHistoryWidget implem @Input({ required: true }) public period!: DefaultTypes.HistoryPeriod; @Input({ required: true }) public componentId!: string; - public activeSecondsOverPeriod: number = null; - public edge: Edge = null; - public component: EdgeConfig.Component = null; + public activeSecondsOverPeriod: number | null = null; + public edge: Edge | null = null; + public component: EdgeConfig.Component | null = null; constructor( public override service: Service, diff --git a/ui/src/app/edge/history/storage/chargerchart.component.ts b/ui/src/app/edge/history/storage/chargerchart.component.ts index a82e8d60ed6..60c1ddedb19 100644 --- a/ui/src/app/edge/history/storage/chargerchart.component.ts +++ b/ui/src/app/edge/history/storage/chargerchart.component.ts @@ -16,7 +16,7 @@ export class StorageChargerChartComponent extends AbstractHistoryChart implement @Input({ required: true }) public period!: DefaultTypes.HistoryPeriod; @Input({ required: true }) public componentId!: string; - private moreThanOneProducer: boolean = null; + private moreThanOneProducer: boolean | null = null; constructor( protected override service: Service, diff --git a/ui/src/app/edge/history/storage/esschart.component.ts b/ui/src/app/edge/history/storage/esschart.component.ts index c338f6c274a..45071d138f8 100644 --- a/ui/src/app/edge/history/storage/esschart.component.ts +++ b/ui/src/app/edge/history/storage/esschart.component.ts @@ -18,7 +18,7 @@ export class StorageESSChartComponent extends AbstractHistoryChart implements On @Input({ required: true }) public componentId!: string; @Input({ required: true }) public showPhases!: boolean; - private moreThanOneProducer: boolean = null; + private moreThanOneProducer: boolean | null = null; constructor( protected override service: Service, diff --git a/ui/src/app/edge/history/storage/storagechartoverview/storagechartoverview.component.ts b/ui/src/app/edge/history/storage/storagechartoverview/storagechartoverview.component.ts index 3443f4c1a87..84f1c456a1a 100644 --- a/ui/src/app/edge/history/storage/storagechartoverview/storagechartoverview.component.ts +++ b/ui/src/app/edge/history/storage/storagechartoverview/storagechartoverview.component.ts @@ -11,10 +11,10 @@ export class StorageChartOverviewComponent implements OnInit { private static readonly SELECTOR = "storage-chart-overview"; - public edge: Edge = null; + public edge: Edge | null = null; - public essComponents: EdgeConfig.Component[] = null; - public chargerComponents: EdgeConfig.Component[] = null; + public essComponents: EdgeConfig.Component[] | null = null; + public chargerComponents: EdgeConfig.Component[] | null = null; public showPhases: boolean = false; public showTotal: boolean = false; diff --git a/ui/src/app/edge/history/storage/widget.component.ts b/ui/src/app/edge/history/storage/widget.component.ts index 4c7325117e1..57987a5ca63 100644 --- a/ui/src/app/edge/history/storage/widget.component.ts +++ b/ui/src/app/edge/history/storage/widget.component.ts @@ -18,8 +18,8 @@ export class StorageComponent extends AbstractHistoryWidget implements OnInit, O // reference to the Utils method to access via html public isLastElement = Utils.isLastElement; - public data: Cumulated = null; - public edge: Edge = null; + public data: Cumulated | null = null; + public edge: Edge | null = null; public essComponents: EdgeConfig.Component[] = []; constructor( diff --git a/ui/src/app/edge/live/Controller/ChpSoc/ChpSoc.ts b/ui/src/app/edge/live/Controller/ChpSoc/ChpSoc.ts index 2ff97d2e9a5..9a56102cea6 100644 --- a/ui/src/app/edge/live/Controller/ChpSoc/ChpSoc.ts +++ b/ui/src/app/edge/live/Controller/ChpSoc/ChpSoc.ts @@ -13,10 +13,9 @@ import { Controller_ChpSocModalComponent } from './modal/modal.component'; export class Controller_ChpSocComponent extends AbstractFlatWidget { private static PROPERTY_MODE: string = '_PropertyMode'; - - public inputChannel: ChannelAddress = null; - public outputChannel: ChannelAddress = null; - public propertyModeChannel: ChannelAddress = null; + public inputChannel: ChannelAddress | null = null; + public outputChannel: ChannelAddress | null = null; + public propertyModeChannel: ChannelAddress | null = null; public highThresholdValue: number; public lowThresholdValue: number; public state: string; diff --git a/ui/src/app/edge/live/Controller/Ess/FixActivePower/flat/flat.ts b/ui/src/app/edge/live/Controller/Ess/FixActivePower/flat/flat.ts index 8e0442eb7d1..fd80147f88a 100644 --- a/ui/src/app/edge/live/Controller/Ess/FixActivePower/flat/flat.ts +++ b/ui/src/app/edge/live/Controller/Ess/FixActivePower/flat/flat.ts @@ -16,7 +16,7 @@ export class FlatComponent extends AbstractFlatWidget { public readonly CONVERT_MANUAL_ON_OFF = Utils.CONVERT_MANUAL_ON_OFF(this.translate); public chargeDischargePower: { name: string, value: number }; - public propertyMode: DefaultTypes.ManualOnOff = null; + public propertyMode: DefaultTypes.ManualOnOff | null = null; async presentModal() { if (!this.isInitialized) { diff --git a/ui/src/app/edge/live/Controller/Ess/GridOptimizedCharge/flat/flat.ts b/ui/src/app/edge/live/Controller/Ess/GridOptimizedCharge/flat/flat.ts index d8a3e9b9ab9..27f56312580 100644 --- a/ui/src/app/edge/live/Controller/Ess/GridOptimizedCharge/flat/flat.ts +++ b/ui/src/app/edge/live/Controller/Ess/GridOptimizedCharge/flat/flat.ts @@ -11,7 +11,7 @@ import { ModalComponent } from '../modal/modal'; }) export class FlatComponent extends AbstractFlatWidget { - public override component: EdgeConfig.Component = null; + public override component: EdgeConfig.Component | null = null; public mode: string = '-'; public state: string = '-'; public isSellToGridLimitAvoided: boolean = false; diff --git a/ui/src/app/edge/live/Controller/Ess/GridOptimizedCharge/modal/modal.ts b/ui/src/app/edge/live/Controller/Ess/GridOptimizedCharge/modal/modal.ts index ed019e9e0cd..07343c6befa 100644 --- a/ui/src/app/edge/live/Controller/Ess/GridOptimizedCharge/modal/modal.ts +++ b/ui/src/app/edge/live/Controller/Ess/GridOptimizedCharge/modal/modal.ts @@ -22,11 +22,11 @@ export class ModalComponent extends AbstractModal { public state: string = ''; public chargeLimit: { name: string, value: number }; public delayChargeState: number | null = null; - public maximumSellToGridPower: number = null; + public maximumSellToGridPower: number | null = null; public targetMinute: number | null = null; public delayChargeMaximumChargeLimit: number | null = null; public targetEpochSeconds: number | null = null; - public chargeStartEpochSeconds: number = null; + public chargeStartEpochSeconds: number | null = null; protected override getChannelAddresses(): ChannelAddress[] { this.refreshChart = false; diff --git a/ui/src/app/edge/live/Controller/Evcs/administration/administration.component.ts b/ui/src/app/edge/live/Controller/Evcs/administration/administration.component.ts index 7bb03469098..9b2d74b6c55 100644 --- a/ui/src/app/edge/live/Controller/Evcs/administration/administration.component.ts +++ b/ui/src/app/edge/live/Controller/Evcs/administration/administration.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, Input, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { ModalController } from '@ionic/angular'; @@ -17,7 +16,7 @@ export class AdministrationComponent implements OnInit { @Input({ required: true }) public edge!: Edge; // used for ion-toggle in html - public isCheckedZoe: boolean = null; + public isCheckedZoe: boolean | null = null; constructor( private route: ActivatedRoute, diff --git a/ui/src/app/edge/live/Controller/Evcs/flat/flat.ts b/ui/src/app/edge/live/Controller/Evcs/flat/flat.ts index 7836e8cd0d1..f4d3d8a38e9 100644 --- a/ui/src/app/edge/live/Controller/Evcs/flat/flat.ts +++ b/ui/src/app/edge/live/Controller/Evcs/flat/flat.ts @@ -19,7 +19,7 @@ export class FlatComponent extends AbstractFlatWidget { public readonly CONVERT_MANUAL_ON_OFF = Utils.CONVERT_MANUAL_ON_OFF(this.translate); protected controller: EdgeConfig.Component; - protected evcsComponent: EdgeConfig.Component = null; + protected evcsComponent: EdgeConfig.Component | null = null; protected isConnectionSuccessful: boolean = false; protected isEnergySinceBeginningAllowed: boolean = false; protected mode: string; @@ -33,14 +33,14 @@ export class FlatComponent extends AbstractFlatWidget { protected minChargePower: number; protected maxChargePower: number; protected forceChargeMinPower: string; - protected chargeMode: ChargeMode = null; + protected chargeMode: ChargeMode | null = null; protected readonly CONVERT_TO_WATT = Utils.CONVERT_TO_WATT; protected readonly CONVERT_TO_KILO_WATTHOURS = Utils.CONVERT_TO_KILO_WATTHOURS; protected readonly CONVERT_MANUAL_ON_OFF_AUTOMATIC = Utils.CONVERT_MODE_TO_MANUAL_OFF_AUTOMATIC(this.translate); protected chargeTarget: string; protected energySession: string; protected chargeDischargePower: { name: string, value: number }; - protected propertyMode: DefaultTypes.ManualOnOff = null; + protected propertyMode: DefaultTypes.ManualOnOff | null = null; protected status: string; formatNumber(i: number) { diff --git a/ui/src/app/edge/live/Controller/Evcs/modal/modal.ts b/ui/src/app/edge/live/Controller/Evcs/modal/modal.ts index 0f3179af0f0..461ab9bdba5 100644 --- a/ui/src/app/edge/live/Controller/Evcs/modal/modal.ts +++ b/ui/src/app/edge/live/Controller/Evcs/modal/modal.ts @@ -32,7 +32,7 @@ export class ModalComponent extends AbstractModal { protected numberOfPhases: number = 3; // Defaults to three phases protected defaultChargeMinPower: number; protected energyLimit: boolean; - protected chargeMode: ChargeMode = null; + protected chargeMode: ChargeMode | null = null; protected isEnergySinceBeginningAllowed: boolean = false; protected isChargingEnabled: boolean = false; protected sessionLimit: number; diff --git a/ui/src/app/edge/live/Controller/Io/Heatpump/Io_Heatpump.ts b/ui/src/app/edge/live/Controller/Io/Heatpump/Io_Heatpump.ts index 259028e54b7..2d8ec32c161 100644 --- a/ui/src/app/edge/live/Controller/Io/Heatpump/Io_Heatpump.ts +++ b/ui/src/app/edge/live/Controller/Io/Heatpump/Io_Heatpump.ts @@ -14,7 +14,7 @@ export class Controller_Io_HeatpumpComponent extends AbstractFlatWidget { private static PROPERTY_MODE: string = '_PropertyMode'; - public override component: EdgeConfig.Component = null; + public override component: EdgeConfig.Component | null = null; public status: BehaviorSubject<{ name: string }> = new BehaviorSubject(null); public isConnectionSuccessful: boolean; public mode: string; diff --git a/ui/src/app/edge/live/Io/Api_DigitalInput/Io_Api_DigitalInput.ts b/ui/src/app/edge/live/Io/Api_DigitalInput/Io_Api_DigitalInput.ts index d28da112f7f..0c64f49d90c 100644 --- a/ui/src/app/edge/live/Io/Api_DigitalInput/Io_Api_DigitalInput.ts +++ b/ui/src/app/edge/live/Io/Api_DigitalInput/Io_Api_DigitalInput.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component } from '@angular/core'; import { AbstractFlatWidget } from 'src/app/shared/components/flat/abstract-flat-widget'; import { EdgeConfig } from 'src/app/shared/shared'; @@ -12,7 +11,7 @@ import { Io_Api_DigitalInput_ModalComponent } from './modal/modal.component'; export class Io_Api_DigitalInputComponent extends AbstractFlatWidget { - public ioComponents: EdgeConfig.Component[] = null; + public ioComponents: EdgeConfig.Component[] | null = null; public ioComponentCount = 0; async presentModal() { diff --git a/ui/src/app/edge/live/Multiple/Evcs_Api_Cluster/Evcs_Api_Cluster.ts b/ui/src/app/edge/live/Multiple/Evcs_Api_Cluster/Evcs_Api_Cluster.ts index bb09d1797bb..830159e6d27 100644 --- a/ui/src/app/edge/live/Multiple/Evcs_Api_Cluster/Evcs_Api_Cluster.ts +++ b/ui/src/app/edge/live/Multiple/Evcs_Api_Cluster/Evcs_Api_Cluster.ts @@ -14,7 +14,7 @@ export class Evcs_Api_ClusterComponent extends AbstractFlatWidget { public channelAddresses: ChannelAddress[] = []; public evcsIdsInCluster: string[] = []; public evcssInCluster: EdgeConfig.Component[] = []; - public evcsComponent: EdgeConfig.Component = null; + public evcsComponent: EdgeConfig.Component | null = null; public evcsMap: { [sourceId: string]: EdgeConfig.Component } = {}; public isConnectionSuccessful: boolean; public alias: string; diff --git a/ui/src/app/edge/live/Multiple/Evcs_Api_Cluster/modal/evcsCluster-modal.page.ts b/ui/src/app/edge/live/Multiple/Evcs_Api_Cluster/modal/evcsCluster-modal.page.ts index 8969624eb12..13b2dfaeb2d 100644 --- a/ui/src/app/edge/live/Multiple/Evcs_Api_Cluster/modal/evcsCluster-modal.page.ts +++ b/ui/src/app/edge/live/Multiple/Evcs_Api_Cluster/modal/evcsCluster-modal.page.ts @@ -15,7 +15,7 @@ type Priority = 'CAR' | 'STORAGE'; export class Evcs_Api_ClusterModalComponent implements OnInit { @Input({ required: true }) public edge!: Edge; - @Input() public config: EdgeConfig.Component = null; + @Input() public config: EdgeConfig.Component | null = null; @Input({ required: true }) public componentId!: string; @Input() public evcsMap: { [sourceId: string]: EdgeConfig.Component } = {}; diff --git a/ui/src/app/edge/live/common/consumption/flat/flat.ts b/ui/src/app/edge/live/common/consumption/flat/flat.ts index 0b6ed57d031..bcc6602c7f0 100644 --- a/ui/src/app/edge/live/common/consumption/flat/flat.ts +++ b/ui/src/app/edge/live/common/consumption/flat/flat.ts @@ -11,7 +11,7 @@ import { ModalComponent } from '../modal/modal'; export class FlatComponent extends AbstractFlatWidget { public evcss: EdgeConfig.Component[] | null = null; - public consumptionMeters: EdgeConfig.Component[] = null; + public consumptionMeters: EdgeConfig.Component[] | null = null; public sumActivePower: number = 0; public evcsSumOfChargePower: number; public otherPower: number; diff --git a/ui/src/app/edge/live/common/storage/modal/modal.component.ts b/ui/src/app/edge/live/common/storage/modal/modal.component.ts index 0c4de15b7d4..e64da36eb1b 100644 --- a/ui/src/app/edge/live/common/storage/modal/modal.component.ts +++ b/ui/src/app/edge/live/common/storage/modal/modal.component.ts @@ -19,7 +19,7 @@ export class StorageModalComponent implements OnInit, OnDestroy { @Input({ required: true }) protected config!: EdgeConfig; @Input() protected essComponents: EdgeConfig.Component[] | null = null; @Input({ required: true }) protected chargerComponents!: EdgeConfig.Component[]; - @Input() protected singleComponent: EdgeConfig.Component = null; + @Input() protected singleComponent: EdgeConfig.Component | null = null; // reference to the Utils method to access via html public isLastElement = Utils.isLastElement; diff --git a/ui/src/app/edge/live/common/storage/storage.component.ts b/ui/src/app/edge/live/common/storage/storage.component.ts index 692eeb05770..98549f34bff 100644 --- a/ui/src/app/edge/live/common/storage/storage.component.ts +++ b/ui/src/app/edge/live/common/storage/storage.component.ts @@ -16,7 +16,7 @@ export class StorageComponent extends AbstractFlatWidget { public essComponents: EdgeConfig.Component[] = []; public chargerComponents: EdgeConfig.Component[] = []; - public storageIconStyle: string = null; + public storageIconStyle: string | null = null; public isHybridEss: boolean[] = []; public emergencyReserveComponents: { [essId: string]: EdgeConfig.Component } = {}; public currentSoc: number[] = []; diff --git a/ui/src/app/edge/live/delayedselltogrid/delayedselltogrid.component.ts b/ui/src/app/edge/live/delayedselltogrid/delayedselltogrid.component.ts index ea2ca6e7d0a..13e4c3dd1b9 100644 --- a/ui/src/app/edge/live/delayedselltogrid/delayedselltogrid.component.ts +++ b/ui/src/app/edge/live/delayedselltogrid/delayedselltogrid.component.ts @@ -16,9 +16,9 @@ export class DelayedSellToGridComponent implements OnInit, OnDestroy { @Input({ required: true }) public componentId!: string; - public edge: Edge = null; + public edge: Edge | null = null; - public component: EdgeConfig.Component = null; + public component: EdgeConfig.Component | null = null; constructor( private route: ActivatedRoute, diff --git a/ui/src/app/edge/live/energymonitor/chart/section/abstractsection.component.ts b/ui/src/app/edge/live/energymonitor/chart/section/abstractsection.component.ts index 9a6dfc9b214..869a8d30bf9 100644 --- a/ui/src/app/edge/live/energymonitor/chart/section/abstractsection.component.ts +++ b/ui/src/app/edge/live/energymonitor/chart/section/abstractsection.component.ts @@ -120,7 +120,7 @@ export abstract class AbstractSection { public fillRef: string = ""; public valuePath: string = ""; public outlinePath: string = ""; - public energyFlow: EnergyFlow = null; + public energyFlow: EnergyFlow | null = null; public square: SvgSquare; public squarePosition: SvgSquarePosition; public name: string = ""; @@ -136,7 +136,7 @@ export abstract class AbstractSection { protected gridMode: GridMode; protected restrictionMode: number; - private lastCurrentData: DefaultTypes.Summary = null; + private lastCurrentData: DefaultTypes.Summary | null = null; constructor( translateName: string, diff --git a/ui/src/app/edge/live/energymonitor/energymonitor.component.ts b/ui/src/app/edge/live/energymonitor/energymonitor.component.ts index 031658e1429..d696a7497ba 100644 --- a/ui/src/app/edge/live/energymonitor/energymonitor.component.ts +++ b/ui/src/app/edge/live/energymonitor/energymonitor.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { ChannelAddress, Edge, Service, Websocket } from '../../../shared/shared'; diff --git a/ui/src/app/edge/live/live.component.ts b/ui/src/app/edge/live/live.component.ts index 8ac34ca0542..07ef40f7c93 100644 --- a/ui/src/app/edge/live/live.component.ts +++ b/ui/src/app/edge/live/live.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { RefresherCustomEvent } from '@ionic/angular'; @@ -12,9 +11,9 @@ import { Edge, EdgeConfig, Service, Utils, Websocket, Widgets } from 'src/app/sh }) export class LiveComponent implements OnInit, OnDestroy { - public edge: Edge = null; - public config: EdgeConfig = null; - public widgets: Widgets = null; + public edge: Edge | null = null; + public config: EdgeConfig | null = null; + public widgets: Widgets | null = null; private stopOnDestroy: Subject = new Subject(); constructor( diff --git a/ui/src/app/edge/settings/app/formly/safe-input/formly-safe-input-modal.component.ts b/ui/src/app/edge/settings/app/formly/safe-input/formly-safe-input-modal.component.ts index 60ef52e3be1..87110962d05 100644 --- a/ui/src/app/edge/settings/app/formly/safe-input/formly-safe-input-modal.component.ts +++ b/ui/src/app/edge/settings/app/formly/safe-input/formly-safe-input-modal.component.ts @@ -13,7 +13,7 @@ export class FormlySafeInputModalComponent implements OnInit { @Input({ required: true }) protected title!: string; @Input() - protected fields: FormlyFieldConfig[] = null; + protected fields: FormlyFieldConfig[] | null = null; @Input({ required: true }) protected model!: {}; diff --git a/ui/src/app/edge/settings/app/install.component.ts b/ui/src/app/edge/settings/app/install.component.ts index 8a5a8775ffd..18468365653 100644 --- a/ui/src/app/edge/settings/app/install.component.ts +++ b/ui/src/app/edge/settings/app/install.component.ts @@ -28,7 +28,7 @@ export class InstallAppComponent implements OnInit, OnDestroy { public readonly spinnerId: string = InstallAppComponent.SELECTOR; protected form: FormGroup | null = null; - protected fields: FormlyFieldConfig[] = null; + protected fields: FormlyFieldConfig[] | null = null; protected model: any | null = null; protected appName: string | null = null; protected isInstalling: boolean = false; diff --git a/ui/src/app/edge/settings/channels/channels.component.ts b/ui/src/app/edge/settings/channels/channels.component.ts index 0949912ca8e..2cf0ec77779 100644 --- a/ui/src/app/edge/settings/channels/channels.component.ts +++ b/ui/src/app/edge/settings/channels/channels.component.ts @@ -24,8 +24,8 @@ export class ChannelsComponent { }; protected readonly spinnerId = ChannelsComponent.SELECTOR; protected readonly environment = environment; - protected edge: Edge = null; - protected config: EdgeConfig = null; + protected edge: Edge | null = null; + protected config: EdgeConfig | null = null; protected channelsPerComponent = new Map(); protected selectedComponentChannels = new Map>(); // TODO should be a simple SET but equality checking in SETs is currently not changeable and therefore not very useful for objects diff --git a/ui/src/app/edge/settings/component/install/install.component.ts b/ui/src/app/edge/settings/component/install/install.component.ts index d53a0a642fc..360f2895de0 100644 --- a/ui/src/app/edge/settings/component/install/install.component.ts +++ b/ui/src/app/edge/settings/component/install/install.component.ts @@ -13,13 +13,13 @@ export class ComponentInstallComponent implements OnInit { private static readonly SELECTOR = "componentInstall"; - public edge: Edge = null; - public factory: EdgeConfig.Factory = null; + public edge: Edge | null = null; + public factory: EdgeConfig.Factory | null = null; public form = null; public model = null; - public fields: FormlyFieldConfig[] = null; + public fields: FormlyFieldConfig[] | null = null; - private factoryId: string = null; + private factoryId: string | null = null; constructor( private route: ActivatedRoute, diff --git a/ui/src/app/edge/settings/component/update/index.component.ts b/ui/src/app/edge/settings/component/update/index.component.ts index 1d869715df9..05e6efe2b3f 100644 --- a/ui/src/app/edge/settings/component/update/index.component.ts +++ b/ui/src/app/edge/settings/component/update/index.component.ts @@ -16,7 +16,7 @@ export class IndexComponent implements OnInit { private static readonly SELECTOR = "indexComponentUpdate"; - public config: EdgeConfig = null; + public config: EdgeConfig | null = null; public list: MyCategorizedComponents[]; public showAllEntries = false; diff --git a/ui/src/app/edge/settings/component/update/update.component.ts b/ui/src/app/edge/settings/component/update/update.component.ts index 08a268df402..ff1f9201fcd 100644 --- a/ui/src/app/edge/settings/component/update/update.component.ts +++ b/ui/src/app/edge/settings/component/update/update.component.ts @@ -13,14 +13,14 @@ export class ComponentUpdateComponent implements OnInit { private static readonly SELECTOR = "componentUpdate"; - public edge: Edge = null; - public factory: EdgeConfig.Factory = null; - public form: FormGroup = null; + public edge: Edge | null = null; + public factory: EdgeConfig.Factory | null = null; + public form: FormGroup | null = null; public model = null; - public fields: FormlyFieldConfig[] = null; - public componentIcon: string = null; + public fields: FormlyFieldConfig[] | null = null; + public componentIcon: string | null = null; - private componentId: string = null; + private componentId: string | null = null; constructor( private route: ActivatedRoute, diff --git a/ui/src/app/edge/settings/profile/aliasupdate.component.ts b/ui/src/app/edge/settings/profile/aliasupdate.component.ts index 28c1c375674..528d653b9da 100644 --- a/ui/src/app/edge/settings/profile/aliasupdate.component.ts +++ b/ui/src/app/edge/settings/profile/aliasupdate.component.ts @@ -11,10 +11,11 @@ import { Edge, EdgeConfig, Service, Websocket } from 'src/app/shared/shared'; }) export class AliasUpdateComponent implements OnInit { - public component: EdgeConfig.Component = null; + public component: EdgeConfig.Component | null = null; + public formGroup: FormGroup | null = null; - public factory: EdgeConfig.Factory = null; - public componentIcon: string = null; + public factory: EdgeConfig.Factory | null = null; + public componentIcon: string | null = null; private edge: Edge; diff --git a/ui/src/app/edge/settings/profile/profile.component.ts b/ui/src/app/edge/settings/profile/profile.component.ts index 3f2591e875e..a6ca6b3a0f5 100644 --- a/ui/src/app/edge/settings/profile/profile.component.ts +++ b/ui/src/app/edge/settings/profile/profile.component.ts @@ -1,4 +1,3 @@ -// @ts-strict-ignore import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { PopoverController } from '@ionic/angular'; @@ -22,8 +21,8 @@ export class ProfileComponent implements OnInit { public environment = environment; - public edge: Edge = null; - public config: EdgeConfig = null; + public edge: Edge | null = null; + public config: EdgeConfig | null = null; public subscribedChannels: ChannelAddress[] = []; public components: CategorizedComponents[] | null = null; diff --git a/ui/src/app/edge/settings/system/executesystemupdate.component.ts b/ui/src/app/edge/settings/system/executesystemupdate.component.ts index 739791ffc2f..7aed9eef8b7 100644 --- a/ui/src/app/edge/settings/system/executesystemupdate.component.ts +++ b/ui/src/app/edge/settings/system/executesystemupdate.component.ts @@ -18,7 +18,7 @@ export class ExecuteSystemUpdateComponent implements OnInit, OnDestroy { public readonly spinnerId: string = ExecuteSystemUpdateComponent.SELECTOR; public readonly environment = environment; - protected executeUpdate: ExecuteSystemUpdate = null; + protected executeUpdate: ExecuteSystemUpdate | null = null; protected isWaiting: boolean; diff --git a/ui/src/app/edge/settings/system/oe-system-update.component.ts b/ui/src/app/edge/settings/system/oe-system-update.component.ts index aec78e619d2..2e547e5a9a2 100644 --- a/ui/src/app/edge/settings/system/oe-system-update.component.ts +++ b/ui/src/app/edge/settings/system/oe-system-update.component.ts @@ -21,7 +21,7 @@ export class OeSystemUpdateComponent implements OnInit, OnDestroy { public readonly environment = environment; public readonly spinnerId: string = OeSystemUpdateComponent.SELECTOR; - protected executeUpdate: ExecuteSystemUpdate = null; + protected executeUpdate: ExecuteSystemUpdate | null = null; protected isWaiting: boolean; constructor( diff --git a/ui/src/app/shared/components/abstracthistorywidget.ts b/ui/src/app/shared/components/abstracthistorywidget.ts index 550a34c1907..2c1bb5f9033 100644 --- a/ui/src/app/shared/components/abstracthistorywidget.ts +++ b/ui/src/app/shared/components/abstracthistorywidget.ts @@ -22,9 +22,9 @@ export abstract class AbstractHistoryWidget implements OnInit, OnChanges, OnDest * True after this.edge, this.config and this.component are set. */ public isInitialized: boolean = false; - public edge: Edge = null; - public config: EdgeConfig = null; - public component: EdgeConfig.Component = null; + public edge: Edge | null = null; + public config: EdgeConfig | null = null; + public component: EdgeConfig.Component | null = null; public stopOnDestroy: Subject = new Subject(); private selector: string = uuidv4(); diff --git a/ui/src/app/shared/components/chart/abstractHistoryChartOverview.ts b/ui/src/app/shared/components/chart/abstractHistoryChartOverview.ts index 04e87fe1ca5..47410194515 100644 --- a/ui/src/app/shared/components/chart/abstractHistoryChartOverview.ts +++ b/ui/src/app/shared/components/chart/abstractHistoryChartOverview.ts @@ -15,7 +15,7 @@ export abstract class AbstractHistoryChartOverview implements OnInit, OnChanges, */ public isInitialized: boolean = false; public config: EdgeConfig = null; - public component: EdgeConfig.Component = null; + public component: EdgeConfig.Component | null = null; public stopOnDestroy: Subject = new Subject(); public edge: Edge | null = null; public period: DefaultTypes.HistoryPeriod; diff --git a/ui/src/app/shared/components/chart/abstracthistorychart.ts b/ui/src/app/shared/components/chart/abstracthistorychart.ts index 223c084c981..4a2a61fadbf 100644 --- a/ui/src/app/shared/components/chart/abstracthistorychart.ts +++ b/ui/src/app/shared/components/chart/abstracthistorychart.ts @@ -97,7 +97,7 @@ export abstract class AbstractHistoryChart implements OnInit { } chartObject.input.forEach(element => { - let channelAddress: ChannelAddress = null; + let channelAddress: ChannelAddress | null = null; if (chartType == 'bar' && element.energyChannel) { channelAddress = element.energyChannel; } else { diff --git a/ui/src/app/shared/components/flat/abstract-flat-widget-line.ts b/ui/src/app/shared/components/flat/abstract-flat-widget-line.ts index c665ca634d5..cb3ea6c980e 100644 --- a/ui/src/app/shared/components/flat/abstract-flat-widget-line.ts +++ b/ui/src/app/shared/components/flat/abstract-flat-widget-line.ts @@ -38,7 +38,7 @@ export abstract class AbstractFlatWidgetLine implements OnChanges, OnDestroy { */ private selector: string = uuidv4(); private stopOnDestroy: Subject = new Subject(); - private edge: Edge = null; + private edge: Edge | null = null; constructor( @Inject(Websocket) protected websocket: Websocket, diff --git a/ui/src/app/shared/components/modal/abstract-modal-line.ts b/ui/src/app/shared/components/modal/abstract-modal-line.ts index 7717aa303de..625dac513e5 100644 --- a/ui/src/app/shared/components/modal/abstract-modal-line.ts +++ b/ui/src/app/shared/components/modal/abstract-modal-line.ts @@ -46,10 +46,10 @@ export abstract class AbstractModalLine implements OnInit, OnDestroy, OnChanges /** * displayValue is the displayed @Input value in html */ - public displayValue: string = null; - public displayName: string = null; - public edge: Edge = null; - public config: EdgeConfig = null; + public displayValue: string | null = null; + public displayName: string | null = null; + public edge: Edge | null = null; + public config: EdgeConfig | null = null; public stopOnDestroy: Subject = new Subject(); /** Checks if any value of this line can be seen => hides line if false diff --git a/ui/src/app/shared/components/modal/abstractModal.ts b/ui/src/app/shared/components/modal/abstractModal.ts index d2d1ec38b9b..5c5ca8f55aa 100644 --- a/ui/src/app/shared/components/modal/abstractModal.ts +++ b/ui/src/app/shared/components/modal/abstractModal.ts @@ -16,7 +16,7 @@ import { Converter } from "../shared/converter"; @Directive() export abstract class AbstractModal implements OnInit, OnDestroy { - @Input() public component: EdgeConfig.Component = null; + @Input() public component: EdgeConfig.Component | null = null; /** Enum for User Role */ public readonly Role = Role; @@ -28,7 +28,7 @@ export abstract class AbstractModal implements OnInit, OnDestroy { public readonly Converter = Converter; public isInitialized: boolean = false; - public edge: Edge = null; + public edge: Edge | null = null; public config: EdgeConfig = null; public stopOnDestroy: Subject = new Subject(); public formGroup: FormGroup | null = null; diff --git a/ui/src/app/shared/components/modal/modal.ts b/ui/src/app/shared/components/modal/modal.ts index 5665ec13255..d2365497540 100644 --- a/ui/src/app/shared/components/modal/modal.ts +++ b/ui/src/app/shared/components/modal/modal.ts @@ -28,7 +28,7 @@ export class ModalComponent { /** Title in Header */ @Input({ required: true }) public title!: string; - @Input() protected component: EdgeConfig.Component = null; + @Input() protected component: EdgeConfig.Component | null = null; @Input() protected formGroup: FormGroup = new FormGroup({}); @Input() protected toolbarButtons: { url: string, icon: Icon }[] | { url: string, icon: Icon } | { @@ -39,7 +39,7 @@ export class ModalComponent { @Input() protected helpKey: string | null = null; public readonly Role = Role; - private edge: Edge = null; + private edge: Edge | null = null; constructor( public modalController: ModalController, diff --git a/ui/src/app/shared/service/service.ts b/ui/src/app/shared/service/service.ts index d8c19586358..a0efd655628 100644 --- a/ui/src/app/shared/service/service.ts +++ b/ui/src/app/shared/service/service.ts @@ -82,7 +82,7 @@ export class Service extends AbstractService { /** * Holds the current Activated Route */ - private currentActivatedRoute: ActivatedRoute = null; + private currentActivatedRoute: ActivatedRoute | null = null; private queryEnergyQueue: { fromDate: Date, toDate: Date, channels: ChannelAddress[], promises: { resolve, reject }[]