@volo/abp.ng.identity 5.2.0-rc.1 → 5.2.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.
@@ -3,12 +3,12 @@ import { EventEmitter, Component, Input, Output, ViewChild, InjectionToken, LOCA
3
3
  import * as i3 from '@volo/abp.ng.identity/proxy';
4
4
  import { OrganizationUnitService } from '@volo/abp.ng.identity/proxy';
5
5
  import { take, finalize, tap, switchMap, map, mapTo } from 'rxjs/operators';
6
+ import * as i1 from '@abp/ng.core';
7
+ import { SubscriptionService, ListService, mapEnumToOptions, generatePassword, LocalizationService, escapeHtmlChars, ConfigStateService, getShortDateShortTimeFormat, RouterOutletComponent, AuthGuard, PermissionGuard, ReplaceableRouteContainerComponent, LazyModuleFactory, CoreModule } from '@abp/ng.core';
6
8
  import * as i2 from '@abp/ng.theme.shared';
7
9
  import { Confirmation, ConfirmationService, getPasswordValidators, ThemeSharedModule } from '@abp/ng.theme.shared';
8
10
  import * as i4 from '@angular/forms';
9
11
  import { FormControl, Validators } from '@angular/forms';
10
- import * as i1 from '@abp/ng.core';
11
- import { ListService, mapEnumToOptions, generatePassword, LocalizationService, escapeHtmlChars, ConfigStateService, getShortDateShortTimeFormat, RouterOutletComponent, AuthGuard, PermissionGuard, ReplaceableRouteContainerComponent, LazyModuleFactory, CoreModule } from '@abp/ng.core';
12
12
  import * as i5 from '@angular/common';
13
13
  import { formatDate } from '@angular/common';
14
14
  import * as i6$1 from '@abp/ng.theme.shared/extensions';
@@ -31,9 +31,10 @@ import * as i1$1 from '@angular/router';
31
31
  import { RouterModule } from '@angular/router';
32
32
 
33
33
  class ClaimModalComponent {
34
- constructor(roleService, userService) {
34
+ constructor(roleService, userService, subscription) {
35
35
  this.roleService = roleService;
36
36
  this.userService = userService;
37
+ this.subscription = subscription;
37
38
  this.visibleChange = new EventEmitter();
38
39
  this.modalBusy = false;
39
40
  }
@@ -65,12 +66,10 @@ class ClaimModalComponent {
65
66
  this.getSubjectClaims(this.subject);
66
67
  }
67
68
  getClaimTypeNames() {
68
- this.service.getAllClaimTypes().subscribe(claimTypes => (this.claimTypes = claimTypes));
69
+ this.subscription.addOne(this.service.getAllClaimTypes(), claimTypes => (this.claimTypes = claimTypes));
69
70
  }
70
71
  getSubjectClaims(subject) {
71
- this.service.getClaims(subject.id)
72
- .pipe(take(1))
73
- .subscribe(claims => (this.subjectClaims = claims));
72
+ this.subscription.addOne(this.service.getClaims(subject.id).pipe(take(1)), claims => (this.subjectClaims = claims));
74
73
  }
75
74
  addClaim() {
76
75
  if (!this.newClaimType || !this.newClaimValue)
@@ -94,18 +93,15 @@ class ClaimModalComponent {
94
93
  if (this.modalBusy)
95
94
  return;
96
95
  this.modalBusy = true;
97
- this.service
98
- .updateClaims(this.subject.id, this.subjectClaims)
99
- .pipe(take(1), finalize(() => (this.modalBusy = false)))
100
- .subscribe(() => (this.visible = false));
96
+ this.subscription.addOne(this.service.updateClaims(this.subject.id, this.subjectClaims).pipe(take(1), finalize(() => (this.modalBusy = false))), () => (this.visible = false));
101
97
  }
102
98
  }
103
- ClaimModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ClaimModalComponent, deps: [{ token: i3.IdentityRoleService }, { token: i3.IdentityUserService }], target: i0.ɵɵFactoryTarget.Component });
104
- ClaimModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ClaimModalComponent, selector: "abp-claim-modal", inputs: { subject: "subject", visible: "visible" }, outputs: { visibleChange: "visibleChange" }, usesOnChanges: true, ngImport: i0, template: "<abp-modal [(visible)]=\"visible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpIdentity::Claims' | abpLocalization }}</h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <form (ngSubmit)=\"addClaim()\">\r\n <div class=\"row\">\r\n <div class=\"col col-sm-6\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"claimTypeSelect\">{{\r\n 'AbpIdentity::Type' | abpLocalization\r\n }}</label\r\n ><select\r\n autofocus\r\n id=\"claimTypeSelect\"\r\n class=\"form-select form-control\"\r\n [(ngModel)]=\"newClaimType\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n >\r\n <option *ngFor=\"let type of claimTypes\" [ngValue]=\"type.name\">{{ type.name }}</option>\r\n </select>\r\n </div>\r\n </div>\r\n <div class=\"col col-sm-6\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"newClaimValue\">Value</label>\r\n <input\r\n required\r\n id=\"newClaimValue\"\r\n type=\"text\"\r\n class=\"form-control\"\r\n [(ngModel)]=\"newClaimValue\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n />\r\n </div>\r\n </div>\r\n <div class=\"col col-sm-12 align-self-center d-grid\">\r\n <button class=\"btn btn-success\" type=\"button\" (click)=\"addClaim()\">\r\n <i class=\"fa fa-plus\"></i>\r\n {{ 'AbpIdentity::AddClaim' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <div class=\"willBeHidden\" *ngIf=\"subjectClaims && subjectClaims.length\">\r\n <div class=\"input-group mb-3\" *ngFor=\"let claim of subjectClaims; let i = index\">\r\n <div class=\"input-group-prepend\">\r\n <label class=\"input-group-text mw-100 fs-9\">{{ claim.claimType }}</label>\r\n </div>\r\n <input\r\n type=\"text\"\r\n class=\"form-control\"\r\n [(ngModel)]=\"subjectClaims[i].claimValue\"\r\n required\r\n />\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-danger deleteClaim\" (click)=\"removeClaim(i)\">\r\n <i class=\"fa fa-trash\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n", components: [{ type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.ModalCloseDirective, selector: "[abpClose]" }], pipes: { "abpLocalization": i1.LocalizationPipe } });
99
+ ClaimModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ClaimModalComponent, deps: [{ token: i3.IdentityRoleService }, { token: i3.IdentityUserService }, { token: i1.SubscriptionService }], target: i0.ɵɵFactoryTarget.Component });
100
+ ClaimModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ClaimModalComponent, selector: "abp-claim-modal", inputs: { subject: "subject", visible: "visible" }, outputs: { visibleChange: "visibleChange" }, providers: [SubscriptionService], usesOnChanges: true, ngImport: i0, template: "<abp-modal [(visible)]=\"visible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpIdentity::Claims' | abpLocalization }}</h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <form (ngSubmit)=\"addClaim()\">\r\n <div class=\"row\">\r\n <div class=\"col col-sm-6\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"claimTypeSelect\">{{\r\n 'AbpIdentity::Type' | abpLocalization\r\n }}</label\r\n ><select\r\n autofocus\r\n id=\"claimTypeSelect\"\r\n class=\"form-select form-control\"\r\n [(ngModel)]=\"newClaimType\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n >\r\n <option></option>\r\n <option *ngFor=\"let type of claimTypes\" [ngValue]=\"type.name\">{{ type.name }}</option>\r\n </select>\r\n </div>\r\n </div>\r\n <div class=\"col col-sm-6\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"newClaimValue\">Value</label>\r\n <input\r\n required\r\n id=\"newClaimValue\"\r\n type=\"text\"\r\n class=\"form-control\"\r\n [(ngModel)]=\"newClaimValue\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n />\r\n </div>\r\n </div>\r\n <div class=\"col col-sm-12 align-self-center d-grid\">\r\n <button class=\"btn btn-success\" type=\"button\" (click)=\"addClaim()\">\r\n <i class=\"fa fa-plus\"></i>\r\n {{ 'AbpIdentity::AddClaim' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <div class=\"willBeHidden mt-3\" *ngIf=\"subjectClaims && subjectClaims.length\">\r\n <div class=\"input-group mb-3\" *ngFor=\"let claim of subjectClaims; let i = index\">\r\n <div class=\"input-group-prepend\">\r\n <label class=\"input-group-text mw-100 h-100 fs-9\">{{ claim.claimType }}</label>\r\n </div>\r\n <input\r\n type=\"text\"\r\n class=\"form-control\"\r\n [(ngModel)]=\"subjectClaims[i].claimValue\"\r\n required\r\n />\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-danger deleteClaim\" (click)=\"removeClaim(i)\">\r\n <i class=\"fa fa-trash\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n", components: [{ type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i1.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.ModalCloseDirective, selector: "[abpClose]" }], pipes: { "abpLocalization": i1.LocalizationPipe } });
105
101
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ClaimModalComponent, decorators: [{
106
102
  type: Component,
107
- args: [{ selector: 'abp-claim-modal', template: "<abp-modal [(visible)]=\"visible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpIdentity::Claims' | abpLocalization }}</h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <form (ngSubmit)=\"addClaim()\">\r\n <div class=\"row\">\r\n <div class=\"col col-sm-6\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"claimTypeSelect\">{{\r\n 'AbpIdentity::Type' | abpLocalization\r\n }}</label\r\n ><select\r\n autofocus\r\n id=\"claimTypeSelect\"\r\n class=\"form-select form-control\"\r\n [(ngModel)]=\"newClaimType\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n >\r\n <option *ngFor=\"let type of claimTypes\" [ngValue]=\"type.name\">{{ type.name }}</option>\r\n </select>\r\n </div>\r\n </div>\r\n <div class=\"col col-sm-6\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"newClaimValue\">Value</label>\r\n <input\r\n required\r\n id=\"newClaimValue\"\r\n type=\"text\"\r\n class=\"form-control\"\r\n [(ngModel)]=\"newClaimValue\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n />\r\n </div>\r\n </div>\r\n <div class=\"col col-sm-12 align-self-center d-grid\">\r\n <button class=\"btn btn-success\" type=\"button\" (click)=\"addClaim()\">\r\n <i class=\"fa fa-plus\"></i>\r\n {{ 'AbpIdentity::AddClaim' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <div class=\"willBeHidden\" *ngIf=\"subjectClaims && subjectClaims.length\">\r\n <div class=\"input-group mb-3\" *ngFor=\"let claim of subjectClaims; let i = index\">\r\n <div class=\"input-group-prepend\">\r\n <label class=\"input-group-text mw-100 fs-9\">{{ claim.claimType }}</label>\r\n </div>\r\n <input\r\n type=\"text\"\r\n class=\"form-control\"\r\n [(ngModel)]=\"subjectClaims[i].claimValue\"\r\n required\r\n />\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-danger deleteClaim\" (click)=\"removeClaim(i)\">\r\n <i class=\"fa fa-trash\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
108
- }], ctorParameters: function () { return [{ type: i3.IdentityRoleService }, { type: i3.IdentityUserService }]; }, propDecorators: { subject: [{
103
+ args: [{ selector: 'abp-claim-modal', providers: [SubscriptionService], template: "<abp-modal [(visible)]=\"visible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpIdentity::Claims' | abpLocalization }}</h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <form (ngSubmit)=\"addClaim()\">\r\n <div class=\"row\">\r\n <div class=\"col col-sm-6\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"claimTypeSelect\">{{\r\n 'AbpIdentity::Type' | abpLocalization\r\n }}</label\r\n ><select\r\n autofocus\r\n id=\"claimTypeSelect\"\r\n class=\"form-select form-control\"\r\n [(ngModel)]=\"newClaimType\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n >\r\n <option></option>\r\n <option *ngFor=\"let type of claimTypes\" [ngValue]=\"type.name\">{{ type.name }}</option>\r\n </select>\r\n </div>\r\n </div>\r\n <div class=\"col col-sm-6\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"newClaimValue\">Value</label>\r\n <input\r\n required\r\n id=\"newClaimValue\"\r\n type=\"text\"\r\n class=\"form-control\"\r\n [(ngModel)]=\"newClaimValue\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n />\r\n </div>\r\n </div>\r\n <div class=\"col col-sm-12 align-self-center d-grid\">\r\n <button class=\"btn btn-success\" type=\"button\" (click)=\"addClaim()\">\r\n <i class=\"fa fa-plus\"></i>\r\n {{ 'AbpIdentity::AddClaim' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <div class=\"willBeHidden mt-3\" *ngIf=\"subjectClaims && subjectClaims.length\">\r\n <div class=\"input-group mb-3\" *ngFor=\"let claim of subjectClaims; let i = index\">\r\n <div class=\"input-group-prepend\">\r\n <label class=\"input-group-text mw-100 h-100 fs-9\">{{ claim.claimType }}</label>\r\n </div>\r\n <input\r\n type=\"text\"\r\n class=\"form-control\"\r\n [(ngModel)]=\"subjectClaims[i].claimValue\"\r\n required\r\n />\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-danger deleteClaim\" (click)=\"removeClaim(i)\">\r\n <i class=\"fa fa-trash\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
104
+ }], ctorParameters: function () { return [{ type: i3.IdentityRoleService }, { type: i3.IdentityUserService }, { type: i1.SubscriptionService }]; }, propDecorators: { subject: [{
109
105
  type: Input
110
106
  }], visible: [{
111
107
  type: Input