Skip to content

Commit

Permalink
UI: add no-trailing-spaces:error setting to eslintrc (#2488)
Browse files Browse the repository at this point in the history
  • Loading branch information
miettal authored Jan 17, 2024
1 parent 855998c commit 1079649
Show file tree
Hide file tree
Showing 148 changed files with 482 additions and 481 deletions.
3 changes: 2 additions & 1 deletion ui/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"eol-last": [
"error",
"always"
]
],
"no-trailing-spaces": "error"
}
},
{
Expand Down
24 changes: 12 additions & 12 deletions ui/src/app/edge/history/abstracthistorychart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export abstract class AbstractHistoryChart {

/**
* Gets the ChannelAddresses that should be queried.
*
*
* @param edge the current Edge
* @param config the EdgeConfig
*/
Expand All @@ -67,7 +67,7 @@ export abstract class AbstractHistoryChart {

/**
* Sends the Historic Timeseries Data Query and makes sure the result is not empty.
*
*
* @param fromDate the From-Date
* @param toDate the To-Date
* @param edge the current Edge
Expand Down Expand Up @@ -112,14 +112,14 @@ export abstract class AbstractHistoryChart {

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

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

this.errorResponse = null;
Expand Down Expand Up @@ -152,9 +152,9 @@ export abstract class AbstractHistoryChart {

/**
* Generates a Tooltip Title string from a 'fromDate' and 'toDate'.
*
*
* @param fromDate the From-Date
* @param toDate the To-Date
* @param toDate the To-Date
* @param date Date from TooltipItem
* @returns period for Tooltip Header
*/
Expand All @@ -170,9 +170,9 @@ export abstract class AbstractHistoryChart {

/**
* Creates the default Chart options
*
*
* @Future TODO change into static method and pass the historyPeriods value
*
*
* @returns the ChartOptions
*/
protected createDefaultChartOptions(): ChartOptions {
Expand All @@ -197,7 +197,7 @@ export abstract class AbstractHistoryChart {

/**
* checks if chart is allowed to be refreshed
*
*
*/
// protected checkAllowanceChartRefresh(): boolean {
// let currentDate = new Date();
Expand Down Expand Up @@ -273,11 +273,11 @@ export abstract class AbstractHistoryChart {

/**
* Start NGX-Spinner
*
*
* Spinner will appear inside html tag only
*
*
* @example <ngx-spinner name="YOURSELECTOR"></ngx-spinner>
*
*
* @param selector selector for specific spinner
*/
public startSpinner() {
Expand Down
4 changes: 2 additions & 2 deletions ui/src/app/edge/history/abstracthistorywidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export abstract class AbstractHistoryWidget {

/**
* Sends the Historic Timeseries Data Query and makes sure the result is not empty.
*
*
* @param fromDate the From-Date
* @param toDate the To-Date
* @param edge the current Edge
Expand Down Expand Up @@ -86,7 +86,7 @@ export abstract class AbstractHistoryWidget {

/**
* Gets the ChannelAddresses that should be queried.
*
*
* @param edge the current Edge
* @param config the EdgeConfig
*/
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/edge/history/chpsoc/widget.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class ChpSocWidgetComponent extends AbstractHistoryWidget implements OnIn
this.updateValues();
};

// Gather result & timestamps to calculate effective active time in %
// Gather result & timestamps to calculate effective active time in %
protected updateValues() {
this.queryHistoricTimeseriesData(this.service.historyPeriod.value.from, this.service.historyPeriod.value.to).then(response => {
this.service.getConfig().then(config => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import { AbstractHistoryChartOverview } from 'src/app/shared/genericComponents/c
@Component({
templateUrl: './overview.html',
})
export class OverviewComponent extends AbstractHistoryChartOverview { }
export class OverviewComponent extends AbstractHistoryChartOverview { }
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { QueryHistoricTimeseriesEnergyResponse } from "src/app/shared/jsonrpc/re

export namespace History {

/**
/**
* up to 288 datapoints (5 min aggregated values) from a
*
*
* {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}
* */
export const DAY: OeTester.Types.Channels = ({
Expand All @@ -34,7 +34,7 @@ export namespace History {
}),
});

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

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

/**
/**
* up to 12 datapoints(1 month values) from a {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}*/
export const YEAR: OeTester.Types.Channels = {
energyChannelWithValues: new QueryHistoricTimeseriesEnergyResponse("0", {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/edge/history/common/consumption/flat/flat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class FlatComponent extends AbstractFlatWidget {

/**
* Gets the totalOtherEnergy
*
*
* @param currentData the current data
* @returns the total other Energy
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import { AbstractHistoryChartOverview } from 'src/app/shared/genericComponents/c
@Component({
templateUrl: './overview.html',
})
export class OverviewComponent extends AbstractHistoryChartOverview { }
export class OverviewComponent extends AbstractHistoryChartOverview { }
10 changes: 5 additions & 5 deletions ui/src/app/edge/history/common/energy/chart/channels.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ export namespace History {
},
});

/**
/**
* up to 288 datapoints (5 min aggregated values) from a
*
*
* {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}
* */
export const DAY: OeTester.Types.Channels = ({
Expand Down Expand Up @@ -1941,7 +1941,7 @@ export namespace History {
}),
});

/**
/**
* up to 164 datapoints(1 hour values) from a {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}
* */
export const WEEK: OeTester.Types.Channels = {
Expand Down Expand Up @@ -3140,7 +3140,7 @@ export namespace History {
}),
};

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

/**
/**
* up to 12 datapoints(1 month values) from a {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}*/
export const YEAR: OeTester.Types.Channels = {
energyChannelWithValues: new QueryHistoricTimeseriesEnergyResponse("0", {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/edge/history/common/grid/overview/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import { AbstractHistoryChartOverview } from 'src/app/shared/genericComponents/c
@Component({
templateUrl: './overview.html',
})
export class OverviewComponent extends AbstractHistoryChartOverview { }
export class OverviewComponent extends AbstractHistoryChartOverview { }
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ export class OverviewComponent extends AbstractHistoryChartOverview {
.filter(component => component.isEnabled && this.config.isProducer(component));
return [];
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import { AbstractHistoryChartOverview } from 'src/app/shared/genericComponents/c
@Component({
templateUrl: './overview.html',
})
export class OverviewComponent extends AbstractHistoryChartOverview { }
export class OverviewComponent extends AbstractHistoryChartOverview { }
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class FixDigitalOutputWidgetComponent extends AbstractHistoryWidget imple
};

protected updateValues() {
// Gather result & timestamps to calculate effective active time in %
// Gather result & timestamps to calculate effective active time in %
this.queryHistoricTimeseriesData(this.service.historyPeriod.value.from, this.service.historyPeriod.value.to).then(response => {
let result = (response as QueryHistoricTimeseriesDataResponse).result;
this.service.getConfig().then(config => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class SellToGridLimitChartComponent extends AbstractHistoryChart implemen
} else if (value == 0) {
return 0;
} else {
//
//
return value / 1000 * 0.95; // convert to kW
}
});
Expand Down
8 changes: 4 additions & 4 deletions ui/src/app/edge/history/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export function calculateActiveTimeOverPeriod(channel: ChannelAddress, queryResu
/**
* Calculates resolution from passed Dates for queryHistoricTime-SeriesData und -EnergyPerPeriod &&
* Calculates timeFormat from passed Dates for xAxes of chart
*
*
* @param service the Service
* @param fromDate the From-Date
* @param toDate the To-Date
Expand Down Expand Up @@ -335,9 +335,9 @@ export function calculateResolution(service: Service, fromDate: Date, toDate: Da

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

/**
* Stores if the Label should be visible or hidden in Session-Storage.
*
*
* @param label the Chart label
* @param visible true to set the Label visibile; false to hide ite
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class SinglethresholdWidgetComponent extends AbstractHistoryWidget implem
this.updateValues();
};

// Gather result & timestamps to calculate effective active time in %
// Gather result & timestamps to calculate effective active time in %
protected updateValues() {
this.queryHistoricTimeseriesData(this.service.historyPeriod.value.from, this.service.historyPeriod.value.to).then(response => {
this.service.getConfig().then(config => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ export class Controller_ChpSocModalComponent implements OnInit {
this.thresholds['upper'] = this.component.properties['highThreshold'];
};

/**
/**
* Updates the Charge-Mode of the EVCS-Controller.
*
* @param event
*
* @param event
*/
updateMode(event: CustomEvent) {
let oldMode = this.component.properties.mode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class ModalComponent extends AbstractModal {
break;
case 5:

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class PredictionChartComponent extends AbstractHistoryChart implements On
let result = response.result;
let datasets = [];

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

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

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

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

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

}).catch(reason => {
console.error(reason); // TODO error message
console.error(reason); // TODO error message
this.initializeChart();
return;
});
Expand Down
8 changes: 4 additions & 4 deletions ui/src/app/edge/live/Controller/Evcs/flat/flat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ export class FlatComponent extends AbstractFlatWidget {

/**
* Returns the state of the EVCS
*
* @param state
* @param plug
*
*
* @param state
* @param plug
*
*/
private getState(state: number, plug: number): string {
if (this.controller != null) {
Expand Down
6 changes: 3 additions & 3 deletions ui/src/app/edge/live/Controller/Evcs/modal/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class ModalComponent extends AbstractModal {

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

/**
* Returns the state of the EVCS
*
*
* @param state the state
* @param plug the plug
*
*
*/
private getState(state: number, plug: number): string {
if (this.controller?.properties.enabledCharging && this.controller.properties.enabledCharging == false) {
Expand Down
Loading

0 comments on commit 1079649

Please sign in to comment.