Skip to content

Commit 1079649

Browse files
authored
UI: add no-trailing-spaces:error setting to eslintrc (#2488)
1 parent 855998c commit 1079649

File tree

148 files changed

+482
-481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+482
-481
lines changed

ui/.eslintrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
"eol-last": [
6565
"error",
6666
"always"
67-
]
67+
],
68+
"no-trailing-spaces": "error"
6869
}
6970
},
7071
{

ui/src/app/edge/history/abstracthistorychart.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export abstract class AbstractHistoryChart {
5858

5959
/**
6060
* Gets the ChannelAddresses that should be queried.
61-
*
61+
*
6262
* @param edge the current Edge
6363
* @param config the EdgeConfig
6464
*/
@@ -67,7 +67,7 @@ export abstract class AbstractHistoryChart {
6767

6868
/**
6969
* Sends the Historic Timeseries Data Query and makes sure the result is not empty.
70-
*
70+
*
7171
* @param fromDate the From-Date
7272
* @param toDate the To-Date
7373
* @param edge the current Edge
@@ -112,14 +112,14 @@ export abstract class AbstractHistoryChart {
112112

113113
/**
114114
* Sends the Historic Timeseries Energy per Period Query and makes sure the result is not empty.
115-
*
115+
*
116116
* @param fromDate the From-Date
117117
* @param toDate the To-Date
118118
* @param channelAddresses the Channel-Addresses
119119
*/
120120
protected queryHistoricTimeseriesEnergyPerPeriod(fromDate: Date, toDate: Date, channelAddresses: ChannelAddress[]): Promise<QueryHistoricTimeseriesEnergyPerPeriodResponse> {
121121

122-
// TODO should be removed, edge delivers too much data
122+
// TODO should be removed, edge delivers too much data
123123
let resolution = calculateResolution(this.service, fromDate, toDate).resolution;
124124

125125
this.errorResponse = null;
@@ -152,9 +152,9 @@ export abstract class AbstractHistoryChart {
152152

153153
/**
154154
* Generates a Tooltip Title string from a 'fromDate' and 'toDate'.
155-
*
155+
*
156156
* @param fromDate the From-Date
157-
* @param toDate the To-Date
157+
* @param toDate the To-Date
158158
* @param date Date from TooltipItem
159159
* @returns period for Tooltip Header
160160
*/
@@ -170,9 +170,9 @@ export abstract class AbstractHistoryChart {
170170

171171
/**
172172
* Creates the default Chart options
173-
*
173+
*
174174
* @Future TODO change into static method and pass the historyPeriods value
175-
*
175+
*
176176
* @returns the ChartOptions
177177
*/
178178
protected createDefaultChartOptions(): ChartOptions {
@@ -197,7 +197,7 @@ export abstract class AbstractHistoryChart {
197197

198198
/**
199199
* checks if chart is allowed to be refreshed
200-
*
200+
*
201201
*/
202202
// protected checkAllowanceChartRefresh(): boolean {
203203
// let currentDate = new Date();
@@ -273,11 +273,11 @@ export abstract class AbstractHistoryChart {
273273

274274
/**
275275
* Start NGX-Spinner
276-
*
276+
*
277277
* Spinner will appear inside html tag only
278-
*
278+
*
279279
* @example <ngx-spinner name="YOURSELECTOR"></ngx-spinner>
280-
*
280+
*
281281
* @param selector selector for specific spinner
282282
*/
283283
public startSpinner() {

ui/src/app/edge/history/abstracthistorywidget.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export abstract class AbstractHistoryWidget {
4242

4343
/**
4444
* Sends the Historic Timeseries Data Query and makes sure the result is not empty.
45-
*
45+
*
4646
* @param fromDate the From-Date
4747
* @param toDate the To-Date
4848
* @param edge the current Edge
@@ -86,7 +86,7 @@ export abstract class AbstractHistoryWidget {
8686

8787
/**
8888
* Gets the ChannelAddresses that should be queried.
89-
*
89+
*
9090
* @param edge the current Edge
9191
* @param config the EdgeConfig
9292
*/

ui/src/app/edge/history/chpsoc/widget.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class ChpSocWidgetComponent extends AbstractHistoryWidget implements OnIn
4646
this.updateValues();
4747
};
4848

49-
// Gather result & timestamps to calculate effective active time in %
49+
// Gather result & timestamps to calculate effective active time in %
5050
protected updateValues() {
5151
this.queryHistoricTimeseriesData(this.service.historyPeriod.value.from, this.service.historyPeriod.value.to).then(response => {
5252
this.service.getConfig().then(config => {

ui/src/app/edge/history/common/autarchy/overview/overview.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import { AbstractHistoryChartOverview } from 'src/app/shared/genericComponents/c
44
@Component({
55
templateUrl: './overview.html',
66
})
7-
export class OverviewComponent extends AbstractHistoryChartOverview { }
7+
export class OverviewComponent extends AbstractHistoryChartOverview { }

ui/src/app/edge/history/common/consumption/chart/channels.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { QueryHistoricTimeseriesEnergyResponse } from "src/app/shared/jsonrpc/re
55

66
export namespace History {
77

8-
/**
8+
/**
99
* up to 288 datapoints (5 min aggregated values) from a
10-
*
10+
*
1111
* {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}
1212
* */
1313
export const DAY: OeTester.Types.Channels = ({
@@ -34,7 +34,7 @@ export namespace History {
3434
}),
3535
});
3636

37-
/**
37+
/**
3838
* up to 164 datapoints(1 hour values) from a {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}
3939
* */
4040
export const WEEK: OeTester.Types.Channels = {
@@ -55,7 +55,7 @@ export namespace History {
5555
}),
5656
};
5757

58-
/**
58+
/**
5959
* up to 31 datapoints(1 day values) from a {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}*/
6060
export const MONTH: OeTester.Types.Channels = {
6161
energyChannelWithValues: new QueryHistoricTimeseriesEnergyResponse("0", {
@@ -76,7 +76,7 @@ export namespace History {
7676
}),
7777
};
7878

79-
/**
79+
/**
8080
* up to 12 datapoints(1 month values) from a {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}*/
8181
export const YEAR: OeTester.Types.Channels = {
8282
energyChannelWithValues: new QueryHistoricTimeseriesEnergyResponse("0", {

ui/src/app/edge/history/common/consumption/flat/flat.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class FlatComponent extends AbstractFlatWidget {
4343

4444
/**
4545
* Gets the totalOtherEnergy
46-
*
46+
*
4747
* @param currentData the current data
4848
* @returns the total other Energy
4949
*/

ui/src/app/edge/history/common/consumption/overview/overview.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import { AbstractHistoryChartOverview } from 'src/app/shared/genericComponents/c
44
@Component({
55
templateUrl: './overview.html',
66
})
7-
export class OverviewComponent extends AbstractHistoryChartOverview { }
7+
export class OverviewComponent extends AbstractHistoryChartOverview { }

ui/src/app/edge/history/common/energy/chart/channels.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ export namespace History {
187187
},
188188
});
189189

190-
/**
190+
/**
191191
* up to 288 datapoints (5 min aggregated values) from a
192-
*
192+
*
193193
* {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}
194194
* */
195195
export const DAY: OeTester.Types.Channels = ({
@@ -1941,7 +1941,7 @@ export namespace History {
19411941
}),
19421942
});
19431943

1944-
/**
1944+
/**
19451945
* up to 164 datapoints(1 hour values) from a {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}
19461946
* */
19471947
export const WEEK: OeTester.Types.Channels = {
@@ -3140,7 +3140,7 @@ export namespace History {
31403140
}),
31413141
};
31423142

3143-
/**
3143+
/**
31443144
* up to 31 datapoints(1 day values) from a {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}*/
31453145
export const MONTH: OeTester.Types.Channels = {
31463146
energyChannelWithValues: new QueryHistoricTimeseriesEnergyResponse("0", {
@@ -3382,7 +3382,7 @@ export namespace History {
33823382
}),
33833383
};
33843384

3385-
/**
3385+
/**
33863386
* up to 12 datapoints(1 month values) from a {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}*/
33873387
export const YEAR: OeTester.Types.Channels = {
33883388
energyChannelWithValues: new QueryHistoricTimeseriesEnergyResponse("0", {

ui/src/app/edge/history/common/grid/overview/overview.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import { AbstractHistoryChartOverview } from 'src/app/shared/genericComponents/c
44
@Component({
55
templateUrl: './overview.html',
66
})
7-
export class OverviewComponent extends AbstractHistoryChartOverview { }
7+
export class OverviewComponent extends AbstractHistoryChartOverview { }

ui/src/app/edge/history/common/production/overview/overview.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ export class OverviewComponent extends AbstractHistoryChartOverview {
2121
.filter(component => component.isEnabled && this.config.isProducer(component));
2222
return [];
2323
}
24-
}
24+
}

ui/src/app/edge/history/common/selfconsumption/overview/overview.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import { AbstractHistoryChartOverview } from 'src/app/shared/genericComponents/c
44
@Component({
55
templateUrl: './overview.html',
66
})
7-
export class OverviewComponent extends AbstractHistoryChartOverview { }
7+
export class OverviewComponent extends AbstractHistoryChartOverview { }

ui/src/app/edge/history/fixdigitaloutput/widget.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class FixDigitalOutputWidgetComponent extends AbstractHistoryWidget imple
4949
};
5050

5151
protected updateValues() {
52-
// Gather result & timestamps to calculate effective active time in %
52+
// Gather result & timestamps to calculate effective active time in %
5353
this.queryHistoricTimeseriesData(this.service.historyPeriod.value.from, this.service.historyPeriod.value.to).then(response => {
5454
let result = (response as QueryHistoricTimeseriesDataResponse).result;
5555
this.service.getConfig().then(config => {

ui/src/app/edge/history/gridoptimizedcharge/sellToGridLimitChart.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class SellToGridLimitChartComponent extends AbstractHistoryChart implemen
119119
} else if (value == 0) {
120120
return 0;
121121
} else {
122-
//
122+
//
123123
return value / 1000 * 0.95; // convert to kW
124124
}
125125
});

ui/src/app/edge/history/shared.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export function calculateActiveTimeOverPeriod(channel: ChannelAddress, queryResu
281281
/**
282282
* Calculates resolution from passed Dates for queryHistoricTime-SeriesData und -EnergyPerPeriod &&
283283
* Calculates timeFormat from passed Dates for xAxes of chart
284-
*
284+
*
285285
* @param service the Service
286286
* @param fromDate the From-Date
287287
* @param toDate the To-Date
@@ -335,9 +335,9 @@ export function calculateResolution(service: Service, fromDate: Date, toDate: Da
335335

336336
/**
337337
* Returns true if Chart Label should be visible. Defaults to true.
338-
*
338+
*
339339
* Compares only the first part of the label string - without a value or unit.
340-
*
340+
*
341341
* @param label the Chart label
342342
* @param orElse the default, in case no value was stored yet in Session-Storage
343343
* @returns true for visible labels; hidden otherwise
@@ -354,7 +354,7 @@ export function isLabelVisible(label: string, orElse?: boolean): boolean {
354354

355355
/**
356356
* Stores if the Label should be visible or hidden in Session-Storage.
357-
*
357+
*
358358
* @param label the Chart label
359359
* @param visible true to set the Label visibile; false to hide ite
360360
*/

ui/src/app/edge/history/singlethreshold/widget.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class SinglethresholdWidgetComponent extends AbstractHistoryWidget implem
4646
this.updateValues();
4747
};
4848

49-
// Gather result & timestamps to calculate effective active time in %
49+
// Gather result & timestamps to calculate effective active time in %
5050
protected updateValues() {
5151
this.queryHistoricTimeseriesData(this.service.historyPeriod.value.from, this.service.historyPeriod.value.to).then(response => {
5252
this.service.getConfig().then(config => {

ui/src/app/edge/live/Controller/ChpSoc/modal/modal.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ export class Controller_ChpSocModalComponent implements OnInit {
3939
this.thresholds['upper'] = this.component.properties['highThreshold'];
4040
};
4141

42-
/**
42+
/**
4343
* Updates the Charge-Mode of the EVCS-Controller.
44-
*
45-
* @param event
44+
*
45+
* @param event
4646
*/
4747
updateMode(event: CustomEvent) {
4848
let oldMode = this.component.properties.mode;

ui/src/app/edge/live/Controller/Ess/GridOptimizedCharge/modal/modal.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export class ModalComponent extends AbstractModal {
8383
break;
8484
case 5:
8585

86-
// Case 6: 'DISABLED' hides 'state-line', so no Message needed
86+
// Case 6: 'DISABLED' hides 'state-line', so no Message needed
8787
case 7: this.state = this.translate.instant('Edge.Index.Widgets.GridOptimizedCharge.State.noLimitActive');
8888
break;
8989

ui/src/app/edge/live/Controller/Ess/GridOptimizedCharge/modal/predictionChart.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class PredictionChartComponent extends AbstractHistoryChart implements On
5353
let result = response.result;
5454
let datasets = [];
5555

56-
// Get the 5 min index of the current time
56+
// Get the 5 min index of the current time
5757
let hours = new Date().getHours();
5858
let minutes = new Date().getMinutes();
5959
let currIndex = Math.trunc((hours * 60 + minutes) / 5);
@@ -128,7 +128,7 @@ export class PredictionChartComponent extends AbstractHistoryChart implements On
128128
// Calculate how much percentage is needed in every time step (5 min)
129129
dataSteps = remainingCapacity / remainingSteps;
130130

131-
// Set the data for the datasets
131+
// Set the data for the datasets
132132
let predictedSoc = startSoc - dataSteps;
133133
for (let i = currIndex; i <= targetIndex; i++) {
134134
// Predicted SoC increases only after charge start time, when channel is not zero (e.g. for older versions).
@@ -142,7 +142,7 @@ export class PredictionChartComponent extends AbstractHistoryChart implements On
142142
}
143143
}
144144

145-
// Add one buffer hour at the end to get more clarity in the chart
145+
// Add one buffer hour at the end to get more clarity in the chart
146146
let chartEndIndex = targetIndex + 12;
147147

148148
// Remove unimportant values that are after the end index
@@ -182,7 +182,7 @@ export class PredictionChartComponent extends AbstractHistoryChart implements On
182182
position: 'right',
183183
});
184184

185-
// Push the depending colors
185+
// Push the depending colors
186186
this.colors.push({
187187
backgroundColor: 'rgba(189, 195, 199,0.05)',
188188
borderColor: 'rgba(189, 195, 199,1)',
@@ -197,7 +197,7 @@ export class PredictionChartComponent extends AbstractHistoryChart implements On
197197
this.service.stopSpinner(this.spinnerId);
198198

199199
}).catch(reason => {
200-
console.error(reason); // TODO error message
200+
console.error(reason); // TODO error message
201201
this.initializeChart();
202202
return;
203203
});

ui/src/app/edge/live/Controller/Evcs/flat/flat.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ export class FlatComponent extends AbstractFlatWidget {
126126

127127
/**
128128
* Returns the state of the EVCS
129-
*
130-
* @param state
131-
* @param plug
132-
*
129+
*
130+
* @param state
131+
* @param plug
132+
*
133133
*/
134134
private getState(state: number, plug: number): string {
135135
if (this.controller != null) {

ui/src/app/edge/live/Controller/Evcs/modal/modal.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export class ModalComponent extends AbstractModal {
8383

8484
protected override onCurrentData(currentData: CurrentData) {
8585
this.isConnectionSuccessful = currentData.allComponents[this.component.id + '/State'] !== 3 ? true : false;
86-
// Do not change values after touching formControls
86+
// Do not change values after touching formControls
8787
if (this.formGroup?.pristine) {
8888
this.status = this.getState(currentData.allComponents[this.component.id + "/Status"], currentData.allComponents[this.component.id + "/Plug"]);
8989
this.chargePower = Utils.convertChargeDischargePower(this.translate, currentData.allComponents[this.component.id + "/ChargePower"]);
@@ -194,10 +194,10 @@ export class ModalComponent extends AbstractModal {
194194

195195
/**
196196
* Returns the state of the EVCS
197-
*
197+
*
198198
* @param state the state
199199
* @param plug the plug
200-
*
200+
*
201201
*/
202202
private getState(state: number, plug: number): string {
203203
if (this.controller?.properties.enabledCharging && this.controller.properties.enabledCharging == false) {

0 commit comments

Comments
 (0)