- + portrait - {{'car.title' | translate}} - {{carCatalog?.value}} + {{'car.title' | translate}} - {{formGroup.controls['carCatalog'].value}}
-
-
-
-
-
-
-
-
-
-
-
-
- - - - - {{ "general.mandatory_field" | translate }} - - -
-
- - {{ "cars.converter" | translate }} * - - - {{ carCatalogConverter.value }} - - - {{ "general.mandatory_field" | translate }} - -
-
- - - {{ "general.mandatory_field" | translate }} - - {{ "cars.invalid_vin" | translate }} - -
-
- - - - {{ "general.mandatory_field" | translate }} - - - {{ "users.invalid_plate_id" | translate }} - - -
-
- - - - - -
-
-
- - {{ "cars.default_car" | translate }} - -
-
-
-
- -
- - {{type.value | translate}} - -
-
-
-
-
-
-
+
@@ -99,33 +15,8 @@ bluetooth_drive {{"car_connector.title"|translate}} -
-
-
- - {{ "cars.car_connector_name" | translate }} - - - {{carConnectorConnection.name}} - - - - -
-
-
-
- - - - -
-
-
+
+
diff --git a/src/app/pages/cars/car/car.component.ts b/src/app/pages/cars/car/car.component.ts index c3861252c1..f388e20e0f 100644 --- a/src/app/pages/cars/car/car.component.ts +++ b/src/app/pages/cars/car/car.component.ts @@ -1,70 +1,44 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/forms'; -import { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog'; -import { MatSelectChange } from '@angular/material/select'; -import { MatTabChangeEvent } from '@angular/material/tabs'; -import { Router } from '@angular/router'; +import { Component, Input, OnInit, ViewChild } from '@angular/core'; +import { FormGroup } from '@angular/forms'; +import { MatDialogRef } from '@angular/material/dialog'; +import { ActivatedRoute, Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { ComponentService } from 'services/component.service'; -import { UsersDialogComponent } from 'shared/dialogs/users/users-dialog.component'; +import { WindowService } from 'services/window.service'; +import { AbstractTabComponent } from 'shared/component/abstract-tab/abstract-tab.component'; import { CarsAuthorizations, DialogMode } from 'types/Authorization'; -import { CarConnectorConnectionSetting } from 'types/Setting'; import { TenantComponents } from 'types/Tenant'; import { CentralServerService } from '../../../services/central-server.service'; import { DialogService } from '../../../services/dialog.service'; import { MessageService } from '../../../services/message.service'; import { SpinnerService } from '../../../services/spinner.service'; -import { CarCatalogsDialogComponent } from '../../../shared/dialogs/car-catalogs/car-catalogs-dialog.component'; -import { Car, CarCatalog, CarConverter, CarConverterType, CarType } from '../../../types/Car'; +import { Car } from '../../../types/Car'; import { ActionResponse } from '../../../types/DataResult'; -import { KeyValue, RestResponse } from '../../../types/GlobalType'; +import { RestResponse } from '../../../types/GlobalType'; import { HTTPError } from '../../../types/HTTPError'; -import { User } from '../../../types/User'; -import { Cars } from '../../../utils/Cars'; -import { Constants } from '../../../utils/Constants'; import { Utils } from '../../../utils/Utils'; +import { CarConnectorComponent } from './connector/car-connector.component'; +import { CarMainComponent } from './main/car-main.component'; @Component({ selector: 'app-car', templateUrl: 'car.component.html', }) -export class CarComponent implements OnInit { +export class CarComponent extends AbstractTabComponent implements OnInit { @Input() public currentCarID!: string; @Input() public dialogMode!: DialogMode; @Input() public dialogRef!: MatDialogRef; @Input() public carsAuthorizations!: CarsAuthorizations; - public carCatalogImage: string; - public selectedCarCatalog: CarCatalog; - public carCatalogConverters: { type: CarConverterType; value: string; converter: CarConverter }[] = []; - public canListUsers: boolean; - public isCarConnectorComponentActive: boolean; - public readOnly = true; - public formGroup!: FormGroup; - public id!: AbstractControl; - public vin!: AbstractControl; - public licensePlate!: AbstractControl; - public isCompanyCar!: AbstractControl; - public carCatalogID!: AbstractControl; - public carCatalog!: AbstractControl; - public converterType!: AbstractControl; - public converter!: AbstractControl; - public isDefault!: AbstractControl; - public type!: AbstractControl; - public noImage = Constants.NO_IMAGE; - public user!: AbstractControl; - public userID!: AbstractControl; - public carTypes: KeyValue[] = [ - { key: CarType.COMPANY, value: 'cars.company_car' }, - { key: CarType.PRIVATE, value: 'cars.private_car' } - ]; - public carConnectorName!: AbstractControl; - public carConnectorID!: AbstractControl; - public carConnectorMeterID!: AbstractControl; - public carConnectorConnections!: CarConnectorConnectionSetting[]; + @ViewChild('carMainComponent') public carMainComponent!: CarMainComponent; + @ViewChild('carConnectorComponent') public carConnectorComponent!: CarConnectorComponent; - private car: Car; + public formGroup!: FormGroup; + public isCarConnectorComponentActive: boolean; + public canListUsers: boolean; + public readOnly = true; + public car: Car; public constructor( public spinnerService: SpinnerService, @@ -73,101 +47,27 @@ export class CarComponent implements OnInit { private translateService: TranslateService, private dialogService: DialogService, private router: Router, - private dialog: MatDialog, - private componentService: ComponentService ) { + private componentService: ComponentService, + protected activatedRoute: ActivatedRoute, + protected windowService: WindowService) { + super(activatedRoute, windowService, ['main', 'connector'], false); this.isCarConnectorComponentActive = this.componentService.isActive(TenantComponents.CAR_CONNECTOR); } public ngOnInit() { - this.carConnectorName = new FormControl(''); // Init the form - this.formGroup = new FormGroup({ - id: new FormControl(''), - vin: new FormControl('', - Validators.compose([ - Validators.required, - Cars.validateVIN - ])), - licensePlate: new FormControl('', - Validators.compose([ - Validators.pattern('^[A-Z0-9- ]*$'), - ])), - carCatalog: new FormControl('', - Validators.compose([ - Validators.required, - ])), - carCatalogID: new FormControl('', - Validators.compose([ - Validators.required, - ])), - converterType: new FormControl('', - Validators.compose([ - Validators.required, - ])), - converter: new FormControl('', - Validators.compose([ - Validators.required, - ])), - user: new FormControl('', - Validators.compose([ - ])), - userID: new FormControl('', - Validators.compose([ - ])), - isDefault: new FormControl(''), - type: new FormControl(CarType.COMPANY, - Validators.compose([ - Validators.required, - ])), - }); - if(this.isCarConnectorComponentActive){ - this.formGroup.addControl( - 'carConnectorData', new FormGroup({ - carConnectorID: new FormControl('', - Validators.compose([ - ])), - carConnectorMeterID: new FormControl('', - Validators.compose([ - ])), - })); - } - // Form - this.id = this.formGroup.controls['id']; - this.vin = this.formGroup.controls['vin']; - this.licensePlate = this.formGroup.controls['licensePlate']; - this.carCatalogID = this.formGroup.controls['carCatalogID']; - this.carCatalog = this.formGroup.controls['carCatalog']; - this.user = this.formGroup.controls['user']; - this.userID = this.formGroup.controls['userID']; - this.isDefault = this.formGroup.controls['isDefault']; - this.converterType = this.formGroup.controls['converterType']; - this.converter = this.formGroup.controls['converter']; - this.type = this.formGroup.controls['type']; - this.carConnectorID = this.formGroup.get('carConnectorData.carConnectorID'); - this.carConnectorMeterID = this.formGroup.get('carConnectorData.carConnectorMeterID'); - // Default - this.converterType.disable(); - // Initialize authorization actions - this.canListUsers = Utils.convertToBoolean(this.carsAuthorizations.canListUsers); - // Car pool selection handled by cars metadata - if(this.carsAuthorizations.metadata?.createPoolCar?.visible) { - this.carTypes.push({ key: CarType.POOL_CAR, value: 'cars.pool_car' }); - } + this.formGroup = new FormGroup({}); // Handle Dialog mode - this.readOnly = (this.dialogMode === DialogMode.VIEW); + this.readOnly = this.dialogMode === DialogMode.VIEW; + this.canListUsers = Utils.convertToBoolean(this.carsAuthorizations.canListUsers); Utils.handleDialogMode(this.dialogMode, this.formGroup); // Load Car this.loadCar(); } public onClose() { - this.closeDialog(); - } - - public converterChanged(event: MatSelectChange) { - this.converter.setValue( - this.carCatalogConverters.find((converter) => converter.type === event.value).converter - ); + Utils.checkAndSaveAndCloseDialog(this.formGroup, this.dialogService, + this.translateService, this.saveCar.bind(this), this.closeDialog.bind(this)); } public loadCar() { @@ -176,32 +76,14 @@ export class CarComponent implements OnInit { this.centralServerService.getCar(this.currentCarID).subscribe((car: Car) => { this.spinnerService.hide(); this.car = car; - // Init form - this.id.setValue(car.id); - this.carCatalogID.setValue(car.carCatalogID); - this.selectedCarCatalog = car.carCatalog; - this.buildCarCatalogConverter(); - this.vin.setValue(car.vin); - this.licensePlate.setValue(car.licensePlate); - this.type.setValue(car.type); - this.converter.setValue(car.converter); - this.converterType.setValue(car.converter.type); - this.carCatalog.setValue(Utils.buildCarCatalogName(car.carCatalog)); - this.carCatalogImage = car.carCatalog.image; - this.isDefault.setValue(car.default); - this.userID.setValue(car.userID); - if (car.user) { - this.user.setValue(Utils.buildUserFullName(car.user)); - } if (this.readOnly) { // Async call for letting the sub form groups to init setTimeout(() => this.formGroup.disable(), 0); } + // Update form group this.formGroup.updateValueAndValidity(); this.formGroup.markAsPristine(); this.formGroup.markAllAsTouched(); - // Update auhorization actions - this.canListUsers = Utils.convertToBoolean(car.canListUsers); }, (error) => { this.spinnerService.hide(); switch (error.status) { @@ -216,50 +98,6 @@ export class CarComponent implements OnInit { } } - public clearUser() { - this.car.user = null; - this.car.userID = null; - this.user.setValue(null); - this.userID.setValue(null); - this.formGroup.markAsDirty(); - } - - public clearCarConnectorMeterID() { - this.car.carConnectorData.carConnectorMeterID = null; - this.carConnectorMeterID.setValue(null); - this.formGroup.markAsDirty(); - } - - public clearCarConnectorID() { - this.car.carConnectorData.carConnectorID = null; - this.carConnectorID.setValue(null); - this.car.carConnectorData.carConnectorMeterID = null; - this.carConnectorMeterID.setValue(null); - this.carConnectorMeterID.disable(); - this.formGroup.markAsDirty(); - } - - public assignUser() { - // Create the dialog - const dialogConfig = new MatDialogConfig(); - dialogConfig.panelClass = 'transparent-dialog-container'; - dialogConfig.data = { - title: 'cars.assign_user', - validateButtonTitle: 'general.select', - sitesAdminOnly: true, - rowMultipleSelection: false, - }; - // Open - this.dialog.open(UsersDialogComponent, dialogConfig).afterClosed().subscribe((result) => { - if (!Utils.isEmptyArray(result) && result[0].objectRef) { - const user = ((result[0].objectRef) as User); - this.user.setValue(Utils.buildUserFullName(user)); - this.userID.setValue(user.id); - this.formGroup.markAsDirty(); - } - }); - } - public closeDialog(saved: boolean = false) { if (this.dialogRef) { this.dialogRef.close(saved); @@ -279,51 +117,13 @@ export class CarComponent implements OnInit { } } - public changeCarCatalog() { - // Create the dialog - const dialogConfig = new MatDialogConfig(); - dialogConfig.panelClass = 'transparent-dialog-container'; - dialogConfig.data = { - title: 'cars.assign_car_catalog', - validateButtonTitle: 'general.select', - rowMultipleSelection: false, - }; - // Open - this.dialog.open(CarCatalogsDialogComponent, dialogConfig).afterClosed().subscribe((result) => { - if (!Utils.isEmptyArray(result) && result[0].objectRef) { - const carCatalog: CarCatalog = (result[0].objectRef) as CarCatalog; - this.carCatalogID.setValue(result[0].key); - this.carCatalog.setValue(Utils.buildCarCatalogName(carCatalog)); - this.selectedCarCatalog = carCatalog; - this.carCatalogImage = carCatalog.image; - // Build drop down - this.buildCarCatalogConverter(); - this.formGroup.markAsDirty(); - } - }); - } - - public carConnectorChanged(event: MatSelectChange) { - this.carConnectorID.setValue(event.value); - if(this.carConnectorID){ - this.carConnectorMeterID.enable(); - } else { - this.carConnectorMeterID.disable(); - } - } - - public onTabChanged(event: MatTabChangeEvent) { - if(event.index === 1 && Utils.isNullOrUndefined(this.carConnectorConnections)) { - this.loadCarConnectors(); - } - } - private updateCar(car: Car) { this.spinnerService.show(); this.centralServerService.updateCar(car).subscribe((response: ActionResponse) => { this.spinnerService.hide(); if (response.status === RestResponse.SUCCESS) { - this.messageService.showSuccessMessage('cars.update_success', { carName: Utils.buildCarCatalogName(this.selectedCarCatalog) }); + this.messageService.showSuccessMessage('cars.update_success', { + carName: this.formGroup.controls['carCatalog'].value }); this.closeDialog(true); } else { Utils.handleError(JSON.stringify(response), this.messageService, 'cars.update_error'); @@ -353,7 +153,8 @@ export class CarComponent implements OnInit { this.centralServerService.createCar(car, forced).subscribe((response: ActionResponse) => { this.spinnerService.hide(); if (response.status === RestResponse.SUCCESS) { - this.messageService.showSuccessMessage('cars.create_success', { carName: Utils.buildCarCatalogName(this.selectedCarCatalog) }); + this.messageService.showSuccessMessage('cars.create_success', { + carName: this.formGroup.controls['carCatalog'].value }); this.closeDialog(true); } else { Utils.handleError(JSON.stringify(response), this.messageService, 'cars.create_error'); @@ -375,79 +176,4 @@ export class CarComponent implements OnInit { } }); } - - private buildCarCatalogConverter() { - const standardConverter: CarConverter = { - type: CarConverterType.STANDARD, - powerWatts: this.selectedCarCatalog.chargeStandardPower, - amperagePerPhase: this.selectedCarCatalog.chargeStandardPhaseAmp, - numberOfPhases: this.selectedCarCatalog.chargeStandardPhase, - }; - const alternativeConverter: CarConverter = { - type: CarConverterType.ALTERNATIVE, - powerWatts: this.selectedCarCatalog.chargeAlternativePower, - amperagePerPhase: this.selectedCarCatalog.chargeAlternativePhaseAmp, - numberOfPhases: this.selectedCarCatalog.chargeAlternativePhase, - }; - const optionalConverter: CarConverter = { - type: CarConverterType.OPTION, - powerWatts: this.selectedCarCatalog.chargeOptionPower, - amperagePerPhase: this.selectedCarCatalog.chargeOptionPhaseAmp, - numberOfPhases: this.selectedCarCatalog.chargeOptionPhase, - }; - this.carCatalogConverters = [{ - type: CarConverterType.STANDARD, - value: Utils.buildCarCatalogConverterName(standardConverter, this.translateService), - converter: standardConverter, - }]; - if (this.selectedCarCatalog.chargeAlternativePower) { - this.carCatalogConverters.push({ - type: CarConverterType.ALTERNATIVE, - value: Utils.buildCarCatalogConverterName(alternativeConverter, this.translateService), - converter: alternativeConverter, - }); - } - if (this.selectedCarCatalog.chargeOptionPower > 0 && - this.selectedCarCatalog.chargeOptionPower !== this.selectedCarCatalog.chargeAlternativePower) { - this.carCatalogConverters.push({ - type: CarConverterType.OPTION, - value: Utils.buildCarCatalogConverterName(optionalConverter, this.translateService), - converter: optionalConverter, - }); - } - // Set default - if (this.carCatalogConverters.length === 1) { - this.converterType.setValue(this.carCatalogConverters[0].type); - this.converter.setValue(this.carCatalogConverters[0].converter); - } else { - this.converterType.setValue(''); - } - this.converterType.enable(); - } - - private loadCarConnectors(){ - this.componentService.getCarConnectorSettings().subscribe((settings) => { - // Keep - this.carConnectorConnections = settings.carConnector.connections; - const carConnectorID = this.carConnectorConnections.find((carConnectorConnection) => - carConnectorConnection.id === this.car.carConnectorData?.carConnectorID)?.id; - // Set - if(!Utils.isNullOrUndefined(carConnectorID)){ - this.carConnectorID.setValue(carConnectorID); - this.carConnectorMeterID.setValue(this.car.carConnectorData?.carConnectorMeterID); - } else { - this.carConnectorMeterID.disable(); - } - this.formGroup.markAsPristine(); - }, (error) => { - switch (error.status) { - case HTTPError.OBJECT_DOES_NOT_EXIST_ERROR: - this.messageService.showErrorMessage('settings.car_connector.setting_not_found'); - break; - default: - Utils.handleHttpError(error, this.router, this.messageService, - this.centralServerService, 'general.unexpected_error_backend'); - } - }); - } } diff --git a/src/app/pages/cars/car/connector/car-connector.component.html b/src/app/pages/cars/car/connector/car-connector.component.html new file mode 100644 index 0000000000..a289d94dce --- /dev/null +++ b/src/app/pages/cars/car/connector/car-connector.component.html @@ -0,0 +1,27 @@ +
+
+
+ + {{ "cars.car_connector_name" | translate }} + + + {{carConnectorConnection.name}} + + + + +
+
+
+
+ + + + +
+
+
diff --git a/src/app/pages/cars/car/connector/car-connector.component.ts b/src/app/pages/cars/car/connector/car-connector.component.ts new file mode 100644 index 0000000000..2253fe78b4 --- /dev/null +++ b/src/app/pages/cars/car/connector/car-connector.component.ts @@ -0,0 +1,113 @@ +import { Component, Input, OnChanges, OnInit } from '@angular/core'; +import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/forms'; +import { MatSelectChange } from '@angular/material/select'; +import { Router } from '@angular/router'; +import { ComponentService } from 'services/component.service'; +import { CarsAuthorizations } from 'types/Authorization'; +import { CarConnectorConnectionSetting } from 'types/Setting'; + +import { CentralServerService } from '../../../../services/central-server.service'; +import { MessageService } from '../../../../services/message.service'; +import { SpinnerService } from '../../../../services/spinner.service'; +import { Car } from '../../../../types/Car'; +import { HTTPError } from '../../../../types/HTTPError'; +import { Utils } from '../../../../utils/Utils'; + +@Component({ + selector: 'app-car-connector', + templateUrl: 'car-connector.component.html', +}) +export class CarConnectorComponent implements OnInit, OnChanges { + @Input() public formGroup: FormGroup; + @Input() public car!: Car; + @Input() public readOnly: boolean; + @Input() public carsAuthorizations!: CarsAuthorizations; + + public carConnectorName!: AbstractControl; + public carConnectorID!: AbstractControl; + public carConnectorMeterID!: AbstractControl; + public carConnectorConnections!: CarConnectorConnectionSetting[]; + + // eslint-disable-next-line no-useless-constructor + public constructor( + public spinnerService: SpinnerService, + private centralServerService: CentralServerService, + private messageService: MessageService, + private router: Router, + private componentService: ComponentService ) { + } + + public ngOnInit() { + this.formGroup.addControl( + 'carConnectorData', new FormGroup({ + carConnectorID: new FormControl('', + Validators.compose([ + ])), + carConnectorMeterID: new FormControl('', + Validators.compose([ + ])), + })); + this.carConnectorID = this.formGroup.get('carConnectorData.carConnectorID'); + this.carConnectorMeterID = this.formGroup.get('carConnectorData.carConnectorMeterID'); + // Load available connectors + this.loadCarConnectors(); + } + + public ngOnChanges() { + this.loadCar(); + } + + public loadCar() { + if (this.car && this.carConnectorConnections) { + const foundCarConnectorConnection = this.carConnectorConnections.find((carConnectorConnection) => + carConnectorConnection.id === this.car.carConnectorData?.carConnectorID); + // Set + if(!Utils.isNullOrUndefined(foundCarConnectorConnection?.id)){ + this.carConnectorID.setValue(foundCarConnectorConnection.id); + this.carConnectorMeterID.setValue(this.car.carConnectorData?.carConnectorMeterID); + } else { + this.carConnectorMeterID.disable(); + } + } + } + + public clearCarConnectorMeterID() { + this.car.carConnectorData.carConnectorMeterID = null; + this.carConnectorMeterID.setValue(null); + this.formGroup.markAsDirty(); + } + + public clearCarConnectorID() { + this.car.carConnectorData.carConnectorID = null; + this.carConnectorID.setValue(null); + this.car.carConnectorData.carConnectorMeterID = null; + this.carConnectorMeterID.setValue(null); + this.carConnectorMeterID.disable(); + this.formGroup.markAsDirty(); + } + + public carConnectorChanged(event: MatSelectChange) { + this.carConnectorID.setValue(event.value); + if(this.carConnectorID){ + this.carConnectorMeterID.enable(); + } else { + this.carConnectorMeterID.disable(); + } + } + + private loadCarConnectors() { + this.componentService.getCarConnectorSettings().subscribe((settings) => { + this.carConnectorConnections = settings.carConnector.connections; + this.loadCar(); + }, (error) => { + switch (error.status) { + case HTTPError.OBJECT_DOES_NOT_EXIST_ERROR: + this.messageService.showErrorMessage('settings.car_connector.setting_not_found'); + break; + default: + Utils.handleHttpError(error, this.router, this.messageService, + this.centralServerService, 'general.unexpected_error_backend'); + } + }); + } +} diff --git a/src/app/pages/cars/car/main/car-main.component.html b/src/app/pages/cars/car/main/car-main.component.html new file mode 100644 index 0000000000..2faca0b84b --- /dev/null +++ b/src/app/pages/cars/car/main/car-main.component.html @@ -0,0 +1,86 @@ +
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + {{ "general.mandatory_field" | translate }} + + +
+
+ + {{ "cars.converter" | translate }} * + + + {{ carCatalogConverter.value }} + + + {{ "general.mandatory_field" | translate }} + +
+
+ + + {{ "general.mandatory_field" | translate }} + + {{ "cars.invalid_vin" | translate }} + +
+
+ + + + {{ "general.mandatory_field" | translate }} + + + {{ "users.invalid_plate_id" | translate }} + + +
+
+ + + + + +
+
+
+ + {{ "cars.default_car" | translate }} + +
+
+
+
+ +
+ + {{type.value | translate}} + +
+
+
+
+
+
+
diff --git a/src/app/pages/cars/car/main/car-main.component.ts b/src/app/pages/cars/car/main/car-main.component.ts new file mode 100644 index 0000000000..ed503000c7 --- /dev/null +++ b/src/app/pages/cars/car/main/car-main.component.ts @@ -0,0 +1,248 @@ +import { Component, Input, OnChanges, OnInit } from '@angular/core'; +import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/forms'; +import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; +import { MatSelectChange } from '@angular/material/select'; +import { TranslateService } from '@ngx-translate/core'; +import { UsersDialogComponent } from 'shared/dialogs/users/users-dialog.component'; +import { CarsAuthorizations } from 'types/Authorization'; + +import { SpinnerService } from '../../../../services/spinner.service'; +import { CarCatalogsDialogComponent } from '../../../../shared/dialogs/car-catalogs/car-catalogs-dialog.component'; +import { Car, CarCatalog, CarConverter, CarConverterType, CarType } from '../../../../types/Car'; +import { KeyValue } from '../../../../types/GlobalType'; +import { User } from '../../../../types/User'; +import { Cars } from '../../../../utils/Cars'; +import { Constants } from '../../../../utils/Constants'; +import { Utils } from '../../../../utils/Utils'; + +@Component({ + selector: 'app-car-main', + templateUrl: 'car-main.component.html', +}) +export class CarMainComponent implements OnInit, OnChanges { + @Input() public formGroup: FormGroup; + @Input() public car!: Car; + @Input() public readOnly: boolean; + @Input() public carsAuthorizations!: CarsAuthorizations; + + public carCatalogImage: string; + public selectedCarCatalog: CarCatalog; + public carCatalogConverters: { type: CarConverterType; value: string; converter: CarConverter }[] = []; + public canListUsers: boolean; + public isCarConnectorComponentActive: boolean; + + public id!: AbstractControl; + public vin!: AbstractControl; + public licensePlate!: AbstractControl; + public isCompanyCar!: AbstractControl; + public carCatalogID!: AbstractControl; + public carCatalog!: AbstractControl; + public converterType!: AbstractControl; + public converter!: AbstractControl; + public isDefault!: AbstractControl; + public type!: AbstractControl; + public noImage = Constants.NO_IMAGE; + public user!: AbstractControl; + public userID!: AbstractControl; + public carTypes: KeyValue[] = [ + { key: CarType.COMPANY, value: 'cars.company_car' }, + { key: CarType.PRIVATE, value: 'cars.private_car' } + ]; + + // eslint-disable-next-line no-useless-constructor + public constructor( + public spinnerService: SpinnerService, + private translateService: TranslateService, + private dialog: MatDialog) { + } + + public ngOnInit() { + this.formGroup.addControl('id', new FormControl('')); + this.formGroup.addControl('vin', new FormControl('', + Validators.compose([ + Validators.required, + Cars.validateVIN + ]))); + this.formGroup.addControl('licensePlate', new FormControl('', + Validators.compose([ + Validators.pattern('^[A-Z0-9- ]*$'), + ]))); + this.formGroup.addControl('carCatalog', new FormControl('', + Validators.compose([ + Validators.required, + ]))); + this.formGroup.addControl('carCatalogID', new FormControl('', + Validators.compose([ + Validators.required, + ]))); + this.formGroup.addControl('converterType', new FormControl('', + Validators.compose([ + Validators.required, + ]))); + this.formGroup.addControl('converter', new FormControl('', + Validators.compose([ + Validators.required, + ]))); + this.formGroup.addControl('user', new FormControl('')); + this.formGroup.addControl('userID', new FormControl('')); + this.formGroup.addControl('isDefault', new FormControl('')); + this.formGroup.addControl('type', new FormControl(CarType.COMPANY, + Validators.compose([ + Validators.required, + ]))); + // Form + this.id = this.formGroup.controls['id']; + this.vin = this.formGroup.controls['vin']; + this.licensePlate = this.formGroup.controls['licensePlate']; + this.carCatalogID = this.formGroup.controls['carCatalogID']; + this.carCatalog = this.formGroup.controls['carCatalog']; + this.user = this.formGroup.controls['user']; + this.userID = this.formGroup.controls['userID']; + this.isDefault = this.formGroup.controls['isDefault']; + this.converterType = this.formGroup.controls['converterType']; + this.converter = this.formGroup.controls['converter']; + this.type = this.formGroup.controls['type']; + // Default + this.converterType.disable(); + // Car pool selection handled by cars metadata + if(this.carsAuthorizations.metadata?.createPoolCar?.visible) { + this.carTypes.push({ key: CarType.POOL_CAR, value: 'cars.pool_car' }); + } + } + + public ngOnChanges() { + this.loadCar(); + } + + public loadCar() { + if (this.car) { + this.id.setValue(this.car.id); + this.carCatalogID.setValue(this.car.carCatalogID); + this.selectedCarCatalog = this.car.carCatalog; + this.buildCarCatalogConverter(); + this.vin.setValue(this.car.vin); + this.licensePlate.setValue(this.car.licensePlate); + this.type.setValue(this.car.type); + this.converter.setValue(this.car.converter); + this.converterType.setValue(this.car.converter.type); + this.carCatalog.setValue(Utils.buildCarCatalogName(this.car.carCatalog)); + this.carCatalogImage = this.car.carCatalog.image; + this.isDefault.setValue(this.car.default); + this.userID.setValue(this.car.userID); + if (this.car.user) { + this.user.setValue(Utils.buildUserFullName(this.car.user)); + } + this.canListUsers = Utils.convertToBoolean(this.car.canListUsers); + } + } + + public converterChanged(event: MatSelectChange) { + this.converter.setValue( + this.carCatalogConverters.find((converter) => converter.type === event.value).converter + ); + } + + public clearUser() { + this.car.user = null; + this.car.userID = null; + this.user.setValue(null); + this.userID.setValue(null); + this.formGroup.markAsDirty(); + } + + public assignUser() { + // Create the dialog + const dialogConfig = new MatDialogConfig(); + dialogConfig.panelClass = 'transparent-dialog-container'; + dialogConfig.data = { + title: 'cars.assign_user', + validateButtonTitle: 'general.select', + sitesAdminOnly: true, + rowMultipleSelection: false, + }; + // Open + this.dialog.open(UsersDialogComponent, dialogConfig).afterClosed().subscribe((result) => { + if (!Utils.isEmptyArray(result) && result[0].objectRef) { + const user = ((result[0].objectRef) as User); + this.user.setValue(Utils.buildUserFullName(user)); + this.userID.setValue(user.id); + this.formGroup.markAsDirty(); + } + }); + } + + public changeCarCatalog() { + // Create the dialog + const dialogConfig = new MatDialogConfig(); + dialogConfig.panelClass = 'transparent-dialog-container'; + dialogConfig.data = { + title: 'cars.assign_car_catalog', + validateButtonTitle: 'general.select', + rowMultipleSelection: false, + }; + // Open + this.dialog.open(CarCatalogsDialogComponent, dialogConfig).afterClosed().subscribe((result) => { + if (!Utils.isEmptyArray(result) && result[0].objectRef) { + const carCatalog: CarCatalog = (result[0].objectRef) as CarCatalog; + this.carCatalogID.setValue(result[0].key); + this.carCatalog.setValue(Utils.buildCarCatalogName(carCatalog)); + this.selectedCarCatalog = carCatalog; + this.carCatalogImage = carCatalog.image; + // Build drop down + this.buildCarCatalogConverter(); + this.formGroup.markAsDirty(); + } + }); + } + + private buildCarCatalogConverter() { + console.log(this.selectedCarCatalog); + + const standardConverter: CarConverter = { + type: CarConverterType.STANDARD, + powerWatts: this.selectedCarCatalog.chargeStandardPower, + amperagePerPhase: this.selectedCarCatalog.chargeStandardPhaseAmp, + numberOfPhases: this.selectedCarCatalog.chargeStandardPhase, + }; + const alternativeConverter: CarConverter = { + type: CarConverterType.ALTERNATIVE, + powerWatts: this.selectedCarCatalog.chargeAlternativePower, + amperagePerPhase: this.selectedCarCatalog.chargeAlternativePhaseAmp, + numberOfPhases: this.selectedCarCatalog.chargeAlternativePhase, + }; + const optionalConverter: CarConverter = { + type: CarConverterType.OPTION, + powerWatts: this.selectedCarCatalog.chargeOptionPower, + amperagePerPhase: this.selectedCarCatalog.chargeOptionPhaseAmp, + numberOfPhases: this.selectedCarCatalog.chargeOptionPhase, + }; + this.carCatalogConverters = [{ + type: CarConverterType.STANDARD, + value: Utils.buildCarCatalogConverterName(standardConverter, this.translateService), + converter: standardConverter, + }]; + if (this.selectedCarCatalog.chargeAlternativePower) { + this.carCatalogConverters.push({ + type: CarConverterType.ALTERNATIVE, + value: Utils.buildCarCatalogConverterName(alternativeConverter, this.translateService), + converter: alternativeConverter, + }); + } + if (this.selectedCarCatalog.chargeOptionPower > 0 && + this.selectedCarCatalog.chargeOptionPower !== this.selectedCarCatalog.chargeAlternativePower) { + this.carCatalogConverters.push({ + type: CarConverterType.OPTION, + value: Utils.buildCarCatalogConverterName(optionalConverter, this.translateService), + converter: optionalConverter, + }); + } + // Set default + if (this.carCatalogConverters.length === 1) { + this.converterType.setValue(this.carCatalogConverters[0].type); + this.converter.setValue(this.carCatalogConverters[0].converter); + } else { + this.converterType.setValue(''); + } + this.converterType.enable(); + } +} diff --git a/src/app/pages/cars/cars.module.ts b/src/app/pages/cars/cars.module.ts index 725102ed53..650b804362 100644 --- a/src/app/pages/cars/cars.module.ts +++ b/src/app/pages/cars/cars.module.ts @@ -15,6 +15,8 @@ import { CarCarouselComponent } from './car-catalog/carousel/car-carousel.compon import { CarCatalogsListComponent } from './car-catalogs/car-catalogs-list.component'; import { CarDialogComponent } from './car/car-dialog.component'; import { CarComponent } from './car/car.component'; +import { CarConnectorComponent } from './car/connector/car-connector.component'; +import { CarMainComponent } from './car/main/car-main.component'; import { CarsComponent } from './cars.component'; import { CarsRoutes } from './cars.routing'; import { CarsListComponent } from './cars/cars-list.component'; @@ -43,6 +45,8 @@ import { CarImageFormatterCellComponent } from './cell-components/car-image-form CarsListComponent, CarDialogComponent, CarComponent, + CarMainComponent, + CarConnectorComponent, ], entryComponents: [ CarCatalogComponent, @@ -53,6 +57,8 @@ import { CarImageFormatterCellComponent } from './cell-components/car-image-form CarsListComponent, CarDialogComponent, CarComponent, + CarMainComponent, + CarConnectorComponent, ], providers: [ ], diff --git a/src/app/pages/organization/companies/company/main/company-main.component.html b/src/app/pages/organization/companies/company/main/company-main.component.html index 2614c2fa45..6304485b06 100644 --- a/src/app/pages/organization/companies/company/main/company-main.component.html +++ b/src/app/pages/organization/companies/company/main/company-main.component.html @@ -1,49 +1,47 @@ -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
-
-
- +
+
+
+
-
-
- - - - {{"general.mandatory_field" | translate}} - - -
-
-
-
- +
+
+ + + + {{"general.mandatory_field" | translate}} + +
- -
+
+
+
+ +
+
+ diff --git a/src/app/pages/organization/site-areas/site-area/main/site-area-main.component.html b/src/app/pages/organization/site-areas/site-area/main/site-area-main.component.html index bd8c0325b1..08168fb6c3 100644 --- a/src/app/pages/organization/site-areas/site-area/main/site-area-main.component.html +++ b/src/app/pages/organization/site-areas/site-area/main/site-area-main.component.html @@ -1,165 +1,163 @@ -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
-
-
-
- {{'general.change_picture' | translate}} -
- +
+
+
+
+ {{'general.change_picture' | translate}} +
+
-
-
- - - - {{"general.mandatory_field" | translate}} - - -
-
-
- - - - - {{"general.mandatory_field" | translate}} - - - - - -
- - {{'site_areas.enable_access_control' | translate}} - +
+
+
+ + + + {{"general.mandatory_field" | translate}} + + +
+
+
+ + + + + {{"general.mandatory_field" | translate}} + + + + + +
+ + {{'site_areas.enable_access_control' | translate}} + +
+
+ + {{'site_areas.enable_smart_charging' | translate}} + +
+
+
+ + + 230 + 110 + +
-
- - {{'site_areas.enable_smart_charging' | translate}} - +
+ + {{'site_areas.number_of_phases' | translate}} + + + + {{phase.description | translate}} + + + + {{"general.mandatory_field" | translate}} +
-
-
- - - 230 - 110 - - -
-
- - {{'site_areas.number_of_phases' | translate}} - - - - {{phase.description | translate}} - - - - {{"general.mandatory_field" | translate}} - -
-
- - - - {{"general.error_min_value" | translate:{value: 1} }} - {{"chargers.invalid_power" | translate}} - - {{"general.mandatory_field" | translate}} - - -
-
-
- - - -
-
- - - -
+
+ + + + {{"general.error_min_value" | translate:{value: 1} }} + {{"chargers.invalid_power" | translate}} + + {{"general.mandatory_field" | translate}} + + +
+
+
+ + + +
+
+ + +
-
-
-
-
+
+
+
+ + + - - - - - -
-
- -
+ + +
+
+
-
-
- -
+
+
+
+
-
- -
+
+
+ diff --git a/src/app/pages/organization/site-areas/site-area/ocpi/site-area-ocpi.component.html b/src/app/pages/organization/site-areas/site-area/ocpi/site-area-ocpi.component.html index f43d37b934..87c206bb64 100644 --- a/src/app/pages/organization/site-areas/site-area/ocpi/site-area-ocpi.component.html +++ b/src/app/pages/organization/site-areas/site-area/ocpi/site-area-ocpi.component.html @@ -1,19 +1,17 @@ -
-
-
-
- - - - {{"general.mandatory_field" | translate}} - -
-
-
-
+ +
+
+ + + + {{"general.mandatory_field" | translate}} + +
+
+
- -
+
+ diff --git a/src/app/pages/organization/sites/site/main/site-main.component.html b/src/app/pages/organization/sites/site/main/site-main.component.html index 7be08df04b..5af7360125 100644 --- a/src/app/pages/organization/sites/site/main/site-main.component.html +++ b/src/app/pages/organization/sites/site/main/site-main.component.html @@ -1,86 +1,84 @@ -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
-
-
-
- {{'general.change_picture' | translate}} -
- +
+
+
+
+ {{'general.change_picture' | translate}} +
+
-
-
- - - - {{"general.mandatory_field" | translate}} - - -
-
-
-
-
- - - - - {{"general.mandatory_field" | translate}} - - - - - -
-
-
- - {{'sites.auto_user_site_assignment' | translate}} - -
+
+
+
+ + + + {{"general.mandatory_field" | translate}} + + +
+
+
+
+
+ + + + + {{"general.mandatory_field" | translate}} + + + + + +
+
+
+ + {{'sites.auto_user_site_assignment' | translate}} +
-
-
- - {{'sites.public' | translate}} - -
+
+
+
+ + {{'sites.public' | translate}} +
-
-
- -
+
+
+
+
- -
+
+ \ No newline at end of file diff --git a/src/app/pages/organization/sites/site/ocpi/site-ocpi.component.html b/src/app/pages/organization/sites/site/ocpi/site-ocpi.component.html index f43d37b934..87c206bb64 100644 --- a/src/app/pages/organization/sites/site/ocpi/site-ocpi.component.html +++ b/src/app/pages/organization/sites/site/ocpi/site-ocpi.component.html @@ -1,19 +1,17 @@ -
-
-
-
- - - - {{"general.mandatory_field" | translate}} - -
-
-
-
+ +
+
+ + + + {{"general.mandatory_field" | translate}} + +
+
+
- -
+
+ diff --git a/src/app/pages/settings-technical/crypto/settings-crypto.component.html b/src/app/pages/settings-technical/crypto/settings-crypto.component.html index 18870742d7..a843e37935 100644 --- a/src/app/pages/settings-technical/crypto/settings-crypto.component.html +++ b/src/app/pages/settings-technical/crypto/settings-crypto.component.html @@ -1,12 +1,10 @@ -
-
-
- -
- - -
-
\ No newline at end of file +
+
+ +
+ + +
\ No newline at end of file diff --git a/src/app/pages/settings-technical/users/settings-user.component.html b/src/app/pages/settings-technical/users/settings-user.component.html index 1594df9528..7eca60d91c 100644 --- a/src/app/pages/settings-technical/users/settings-user.component.html +++ b/src/app/pages/settings-technical/users/settings-user.component.html @@ -1,29 +1,27 @@ -
-
-
- -
-
-
-
- how_to_reg -
-

{{ "technical_settings.user.title" | translate }}

+ +
+ +
+
+
+
+ how_to_reg
-
-
-
- - {{ "technical_settings.user.auto_activation" | translate }} - -
+

{{ "technical_settings.user.title" | translate }}

+
+
+
+
+ + {{ "technical_settings.user.auto_activation" | translate }} +
- -
+
+ diff --git a/src/app/pages/tags/tag/main/tag-main.component.html b/src/app/pages/tags/tag/main/tag-main.component.html index 1b760f03f6..6546420c45 100644 --- a/src/app/pages/tags/tag/main/tag-main.component.html +++ b/src/app/pages/tags/tag/main/tag-main.component.html @@ -1,90 +1,88 @@ -
-
-
-
-
- - - - {{"general.mandatory_field" | translate}} - - {{"users.invalid_tag_id" | translate}} - -
-
- -
-
-
-
+ +
+
+
+ + + + {{"general.mandatory_field" | translate}} + + {{"users.invalid_tag_id" | translate}} + +
+
+ +
+
+
-
-
-
- - - - {{"general.mandatory_field" | translate}} - - -
+
+
+
+
+ + + + {{"general.mandatory_field" | translate}} + +
-
-
-
- - - - {{"general.mandatory_field" | translate}} - - -
+
+
+
+
+ + + + {{"general.mandatory_field" | translate}} + +
-
-
-
- - - - - {{"general.mandatory_field" | translate}} - - -
+
+
+
+
+ + + + + {{"general.mandatory_field" | translate}} + +
-
-
-
- - - {{'tags.activated' | translate}} - {{'tags.deactivated' | translate}} - - {{"general.mandatory_field" | translate}} - -
+
+
+
+
+ + + {{'tags.activated' | translate}} + {{'tags.deactivated' | translate}} + + {{"general.mandatory_field" | translate}} +
-
-
-
-
- - {{'tags.default_tag' | translate}} - -
+
+
+
+
+
+ + {{'tags.default_tag' | translate}} +
- -
+
+ diff --git a/src/app/pages/tenants/tenant/components/tenant-components.component.html b/src/app/pages/tenants/tenant/components/tenant-components.component.html index 58ac38d8aa..4ffaa4e9e2 100644 --- a/src/app/pages/tenants/tenant/components/tenant-components.component.html +++ b/src/app/pages/tenants/tenant/components/tenant-components.component.html @@ -1,150 +1,148 @@ -
-
-
-
-
-
- - -
-
{{"ocpi.title" | translate}}
-
-
+ +
+
+
+
+ + +
+
{{"ocpi.title" | translate}}
+
-
- - -
-
{{"oicp.title" | translate}}
-
-
+
+
+ + +
+
{{"oicp.title" | translate}}
+
-
- -
-
{{"refund.title" | translate}}
-
-
- - - - {{refundType.value | translate}} - - - - {{"general.mandatory_field" | translate}} - - +
+
+ +
+
{{"refund.title" | translate}}
+
-
- - -
-
{{"pricing.title" | translate}}
-
{{"pricing.description" | translate}}
-
- - - - {{pricingType.value | translate}} - - - - {{"general.mandatory_field" | translate}} - - + + + + {{refundType.value | translate}} + + + + {{"general.mandatory_field" | translate}} + + +
+
+ + +
+
{{"pricing.title" | translate}}
+
{{"pricing.description" | translate}}
-
- - -
-
{{"billing.title" | translate}}
-
{{"billing.description" | translate}}
-
- - - - {{billingType.value | translate}} - - - - {{"general.mandatory_field" | translate}} - - + + + + {{pricingType.value | translate}} + + + + {{"general.mandatory_field" | translate}} + + +
+
+ + +
+
{{"billing.title" | translate}}
+
{{"billing.description" | translate}}
-
- -
-
{{"organization.title" | translate}}
-
{{"organization.description" | translate}}
-
+ + + + {{billingType.value | translate}} + + + + {{"general.mandatory_field" | translate}} + + +
+
+ +
+
{{"organization.title" | translate}}
+
{{"organization.description" | translate}}
-
- -
-
{{"car.title" | translate}}
-
{{"car.description" | translate}}
-
+
+
+ +
+
{{"car.title" | translate}}
+
{{"car.description" | translate}}
-
- -
-
{{"car_connector.title" | translate}}
-
{{"car_connector.description" | translate}}
-
+
+
+ +
+
{{"car_connector.title" | translate}}
+
{{"car_connector.description" | translate}}
-
- -
-
{{"asset.title" | translate}}
-
{{"asset.description" | translate}}
-
+
+
+ +
+
{{"asset.title" | translate}}
+
{{"asset.description" | translate}}
-
- -
-
{{"statistics.title" | translate}}
-
{{"statistics.description" | translate}}
-
+
+
+ +
+
{{"statistics.title" | translate}}
+
{{"statistics.description" | translate}}
-
- - -
-
{{"analytics.title" | translate}}
-
-
- - - - {{analyticsType.value | translate}} - - - - {{"general.mandatory_field" | translate}} - - +
+
+ + +
+
{{"analytics.title" | translate}}
+
-
- - -
-
{{"smart_charging.title" | translate}}
-
{{"smart_charging.description" | translate}}
-
- - - - {{smartChargingType.value | translate}} - - - - {{"general.mandatory_field" | translate}} - - + + + + {{analyticsType.value | translate}} + + + + {{"general.mandatory_field" | translate}} + + +
+
+ + +
+
{{"smart_charging.title" | translate}}
+
{{"smart_charging.description" | translate}}
+ + + + {{smartChargingType.value | translate}} + + + + {{"general.mandatory_field" | translate}} + +
- -
+
+ diff --git a/src/app/pages/tenants/tenant/main/tenant-main.component.html b/src/app/pages/tenants/tenant/main/tenant-main.component.html index 79f66e4a93..dbb2410eff 100644 --- a/src/app/pages/tenants/tenant/main/tenant-main.component.html +++ b/src/app/pages/tenants/tenant/main/tenant-main.component.html @@ -1,67 +1,65 @@ -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
-
-
-
- - -
+
+
+
+
+ +
-
-
-
- - - {{"general.mandatory_field" | translate}} - -
-
-
-
-
-
+
+
+
+
- - {{"general.mandatory_field" | translate}} - -
+ + {{"general.mandatory_field" | translate}} + +
- {{"tenants.error_subdomain" | translate}}
- - {{"general.mandatory_field" | translate}} - {{"authentication.invalid_email" | translate}} + + {{"general.mandatory_field" | translate}} + +
+
+ {{"tenants.error_subdomain" | translate}}
-
-
- -
+
+
+ + + {{"general.mandatory_field" | translate}} + {{"authentication.invalid_email" | translate}} + +
+
+
+
- -
+
+ diff --git a/src/app/pages/users/user/main/user-main.component.html b/src/app/pages/users/user/main/user-main.component.html index 8818ea60a2..c00a017695 100644 --- a/src/app/pages/users/user/main/user-main.component.html +++ b/src/app/pages/users/user/main/user-main.component.html @@ -1,153 +1,151 @@ -
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
-
-
-
- - -
+
+
+
+
+ +
-
-
- - - - {{"general.mandatory_field" | translate}} - - -
-
-
-
-
- - - - {{ "general.mandatory_field" | translate }} - - -
-
-
-
+
+
+
+ + + + {{"general.mandatory_field" | translate}} + + +
+
+
-
-
- - - - {{"authentication.invalid_email" | translate}} - - - {{"general.mandatory_field" | translate}} - - -
+
+ + + + {{ "general.mandatory_field" | translate }} + + +
+
+
-
-
- - - - {{userLocale.value | translate}} - - - -
+
+
+
+ + + + {{"authentication.invalid_email" | translate}} + + + {{"general.mandatory_field" | translate}} + +
-
-
- - - - {{userStatus.value | translate}} - - - -
+
+
+
+ + + + {{userLocale.value | translate}} + + +
-
-
- - - - {{userRole.value | translate}} - - - -
+
+
+
+ + + + {{userStatus.value | translate}} + + +
-
-
- - - - {{"users.invalid_phone_number" | translate}} - {{phone.errors?.pattern | json}} - - -
+
+
+
+ + + + {{userRole.value | translate}} + + +
-
-
- - - - {{"users.invalid_phone_number" | translate}} - - -
+
+
+
+ + + + {{"users.invalid_phone_number" | translate}} + {{phone.errors?.pattern | json}} + +
-
-
- - - - {{"users.invalid_plate_id" | translate}} - - -
+
+
+
+ + + + {{"users.invalid_phone_number" | translate}} + +
-
-
- {{"users.allow_free_access" | translate}} -
+
+
+
+ + + + {{"users.invalid_plate_id" | translate}} + +
-
-
- {{"users.technical" | translate}} -
+
+
+
+ {{"users.allow_free_access" | translate}} +
+
+
+
+ {{"users.technical" | translate}}
- -
+
+ diff --git a/src/app/pages/users/user/notifications/user-notifications.component.html b/src/app/pages/users/user/notifications/user-notifications.component.html index 996f107211..d32315b856 100644 --- a/src/app/pages/users/user/notifications/user-notifications.component.html +++ b/src/app/pages/users/user/notifications/user-notifications.component.html @@ -1,142 +1,140 @@ -
-
-
+ +
+
+
+
+ {{"users.notifications_active" | translate}} + +
+
+
+
- {{"users.notifications_active" | translate}} - + {{"notifications.car_catalog_synchronization_failed" | translate}}
-
-
-
-
- {{"notifications.car_catalog_synchronization_failed" | translate}} -
-
+
+
+
+
+
+
+ + {{"users.notifications_active" | translate}} +
-
+
-
- - {{"users.notifications_active" | translate}} - -
+ {{"notifications.session_started" | translate}}
-
-
-
- {{"notifications.session_started" | translate}} -
-
-
-
- {{"notifications.optimal_charge_reached" | translate}} -
+
+
+ {{"notifications.optimal_charge_reached" | translate}}
-
-
- {{"notifications.end_of_charge" | translate}} -
+
+
+
+ {{"notifications.end_of_charge" | translate}}
-
-
- {{"notifications.end_of_session" | translate}} -
+
+
+
+ {{"notifications.end_of_session" | translate}}
-
-
- {{"notifications.user_account_status_changed" | translate}} -
+
+
+
+ {{"notifications.user_account_status_changed" | translate}}
-
-
- {{"notifications.session_not_started" | translate}} -
+
+
+
+ {{"notifications.session_not_started" | translate}}
-
-
- {{"notifications.user_account_inactivity" | translate}} -
+
+
+
+ {{"notifications.user_account_inactivity" | translate}}
-
-
- {{"notifications.preparing_session_not_started" | translate}} -
+
+
+
+ {{"notifications.preparing_session_not_started" | translate}}
-
-
- {{"notifications.billing_new_invoice" | translate}} -
+
+
+
+ {{"notifications.billing_new_invoice" | translate}}
-
-
{{"notifications.admin_only" | translate}}
-
-
-
- {{"notifications.unknown_user_badged" | translate}} -
+
+
+
{{"notifications.admin_only" | translate}}
+
+
+
+ {{"notifications.unknown_user_badged" | translate}}
-
-
- {{"notifications.charging_station_status_error" | translate}} -
+
+
+
+ {{"notifications.charging_station_status_error" | translate}}
-
-
- {{"notifications.charging_station_registered" | translate}} -
+
+
+
+ {{"notifications.charging_station_registered" | translate}}
-
-
- {{"notifications.charging_stations_offline" | translate}} -
+
+
+
+ {{"notifications.charging_stations_offline" | translate}}
-
-
- {{"notifications.ocpi_patch_status_error" | translate}} -
+
+
+
+ {{"notifications.ocpi_patch_status_error" | translate}}
-
-
- {{"notifications.oicp_patch_status_error" | translate}} -
+
+
+
+ {{"notifications.oicp_patch_status_error" | translate}}
-
-
- {{"notifications.billing_synchronization_failed" | translate}} -
+
+
+
+ {{"notifications.billing_synchronization_failed" | translate}}
-
-
- {{"notifications.billing_periodic_operation_failed" | translate}} -
+
+
+
+ {{"notifications.billing_periodic_operation_failed" | translate}}
-
-
- {{"notifications.compute_and_apply_charging_profiles_failed" | translate}} -
+
+
+
+ {{"notifications.compute_and_apply_charging_profiles_failed" | translate}}
-
-
- {{"notifications.end_user_error_notification" | translate}} -
+
+
+
+ {{"notifications.end_user_error_notification" | translate}}
-
-
- {{"notifications.admin_account_verification" | translate}} -
+
+
+
+ {{"notifications.admin_account_verification" | translate}}
+
-
diff --git a/src/app/pages/users/user/security/user-security.component.html b/src/app/pages/users/user/security/user-security.component.html index dec5a932b6..18924b1263 100644 --- a/src/app/pages/users/user/security/user-security.component.html +++ b/src/app/pages/users/user/security/user-security.component.html @@ -1,40 +1,38 @@ -
-
-
-
-
- - - {{hidePassword ? 'visibility' : 'visibility_off'}} - - - {{"authentication.no_space_in_password" | translate}} - - - {{"authentication.password_rule" | translate}} - - -
+ +
+
+
+ + + {{hidePassword ? 'visibility' : 'visibility_off'}} + + + {{"authentication.no_space_in_password" | translate}} + + + {{"authentication.password_rule" | translate}} + +
-
-
- - - - {{hideRepeatPassword ? 'visibility' : 'visibility_off'}} - - - {{"authentication.password_not_equal" | translate}} - - -
+
+
+
+ + + + {{hideRepeatPassword ? 'visibility' : 'visibility_off'}} + + + {{"authentication.password_not_equal" | translate}} + +
- -
+
+