@lenne.tech/ng-base 14.4.0 → 14.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base-components/base-components.module.d.ts +5 -4
- package/base-components/components/delete-account/delete-account.component.d.ts +15 -0
- package/base-components/public-api.d.ts +1 -0
- package/base-prototype/base-prototype.module.d.ts +7 -6
- package/base-prototype/pages/reset-password/reset-password.component.d.ts +29 -0
- package/base-prototype/public-api.d.ts +1 -0
- package/esm2020/base-components/base-components.module.mjs +5 -1
- package/esm2020/base-components/components/change-password/change-password.component.mjs +4 -5
- package/esm2020/base-components/components/delete-account/delete-account.component.mjs +52 -0
- package/esm2020/base-components/components/input/input.component.mjs +3 -3
- package/esm2020/base-components/components/model-form/model-form.component.mjs +3 -3
- package/esm2020/base-components/public-api.mjs +2 -1
- package/esm2020/base-prototype/base-prototype.module.mjs +7 -3
- package/esm2020/base-prototype/pages/forgot-password/forgot-password.component.mjs +3 -2
- package/esm2020/base-prototype/pages/login/login.component.mjs +3 -2
- package/esm2020/base-prototype/pages/register/register.component.mjs +3 -3
- package/esm2020/base-prototype/pages/reset-password/reset-password.component.mjs +82 -0
- package/esm2020/base-prototype/public-api.mjs +2 -1
- package/esm2020/shared/public-api.mjs +2 -1
- package/esm2020/shared/services/user.service.mjs +27 -1
- package/esm2020/shared/validators/email.validator.mjs +7 -0
- package/fesm2015/lenne.tech-ng-base-base-components.mjs +57 -9
- package/fesm2015/lenne.tech-ng-base-base-components.mjs.map +1 -1
- package/fesm2015/lenne.tech-ng-base-base-prototype.mjs +86 -9
- package/fesm2015/lenne.tech-ng-base-base-prototype.mjs.map +1 -1
- package/fesm2015/lenne.tech-ng-base-shared.mjs +34 -1
- package/fesm2015/lenne.tech-ng-base-shared.mjs.map +1 -1
- package/fesm2020/lenne.tech-ng-base-base-components.mjs +57 -9
- package/fesm2020/lenne.tech-ng-base-base-components.mjs.map +1 -1
- package/fesm2020/lenne.tech-ng-base-base-prototype.mjs +85 -9
- package/fesm2020/lenne.tech-ng-base-base-prototype.mjs.map +1 -1
- package/fesm2020/lenne.tech-ng-base-shared.mjs +34 -1
- package/fesm2020/lenne.tech-ng-base-shared.mjs.map +1 -1
- package/package.json +1 -1
- package/shared/public-api.d.ts +1 -0
- package/shared/services/user.service.d.ts +13 -0
- package/shared/validators/email.validator.d.ts +2 -0
|
@@ -7,7 +7,7 @@ import { DOCUMENT, CommonModule } from '@angular/common';
|
|
|
7
7
|
import { trigger, transition, query, style, animate } from '@angular/animations';
|
|
8
8
|
import { Subscription } from 'rxjs';
|
|
9
9
|
import * as i1$1 from '@lenne.tech/ng-base/shared';
|
|
10
|
-
import { ToastType, Sort, GraphQLRequestType, BasicUser, Validation } from '@lenne.tech/ng-base/shared';
|
|
10
|
+
import { ToastType, Sort, GraphQLRequestType, BasicUser, fullEmail, Validation } from '@lenne.tech/ng-base/shared';
|
|
11
11
|
import * as i2$1 from '@angular/router';
|
|
12
12
|
import * as i1$2 from '@angular/common/http';
|
|
13
13
|
import { HttpHeaders } from '@angular/common/http';
|
|
@@ -41,10 +41,10 @@ class InputComponent {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
InputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
44
|
-
InputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: InputComponent, selector: "base-input", inputs: { id: "id", name: "name", label: "label", placeholder: "placeholder", autocomplete: "autocomplete", tabIndex: "tabIndex", control: "control", type: "type", required: "required", eyeButton: "eyeButton" }, outputs: { enter: "enter" }, ngImport: i0, template: "<div class=\"form-group mb-3\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <div class=\"input-group\">\n <input\n [id]=\"id\"\n [name]=\"name\"\n class=\"form-control\"\n [type]=\"type\"\n [formControl]=\"control\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [autocomplete]=\"autocomplete ?? null\"\n [tabIndex]=\"tabIndex ?? null\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n (keyup.enter)=\"enterEvent()\"\n [attr.aria-describedby]=\"id + 'eye-button'\"\n />\n <button\n class=\"btn btn-outline-primary\"\n type=\"button\"\n [id]=\"id + 'eye-button'\"\n (click)=\"togglePasswordType()\"\n *ngIf=\"eyeButton\"\n >\n <i class=\"bi bi-eye\" *ngIf=\"type === 'password'\"></i>\n <i class=\"bi bi-eye-slash\" *ngIf=\"type === 'text'\"></i>\n </button>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['matching']\">Die Passw\u00F6rter m\u00FCssen \u00FCberein stimmen.</div>\n </div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
44
|
+
InputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: InputComponent, selector: "base-input", inputs: { id: "id", name: "name", label: "label", placeholder: "placeholder", autocomplete: "autocomplete", tabIndex: "tabIndex", control: "control", type: "type", required: "required", eyeButton: "eyeButton" }, outputs: { enter: "enter" }, ngImport: i0, template: "<div class=\"form-group mb-3\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <div class=\"input-group\">\n <input\n [id]=\"id\"\n [name]=\"name\"\n class=\"form-control\"\n [type]=\"type\"\n [formControl]=\"control\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [autocomplete]=\"autocomplete ?? null\"\n [tabIndex]=\"tabIndex ?? null\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n (keyup.enter)=\"enterEvent()\"\n [attr.aria-describedby]=\"id + 'eye-button'\"\n />\n <button\n class=\"btn btn-outline-primary\"\n type=\"button\"\n [id]=\"id + 'eye-button'\"\n (click)=\"togglePasswordType()\"\n *ngIf=\"eyeButton\"\n >\n <i class=\"bi bi-eye\" *ngIf=\"type === 'password'\"></i>\n <i class=\"bi bi-eye-slash\" *ngIf=\"type === 'text'\"></i>\n </button>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['invalidEmail']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['matching']\">Die Passw\u00F6rter m\u00FCssen \u00FCberein stimmen.</div>\n </div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}.input-group>.btn{min-width:100px}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
45
45
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: InputComponent, decorators: [{
|
|
46
46
|
type: Component,
|
|
47
|
-
args: [{ selector: 'base-input', template: "<div class=\"form-group mb-3\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <div class=\"input-group\">\n <input\n [id]=\"id\"\n [name]=\"name\"\n class=\"form-control\"\n [type]=\"type\"\n [formControl]=\"control\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [autocomplete]=\"autocomplete ?? null\"\n [tabIndex]=\"tabIndex ?? null\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n (keyup.enter)=\"enterEvent()\"\n [attr.aria-describedby]=\"id + 'eye-button'\"\n />\n <button\n class=\"btn btn-outline-primary\"\n type=\"button\"\n [id]=\"id + 'eye-button'\"\n (click)=\"togglePasswordType()\"\n *ngIf=\"eyeButton\"\n >\n <i class=\"bi bi-eye\" *ngIf=\"type === 'password'\"></i>\n <i class=\"bi bi-eye-slash\" *ngIf=\"type === 'text'\"></i>\n </button>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['matching']\">Die Passw\u00F6rter m\u00FCssen \u00FCberein stimmen.</div>\n </div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}\n"] }]
|
|
47
|
+
args: [{ selector: 'base-input', template: "<div class=\"form-group mb-3\">\n <label [for]=\"id\" class=\"form-label\" [ngClass]=\"{ required: required }\" *ngIf=\"label\">{{ label }}</label>\n <div class=\"input-group\">\n <input\n [id]=\"id\"\n [name]=\"name\"\n class=\"form-control\"\n [type]=\"type\"\n [formControl]=\"control\"\n [required]=\"required\"\n [placeholder]=\"placeholder\"\n [autocomplete]=\"autocomplete ?? null\"\n [tabIndex]=\"tabIndex ?? null\"\n [ngClass]=\"{ 'is-invalid': control?.invalid && control?.touched }\"\n (keyup.enter)=\"enterEvent()\"\n [attr.aria-describedby]=\"id + 'eye-button'\"\n />\n <button\n class=\"btn btn-outline-primary\"\n type=\"button\"\n [id]=\"id + 'eye-button'\"\n (click)=\"togglePasswordType()\"\n *ngIf=\"eyeButton\"\n >\n <i class=\"bi bi-eye\" *ngIf=\"type === 'password'\"></i>\n <i class=\"bi bi-eye-slash\" *ngIf=\"type === 'text'\"></i>\n </button>\n\n <div class=\"invalid-feedback m-2\" *ngIf=\"control?.invalid && (control?.dirty || control?.touched)\">\n <div *ngIf=\"control?.errors?.['required']\">Dieses Feld ist ein Pflichtfeld.</div>\n <div *ngIf=\"control?.errors?.['minlength']\">\n Die Mindestl\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['minlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['maxlength']\">\n Die maximale L\u00E4nge f\u00FCr dieses Feld betr\u00E4gt\n {{control.errors?.['maxlength']?.requiredLength}} Zeichen.\n </div>\n <div *ngIf=\"control?.errors?.['email']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['invalidEmail']\">Bitte eine g\u00FCltige E-Mail Adresse angeben.</div>\n <div *ngIf=\"control?.errors?.['matching']\">Die Passw\u00F6rter m\u00FCssen \u00FCberein stimmen.</div>\n </div>\n </div>\n</div>\n", styles: [".required:after{content:\" *\"}.input-group>.btn{min-width:100px}\n"] }]
|
|
48
48
|
}], propDecorators: { id: [{
|
|
49
49
|
type: Input
|
|
50
50
|
}], name: [{
|
|
@@ -1280,7 +1280,7 @@ class ModelFormComponent {
|
|
|
1280
1280
|
validators.push(Validators.required);
|
|
1281
1281
|
}
|
|
1282
1282
|
if (config?.type === 'Email') {
|
|
1283
|
-
validators.push(
|
|
1283
|
+
validators.push(fullEmail());
|
|
1284
1284
|
}
|
|
1285
1285
|
if (config?.type === 'Password') {
|
|
1286
1286
|
validators.push(Validators.minLength(6));
|
|
@@ -1731,7 +1731,6 @@ class ChangePasswordComponent {
|
|
|
1731
1731
|
* Submit form and change password of user
|
|
1732
1732
|
*/
|
|
1733
1733
|
submit() {
|
|
1734
|
-
console.log(this.form);
|
|
1735
1734
|
this.loading = true;
|
|
1736
1735
|
if (this.form.invalid) {
|
|
1737
1736
|
this.formsService.validateAllFormFields(this.form);
|
|
@@ -1754,7 +1753,7 @@ class ChangePasswordComponent {
|
|
|
1754
1753
|
error: (error) => {
|
|
1755
1754
|
this.loading = false;
|
|
1756
1755
|
this.toastService.show({
|
|
1757
|
-
id: 'password-change-
|
|
1756
|
+
id: 'password-change-error',
|
|
1758
1757
|
title: 'Fehlgeschlagen',
|
|
1759
1758
|
description: 'Passwort ändern ist fehlgeschlagen, bitte versuche es später erneut.',
|
|
1760
1759
|
type: ToastType.ERROR,
|
|
@@ -1764,12 +1763,58 @@ class ChangePasswordComponent {
|
|
|
1764
1763
|
}
|
|
1765
1764
|
}
|
|
1766
1765
|
ChangePasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ChangePasswordComponent, deps: [{ token: i1$1.FormsService }, { token: i1$1.UserService }, { token: i1$1.AuthService }, { token: i1$1.ToastService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1767
|
-
ChangePasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: ChangePasswordComponent, selector: "base-change-password", ngImport: i0, template: "<form [formGroup]=\"form\">\n <base-input\n [id]=\"'password'\"\n [label]=\"'Passwort'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('password')\"\n [tabIndex]=\"1\"\n [eyeButton]=\"true\"\n ></base-input>\n <base-input\n [id]=\"'password-confirm'\"\n [label]=\"'Passwort best\u00E4tigen'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('passwordConfirm')\"\n [tabIndex]=\"2\"\n [eyeButton]=\"true\"\n ></base-input>\n\n <div class=\"d-flex justify-content-end\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"submit()\" *ngIf=\"!loading\">Passwort \u00E4ndern</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InputComponent, selector: "base-input", inputs: ["id", "name", "label", "placeholder", "autocomplete", "tabIndex", "control", "type", "required", "eyeButton"], outputs: ["enter"] }] });
|
|
1766
|
+
ChangePasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: ChangePasswordComponent, selector: "base-change-password", ngImport: i0, template: "<h3>Passwort \u00E4ndern</h3>\n\n<form [formGroup]=\"form\">\n <base-input\n [id]=\"'password'\"\n [label]=\"'Passwort'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('password')\"\n [tabIndex]=\"1\"\n [eyeButton]=\"true\"\n ></base-input>\n <base-input\n [id]=\"'password-confirm'\"\n [label]=\"'Passwort best\u00E4tigen'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('passwordConfirm')\"\n [tabIndex]=\"2\"\n [eyeButton]=\"true\"\n ></base-input>\n\n <div class=\"d-flex justify-content-end\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"submit()\" *ngIf=\"!loading\">Passwort \u00E4ndern</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InputComponent, selector: "base-input", inputs: ["id", "name", "label", "placeholder", "autocomplete", "tabIndex", "control", "type", "required", "eyeButton"], outputs: ["enter"] }] });
|
|
1768
1767
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ChangePasswordComponent, decorators: [{
|
|
1769
1768
|
type: Component,
|
|
1770
|
-
args: [{ selector: 'base-change-password', template: "<form [formGroup]=\"form\">\n <base-input\n [id]=\"'password'\"\n [label]=\"'Passwort'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('password')\"\n [tabIndex]=\"1\"\n [eyeButton]=\"true\"\n ></base-input>\n <base-input\n [id]=\"'password-confirm'\"\n [label]=\"'Passwort best\u00E4tigen'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('passwordConfirm')\"\n [tabIndex]=\"2\"\n [eyeButton]=\"true\"\n ></base-input>\n\n <div class=\"d-flex justify-content-end\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"submit()\" *ngIf=\"!loading\">Passwort \u00E4ndern</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</form>\n" }]
|
|
1769
|
+
args: [{ selector: 'base-change-password', template: "<h3>Passwort \u00E4ndern</h3>\n\n<form [formGroup]=\"form\">\n <base-input\n [id]=\"'password'\"\n [label]=\"'Passwort'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('password')\"\n [tabIndex]=\"1\"\n [eyeButton]=\"true\"\n ></base-input>\n <base-input\n [id]=\"'password-confirm'\"\n [label]=\"'Passwort best\u00E4tigen'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('passwordConfirm')\"\n [tabIndex]=\"2\"\n [eyeButton]=\"true\"\n ></base-input>\n\n <div class=\"d-flex justify-content-end\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"submit()\" *ngIf=\"!loading\">Passwort \u00E4ndern</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</form>\n" }]
|
|
1771
1770
|
}], ctorParameters: function () { return [{ type: i1$1.FormsService }, { type: i1$1.UserService }, { type: i1$1.AuthService }, { type: i1$1.ToastService }]; } });
|
|
1772
1771
|
|
|
1772
|
+
class DeleteAccountComponent {
|
|
1773
|
+
constructor(userService, authService, toastService, router) {
|
|
1774
|
+
this.userService = userService;
|
|
1775
|
+
this.authService = authService;
|
|
1776
|
+
this.toastService = toastService;
|
|
1777
|
+
this.router = router;
|
|
1778
|
+
this.description = 'Mit dem Löschen Deines Kontos werden alle persönlichen Daten sofort gelöscht und sind nicht wiederherstellbar.';
|
|
1779
|
+
this.loading = false;
|
|
1780
|
+
}
|
|
1781
|
+
deleteAccount() {
|
|
1782
|
+
this.loading = true;
|
|
1783
|
+
this.userService.delete(this.authService.currentUser.id).subscribe({
|
|
1784
|
+
next: (response) => {
|
|
1785
|
+
if (response) {
|
|
1786
|
+
this.toastService.show({
|
|
1787
|
+
id: 'delete-user-success',
|
|
1788
|
+
title: 'Erfolgreich',
|
|
1789
|
+
description: 'Dein Konto wurde erfolgreich gelöscht.',
|
|
1790
|
+
type: ToastType.SUCCESS,
|
|
1791
|
+
});
|
|
1792
|
+
}
|
|
1793
|
+
this.authService.logout();
|
|
1794
|
+
this.router.navigate(['/']);
|
|
1795
|
+
this.loading = false;
|
|
1796
|
+
},
|
|
1797
|
+
error: (error) => {
|
|
1798
|
+
this.loading = false;
|
|
1799
|
+
this.toastService.show({
|
|
1800
|
+
id: 'delete-user-error',
|
|
1801
|
+
title: 'Fehlgeschlagen',
|
|
1802
|
+
description: 'Konto löschen ist fehlgeschlagen, bitte versuche es später erneut.',
|
|
1803
|
+
type: ToastType.ERROR,
|
|
1804
|
+
});
|
|
1805
|
+
},
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
DeleteAccountComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: DeleteAccountComponent, deps: [{ token: i1$1.UserService }, { token: i1$1.AuthService }, { token: i1$1.ToastService }, { token: i2$1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
1810
|
+
DeleteAccountComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: DeleteAccountComponent, selector: "base-delete-account", inputs: { description: "description" }, ngImport: i0, template: "<div>\n <h3>Konto l\u00F6schen</h3>\n\n <p>{{ description }}</p>\n\n <div class=\"d-flex justify-content-end mt-3\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"deleteAccount()\" *ngIf=\"!loading\">Konto l\u00F6schen</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1811
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: DeleteAccountComponent, decorators: [{
|
|
1812
|
+
type: Component,
|
|
1813
|
+
args: [{ selector: 'base-delete-account', template: "<div>\n <h3>Konto l\u00F6schen</h3>\n\n <p>{{ description }}</p>\n\n <div class=\"d-flex justify-content-end mt-3\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"deleteAccount()\" *ngIf=\"!loading\">Konto l\u00F6schen</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</div>\n" }]
|
|
1814
|
+
}], ctorParameters: function () { return [{ type: i1$1.UserService }, { type: i1$1.AuthService }, { type: i1$1.ToastService }, { type: i2$1.Router }]; }, propDecorators: { description: [{
|
|
1815
|
+
type: Input
|
|
1816
|
+
}] } });
|
|
1817
|
+
|
|
1773
1818
|
class BackButtonDirective {
|
|
1774
1819
|
constructor(navigation) {
|
|
1775
1820
|
this.navigation = navigation;
|
|
@@ -1814,6 +1859,7 @@ const elements = [
|
|
|
1814
1859
|
UploadImageComponent,
|
|
1815
1860
|
RefenceInputComponent,
|
|
1816
1861
|
ChangePasswordComponent,
|
|
1862
|
+
DeleteAccountComponent,
|
|
1817
1863
|
// Pipes
|
|
1818
1864
|
EllipsesPipe,
|
|
1819
1865
|
];
|
|
@@ -1841,6 +1887,7 @@ BaseComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
|
|
|
1841
1887
|
UploadImageComponent,
|
|
1842
1888
|
RefenceInputComponent,
|
|
1843
1889
|
ChangePasswordComponent,
|
|
1890
|
+
DeleteAccountComponent,
|
|
1844
1891
|
// Pipes
|
|
1845
1892
|
EllipsesPipe], imports: [FormsModule, ReactiveFormsModule, CommonModule], exports: [
|
|
1846
1893
|
// Directives
|
|
@@ -1863,6 +1910,7 @@ BaseComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
|
|
|
1863
1910
|
UploadImageComponent,
|
|
1864
1911
|
RefenceInputComponent,
|
|
1865
1912
|
ChangePasswordComponent,
|
|
1913
|
+
DeleteAccountComponent,
|
|
1866
1914
|
// Pipes
|
|
1867
1915
|
EllipsesPipe] });
|
|
1868
1916
|
BaseComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: BaseComponentsModule, imports: [imports] });
|
|
@@ -1883,5 +1931,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
1883
1931
|
* Generated bundle index. Do not edit.
|
|
1884
1932
|
*/
|
|
1885
1933
|
|
|
1886
|
-
export { BackButtonDirective, BaseComponentsModule, BreadcrumbComponent, ChangePasswordComponent, CheckboxComponent, ContextMenuDirective, EllipsesPipe, InputComponent, LoadingBarComponent, ModelFormComponent, ModelFormSubComponent, ModelTableComponent, RefenceInputComponent, SelectComponent, SkeletonLoaderComponent, SortDirective, TagsComponent, TextareaComponent, ToastComponent, UploadImageComponent };
|
|
1934
|
+
export { BackButtonDirective, BaseComponentsModule, BreadcrumbComponent, ChangePasswordComponent, CheckboxComponent, ContextMenuDirective, DeleteAccountComponent, EllipsesPipe, InputComponent, LoadingBarComponent, ModelFormComponent, ModelFormSubComponent, ModelTableComponent, RefenceInputComponent, SelectComponent, SkeletonLoaderComponent, SortDirective, TagsComponent, TextareaComponent, ToastComponent, UploadImageComponent };
|
|
1887
1935
|
//# sourceMappingURL=lenne.tech-ng-base-base-components.mjs.map
|