@volo/abp.ng.identity 7.2.0-rc.1 → 7.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.
- package/config/components/authority-delegation/authority-delegation.component.d.ts +14 -0
- package/config/components/authority-delegation/authority-delegation.module.d.ts +15 -0
- package/config/components/authority-delegation/create-user-delegate.component.d.ts +17 -0
- package/config/components/authority-delegation/index.d.ts +5 -0
- package/config/components/authority-delegation/list-authority-delegation.component.d.ts +28 -0
- package/config/components/authority-delegation/my-delegated-users.component.d.ts +24 -0
- package/config/components/index.d.ts +1 -0
- package/config/identity-config.module.d.ts +2 -1
- package/config/models/delegate-authority.d.ts +1 -0
- package/config/services/authority-delegation.service.d.ts +20 -0
- package/config/services/index.d.ts +1 -0
- package/config/utils/factories.d.ts +1 -0
- package/esm2020/config/components/authority-delegation/authority-delegation.component.mjs +32 -0
- package/esm2020/config/components/authority-delegation/authority-delegation.module.mjs +54 -0
- package/esm2020/config/components/authority-delegation/create-user-delegate.component.mjs +55 -0
- package/esm2020/config/components/authority-delegation/index.mjs +6 -0
- package/esm2020/config/components/authority-delegation/list-authority-delegation.component.mjs +78 -0
- package/esm2020/config/components/authority-delegation/my-delegated-users.component.mjs +62 -0
- package/esm2020/config/components/index.mjs +2 -1
- package/esm2020/config/components/my-link-users-modal.component.mjs +1 -1
- package/esm2020/config/identity-config.module.mjs +29 -6
- package/esm2020/config/models/delegate-authority.mjs +2 -0
- package/esm2020/config/services/authority-delegation.service.mjs +61 -0
- package/esm2020/config/services/index.mjs +2 -1
- package/esm2020/config/utils/factories.mjs +14 -2
- package/esm2020/lib/components/users/users.component.mjs +26 -19
- package/fesm2015/volo-abp.ng.identity-config.mjs +333 -13
- package/fesm2015/volo-abp.ng.identity-config.mjs.map +1 -1
- package/fesm2015/volo-abp.ng.identity.mjs +36 -29
- package/fesm2015/volo-abp.ng.identity.mjs.map +1 -1
- package/fesm2020/volo-abp.ng.identity-config.mjs +333 -13
- package/fesm2020/volo-abp.ng.identity-config.mjs.map +1 -1
- package/fesm2020/volo-abp.ng.identity.mjs +35 -28
- package/fesm2020/volo-abp.ng.identity.mjs.map +1 -1
- package/lib/components/users/users.component.d.ts +9 -4
- package/package.json +7 -7
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import * as i3 from '@abp/ng.core';
|
|
2
|
-
import { SubscriptionService, ListService, ConfigStateService, AuthService, EnvironmentService, RoutesService, ContentProjectionService, PROJECTION_STRATEGY, noop
|
|
2
|
+
import { SubscriptionService, ListService, ConfigStateService, AuthService, EnvironmentService, PIPE_TO_LOGIN_FN_KEY, CoreModule, RoutesService, ContentProjectionService, PROJECTION_STRATEGY, noop } from '@abp/ng.core';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable, Component,
|
|
4
|
+
import { Injectable, Component, inject, Injector, EventEmitter, Output, NgModule, APP_INITIALIZER } from '@angular/core';
|
|
5
5
|
import { filter, finalize, map, switchMap, catchError, tap } from 'rxjs/operators';
|
|
6
6
|
import * as i2$1 from '@angular/common';
|
|
7
7
|
import * as i3$2 from '@ng-bootstrap/ng-bootstrap';
|
|
8
|
-
import { NgbDropdownModule, NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
|
|
8
|
+
import { NgbDateAdapter, NgbDropdownModule, NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
|
|
9
9
|
import * as i3$1 from '@angular/forms';
|
|
10
|
-
import { Validators } from '@angular/forms';
|
|
10
|
+
import { Validators, FormBuilder } from '@angular/forms';
|
|
11
11
|
import * as i2 from '@abp/ng.theme.shared';
|
|
12
12
|
import { ConfirmationService, Confirmation, ThemeSharedModule } from '@abp/ng.theme.shared';
|
|
13
13
|
import * as i6 from '@ngx-validate/core';
|
|
14
14
|
import { NgxValidateCoreModule } from '@ngx-validate/core';
|
|
15
15
|
import * as i1 from '@volo/abp.ng.identity/proxy';
|
|
16
|
-
import { IdentityLinkUserService } from '@volo/abp.ng.account/public/proxy';
|
|
17
|
-
import { from, of, pipe } from 'rxjs';
|
|
16
|
+
import { IdentityLinkUserService, IdentityUserDelegationService } from '@volo/abp.ng.account/public/proxy';
|
|
17
|
+
import { from, of, pipe, switchMap as switchMap$1 } from 'rxjs';
|
|
18
18
|
import * as i1$1 from '@angular/router';
|
|
19
|
-
import * as
|
|
20
|
-
import {
|
|
19
|
+
import * as i2$2 from '@swimlane/ngx-datatable';
|
|
20
|
+
import { DateTimeAdapter } from '@abp/ng.theme.shared/extensions';
|
|
21
|
+
import * as i5 from '@volo/abp.commercial.ng.ui';
|
|
22
|
+
import { CommercialUiModule } from '@volo/abp.commercial.ng.ui';
|
|
23
|
+
import { OPEN_MY_LINK_USERS_MODAL, OPEN_AUTHORITY_DELEGATION_MODAL } from '@volo/abp.commercial.ng.ui/config';
|
|
21
24
|
import { SettingTabsService } from '@abp/ng.setting-management/config';
|
|
22
25
|
|
|
23
26
|
class IdentityConfigService {
|
|
@@ -425,12 +428,296 @@ class MyLinkUsersModalComponent {
|
|
|
425
428
|
}
|
|
426
429
|
}
|
|
427
430
|
MyLinkUsersModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: MyLinkUsersModalComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
428
|
-
MyLinkUsersModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.1", type: MyLinkUsersModalComponent, selector: "abp-my-link-users-modal", providers: [ListService], ngImport: i0, template: "<abp-modal [(visible)]=\"isModalOpen\" [suppressUnsavedChangesWarning]=\"true\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::LinkedAccounts' | abpLocalization }}</h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <div class=\"text-end mb-3\">\r\n <button\r\n id=\"create-link-user\"\r\n class=\"btn btn-primary\"\r\n type=\"button\"\r\n (click)=\"createNewLinkUser()\"\r\n >\r\n {{ 'AbpAccount::NewLinkAccount' | abpLocalization }}\r\n </button>\r\n\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"MyLinkUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n <div class=\"mt-2\">\r\n <ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"150\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <div ngbDropdown container=\"body\" class=\"d-inline-block\">\r\n <button\r\n class=\"btn btn-primary btn-sm dropdown-toggle\"\r\n data-toggle=\"dropdown\"\r\n aria-haspopup=\"true\"\r\n ngbDropdownToggle\r\n >\r\n <i class=\"fa fa-cog me-1\" aria-hidden=\"true\"></i>{{ 'AbpUi::Actions' | abpLocalization }}\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem (click)=\"LoginAsThisAccount(row)\">\r\n {{ 'AbpAccount::LoginAsThisAccount' | abpLocalization }}\r\n </button>\r\n <button *ngIf=\"row.directlyLinked\" ngbDropdownItem (click)=\"delete(row)\">\r\n {{ 'AbpUi::Delete' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'AbpAccount::UserName' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <a href=\"javascript:void(0)\" class=\"text-body\" (click)=\"LoginAsThisAccount(row)\">\r\n {{ row.targetTenantName ? row.targetTenantName + '\\\\' : ''\r\n }}{{ row.targetUserName }}\r\n </a>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'AbpAccount::DirectlyLinked' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <i class=\"fas fa-{{ row.directlyLinked ? 'check' : 'times' }}\" aria-hidden=\"true\"></i>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n </ngx-datatable>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</abp-modal>\r\n", dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.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: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type:
|
|
431
|
+
MyLinkUsersModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.1", type: MyLinkUsersModalComponent, selector: "abp-my-link-users-modal", providers: [ListService], ngImport: i0, template: "<abp-modal [(visible)]=\"isModalOpen\" [suppressUnsavedChangesWarning]=\"true\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::LinkedAccounts' | abpLocalization }}</h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <div class=\"text-end mb-3\">\r\n <button\r\n id=\"create-link-user\"\r\n class=\"btn btn-primary\"\r\n type=\"button\"\r\n (click)=\"createNewLinkUser()\"\r\n >\r\n {{ 'AbpAccount::NewLinkAccount' | abpLocalization }}\r\n </button>\r\n\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"MyLinkUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n <div class=\"mt-2\">\r\n <ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"150\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <div ngbDropdown container=\"body\" class=\"d-inline-block\">\r\n <button\r\n class=\"btn btn-primary btn-sm dropdown-toggle\"\r\n data-toggle=\"dropdown\"\r\n aria-haspopup=\"true\"\r\n ngbDropdownToggle\r\n >\r\n <i class=\"fa fa-cog me-1\" aria-hidden=\"true\"></i>{{ 'AbpUi::Actions' | abpLocalization }}\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem (click)=\"LoginAsThisAccount(row)\">\r\n {{ 'AbpAccount::LoginAsThisAccount' | abpLocalization }}\r\n </button>\r\n <button *ngIf=\"row.directlyLinked\" ngbDropdownItem (click)=\"delete(row)\">\r\n {{ 'AbpUi::Delete' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'AbpAccount::UserName' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <a href=\"javascript:void(0)\" class=\"text-body\" (click)=\"LoginAsThisAccount(row)\">\r\n {{ row.targetTenantName ? row.targetTenantName + '\\\\' : ''\r\n }}{{ row.targetUserName }}\r\n </a>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'AbpAccount::DirectlyLinked' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <i class=\"fas fa-{{ row.directlyLinked ? 'check' : 'times' }}\" aria-hidden=\"true\"></i>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n </ngx-datatable>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</abp-modal>\r\n", dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.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: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$2.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i2$2.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i2$2.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "component", type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2.NgxDatatableDefaultDirective, selector: "ngx-datatable[default]", inputs: ["class"], exportAs: ["ngxDatatableDefault"] }, { kind: "directive", type: i2.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "directive", type: i3$2.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i3$2.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i3$2.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i3$2.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["disabled"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] });
|
|
429
432
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: MyLinkUsersModalComponent, decorators: [{
|
|
430
433
|
type: Component,
|
|
431
434
|
args: [{ selector: 'abp-my-link-users-modal', providers: [ListService], template: "<abp-modal [(visible)]=\"isModalOpen\" [suppressUnsavedChangesWarning]=\"true\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::LinkedAccounts' | abpLocalization }}</h5>\r\n </ng-template>\r\n <ng-template #abpBody>\r\n <div class=\"text-end mb-3\">\r\n <button\r\n id=\"create-link-user\"\r\n class=\"btn btn-primary\"\r\n type=\"button\"\r\n (click)=\"createNewLinkUser()\"\r\n >\r\n {{ 'AbpAccount::NewLinkAccount' | abpLocalization }}\r\n </button>\r\n\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"MyLinkUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n <div class=\"mt-2\">\r\n <ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"150\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <div ngbDropdown container=\"body\" class=\"d-inline-block\">\r\n <button\r\n class=\"btn btn-primary btn-sm dropdown-toggle\"\r\n data-toggle=\"dropdown\"\r\n aria-haspopup=\"true\"\r\n ngbDropdownToggle\r\n >\r\n <i class=\"fa fa-cog me-1\" aria-hidden=\"true\"></i>{{ 'AbpUi::Actions' | abpLocalization }}\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem (click)=\"LoginAsThisAccount(row)\">\r\n {{ 'AbpAccount::LoginAsThisAccount' | abpLocalization }}\r\n </button>\r\n <button *ngIf=\"row.directlyLinked\" ngbDropdownItem (click)=\"delete(row)\">\r\n {{ 'AbpUi::Delete' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'AbpAccount::UserName' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <a href=\"javascript:void(0)\" class=\"text-body\" (click)=\"LoginAsThisAccount(row)\">\r\n {{ row.targetTenantName ? row.targetTenantName + '\\\\' : ''\r\n }}{{ row.targetUserName }}\r\n </a>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'AbpAccount::DirectlyLinked' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <i class=\"fas fa-{{ row.directlyLinked ? 'check' : 'times' }}\" aria-hidden=\"true\"></i>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n </ngx-datatable>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
432
435
|
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
433
436
|
|
|
437
|
+
class AbpAuthorityDelegationService {
|
|
438
|
+
constructor() {
|
|
439
|
+
this.service = inject(IdentityUserDelegationService);
|
|
440
|
+
this.authService = inject(AuthService);
|
|
441
|
+
this.pipeToLogin = inject(PIPE_TO_LOGIN_FN_KEY);
|
|
442
|
+
this.injector = inject(Injector);
|
|
443
|
+
this.grantType = 'Impersonation';
|
|
444
|
+
}
|
|
445
|
+
isVisible() {
|
|
446
|
+
return this.authService.isAuthenticated;
|
|
447
|
+
}
|
|
448
|
+
getUsers() {
|
|
449
|
+
return this.service.getActiveDelegations();
|
|
450
|
+
}
|
|
451
|
+
delegatedImpersonate(userDelegationId) {
|
|
452
|
+
const promise = this.authService.loginUsingGrant(this.grantType, {
|
|
453
|
+
UserDelegationId: userDelegationId,
|
|
454
|
+
});
|
|
455
|
+
return from(promise).pipe(this.pipeToLogin && this.pipeToLogin({}, this.injector));
|
|
456
|
+
}
|
|
457
|
+
getStatus(row) {
|
|
458
|
+
const { startTime, endTime } = row;
|
|
459
|
+
const curr = new Date().getTime();
|
|
460
|
+
const beg = new Date(startTime).getTime();
|
|
461
|
+
const end = new Date(endTime).getTime();
|
|
462
|
+
if (beg > curr) {
|
|
463
|
+
return 'Future';
|
|
464
|
+
}
|
|
465
|
+
else if (curr > end) {
|
|
466
|
+
return 'Expired';
|
|
467
|
+
}
|
|
468
|
+
else if (beg < curr && curr < end) {
|
|
469
|
+
return 'Active';
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
statusClass(row) {
|
|
473
|
+
const status = this.getStatus(row);
|
|
474
|
+
switch (status) {
|
|
475
|
+
case 'Active':
|
|
476
|
+
return 'success';
|
|
477
|
+
case 'Expired':
|
|
478
|
+
return 'danger';
|
|
479
|
+
case 'Future':
|
|
480
|
+
return 'warning';
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
AbpAuthorityDelegationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: AbpAuthorityDelegationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
485
|
+
AbpAuthorityDelegationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: AbpAuthorityDelegationService, providedIn: 'root' });
|
|
486
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: AbpAuthorityDelegationService, decorators: [{
|
|
487
|
+
type: Injectable,
|
|
488
|
+
args: [{
|
|
489
|
+
providedIn: 'root',
|
|
490
|
+
}]
|
|
491
|
+
}] });
|
|
492
|
+
|
|
493
|
+
class CreateUserDelegateComponent {
|
|
494
|
+
constructor() {
|
|
495
|
+
this.identityUserDelegationService = inject(IdentityUserDelegationService);
|
|
496
|
+
this.fb = inject(FormBuilder);
|
|
497
|
+
this.form = this.fb.group({
|
|
498
|
+
userNameId: ['', [Validators.required]],
|
|
499
|
+
times: {
|
|
500
|
+
startTime: ['', []],
|
|
501
|
+
endTime: ['', []],
|
|
502
|
+
},
|
|
503
|
+
});
|
|
504
|
+
this.save = new EventEmitter();
|
|
505
|
+
this.getFn = (input) => {
|
|
506
|
+
return this.identityUserDelegationService.getUserLookup(input).pipe(map((usersLookup) => {
|
|
507
|
+
return {
|
|
508
|
+
items: usersLookup.items,
|
|
509
|
+
totalCount: usersLookup.items.length,
|
|
510
|
+
};
|
|
511
|
+
}));
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
ngSubmit() {
|
|
515
|
+
if (this.form.invalid) {
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
const { userNameId, times } = this.form.value;
|
|
519
|
+
const newUser = {
|
|
520
|
+
targetUserId: userNameId,
|
|
521
|
+
startTime: times.startTime,
|
|
522
|
+
endTime: times.endTime,
|
|
523
|
+
};
|
|
524
|
+
this.identityUserDelegationService.delegateNewUser(newUser).subscribe(() => this.save.emit());
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
CreateUserDelegateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: CreateUserDelegateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
528
|
+
CreateUserDelegateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.1", type: CreateUserDelegateComponent, selector: "abp-create-user-delegate", outputs: { save: "save" }, providers: [{ provide: NgbDateAdapter, useClass: DateTimeAdapter }], ngImport: i0, template: "<form (ngSubmit)=\"ngSubmit()\" [formGroup]=\"form\" id=\"DelegateNewUser\" name=\"DelegateNewUser\">\r\n <div class=\"mb-3\">\r\n <label for=\"delegate-new-user-id\">{{ 'AbpAccount::UserName' | abpLocalization }}</label>\r\n <abp-lookup-typeahead\r\n cid=\"delegate-new-user-id\"\r\n displayNameProp=\"userName\"\r\n lookupNameProp=\"userName\"\r\n formControlName=\"userNameId\"\r\n [getFn]=\"getFn\"\r\n ></abp-lookup-typeahead>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label> {{ 'AbpAccount::DelegationDateRange' | abpLocalization }} </label>\r\n <abp-date-range-picker startDateProp=\"startTime\" endDateProp=\"endTime\" formControlName=\"times\">\r\n </abp-date-range-picker>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end align-items-center mb-2 gap-2\">\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpAccount::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" buttonType=\"submit\" formName=\"DelegateNewUser\">\r\n {{ 'AbpAccount::Save' | abpLocalization }}\r\n </abp-button>\r\n </div>\r\n</form>\r\n", dependencies: [{ kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i6.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i6.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "directive", type: i2.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i5.LookupTypeaheadComponent, selector: "abp-lookup-typeahead", inputs: ["displayNameProp", "lookupFilterProp", "filter", "editingData"] }, { kind: "component", type: i5.DateRangePickerComponent, selector: "abp-date-range-picker", inputs: ["startDateProp", "endDateProp", "labelText"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] });
|
|
529
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: CreateUserDelegateComponent, decorators: [{
|
|
530
|
+
type: Component,
|
|
531
|
+
args: [{ selector: 'abp-create-user-delegate', providers: [{ provide: NgbDateAdapter, useClass: DateTimeAdapter }], template: "<form (ngSubmit)=\"ngSubmit()\" [formGroup]=\"form\" id=\"DelegateNewUser\" name=\"DelegateNewUser\">\r\n <div class=\"mb-3\">\r\n <label for=\"delegate-new-user-id\">{{ 'AbpAccount::UserName' | abpLocalization }}</label>\r\n <abp-lookup-typeahead\r\n cid=\"delegate-new-user-id\"\r\n displayNameProp=\"userName\"\r\n lookupNameProp=\"userName\"\r\n formControlName=\"userNameId\"\r\n [getFn]=\"getFn\"\r\n ></abp-lookup-typeahead>\r\n </div>\r\n <div class=\"mb-3\">\r\n <label> {{ 'AbpAccount::DelegationDateRange' | abpLocalization }} </label>\r\n <abp-date-range-picker startDateProp=\"startTime\" endDateProp=\"endTime\" formControlName=\"times\">\r\n </abp-date-range-picker>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end align-items-center mb-2 gap-2\">\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpAccount::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" buttonType=\"submit\" formName=\"DelegateNewUser\">\r\n {{ 'AbpAccount::Save' | abpLocalization }}\r\n </abp-button>\r\n </div>\r\n</form>\r\n" }]
|
|
532
|
+
}], propDecorators: { save: [{
|
|
533
|
+
type: Output
|
|
534
|
+
}] } });
|
|
535
|
+
|
|
536
|
+
class ListAuthorityDelegationComponent {
|
|
537
|
+
constructor() {
|
|
538
|
+
this.identityUserDelegationService = inject(IdentityUserDelegationService);
|
|
539
|
+
this.confirmation = inject(ConfirmationService);
|
|
540
|
+
this.service = inject(AbpAuthorityDelegationService);
|
|
541
|
+
this.list = inject(ListService);
|
|
542
|
+
this.filterText = '';
|
|
543
|
+
this.isNewUserDelegateModalOpen = false;
|
|
544
|
+
}
|
|
545
|
+
get pageStartIndex() {
|
|
546
|
+
return this.list.page * this.list.maxResultCount;
|
|
547
|
+
}
|
|
548
|
+
get pageEndIndex() {
|
|
549
|
+
return this.pageStartIndex + this.list.maxResultCount;
|
|
550
|
+
}
|
|
551
|
+
ngOnInit() {
|
|
552
|
+
this.list.maxResultCount = 5;
|
|
553
|
+
this.getAllList();
|
|
554
|
+
}
|
|
555
|
+
filterByText() {
|
|
556
|
+
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
557
|
+
}
|
|
558
|
+
getFilteredData() {
|
|
559
|
+
const list = this.data.filter(user => user.userName.toLowerCase().includes(this.filterText.toLowerCase()));
|
|
560
|
+
this.resultCount = list.length;
|
|
561
|
+
return list;
|
|
562
|
+
}
|
|
563
|
+
getPageData(start, end) {
|
|
564
|
+
return this.getFilteredData().slice(start, end);
|
|
565
|
+
}
|
|
566
|
+
getAllList() {
|
|
567
|
+
this.identityUserDelegationService.getDelegatedUsers().subscribe(res => {
|
|
568
|
+
this.data = res.items;
|
|
569
|
+
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
570
|
+
});
|
|
571
|
+
this.list
|
|
572
|
+
.hookToQuery(query => of({ items: this.getPageData(query.skipCount, query.skipCount + query.maxResultCount) }))
|
|
573
|
+
.subscribe(res => (this.filteredData = res.items));
|
|
574
|
+
}
|
|
575
|
+
create() {
|
|
576
|
+
this.isNewUserDelegateModalOpen = true;
|
|
577
|
+
}
|
|
578
|
+
refreshData() {
|
|
579
|
+
this.getAllList();
|
|
580
|
+
this.isNewUserDelegateModalOpen = false;
|
|
581
|
+
}
|
|
582
|
+
delete(row) {
|
|
583
|
+
const id = row.id;
|
|
584
|
+
this.confirmation
|
|
585
|
+
.warn(`AbpAccount::DeleteUserDelegationConfirmationMessage`, 'AbpAccount::AreYouSure', {
|
|
586
|
+
messageLocalizationParams: [row.userName],
|
|
587
|
+
})
|
|
588
|
+
.pipe(filter(res => res === Confirmation.Status.confirm), switchMap$1(() => this.identityUserDelegationService.deleteDelegation(id)))
|
|
589
|
+
.subscribe(() => {
|
|
590
|
+
this.refreshData();
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
ListAuthorityDelegationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: ListAuthorityDelegationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
595
|
+
ListAuthorityDelegationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.1", type: ListAuthorityDelegationComponent, selector: "abp-list-authority-delegation", providers: [ListService], ngImport: i0, template: "<div class=\"text-end mb-2\">\r\n <button id=\"create-delegate-user\" class=\"btn btn-primary\" type=\"button\" (click)=\"create()\">\r\n {{ 'AbpAccount::DelegateNewUser' | abpLocalization }}\r\n </button>\r\n\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"DelegatedUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n</div>\r\n\r\n<ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"100\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <button class=\"btn btn-danger btn-sm\" (click)=\"delete(row)\">\r\n {{ 'AbpAccount::Delete' | abpLocalization }}\r\n </button>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpUi::Status' | abpLocalization\" [maxWidth]=\"125\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <span class=\"badge bg-{{ service.statusClass(row) }}\">\r\n {{ 'AbpAccount::Status' + service.getStatus(row) | abpLocalization }}\r\n </span>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column\r\n [sortable]=\"true\"\r\n [name]=\"'AbpAccount::UserName' | abpLocalization\"\r\n prop=\"userName\"\r\n >\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::StartTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.startTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::EndTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.endTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n</ngx-datatable>\r\n\r\n<abp-modal [(visible)]=\"isNewUserDelegateModalOpen\" [suppressUnsavedChangesWarning]=\"true\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::DelegateNewUser' | abpLocalization }}</h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <abp-create-user-delegate (save)=\"refreshData()\"> </abp-create-user-delegate>\r\n </ng-template>\r\n</abp-modal>\r\n", dependencies: [{ kind: "directive", type: i3$1.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: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$2.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i2$2.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i2$2.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "component", type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i2.NgxDatatableDefaultDirective, selector: "ngx-datatable[default]", inputs: ["class"], exportAs: ["ngxDatatableDefault"] }, { kind: "directive", type: i2.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "component", type: CreateUserDelegateComponent, selector: "abp-create-user-delegate", outputs: ["save"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }, { kind: "pipe", type: i3.ShortDateTimePipe, name: "shortDateTime" }] });
|
|
596
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: ListAuthorityDelegationComponent, decorators: [{
|
|
597
|
+
type: Component,
|
|
598
|
+
args: [{ selector: 'abp-list-authority-delegation', providers: [ListService], template: "<div class=\"text-end mb-2\">\r\n <button id=\"create-delegate-user\" class=\"btn btn-primary\" type=\"button\" (click)=\"create()\">\r\n {{ 'AbpAccount::DelegateNewUser' | abpLocalization }}\r\n </button>\r\n\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"DelegatedUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n</div>\r\n\r\n<ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"100\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <button class=\"btn btn-danger btn-sm\" (click)=\"delete(row)\">\r\n {{ 'AbpAccount::Delete' | abpLocalization }}\r\n </button>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpUi::Status' | abpLocalization\" [maxWidth]=\"125\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <span class=\"badge bg-{{ service.statusClass(row) }}\">\r\n {{ 'AbpAccount::Status' + service.getStatus(row) | abpLocalization }}\r\n </span>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column\r\n [sortable]=\"true\"\r\n [name]=\"'AbpAccount::UserName' | abpLocalization\"\r\n prop=\"userName\"\r\n >\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::StartTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.startTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::EndTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.endTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n</ngx-datatable>\r\n\r\n<abp-modal [(visible)]=\"isNewUserDelegateModalOpen\" [suppressUnsavedChangesWarning]=\"true\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::DelegateNewUser' | abpLocalization }}</h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <abp-create-user-delegate (save)=\"refreshData()\"> </abp-create-user-delegate>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
599
|
+
}] });
|
|
600
|
+
|
|
601
|
+
class MyDelegatedUsersComponent {
|
|
602
|
+
constructor() {
|
|
603
|
+
this.subscription = inject(SubscriptionService);
|
|
604
|
+
this.identityUserDelegationService = inject(IdentityUserDelegationService);
|
|
605
|
+
this.service = inject(AbpAuthorityDelegationService);
|
|
606
|
+
this.list = inject(ListService);
|
|
607
|
+
this.filterText = '';
|
|
608
|
+
}
|
|
609
|
+
get pageStartIndex() {
|
|
610
|
+
return this.list.page * this.list.maxResultCount;
|
|
611
|
+
}
|
|
612
|
+
get pageEndIndex() {
|
|
613
|
+
return this.pageStartIndex + this.list.maxResultCount;
|
|
614
|
+
}
|
|
615
|
+
filterByText() {
|
|
616
|
+
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
617
|
+
}
|
|
618
|
+
getFilteredData() {
|
|
619
|
+
const list = this.data.filter(user => user.userName.toLowerCase().includes(this.filterText.toLowerCase()));
|
|
620
|
+
this.resultCount = list.length;
|
|
621
|
+
return list;
|
|
622
|
+
}
|
|
623
|
+
getPageData(start, end) {
|
|
624
|
+
return this.getFilteredData().slice(start, end);
|
|
625
|
+
}
|
|
626
|
+
getAllList() {
|
|
627
|
+
this.identityUserDelegationService.getMyDelegatedUsers().subscribe(res => {
|
|
628
|
+
this.data = res.items;
|
|
629
|
+
this.filteredData = this.getPageData(this.pageStartIndex, this.pageEndIndex);
|
|
630
|
+
});
|
|
631
|
+
this.list
|
|
632
|
+
.hookToQuery(query => of({ items: this.getPageData(query.skipCount, query.skipCount + query.maxResultCount) }))
|
|
633
|
+
.subscribe(res => (this.filteredData = res.items));
|
|
634
|
+
}
|
|
635
|
+
ngOnInit() {
|
|
636
|
+
this.list.maxResultCount = 5;
|
|
637
|
+
this.getAllList();
|
|
638
|
+
}
|
|
639
|
+
login(row) {
|
|
640
|
+
const result$ = this.service.delegatedImpersonate(row.id);
|
|
641
|
+
this.subscription.addOne(result$, () => {
|
|
642
|
+
this.service.modalRef.instance.isModalOpen = false;
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
MyDelegatedUsersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: MyDelegatedUsersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
647
|
+
MyDelegatedUsersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.1", type: MyDelegatedUsersComponent, selector: "abp-my-delegated-users", providers: [ListService], ngImport: i0, template: "<div class=\"text-end mb-3\">\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"DelegatedUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n</div>\r\n\r\n<ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"100\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <button\r\n type=\"button\"\r\n class=\"btn btn-primary btn-sm\"\r\n [class.disabled]=\"service.getStatus(row) !== 'Active'\"\r\n (click)=\"login(row)\"\r\n >\r\n <span>{{ 'AbpAccount::Login' | abpLocalization }}</span>\r\n </button>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpUi::Status' | abpLocalization\" [maxWidth]=\"125\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <span class=\"badge bg-{{ service.statusClass(row) }}\">\r\n {{ 'AbpAccount::Status' + service.getStatus(row) | abpLocalization }}\r\n </span>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column\r\n [sortable]=\"true\"\r\n [name]=\"'AbpAccount::UserName' | abpLocalization\"\r\n prop=\"userName\"\r\n >\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::StartTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.startTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::EndTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.endTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n</ngx-datatable>\r\n", dependencies: [{ kind: "directive", type: i3$1.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: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$2.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i2$2.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i2$2.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "directive", type: i2.NgxDatatableDefaultDirective, selector: "ngx-datatable[default]", inputs: ["class"], exportAs: ["ngxDatatableDefault"] }, { kind: "directive", type: i2.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }, { kind: "pipe", type: i3.ShortDateTimePipe, name: "shortDateTime" }] });
|
|
648
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: MyDelegatedUsersComponent, decorators: [{
|
|
649
|
+
type: Component,
|
|
650
|
+
args: [{ selector: 'abp-my-delegated-users', providers: [ListService], template: "<div class=\"text-end mb-3\">\r\n <div class=\"mt-2\">\r\n <label class=\"form-label d-inline-block\">\r\n {{ 'AbpAccount::Search' | abpLocalization }}\r\n <input\r\n type=\"search\"\r\n class=\"form-control form-control-sm d-inline-block w-auto\"\r\n [(ngModel)]=\"filterText\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"filterByText()\"\r\n aria-controls=\"DelegatedUsersTable\"\r\n />\r\n </label>\r\n </div>\r\n</div>\r\n\r\n<ngx-datatable [rows]=\"filteredData\" [count]=\"resultCount\" [list]=\"list\" default>\r\n <ngx-datatable-column\r\n [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [maxWidth]=\"100\"\r\n [sortable]=\"false\"\r\n >\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <button\r\n type=\"button\"\r\n class=\"btn btn-primary btn-sm\"\r\n [class.disabled]=\"service.getStatus(row) !== 'Active'\"\r\n (click)=\"login(row)\"\r\n >\r\n <span>{{ 'AbpAccount::Login' | abpLocalization }}</span>\r\n </button>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpUi::Status' | abpLocalization\" [maxWidth]=\"125\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n <span class=\"badge bg-{{ service.statusClass(row) }}\">\r\n {{ 'AbpAccount::Status' + service.getStatus(row) | abpLocalization }}\r\n </span>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column\r\n [sortable]=\"true\"\r\n [name]=\"'AbpAccount::UserName' | abpLocalization\"\r\n prop=\"userName\"\r\n >\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::StartTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.startTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n\r\n <ngx-datatable-column [name]=\"'AbpAccount::EndTime' | abpLocalization\">\r\n <ng-template let-row=\"row\" ngx-datatable-cell-template>\r\n {{ row.endTime | shortDateTime }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n</ngx-datatable>\r\n" }]
|
|
651
|
+
}] });
|
|
652
|
+
|
|
653
|
+
class AuthorityDelegationComponent {
|
|
654
|
+
constructor() {
|
|
655
|
+
this.isModalOpen = true;
|
|
656
|
+
this.option = { size: 'lg' };
|
|
657
|
+
this.tabs = [
|
|
658
|
+
{
|
|
659
|
+
name: 'AbpAccount::DelegatedUsers',
|
|
660
|
+
component: ListAuthorityDelegationComponent,
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
name: 'AbpAccount::MyDelegatedUsers',
|
|
664
|
+
component: MyDelegatedUsersComponent,
|
|
665
|
+
},
|
|
666
|
+
];
|
|
667
|
+
this.selected = this.tabs[0];
|
|
668
|
+
this.trackByFn = (_, item) => item.name;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
AuthorityDelegationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: AuthorityDelegationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
672
|
+
AuthorityDelegationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.1", type: AuthorityDelegationComponent, selector: "abp-authority-delegation", ngImport: i0, template: "<abp-modal [(visible)]=\"isModalOpen\" [suppressUnsavedChangesWarning]=\"true\" [options]=\"option\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::AuthorityDelegation' | abpLocalization }}</h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <ul class=\"nav nav-tabs mb-0\">\r\n <li *abpFor=\"let tab of tabs; trackBy: trackByFn\" class=\"nav-item\">\r\n <a\r\n [id]=\"tab.name + '-tab'\"\r\n role=\"tab\"\r\n class=\"nav-link pointer\"\r\n [class.active]=\"selected.name === tab.name\"\r\n (click)=\"selected = tab\"\r\n >\r\n {{ tab.name | abpLocalization }}\r\n </a>\r\n </li>\r\n </ul>\r\n\r\n <div class=\"tab-content\">\r\n <div class=\"tab-pane active\">\r\n <div class=\"card mb-0\">\r\n <ng-container *ngComponentOutlet=\"selected.component\"></ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</abp-modal>\r\n", dependencies: [{ kind: "directive", type: i2$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i3.ForDirective, selector: "[abpFor]", inputs: ["abpForOf", "abpForOrderBy", "abpForOrderDir", "abpForFilterBy", "abpForFilterVal", "abpForTrackBy", "abpForCompareBy", "abpForEmptyRef"] }, { kind: "component", type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] });
|
|
673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: AuthorityDelegationComponent, decorators: [{
|
|
674
|
+
type: Component,
|
|
675
|
+
args: [{ selector: 'abp-authority-delegation', template: "<abp-modal [(visible)]=\"isModalOpen\" [suppressUnsavedChangesWarning]=\"true\" [options]=\"option\">\r\n <ng-template #abpHeader>\r\n <h5 class=\"modal-title\">{{ 'AbpAccount::AuthorityDelegation' | abpLocalization }}</h5>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <ul class=\"nav nav-tabs mb-0\">\r\n <li *abpFor=\"let tab of tabs; trackBy: trackByFn\" class=\"nav-item\">\r\n <a\r\n [id]=\"tab.name + '-tab'\"\r\n role=\"tab\"\r\n class=\"nav-link pointer\"\r\n [class.active]=\"selected.name === tab.name\"\r\n (click)=\"selected = tab\"\r\n >\r\n {{ tab.name | abpLocalization }}\r\n </a>\r\n </li>\r\n </ul>\r\n\r\n <div class=\"tab-content\">\r\n <div class=\"tab-pane active\">\r\n <div class=\"card mb-0\">\r\n <ng-container *ngComponentOutlet=\"selected.component\"></ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
|
|
676
|
+
}] });
|
|
677
|
+
|
|
678
|
+
const declarationsWithExports$1 = [
|
|
679
|
+
AuthorityDelegationComponent,
|
|
680
|
+
ListAuthorityDelegationComponent,
|
|
681
|
+
MyDelegatedUsersComponent,
|
|
682
|
+
CreateUserDelegateComponent,
|
|
683
|
+
];
|
|
684
|
+
class AuthorityDelegationModule {
|
|
685
|
+
}
|
|
686
|
+
AuthorityDelegationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: AuthorityDelegationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
687
|
+
AuthorityDelegationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.1", ngImport: i0, type: AuthorityDelegationModule, declarations: [AuthorityDelegationComponent,
|
|
688
|
+
ListAuthorityDelegationComponent,
|
|
689
|
+
MyDelegatedUsersComponent,
|
|
690
|
+
CreateUserDelegateComponent], imports: [CoreModule,
|
|
691
|
+
ThemeSharedModule,
|
|
692
|
+
NgbDropdownModule,
|
|
693
|
+
NgbNavModule,
|
|
694
|
+
NgxValidateCoreModule,
|
|
695
|
+
CommercialUiModule], exports: [AuthorityDelegationComponent,
|
|
696
|
+
ListAuthorityDelegationComponent,
|
|
697
|
+
MyDelegatedUsersComponent,
|
|
698
|
+
CreateUserDelegateComponent] });
|
|
699
|
+
AuthorityDelegationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: AuthorityDelegationModule, imports: [CoreModule,
|
|
700
|
+
ThemeSharedModule,
|
|
701
|
+
NgbDropdownModule,
|
|
702
|
+
NgbNavModule,
|
|
703
|
+
NgxValidateCoreModule,
|
|
704
|
+
CommercialUiModule] });
|
|
705
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: AuthorityDelegationModule, decorators: [{
|
|
706
|
+
type: NgModule,
|
|
707
|
+
args: [{
|
|
708
|
+
declarations: [...declarationsWithExports$1],
|
|
709
|
+
exports: [...declarationsWithExports$1],
|
|
710
|
+
imports: [
|
|
711
|
+
CoreModule,
|
|
712
|
+
ThemeSharedModule,
|
|
713
|
+
NgbDropdownModule,
|
|
714
|
+
NgbNavModule,
|
|
715
|
+
NgxValidateCoreModule,
|
|
716
|
+
CommercialUiModule,
|
|
717
|
+
],
|
|
718
|
+
}]
|
|
719
|
+
}] });
|
|
720
|
+
|
|
434
721
|
const IDENTITY_ROUTE_PROVIDERS = [
|
|
435
722
|
{ provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [RoutesService], multi: true },
|
|
436
723
|
];
|
|
@@ -516,6 +803,17 @@ function openMyLinkUsersFactory(injector) {
|
|
|
516
803
|
}
|
|
517
804
|
componentRef = contentProjectionService.projectContent(PROJECTION_STRATEGY.AppendComponentToBody(MyLinkUsersModalComponent));
|
|
518
805
|
};
|
|
806
|
+
}
|
|
807
|
+
function openAuthorityDelegationFactory(injector) {
|
|
808
|
+
const contentProjectionService = injector.get(ContentProjectionService);
|
|
809
|
+
const delegationService = injector.get(AbpAuthorityDelegationService);
|
|
810
|
+
return () => {
|
|
811
|
+
if (delegationService.modalRef) {
|
|
812
|
+
delegationService.modalRef.instance.isModalOpen = true;
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
delegationService.modalRef = contentProjectionService.projectContent(PROJECTION_STRATEGY.AppendComponentToBody(AuthorityDelegationComponent));
|
|
816
|
+
};
|
|
519
817
|
}
|
|
520
818
|
|
|
521
819
|
const declarationsWithExports = [
|
|
@@ -533,6 +831,11 @@ class IdentityConfigModule {
|
|
|
533
831
|
IDENTITY_ROUTE_PROVIDERS,
|
|
534
832
|
IDENTITY_SETTING_TAB_PROVIDERS,
|
|
535
833
|
{ provide: OPEN_MY_LINK_USERS_MODAL, useFactory: openMyLinkUsersFactory, deps: [Injector] },
|
|
834
|
+
{
|
|
835
|
+
provide: OPEN_AUTHORITY_DELEGATION_MODAL,
|
|
836
|
+
useFactory: openAuthorityDelegationFactory,
|
|
837
|
+
deps: [Injector],
|
|
838
|
+
},
|
|
536
839
|
{ provide: APP_INITIALIZER, multi: true, useFactory: noop, deps: [LinkLoginHandler] },
|
|
537
840
|
],
|
|
538
841
|
};
|
|
@@ -543,16 +846,33 @@ IdentityConfigModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
|
|
|
543
846
|
IdentitySettingComponent,
|
|
544
847
|
IdentityExternalLoginSettingsComponent,
|
|
545
848
|
IdentityLdapSettingsComponent,
|
|
546
|
-
MyLinkUsersModalComponent], imports: [CoreModule,
|
|
849
|
+
MyLinkUsersModalComponent], imports: [CoreModule,
|
|
850
|
+
ThemeSharedModule,
|
|
851
|
+
NgbDropdownModule,
|
|
852
|
+
NgbNavModule,
|
|
853
|
+
NgxValidateCoreModule,
|
|
854
|
+
AuthorityDelegationModule], exports: [IdentitySettingsComponent,
|
|
547
855
|
IdentitySettingComponent,
|
|
548
856
|
IdentityExternalLoginSettingsComponent,
|
|
549
857
|
IdentityLdapSettingsComponent,
|
|
550
858
|
MyLinkUsersModalComponent] });
|
|
551
|
-
IdentityConfigModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: IdentityConfigModule, imports: [CoreModule,
|
|
859
|
+
IdentityConfigModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: IdentityConfigModule, imports: [CoreModule,
|
|
860
|
+
ThemeSharedModule,
|
|
861
|
+
NgbDropdownModule,
|
|
862
|
+
NgbNavModule,
|
|
863
|
+
NgxValidateCoreModule,
|
|
864
|
+
AuthorityDelegationModule] });
|
|
552
865
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.1", ngImport: i0, type: IdentityConfigModule, decorators: [{
|
|
553
866
|
type: NgModule,
|
|
554
867
|
args: [{
|
|
555
|
-
imports: [
|
|
868
|
+
imports: [
|
|
869
|
+
CoreModule,
|
|
870
|
+
ThemeSharedModule,
|
|
871
|
+
NgbDropdownModule,
|
|
872
|
+
NgbNavModule,
|
|
873
|
+
NgxValidateCoreModule,
|
|
874
|
+
AuthorityDelegationModule,
|
|
875
|
+
],
|
|
556
876
|
declarations: [...declarationsWithExports],
|
|
557
877
|
exports: [...declarationsWithExports],
|
|
558
878
|
}]
|
|
@@ -562,5 +882,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.1", ngImpor
|
|
|
562
882
|
* Generated bundle index. Do not edit.
|
|
563
883
|
*/
|
|
564
884
|
|
|
565
|
-
export { IDENTITY_ROUTE_PROVIDERS, IDENTITY_SETTING_TAB_PROVIDERS, IdentityConfigModule, IdentityConfigService, IdentityExternalLoginSettingsComponent, IdentityLdapSettingsComponent, IdentityLinkLoginService, IdentitySettingComponent, IdentitySettingsComponent, LinkLoginHandler, MyLinkUsersModalComponent, configureRoutes, configureSettingTabs };
|
|
885
|
+
export { AbpAuthorityDelegationService, AuthorityDelegationComponent, AuthorityDelegationModule, CreateUserDelegateComponent, IDENTITY_ROUTE_PROVIDERS, IDENTITY_SETTING_TAB_PROVIDERS, IdentityConfigModule, IdentityConfigService, IdentityExternalLoginSettingsComponent, IdentityLdapSettingsComponent, IdentityLinkLoginService, IdentitySettingComponent, IdentitySettingsComponent, LinkLoginHandler, ListAuthorityDelegationComponent, MyDelegatedUsersComponent, MyLinkUsersModalComponent, configureRoutes, configureSettingTabs };
|
|
566
886
|
//# sourceMappingURL=volo-abp.ng.identity-config.mjs.map
|