Skip to content

Commit

Permalink
Merge pull request #2509 from sap-labs-france/master-qa
Browse files Browse the repository at this point in the history
Merge master-qa
  • Loading branch information
LucasBrazi06 authored Jul 26, 2021
2 parents 86d7096 + c1f727a commit fd1716a
Show file tree
Hide file tree
Showing 28 changed files with 161 additions and 54 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ev-dashboard",
"description": "Dashboard for Electric Vehicle charging station",
"homepage": "https://github.com/sap-labs-france/ev-dashboard",
"version": "2.4.78",
"version": "2.4.79",
"engines": {
"npm": "6.x.x."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class AppRegistrationTokenStatusPipe implements PipeTransform {
}

public buildStatusClasses(registrationToken: RegistrationToken): string {
let classNames = 'chip-width-5em ';
let classNames = 'chip-width-8em ';
if (this.isExpired(registrationToken)) {
classNames += ChipType.DANGER;
} else if (this.isRevoked(registrationToken)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class AppFormatLogLevelPipe implements PipeTransform {
}

public buildLogLevelClasses(logLevel: string): string {
let classNames = 'chip-width-5em ';
let classNames = 'chip-width-8em ';
switch (logLevel) {
case 'E':
classNames += ChipType.DANGER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@
</app-settings-wit-connection>
</div>
</div>
<div class="row" *ngIf="type.value === 'lacroix'">
<div class="col-md-12">
<app-settings-lacroix-connection
[formGroup]="formGroup" [lacroixConnection]="lacroixConnection">
</app-settings-lacroix-connection>
</div>
</div>
<div class="card-footer mat-dialog-actions" align="end">
<button mat-raised-button color="warn" (click)="setConnectionAndClose(formGroup.value)"
[disabled]="!formGroup.valid || !formGroup.dirty">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MatDialogRef } from '@angular/material/dialog';
import { TranslateService } from '@ngx-translate/core';

import { KeyValue } from '../../../../types/GlobalType';
import { AssetConnectionSetting, AssetConnectionType, AssetGreencomConnectionType, AssetIothinkConnectionType, AssetSchneiderConnectionType, AssetWitConnectionType } from '../../../../types/Setting';
import { AssetConnectionSetting, AssetConnectionType, AssetGreencomConnectionType, AssetIothinkConnectionType, AssetLacroixConnectionType, AssetSchneiderConnectionType, AssetWitConnectionType } from '../../../../types/Setting';
import { Constants } from '../../../../utils/Constants';
import { AssetConnectionDialogComponent } from './asset-connection.dialog.component';

Expand All @@ -29,11 +29,13 @@ export class AssetConnectionComponent implements OnInit {
public greencomConnection!: AssetGreencomConnectionType;
public iothinkConnection!: AssetIothinkConnectionType;
public witConnection!: AssetWitConnectionType;
public lacroixConnection!: AssetLacroixConnectionType;
public assetConnectionTypes: KeyValue[] = [
{ key: AssetConnectionType.SCHNEIDER, value: 'settings.asset.types.schneider' },
{ key: AssetConnectionType.GREENCOM, value: 'settings.asset.types.greencom' },
{ key: AssetConnectionType.IOTHINK, value: 'settings.asset.types.iothink' },
{ key: AssetConnectionType.WIT, value: 'settings.asset.types.wit' }
{ key: AssetConnectionType.WIT, value: 'settings.asset.types.wit' },
{ key: AssetConnectionType.LACROIX, value: 'settings.asset.types.lacroix' }
];
public submitButtonTranslation!: any;

Expand Down Expand Up @@ -117,6 +119,9 @@ export class AssetConnectionComponent implements OnInit {
case AssetConnectionType.WIT:
this.witConnection = this.currentAssetConnection.witConnection;
break;
case AssetConnectionType.LACROIX:
this.lacroixConnection = this.currentAssetConnection.lacroixConnection;
break;
}
}

Expand Down Expand Up @@ -156,5 +161,8 @@ export class AssetConnectionComponent implements OnInit {
if (this.formGroup.controls.witConnection && type !== AssetConnectionType.WIT) {
delete this.formGroup.controls.witConnection;
}
if (this.formGroup.controls.lacroixConnection && type !== AssetConnectionType.LACROIX) {
delete this.formGroup.controls.lacroixConnection;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div class="row">
<!-- User -->
<div class="col-md-6">
<div class="form-group">
<mat-form-field>
<input appAutofocus matInput
placeholder="{{'settings.asset.connection.user' | translate}}"
type="text" [formControl]="user" required>
<mat-error *ngIf="user.errors?.required">{{"general.mandatory_field" | translate}}</mat-error>
</mat-form-field>
</div>
</div>
<!-- Password -->
<div class="col-md-6">
<div class="form-group">
<mat-form-field>
<input matInput
placeholder="{{'settings.asset.connection.password' | translate}}"
type="password" [formControl]="password" required>
<mat-error *ngIf="password.errors?.required">{{"general.mandatory_field" | translate}}</mat-error>
</mat-form-field>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { Component, Input, OnInit } from '@angular/core';
import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/forms';

import { AssetLacroixConnectionType } from '../../../../../types/Setting';

@Component({
selector: 'app-settings-lacroix-connection',
templateUrl: './lacroix-asset-connection.component.html'
})
export class LacroixAssetConnectionComponent implements OnInit {
@Input() public formGroup!: FormGroup;
@Input() public lacroixConnection!: AssetLacroixConnectionType;

public lacroixLoginForm!: FormGroup;
public user!: AbstractControl;
public password!: AbstractControl;

public ngOnInit(): void {
// Set login credentials form
this.lacroixLoginForm = new FormGroup({
user: new FormControl('',
Validators.compose([
Validators.required,
])),
password: new FormControl('',
Validators.compose([
Validators.required,
])),
});
if (!this.formGroup.disabled) {
this.formGroup.addControl('lacroixConnection', this.lacroixLoginForm);
} else {
this.lacroixLoginForm.disable();
}
this.user = this.lacroixLoginForm.controls['user'];
this.password = this.lacroixLoginForm.controls['password'];
// Load existing credentials
this.loadCredentials();
}

public loadCredentials(): void {
if (this.lacroixConnection) {
if (this.lacroixConnection.user) {
this.lacroixLoginForm.controls.user.setValue(this.lacroixConnection.user);
}
if (this.lacroixConnection.password) {
this.lacroixLoginForm.controls.password.setValue(this.lacroixConnection.password);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class OcpiDetailFailureEvsesStatusFormatterComponent extends CellContentT
export class AppFormatOcpiEvsesFailurePipe implements PipeTransform {
public transform(failureNbr: number, type: string): string {
if (type === 'class') {
let classNames = 'chip-width-4em ';
let classNames = 'chip-width-5em ';
if (failureNbr > 0) {
classNames += ChipType.DANGER;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { OcpiEndpointDetail } from '../../../../../types/ocpi/OCPIEndpoint';
@Component({
template: `
<mat-chip-list [selectable]="false">
<mat-chip ngClass="chip-width-4em chip-success" [disabled]="true">
<mat-chip ngClass="chip-width-5em chip-success" [disabled]="true">
{{row.successNbr}}
</mat-chip>
</mat-chip-list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class OcpiDetailTotalEvsesStatusFormatterComponent extends CellContentTem
export class AppFormatOcpiEvsesTotalPipe implements PipeTransform {
public transform(totalNbr: number, type: string): string {
if (type === 'class') {
let classNames = 'chip-width-4em ';
let classNames = 'chip-width-5em ';
if (totalNbr > 0) {
classNames += ChipType.INFO;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class OicpDetailFailureEvsesStatusFormatterComponent extends CellContentT
export class AppFormatOicpEvsesFailurePipe implements PipeTransform {
public transform(failureNbr: number, type: string): string {
if (type === 'class') {
let classNames = 'chip-width-4em ';
let classNames = 'chip-width-5em ';
if (failureNbr > 0) {
classNames += ChipType.DANGER;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { OicpEndpointDetail } from '../../../../../types/oicp/OICPEndpoint';
@Component({
template: `
<mat-chip-list [selectable]="false">
<mat-chip ngClass="chip-width-4em chip-success" [disabled]="true">
<mat-chip ngClass="chip-width-5em chip-success" [disabled]="true">
{{row.successNbr}}
</mat-chip>
</mat-chip-list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class OicpDetailTotalEvsesStatusFormatterComponent extends CellContentTem
export class AppFormatOicpEvsesTotalPipe implements PipeTransform {
public transform(totalNbr: number, type: string): string {
if (type === 'class') {
let classNames = 'chip-width-4em ';
let classNames = 'chip-width-5em ';
if (totalNbr > 0) {
classNames += ChipType.INFO;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { AssetConnectionComponent } from './asset/connection/asset-connection.co
import { AssetConnectionDialogComponent } from './asset/connection/asset-connection.dialog.component';
import { GreencomAssetConnectionComponent } from './asset/connection/greencom/greencom-asset-connection.component';
import { IothinkAssetConnectionComponent } from './asset/connection/iothink/iothink-asset-connection.component';
import { LacroixAssetConnectionComponent } from './asset/connection/lacroix/lacroix-asset-connection.component';
import { SchneiderAssetConnectionComponent } from './asset/connection/schneider/schneider-asset-connection.component';
import { WitAssetConnectionComponent } from './asset/connection/wit/wit-asset-connection.component';
import { SettingsAssetConnectionEditableTableDataSource } from './asset/settings-asset-connections-list-table-data-source';
Expand Down Expand Up @@ -114,6 +115,7 @@ import { SettingsSmartChargingComponent } from './smart-charging/settings-smart-
GreencomAssetConnectionComponent,
IothinkAssetConnectionComponent,
WitAssetConnectionComponent,
LacroixAssetConnectionComponent,
SettingsCarConnectorComponent,
CarConnectorConnectionComponent,
CarConnectorConnectionDialogComponent,
Expand Down Expand Up @@ -174,6 +176,7 @@ import { SettingsSmartChargingComponent } from './smart-charging/settings-smart-
GreencomAssetConnectionComponent,
IothinkAssetConnectionComponent,
WitAssetConnectionComponent,
LacroixAssetConnectionComponent,
SettingsCarConnectorComponent,
CarConnectorConnectionComponent,
CarConnectorConnectionDialogComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class AppFormatUserStatusPipe implements PipeTransform {
}

public buildUserStatusClasses(status: string): string {
let classNames = 'chip-width-5em ';
let classNames = 'chip-width-8em ';
switch (status) {
case UserStatus.ACTIVE:
classNames += ChipType.SUCCESS;
Expand Down
22 changes: 22 additions & 0 deletions src/app/release-notes/release-notes.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,28 @@ export class ReleaseNotesComponent {

public buildReleaseNotes() {
this.releaseNotes = [
{
version: '2.4.79',
date: new Date('2021-07-26'),
componentChanges: [
{
name: 'Dashboard',
changes: [
`Fixed Site Admin cannot see Statistics of his Users`,
`Fixed missing IDs in RESTful file documentation`,
`Lacroix / Linky Asset integration`,
`Check Charging Station Registration Token at Web Socket connection and refuse it if not valid`,
`Set OCPI Opening Hours and Tariff ID for SLF Caen`,
`Set the OCPP heartbeat to 60 secs in OCPP 1.6-J`,
`Stop OCPI Transaction if receiving OCPP Meter Values with unknown Transaction ID`,
`Do not create a Transaction before checking Roaming Authorization`,
`Request OCPI Authorization Token also in OCPP Start Transaction in addition to OCPP Authorize`,
`Restrain OCPI Remote Authorization Token validity from 10 mins to 2 mins`

],
},
],
},
{
version: '2.4.78',
date: new Date('2021-07-20'),
Expand Down
3 changes: 3 additions & 0 deletions src/app/services/component.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ export class ComponentService {
settingsToSave.sensitiveData.push(`content.asset.connections[${index}].witConnection.password`);
settingsToSave.sensitiveData.push(`content.asset.connections[${index}].witConnection.clientSecret`);
break;
case AssetConnectionType.LACROIX:
settingsToSave.sensitiveData.push(`content.asset.connections[${index}].lacroixConnection.password`);
break;
}

});
Expand Down
4 changes: 4 additions & 0 deletions src/app/types/Setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ export interface AssetConnectionSetting extends TableData {
greencomConnection?: AssetGreencomConnectionType;
iothinkConnection?: AssetIothinkConnectionType;
witConnection?: AssetWitConnectionType;
lacroixConnection?: AssetLacroixConnectionType;
}

export enum AssetConnectionType {
Expand All @@ -254,6 +255,7 @@ export enum AssetConnectionType {
GREENCOM = 'greencom',
IOTHINK = 'iothink',
WIT = 'wit',
LACROIX = 'lacroix',
}

export interface AssetUserPasswordConnectionType {
Expand All @@ -265,6 +267,8 @@ export type AssetSchneiderConnectionType = AssetUserPasswordConnectionType;

export type AssetIothinkConnectionType = AssetUserPasswordConnectionType;

export type AssetLacroixConnectionType = AssetUserPasswordConnectionType;

export interface AssetGreencomConnectionType {
clientId: string;
clientSecret: string;
Expand Down
2 changes: 1 addition & 1 deletion src/assets/configs-aws
7 changes: 4 additions & 3 deletions src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"nbr_of_records": "Einträge",
"connectors": "Verknüpfungen",
"notifications": "Benachrichtungen",
"app_name": "e-Mobility",
"app_name": "Open e-Mobility",
"version": "Version",
"about_us": "About Us",
"unexpected_error_backend": "Ein unerwarteter Fehler ist aufgetreten",
Expand Down Expand Up @@ -505,7 +505,7 @@
"eula": "Endnutzer Lizenzvereinbarung",
"must_accept_eula": "Sie müssen die Endnutzer Lizenzvereinbarung akzeptieren",
"no_space_in_password": "Am Anfang und am Ende ist kein Leerzeichen erlaubt",
"title": "Anmelden bei e-Mobility",
"title": "Anmelden bei Open e-Mobility",
"register": "Registrieren",
"signup_link": "Neuer Nutzer? Registrieren!",
"signin_link": "Haben Sie bereits einen Account? Melden Sie sich an!",
Expand Down Expand Up @@ -1647,7 +1647,8 @@
"schneider": "Schneider Building Management System",
"greencom": "GreenCom Asset Management System",
"iothink": "ioThink Asset Management System",
"wit": "WIT Asset Management System"
"wit": "WIT Asset Management System",
"lacroix": "LACROIX Asset Management System"
},
"connection_success": "Die Verbindung zum System wurde erfolgreich getestet.",
"unknown_connection_error": "Unbekannter Verbindungsfehler",
Expand Down
7 changes: 4 additions & 3 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"nbr_of_records": "Records",
"connectors": "Connections",
"notifications": "Notifications",
"app_name": "e-Mobility",
"app_name": "Open e-Mobility",
"version": "Version",
"about_us": "About Us",
"unexpected_error_backend": "An unexpected error occurred, check the logs",
Expand Down Expand Up @@ -505,7 +505,7 @@
"eula": "End-user License Agreement",
"must_accept_eula": "You must accept the End-user License Agreement",
"no_space_in_password": "No space is allowed at the beginning and the end",
"title": "Sign in to e-Mobility",
"title": "Sign in to Open e-Mobility",
"register": "Register",
"signup_link": "New user? Register!",
"signin_link": "Already have an account? Sign in!",
Expand Down Expand Up @@ -1647,7 +1647,8 @@
"schneider": "Schneider Building Management System",
"greencom": "GreenCom Asset Management System",
"iothink": "ioThink Asset Management System",
"wit": "WIT Asset Management System"
"wit": "WIT Asset Management System",
"lacroix": "LACROIX Asset Management System"
},
"connection_success": "Connection to the system was tested successfully",
"unknown_connection_error": "Unknown connection error",
Expand Down
Loading

0 comments on commit fd1716a

Please sign in to comment.