@abp/ng.account 6.0.0 → 6.0.1
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/esm2020/lib/account.module.mjs +6 -1
- package/esm2020/lib/components/personal-settings/personal-settings.component.mjs +45 -10
- package/esm2020/lib/models/config-options.mjs +1 -1
- package/esm2020/lib/tokens/index.mjs +2 -1
- package/esm2020/lib/tokens/re-login-confirmation.token.mjs +3 -0
- package/fesm2015/abp-ng.account.mjs +145 -103
- package/fesm2015/abp-ng.account.mjs.map +1 -1
- package/fesm2020/abp-ng.account.mjs +140 -101
- package/fesm2020/abp-ng.account.mjs.map +1 -1
- package/lib/components/personal-settings/personal-settings.component.d.ts +11 -2
- package/lib/models/config-options.d.ts +1 -0
- package/lib/tokens/index.d.ts +1 -0
- package/lib/tokens/re-login-confirmation.token.d.ts +2 -0
- package/lib/utils/factory-utils.d.ts +1 -0
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i3$2 from '@abp/ng.core';
|
|
2
2
|
import { InternalStore, ConfigStateService, RouterOutletComponent, ReplaceableRouteContainerComponent, AuthGuard, LazyModuleFactory, CoreModule } from '@abp/ng.core';
|
|
3
3
|
import * as i2$1 from '@abp/ng.theme.shared';
|
|
4
|
-
import { getPasswordValidators, fadeIn, ThemeSharedModule } from '@abp/ng.theme.shared';
|
|
4
|
+
import { getPasswordValidators, Confirmation, fadeIn, ThemeSharedModule } from '@abp/ng.theme.shared';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
6
|
import { Component, InjectionToken, Injectable, Inject, NgModule } from '@angular/core';
|
|
7
7
|
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
@@ -12,12 +12,12 @@ import { ActivatedRoute, RouterModule } from '@angular/router';
|
|
|
12
12
|
import * as i2 from '@abp/ng.account.core/proxy';
|
|
13
13
|
import * as i1 from '@angular/forms';
|
|
14
14
|
import { Validators, UntypedFormControl } from '@angular/forms';
|
|
15
|
-
import { finalize, catchError, switchMap, map, tap, mapTo } from 'rxjs/operators';
|
|
15
|
+
import { finalize, catchError, filter, switchMap, map, tap, mapTo } from 'rxjs/operators';
|
|
16
16
|
import * as i3 from '@angular/common';
|
|
17
17
|
import { throwError } from 'rxjs';
|
|
18
18
|
import { trigger, transition, useAnimation } from '@angular/animations';
|
|
19
|
-
import * as
|
|
20
|
-
import {
|
|
19
|
+
import * as i4 from '@abp/ng.theme.shared/extensions';
|
|
20
|
+
import { EXTENSIONS_FORM_PROP, EXTENSIBLE_FORM_VIEW_PROVIDER, FormProp, FormPropData, generateFormFromProps, EXTENSIONS_IDENTIFIER, ExtensionsService, getObjectExtensionEntitiesFromStore, mapEntitiesToContributors, mergeWithDefaultProps, UiExtensionsModule } from '@abp/ng.theme.shared/extensions';
|
|
21
21
|
|
|
22
22
|
class ForgotPasswordComponent {
|
|
23
23
|
constructor(fb, accountService) {
|
|
@@ -204,13 +204,109 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
204
204
|
args: [{ selector: 'abp-change-password-form', exportAs: 'abpChangePasswordForm', template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" [mapErrorsFn]=\"mapErrorsFn\" validateOnSubmit>\r\n <div *ngIf=\"!hideCurrentPassword\" class=\"mb-3 form-group\">\r\n <label for=\"current-password\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:CurrentPassword' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"current-password\"\r\n class=\"form-control\"\r\n formControlName=\"password\"\r\n autofocus\r\n autocomplete=\"current-password\"\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"new-password\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:NewPassword' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"new-password\"\r\n class=\"form-control\"\r\n formControlName=\"newPassword\"\r\n autocomplete=\"new-password\"\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"confirm-new-password\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:NewPasswordConfirm' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"confirm-new-password\"\r\n class=\"form-control\"\r\n formControlName=\"repeatNewPassword\"\r\n autocomplete=\"new-password\"\r\n />\r\n </div>\r\n <abp-button\r\n iconClass=\"fa fa-check\"\r\n buttonClass=\"btn btn-primary color-white\"\r\n buttonType=\"submit\"\r\n [loading]=\"inProgress\"\r\n [disabled]=\"form?.invalid\"\r\n >{{ 'AbpIdentity::Save' | abpLocalization }}</abp-button\r\n >\r\n</form>\r\n" }]
|
|
205
205
|
}], ctorParameters: function () { return [{ type: i1.UntypedFormBuilder }, { type: i0.Injector }, { type: i2$1.ToasterService }, { type: i2.ProfileService }, { type: ManageProfileStateService }]; } });
|
|
206
206
|
|
|
207
|
+
const RE_LOGIN_CONFIRMATION_TOKEN = new InjectionToken('RE_LOGIN_CONFIRMATION_TOKEN');
|
|
208
|
+
|
|
209
|
+
class PersonalSettingsHalfRowComponent {
|
|
210
|
+
constructor(propData) {
|
|
211
|
+
this.propData = propData;
|
|
212
|
+
this.displayName = propData.displayName;
|
|
213
|
+
this.name = propData.name;
|
|
214
|
+
this.id = propData.id;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
PersonalSettingsHalfRowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: PersonalSettingsHalfRowComponent, deps: [{ token: EXTENSIONS_FORM_PROP }], target: i0.ɵɵFactoryTarget.Component });
|
|
218
|
+
PersonalSettingsHalfRowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: PersonalSettingsHalfRowComponent, selector: "abp-personal-settings-half-row", ngImport: i0, template: ` <div class="w-50 d-inline">
|
|
219
|
+
<div class="mb-3 form-group">
|
|
220
|
+
<label [attr.for]="name" class="form-label">{{ displayName | abpLocalization }} </label>
|
|
221
|
+
<input
|
|
222
|
+
type="text"
|
|
223
|
+
[attr.id]="id"
|
|
224
|
+
class="form-control"
|
|
225
|
+
[attr.name]="name"
|
|
226
|
+
[formControlName]="name"
|
|
227
|
+
/>
|
|
228
|
+
</div>
|
|
229
|
+
</div>`, isInline: true, 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.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i7.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i3$2.LocalizationPipe, name: "abpLocalization" }], viewProviders: [EXTENSIBLE_FORM_VIEW_PROVIDER] });
|
|
230
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: PersonalSettingsHalfRowComponent, decorators: [{
|
|
231
|
+
type: Component,
|
|
232
|
+
args: [{ selector: 'abp-personal-settings-half-row', template: ` <div class="w-50 d-inline">
|
|
233
|
+
<div class="mb-3 form-group">
|
|
234
|
+
<label [attr.for]="name" class="form-label">{{ displayName | abpLocalization }} </label>
|
|
235
|
+
<input
|
|
236
|
+
type="text"
|
|
237
|
+
[attr.id]="id"
|
|
238
|
+
class="form-control"
|
|
239
|
+
[attr.name]="name"
|
|
240
|
+
[formControlName]="name"
|
|
241
|
+
/>
|
|
242
|
+
</div>
|
|
243
|
+
</div>`, viewProviders: [EXTENSIBLE_FORM_VIEW_PROVIDER] }]
|
|
244
|
+
}], ctorParameters: function () { return [{ type: i4.FormProp, decorators: [{
|
|
245
|
+
type: Inject,
|
|
246
|
+
args: [EXTENSIONS_FORM_PROP]
|
|
247
|
+
}] }]; } });
|
|
248
|
+
|
|
249
|
+
const { maxLength: maxLength$1, required: required$1, email: email$1 } = Validators;
|
|
250
|
+
const DEFAULT_PERSONAL_SETTINGS_UPDATE_FORM_PROPS = FormProp.createMany([
|
|
251
|
+
{
|
|
252
|
+
type: "string" /* ePropType.String */,
|
|
253
|
+
name: 'userName',
|
|
254
|
+
displayName: 'AbpIdentity::DisplayName:UserName',
|
|
255
|
+
id: 'username',
|
|
256
|
+
validators: () => [required$1, maxLength$1(256)],
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
type: "string" /* ePropType.String */,
|
|
260
|
+
name: 'name',
|
|
261
|
+
displayName: 'AbpIdentity::DisplayName:Name',
|
|
262
|
+
id: 'name',
|
|
263
|
+
validators: () => [maxLength$1(64)],
|
|
264
|
+
template: PersonalSettingsHalfRowComponent,
|
|
265
|
+
className: 'd-inline-block w-50',
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
type: "string" /* ePropType.String */,
|
|
269
|
+
name: 'surname',
|
|
270
|
+
displayName: 'AbpIdentity::DisplayName:Surname',
|
|
271
|
+
id: 'surname',
|
|
272
|
+
validators: () => [maxLength$1(64)],
|
|
273
|
+
className: 'd-inline-block w-50 ps-4',
|
|
274
|
+
template: PersonalSettingsHalfRowComponent,
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
type: "string" /* ePropType.String */,
|
|
278
|
+
name: 'email',
|
|
279
|
+
displayName: 'AbpIdentity::DisplayName:Email',
|
|
280
|
+
id: 'email-address',
|
|
281
|
+
validators: () => [required$1, email$1, maxLength$1(256)],
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
type: "string" /* ePropType.String */,
|
|
285
|
+
name: 'phoneNumber',
|
|
286
|
+
displayName: 'AbpIdentity::DisplayName:PhoneNumber',
|
|
287
|
+
id: 'phone-number',
|
|
288
|
+
validators: () => [maxLength$1(16)],
|
|
289
|
+
},
|
|
290
|
+
]);
|
|
291
|
+
|
|
292
|
+
const DEFAULT_ACCOUNT_FORM_PROPS = {
|
|
293
|
+
["Account.PersonalSettingsComponent" /* eAccountComponents.PersonalSettings */]: DEFAULT_PERSONAL_SETTINGS_UPDATE_FORM_PROPS,
|
|
294
|
+
};
|
|
295
|
+
const ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS = new InjectionToken('ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS');
|
|
296
|
+
|
|
207
297
|
class PersonalSettingsComponent {
|
|
208
|
-
constructor(fb, toasterService, profileService, manageProfileState, injector) {
|
|
298
|
+
constructor(fb, toasterService, profileService, manageProfileState, authService, confirmationService, isPersonalSettingsChangedConfirmationActive, injector) {
|
|
209
299
|
this.fb = fb;
|
|
210
300
|
this.toasterService = toasterService;
|
|
211
301
|
this.profileService = profileService;
|
|
212
302
|
this.manageProfileState = manageProfileState;
|
|
303
|
+
this.authService = authService;
|
|
304
|
+
this.confirmationService = confirmationService;
|
|
305
|
+
this.isPersonalSettingsChangedConfirmationActive = isPersonalSettingsChangedConfirmationActive;
|
|
213
306
|
this.injector = injector;
|
|
307
|
+
this.logoutConfirmation = () => {
|
|
308
|
+
this.authService.logout().subscribe();
|
|
309
|
+
};
|
|
214
310
|
}
|
|
215
311
|
buildForm() {
|
|
216
312
|
this.selected = this.manageProfileState.getProfile();
|
|
@@ -226,6 +322,7 @@ class PersonalSettingsComponent {
|
|
|
226
322
|
submit() {
|
|
227
323
|
if (this.form.invalid)
|
|
228
324
|
return;
|
|
325
|
+
const isLogOutConfirmMessageVisible = this.isLogoutConfirmMessageActive();
|
|
229
326
|
this.inProgress = true;
|
|
230
327
|
this.profileService
|
|
231
328
|
.update(this.form.value)
|
|
@@ -233,16 +330,39 @@ class PersonalSettingsComponent {
|
|
|
233
330
|
.subscribe(profile => {
|
|
234
331
|
this.manageProfileState.setProfile(profile);
|
|
235
332
|
this.toasterService.success('AbpAccount::PersonalSettingsSaved', 'Success', { life: 5000 });
|
|
333
|
+
if (isLogOutConfirmMessageVisible) {
|
|
334
|
+
this.showLogoutConfirmMessage();
|
|
335
|
+
}
|
|
236
336
|
});
|
|
237
337
|
}
|
|
338
|
+
isDataSame(oldValue, newValue) {
|
|
339
|
+
return Object.entries(oldValue).some(([key, value]) => {
|
|
340
|
+
if (key in newValue) {
|
|
341
|
+
return value !== newValue[key];
|
|
342
|
+
}
|
|
343
|
+
return false;
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
isLogoutConfirmMessageActive() {
|
|
347
|
+
if (!this.isPersonalSettingsChangedConfirmationActive) {
|
|
348
|
+
return false;
|
|
349
|
+
}
|
|
350
|
+
return this.isDataSame(this.profile, this.form.value);
|
|
351
|
+
}
|
|
352
|
+
showLogoutConfirmMessage() {
|
|
353
|
+
this.confirmationService
|
|
354
|
+
.info('AbpAccount::PersonalSettingsChangedConfirmationModalDescription', 'AbpAccount::PersonalSettingsChangedConfirmationModalTitle')
|
|
355
|
+
.pipe(filter(status => status === Confirmation.Status.confirm))
|
|
356
|
+
.subscribe(this.logoutConfirmation);
|
|
357
|
+
}
|
|
238
358
|
}
|
|
239
|
-
PersonalSettingsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: PersonalSettingsComponent, deps: [{ token: i1.UntypedFormBuilder }, { token: i2$1.ToasterService }, { token: i2.ProfileService }, { token: ManageProfileStateService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
359
|
+
PersonalSettingsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: PersonalSettingsComponent, deps: [{ token: i1.UntypedFormBuilder }, { token: i2$1.ToasterService }, { token: i2.ProfileService }, { token: ManageProfileStateService }, { token: i3$2.AuthService }, { token: i2$1.ConfirmationService }, { token: RE_LOGIN_CONFIRMATION_TOKEN }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
240
360
|
PersonalSettingsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: PersonalSettingsComponent, selector: "abp-personal-settings-form", providers: [
|
|
241
361
|
{
|
|
242
362
|
provide: EXTENSIONS_IDENTIFIER,
|
|
243
363
|
useValue: "Account.PersonalSettingsComponent" /* eAccountComponents.PersonalSettings */,
|
|
244
364
|
},
|
|
245
|
-
], exportAs: ["abpPersonalSettingsForm"], ngImport: i0, template: "<form [formGroup]=\"form\" *ngIf=\"form\" (ngSubmit)=\"submit()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n\r\n <abp-button\r\n buttonType=\"submit\"\r\n iconClass=\"fa fa-check\"\r\n buttonClass=\"btn btn-primary color-white\"\r\n [loading]=\"inProgress\"\r\n >\r\n {{ 'AbpIdentity::Save' | abpLocalization }}</abp-button\r\n >\r\n</form>\r\n", dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: i3$2.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "component", type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "directive", type: i7.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type:
|
|
365
|
+
], exportAs: ["abpPersonalSettingsForm"], ngImport: i0, template: "<form [formGroup]=\"form\" *ngIf=\"form\" (ngSubmit)=\"submit()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n\r\n <abp-button\r\n buttonType=\"submit\"\r\n iconClass=\"fa fa-check\"\r\n buttonClass=\"btn btn-primary color-white\"\r\n [loading]=\"inProgress\"\r\n >\r\n {{ 'AbpIdentity::Save' | abpLocalization }}</abp-button\r\n >\r\n</form>\r\n", dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: i3$2.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "component", type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "directive", type: i7.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i4.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { kind: "pipe", type: i3$2.LocalizationPipe, name: "abpLocalization" }] });
|
|
246
366
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: PersonalSettingsComponent, decorators: [{
|
|
247
367
|
type: Component,
|
|
248
368
|
args: [{ selector: 'abp-personal-settings-form', exportAs: 'abpPersonalSettingsForm', providers: [
|
|
@@ -251,7 +371,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
251
371
|
useValue: "Account.PersonalSettingsComponent" /* eAccountComponents.PersonalSettings */,
|
|
252
372
|
},
|
|
253
373
|
], template: "<form [formGroup]=\"form\" *ngIf=\"form\" (ngSubmit)=\"submit()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n\r\n <abp-button\r\n buttonType=\"submit\"\r\n iconClass=\"fa fa-check\"\r\n buttonClass=\"btn btn-primary color-white\"\r\n [loading]=\"inProgress\"\r\n >\r\n {{ 'AbpIdentity::Save' | abpLocalization }}</abp-button\r\n >\r\n</form>\r\n" }]
|
|
254
|
-
}], ctorParameters: function () { return [{ type: i1.UntypedFormBuilder }, { type: i2$1.ToasterService }, { type: i2.ProfileService }, { type: ManageProfileStateService }, { type:
|
|
374
|
+
}], ctorParameters: function () { return [{ type: i1.UntypedFormBuilder }, { type: i2$1.ToasterService }, { type: i2.ProfileService }, { type: ManageProfileStateService }, { type: i3$2.AuthService }, { type: i2$1.ConfirmationService }, { type: undefined, decorators: [{
|
|
375
|
+
type: Inject,
|
|
376
|
+
args: [RE_LOGIN_CONFIRMATION_TOKEN]
|
|
377
|
+
}] }, { type: i0.Injector }]; } });
|
|
255
378
|
|
|
256
379
|
class ManageProfileComponent {
|
|
257
380
|
constructor(profileService, manageProfileState) {
|
|
@@ -279,7 +402,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
279
402
|
args: [{ selector: 'abp-manage-profile', animations: [trigger('fadeIn', [transition(':enter', useAnimation(fadeIn))])], template: "<div id=\"AbpContentToolbar\"></div>\r\n\r\n<div class=\"card border-0 shadow-sm min-h-400\" [abpLoading]=\"!(profile$ | async)?.userName\">\r\n <div class=\"card-body\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-md-3\">\r\n <ul class=\"nav flex-column nav-pills\" id=\"nav-tab\" role=\"tablist\">\r\n <li\r\n *ngIf=\"!hideChangePasswordTab && (profile$ | async)\"\r\n class=\"nav-item\"\r\n (click)=\"selectedTab = 0\"\r\n >\r\n <a\r\n class=\"nav-link\"\r\n [ngClass]=\"{ active: selectedTab === 0 }\"\r\n role=\"tab\"\r\n href=\"javascript:void(0)\"\r\n >{{ 'AbpUi::ChangePassword' | abpLocalization }}</a\r\n >\r\n </li>\r\n <li class=\"nav-item mb-2\" (click)=\"selectedTab = 1\">\r\n <a\r\n class=\"nav-link\"\r\n [ngClass]=\"{ active: selectedTab === 1 }\"\r\n role=\"tab\"\r\n href=\"javascript:void(0)\"\r\n >{{ 'AbpAccount::PersonalSettings' | abpLocalization }}</a\r\n >\r\n </li>\r\n </ul>\r\n </div>\r\n <div *ngIf=\"profile$ | async\" class=\"col-12 col-md-9\">\r\n <div class=\"tab-content\" *ngIf=\"selectedTab === 0\" [@fadeIn]>\r\n <div class=\"tab-pane active\" role=\"tabpanel\">\r\n <h4>\r\n {{ 'AbpIdentity::ChangePassword' | abpLocalization }}\r\n <hr />\r\n </h4>\r\n <abp-change-password-form\r\n *abpReplaceableTemplate=\"{\r\n componentKey: changePasswordKey\r\n }\"\r\n ></abp-change-password-form>\r\n </div>\r\n </div>\r\n <div class=\"tab-content\" *ngIf=\"selectedTab === 1\" [@fadeIn]>\r\n <div class=\"tab-pane active\" role=\"tabpanel\">\r\n <h4>\r\n {{ 'AbpIdentity::PersonalSettings' | abpLocalization }}\r\n <hr />\r\n </h4>\r\n <abp-personal-settings-form\r\n *abpReplaceableTemplate=\"{\r\n componentKey: personalSettingsKey\r\n }\"\r\n ></abp-personal-settings-form>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".min-h-400{min-height:400px}\n"] }]
|
|
280
403
|
}], ctorParameters: function () { return [{ type: i2.ProfileService }, { type: ManageProfileStateService }]; } });
|
|
281
404
|
|
|
282
|
-
const { maxLength
|
|
405
|
+
const { maxLength, required, email } = Validators;
|
|
283
406
|
class RegisterComponent {
|
|
284
407
|
constructor(fb, accountService, configState, toasterService, authService, injector) {
|
|
285
408
|
this.fb = fb;
|
|
@@ -309,9 +432,9 @@ class RegisterComponent {
|
|
|
309
432
|
}
|
|
310
433
|
buildForm() {
|
|
311
434
|
this.form = this.fb.group({
|
|
312
|
-
username: ['', [required
|
|
313
|
-
password: ['', [required
|
|
314
|
-
email: ['', [required
|
|
435
|
+
username: ['', [required, maxLength(255)]],
|
|
436
|
+
password: ['', [required, ...getPasswordValidators(this.injector)]],
|
|
437
|
+
email: ['', [required, email]],
|
|
315
438
|
});
|
|
316
439
|
}
|
|
317
440
|
onSubmit() {
|
|
@@ -416,94 +539,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
416
539
|
type: Injectable
|
|
417
540
|
}], ctorParameters: function () { return [{ type: i3$2.AuthService }]; } });
|
|
418
541
|
|
|
419
|
-
class PersonalSettingsHalfRowComponent {
|
|
420
|
-
constructor(propData) {
|
|
421
|
-
this.propData = propData;
|
|
422
|
-
this.displayName = propData.displayName;
|
|
423
|
-
this.name = propData.name;
|
|
424
|
-
this.id = propData.id;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
PersonalSettingsHalfRowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: PersonalSettingsHalfRowComponent, deps: [{ token: EXTENSIONS_FORM_PROP }], target: i0.ɵɵFactoryTarget.Component });
|
|
428
|
-
PersonalSettingsHalfRowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: PersonalSettingsHalfRowComponent, selector: "abp-personal-settings-half-row", ngImport: i0, template: ` <div class="w-50 d-inline">
|
|
429
|
-
<div class="mb-3 form-group">
|
|
430
|
-
<label [attr.for]="name" class="form-label">{{ displayName | abpLocalization }} </label>
|
|
431
|
-
<input
|
|
432
|
-
type="text"
|
|
433
|
-
[attr.id]="id"
|
|
434
|
-
class="form-control"
|
|
435
|
-
[attr.name]="name"
|
|
436
|
-
[formControlName]="name"
|
|
437
|
-
/>
|
|
438
|
-
</div>
|
|
439
|
-
</div>`, isInline: true, 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.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i7.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i3$2.LocalizationPipe, name: "abpLocalization" }], viewProviders: [EXTENSIBLE_FORM_VIEW_PROVIDER] });
|
|
440
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: PersonalSettingsHalfRowComponent, decorators: [{
|
|
441
|
-
type: Component,
|
|
442
|
-
args: [{ selector: 'abp-personal-settings-half-row', template: ` <div class="w-50 d-inline">
|
|
443
|
-
<div class="mb-3 form-group">
|
|
444
|
-
<label [attr.for]="name" class="form-label">{{ displayName | abpLocalization }} </label>
|
|
445
|
-
<input
|
|
446
|
-
type="text"
|
|
447
|
-
[attr.id]="id"
|
|
448
|
-
class="form-control"
|
|
449
|
-
[attr.name]="name"
|
|
450
|
-
[formControlName]="name"
|
|
451
|
-
/>
|
|
452
|
-
</div>
|
|
453
|
-
</div>`, viewProviders: [EXTENSIBLE_FORM_VIEW_PROVIDER] }]
|
|
454
|
-
}], ctorParameters: function () { return [{ type: i8.FormProp, decorators: [{
|
|
455
|
-
type: Inject,
|
|
456
|
-
args: [EXTENSIONS_FORM_PROP]
|
|
457
|
-
}] }]; } });
|
|
458
|
-
|
|
459
|
-
const { maxLength, required, email } = Validators;
|
|
460
|
-
const DEFAULT_PERSONAL_SETTINGS_UPDATE_FORM_PROPS = FormProp.createMany([
|
|
461
|
-
{
|
|
462
|
-
type: "string" /* ePropType.String */,
|
|
463
|
-
name: 'userName',
|
|
464
|
-
displayName: 'AbpIdentity::DisplayName:UserName',
|
|
465
|
-
id: 'username',
|
|
466
|
-
validators: () => [required, maxLength(256)],
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
type: "string" /* ePropType.String */,
|
|
470
|
-
name: 'name',
|
|
471
|
-
displayName: 'AbpIdentity::DisplayName:Name',
|
|
472
|
-
id: 'name',
|
|
473
|
-
validators: () => [maxLength(64)],
|
|
474
|
-
template: PersonalSettingsHalfRowComponent,
|
|
475
|
-
className: 'd-inline-block w-50',
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
type: "string" /* ePropType.String */,
|
|
479
|
-
name: 'surname',
|
|
480
|
-
displayName: 'AbpIdentity::DisplayName:Surname',
|
|
481
|
-
id: 'surname',
|
|
482
|
-
validators: () => [maxLength(64)],
|
|
483
|
-
className: 'd-inline-block w-50 ps-4',
|
|
484
|
-
template: PersonalSettingsHalfRowComponent,
|
|
485
|
-
},
|
|
486
|
-
{
|
|
487
|
-
type: "string" /* ePropType.String */,
|
|
488
|
-
name: 'email',
|
|
489
|
-
displayName: 'AbpIdentity::DisplayName:Email',
|
|
490
|
-
id: 'email-address',
|
|
491
|
-
validators: () => [required, email, maxLength(256)],
|
|
492
|
-
},
|
|
493
|
-
{
|
|
494
|
-
type: "string" /* ePropType.String */,
|
|
495
|
-
name: 'phoneNumber',
|
|
496
|
-
displayName: 'AbpIdentity::DisplayName:PhoneNumber',
|
|
497
|
-
id: 'phone-number',
|
|
498
|
-
validators: () => [maxLength(16)],
|
|
499
|
-
},
|
|
500
|
-
]);
|
|
501
|
-
|
|
502
|
-
const DEFAULT_ACCOUNT_FORM_PROPS = {
|
|
503
|
-
["Account.PersonalSettingsComponent" /* eAccountComponents.PersonalSettings */]: DEFAULT_PERSONAL_SETTINGS_UPDATE_FORM_PROPS,
|
|
504
|
-
};
|
|
505
|
-
const ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS = new InjectionToken('ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS');
|
|
506
|
-
|
|
507
542
|
class AccountExtensionsGuard {
|
|
508
543
|
constructor(injector) {
|
|
509
544
|
this.injector = injector;
|
|
@@ -632,6 +667,10 @@ class AccountModule {
|
|
|
632
667
|
useFactory: accountConfigOptionsFactory,
|
|
633
668
|
deps: [ACCOUNT_CONFIG_OPTIONS],
|
|
634
669
|
},
|
|
670
|
+
{
|
|
671
|
+
provide: RE_LOGIN_CONFIRMATION_TOKEN,
|
|
672
|
+
useValue: options.isPersonalSettingsChangedConfirmationActive ?? true,
|
|
673
|
+
},
|
|
635
674
|
{
|
|
636
675
|
provide: ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS,
|
|
637
676
|
useValue: options.editFormPropContributors,
|
|
@@ -693,5 +732,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
693
732
|
* Generated bundle index. Do not edit.
|
|
694
733
|
*/
|
|
695
734
|
|
|
696
|
-
export { ACCOUNT_CONFIG_OPTIONS, ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS, AccountExtensionsGuard, AccountModule, AuthenticationFlowGuard, ChangePasswordComponent, DEFAULT_ACCOUNT_FORM_PROPS, ForgotPasswordComponent, LoginComponent, ManageProfileComponent, ManageProfileStateService, PersonalSettingsComponent, PersonalSettingsHalfRowComponent, RegisterComponent, ResetPasswordComponent };
|
|
735
|
+
export { ACCOUNT_CONFIG_OPTIONS, ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS, AccountExtensionsGuard, AccountModule, AuthenticationFlowGuard, ChangePasswordComponent, DEFAULT_ACCOUNT_FORM_PROPS, ForgotPasswordComponent, LoginComponent, ManageProfileComponent, ManageProfileStateService, PersonalSettingsComponent, PersonalSettingsHalfRowComponent, RE_LOGIN_CONFIRMATION_TOKEN, RegisterComponent, ResetPasswordComponent };
|
|
697
736
|
//# sourceMappingURL=abp-ng.account.mjs.map
|