@volo/abp.ng.identity 10.2.0-rc.4 → 10.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.
|
@@ -204,7 +204,6 @@ class ClaimModalComponent {
|
|
|
204
204
|
this.toasterService = inject(ToasterService);
|
|
205
205
|
this.visible = model(false, ...(ngDevMode ? [{ debugName: "visible" }] : []));
|
|
206
206
|
this.subject = input(...(ngDevMode ? [undefined, { debugName: "subject" }] : []));
|
|
207
|
-
this.visibleChange = output();
|
|
208
207
|
this.modalBusy = false;
|
|
209
208
|
this.inputType = 'String';
|
|
210
209
|
effect(() => {
|
|
@@ -346,7 +345,7 @@ class ClaimModalComponent {
|
|
|
346
345
|
});
|
|
347
346
|
}
|
|
348
347
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ClaimModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
349
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ClaimModalComponent, isStandalone: true, selector: "abp-claim-modal", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, subject: { classPropertyName: "subject", publicName: "subject", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange"
|
|
348
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: ClaimModalComponent, isStandalone: true, selector: "abp-claim-modal", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, subject: { classPropertyName: "subject", publicName: "subject", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange" }, providers: [SubscriptionService], ngImport: i0, template: "<abp-modal [visible]=\"visible()\" (visibleChange)=\"visible.set($event)\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">\r\n {{ 'AbpIdentity::Claims' | abpLocalization }}\r\n @if (subject().title) {\r\n - {{ subject().title }}\r\n }\r\n </h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <form\r\n (ngSubmit)=\"addClaim(ngForm)\"\r\n #ngForm=\"ngForm\"\r\n [formGroup]=\"form\"\r\n validateOnSubmit\r\n [markAsDirtyWhenSubmit]=\"false\"\r\n >\r\n <div class=\"row\">\r\n <div class=\"col-md-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\"\r\n formControlName=\"claimType\"\r\n (change)=\"claimTypeChange()\"\r\n >\r\n @for (type of claimTypes; track $index) {\r\n <option [ngValue]=\"type.name\">\r\n {{ type.name }}\r\n </option>\r\n }\r\n </select>\r\n </div>\r\n </div>\r\n <div class=\"col-md-6\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"newClaimValue\">\r\n {{ 'AbpIdentity::ClaimValue' | abpLocalization }}\r\n </label>\r\n\r\n @if (inputType === 'Boolean') {\r\n <select\r\n autofocus\r\n id=\"newClaimValueBool\"\r\n class=\"form-select form-control\"\r\n formControlName=\"claimValue\"\r\n >\r\n <option ngValue=\"true\">{{ 'AbpIdentity::True' | abpLocalization }}</option>\r\n <option ngValue=\"false\">{{ 'AbpIdentity::False' | abpLocalization }}</option>\r\n </select>\r\n } @else {\r\n <input\r\n required\r\n id=\"newClaimValue\"\r\n [type]=\"inputType\"\r\n class=\"form-control\"\r\n formControlName=\"claimValue\"\r\n (keydown)=\"onKeyDown($event)\"\r\n />\r\n }\r\n </div>\r\n </div>\r\n <div class=\"col-md-12 align-self-center d-grid\">\r\n <button class=\"btn btn-success\" type=\"submit\">\r\n <i class=\"fa fa-plus\" aria-hidden=\"true\"></i>\r\n {{ 'AbpIdentity::AddClaim' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n @if (subjectClaims && subjectClaims.length) {\r\n <div class=\"willBeHidden mt-3\">\r\n @for (claim of subjectClaims; track $index; let i = $index) {\r\n <div class=\"input-group mb-3\">\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\r\n @if (subjectClaims[i].inputType === 'Boolean') {\r\n <select autofocus class=\"form-control\" [(ngModel)]=\"subjectClaims[i].claimValue\">\r\n <option ngValue=\"true\">{{ 'AbpIdentity::True' | abpLocalization }}</option>\r\n <option ngValue=\"false\">{{ 'AbpIdentity::False' | abpLocalization }}</option>\r\n </select>\r\n } @else {\r\n <input\r\n [type]=\"subjectClaims[i].inputType\"\r\n class=\"form-control\"\r\n [(ngModel)]=\"subjectClaims[i].claimValue\"\r\n required\r\n />\r\n }\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\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </ng-template>\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-outline-primary\" abpClose>\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" (click)=\"save()\" [disabled]=\"modalBusy\">{{\r\n 'AbpUi::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { 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.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { 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.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: NgxValidateCoreModule }, { kind: "directive", type: i2.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i2.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "directive", type: AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }, { kind: "directive", type: ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "component", type: ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "pipe", type: LocalizationPipe, name: "abpLocalization" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
350
349
|
}
|
|
351
350
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: ClaimModalComponent, decorators: [{
|
|
352
351
|
type: Component,
|
|
@@ -360,7 +359,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
360
359
|
ModalComponent,
|
|
361
360
|
ButtonComponent,
|
|
362
361
|
], template: "<abp-modal [visible]=\"visible()\" (visibleChange)=\"visible.set($event)\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">\r\n {{ 'AbpIdentity::Claims' | abpLocalization }}\r\n @if (subject().title) {\r\n - {{ subject().title }}\r\n }\r\n </h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <form\r\n (ngSubmit)=\"addClaim(ngForm)\"\r\n #ngForm=\"ngForm\"\r\n [formGroup]=\"form\"\r\n validateOnSubmit\r\n [markAsDirtyWhenSubmit]=\"false\"\r\n >\r\n <div class=\"row\">\r\n <div class=\"col-md-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\"\r\n formControlName=\"claimType\"\r\n (change)=\"claimTypeChange()\"\r\n >\r\n @for (type of claimTypes; track $index) {\r\n <option [ngValue]=\"type.name\">\r\n {{ type.name }}\r\n </option>\r\n }\r\n </select>\r\n </div>\r\n </div>\r\n <div class=\"col-md-6\">\r\n <div class=\"mb-3\">\r\n <label class=\"form-label\" for=\"newClaimValue\">\r\n {{ 'AbpIdentity::ClaimValue' | abpLocalization }}\r\n </label>\r\n\r\n @if (inputType === 'Boolean') {\r\n <select\r\n autofocus\r\n id=\"newClaimValueBool\"\r\n class=\"form-select form-control\"\r\n formControlName=\"claimValue\"\r\n >\r\n <option ngValue=\"true\">{{ 'AbpIdentity::True' | abpLocalization }}</option>\r\n <option ngValue=\"false\">{{ 'AbpIdentity::False' | abpLocalization }}</option>\r\n </select>\r\n } @else {\r\n <input\r\n required\r\n id=\"newClaimValue\"\r\n [type]=\"inputType\"\r\n class=\"form-control\"\r\n formControlName=\"claimValue\"\r\n (keydown)=\"onKeyDown($event)\"\r\n />\r\n }\r\n </div>\r\n </div>\r\n <div class=\"col-md-12 align-self-center d-grid\">\r\n <button class=\"btn btn-success\" type=\"submit\">\r\n <i class=\"fa fa-plus\" aria-hidden=\"true\"></i>\r\n {{ 'AbpIdentity::AddClaim' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n @if (subjectClaims && subjectClaims.length) {\r\n <div class=\"willBeHidden mt-3\">\r\n @for (claim of subjectClaims; track $index; let i = $index) {\r\n <div class=\"input-group mb-3\">\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\r\n @if (subjectClaims[i].inputType === 'Boolean') {\r\n <select autofocus class=\"form-control\" [(ngModel)]=\"subjectClaims[i].claimValue\">\r\n <option ngValue=\"true\">{{ 'AbpIdentity::True' | abpLocalization }}</option>\r\n <option ngValue=\"false\">{{ 'AbpIdentity::False' | abpLocalization }}</option>\r\n </select>\r\n } @else {\r\n <input\r\n [type]=\"subjectClaims[i].inputType\"\r\n class=\"form-control\"\r\n [(ngModel)]=\"subjectClaims[i].claimValue\"\r\n required\r\n />\r\n }\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\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </ng-template>\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-outline-primary\" abpClose>\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" (click)=\"save()\" [disabled]=\"modalBusy\">{{\r\n 'AbpUi::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
363
|
-
}], ctorParameters: () => [], propDecorators: { visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], subject: [{ type: i0.Input, args: [{ isSignal: true, alias: "subject", required: false }] }]
|
|
362
|
+
}], ctorParameters: () => [], propDecorators: { visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], subject: [{ type: i0.Input, args: [{ isSignal: true, alias: "subject", required: false }] }] } });
|
|
364
363
|
|
|
365
364
|
class UploadExcelFileComponent {
|
|
366
365
|
constructor() {
|
|
@@ -2069,19 +2068,26 @@ class MoveAllUsersComponent {
|
|
|
2069
2068
|
.subscribe(res => this.#roles.set(res.items));
|
|
2070
2069
|
}
|
|
2071
2070
|
async save() {
|
|
2071
|
+
if (this.loading()) {
|
|
2072
|
+
return;
|
|
2073
|
+
}
|
|
2072
2074
|
if (this.form.invalid) {
|
|
2073
2075
|
return;
|
|
2074
2076
|
}
|
|
2075
2077
|
this.loading.set(true);
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2078
|
+
try {
|
|
2079
|
+
const { role } = this.form.value;
|
|
2080
|
+
const moveAllTenants$ = this.service.moveAllUsers(this.selected().id, role);
|
|
2081
|
+
await firstValueFrom(moveAllTenants$);
|
|
2082
|
+
this.toasterService.success('AbpUi::SavedSuccessfully');
|
|
2083
|
+
this.visibleChange.emit({ visible: false, refresh: true });
|
|
2084
|
+
}
|
|
2085
|
+
finally {
|
|
2086
|
+
this.loading.set(false);
|
|
2087
|
+
}
|
|
2082
2088
|
}
|
|
2083
2089
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: MoveAllUsersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2084
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: MoveAllUsersComponent, isStandalone: true, selector: "abp-move-all-users", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, ngImport: i0, template: "<abp-modal\
|
|
2090
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: MoveAllUsersComponent, isStandalone: true, selector: "abp-move-all-users", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, ngImport: i0, template: "<abp-modal\n [visible]=\"visible()\"\n [busy]=\"loading()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [suppressUnsavedChangesWarning]=\"true\"\n>\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">\r\n {{ 'AbpIdentity::MoveAllUsers' | abpLocalization }}\r\n </h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <p [innerHTML]=\"'AbpIdentity::MoveAllUsersWithRoleTo' | abpLocalization: name\"></p>\r\n <form [formGroup]=\"form\" id=\"role-move-users-form\" (ngSubmit)=\"save()\">\r\n <select class=\"form-select mt-2\" formControlName=\"role\">\r\n <option value=\"\" selected>\r\n {{\r\n (loading() ? 'AbpUi::LoadingWithThreeDot' : 'AbpIdentity::UnassignRole')\r\n | abpLocalization\r\n }}\r\n </option>\r\n @for (item of roles(); track $index) {\r\n <option [value]=\"item.id\">{{ item.name }}</option>\r\n }\r\n </select>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button abpClose type=\"button\" class=\"btn btn-outline-primary\">\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <button\n type=\"submit\"\n class=\"btn btn-primary\"\n [loading]=\"loading()\"\n [disabled]=\"loading() || (form.invalid && form.touched)\"\n form=\"role-move-users-form\"\n >\n <i class=\"fa fa-check me-1\" aria-hidden=\"true\"></i>\r\n {{ 'AbpUi::Save' | abpLocalization }}\r\n </button>\r\n </ng-template>\r\n</abp-modal>\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: NgxValidateCoreModule }, { kind: "directive", type: i2.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i2.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "directive", type: ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "pipe", type: LocalizationPipe, name: "abpLocalization" }] }); }
|
|
2085
2091
|
}
|
|
2086
2092
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: MoveAllUsersComponent, decorators: [{
|
|
2087
2093
|
type: Component,
|
|
@@ -2092,7 +2098,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
2092
2098
|
ModalCloseDirective,
|
|
2093
2099
|
LocalizationPipe,
|
|
2094
2100
|
ModalComponent,
|
|
2095
|
-
], template: "<abp-modal\
|
|
2101
|
+
], template: "<abp-modal\n [visible]=\"visible()\"\n [busy]=\"loading()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [suppressUnsavedChangesWarning]=\"true\"\n>\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">\r\n {{ 'AbpIdentity::MoveAllUsers' | abpLocalization }}\r\n </h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <p [innerHTML]=\"'AbpIdentity::MoveAllUsersWithRoleTo' | abpLocalization: name\"></p>\r\n <form [formGroup]=\"form\" id=\"role-move-users-form\" (ngSubmit)=\"save()\">\r\n <select class=\"form-select mt-2\" formControlName=\"role\">\r\n <option value=\"\" selected>\r\n {{\r\n (loading() ? 'AbpUi::LoadingWithThreeDot' : 'AbpIdentity::UnassignRole')\r\n | abpLocalization\r\n }}\r\n </option>\r\n @for (item of roles(); track $index) {\r\n <option [value]=\"item.id\">{{ item.name }}</option>\r\n }\r\n </select>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button abpClose type=\"button\" class=\"btn btn-outline-primary\">\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <button\n type=\"submit\"\n class=\"btn btn-primary\"\n [loading]=\"loading()\"\n [disabled]=\"loading() || (form.invalid && form.touched)\"\n form=\"role-move-users-form\"\n >\n <i class=\"fa fa-check me-1\" aria-hidden=\"true\"></i>\r\n {{ 'AbpUi::Save' | abpLocalization }}\r\n </button>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
2096
2102
|
}], propDecorators: { visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: true }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: true }] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }] } });
|
|
2097
2103
|
|
|
2098
2104
|
function RoleDeleteValidator() {
|
|
@@ -2179,19 +2185,23 @@ class RoleDeleteComponent {
|
|
|
2179
2185
|
return;
|
|
2180
2186
|
}
|
|
2181
2187
|
this.loading.set(true);
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2188
|
+
try {
|
|
2189
|
+
const { assignType, role } = this.form.value;
|
|
2190
|
+
if (assignType) {
|
|
2191
|
+
const moveAllTenants$ = this.service.moveAllUsers(this.selected().id, role);
|
|
2192
|
+
await firstValueFrom(moveAllTenants$);
|
|
2193
|
+
}
|
|
2194
|
+
const delete$ = this.service.delete(this.selected().id);
|
|
2195
|
+
await firstValueFrom(delete$);
|
|
2196
|
+
this.toasterService.success('AbpUi::DeletedSuccessfully');
|
|
2197
|
+
this.visibleChange.emit({ visible: false, refresh: true });
|
|
2198
|
+
}
|
|
2199
|
+
finally {
|
|
2200
|
+
this.loading.set(false);
|
|
2186
2201
|
}
|
|
2187
|
-
const delete$ = this.service.delete(this.selected().id);
|
|
2188
|
-
await firstValueFrom(delete$);
|
|
2189
|
-
this.loading.set(false);
|
|
2190
|
-
this.toasterService.success('AbpUi::DeletedSuccessfully');
|
|
2191
|
-
this.visibleChange.emit({ visible: false, refresh: true });
|
|
2192
2202
|
}
|
|
2193
2203
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: RoleDeleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2194
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: RoleDeleteComponent, isStandalone: true, selector: "abp-role-delete", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, ngImport: i0, template: "<abp-modal\
|
|
2204
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: RoleDeleteComponent, isStandalone: true, selector: "abp-role-delete", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, ngImport: i0, template: "<abp-modal\n [visible]=\"visible()\"\n [busy]=\"loading()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [suppressUnsavedChangesWarning]=\"true\"\n>\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">\r\n {{ 'AbpUi::AreYouSure' | abpLocalization }}\r\n </h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <p class=\"fw-bold\">\r\n {{ 'AbpIdentity::RoleDeletionConfirmationMessage' | abpLocalization: name }}\r\n </p>\r\n <form [formGroup]=\"form\" id=\"role-delete-form\" (ngSubmit)=\"save()\">\r\n @if (userCount > 0) {\r\n <p class=\"mt-2\">\r\n {{ 'AbpIdentity::ChooseAnActionForRole' | abpLocalization: userCount }}\r\n </p>\r\n\r\n <div class=\"form-check mt-2\">\r\n <input\r\n class=\"form-check-input\"\r\n formControlName=\"assignType\"\r\n type=\"radio\"\r\n name=\"assignType\"\r\n id=\"unassign\"\r\n [value]=\"false\"\r\n />\r\n <label class=\"form-check-label\" for=\"unassign\">{{\r\n 'AbpIdentity::UnassignTheRoleFromTheUsers' | abpLocalization\r\n }}</label>\r\n </div>\r\n @if (roles().length > 0) {\r\n <div class=\"form-check mt-2\">\r\n <input\r\n class=\"form-check-input\"\r\n formControlName=\"assignType\"\r\n type=\"radio\"\r\n name=\"assignType\"\r\n id=\"assign\"\r\n [value]=\"true\"\r\n />\r\n <label class=\"form-check-label\" for=\"assign\">{{\r\n 'AbpIdentity::AssignUsersToOtherRole' | abpLocalization\r\n }}</label>\r\n </div>\r\n @if (assignType$ | async) {\r\n <select\r\n class=\"form-select mt-2\"\r\n [class.border-danger]=\"showAssignErrorMessage()\"\r\n formControlName=\"role\"\r\n >\r\n <option [ngValue]=\"null\" selected>\r\n {{\r\n (loading() ? 'AbpUi::LoadingWithThreeDot' : 'AbpIdentity::SelectAnRoleToAssign')\r\n | abpLocalization\r\n }}\r\n </option>\r\n @for (item of roles(); track $index) {\r\n <option [value]=\"item.id\">\r\n {{ item.name }}\r\n </option>\r\n }\r\n </select>\r\n }\r\n @if (showAssignErrorMessage()) {\r\n <span class=\"text-danger\">\r\n {{ 'AbpValidation::ThisFieldIsRequired.' | abpLocalization }}\r\n </span>\r\n }\r\n }\r\n }\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button abpClose type=\"button\" class=\"btn btn-outline-danger\">\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <button\r\n type=\"submit\"\r\n class=\"btn btn-danger\"\r\n [loading]=\"loading()\"\r\n [disabled]=\"loading()\"\r\n form=\"role-delete-form\"\r\n >\r\n <i class=\"fa fa-trash\" aria-hidden=\"true\"></i>\r\n {{ 'AbpUi::Delete' | abpLocalization }}\r\n </button>\r\n </ng-template>\r\n</abp-modal>\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { 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.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: NgxValidateCoreModule }, { kind: "directive", type: i2.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i2.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "directive", type: ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: LocalizationPipe, name: "abpLocalization" }] }); }
|
|
2195
2205
|
}
|
|
2196
2206
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: RoleDeleteComponent, decorators: [{
|
|
2197
2207
|
type: Component,
|
|
@@ -2203,7 +2213,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
2203
2213
|
AsyncPipe,
|
|
2204
2214
|
LocalizationPipe,
|
|
2205
2215
|
ModalComponent,
|
|
2206
|
-
], template: "<abp-modal\
|
|
2216
|
+
], template: "<abp-modal\n [visible]=\"visible()\"\n [busy]=\"loading()\"\n (visibleChange)=\"onVisibleChange($event)\"\n [suppressUnsavedChangesWarning]=\"true\"\n>\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">\r\n {{ 'AbpUi::AreYouSure' | abpLocalization }}\r\n </h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <p class=\"fw-bold\">\r\n {{ 'AbpIdentity::RoleDeletionConfirmationMessage' | abpLocalization: name }}\r\n </p>\r\n <form [formGroup]=\"form\" id=\"role-delete-form\" (ngSubmit)=\"save()\">\r\n @if (userCount > 0) {\r\n <p class=\"mt-2\">\r\n {{ 'AbpIdentity::ChooseAnActionForRole' | abpLocalization: userCount }}\r\n </p>\r\n\r\n <div class=\"form-check mt-2\">\r\n <input\r\n class=\"form-check-input\"\r\n formControlName=\"assignType\"\r\n type=\"radio\"\r\n name=\"assignType\"\r\n id=\"unassign\"\r\n [value]=\"false\"\r\n />\r\n <label class=\"form-check-label\" for=\"unassign\">{{\r\n 'AbpIdentity::UnassignTheRoleFromTheUsers' | abpLocalization\r\n }}</label>\r\n </div>\r\n @if (roles().length > 0) {\r\n <div class=\"form-check mt-2\">\r\n <input\r\n class=\"form-check-input\"\r\n formControlName=\"assignType\"\r\n type=\"radio\"\r\n name=\"assignType\"\r\n id=\"assign\"\r\n [value]=\"true\"\r\n />\r\n <label class=\"form-check-label\" for=\"assign\">{{\r\n 'AbpIdentity::AssignUsersToOtherRole' | abpLocalization\r\n }}</label>\r\n </div>\r\n @if (assignType$ | async) {\r\n <select\r\n class=\"form-select mt-2\"\r\n [class.border-danger]=\"showAssignErrorMessage()\"\r\n formControlName=\"role\"\r\n >\r\n <option [ngValue]=\"null\" selected>\r\n {{\r\n (loading() ? 'AbpUi::LoadingWithThreeDot' : 'AbpIdentity::SelectAnRoleToAssign')\r\n | abpLocalization\r\n }}\r\n </option>\r\n @for (item of roles(); track $index) {\r\n <option [value]=\"item.id\">\r\n {{ item.name }}\r\n </option>\r\n }\r\n </select>\r\n }\r\n @if (showAssignErrorMessage()) {\r\n <span class=\"text-danger\">\r\n {{ 'AbpValidation::ThisFieldIsRequired.' | abpLocalization }}\r\n </span>\r\n }\r\n }\r\n }\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button abpClose type=\"button\" class=\"btn btn-outline-danger\">\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <button\r\n type=\"submit\"\r\n class=\"btn btn-danger\"\r\n [loading]=\"loading()\"\r\n [disabled]=\"loading()\"\r\n form=\"role-delete-form\"\r\n >\r\n <i class=\"fa fa-trash\" aria-hidden=\"true\"></i>\r\n {{ 'AbpUi::Delete' | abpLocalization }}\r\n </button>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
2207
2217
|
}], propDecorators: { visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: true }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: true }] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }] } });
|
|
2208
2218
|
|
|
2209
2219
|
class RolesModalComponent {
|
|
@@ -2211,6 +2221,7 @@ class RolesModalComponent {
|
|
|
2211
2221
|
this.service = inject(IdentityRoleService);
|
|
2212
2222
|
this.toasterService = inject(ToasterService);
|
|
2213
2223
|
this.injector = inject(Injector);
|
|
2224
|
+
this.modalBusy = false;
|
|
2214
2225
|
this.selected = input(...(ngDevMode ? [undefined, { debugName: "selected" }] : []));
|
|
2215
2226
|
this.visibleChange = output();
|
|
2216
2227
|
}
|
|
@@ -2225,9 +2236,10 @@ class RolesModalComponent {
|
|
|
2225
2236
|
this.visibleChange.emit({ visible, refresh });
|
|
2226
2237
|
}
|
|
2227
2238
|
save() {
|
|
2228
|
-
if (!this.form.valid) {
|
|
2239
|
+
if (!this.form.valid || this.modalBusy) {
|
|
2229
2240
|
return;
|
|
2230
2241
|
}
|
|
2242
|
+
this.modalBusy = true;
|
|
2231
2243
|
let observable = this.service.create(this.form.value);
|
|
2232
2244
|
if (this.selected()?.id.length > 0) {
|
|
2233
2245
|
const { id } = this.selected();
|
|
@@ -2237,13 +2249,15 @@ class RolesModalComponent {
|
|
|
2237
2249
|
};
|
|
2238
2250
|
observable = this.service.update(id, input);
|
|
2239
2251
|
}
|
|
2240
|
-
observable
|
|
2252
|
+
observable
|
|
2253
|
+
.pipe(finalize$1(() => (this.modalBusy = false)))
|
|
2254
|
+
.subscribe(() => {
|
|
2241
2255
|
this.onVisibleChange(false, true);
|
|
2242
2256
|
this.toasterService.success('AbpUi::SavedSuccessfully');
|
|
2243
2257
|
});
|
|
2244
2258
|
}
|
|
2245
2259
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: RolesModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2246
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: RolesModalComponent, isStandalone: true, selector: "abp-roles-modal", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, ngImport: i0, template: "<abp-modal [visible]=\"true\" (visibleChange)=\"onVisibleChange($event)\">\
|
|
2260
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.9", type: RolesModalComponent, isStandalone: true, selector: "abp-roles-modal", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleChange: "visibleChange" }, ngImport: i0, template: "<abp-modal [visible]=\"true\" [busy]=\"modalBusy\" (visibleChange)=\"onVisibleChange($event)\">\n <ng-template #abpHeader>\r\n <h3>\r\n @if (!selected()?.id) {\r\n {{ 'AbpIdentity::NewRole' | abpLocalization }}\r\n } @else {\r\n {{ 'AbpUi::Edit' | abpLocalization }}\r\n @if (selected().name; as roleName) {\r\n - {{ roleName }}\r\n }\r\n }\r\n </h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n @if (form) {\r\n <form id=\"roleForm\" [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form class=\"row gap-x2\" [selectedRecord]=\"selected()\" />\r\n </form>\r\n }\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-outline-primary\" abpClose>\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button\n iconClass=\"fa fa-check\"\n buttonType=\"submit\"\n formName=\"roleForm\"\n [disabled]=\"modalBusy\"\n >\n {{ 'AbpUi::Save' | abpLocalization }}\n </abp-button>\n </ng-template>\n</abp-modal>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NgxValidateCoreModule }, { kind: "directive", type: i2.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { kind: "component", type: ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "component", type: ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "pipe", type: LocalizationPipe, name: "abpLocalization" }] }); }
|
|
2247
2261
|
}
|
|
2248
2262
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: RolesModalComponent, decorators: [{
|
|
2249
2263
|
type: Component,
|
|
@@ -2255,7 +2269,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImpor
|
|
|
2255
2269
|
ExtensibleFormComponent,
|
|
2256
2270
|
ModalComponent,
|
|
2257
2271
|
ButtonComponent,
|
|
2258
|
-
], template: "<abp-modal [visible]=\"true\" (visibleChange)=\"onVisibleChange($event)\">\
|
|
2272
|
+
], template: "<abp-modal [visible]=\"true\" [busy]=\"modalBusy\" (visibleChange)=\"onVisibleChange($event)\">\n <ng-template #abpHeader>\r\n <h3>\r\n @if (!selected()?.id) {\r\n {{ 'AbpIdentity::NewRole' | abpLocalization }}\r\n } @else {\r\n {{ 'AbpUi::Edit' | abpLocalization }}\r\n @if (selected().name; as roleName) {\r\n - {{ roleName }}\r\n }\r\n }\r\n </h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n @if (form) {\r\n <form id=\"roleForm\" [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form class=\"row gap-x2\" [selectedRecord]=\"selected()\" />\r\n </form>\r\n }\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-outline-primary\" abpClose>\r\n {{ 'AbpUi::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button\n iconClass=\"fa fa-check\"\n buttonType=\"submit\"\n formName=\"roleForm\"\n [disabled]=\"modalBusy\"\n >\n {{ 'AbpUi::Save' | abpLocalization }}\n </abp-button>\n </ng-template>\n</abp-modal>\n" }]
|
|
2259
2273
|
}], propDecorators: { selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], visibleChange: [{ type: i0.Output, args: ["visibleChange"] }] } });
|
|
2260
2274
|
|
|
2261
2275
|
class RolesComponent {
|