|
|
@ -1,4 +1,7 @@
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
|
|
|
|
import { FormControl, Validators } from '@angular/forms';
|
|
|
|
|
|
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
|
|
|
|
|
|
import { AuthService } from 'src/app/services/auth.service';
|
|
|
|
import { BikesService } from '../../services/bikes.service';
|
|
|
|
import { BikesService } from '../../services/bikes.service';
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
@ -7,149 +10,41 @@ import { BikesService } from '../../services/bikes.service';
|
|
|
|
styleUrls: ['./profile.component.scss'],
|
|
|
|
styleUrls: ['./profile.component.scss'],
|
|
|
|
})
|
|
|
|
})
|
|
|
|
export class ProfileComponent implements OnInit {
|
|
|
|
export class ProfileComponent implements OnInit {
|
|
|
|
columnInfo = [
|
|
|
|
email = new FormControl('', [Validators.required, Validators.email]);
|
|
|
|
{
|
|
|
|
password = new FormControl('', [Validators.required]);
|
|
|
|
dataPath: 'name',
|
|
|
|
hide = true;
|
|
|
|
translation: 'Name',
|
|
|
|
loading = false;
|
|
|
|
sticky: true,
|
|
|
|
errorOccurred = false;
|
|
|
|
link: (row: any) => {
|
|
|
|
errorMessage = '';
|
|
|
|
return '/bike/' + row.id;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ dataPath: 'id', translation: 'ID', readonly: true },
|
|
|
|
|
|
|
|
{ dataPath: 'group', translation: 'Gruppe' },
|
|
|
|
|
|
|
|
{ dataPath: 'modelName', translation: 'Modell' },
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'insuranceData.billing',
|
|
|
|
|
|
|
|
translation: 'Versicherung Abrechnung',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ dataPath: 'insuranceData.hasFixedRate', translation: 'Pauschale j/n' },
|
|
|
|
|
|
|
|
{ dataPath: 'insuranceData.fixedRate', translation: 'Pauschale Betrag' },
|
|
|
|
|
|
|
|
{ dataPath: 'insuranceData.name', translation: 'Versicherer' },
|
|
|
|
|
|
|
|
{ dataPath: 'insuranceData.benefactor', translation: 'Kostenträger' },
|
|
|
|
|
|
|
|
{ dataPath: 'insuranceData.noPnP', translation: 'Nr. P&P' },
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'insuranceData.maintenanceResponsible',
|
|
|
|
|
|
|
|
translation: 'Wartung zuständig',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'insuranceData.maintenanceBenefactor',
|
|
|
|
|
|
|
|
translation: 'Wartung Kostenträger',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'insuranceData.maintenanceAgreement',
|
|
|
|
|
|
|
|
translation: 'Wartungsvereinbarung',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'insuranceData.projectAllowance',
|
|
|
|
|
|
|
|
translation: 'Projektzuschuss',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ dataPath: 'insuranceData.notes', translation: 'Sonstiges' },
|
|
|
|
|
|
|
|
{ dataPath: 'dimensionsAndLoad.bikeLength', translation: 'Länge' },
|
|
|
|
|
|
|
|
{ dataPath: 'dimensionsAndLoad.bikeWeight', translation: 'Gewicht' },
|
|
|
|
|
|
|
|
{ dataPath: 'dimensionsAndLoad.bikeHeight', translation: 'Höhe' },
|
|
|
|
|
|
|
|
{ dataPath: 'dimensionsAndLoad.bikeWidth', translation: 'Breite' },
|
|
|
|
|
|
|
|
{ dataPath: 'dimensionsAndLoad.boxHeightRange', translation: 'Boxhöhe' },
|
|
|
|
|
|
|
|
{ dataPath: 'dimensionsAndLoad.boxLengthRange', translation: 'Boxlänge' },
|
|
|
|
|
|
|
|
{ dataPath: 'dimensionsAndLoad.boxWidthRange', translation: 'Boxbreite' },
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'dimensionsAndLoad.hasCoverBox',
|
|
|
|
|
|
|
|
translation: 'Boxabdeckung j/n',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ dataPath: 'dimensionsAndLoad.lockable', translation: 'Box abschließbar' },
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'dimensionsAndLoad.maxWeightBox',
|
|
|
|
|
|
|
|
translation: 'max Zuladung Box',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'dimensionsAndLoad.maxWeightLuggageRack',
|
|
|
|
|
|
|
|
translation: 'max Zuladung Gepäckträger',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'dimensionsAndLoad.maxWeightTotal',
|
|
|
|
|
|
|
|
translation: 'max Gesamtgewicht',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ dataPath: 'numberOfChildren', translation: 'Anzahl Kinder' },
|
|
|
|
|
|
|
|
{ dataPath: 'numberOfWheels', translation: 'Anzahl Räder' },
|
|
|
|
|
|
|
|
{ dataPath: 'forCargo', translation: 'für Lasten j/n' },
|
|
|
|
|
|
|
|
{ dataPath: 'forChildren', translation: 'für Kinder j/n' },
|
|
|
|
|
|
|
|
{ dataPath: 'security.frameNumber', translation: 'Rahmennummer' },
|
|
|
|
|
|
|
|
{ dataPath: 'security.adfcCoding', translation: 'ADFC Codierung' },
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'security.keyNumberAXAChain',
|
|
|
|
|
|
|
|
translation: 'Schlüsselnrummer Rahmenschloss',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'security.keyNumberFrameLock',
|
|
|
|
|
|
|
|
translation: 'Schlüsselnrummer AXA-Kette',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ dataPath: 'security.policeCoding', translation: 'Polizei Codierung' },
|
|
|
|
|
|
|
|
{ dataPath: 'technicalEquipment.bicycleShift', translation: 'Schaltung' },
|
|
|
|
|
|
|
|
{ dataPath: 'technicalEquipment.isEBike', translation: 'E-Bike j/n' },
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'technicalEquipment.hasLightSystem',
|
|
|
|
|
|
|
|
translation: 'Lichtanlage j/n',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'technicalEquipment.specialFeatures',
|
|
|
|
|
|
|
|
translation: 'Besonderheiten',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ dataPath: 'stickerBikeNameState', translation: 'Aufkleber Status' },
|
|
|
|
|
|
|
|
{ dataPath: 'note', translation: 'Aufkleber Kommentar' },
|
|
|
|
|
|
|
|
{ dataPath: 'taxes.costCenter', translation: 'Steuern Kostenstelle' },
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'taxes.organisationArea',
|
|
|
|
|
|
|
|
translation: 'Steuern Vereinsbereich',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ dataPath: 'provider.id', translation: '' },
|
|
|
|
|
|
|
|
{ dataPath: 'provider.formName', translation: '' },
|
|
|
|
|
|
|
|
{ dataPath: 'provider.privatePerson.id', translation: '' },
|
|
|
|
|
|
|
|
{ dataPath: 'provider.privatePerson.person.id', translation: '' },
|
|
|
|
|
|
|
|
{ dataPath: 'provider.privatePerson.person.name', translation: '' },
|
|
|
|
|
|
|
|
{ dataPath: 'provider.privatePerson.person.firstName', translation: '' },
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
dataPath: 'provider.privatePerson.person.contactInformation.email',
|
|
|
|
|
|
|
|
translation: '',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{ dataPath: 'lendingStation.id', translation: '' },
|
|
|
|
|
|
|
|
{ dataPath: 'lendingStation.name', translation: '' },
|
|
|
|
|
|
|
|
{ dataPath: 'lendingStation.address.number', translation: '' },
|
|
|
|
|
|
|
|
{ dataPath: 'lendingStation.address.street', translation: '' },
|
|
|
|
|
|
|
|
{ dataPath: 'lendingStation.address.zip', translation: '' },
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataService: any;
|
|
|
|
returnUrl : string;
|
|
|
|
|
|
|
|
|
|
|
|
tableDataGQLType: string = 'CargoBike';
|
|
|
|
constructor(private authService: AuthService, private router: Router, private route: ActivatedRoute) {}
|
|
|
|
tableDataGQLCreateInputType: string = 'CargoBikeCreateInput';
|
|
|
|
|
|
|
|
tableDataGQLUpdateInputType: string = 'CargoBikeUpdateInput';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
headline = 'Lastenräder';
|
|
|
|
ngOnInit(): void {
|
|
|
|
|
|
|
|
this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/tableOverview';
|
|
|
|
loadingRowIds: string[] = [];
|
|
|
|
|
|
|
|
constructor(private bikesService: BikesService) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
|
|
|
this.dataService = this.bikesService;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
create(object: { currentId: string; row: any }) {
|
|
|
|
|
|
|
|
this.bikesService.createBike(object.currentId, { bike: object.row });
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lock(row: any) {
|
|
|
|
login() {
|
|
|
|
this.bikesService.lockBike({ id: row.id });
|
|
|
|
this.errorMessage = '';
|
|
|
|
|
|
|
|
this.errorOccurred = false;
|
|
|
|
|
|
|
|
if (this.email.invalid || this.password.invalid) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.loading = true;
|
|
|
|
save(row: any) {
|
|
|
|
this.authService
|
|
|
|
this.bikesService.updateBike({ bike: row });
|
|
|
|
.login(this.email.value, this.password.value)
|
|
|
|
}
|
|
|
|
.subscribe(
|
|
|
|
|
|
|
|
() => this.router.navigateByUrl(this.returnUrl),
|
|
|
|
cancel(row: any) {
|
|
|
|
(error) => {
|
|
|
|
this.bikesService.unlockBike({ id: row.id });
|
|
|
|
this.errorOccurred = true;
|
|
|
|
|
|
|
|
this.errorMessage =
|
|
|
|
|
|
|
|
error.error.message ||
|
|
|
|
|
|
|
|
'Ein Fehler bei Einloggen ist aufgetreten. Überprüfen Sie Ihre Internetverbindung oder versuchen Sie es später erneut.';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
delete(row: any) {
|
|
|
|
.add(() => {
|
|
|
|
this.bikesService.deleteBike({ id: row.id });
|
|
|
|
this.loading = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|