@indigina/ui-kit 1.1.551 → 1.1.553
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/fesm2022/indigina-ui-kit.mjs +813 -770
- package/fesm2022/indigina-ui-kit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/indigina-ui-kit.d.ts +88 -74
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i1$7 from '@angular/common';
|
|
2
|
-
import { NgClass, NgTemplateOutlet, CommonModule, DatePipe, AsyncPipe, DecimalPipe, Location, TitleCasePipe } from '@angular/common';
|
|
2
|
+
import { NgClass, NgTemplateOutlet, CommonModule, DatePipe, AsyncPipe, DecimalPipe, NgComponentOutlet, Location, TitleCasePipe } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { Input, ChangeDetectionStrategy, Component, input, EventEmitter, Output, ViewEncapsulation, InjectionToken, inject, Injectable, Directive, model, output, viewChild, contentChild, TemplateRef, computed, effect, ElementRef, NgZone, Renderer2, forwardRef, signal, HostListener, ContentChild, NgModule, RendererFactory2, ViewChild, DOCUMENT, ViewContainerRef, DestroyRef, afterNextRender, contentChildren, linkedSignal, ContentChildren, viewChildren, QueryList, ViewChildren, Pipe, Injector, runInInjectionContext } from '@angular/core';
|
|
5
5
|
import * as i1 from '@progress/kendo-angular-buttons';
|
|
6
6
|
import { ButtonModule, ButtonGroupModule, KENDO_BUTTONS } from '@progress/kendo-angular-buttons';
|
|
7
7
|
import { HttpClient, HttpHeaders, HttpParams, HttpStatusCode } from '@angular/common/http';
|
|
8
|
-
import { map, catchError, EMPTY, forkJoin, BehaviorSubject, filter, Subject, startWith, pairwise, takeUntil, combineLatest, tap, debounceTime, distinctUntilChanged, take, switchMap, of, finalize, throwError } from 'rxjs';
|
|
8
|
+
import { map, catchError, EMPTY, forkJoin, BehaviorSubject, filter, Subject, startWith, pairwise, takeUntil, combineLatest, tap, debounceTime, distinctUntilChanged, take, switchMap, of, finalize, throwError, merge } from 'rxjs';
|
|
9
9
|
import * as i1$1 from '@progress/kendo-angular-layout';
|
|
10
10
|
import { ExpansionPanelComponent, ExpansionPanelModule, KENDO_LAYOUT, TileLayoutModule, DrawerComponent } from '@progress/kendo-angular-layout';
|
|
11
11
|
import * as i1$3 from '@progress/kendo-angular-label';
|
|
@@ -52,11 +52,11 @@ import { StateToken, Action, State, Store, Selector, createSelector, provideStat
|
|
|
52
52
|
import { __decorate } from 'tslib';
|
|
53
53
|
import * as i2$1 from '@progress/kendo-angular-sortable';
|
|
54
54
|
import { KENDO_SORTABLE } from '@progress/kendo-angular-sortable';
|
|
55
|
+
import { saveAs, encodeBase64 } from '@progress/kendo-file-saver';
|
|
56
|
+
import { Workbook } from '@progress/kendo-ooxml';
|
|
55
57
|
import { patch, append, removeItem, updateItem } from '@ngxs/store/operators';
|
|
56
58
|
import { toODataString, filterBy } from '@progress/kendo-data-query';
|
|
57
59
|
import { StateReset } from 'ngxs-reset-plugin';
|
|
58
|
-
import { saveAs, encodeBase64 } from '@progress/kendo-file-saver';
|
|
59
|
-
import { Workbook } from '@progress/kendo-ooxml';
|
|
60
60
|
import { catchError as catchError$1, tap as tap$1, map as map$1 } from 'rxjs/operators';
|
|
61
61
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
62
62
|
import { signalSetFn, SIGNAL } from '@angular/core/primitives/signals';
|
|
@@ -1049,6 +1049,7 @@ var KitFormErrorCode;
|
|
|
1049
1049
|
KitFormErrorCode["Duplicate"] = "duplicate";
|
|
1050
1050
|
KitFormErrorCode["MaxNumber"] = "max";
|
|
1051
1051
|
KitFormErrorCode["MinNumber"] = "min";
|
|
1052
|
+
KitFormErrorCode["PasswordsMismatch"] = "passwordsMismatch";
|
|
1052
1053
|
})(KitFormErrorCode || (KitFormErrorCode = {}));
|
|
1053
1054
|
|
|
1054
1055
|
class KitFormErrors {
|
|
@@ -1067,6 +1068,7 @@ class KitFormErrors {
|
|
|
1067
1068
|
minNumber: errors.min,
|
|
1068
1069
|
}),
|
|
1069
1070
|
[KitFormErrorCode.Duplicate]: () => this.translateService.instant('kit.formControlError.duplicate'),
|
|
1071
|
+
[KitFormErrorCode.PasswordsMismatch]: () => this.translateService.instant('kit.formControlError.passwordsMismatch'),
|
|
1070
1072
|
};
|
|
1071
1073
|
}
|
|
1072
1074
|
getErrors(control) {
|
|
@@ -1586,8 +1588,9 @@ class KitDropdownComponent {
|
|
|
1586
1588
|
* Function that is called when dropdown list item selected
|
|
1587
1589
|
*/
|
|
1588
1590
|
onItemSelect(item) {
|
|
1589
|
-
this.
|
|
1590
|
-
this.
|
|
1591
|
+
const value = (this.isValuePrimitive() ? item.value : item);
|
|
1592
|
+
this.selectedItem.set(value);
|
|
1593
|
+
this.onChange(value);
|
|
1591
1594
|
this.selected.emit(item);
|
|
1592
1595
|
this.onTouched();
|
|
1593
1596
|
}
|
|
@@ -6084,7 +6087,6 @@ class KitMultiselectComponent {
|
|
|
6084
6087
|
}
|
|
6085
6088
|
writeValue(value) {
|
|
6086
6089
|
this.selectedItems = value;
|
|
6087
|
-
this.onChange(value);
|
|
6088
6090
|
}
|
|
6089
6091
|
registerOnChange(fn) {
|
|
6090
6092
|
this.onChange = fn;
|
|
@@ -8359,6 +8361,7 @@ class KitFileCardComponent {
|
|
|
8359
8361
|
this.showViewFileButton = input(true, ...(ngDevMode ? [{ debugName: "showViewFileButton" }] : /* istanbul ignore next */ []));
|
|
8360
8362
|
this.useUTCDateValues = input(true, ...(ngDevMode ? [{ debugName: "useUTCDateValues" }] : /* istanbul ignore next */ []));
|
|
8361
8363
|
this.subTitle = input(...(ngDevMode ? [undefined, { debugName: "subTitle" }] : /* istanbul ignore next */ []));
|
|
8364
|
+
this.subTitleColor = input(KitStatusLabelColor.ORANGE, ...(ngDevMode ? [{ debugName: "subTitleColor" }] : /* istanbul ignore next */ []));
|
|
8362
8365
|
/**
|
|
8363
8366
|
* An action which is emitted when view button clicked
|
|
8364
8367
|
*/
|
|
@@ -8434,9 +8437,9 @@ class KitFileCardComponent {
|
|
|
8434
8437
|
return label ?? this.translateService.instant(defaultLabelKey);
|
|
8435
8438
|
}
|
|
8436
8439
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitFileCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8437
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitFileCardComponent, isStandalone: true, selector: "kit-file-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, fileType: { classPropertyName: "fileType", publicName: "fileType", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, fileSize: { classPropertyName: "fileSize", publicName: "fileSize", isSignal: true, isRequired: false, transformFunction: null }, showViewFileButton: { classPropertyName: "showViewFileButton", publicName: "showViewFileButton", isSignal: true, isRequired: false, transformFunction: null }, useUTCDateValues: { classPropertyName: "useUTCDateValues", publicName: "useUTCDateValues", isSignal: true, isRequired: false, transformFunction: null }, subTitle: { classPropertyName: "subTitle", publicName: "subTitle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { viewButtonClicked: "viewButtonClicked", downloadButtonClicked: "downloadButtonClicked" }, providers: [
|
|
8440
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitFileCardComponent, isStandalone: true, selector: "kit-file-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, fileType: { classPropertyName: "fileType", publicName: "fileType", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, fileSize: { classPropertyName: "fileSize", publicName: "fileSize", isSignal: true, isRequired: false, transformFunction: null }, showViewFileButton: { classPropertyName: "showViewFileButton", publicName: "showViewFileButton", isSignal: true, isRequired: false, transformFunction: null }, useUTCDateValues: { classPropertyName: "useUTCDateValues", publicName: "useUTCDateValues", isSignal: true, isRequired: false, transformFunction: null }, subTitle: { classPropertyName: "subTitle", publicName: "subTitle", isSignal: true, isRequired: false, transformFunction: null }, subTitleColor: { classPropertyName: "subTitleColor", publicName: "subTitleColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { viewButtonClicked: "viewButtonClicked", downloadButtonClicked: "downloadButtonClicked" }, providers: [
|
|
8438
8441
|
DatePipe,
|
|
8439
|
-
], queries: [{ propertyName: "customMessages", first: true, predicate: KitFileCardMessagesComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"kit-file-card\"\n [ngClass]=\"type() ? [type(), size()] : [size()]\">\n <div class=\"kit-file-card-header\">\n <div class=\"card-title\">{{ title() }}</div>\n <div class=\"card-subtitle\">\n <div class=\"card-type\">{{ label() }}</div>\n <
|
|
8442
|
+
], queries: [{ propertyName: "customMessages", first: true, predicate: KitFileCardMessagesComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"kit-file-card\"\n [ngClass]=\"type() ? [type(), size()] : [size()]\">\n <div class=\"kit-file-card-header\">\n <div class=\"card-title\">{{ title() }}</div>\n <div class=\"card-subtitle\">\n <div class=\"card-type\">{{ label() }}</div>\n @if (subTitle()) {\n <kit-status-label [color]=\"subTitleColor()\">{{ subTitle() }}</kit-status-label>\n }\n </div>\n </div>\n\n <kit-svg-icon class=\"kit-file-card-icon\"\n [icon]=\"getFileIconByExtension(fileType())\">\n </kit-svg-icon>\n\n <div class=\"kit-file-card-info\">\n <div class=\"info-item\">\n @if (size() === kitFileCardSize.LARGE) {\n <div class=\"info-item-label\">{{ customMessages()?.createDate ?? \"kit.fileCard.createdDate\" | translate }}</div>\n }\n <div class=\"info-item-value\">{{ getFormattedDate() }}</div>\n </div>\n @if (name()) {\n <div class=\"info-item\">\n @if (size() === kitFileCardSize.LARGE) {\n <div class=\"info-item-label\">{{ customMessages()?.createdBy ?? \"kit.fileCard.createdBy\" | translate }}</div>\n }\n <div class=\"info-item-value\">{{ name() }}</div>\n </div>\n }\n @if (formattedFileSize()) {\n <div class=\"info-item\">\n @if (size() === kitFileCardSize.LARGE) {\n <div class=\"info-item-label\">{{ customMessages()?.fileSize() ?? \"kit.fileCard.fileSize\" | translate }}</div>\n }\n <div class=\"info-item-value\">{{ formattedFileSize() }}</div>\n </div>\n }\n </div>\n\n <div class=\"kit-file-card-action\">\n @if (showViewFileButton() && hasViewFileButton(fileType())) {\n <kit-button class=\"action-button\"\n kitTooltip\n kitTooltipFilter=\".action-button\"\n [kitTooltipVisible]=\"size() === kitFileCardSize.SMALL\"\n [kitTooltipPosition]=\"kitTooltipPosition.TOP\"\n [title]=\"customMessages()?.viewButtonLabel ?? 'kit.fileCard.view' | translate\"\n [label]=\"getActionButtonLabel(customMessages()?.viewButtonLabel, 'kit.fileCard.view')\"\n [icon]=\"kitSvgIcon.EYE\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"size() === kitFileCardSize.LARGE ? kitButtonKind.LARGE : kitButtonKind.SMALL\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"viewButtonClicked.emit()\"\n ></kit-button>\n }\n <kit-button class=\"action-button\"\n kitTooltip\n kitTooltipFilter=\".action-button\"\n [kitTooltipVisible]=\"size() === kitFileCardSize.SMALL\"\n [kitTooltipPosition]=\"kitTooltipPosition.TOP\"\n [title]=\"customMessages()?.downloadButtonLabel ?? 'kit.fileCard.download' | translate\"\n [label]=\"getActionButtonLabel(customMessages()?.downloadButtonLabel, 'kit.fileCard.download')\"\n [icon]=\"kitSvgIcon.DOWNLOAD\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"size() === kitFileCardSize.LARGE ? kitButtonKind.LARGE : kitButtonKind.SMALL\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"downloadButtonClicked.emit()\"\n ></kit-button>\n </div>\n</div>\n<ng-content></ng-content>\n", styles: [".kit-file-card{display:grid;color:var(--ui-kit-color-grey-10);border-radius:10px;border:1px solid var(--ui-kit-color-grey-11);background:var(--ui-kit-color-white)}.kit-file-card .kit-file-card-header{display:flex;gap:10px;grid-area:header}.kit-file-card .card-title{font-weight:400}.kit-file-card .card-subtitle{display:flex;gap:10px;align-items:center;justify-content:space-between}.kit-file-card .card-type{display:inline-flex;align-items:center;justify-content:center;padding:0 8px;height:20px;font-size:12px;font-weight:500;color:var(--ui-kit-color-main);border:1px solid var(--ui-kit-color-main);border-radius:4px}.kit-file-card .kit-file-card-icon{display:flex;grid-area:icon}.kit-file-card .kit-file-card-info{grid-area:info;display:flex}.kit-file-card .kit-file-card-action{display:flex;grid-area:action}.kit-file-card .action-button ::ng-deep .k-button{width:100%}.kit-file-card.blue .card-type{color:var(--ui-kit-color-blue);border-color:var(--ui-kit-color-blue);background-color:var(--ui-kit-color-blue-1)}.kit-file-card.purple .card-type{color:var(--ui-kit-color-purple);border-color:var(--ui-kit-color-purple);background-color:var(--ui-kit-color-purple-1)}.kit-file-card.teal .card-type{color:var(--ui-kit-color-teal);border-color:var(--ui-kit-color-teal);background-color:var(--ui-kit-color-teal-1)}.kit-file-card.orange .card-type{color:var(--ui-kit-color-orange-2);border-color:var(--ui-kit-color-orange-2);background-color:var(--ui-kit-color-orange-3)}.kit-file-card.green .card-type{color:var(--ui-kit-color-green-1);border-color:var(--ui-kit-color-green-1);background-color:var(--ui-kit-color-green-4)}.kit-file-card.grey .card-type{color:var(--ui-kit-color-grey-10);border-color:var(--ui-kit-color-grey-10);background-color:var(--ui-kit-color-grey-16)}.kit-file-card.red .card-type{color:var(--ui-kit-color-red-1);border-color:var(--ui-kit-color-red-1);background-color:var(--ui-kit-color-red-3)}.kit-file-card.pink .card-type{color:var(--ui-kit-color-pink);border-color:var(--ui-kit-color-pink);background-color:var(--ui-kit-color-pink-1)}.kit-file-card.large{grid-template-columns:78px 1fr;grid-template-areas:\"header header\" \"icon info\" \"action action\";gap:17px 24px;padding:25px}.kit-file-card.large .kit-file-card-header{flex-direction:column;padding-bottom:10px;border-bottom:1px solid var(--ui-kit-color-grey-11)}.kit-file-card.large .card-title{font-size:16px}.kit-file-card.large .kit-file-card-icon{width:78px;height:100px}.kit-file-card.large .kit-file-card-info{flex-direction:column;gap:12px}.kit-file-card.large .kit-file-card-info .info-item{line-height:22px}.kit-file-card.large .kit-file-card-info .info-item-label{color:var(--ui-kit-color-grey-14);font-size:13px}.kit-file-card.large .kit-file-card-info .info-item-value{font-size:16px}.kit-file-card.large .kit-file-card-action{gap:15px;padding-top:15px;border-top:1px solid var(--ui-kit-color-grey-11)}.kit-file-card.large .kit-file-card-action .action-button{flex:1}.kit-file-card.small{grid-template-columns:40px 1fr 36px;grid-template-areas:\"icon header action\" \"icon info action\";gap:10px 12px;padding:15px}.kit-file-card.small .kit-file-card-header{align-items:center}.kit-file-card.small .card-title{font-size:14px}.kit-file-card.small .kit-file-card-icon{width:40px;height:52px}.kit-file-card.small .kit-file-card-info .info-item{margin-right:10px;padding-right:10px;color:var(--ui-kit-color-grey-14);font-size:14px;border-right:1px solid var(--ui-kit-color-grey-12);line-height:20px}.kit-file-card.small .kit-file-card-info .info-item:last-child{margin:0;padding:0;border:none}.kit-file-card.small .kit-file-card-action{flex-direction:column;align-items:flex-end;gap:4px;border-left:1px solid var(--ui-kit-color-grey-11)}\n"], dependencies: [{ kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "component", type: KitSvgIconComponent, selector: "kit-svg-icon", inputs: ["icon", "iconClass"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: KitTooltipDirective, selector: "[kitTooltip]", inputs: ["kitTooltipPosition", "kitTooltipFilter", "kitTooltipTemplateRef", "kitTooltipVisible", "kitTooltipOffset"] }, { kind: "component", type: KitStatusLabelComponent, selector: "kit-status-label", inputs: ["color", "size", "tooltip"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8440
8443
|
}
|
|
8441
8444
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitFileCardComponent, decorators: [{
|
|
8442
8445
|
type: Component,
|
|
@@ -8446,10 +8449,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
8446
8449
|
NgClass,
|
|
8447
8450
|
KitTooltipDirective,
|
|
8448
8451
|
TranslatePipe,
|
|
8452
|
+
KitStatusLabelComponent,
|
|
8449
8453
|
], providers: [
|
|
8450
8454
|
DatePipe,
|
|
8451
|
-
], template: "<div class=\"kit-file-card\"\n [ngClass]=\"type() ? [type(), size()] : [size()]\">\n <div class=\"kit-file-card-header\">\n <div class=\"card-title\">{{ title() }}</div>\n <div class=\"card-subtitle\">\n <div class=\"card-type\">{{ label() }}</div>\n <
|
|
8452
|
-
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], fileType: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileType", required: false }] }], date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], fileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileSize", required: false }] }], showViewFileButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showViewFileButton", required: false }] }], useUTCDateValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "useUTCDateValues", required: false }] }], subTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subTitle", required: false }] }], viewButtonClicked: [{ type: i0.Output, args: ["viewButtonClicked"] }], downloadButtonClicked: [{ type: i0.Output, args: ["downloadButtonClicked"] }], customMessages: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KitFileCardMessagesComponent), { isSignal: true }] }] } });
|
|
8455
|
+
], template: "<div class=\"kit-file-card\"\n [ngClass]=\"type() ? [type(), size()] : [size()]\">\n <div class=\"kit-file-card-header\">\n <div class=\"card-title\">{{ title() }}</div>\n <div class=\"card-subtitle\">\n <div class=\"card-type\">{{ label() }}</div>\n @if (subTitle()) {\n <kit-status-label [color]=\"subTitleColor()\">{{ subTitle() }}</kit-status-label>\n }\n </div>\n </div>\n\n <kit-svg-icon class=\"kit-file-card-icon\"\n [icon]=\"getFileIconByExtension(fileType())\">\n </kit-svg-icon>\n\n <div class=\"kit-file-card-info\">\n <div class=\"info-item\">\n @if (size() === kitFileCardSize.LARGE) {\n <div class=\"info-item-label\">{{ customMessages()?.createDate ?? \"kit.fileCard.createdDate\" | translate }}</div>\n }\n <div class=\"info-item-value\">{{ getFormattedDate() }}</div>\n </div>\n @if (name()) {\n <div class=\"info-item\">\n @if (size() === kitFileCardSize.LARGE) {\n <div class=\"info-item-label\">{{ customMessages()?.createdBy ?? \"kit.fileCard.createdBy\" | translate }}</div>\n }\n <div class=\"info-item-value\">{{ name() }}</div>\n </div>\n }\n @if (formattedFileSize()) {\n <div class=\"info-item\">\n @if (size() === kitFileCardSize.LARGE) {\n <div class=\"info-item-label\">{{ customMessages()?.fileSize() ?? \"kit.fileCard.fileSize\" | translate }}</div>\n }\n <div class=\"info-item-value\">{{ formattedFileSize() }}</div>\n </div>\n }\n </div>\n\n <div class=\"kit-file-card-action\">\n @if (showViewFileButton() && hasViewFileButton(fileType())) {\n <kit-button class=\"action-button\"\n kitTooltip\n kitTooltipFilter=\".action-button\"\n [kitTooltipVisible]=\"size() === kitFileCardSize.SMALL\"\n [kitTooltipPosition]=\"kitTooltipPosition.TOP\"\n [title]=\"customMessages()?.viewButtonLabel ?? 'kit.fileCard.view' | translate\"\n [label]=\"getActionButtonLabel(customMessages()?.viewButtonLabel, 'kit.fileCard.view')\"\n [icon]=\"kitSvgIcon.EYE\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"size() === kitFileCardSize.LARGE ? kitButtonKind.LARGE : kitButtonKind.SMALL\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"viewButtonClicked.emit()\"\n ></kit-button>\n }\n <kit-button class=\"action-button\"\n kitTooltip\n kitTooltipFilter=\".action-button\"\n [kitTooltipVisible]=\"size() === kitFileCardSize.SMALL\"\n [kitTooltipPosition]=\"kitTooltipPosition.TOP\"\n [title]=\"customMessages()?.downloadButtonLabel ?? 'kit.fileCard.download' | translate\"\n [label]=\"getActionButtonLabel(customMessages()?.downloadButtonLabel, 'kit.fileCard.download')\"\n [icon]=\"kitSvgIcon.DOWNLOAD\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"size() === kitFileCardSize.LARGE ? kitButtonKind.LARGE : kitButtonKind.SMALL\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"downloadButtonClicked.emit()\"\n ></kit-button>\n </div>\n</div>\n<ng-content></ng-content>\n", styles: [".kit-file-card{display:grid;color:var(--ui-kit-color-grey-10);border-radius:10px;border:1px solid var(--ui-kit-color-grey-11);background:var(--ui-kit-color-white)}.kit-file-card .kit-file-card-header{display:flex;gap:10px;grid-area:header}.kit-file-card .card-title{font-weight:400}.kit-file-card .card-subtitle{display:flex;gap:10px;align-items:center;justify-content:space-between}.kit-file-card .card-type{display:inline-flex;align-items:center;justify-content:center;padding:0 8px;height:20px;font-size:12px;font-weight:500;color:var(--ui-kit-color-main);border:1px solid var(--ui-kit-color-main);border-radius:4px}.kit-file-card .kit-file-card-icon{display:flex;grid-area:icon}.kit-file-card .kit-file-card-info{grid-area:info;display:flex}.kit-file-card .kit-file-card-action{display:flex;grid-area:action}.kit-file-card .action-button ::ng-deep .k-button{width:100%}.kit-file-card.blue .card-type{color:var(--ui-kit-color-blue);border-color:var(--ui-kit-color-blue);background-color:var(--ui-kit-color-blue-1)}.kit-file-card.purple .card-type{color:var(--ui-kit-color-purple);border-color:var(--ui-kit-color-purple);background-color:var(--ui-kit-color-purple-1)}.kit-file-card.teal .card-type{color:var(--ui-kit-color-teal);border-color:var(--ui-kit-color-teal);background-color:var(--ui-kit-color-teal-1)}.kit-file-card.orange .card-type{color:var(--ui-kit-color-orange-2);border-color:var(--ui-kit-color-orange-2);background-color:var(--ui-kit-color-orange-3)}.kit-file-card.green .card-type{color:var(--ui-kit-color-green-1);border-color:var(--ui-kit-color-green-1);background-color:var(--ui-kit-color-green-4)}.kit-file-card.grey .card-type{color:var(--ui-kit-color-grey-10);border-color:var(--ui-kit-color-grey-10);background-color:var(--ui-kit-color-grey-16)}.kit-file-card.red .card-type{color:var(--ui-kit-color-red-1);border-color:var(--ui-kit-color-red-1);background-color:var(--ui-kit-color-red-3)}.kit-file-card.pink .card-type{color:var(--ui-kit-color-pink);border-color:var(--ui-kit-color-pink);background-color:var(--ui-kit-color-pink-1)}.kit-file-card.large{grid-template-columns:78px 1fr;grid-template-areas:\"header header\" \"icon info\" \"action action\";gap:17px 24px;padding:25px}.kit-file-card.large .kit-file-card-header{flex-direction:column;padding-bottom:10px;border-bottom:1px solid var(--ui-kit-color-grey-11)}.kit-file-card.large .card-title{font-size:16px}.kit-file-card.large .kit-file-card-icon{width:78px;height:100px}.kit-file-card.large .kit-file-card-info{flex-direction:column;gap:12px}.kit-file-card.large .kit-file-card-info .info-item{line-height:22px}.kit-file-card.large .kit-file-card-info .info-item-label{color:var(--ui-kit-color-grey-14);font-size:13px}.kit-file-card.large .kit-file-card-info .info-item-value{font-size:16px}.kit-file-card.large .kit-file-card-action{gap:15px;padding-top:15px;border-top:1px solid var(--ui-kit-color-grey-11)}.kit-file-card.large .kit-file-card-action .action-button{flex:1}.kit-file-card.small{grid-template-columns:40px 1fr 36px;grid-template-areas:\"icon header action\" \"icon info action\";gap:10px 12px;padding:15px}.kit-file-card.small .kit-file-card-header{align-items:center}.kit-file-card.small .card-title{font-size:14px}.kit-file-card.small .kit-file-card-icon{width:40px;height:52px}.kit-file-card.small .kit-file-card-info .info-item{margin-right:10px;padding-right:10px;color:var(--ui-kit-color-grey-14);font-size:14px;border-right:1px solid var(--ui-kit-color-grey-12);line-height:20px}.kit-file-card.small .kit-file-card-info .info-item:last-child{margin:0;padding:0;border:none}.kit-file-card.small .kit-file-card-action{flex-direction:column;align-items:flex-end;gap:4px;border-left:1px solid var(--ui-kit-color-grey-11)}\n"] }]
|
|
8456
|
+
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], fileType: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileType", required: false }] }], date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], fileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileSize", required: false }] }], showViewFileButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showViewFileButton", required: false }] }], useUTCDateValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "useUTCDateValues", required: false }] }], subTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subTitle", required: false }] }], subTitleColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "subTitleColor", required: false }] }], viewButtonClicked: [{ type: i0.Output, args: ["viewButtonClicked"] }], downloadButtonClicked: [{ type: i0.Output, args: ["downloadButtonClicked"] }], customMessages: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KitFileCardMessagesComponent), { isSignal: true }] }] } });
|
|
8453
8457
|
|
|
8454
8458
|
var KitDataFieldState;
|
|
8455
8459
|
(function (KitDataFieldState) {
|
|
@@ -9083,6 +9087,215 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
9083
9087
|
type: Input
|
|
9084
9088
|
}], dragEnd: [{ type: i0.Output, args: ["dragEnd"] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
|
|
9085
9089
|
|
|
9090
|
+
const KIT_USER_PATH = new InjectionToken('kitUserPath');
|
|
9091
|
+
|
|
9092
|
+
const KIT_USER_APPLICATIONS_PATH = new InjectionToken('kitUserApplicationsPath');
|
|
9093
|
+
|
|
9094
|
+
class KitUserApiService {
|
|
9095
|
+
constructor() {
|
|
9096
|
+
this.httpClient = inject(HttpClient);
|
|
9097
|
+
this.basePath = inject(KIT_BASE_PATH);
|
|
9098
|
+
this.userPath = inject(KIT_USER_PATH);
|
|
9099
|
+
this.userApplicationsPath = inject(KIT_USER_APPLICATIONS_PATH);
|
|
9100
|
+
}
|
|
9101
|
+
getUserInfo() {
|
|
9102
|
+
const url = `${this.basePath}/${this.userPath}`;
|
|
9103
|
+
return this.httpClient.get(url);
|
|
9104
|
+
}
|
|
9105
|
+
getUserApplicationList() {
|
|
9106
|
+
const url = `${this.basePath}/${this.userApplicationsPath}`;
|
|
9107
|
+
return this.httpClient.get(url);
|
|
9108
|
+
}
|
|
9109
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
9110
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserApiService, providedIn: 'root' }); }
|
|
9111
|
+
}
|
|
9112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserApiService, decorators: [{
|
|
9113
|
+
type: Injectable,
|
|
9114
|
+
args: [{
|
|
9115
|
+
providedIn: 'root',
|
|
9116
|
+
}]
|
|
9117
|
+
}] });
|
|
9118
|
+
|
|
9119
|
+
class FetchUser {
|
|
9120
|
+
static { this.type = '[User] Fetch'; }
|
|
9121
|
+
}
|
|
9122
|
+
|
|
9123
|
+
const KIT_USER_STATE_TOKEN = new StateToken('user');
|
|
9124
|
+
let KitUserState = class KitUserState {
|
|
9125
|
+
constructor() {
|
|
9126
|
+
this.kitUserApiService = inject(KitUserApiService);
|
|
9127
|
+
}
|
|
9128
|
+
fetchUser(ctx) {
|
|
9129
|
+
return this.kitUserApiService.getUserInfo().pipe(tap(user => ctx.setState({
|
|
9130
|
+
data: user,
|
|
9131
|
+
loading: false,
|
|
9132
|
+
})));
|
|
9133
|
+
}
|
|
9134
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserState, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
9135
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserState }); }
|
|
9136
|
+
};
|
|
9137
|
+
__decorate([
|
|
9138
|
+
Action(FetchUser)
|
|
9139
|
+
], KitUserState.prototype, "fetchUser", null);
|
|
9140
|
+
KitUserState = __decorate([
|
|
9141
|
+
State({
|
|
9142
|
+
name: KIT_USER_STATE_TOKEN,
|
|
9143
|
+
defaults: {
|
|
9144
|
+
data: null,
|
|
9145
|
+
loading: true,
|
|
9146
|
+
},
|
|
9147
|
+
})
|
|
9148
|
+
], KitUserState);
|
|
9149
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserState, decorators: [{
|
|
9150
|
+
type: Injectable
|
|
9151
|
+
}], propDecorators: { fetchUser: [] } });
|
|
9152
|
+
|
|
9153
|
+
class KitGridCellService {
|
|
9154
|
+
constructor() {
|
|
9155
|
+
this.translateService = inject(TranslateService);
|
|
9156
|
+
this.decimalPipe = inject(DecimalPipe);
|
|
9157
|
+
this.datePipe = inject(DatePipe);
|
|
9158
|
+
this.dateFormatConfig = inject(KIT_GRID_CELL_DATE_FORMAT_CONFIG, { optional: true });
|
|
9159
|
+
this.store = inject(Store);
|
|
9160
|
+
this.userState = this.store.selectSignal(KIT_USER_STATE_TOKEN)();
|
|
9161
|
+
const dateFormatConfig = this.dateFormatConfig;
|
|
9162
|
+
this.dateFormat = dateFormatConfig?.dateFormat ?? KIT_DATE_FORMAT;
|
|
9163
|
+
this.dateTimeFormat = dateFormatConfig?.dateTimeFormat ?? KIT_DATETIME_FORMAT_LONG;
|
|
9164
|
+
}
|
|
9165
|
+
createCellValue(columnType, columnField, dataItem, translationMap = {}, defaultValue = '', valueTransforms = {}) {
|
|
9166
|
+
const rawValue = this.getCellValue(dataItem, columnField);
|
|
9167
|
+
const value = valueTransforms[columnField]?.(rawValue) ?? rawValue;
|
|
9168
|
+
if (columnField in translationMap && value != null && value !== '') {
|
|
9169
|
+
return this.translateService.instant(translationMap[columnField](value)) ?? defaultValue;
|
|
9170
|
+
}
|
|
9171
|
+
switch (columnType) {
|
|
9172
|
+
case 'number':
|
|
9173
|
+
return this.decimalPipe.transform(value) ?? defaultValue;
|
|
9174
|
+
case 'plainNumber':
|
|
9175
|
+
return value || defaultValue;
|
|
9176
|
+
case 'date':
|
|
9177
|
+
return this.datePipe.transform(value, this.dateFormat, 'UTC') ?? defaultValue;
|
|
9178
|
+
case 'dateTime':
|
|
9179
|
+
return this.datePipe.transform(value, this.dateTimeFormat, 'UTC') ?? defaultValue;
|
|
9180
|
+
case 'dateLocal':
|
|
9181
|
+
return this.datePipe.transform(value, this.dateFormat) ?? defaultValue;
|
|
9182
|
+
case 'dateTimeLocal':
|
|
9183
|
+
return this.datePipe.transform(value, this.dateTimeFormat) ?? defaultValue;
|
|
9184
|
+
case 'dateZone':
|
|
9185
|
+
return value ? formatInTimeZone(value, this.userState.data?.namedTimeZone ?? 'UTC', this.dateFormat) : defaultValue;
|
|
9186
|
+
case 'dateTimeZone':
|
|
9187
|
+
return value ? formatInTimeZone(value, this.userState.data?.namedTimeZone ?? 'UTC', this.dateTimeFormat) : defaultValue;
|
|
9188
|
+
case 'boolean':
|
|
9189
|
+
return this.translateService.instant(value ? 'common.yes' : 'common.no');
|
|
9190
|
+
default:
|
|
9191
|
+
return value || defaultValue;
|
|
9192
|
+
}
|
|
9193
|
+
}
|
|
9194
|
+
getCellValue(dataItem, field) {
|
|
9195
|
+
let value = dataItem[field];
|
|
9196
|
+
if (!value) {
|
|
9197
|
+
value = this.getNestedGridCellValue(dataItem, field);
|
|
9198
|
+
}
|
|
9199
|
+
return value;
|
|
9200
|
+
}
|
|
9201
|
+
getNestedGridCellValue(dataItem, field) {
|
|
9202
|
+
const value = field.split('.').reduce((acc, key) => acc !== null && typeof acc === 'object' && key in acc
|
|
9203
|
+
? acc[key]
|
|
9204
|
+
: undefined, dataItem);
|
|
9205
|
+
return value === 0 ? 0 : value || '';
|
|
9206
|
+
}
|
|
9207
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitGridCellService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
9208
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitGridCellService }); }
|
|
9209
|
+
}
|
|
9210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitGridCellService, decorators: [{
|
|
9211
|
+
type: Injectable
|
|
9212
|
+
}], ctorParameters: () => [] });
|
|
9213
|
+
|
|
9214
|
+
class KitExcelExportService {
|
|
9215
|
+
constructor() {
|
|
9216
|
+
this.translateService = inject(TranslateService);
|
|
9217
|
+
this.store = inject(Store);
|
|
9218
|
+
this.gridCellService = inject(KitGridCellService);
|
|
9219
|
+
}
|
|
9220
|
+
async export(data, exportedColumns, exportedFileName, translationMap, valueTransforms = {}) {
|
|
9221
|
+
const userTimezone = this.store.selectSnapshot(KIT_USER_STATE_TOKEN).data?.namedTimeZone ?? 'UTC';
|
|
9222
|
+
const workbook = { sheets: [{ rows: [], columns: [] }] };
|
|
9223
|
+
const columns = exportedColumns.map(({ title, field }) => ({
|
|
9224
|
+
value: this.translateService.instant(title || field),
|
|
9225
|
+
background: '#7a7a7a',
|
|
9226
|
+
color: '#fff',
|
|
9227
|
+
width: 170,
|
|
9228
|
+
}));
|
|
9229
|
+
workbook.sheets[0].rows = this.getExportedExcelRows(columns, data, exportedColumns, translationMap, userTimezone, valueTransforms);
|
|
9230
|
+
workbook.sheets[0].columns = columns;
|
|
9231
|
+
const dataUrl = await new Workbook(workbook).toDataURL();
|
|
9232
|
+
return saveAs(dataUrl, `${exportedFileName}.xlsx`);
|
|
9233
|
+
}
|
|
9234
|
+
getExportedExcelRows(columns, data, gridColumns, translationMap, userTimezone, valueTransforms = {}) {
|
|
9235
|
+
const rows = [{ cells: columns, type: 'header' }];
|
|
9236
|
+
for (const row of data) {
|
|
9237
|
+
const rowCells = gridColumns.map((column) => {
|
|
9238
|
+
const rawValue = this.gridCellService.getCellValue(row, column.field);
|
|
9239
|
+
const value = valueTransforms[column.field]?.(rawValue) ?? rawValue;
|
|
9240
|
+
switch (column.type) {
|
|
9241
|
+
case 'number': {
|
|
9242
|
+
return { value: (value ?? undefined) };
|
|
9243
|
+
}
|
|
9244
|
+
case 'time':
|
|
9245
|
+
return { format: column.excelFormat, value: this.timeStringToExcelFraction(value) };
|
|
9246
|
+
case 'date':
|
|
9247
|
+
case 'dateTime': {
|
|
9248
|
+
const format = column.excelFormat || (column.type === 'date' ? KIT_DATE_FORMAT : KIT_DATETIME_FORMAT_LONG);
|
|
9249
|
+
const dateValue = value ? this.truncateToSeconds(this.convertToUtcDate(value)) : undefined;
|
|
9250
|
+
return { format, value: dateValue };
|
|
9251
|
+
}
|
|
9252
|
+
case 'dateLocal':
|
|
9253
|
+
case 'dateTimeLocal': {
|
|
9254
|
+
const format = column.excelFormat || (column.type === 'dateLocal' ? KIT_DATE_FORMAT : KIT_DATETIME_FORMAT_LONG);
|
|
9255
|
+
const dateValue = value ? this.truncateToSeconds(new Date(value)) : undefined;
|
|
9256
|
+
return { format, value: dateValue };
|
|
9257
|
+
}
|
|
9258
|
+
case 'dateZone':
|
|
9259
|
+
case 'dateTimeZone': {
|
|
9260
|
+
const format = column.excelFormat || (column.type === 'dateZone' ? KIT_DATE_FORMAT : KIT_DATETIME_FORMAT_LONG);
|
|
9261
|
+
const dateValue = value
|
|
9262
|
+
? this.truncateToSeconds(toZonedTime(new Date(value), userTimezone))
|
|
9263
|
+
: undefined;
|
|
9264
|
+
return { format, value: dateValue };
|
|
9265
|
+
}
|
|
9266
|
+
}
|
|
9267
|
+
return { value: this.gridCellService.createCellValue(column.type, column.field, row, translationMap, '', valueTransforms) };
|
|
9268
|
+
});
|
|
9269
|
+
rows.push({ cells: rowCells, type: 'data' });
|
|
9270
|
+
}
|
|
9271
|
+
return rows;
|
|
9272
|
+
}
|
|
9273
|
+
timeStringToExcelFraction(time) {
|
|
9274
|
+
if (!time) {
|
|
9275
|
+
return '';
|
|
9276
|
+
}
|
|
9277
|
+
const [hoursStr, minutesStr,] = time.split(':');
|
|
9278
|
+
const hours = Number.parseInt(hoursStr, 10);
|
|
9279
|
+
const minutes = Number.parseInt(minutesStr, 10);
|
|
9280
|
+
return (hours * 60 + minutes) / (24 * 60);
|
|
9281
|
+
}
|
|
9282
|
+
convertToUtcDate(dateString) {
|
|
9283
|
+
const date = new Date(dateString);
|
|
9284
|
+
const timezoneOffset = date.getTimezoneOffset();
|
|
9285
|
+
return new Date(date.getTime() + timezoneOffset * 60 * 1000);
|
|
9286
|
+
}
|
|
9287
|
+
truncateToSeconds(date) {
|
|
9288
|
+
const result = new Date(date);
|
|
9289
|
+
result.setMilliseconds(0);
|
|
9290
|
+
return result;
|
|
9291
|
+
}
|
|
9292
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitExcelExportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
9293
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitExcelExportService }); }
|
|
9294
|
+
}
|
|
9295
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitExcelExportService, decorators: [{
|
|
9296
|
+
type: Injectable
|
|
9297
|
+
}] });
|
|
9298
|
+
|
|
9086
9299
|
class KitCardDetailsComponent {
|
|
9087
9300
|
constructor() {
|
|
9088
9301
|
this.router = inject(Router);
|
|
@@ -9766,16 +9979,6 @@ const kitShouldResetGridState = ({ stateColumns, availableColumns, }) => {
|
|
|
9766
9979
|
return !stateTitles.every(field => availableTitles.has(field));
|
|
9767
9980
|
};
|
|
9768
9981
|
|
|
9769
|
-
var KitUsersSettingsServerErrorTitle;
|
|
9770
|
-
(function (KitUsersSettingsServerErrorTitle) {
|
|
9771
|
-
KitUsersSettingsServerErrorTitle["PASSWORD_TOO_WEAK"] = "Your password is too weak.";
|
|
9772
|
-
KitUsersSettingsServerErrorTitle["INVALID_USER_NAME"] = "You have specified invalid UserName.";
|
|
9773
|
-
})(KitUsersSettingsServerErrorTitle || (KitUsersSettingsServerErrorTitle = {}));
|
|
9774
|
-
const kitUsersSettingsErrorTranslationMap = {
|
|
9775
|
-
[KitUsersSettingsServerErrorTitle.PASSWORD_TOO_WEAK]: 'kit.usersSettings.details.passwordTooWeak',
|
|
9776
|
-
[KitUsersSettingsServerErrorTitle.INVALID_USER_NAME]: 'kit.usersSettings.details.userNameInvalid',
|
|
9777
|
-
};
|
|
9778
|
-
|
|
9779
9982
|
class KitFetchUsersSettings extends KitAbstractPayloadAction {
|
|
9780
9983
|
static { this.type = '[KitUsersSettings] Fetch Users'; }
|
|
9781
9984
|
}
|
|
@@ -9792,6 +9995,12 @@ class KitDeleteUsersSettingsUser extends KitAbstractPayloadAction {
|
|
|
9792
9995
|
static { this.type = '[KitUsersSettings] Delete User'; }
|
|
9793
9996
|
}
|
|
9794
9997
|
|
|
9998
|
+
const kitApiResponseDefaultEntities = () => ({
|
|
9999
|
+
data: [],
|
|
10000
|
+
total: 0,
|
|
10001
|
+
loading: true,
|
|
10002
|
+
});
|
|
10003
|
+
|
|
9795
10004
|
const kitBuildHttpParams = (obj) => {
|
|
9796
10005
|
let params = new HttpParams();
|
|
9797
10006
|
Object.entries(obj).forEach(([key, value,]) => {
|
|
@@ -9803,71 +10012,96 @@ const kitBuildHttpParams = (obj) => {
|
|
|
9803
10012
|
return params;
|
|
9804
10013
|
};
|
|
9805
10014
|
|
|
9806
|
-
class
|
|
10015
|
+
class KitHttpErrorHandlerService {
|
|
9807
10016
|
constructor() {
|
|
9808
|
-
this.
|
|
9809
|
-
this.
|
|
9810
|
-
|
|
9811
|
-
fetchUsers(state) {
|
|
9812
|
-
const url = `${this.baseUrl}users`;
|
|
9813
|
-
const { $skip, $top, $orderby, $filter } = this.getRequestParams(state);
|
|
9814
|
-
return this.httpClient.get(url, { params: kitBuildHttpParams({ $skip, $top, $orderby, $filter }) });
|
|
9815
|
-
}
|
|
9816
|
-
fetchUserDetails(id) {
|
|
9817
|
-
const url = `${this.baseUrl}users/${id}`;
|
|
9818
|
-
return this.httpClient.get(url);
|
|
9819
|
-
}
|
|
9820
|
-
updateUserDetails(payload) {
|
|
9821
|
-
const url = `${this.baseUrl}users/${payload.id}`;
|
|
9822
|
-
return this.httpClient.put(url, payload);
|
|
9823
|
-
}
|
|
9824
|
-
createUser(payload) {
|
|
9825
|
-
const url = `${this.baseUrl}users`;
|
|
9826
|
-
return this.httpClient.post(url, payload);
|
|
9827
|
-
}
|
|
9828
|
-
deleteUser(id) {
|
|
9829
|
-
const url = `${this.baseUrl}users/${id}`;
|
|
9830
|
-
return this.httpClient.delete(url);
|
|
9831
|
-
}
|
|
9832
|
-
getRequestParams(state) {
|
|
9833
|
-
const $skip = state.skip && state.skip > 0 ? state.skip : undefined;
|
|
9834
|
-
const $top = state.take;
|
|
9835
|
-
const $orderby = state.sort?.length
|
|
9836
|
-
? state.sort.map(sort => `${sort.field} ${sort.dir ?? KitSortDirection.ASC}`).join(',')
|
|
9837
|
-
: 'name asc';
|
|
9838
|
-
const $filter = state.filter
|
|
9839
|
-
? kitDataStateToODataString({ filter: state.filter }).replace('$filter=', '')
|
|
9840
|
-
: undefined;
|
|
9841
|
-
return {
|
|
9842
|
-
$skip,
|
|
9843
|
-
$top,
|
|
9844
|
-
$orderby,
|
|
9845
|
-
$filter,
|
|
9846
|
-
};
|
|
10017
|
+
this.kitNotificationService = inject(KitNotificationService);
|
|
10018
|
+
this.translateService = inject(TranslateService);
|
|
10019
|
+
this.router = inject(Router);
|
|
9847
10020
|
}
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
}
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
10021
|
+
handleServerError(error) {
|
|
10022
|
+
if (error.error instanceof ErrorEvent) {
|
|
10023
|
+
this.showErrorNotification(`${this.translateService.instant('kit.http.clientError')} ${error.error.message}`);
|
|
10024
|
+
return throwError(() => error);
|
|
10025
|
+
}
|
|
10026
|
+
switch (error.status) {
|
|
10027
|
+
case HttpStatusCode.Unauthorized:
|
|
10028
|
+
this.showErrorNotification(this.translateService.instant('kit.http.unauthorized'));
|
|
10029
|
+
break;
|
|
10030
|
+
case HttpStatusCode.Forbidden:
|
|
10031
|
+
this.showErrorNotification(this.translateService.instant('kit.http.forbidden'));
|
|
10032
|
+
this.router.navigate(['forbidden']);
|
|
10033
|
+
break;
|
|
10034
|
+
case HttpStatusCode.NotFound:
|
|
10035
|
+
this.showErrorNotification(this.translateService.instant('kit.http.notFound'));
|
|
10036
|
+
break;
|
|
10037
|
+
case HttpStatusCode.BadRequest:
|
|
10038
|
+
this.showErrorNotification(`${this.translateService.instant('kit.http.validationError')} ${error.error?.title ?? ''}`);
|
|
10039
|
+
break;
|
|
10040
|
+
default:
|
|
10041
|
+
if (error.status >= HttpStatusCode.InternalServerError) {
|
|
10042
|
+
this.showErrorNotification(`${this.translateService.instant('kit.http.serverError')} ${error.error?.title ?? ''}`);
|
|
10043
|
+
}
|
|
10044
|
+
}
|
|
10045
|
+
return throwError(() => error);
|
|
10046
|
+
}
|
|
10047
|
+
showSuccessNotification(message) {
|
|
10048
|
+
this.kitNotificationService.addNotification(KitNotificationType.SUCCESS, message, true, 3000);
|
|
10049
|
+
}
|
|
10050
|
+
showErrorNotification(message) {
|
|
10051
|
+
this.kitNotificationService.addNotification(KitNotificationType.ERROR, message);
|
|
10052
|
+
}
|
|
10053
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitHttpErrorHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
10054
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitHttpErrorHandlerService }); }
|
|
10055
|
+
}
|
|
10056
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitHttpErrorHandlerService, decorators: [{
|
|
10057
|
+
type: Injectable
|
|
10058
|
+
}] });
|
|
9854
10059
|
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
10060
|
+
class KitUsersService {
|
|
10061
|
+
constructor() {
|
|
10062
|
+
this.httpClient = inject(HttpClient);
|
|
10063
|
+
this.baseUrl = `${trimTrailingSlash(inject(KIT_BASE_PATH))}/`;
|
|
10064
|
+
this.kitHttpErrorHandlerService = inject(KitHttpErrorHandlerService);
|
|
10065
|
+
this.translateService = inject(TranslateService);
|
|
10066
|
+
}
|
|
10067
|
+
fetchUsers(state) {
|
|
10068
|
+
const url = `${this.baseUrl}users`;
|
|
10069
|
+
const { skip, take, sort, filter } = state;
|
|
10070
|
+
return this.httpClient.get(url, { params: kitBuildHttpParams({ $skip: skip, $top: take, $orderby: kitBuildSortString(sort), $filter: kitBuildOdataFilter(filter) }) }).pipe(catchError((err) => this.kitHttpErrorHandlerService.handleServerError(err)));
|
|
10071
|
+
}
|
|
10072
|
+
fetchUserDetails(id) {
|
|
10073
|
+
const url = `${this.baseUrl}users/${id}`;
|
|
10074
|
+
return this.httpClient.get(url).pipe(catchError((err) => this.kitHttpErrorHandlerService.handleServerError(err)));
|
|
10075
|
+
}
|
|
10076
|
+
updateUserDetails(payload) {
|
|
10077
|
+
const url = `${this.baseUrl}users/${payload.id}`;
|
|
10078
|
+
return this.httpClient.put(url, payload).pipe(tap(() => this.kitHttpErrorHandlerService.showSuccessNotification(this.translateService.instant('kit.http.savedSuccessfully'))), catchError((err) => this.kitHttpErrorHandlerService.handleServerError(err)));
|
|
10079
|
+
}
|
|
10080
|
+
createUser(payload) {
|
|
10081
|
+
const url = `${this.baseUrl}users`;
|
|
10082
|
+
return this.httpClient.post(url, payload).pipe(tap(() => this.kitHttpErrorHandlerService.showSuccessNotification(this.translateService.instant('kit.http.savedSuccessfully'))), catchError((err) => this.kitHttpErrorHandlerService.handleServerError(err)));
|
|
10083
|
+
}
|
|
10084
|
+
deleteUser(id) {
|
|
10085
|
+
const url = `${this.baseUrl}users/${id}`;
|
|
10086
|
+
return this.httpClient.delete(url).pipe(tap(() => this.kitHttpErrorHandlerService.showSuccessNotification(this.translateService.instant('kit.http.removedSuccessfully'))), catchError((err) => this.kitHttpErrorHandlerService.handleServerError(err)));
|
|
10087
|
+
}
|
|
10088
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
10089
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersService }); }
|
|
10090
|
+
}
|
|
10091
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersService, decorators: [{
|
|
10092
|
+
type: Injectable
|
|
10093
|
+
}] });
|
|
9860
10094
|
|
|
9861
10095
|
const KIT_USERS_SETTINGS_STATE_TOKEN = new StateToken('usersSettings');
|
|
9862
10096
|
let KitUsersSettingsState = class KitUsersSettingsState {
|
|
9863
10097
|
constructor() {
|
|
9864
|
-
this.
|
|
10098
|
+
this.kitUsersService = inject(KitUsersService);
|
|
9865
10099
|
}
|
|
9866
10100
|
fetchUsers(ctx, action) {
|
|
9867
10101
|
ctx.patchState({
|
|
9868
10102
|
users: { ...ctx.getState().users, loading: true },
|
|
9869
10103
|
});
|
|
9870
|
-
return this.
|
|
10104
|
+
return this.kitUsersService.fetchUsers(action.payload).pipe(tap(data => {
|
|
9871
10105
|
ctx.patchState({
|
|
9872
10106
|
users: {
|
|
9873
10107
|
loading: false,
|
|
@@ -9890,7 +10124,7 @@ let KitUsersSettingsState = class KitUsersSettingsState {
|
|
|
9890
10124
|
ctx.patchState({
|
|
9891
10125
|
userDetails: { loading: true, data: null },
|
|
9892
10126
|
});
|
|
9893
|
-
return this.
|
|
10127
|
+
return this.kitUsersService.fetchUserDetails(action.payload).pipe(tap(data => {
|
|
9894
10128
|
ctx.patchState({
|
|
9895
10129
|
userDetails: {
|
|
9896
10130
|
loading: false,
|
|
@@ -9911,7 +10145,7 @@ let KitUsersSettingsState = class KitUsersSettingsState {
|
|
|
9911
10145
|
loading: true,
|
|
9912
10146
|
},
|
|
9913
10147
|
});
|
|
9914
|
-
return this.
|
|
10148
|
+
return this.kitUsersService.updateUserDetails(action.payload).pipe(tap(data => {
|
|
9915
10149
|
const state = ctx.getState();
|
|
9916
10150
|
ctx.patchState({
|
|
9917
10151
|
users: {
|
|
@@ -9934,34 +10168,30 @@ let KitUsersSettingsState = class KitUsersSettingsState {
|
|
|
9934
10168
|
}));
|
|
9935
10169
|
}
|
|
9936
10170
|
createUser(ctx, action) {
|
|
9937
|
-
|
|
9938
|
-
users: {
|
|
9939
|
-
...ctx.getState().users,
|
|
9940
|
-
loading: true,
|
|
9941
|
-
},
|
|
9942
|
-
});
|
|
9943
|
-
return this.kitUsersSettingsService.createUser(action.payload).pipe(finalize(() => {
|
|
10171
|
+
return this.kitUsersService.createUser(action.payload).pipe(tap(data => {
|
|
9944
10172
|
ctx.patchState({
|
|
9945
|
-
|
|
9946
|
-
...ctx.getState().users,
|
|
10173
|
+
userDetails: {
|
|
9947
10174
|
loading: false,
|
|
10175
|
+
data,
|
|
9948
10176
|
},
|
|
9949
10177
|
});
|
|
9950
10178
|
}));
|
|
9951
10179
|
}
|
|
9952
10180
|
deleteUser(ctx, action) {
|
|
9953
|
-
return this.
|
|
10181
|
+
return this.kitUsersService.deleteUser(action.payload).pipe(tap(() => {
|
|
9954
10182
|
const state = ctx.getState();
|
|
9955
|
-
const
|
|
10183
|
+
const filteredData = state.users.data.filter(user => user.id !== action.payload);
|
|
10184
|
+
const wasDeleted = filteredData.length < state.users.data.length;
|
|
9956
10185
|
ctx.patchState({
|
|
9957
10186
|
users: {
|
|
9958
|
-
|
|
9959
|
-
data:
|
|
9960
|
-
total:
|
|
10187
|
+
loading: false,
|
|
10188
|
+
data: filteredData,
|
|
10189
|
+
total: wasDeleted ? (state.users.total ?? 1) - 1 : state.users.total,
|
|
10190
|
+
},
|
|
10191
|
+
userDetails: {
|
|
10192
|
+
data: null,
|
|
10193
|
+
loading: false,
|
|
9961
10194
|
},
|
|
9962
|
-
userDetails: state.userDetails.data?.id === action.payload
|
|
9963
|
-
? { ...state.userDetails, data: null }
|
|
9964
|
-
: state.userDetails,
|
|
9965
10195
|
});
|
|
9966
10196
|
}));
|
|
9967
10197
|
}
|
|
@@ -9969,10 +10199,10 @@ let KitUsersSettingsState = class KitUsersSettingsState {
|
|
|
9969
10199
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsState }); }
|
|
9970
10200
|
};
|
|
9971
10201
|
__decorate([
|
|
9972
|
-
Action(KitFetchUsersSettings)
|
|
10202
|
+
Action(KitFetchUsersSettings, { cancelUncompleted: true })
|
|
9973
10203
|
], KitUsersSettingsState.prototype, "fetchUsers", null);
|
|
9974
10204
|
__decorate([
|
|
9975
|
-
Action(KitFetchUsersSettingsDetails)
|
|
10205
|
+
Action(KitFetchUsersSettingsDetails, { cancelUncompleted: true })
|
|
9976
10206
|
], KitUsersSettingsState.prototype, "fetchUserDetails", null);
|
|
9977
10207
|
__decorate([
|
|
9978
10208
|
Action(KitUpdateUsersSettingsDetails)
|
|
@@ -10006,10 +10236,6 @@ var KitUsersSettingsDetailsField;
|
|
|
10006
10236
|
KitUsersSettingsDetailsField["MFA"] = "mfaEnabled";
|
|
10007
10237
|
KitUsersSettingsDetailsField["FORCE_PASSWORD"] = "forcePassword";
|
|
10008
10238
|
})(KitUsersSettingsDetailsField || (KitUsersSettingsDetailsField = {}));
|
|
10009
|
-
const kitUsersSettingsDetailsFormServerErrorFieldMap = {
|
|
10010
|
-
[KitUsersSettingsServerErrorTitle.PASSWORD_TOO_WEAK]: KitUsersSettingsDetailsField.PASSWORD,
|
|
10011
|
-
[KitUsersSettingsServerErrorTitle.INVALID_USER_NAME]: KitUsersSettingsDetailsField.USER_NAME,
|
|
10012
|
-
};
|
|
10013
10239
|
|
|
10014
10240
|
class KitUsersSettingsDetailsFormComponent {
|
|
10015
10241
|
constructor() {
|
|
@@ -10017,7 +10243,8 @@ class KitUsersSettingsDetailsFormComponent {
|
|
|
10017
10243
|
this.store = inject(Store);
|
|
10018
10244
|
this.kitFormErrors = inject(KitFormErrors);
|
|
10019
10245
|
this.destroyRef = inject(DestroyRef);
|
|
10020
|
-
this.
|
|
10246
|
+
this.isCreateMode = input(false, ...(ngDevMode ? [{ debugName: "isCreateMode" }] : /* istanbul ignore next */ []));
|
|
10247
|
+
this.updated = output();
|
|
10021
10248
|
this.usersSettingsState = this.store.selectSignal(KIT_USERS_SETTINGS_STATE_TOKEN);
|
|
10022
10249
|
this.userDetails = computed(() => this.usersSettingsState().userDetails, ...(ngDevMode ? [{ debugName: "userDetails" }] : /* istanbul ignore next */ []));
|
|
10023
10250
|
this.kitUsersSettingsDetailsField = KitUsersSettingsDetailsField;
|
|
@@ -10033,55 +10260,61 @@ class KitUsersSettingsDetailsFormComponent {
|
|
|
10033
10260
|
[KitUsersSettingsDetailsField.MFA]: this.formBuilder.nonNullable.control(false),
|
|
10034
10261
|
[KitUsersSettingsDetailsField.FORCE_PASSWORD]: this.formBuilder.nonNullable.control(false),
|
|
10035
10262
|
});
|
|
10263
|
+
this.isSaving = signal(false, ...(ngDevMode ? [{ debugName: "isSaving" }] : /* istanbul ignore next */ []));
|
|
10264
|
+
this.lastPatchedUserId = null;
|
|
10036
10265
|
effect(() => {
|
|
10037
|
-
if (!this.
|
|
10266
|
+
if (!this.isCreateMode()) {
|
|
10038
10267
|
const { data: userDetails, loading } = this.userDetails();
|
|
10039
10268
|
loading ? this.form.disable({ emitEvent: false }) : this.form.enable({ emitEvent: false });
|
|
10040
|
-
if (userDetails) {
|
|
10269
|
+
if (userDetails && userDetails.id !== this.lastPatchedUserId) {
|
|
10270
|
+
this.lastPatchedUserId = userDetails.id;
|
|
10041
10271
|
this.patchForm(userDetails);
|
|
10042
10272
|
}
|
|
10043
10273
|
}
|
|
10044
10274
|
});
|
|
10045
10275
|
}
|
|
10046
10276
|
ngOnInit() {
|
|
10047
|
-
if (this.
|
|
10277
|
+
if (this.isCreateMode()) {
|
|
10048
10278
|
this.enablePasswordControl();
|
|
10049
10279
|
}
|
|
10050
10280
|
}
|
|
10051
|
-
getTextboxState(
|
|
10052
|
-
|
|
10053
|
-
return control?.touched && control?.invalid && control?.dirty
|
|
10054
|
-
? KitTextboxState.ERROR
|
|
10055
|
-
: KitTextboxState.DEFAULT;
|
|
10281
|
+
getTextboxState(form, controlName) {
|
|
10282
|
+
return this.kitFormErrors.getErrors(form.controls[controlName]).length && KitTextboxState.ERROR || KitTextboxState.DEFAULT;
|
|
10056
10283
|
}
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
if (!control || !(control.touched || control.dirty)) {
|
|
10060
|
-
return undefined;
|
|
10061
|
-
}
|
|
10062
|
-
if (control.errors?.['serverError']) {
|
|
10063
|
-
return control.errors['serverError'];
|
|
10064
|
-
}
|
|
10065
|
-
return this.kitFormErrors.getErrors(control)[0];
|
|
10284
|
+
getFormErrorMessages(form, controlName) {
|
|
10285
|
+
return this.kitFormErrors.getErrors(form.controls[controlName]).join('. ');
|
|
10066
10286
|
}
|
|
10067
10287
|
submit() {
|
|
10068
|
-
|
|
10288
|
+
this.isSaving.set(true);
|
|
10289
|
+
return this.isCreateMode()
|
|
10069
10290
|
? this.createUser()
|
|
10070
10291
|
: this.updateUser();
|
|
10071
10292
|
}
|
|
10072
10293
|
createUser() {
|
|
10073
|
-
return this.store.dispatch(new KitCreateUsersSettingsUser(this.form.getRawValue())).pipe(takeUntilDestroyed(this.destroyRef),
|
|
10294
|
+
return this.store.dispatch(new KitCreateUsersSettingsUser(this.form.getRawValue())).pipe(takeUntilDestroyed(this.destroyRef), map(() => this.userDetails().data), catchError(() => {
|
|
10295
|
+
this.form.setErrors({ serverError: true });
|
|
10296
|
+
return EMPTY;
|
|
10297
|
+
}), finalize(() => this.isSaving.set(false)));
|
|
10074
10298
|
}
|
|
10075
10299
|
updateUser() {
|
|
10076
10300
|
const id = this.userDetails().data?.id;
|
|
10077
10301
|
if (!id) {
|
|
10302
|
+
this.isSaving.set(false);
|
|
10078
10303
|
return EMPTY;
|
|
10079
10304
|
}
|
|
10080
10305
|
const { password, forcePassword, ...userDetails } = this.form.getRawValue();
|
|
10081
10306
|
return this.store.dispatch(new KitUpdateUsersSettingsDetails({
|
|
10082
10307
|
...userDetails,
|
|
10083
10308
|
id,
|
|
10084
|
-
})).pipe(takeUntilDestroyed(this.destroyRef),
|
|
10309
|
+
})).pipe(takeUntilDestroyed(this.destroyRef), map(() => this.userDetails().data), tap(updatedUser => {
|
|
10310
|
+
this.form.markAsPristine();
|
|
10311
|
+
if (updatedUser) {
|
|
10312
|
+
this.updated.emit(updatedUser);
|
|
10313
|
+
}
|
|
10314
|
+
}), catchError(() => {
|
|
10315
|
+
this.form.setErrors({ serverError: true });
|
|
10316
|
+
return EMPTY;
|
|
10317
|
+
}), finalize(() => this.isSaving.set(false)));
|
|
10085
10318
|
}
|
|
10086
10319
|
enablePasswordControl() {
|
|
10087
10320
|
const passwordControl = this.form.get(KitUsersSettingsDetailsField.PASSWORD);
|
|
@@ -10100,23 +10333,8 @@ class KitUsersSettingsDetailsFormComponent {
|
|
|
10100
10333
|
[KitUsersSettingsDetailsField.FORCE_PASSWORD]: false,
|
|
10101
10334
|
}, { emitEvent: false });
|
|
10102
10335
|
}
|
|
10103
|
-
handleSubmitError(error) {
|
|
10104
|
-
this.applyServerError(error?.error?.title ?? '');
|
|
10105
|
-
return EMPTY;
|
|
10106
|
-
}
|
|
10107
|
-
applyServerError(title) {
|
|
10108
|
-
const field = kitUsersSettingsDetailsFormServerErrorFieldMap[title];
|
|
10109
|
-
const translationKey = kitUsersSettingsErrorTranslationMap[title];
|
|
10110
|
-
const control = this.form.get(field);
|
|
10111
|
-
if (!field || !translationKey || !control) {
|
|
10112
|
-
return;
|
|
10113
|
-
}
|
|
10114
|
-
control.setErrors({ serverError: translationKey });
|
|
10115
|
-
control.markAsTouched();
|
|
10116
|
-
control.markAsDirty();
|
|
10117
|
-
}
|
|
10118
10336
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsDetailsFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10119
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitUsersSettingsDetailsFormComponent, isStandalone: true, selector: "kit-users-settings-details-form", inputs: {
|
|
10337
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitUsersSettingsDetailsFormComponent, isStandalone: true, selector: "kit-users-settings-details-form", inputs: { isCreateMode: { classPropertyName: "isCreateMode", publicName: "isCreateMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { updated: "updated" }, providers: [KitFormErrors], ngImport: i0, template: "<form class=\"kit-user-settings-details-form\"\n [formGroup]=\"form\">\n <kit-textbox [formControlName]=\"kitUsersSettingsDetailsField.USER_NAME\"\n [label]=\"'kit.usersSettings.details.loginId' | translate\"\n [readonly]=\"!isCreateMode()\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsDetailsField.USER_NAME)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsDetailsField.USER_NAME) | translate\"></kit-textbox>\n <kit-textbox [formControlName]=\"kitUsersSettingsDetailsField.FIRST_NAME\"\n [label]=\"'kit.usersSettings.details.firstName' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsDetailsField.FIRST_NAME)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsDetailsField.FIRST_NAME) | translate\"></kit-textbox>\n <kit-textbox [formControlName]=\"kitUsersSettingsDetailsField.LAST_NAME\"\n [label]=\"'kit.usersSettings.details.lastName' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsDetailsField.LAST_NAME)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsDetailsField.LAST_NAME) | translate\"></kit-textbox>\n <kit-textbox [formControlName]=\"kitUsersSettingsDetailsField.EMAIL\"\n [label]=\"'kit.usersSettings.details.email' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsDetailsField.EMAIL)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsDetailsField.EMAIL) | translate\"></kit-textbox>\n @if (isCreateMode()) {\n <kit-textbox type=\"password\"\n [formControlName]=\"kitUsersSettingsDetailsField.PASSWORD\"\n [label]=\"'kit.usersSettings.details.password' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsDetailsField.PASSWORD)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsDetailsField.PASSWORD) | translate\"></kit-textbox>\n }\n <div class=\"kit-user-settings-details-form-toggles\">\n <kit-toggle class=\"kit-user-settings-details-form-toggle\"\n [formControlName]=\"kitUsersSettingsDetailsField.MFA\"\n [label]=\"'kit.usersSettings.details.mfa' | translate\"></kit-toggle>\n @if (isCreateMode()) {\n <kit-toggle class=\"kit-user-settings-details-form-toggle\"\n [formControlName]=\"kitUsersSettingsDetailsField.FORCE_PASSWORD\"\n [label]=\"'kit.usersSettings.details.forcePassword' | translate\"></kit-toggle>\n }\n </div>\n</form>\n", styles: [".kit-user-settings-details-form{display:flex;flex-direction:column;gap:10px;width:100%}.kit-user-settings-details-form-toggles{display:flex;width:100%;gap:20px}.kit-user-settings-details-form-toggle{width:100%}.kit-user-settings-details-form-toggle ::ng-deep .kit-toggle{display:flex;align-items:center;gap:15px;justify-content:space-between;width:100%}.kit-user-settings-details-form-toggle ::ng-deep .kit-form-label{margin:0}\n"], dependencies: [{ kind: "component", type: KitTextboxComponent, selector: "kit-textbox", inputs: ["placeholder", "label", "labelTooltip", "defaultValue", "messageIcon", "messageText", "messageTemplate", "disabled", "maxlength", "state", "size", "icon", "clearButton", "showStateIcon", "readonly", "customStateIcon", "type"], outputs: ["defaultValueChange", "disabledChange", "blured", "focused", "changed"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$8.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: KitToggleComponent, selector: "kit-toggle", inputs: ["label", "disabled", "readonly", "defaultChecked", "leftLabel", "rightLabel", "messageIcon", "messageText", "size"], outputs: ["disabledChange", "defaultCheckedChange", "changed"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10120
10338
|
}
|
|
10121
10339
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsDetailsFormComponent, decorators: [{
|
|
10122
10340
|
type: Component,
|
|
@@ -10125,49 +10343,74 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
10125
10343
|
KitTextboxComponent,
|
|
10126
10344
|
ReactiveFormsModule,
|
|
10127
10345
|
KitToggleComponent,
|
|
10128
|
-
], providers: [KitFormErrors], template: "<form class=\"kit-user-settings-details-form\"\n [formGroup]=\"form\">\n <kit-textbox [formControlName]=\"kitUsersSettingsDetailsField.USER_NAME\"\n [label]=\"'kit.usersSettings.details.loginId' | translate\"\n [state]=\"getTextboxState(kitUsersSettingsDetailsField.USER_NAME)\"\n [messageText]=\"
|
|
10129
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
10346
|
+
], providers: [KitFormErrors], template: "<form class=\"kit-user-settings-details-form\"\n [formGroup]=\"form\">\n <kit-textbox [formControlName]=\"kitUsersSettingsDetailsField.USER_NAME\"\n [label]=\"'kit.usersSettings.details.loginId' | translate\"\n [readonly]=\"!isCreateMode()\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsDetailsField.USER_NAME)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsDetailsField.USER_NAME) | translate\"></kit-textbox>\n <kit-textbox [formControlName]=\"kitUsersSettingsDetailsField.FIRST_NAME\"\n [label]=\"'kit.usersSettings.details.firstName' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsDetailsField.FIRST_NAME)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsDetailsField.FIRST_NAME) | translate\"></kit-textbox>\n <kit-textbox [formControlName]=\"kitUsersSettingsDetailsField.LAST_NAME\"\n [label]=\"'kit.usersSettings.details.lastName' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsDetailsField.LAST_NAME)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsDetailsField.LAST_NAME) | translate\"></kit-textbox>\n <kit-textbox [formControlName]=\"kitUsersSettingsDetailsField.EMAIL\"\n [label]=\"'kit.usersSettings.details.email' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsDetailsField.EMAIL)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsDetailsField.EMAIL) | translate\"></kit-textbox>\n @if (isCreateMode()) {\n <kit-textbox type=\"password\"\n [formControlName]=\"kitUsersSettingsDetailsField.PASSWORD\"\n [label]=\"'kit.usersSettings.details.password' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsDetailsField.PASSWORD)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsDetailsField.PASSWORD) | translate\"></kit-textbox>\n }\n <div class=\"kit-user-settings-details-form-toggles\">\n <kit-toggle class=\"kit-user-settings-details-form-toggle\"\n [formControlName]=\"kitUsersSettingsDetailsField.MFA\"\n [label]=\"'kit.usersSettings.details.mfa' | translate\"></kit-toggle>\n @if (isCreateMode()) {\n <kit-toggle class=\"kit-user-settings-details-form-toggle\"\n [formControlName]=\"kitUsersSettingsDetailsField.FORCE_PASSWORD\"\n [label]=\"'kit.usersSettings.details.forcePassword' | translate\"></kit-toggle>\n }\n </div>\n</form>\n", styles: [".kit-user-settings-details-form{display:flex;flex-direction:column;gap:10px;width:100%}.kit-user-settings-details-form-toggles{display:flex;width:100%;gap:20px}.kit-user-settings-details-form-toggle{width:100%}.kit-user-settings-details-form-toggle ::ng-deep .kit-toggle{display:flex;align-items:center;gap:15px;justify-content:space-between;width:100%}.kit-user-settings-details-form-toggle ::ng-deep .kit-form-label{margin:0}\n"] }]
|
|
10347
|
+
}], ctorParameters: () => [], propDecorators: { isCreateMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCreateMode", required: false }] }], updated: [{ type: i0.Output, args: ["updated"] }] } });
|
|
10130
10348
|
|
|
10131
|
-
class KitUsersSettingsCreateDialogComponent {
|
|
10349
|
+
class KitUsersSettingsCreateDialogComponent extends DialogContentBase {
|
|
10132
10350
|
constructor() {
|
|
10351
|
+
const dialog = inject(DialogRef);
|
|
10352
|
+
super(dialog);
|
|
10133
10353
|
this.destroyRef = inject(DestroyRef);
|
|
10134
10354
|
this.detailsForm = viewChild.required(KitUsersSettingsDetailsFormComponent);
|
|
10135
|
-
this.opened = model(false, ...(ngDevMode ? [{ debugName: "opened" }] : /* istanbul ignore next */ []));
|
|
10136
|
-
this.kitDialogType = KitDialogType;
|
|
10137
10355
|
this.kitButtonKind = KitButtonKind;
|
|
10138
10356
|
this.kitButtonType = KitButtonType;
|
|
10139
10357
|
}
|
|
10140
10358
|
get isFormDisabled() {
|
|
10141
|
-
return this.detailsForm().form.pristine || this.detailsForm().form.invalid;
|
|
10359
|
+
return this.detailsForm().form.pristine || this.detailsForm().form.invalid || this.detailsForm().isSaving();
|
|
10142
10360
|
}
|
|
10143
10361
|
onConfirm() {
|
|
10144
|
-
this.detailsForm().submit().pipe(takeUntilDestroyed(this.destroyRef)).subscribe(
|
|
10145
|
-
this.
|
|
10362
|
+
this.detailsForm().submit().pipe(takeUntilDestroyed(this.destroyRef)).subscribe(createdUser => {
|
|
10363
|
+
this.dialog.close(createdUser);
|
|
10146
10364
|
});
|
|
10147
10365
|
}
|
|
10148
10366
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsCreateDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10149
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
10367
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.4", type: KitUsersSettingsCreateDialogComponent, isStandalone: true, selector: "kit-users-settings-create-dialog", viewQueries: [{ propertyName: "detailsForm", first: true, predicate: KitUsersSettingsDetailsFormComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"kit-user-settings-create-dialog-content\">\n <kit-users-settings-details-form [isCreateMode]=\"true\" />\n</div>\n\n<kit-dialog-actions>\n <kit-button [label]=\"'kit.usersSettings.createDialog.cancel' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"dialog.close()\" />\n <kit-button [label]=\"'kit.usersSettings.createDialog.confirm' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [disabled]=\"isFormDisabled\"\n (clicked)=\"onConfirm()\" />\n</kit-dialog-actions>\n", styles: [".kit-user-settings-create-dialog-content{display:flex;flex-direction:column;gap:15px}\n"], dependencies: [{ kind: "component", type: KitDialogActionsComponent, selector: "kit-dialog-actions" }, { kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "component", type: KitUsersSettingsDetailsFormComponent, selector: "kit-users-settings-details-form", inputs: ["isCreateMode"], outputs: ["updated"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10150
10368
|
}
|
|
10151
10369
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsCreateDialogComponent, decorators: [{
|
|
10152
10370
|
type: Component,
|
|
10153
10371
|
args: [{ selector: 'kit-users-settings-create-dialog', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
10154
|
-
KitDialogComponent,
|
|
10155
|
-
KitDialogTitlebarComponent,
|
|
10156
10372
|
KitDialogActionsComponent,
|
|
10157
10373
|
KitButtonComponent,
|
|
10158
10374
|
TranslatePipe,
|
|
10159
10375
|
KitUsersSettingsDetailsFormComponent,
|
|
10160
|
-
], template: "
|
|
10161
|
-
}], propDecorators: { detailsForm: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitUsersSettingsDetailsFormComponent), { isSignal: true }] }]
|
|
10376
|
+
], template: "<div class=\"kit-user-settings-create-dialog-content\">\n <kit-users-settings-details-form [isCreateMode]=\"true\" />\n</div>\n\n<kit-dialog-actions>\n <kit-button [label]=\"'kit.usersSettings.createDialog.cancel' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"dialog.close()\" />\n <kit-button [label]=\"'kit.usersSettings.createDialog.confirm' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [disabled]=\"isFormDisabled\"\n (clicked)=\"onConfirm()\" />\n</kit-dialog-actions>\n", styles: [".kit-user-settings-create-dialog-content{display:flex;flex-direction:column;gap:15px}\n"] }]
|
|
10377
|
+
}], ctorParameters: () => [], propDecorators: { detailsForm: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitUsersSettingsDetailsFormComponent), { isSignal: true }] }] } });
|
|
10162
10378
|
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
;
|
|
10379
|
+
const KIT_GRID_COLUMN_WIDTH = 170;
|
|
10380
|
+
const KIT_GRID_PAGE_SIZE = 10;
|
|
10381
|
+
|
|
10382
|
+
var KitPermissionTypes;
|
|
10383
|
+
(function (KitPermissionTypes) {
|
|
10384
|
+
KitPermissionTypes["Create"] = "Create";
|
|
10385
|
+
KitPermissionTypes["Delete"] = "Delete";
|
|
10386
|
+
KitPermissionTypes["Edit"] = "Edit";
|
|
10387
|
+
KitPermissionTypes["View"] = "View";
|
|
10388
|
+
KitPermissionTypes["Set"] = "Set";
|
|
10389
|
+
KitPermissionTypes["Use"] = "Use";
|
|
10390
|
+
})(KitPermissionTypes || (KitPermissionTypes = {}));
|
|
10391
|
+
const defaultUserRolesSort = [{ field: 'name', dir: 'asc' }];
|
|
10392
|
+
const exportedUserRoleColumns = [
|
|
10393
|
+
kitBuildGridColumn('name', 'Name', 'string', false, false, KIT_GRID_COLUMN_WIDTH),
|
|
10394
|
+
];
|
|
10395
|
+
|
|
10396
|
+
class KitSkeletonSectionComponent {
|
|
10397
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitSkeletonSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10398
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: KitSkeletonSectionComponent, isStandalone: true, selector: "kit-skeleton-section", ngImport: i0, template: "<div class=\"kit-skeleton-section\">\n <kit-skeleton [height]=\"24\"\n [width]=\"250\"\n ></kit-skeleton>\n\n <kit-skeleton [height]=\"500\"\n ></kit-skeleton>\n</div>\n", styles: [".kit-skeleton-section{display:flex;flex-direction:column;gap:30px}\n"], dependencies: [{ kind: "component", type: KitSkeletonComponent, selector: "kit-skeleton", inputs: ["width", "height", "shape", "animation"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10399
|
+
}
|
|
10400
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitSkeletonSectionComponent, decorators: [{
|
|
10401
|
+
type: Component,
|
|
10402
|
+
args: [{ selector: 'kit-skeleton-section', imports: [
|
|
10403
|
+
KitSkeletonComponent,
|
|
10404
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"kit-skeleton-section\">\n <kit-skeleton [height]=\"24\"\n [width]=\"250\"\n ></kit-skeleton>\n\n <kit-skeleton [height]=\"500\"\n ></kit-skeleton>\n</div>\n", styles: [".kit-skeleton-section{display:flex;flex-direction:column;gap:30px}\n"] }]
|
|
10405
|
+
}] });
|
|
10406
|
+
|
|
10407
|
+
const kitUsersSettingsConfig = new InjectionToken('KitUsersSettingsConfig', {
|
|
10408
|
+
factory: () => {
|
|
10409
|
+
return {
|
|
10410
|
+
scopesComponent: null,
|
|
10411
|
+
};
|
|
10412
|
+
},
|
|
10413
|
+
});
|
|
10171
10414
|
|
|
10172
10415
|
var KitUsersSettingsEntitlementType;
|
|
10173
10416
|
(function (KitUsersSettingsEntitlementType) {
|
|
@@ -10181,7 +10424,7 @@ class KitUsersSettingsReferenceService {
|
|
|
10181
10424
|
this.baseUrl = `${trimTrailingSlash(inject(KIT_BASE_PATH))}/`;
|
|
10182
10425
|
}
|
|
10183
10426
|
getPartners() {
|
|
10184
|
-
const url = `${this.baseUrl}
|
|
10427
|
+
const url = `${this.baseUrl}partners`;
|
|
10185
10428
|
return this.httpClient.get(url, {
|
|
10186
10429
|
params: kitBuildHttpParams({ $orderby: 'name' }),
|
|
10187
10430
|
}).pipe(map((response) => response.data));
|
|
@@ -10219,10 +10462,11 @@ class KitUsersSettingsEntitlementsService {
|
|
|
10219
10462
|
constructor() {
|
|
10220
10463
|
this.httpClient = inject(HttpClient);
|
|
10221
10464
|
this.baseUrl = `${trimTrailingSlash(inject(KIT_BASE_PATH))}/`;
|
|
10465
|
+
this.kitHttpErrorHandlerService = inject(KitHttpErrorHandlerService);
|
|
10222
10466
|
}
|
|
10223
10467
|
getUserEntitlements(id) {
|
|
10224
10468
|
const url = `${this.baseUrl}users/${id}/identities`;
|
|
10225
|
-
return this.httpClient.get(url);
|
|
10469
|
+
return this.httpClient.get(url).pipe(catchError((err) => this.kitHttpErrorHandlerService.handleServerError(err)));
|
|
10226
10470
|
}
|
|
10227
10471
|
getEntitlementDetails(userId, entitlementId) {
|
|
10228
10472
|
const url = `${this.baseUrl}users/${userId}/identities/${entitlementId}`;
|
|
@@ -10230,15 +10474,15 @@ class KitUsersSettingsEntitlementsService {
|
|
|
10230
10474
|
}
|
|
10231
10475
|
createEntitlement(userId, payload) {
|
|
10232
10476
|
const url = `${this.baseUrl}users/${userId}/identities`;
|
|
10233
|
-
return this.httpClient.post(url, payload);
|
|
10477
|
+
return this.httpClient.post(url, payload).pipe(catchError((err) => this.kitHttpErrorHandlerService.handleServerError(err)));
|
|
10234
10478
|
}
|
|
10235
10479
|
updateEntitlement(userId, entitlementId, payload) {
|
|
10236
10480
|
const url = `${this.baseUrl}users/${userId}/identities/${entitlementId}`;
|
|
10237
|
-
return this.httpClient.put(url, payload);
|
|
10481
|
+
return this.httpClient.put(url, payload).pipe(catchError((err) => this.kitHttpErrorHandlerService.handleServerError(err)));
|
|
10238
10482
|
}
|
|
10239
10483
|
deleteEntitlement(userId, entitlementId) {
|
|
10240
10484
|
const url = `${this.baseUrl}users/${userId}/identities/${entitlementId}`;
|
|
10241
|
-
return this.httpClient.delete(url);
|
|
10485
|
+
return this.httpClient.delete(url).pipe(catchError((err) => this.kitHttpErrorHandlerService.handleServerError(err)));
|
|
10242
10486
|
}
|
|
10243
10487
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
10244
10488
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsService }); }
|
|
@@ -10250,14 +10494,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
10250
10494
|
const KIT_USERS_SETTINGS_ENTITLEMENTS_STATE_TOKEN = new StateToken('usersSettingsEntitlements');
|
|
10251
10495
|
let KitUsersSettingsEntitlementsState = class KitUsersSettingsEntitlementsState {
|
|
10252
10496
|
constructor() {
|
|
10253
|
-
this.
|
|
10497
|
+
this.kitUserService = inject(KitUsersSettingsEntitlementsService);
|
|
10254
10498
|
}
|
|
10255
10499
|
fetchUserEntitlements(ctx, action) {
|
|
10256
10500
|
const currentState = ctx.getState();
|
|
10257
10501
|
ctx.patchState({
|
|
10258
10502
|
userEntitlements: { ...currentState.userEntitlements, loading: true },
|
|
10259
10503
|
});
|
|
10260
|
-
return this.
|
|
10504
|
+
return this.kitUserService.getUserEntitlements(action.payload).pipe(tap(data => {
|
|
10261
10505
|
ctx.patchState({
|
|
10262
10506
|
userEntitlements: {
|
|
10263
10507
|
loading: false,
|
|
@@ -10275,7 +10519,7 @@ let KitUsersSettingsEntitlementsState = class KitUsersSettingsEntitlementsState
|
|
|
10275
10519
|
ctx.patchState({
|
|
10276
10520
|
userEntitlementDetails: { loading: true, data: null },
|
|
10277
10521
|
});
|
|
10278
|
-
return this.
|
|
10522
|
+
return this.kitUserService.getEntitlementDetails(action.payload.userId, action.payload.entitlementId).pipe(tap(data => {
|
|
10279
10523
|
ctx.patchState({
|
|
10280
10524
|
userEntitlementDetails: { loading: false, data },
|
|
10281
10525
|
});
|
|
@@ -10287,7 +10531,7 @@ let KitUsersSettingsEntitlementsState = class KitUsersSettingsEntitlementsState
|
|
|
10287
10531
|
}));
|
|
10288
10532
|
}
|
|
10289
10533
|
deleteEntitlement(ctx, action) {
|
|
10290
|
-
return this.
|
|
10534
|
+
return this.kitUserService.deleteEntitlement(action.payload.userId, action.payload.entitlementId).pipe(tap(() => {
|
|
10291
10535
|
const currentState = ctx.getState();
|
|
10292
10536
|
ctx.patchState({
|
|
10293
10537
|
userEntitlements: {
|
|
@@ -10299,7 +10543,7 @@ let KitUsersSettingsEntitlementsState = class KitUsersSettingsEntitlementsState
|
|
|
10299
10543
|
}));
|
|
10300
10544
|
}
|
|
10301
10545
|
createEntitlement(ctx, action) {
|
|
10302
|
-
return this.
|
|
10546
|
+
return this.kitUserService.createEntitlement(action.payload.userId, action.payload.payload).pipe(tap(data => {
|
|
10303
10547
|
const currentState = ctx.getState();
|
|
10304
10548
|
ctx.patchState({
|
|
10305
10549
|
userEntitlements: {
|
|
@@ -10318,8 +10562,13 @@ let KitUsersSettingsEntitlementsState = class KitUsersSettingsEntitlementsState
|
|
|
10318
10562
|
}));
|
|
10319
10563
|
}
|
|
10320
10564
|
updateEntitlement(ctx, action) {
|
|
10321
|
-
return this.
|
|
10565
|
+
return this.kitUserService.updateEntitlement(action.payload.userId, action.payload.entitlementId, action.payload.payload).pipe(tap(data => {
|
|
10566
|
+
const currentState = ctx.getState();
|
|
10322
10567
|
ctx.patchState({
|
|
10568
|
+
userEntitlements: {
|
|
10569
|
+
...currentState.userEntitlements,
|
|
10570
|
+
data: currentState.userEntitlements.data.map(entitlement => (entitlement.id === data.id ? { ...entitlement, alias: data.alias, type: data.type } : entitlement)),
|
|
10571
|
+
},
|
|
10323
10572
|
userEntitlementDetails: { loading: false, data },
|
|
10324
10573
|
});
|
|
10325
10574
|
}), catchError(err => {
|
|
@@ -10363,94 +10612,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
10363
10612
|
type: Injectable
|
|
10364
10613
|
}], propDecorators: { fetchUserEntitlements: [], fetchUserEntitlementDetails: [], deleteEntitlement: [], createEntitlement: [], updateEntitlement: [] } });
|
|
10365
10614
|
|
|
10615
|
+
var KitUsersSettingsEntitlementsField;
|
|
10616
|
+
(function (KitUsersSettingsEntitlementsField) {
|
|
10617
|
+
KitUsersSettingsEntitlementsField["IDENTITY_TYPE"] = "identityType";
|
|
10618
|
+
KitUsersSettingsEntitlementsField["PARTNERS"] = "partners";
|
|
10619
|
+
KitUsersSettingsEntitlementsField["ALIAS"] = "alias";
|
|
10620
|
+
KitUsersSettingsEntitlementsField["ROLES"] = "roles";
|
|
10621
|
+
KitUsersSettingsEntitlementsField["SCOPES"] = "scopes";
|
|
10622
|
+
})(KitUsersSettingsEntitlementsField || (KitUsersSettingsEntitlementsField = {}));
|
|
10623
|
+
;
|
|
10624
|
+
|
|
10366
10625
|
class KitUsersSettingsEntitlementsFormComponent {
|
|
10367
10626
|
constructor() {
|
|
10368
10627
|
this.formBuilder = inject(FormBuilder);
|
|
10369
10628
|
this.store = inject(Store);
|
|
10370
|
-
this.
|
|
10629
|
+
this.kitFormErrors = inject(KitFormErrors);
|
|
10371
10630
|
this.referenceService = inject(KitUsersSettingsReferenceService);
|
|
10631
|
+
this.config = inject(kitUsersSettingsConfig);
|
|
10372
10632
|
this.isCreating = input(false, ...(ngDevMode ? [{ debugName: "isCreating" }] : /* istanbul ignore next */ []));
|
|
10373
10633
|
this.showIdentityType = input.required(...(ngDevMode ? [{ debugName: "showIdentityType" }] : /* istanbul ignore next */ []));
|
|
10374
|
-
this.identityTypeItems = computed(() => [
|
|
10375
|
-
{
|
|
10376
|
-
text: this.translateService.instant('kit.common.selectValue'),
|
|
10377
|
-
value: null,
|
|
10378
|
-
},
|
|
10379
|
-
...Object.values(KitUsersSettingsEntitlementType).map((value) => ({ text: value, value })),
|
|
10380
|
-
], ...(ngDevMode ? [{ debugName: "identityTypeItems" }] : /* istanbul ignore next */ []));
|
|
10634
|
+
this.identityTypeItems = computed(() => Object.values(KitUsersSettingsEntitlementType).map((value) => ({ text: value, value })), ...(ngDevMode ? [{ debugName: "identityTypeItems" }] : /* istanbul ignore next */ []));
|
|
10381
10635
|
this.kitUsersSettingsEntitlementsField = KitUsersSettingsEntitlementsField;
|
|
10382
10636
|
this.form = this.formBuilder.group({
|
|
10383
|
-
[KitUsersSettingsEntitlementsField.IDENTITY_TYPE]: this.formBuilder.control(null),
|
|
10637
|
+
[KitUsersSettingsEntitlementsField.IDENTITY_TYPE]: this.formBuilder.control(null, Validators.required),
|
|
10384
10638
|
[KitUsersSettingsEntitlementsField.PARTNERS]: this.formBuilder.control(null),
|
|
10385
10639
|
[KitUsersSettingsEntitlementsField.ALIAS]: this.formBuilder.nonNullable.control('', Validators.required),
|
|
10386
10640
|
[KitUsersSettingsEntitlementsField.ROLES]: this.formBuilder.control(null, Validators.required),
|
|
10641
|
+
[KitUsersSettingsEntitlementsField.SCOPES]: this.formBuilder.control(null),
|
|
10387
10642
|
});
|
|
10643
|
+
this.scopesComponent = this.config.scopesComponent ?? null;
|
|
10388
10644
|
this.kitUsersSettingsEntitlementType = KitUsersSettingsEntitlementType;
|
|
10389
10645
|
this.roleItems = computed(() => this.roles().map((role) => ({
|
|
10390
10646
|
text: role.name,
|
|
10391
10647
|
value: role.id.toString(),
|
|
10392
10648
|
})), ...(ngDevMode ? [{ debugName: "roleItems" }] : /* istanbul ignore next */ []));
|
|
10393
|
-
this.partnerItems = computed(() => {
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
this.userEntitlements = computed(() => this.store.selectSignal(KIT_USERS_SETTINGS_ENTITLEMENTS_STATE_TOKEN)().userEntitlements, ...(ngDevMode ? [{ debugName: "userEntitlements" }] : /* istanbul ignore next */ []));
|
|
10407
|
-
this.userEntitlementDetails = computed(() => (this.store.selectSignal(KIT_USERS_SETTINGS_ENTITLEMENTS_STATE_TOKEN)().userEntitlementDetails.data), ...(ngDevMode ? [{ debugName: "userEntitlementDetails" }] : /* istanbul ignore next */ []));
|
|
10408
|
-
this.userId = computed(() => (this.store.selectSignal(KIT_USERS_SETTINGS_STATE_TOKEN)().userDetails.data?.id ?? null), ...(ngDevMode ? [{ debugName: "userId" }] : /* istanbul ignore next */ []));
|
|
10649
|
+
this.partnerItems = computed(() => this.partners().map((partner) => ({
|
|
10650
|
+
text: partner.name,
|
|
10651
|
+
value: partner.id.toString(),
|
|
10652
|
+
})), ...(ngDevMode ? [{ debugName: "partnerItems" }] : /* istanbul ignore next */ []));
|
|
10653
|
+
this.loading = computed(() => !this.isCreating() && (this.entitlementsState().userEntitlementDetails.loading || this.userEntitlements().loading), ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
10654
|
+
this.showPartnersControl = computed(() => this.creatingFormContext().identityType === KitUsersSettingsEntitlementType.USER && this.showIdentityType(), ...(ngDevMode ? [{ debugName: "showPartnersControl" }] : /* istanbul ignore next */ []));
|
|
10655
|
+
this.isSaving = signal(false, ...(ngDevMode ? [{ debugName: "isSaving" }] : /* istanbul ignore next */ []));
|
|
10656
|
+
this.getTextboxState = getTextboxState;
|
|
10657
|
+
this.entitlementsState = this.store.selectSignal(KIT_USERS_SETTINGS_ENTITLEMENTS_STATE_TOKEN);
|
|
10658
|
+
this.usersSettingsState = this.store.selectSignal(KIT_USERS_SETTINGS_STATE_TOKEN);
|
|
10659
|
+
this.userEntitlements = computed(() => this.entitlementsState().userEntitlements, ...(ngDevMode ? [{ debugName: "userEntitlements" }] : /* istanbul ignore next */ []));
|
|
10660
|
+
this.userEntitlementDetails = computed(() => this.entitlementsState().userEntitlementDetails.data, ...(ngDevMode ? [{ debugName: "userEntitlementDetails" }] : /* istanbul ignore next */ []));
|
|
10661
|
+
this.userId = computed(() => this.usersSettingsState().userDetails.data?.id ?? null, ...(ngDevMode ? [{ debugName: "userId" }] : /* istanbul ignore next */ []));
|
|
10409
10662
|
this.partners = signal([], ...(ngDevMode ? [{ debugName: "partners" }] : /* istanbul ignore next */ []));
|
|
10410
10663
|
this.roles = signal([], ...(ngDevMode ? [{ debugName: "roles" }] : /* istanbul ignore next */ []));
|
|
10664
|
+
this.creatingFormContext = toSignal(merge(this.form.controls[KitUsersSettingsEntitlementsField.IDENTITY_TYPE].valueChanges, this.form.controls[KitUsersSettingsEntitlementsField.PARTNERS].valueChanges).pipe(startWith(null), map(() => ({
|
|
10665
|
+
identityType: this.form.controls[KitUsersSettingsEntitlementsField.IDENTITY_TYPE].value,
|
|
10666
|
+
partnerId: this.form.controls[KitUsersSettingsEntitlementsField.PARTNERS].value,
|
|
10667
|
+
}))), { initialValue: { identityType: null, partnerId: null } });
|
|
10411
10668
|
effect(() => this.updateFormFields());
|
|
10412
10669
|
effect(() => this.loadFormData());
|
|
10413
|
-
effect(() => this.
|
|
10670
|
+
effect(() => this.updatePartnersValidator());
|
|
10414
10671
|
}
|
|
10415
|
-
|
|
10416
|
-
return this.
|
|
10417
|
-
|
|
10672
|
+
isControlInvalid(form, controlName) {
|
|
10673
|
+
return !!this.kitFormErrors.getErrors(form.controls[controlName]).length;
|
|
10674
|
+
}
|
|
10675
|
+
getFormErrorMessages(form, controlName) {
|
|
10676
|
+
return this.kitFormErrors.getErrors(form.controls[controlName]).join('. ');
|
|
10418
10677
|
}
|
|
10419
10678
|
submit() {
|
|
10420
10679
|
const userId = this.userId();
|
|
10421
10680
|
if (!userId) {
|
|
10422
|
-
return;
|
|
10681
|
+
return of(false);
|
|
10423
10682
|
}
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
return;
|
|
10683
|
+
const formValue = this.form.getRawValue();
|
|
10684
|
+
const action = this.isCreating()
|
|
10685
|
+
? new KitCreateUsersSettingsEntitlement({ userId, payload: this.buildCreatePayload(formValue) })
|
|
10686
|
+
: this.buildUpdateAction(userId, formValue);
|
|
10687
|
+
if (!action) {
|
|
10688
|
+
return of(false);
|
|
10431
10689
|
}
|
|
10432
|
-
this.
|
|
10690
|
+
this.isSaving.set(true);
|
|
10691
|
+
return this.dispatchAndMarkPristine(action);
|
|
10433
10692
|
}
|
|
10434
|
-
|
|
10435
|
-
const formValue = this.form.getRawValue();
|
|
10693
|
+
buildUpdateAction(userId, formValue) {
|
|
10436
10694
|
const entitlementDetails = this.userEntitlementDetails();
|
|
10437
10695
|
if (!entitlementDetails) {
|
|
10438
|
-
return;
|
|
10696
|
+
return null;
|
|
10439
10697
|
}
|
|
10440
|
-
|
|
10441
|
-
this.dispatchAndMarkPristine(new KitUpdateUsersSettingsEntitlement({
|
|
10698
|
+
return new KitUpdateUsersSettingsEntitlement({
|
|
10442
10699
|
userId,
|
|
10443
10700
|
entitlementId: entitlementDetails.id,
|
|
10444
|
-
payload:
|
|
10445
|
-
})
|
|
10701
|
+
payload: this.buildUpdatePayload(formValue, entitlementDetails, userId),
|
|
10702
|
+
});
|
|
10446
10703
|
}
|
|
10447
|
-
buildCreatePayload() {
|
|
10448
|
-
const formValue = this.form.getRawValue();
|
|
10704
|
+
buildCreatePayload(formValue) {
|
|
10449
10705
|
return {
|
|
10450
10706
|
alias: formValue.alias,
|
|
10451
10707
|
type: formValue.identityType ?? undefined,
|
|
10452
10708
|
roles: (formValue.roles ?? []).map(Number),
|
|
10453
10709
|
partnerId: this.resolvePartnerId(formValue.identityType, formValue.partners),
|
|
10710
|
+
scopes: formValue.scopes ?? undefined,
|
|
10454
10711
|
};
|
|
10455
10712
|
}
|
|
10456
10713
|
buildUpdatePayload(formValue, entitlementDetails, userId) {
|
|
@@ -10461,7 +10718,7 @@ class KitUsersSettingsEntitlementsFormComponent {
|
|
|
10461
10718
|
alias: formValue.alias,
|
|
10462
10719
|
partnerId: this.resolvePartnerId(formValue.identityType, formValue.partners),
|
|
10463
10720
|
roles: (formValue.roles ?? []).map(Number),
|
|
10464
|
-
scopes: entitlementDetails.scopes,
|
|
10721
|
+
scopes: formValue.scopes ?? entitlementDetails.scopes,
|
|
10465
10722
|
};
|
|
10466
10723
|
}
|
|
10467
10724
|
resolvePartnerId(identityType, partnerId) {
|
|
@@ -10471,18 +10728,10 @@ class KitUsersSettingsEntitlementsFormComponent {
|
|
|
10471
10728
|
return undefined;
|
|
10472
10729
|
}
|
|
10473
10730
|
dispatchAndMarkPristine(action) {
|
|
10474
|
-
this.store.dispatch(action).pipe(tap(() => this.form.markAsPristine()))
|
|
10475
|
-
|
|
10476
|
-
|
|
10477
|
-
|
|
10478
|
-
if (disabled) {
|
|
10479
|
-
this.form.get(KitUsersSettingsEntitlementsField.ALIAS)?.disable();
|
|
10480
|
-
this.form.get(KitUsersSettingsEntitlementsField.ROLES)?.disable();
|
|
10481
|
-
}
|
|
10482
|
-
else {
|
|
10483
|
-
this.form.get(KitUsersSettingsEntitlementsField.ALIAS)?.enable();
|
|
10484
|
-
this.form.get(KitUsersSettingsEntitlementsField.ROLES)?.enable();
|
|
10485
|
-
}
|
|
10731
|
+
return this.store.dispatch(action).pipe(tap(() => this.form.markAsPristine()), map(() => true), catchError(() => {
|
|
10732
|
+
this.form.setErrors({ serverError: true });
|
|
10733
|
+
return of(false);
|
|
10734
|
+
}), finalize(() => this.isSaving.set(false)));
|
|
10486
10735
|
}
|
|
10487
10736
|
updateFormFields() {
|
|
10488
10737
|
const userEntitlementDetails = this.userEntitlementDetails();
|
|
@@ -10492,12 +10741,23 @@ class KitUsersSettingsEntitlementsFormComponent {
|
|
|
10492
10741
|
[KitUsersSettingsEntitlementsField.PARTNERS]: userEntitlementDetails.partnerId?.toString() ?? null,
|
|
10493
10742
|
[KitUsersSettingsEntitlementsField.ALIAS]: userEntitlementDetails.alias,
|
|
10494
10743
|
[KitUsersSettingsEntitlementsField.ROLES]: userEntitlementDetails.roles?.map(String) ?? null,
|
|
10744
|
+
[KitUsersSettingsEntitlementsField.SCOPES]: userEntitlementDetails.scopes ?? null,
|
|
10495
10745
|
});
|
|
10496
10746
|
this.form.get(KitUsersSettingsEntitlementsField.IDENTITY_TYPE)?.disable();
|
|
10497
10747
|
this.form.get(KitUsersSettingsEntitlementsField.PARTNERS)?.disable();
|
|
10498
10748
|
this.form.markAsPristine();
|
|
10499
10749
|
}
|
|
10500
10750
|
}
|
|
10751
|
+
updatePartnersValidator() {
|
|
10752
|
+
const partnersControl = this.form.get(KitUsersSettingsEntitlementsField.PARTNERS);
|
|
10753
|
+
if (this.showPartnersControl()) {
|
|
10754
|
+
partnersControl?.addValidators(Validators.required);
|
|
10755
|
+
}
|
|
10756
|
+
else {
|
|
10757
|
+
partnersControl?.removeValidators(Validators.required);
|
|
10758
|
+
}
|
|
10759
|
+
partnersControl?.updateValueAndValidity({ emitEvent: false });
|
|
10760
|
+
}
|
|
10501
10761
|
loadFormData() {
|
|
10502
10762
|
const context = this.getFormDataContext();
|
|
10503
10763
|
if (!context) {
|
|
@@ -10509,11 +10769,10 @@ class KitUsersSettingsEntitlementsFormComponent {
|
|
|
10509
10769
|
}
|
|
10510
10770
|
getFormDataContext() {
|
|
10511
10771
|
if (this.isCreating()) {
|
|
10512
|
-
const
|
|
10513
|
-
const formIdentityType = this.form.value[KitUsersSettingsEntitlementsField.IDENTITY_TYPE] ?? null;
|
|
10772
|
+
const { identityType, partnerId } = this.creatingFormContext();
|
|
10514
10773
|
return {
|
|
10515
|
-
partnerId:
|
|
10516
|
-
identityType
|
|
10774
|
+
partnerId: Number(partnerId) || null,
|
|
10775
|
+
identityType,
|
|
10517
10776
|
};
|
|
10518
10777
|
}
|
|
10519
10778
|
const details = this.userEntitlementDetails();
|
|
@@ -10538,10 +10797,11 @@ class KitUsersSettingsEntitlementsFormComponent {
|
|
|
10538
10797
|
})).subscribe();
|
|
10539
10798
|
}
|
|
10540
10799
|
buildRolesFilter(identityType, partnerId) {
|
|
10541
|
-
const
|
|
10542
|
-
if (!identityType ||
|
|
10800
|
+
const isUserWithoutPartner = identityType === KitUsersSettingsEntitlementType.USER && !partnerId;
|
|
10801
|
+
if (!identityType || !this.showIdentityType() || isUserWithoutPartner) {
|
|
10543
10802
|
return undefined;
|
|
10544
10803
|
}
|
|
10804
|
+
const filters = [];
|
|
10545
10805
|
if (identityType === KitUsersSettingsEntitlementType.ADMIN) {
|
|
10546
10806
|
const adminFilter = {
|
|
10547
10807
|
field: 'type',
|
|
@@ -10571,7 +10831,7 @@ class KitUsersSettingsEntitlementsFormComponent {
|
|
|
10571
10831
|
}).replace('$filter=', '');
|
|
10572
10832
|
}
|
|
10573
10833
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10574
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitUsersSettingsEntitlementsFormComponent, isStandalone: true, selector: "kit-users-settings-entitlements-form", inputs: { isCreating: { classPropertyName: "isCreating", publicName: "isCreating", isSignal: true, isRequired: false, transformFunction: null }, showIdentityType: { classPropertyName: "showIdentityType", publicName: "showIdentityType", isSignal: true, isRequired: true, transformFunction: null } }, providers: [KitFormErrors], ngImport: i0, template: "<form class=\"kit-user-settings-entitlements-form\"
|
|
10834
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitUsersSettingsEntitlementsFormComponent, isStandalone: true, selector: "kit-users-settings-entitlements-form", inputs: { isCreating: { classPropertyName: "isCreating", publicName: "isCreating", isSignal: true, isRequired: false, transformFunction: null }, showIdentityType: { classPropertyName: "showIdentityType", publicName: "showIdentityType", isSignal: true, isRequired: true, transformFunction: null } }, providers: [KitFormErrors], ngImport: i0, template: "<form [formGroup]=\"form\">\n @if (loading()) {\n <kit-skeleton-section />\n }\n <div class=\"kit-user-settings-entitlements-form\">\n @if (showIdentityType()) {\n <kit-dropdown [formControlName]=\"kitUsersSettingsEntitlementsField.IDENTITY_TYPE\"\n [items]=\"identityTypeItems()\"\n [label]=\"'kit.usersSettings.entitlements.identityType' | translate\"\n [invalid]=\"isControlInvalid(form, kitUsersSettingsEntitlementsField.IDENTITY_TYPE)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsEntitlementsField.IDENTITY_TYPE) | translate\"\n (selected)=\"form.get(kitUsersSettingsEntitlementsField.ROLES)?.reset()\" />\n }\n @if (showPartnersControl()) {\n <kit-dropdown [formControlName]=\"kitUsersSettingsEntitlementsField.PARTNERS\"\n [items]=\"partnerItems()\"\n [label]=\"'kit.usersSettings.entitlements.partners' | translate\"\n [invalid]=\"isControlInvalid(form, kitUsersSettingsEntitlementsField.PARTNERS)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsEntitlementsField.PARTNERS) | translate\"\n (selected)=\"form.get(kitUsersSettingsEntitlementsField.ROLES)?.reset()\" />\n }\n <kit-textbox [formControlName]=\"kitUsersSettingsEntitlementsField.ALIAS\"\n [label]=\"'kit.usersSettings.entitlements.alias' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form.get(kitUsersSettingsEntitlementsField.ALIAS))\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsEntitlementsField.ALIAS) | translate\" />\n <kit-multiselect [formControlName]=\"kitUsersSettingsEntitlementsField.ROLES\"\n [items]=\"roleItems()\"\n [label]=\"'kit.usersSettings.entitlements.roles' | translate\"\n [invalid]=\"isControlInvalid(form, kitUsersSettingsEntitlementsField.ROLES)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsEntitlementsField.ROLES) | translate\" />\n @if (scopesComponent) {\n <ng-container *ngComponentOutlet=\"scopesComponent; inputs: { form: form }\" />\n }\n </div>\n</form>\n", styles: [".kit-user-settings-entitlements-form{display:flex;flex-direction:column;gap:10px;width:100%}\n"], dependencies: [{ kind: "component", type: KitTextboxComponent, selector: "kit-textbox", inputs: ["placeholder", "label", "labelTooltip", "defaultValue", "messageIcon", "messageText", "messageTemplate", "disabled", "maxlength", "state", "size", "icon", "clearButton", "showStateIcon", "readonly", "customStateIcon", "type"], outputs: ["defaultValueChange", "disabledChange", "blured", "focused", "changed"] }, { kind: "component", type: KitDropdownComponent, selector: "kit-dropdown", inputs: ["items", "selectedItem", "label", "disabled", "messageIcon", "messageText", "invalid", "defaultItem", "listHeight", "hideDefaultItem", "toggleIcon", "popupSettings", "isValuePrimitive", "footerTemplate", "noDataTemplate", "readonly", "size"], outputs: ["selectedItemChange", "disabledChange", "selected"] }, { kind: "component", type: KitMultiselectComponent, selector: "kit-multiselect", inputs: ["items", "selectedItems", "label", "disabled", "placeholder", "autoClose", "messageIcon", "messageText", "shouldAddAllAsOption", "allOptionLabel", "tagMapper", "size", "useCheckboxes", "popupClass", "listHeight", "allowCustom", "invalid", "filterable", "itemsDirection", "autoSummaryTag", "autoSummaryTagContainerClass", "fallbackGroupChipWidth", "showCheckIcon"], outputs: ["disabledChange", "changed"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$8.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: KitSkeletonSectionComponent, selector: "kit-skeleton-section" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10575
10835
|
}
|
|
10576
10836
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsFormComponent, decorators: [{
|
|
10577
10837
|
type: Component,
|
|
@@ -10581,11 +10841,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
10581
10841
|
KitDropdownComponent,
|
|
10582
10842
|
KitMultiselectComponent,
|
|
10583
10843
|
ReactiveFormsModule,
|
|
10584
|
-
|
|
10844
|
+
NgComponentOutlet,
|
|
10845
|
+
KitSkeletonSectionComponent,
|
|
10846
|
+
], providers: [KitFormErrors], template: "<form [formGroup]=\"form\">\n @if (loading()) {\n <kit-skeleton-section />\n }\n <div class=\"kit-user-settings-entitlements-form\">\n @if (showIdentityType()) {\n <kit-dropdown [formControlName]=\"kitUsersSettingsEntitlementsField.IDENTITY_TYPE\"\n [items]=\"identityTypeItems()\"\n [label]=\"'kit.usersSettings.entitlements.identityType' | translate\"\n [invalid]=\"isControlInvalid(form, kitUsersSettingsEntitlementsField.IDENTITY_TYPE)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsEntitlementsField.IDENTITY_TYPE) | translate\"\n (selected)=\"form.get(kitUsersSettingsEntitlementsField.ROLES)?.reset()\" />\n }\n @if (showPartnersControl()) {\n <kit-dropdown [formControlName]=\"kitUsersSettingsEntitlementsField.PARTNERS\"\n [items]=\"partnerItems()\"\n [label]=\"'kit.usersSettings.entitlements.partners' | translate\"\n [invalid]=\"isControlInvalid(form, kitUsersSettingsEntitlementsField.PARTNERS)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsEntitlementsField.PARTNERS) | translate\"\n (selected)=\"form.get(kitUsersSettingsEntitlementsField.ROLES)?.reset()\" />\n }\n <kit-textbox [formControlName]=\"kitUsersSettingsEntitlementsField.ALIAS\"\n [label]=\"'kit.usersSettings.entitlements.alias' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form.get(kitUsersSettingsEntitlementsField.ALIAS))\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsEntitlementsField.ALIAS) | translate\" />\n <kit-multiselect [formControlName]=\"kitUsersSettingsEntitlementsField.ROLES\"\n [items]=\"roleItems()\"\n [label]=\"'kit.usersSettings.entitlements.roles' | translate\"\n [invalid]=\"isControlInvalid(form, kitUsersSettingsEntitlementsField.ROLES)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsEntitlementsField.ROLES) | translate\" />\n @if (scopesComponent) {\n <ng-container *ngComponentOutlet=\"scopesComponent; inputs: { form: form }\" />\n }\n </div>\n</form>\n", styles: [".kit-user-settings-entitlements-form{display:flex;flex-direction:column;gap:10px;width:100%}\n"] }]
|
|
10585
10847
|
}], ctorParameters: () => [], propDecorators: { isCreating: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCreating", required: false }] }], showIdentityType: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIdentityType", required: true }] }] } });
|
|
10586
10848
|
|
|
10587
10849
|
class KitUsersSettingsCreateEntitlementDialogComponent {
|
|
10588
10850
|
constructor() {
|
|
10851
|
+
this.destroyRef = inject(DestroyRef);
|
|
10589
10852
|
this.entitlementsForm = viewChild.required(KitUsersSettingsEntitlementsFormComponent);
|
|
10590
10853
|
this.showIdentityType = input.required(...(ngDevMode ? [{ debugName: "showIdentityType" }] : /* istanbul ignore next */ []));
|
|
10591
10854
|
this.opened = model(false, ...(ngDevMode ? [{ debugName: "opened" }] : /* istanbul ignore next */ []));
|
|
@@ -10594,17 +10857,20 @@ class KitUsersSettingsCreateEntitlementDialogComponent {
|
|
|
10594
10857
|
this.kitButtonType = KitButtonType;
|
|
10595
10858
|
}
|
|
10596
10859
|
get isFormDisabled() {
|
|
10597
|
-
return this.entitlementsForm().form.pristine || this.entitlementsForm().form.invalid;
|
|
10860
|
+
return this.entitlementsForm().form.pristine || this.entitlementsForm().form.invalid || this.entitlementsForm().isSaving();
|
|
10598
10861
|
}
|
|
10599
10862
|
onConfirm() {
|
|
10600
|
-
this.entitlementsForm().submit()
|
|
10601
|
-
|
|
10863
|
+
this.entitlementsForm().submit().pipe(takeUntilDestroyed(this.destroyRef)).subscribe(success => {
|
|
10864
|
+
if (success) {
|
|
10865
|
+
this.opened.set(false);
|
|
10866
|
+
}
|
|
10867
|
+
});
|
|
10602
10868
|
}
|
|
10603
10869
|
onClose() {
|
|
10604
10870
|
this.opened.set(false);
|
|
10605
10871
|
}
|
|
10606
10872
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsCreateEntitlementDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10607
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitUsersSettingsCreateEntitlementDialogComponent, isStandalone: true, selector: "kit-users-settings-create-entitlement-dialog", inputs: { showIdentityType: { classPropertyName: "showIdentityType", publicName: "showIdentityType", isSignal: true, isRequired: true, transformFunction: null }, opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "openedChange" }, viewQueries: [{ propertyName: "entitlementsForm", first: true, predicate: KitUsersSettingsEntitlementsFormComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@if (opened()) {\n <kit-dialog class=\"kit-user-settings-create-entitlement-dialog\"\n [type]=\"kitDialogType.Declarative\">\n <kit-dialog-titlebar (closed)=\"onClose()\">\n {{ \"kit.usersSettings.profile.createEntitlement\" | translate }}\n </kit-dialog-titlebar>\n\n <div class=\"kit-user-settings-create-entitlement-dialog-content\">\n <kit-users-settings-entitlements-form [showIdentityType]=\"showIdentityType()\"\n [isCreating]=\"true\" />\n </div>\n\n <kit-dialog-actions>\n <kit-button [label]=\"'kit.usersSettings.createDialog.cancel' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"onClose()\" />\n <kit-button [label]=\"'kit.usersSettings.createDialog.confirm' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [disabled]=\"isFormDisabled\"\n (clicked)=\"onConfirm()\" />\n </kit-dialog-actions>\n </kit-dialog>\n}\n", styles: [".kit-user-settings-create-entitlement-dialog-content{
|
|
10873
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitUsersSettingsCreateEntitlementDialogComponent, isStandalone: true, selector: "kit-users-settings-create-entitlement-dialog", inputs: { showIdentityType: { classPropertyName: "showIdentityType", publicName: "showIdentityType", isSignal: true, isRequired: true, transformFunction: null }, opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "openedChange" }, viewQueries: [{ propertyName: "entitlementsForm", first: true, predicate: KitUsersSettingsEntitlementsFormComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@if (opened()) {\n <kit-dialog class=\"kit-user-settings-create-entitlement-dialog\"\n [type]=\"kitDialogType.Declarative\">\n <kit-dialog-titlebar (closed)=\"onClose()\">\n {{ \"kit.usersSettings.profile.createEntitlement\" | translate }}\n </kit-dialog-titlebar>\n\n <div class=\"dialog-content kit-user-settings-create-entitlement-dialog-content\">\n <kit-users-settings-entitlements-form [showIdentityType]=\"showIdentityType()\"\n [isCreating]=\"true\" />\n </div>\n\n <kit-dialog-actions>\n <kit-button [label]=\"'kit.usersSettings.createDialog.cancel' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"onClose()\" />\n <kit-button [label]=\"'kit.usersSettings.createDialog.confirm' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [disabled]=\"isFormDisabled\"\n (clicked)=\"onConfirm()\" />\n </kit-dialog-actions>\n </kit-dialog>\n}\n", styles: [".kit-user-settings-create-entitlement-dialog-content{width:600px;padding:15px 20px}\n"], dependencies: [{ kind: "component", type: KitDialogComponent, selector: "kit-dialog", inputs: ["type", "backUrl"] }, { kind: "component", type: KitDialogTitlebarComponent, selector: "kit-dialog-titlebar", outputs: ["closed"] }, { kind: "component", type: KitDialogActionsComponent, selector: "kit-dialog-actions" }, { kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "component", type: KitUsersSettingsEntitlementsFormComponent, selector: "kit-users-settings-entitlements-form", inputs: ["isCreating", "showIdentityType"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10608
10874
|
}
|
|
10609
10875
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsCreateEntitlementDialogComponent, decorators: [{
|
|
10610
10876
|
type: Component,
|
|
@@ -10615,71 +10881,151 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
10615
10881
|
KitButtonComponent,
|
|
10616
10882
|
TranslatePipe,
|
|
10617
10883
|
KitUsersSettingsEntitlementsFormComponent,
|
|
10618
|
-
], template: "@if (opened()) {\n <kit-dialog class=\"kit-user-settings-create-entitlement-dialog\"\n [type]=\"kitDialogType.Declarative\">\n <kit-dialog-titlebar (closed)=\"onClose()\">\n {{ \"kit.usersSettings.profile.createEntitlement\" | translate }}\n </kit-dialog-titlebar>\n\n <div class=\"kit-user-settings-create-entitlement-dialog-content\">\n <kit-users-settings-entitlements-form [showIdentityType]=\"showIdentityType()\"\n [isCreating]=\"true\" />\n </div>\n\n <kit-dialog-actions>\n <kit-button [label]=\"'kit.usersSettings.createDialog.cancel' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"onClose()\" />\n <kit-button [label]=\"'kit.usersSettings.createDialog.confirm' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [disabled]=\"isFormDisabled\"\n (clicked)=\"onConfirm()\" />\n </kit-dialog-actions>\n </kit-dialog>\n}\n", styles: [".kit-user-settings-create-entitlement-dialog-content{
|
|
10884
|
+
], template: "@if (opened()) {\n <kit-dialog class=\"kit-user-settings-create-entitlement-dialog\"\n [type]=\"kitDialogType.Declarative\">\n <kit-dialog-titlebar (closed)=\"onClose()\">\n {{ \"kit.usersSettings.profile.createEntitlement\" | translate }}\n </kit-dialog-titlebar>\n\n <div class=\"dialog-content kit-user-settings-create-entitlement-dialog-content\">\n <kit-users-settings-entitlements-form [showIdentityType]=\"showIdentityType()\"\n [isCreating]=\"true\" />\n </div>\n\n <kit-dialog-actions>\n <kit-button [label]=\"'kit.usersSettings.createDialog.cancel' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"onClose()\" />\n <kit-button [label]=\"'kit.usersSettings.createDialog.confirm' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [disabled]=\"isFormDisabled\"\n (clicked)=\"onConfirm()\" />\n </kit-dialog-actions>\n </kit-dialog>\n}\n", styles: [".kit-user-settings-create-entitlement-dialog-content{width:600px;padding:15px 20px}\n"] }]
|
|
10619
10885
|
}], propDecorators: { entitlementsForm: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitUsersSettingsEntitlementsFormComponent), { isSignal: true }] }], showIdentityType: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIdentityType", required: true }] }], opened: [{ type: i0.Input, args: [{ isSignal: true, alias: "opened", required: false }] }, { type: i0.Output, args: ["openedChange"] }] } });
|
|
10620
10886
|
|
|
10621
|
-
|
|
10622
|
-
(function (KitUsersSettingsPasswordDialogField) {
|
|
10623
|
-
KitUsersSettingsPasswordDialogField["PASSWORD"] = "password";
|
|
10624
|
-
KitUsersSettingsPasswordDialogField["REPEAT_PASSWORD"] = "repeatPassword";
|
|
10625
|
-
KitUsersSettingsPasswordDialogField["FORCE_PASSWORD"] = "forcePassword";
|
|
10626
|
-
})(KitUsersSettingsPasswordDialogField || (KitUsersSettingsPasswordDialogField = {}));
|
|
10627
|
-
|
|
10628
|
-
class KitUsersSettingsPasswordDialogComponent {
|
|
10887
|
+
class KitUsersSettingsEntitlementsComponent {
|
|
10629
10888
|
constructor() {
|
|
10630
|
-
this.kitFormErrors = inject(KitFormErrors);
|
|
10631
|
-
this.formBuilder = inject(FormBuilder);
|
|
10632
10889
|
this.store = inject(Store);
|
|
10633
|
-
this.
|
|
10634
|
-
this.
|
|
10635
|
-
this.
|
|
10636
|
-
this.
|
|
10637
|
-
this.
|
|
10638
|
-
this.
|
|
10639
|
-
this.
|
|
10640
|
-
this.
|
|
10641
|
-
this.
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
}, { validators: this.passwordsMatchValidator });
|
|
10890
|
+
this.entitlementsForm = viewChild(KitUsersSettingsEntitlementsFormComponent, ...(ngDevMode ? [{ debugName: "entitlementsForm" }] : /* istanbul ignore next */ []));
|
|
10891
|
+
this.collapsedList = viewChild(KitCollapsedListComponent, ...(ngDevMode ? [{ debugName: "collapsedList" }] : /* istanbul ignore next */ []));
|
|
10892
|
+
this.showIdentityType = input.required(...(ngDevMode ? [{ debugName: "showIdentityType" }] : /* istanbul ignore next */ []));
|
|
10893
|
+
this.userEntitlements = computed(() => this.store.selectSignal(KIT_USERS_SETTINGS_ENTITLEMENTS_STATE_TOKEN)().userEntitlements, ...(ngDevMode ? [{ debugName: "userEntitlements" }] : /* istanbul ignore next */ []));
|
|
10894
|
+
this.userEntitlementDetails = computed(() => this.store.selectSignal(KIT_USERS_SETTINGS_ENTITLEMENTS_STATE_TOKEN)().userEntitlementDetails, ...(ngDevMode ? [{ debugName: "userEntitlementDetails" }] : /* istanbul ignore next */ []));
|
|
10895
|
+
this.userDetailsId = computed(() => (this.store.selectSignal(KIT_USERS_SETTINGS_STATE_TOKEN)().userDetails.data?.id), ...(ngDevMode ? [{ debugName: "userDetailsId" }] : /* istanbul ignore next */ []));
|
|
10896
|
+
this.entitlementItems = computed(() => this.userEntitlements().data.map(entitlement => ({ text: entitlement.alias, value: String(entitlement.id) })), ...(ngDevMode ? [{ debugName: "entitlementItems" }] : /* istanbul ignore next */ []));
|
|
10897
|
+
this.selectedEntitlementId = signal(null, ...(ngDevMode ? [{ debugName: "selectedEntitlementId" }] : /* istanbul ignore next */ []));
|
|
10898
|
+
this.knownEntitlementIds = [];
|
|
10899
|
+
effect(() => this.fetchEntitlements());
|
|
10900
|
+
effect(() => this.fetchEntitlementDetails());
|
|
10901
|
+
effect(() => this.syncSelectedEntitlement());
|
|
10646
10902
|
}
|
|
10647
|
-
get
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
const
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
isTouchedAndDirty;
|
|
10657
|
-
return hasFieldError || hasMatchError ? KitTextboxState.ERROR : KitTextboxState.DEFAULT;
|
|
10658
|
-
}
|
|
10659
|
-
getTextboxMessageText(field) {
|
|
10660
|
-
const control = this.form.get(field);
|
|
10661
|
-
if (!control || !(control.touched || control.dirty)) {
|
|
10662
|
-
return undefined;
|
|
10663
|
-
}
|
|
10664
|
-
if (field === 'repeatPassword' && this.form.errors?.['passwordsMismatch'] && control.dirty) {
|
|
10665
|
-
return 'kit.usersSettings.passwordDialog.passwordsDoNotMatch';
|
|
10666
|
-
}
|
|
10667
|
-
if (control.errors?.['serverError']) {
|
|
10668
|
-
return control.errors['serverError'];
|
|
10903
|
+
get isSaveBtnDisabled() {
|
|
10904
|
+
const formComponent = this.entitlementsForm();
|
|
10905
|
+
return !formComponent || formComponent.form.pristine || formComponent.form.invalid || formComponent.isSaving();
|
|
10906
|
+
}
|
|
10907
|
+
selectItem(item) {
|
|
10908
|
+
const collapsedList = this.collapsedList();
|
|
10909
|
+
if (collapsedList) {
|
|
10910
|
+
collapsedList.setSelectedItem(item);
|
|
10911
|
+
this.selectedEntitlementId.set(+item.value);
|
|
10669
10912
|
}
|
|
10670
|
-
|
|
10913
|
+
;
|
|
10671
10914
|
}
|
|
10672
|
-
|
|
10915
|
+
submit() {
|
|
10916
|
+
return this.entitlementsForm()?.submit() ?? of(false);
|
|
10917
|
+
}
|
|
10918
|
+
fetchEntitlements() {
|
|
10919
|
+
const userId = this.userDetailsId();
|
|
10920
|
+
if (userId) {
|
|
10921
|
+
this.selectedEntitlementId.set(null);
|
|
10922
|
+
this.knownEntitlementIds = [];
|
|
10923
|
+
this.store.dispatch(new KitFetchUsersSettingsEntitlements(userId));
|
|
10924
|
+
}
|
|
10925
|
+
}
|
|
10926
|
+
syncSelectedEntitlement() {
|
|
10927
|
+
const entitlements = this.userEntitlements().data;
|
|
10928
|
+
const previousKnownIds = this.knownEntitlementIds;
|
|
10929
|
+
this.knownEntitlementIds = entitlements.map(entitlement => entitlement.id);
|
|
10930
|
+
const selectedId = this.selectedEntitlementId();
|
|
10931
|
+
if (selectedId === null) {
|
|
10932
|
+
if (entitlements[0]) {
|
|
10933
|
+
this.selectItem({ text: entitlements[0].alias, value: String(entitlements[0].id) });
|
|
10934
|
+
}
|
|
10935
|
+
return;
|
|
10936
|
+
}
|
|
10937
|
+
if (entitlements.some(entitlement => entitlement.id === selectedId)) {
|
|
10938
|
+
const newEntitlement = entitlements.find(entitlement => !previousKnownIds.includes(entitlement.id));
|
|
10939
|
+
if (newEntitlement) {
|
|
10940
|
+
this.selectItem({ text: newEntitlement.alias, value: String(newEntitlement.id) });
|
|
10941
|
+
}
|
|
10942
|
+
return;
|
|
10943
|
+
}
|
|
10944
|
+
const previousIndex = previousKnownIds.indexOf(selectedId);
|
|
10945
|
+
const nextItemToSelect = entitlements[Math.min(previousIndex, entitlements.length - 1)];
|
|
10946
|
+
if (nextItemToSelect) {
|
|
10947
|
+
this.selectItem({ text: nextItemToSelect.alias, value: String(nextItemToSelect.id) });
|
|
10948
|
+
}
|
|
10949
|
+
else {
|
|
10950
|
+
this.selectedEntitlementId.set(null);
|
|
10951
|
+
}
|
|
10952
|
+
}
|
|
10953
|
+
fetchEntitlementDetails() {
|
|
10954
|
+
const entitlementId = this.selectedEntitlementId();
|
|
10955
|
+
const userId = this.userDetailsId();
|
|
10956
|
+
if (entitlementId && userId) {
|
|
10957
|
+
this.store.dispatch(new KitFetchUsersSettingsEntitlementDetails({
|
|
10958
|
+
userId,
|
|
10959
|
+
entitlementId,
|
|
10960
|
+
}));
|
|
10961
|
+
}
|
|
10962
|
+
}
|
|
10963
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10964
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitUsersSettingsEntitlementsComponent, isStandalone: true, selector: "kit-users-settings-entitlements", inputs: { showIdentityType: { classPropertyName: "showIdentityType", publicName: "showIdentityType", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "entitlementsForm", first: true, predicate: KitUsersSettingsEntitlementsFormComponent, descendants: true, isSignal: true }, { propertyName: "collapsedList", first: true, predicate: KitCollapsedListComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"kit-users-settings-entitlements\">\n @if (userEntitlements().loading) {\n <kit-skeleton-section />\n } @else {\n @if (userEntitlements().data.length) {\n <kit-collapsed-list [itemList]=\"entitlementItems()\"\n (selectItem)=\"selectItem($event)\" />\n <kit-users-settings-entitlements-form [showIdentityType]=\"showIdentityType()\" />\n } @else {\n <kit-empty-section [text]=\"'kit.usersSettings.entitlements.empty' | translate\" />\n }\n }\n</div>\n", styles: [".kit-users-settings-entitlements{display:flex;flex-direction:column;gap:16px}\n"], dependencies: [{ kind: "component", type: KitCollapsedListComponent, selector: "kit-collapsed-list", inputs: ["itemList", "lineHeight", "dropdownDefaultValueText", "gap", "disableActions", "itemTemplate", "dropdownFooterTemplate", "dropdownItemTemplate", "dropdownNoDataTemplate", "appendTo", "alwaysShowDropdown", "dropdownAlign"], outputs: ["selectItem"] }, { kind: "component", type: KitUsersSettingsEntitlementsFormComponent, selector: "kit-users-settings-entitlements-form", inputs: ["isCreating", "showIdentityType"] }, { kind: "component", type: KitEmptySectionComponent, selector: "kit-empty-section", inputs: ["text", "size"] }, { kind: "component", type: KitSkeletonSectionComponent, selector: "kit-skeleton-section" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10965
|
+
}
|
|
10966
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsComponent, decorators: [{
|
|
10967
|
+
type: Component,
|
|
10968
|
+
args: [{ selector: 'kit-users-settings-entitlements', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
10969
|
+
KitCollapsedListComponent,
|
|
10970
|
+
KitUsersSettingsEntitlementsFormComponent,
|
|
10971
|
+
KitEmptySectionComponent,
|
|
10972
|
+
TranslatePipe,
|
|
10973
|
+
KitSkeletonSectionComponent,
|
|
10974
|
+
], template: "<div class=\"kit-users-settings-entitlements\">\n @if (userEntitlements().loading) {\n <kit-skeleton-section />\n } @else {\n @if (userEntitlements().data.length) {\n <kit-collapsed-list [itemList]=\"entitlementItems()\"\n (selectItem)=\"selectItem($event)\" />\n <kit-users-settings-entitlements-form [showIdentityType]=\"showIdentityType()\" />\n } @else {\n <kit-empty-section [text]=\"'kit.usersSettings.entitlements.empty' | translate\" />\n }\n }\n</div>\n", styles: [".kit-users-settings-entitlements{display:flex;flex-direction:column;gap:16px}\n"] }]
|
|
10975
|
+
}], ctorParameters: () => [], propDecorators: { entitlementsForm: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitUsersSettingsEntitlementsFormComponent), { isSignal: true }] }], collapsedList: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitCollapsedListComponent), { isSignal: true }] }], showIdentityType: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIdentityType", required: true }] }] } });
|
|
10976
|
+
|
|
10977
|
+
var KitUsersSettingsPasswordDialogField;
|
|
10978
|
+
(function (KitUsersSettingsPasswordDialogField) {
|
|
10979
|
+
KitUsersSettingsPasswordDialogField["PASSWORD"] = "password";
|
|
10980
|
+
KitUsersSettingsPasswordDialogField["REPEAT_PASSWORD"] = "repeatPassword";
|
|
10981
|
+
KitUsersSettingsPasswordDialogField["FORCE_PASSWORD"] = "forcePassword";
|
|
10982
|
+
})(KitUsersSettingsPasswordDialogField || (KitUsersSettingsPasswordDialogField = {}));
|
|
10983
|
+
|
|
10984
|
+
class KitUsersSettingsPasswordDialogComponent extends DialogContentBase {
|
|
10985
|
+
constructor() {
|
|
10986
|
+
const dialog = inject(DialogRef);
|
|
10987
|
+
super(dialog);
|
|
10988
|
+
this.kitFormErrors = inject(KitFormErrors);
|
|
10989
|
+
this.formBuilder = inject(FormBuilder);
|
|
10990
|
+
this.store = inject(Store);
|
|
10991
|
+
this.destroyRef = inject(DestroyRef);
|
|
10992
|
+
this.usersSettingsState = this.store.selectSignal(KIT_USERS_SETTINGS_STATE_TOKEN);
|
|
10993
|
+
this.userDetails = computed(() => this.usersSettingsState().userDetails, ...(ngDevMode ? [{ debugName: "userDetails" }] : /* istanbul ignore next */ []));
|
|
10994
|
+
this.kitDialogType = KitDialogType;
|
|
10995
|
+
this.kitButtonKind = KitButtonKind;
|
|
10996
|
+
this.kitButtonType = KitButtonType;
|
|
10997
|
+
this.kitUsersSettingsPasswordDialogField = KitUsersSettingsPasswordDialogField;
|
|
10998
|
+
this.form = this.formBuilder.group({
|
|
10999
|
+
[KitUsersSettingsPasswordDialogField.PASSWORD]: this.formBuilder.nonNullable.control('', Validators.required),
|
|
11000
|
+
[KitUsersSettingsPasswordDialogField.REPEAT_PASSWORD]: this.formBuilder.nonNullable.control('', Validators.required),
|
|
11001
|
+
[KitUsersSettingsPasswordDialogField.FORCE_PASSWORD]: this.formBuilder.nonNullable.control(false),
|
|
11002
|
+
}, { validators: this.passwordsMatchValidator });
|
|
11003
|
+
this.isSaving = signal(false, ...(ngDevMode ? [{ debugName: "isSaving" }] : /* istanbul ignore next */ []));
|
|
11004
|
+
}
|
|
11005
|
+
get isFormDisabled() {
|
|
11006
|
+
return this.form.pristine || this.form.invalid || this.isSaving();
|
|
11007
|
+
}
|
|
11008
|
+
getTextboxState(form, controlName) {
|
|
11009
|
+
return this.getFieldErrors(form, controlName).length && KitTextboxState.ERROR || KitTextboxState.DEFAULT;
|
|
11010
|
+
}
|
|
11011
|
+
getFormErrorMessages(form, controlName) {
|
|
11012
|
+
return this.getFieldErrors(form, controlName).join('. ');
|
|
11013
|
+
}
|
|
11014
|
+
onConfirm() {
|
|
10673
11015
|
const userDetails = this.userDetails().data;
|
|
10674
11016
|
if (!userDetails) {
|
|
10675
11017
|
return;
|
|
10676
11018
|
}
|
|
11019
|
+
this.isSaving.set(true);
|
|
10677
11020
|
this.store.dispatch(new KitUpdateUsersSettingsDetails({
|
|
10678
11021
|
...userDetails,
|
|
10679
11022
|
password: this.form.get(KitUsersSettingsPasswordDialogField.PASSWORD)?.value ?? undefined,
|
|
10680
11023
|
forcePasswordResetOnNextLogin: this.form.get(KitUsersSettingsPasswordDialogField.FORCE_PASSWORD)?.value ?? false,
|
|
10681
|
-
})).pipe(catchError(
|
|
10682
|
-
this.
|
|
11024
|
+
})).pipe(catchError(() => {
|
|
11025
|
+
this.form.setErrors({ serverError: true });
|
|
11026
|
+
return EMPTY;
|
|
11027
|
+
}), finalize(() => this.isSaving.set(false)), takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
11028
|
+
this.dialog.close();
|
|
10683
11029
|
});
|
|
10684
11030
|
}
|
|
10685
11031
|
passwordsMatchValidator(group) {
|
|
@@ -10687,36 +11033,29 @@ class KitUsersSettingsPasswordDialogComponent {
|
|
|
10687
11033
|
const repeatPassword = group.get(KitUsersSettingsPasswordDialogField.REPEAT_PASSWORD)?.value ?? '';
|
|
10688
11034
|
return password === repeatPassword ? null : { passwordsMismatch: true };
|
|
10689
11035
|
}
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
const translationKey = kitUsersSettingsErrorTranslationMap[title];
|
|
10696
|
-
const control = this.form.get(KitUsersSettingsPasswordDialogField.PASSWORD);
|
|
10697
|
-
if (!translationKey || !control) {
|
|
10698
|
-
return;
|
|
11036
|
+
getFieldErrors(form, controlName) {
|
|
11037
|
+
const control = form.controls[controlName] ?? null;
|
|
11038
|
+
const controlErrors = this.kitFormErrors.getErrors(control);
|
|
11039
|
+
if (controlErrors.length) {
|
|
11040
|
+
return controlErrors;
|
|
10699
11041
|
}
|
|
10700
|
-
|
|
10701
|
-
control.
|
|
10702
|
-
control.markAsDirty();
|
|
11042
|
+
const isRepeatPassword = controlName === KitUsersSettingsPasswordDialogField.REPEAT_PASSWORD;
|
|
11043
|
+
return isRepeatPassword && control?.dirty ? this.kitFormErrors.getErrors(form) : [];
|
|
10703
11044
|
}
|
|
10704
11045
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsPasswordDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10705
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
11046
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: KitUsersSettingsPasswordDialogComponent, isStandalone: true, selector: "kit-users-settings-password-dialog", providers: [KitFormErrors], usesInheritance: true, ngImport: i0, template: "<form class=\"kit-users-settings-password-dialog-content\"\n [formGroup]=\"form\">\n <kit-textbox type=\"password\"\n class=\"kit-users-settings-password-dialog-textbox\"\n [formControlName]=\"kitUsersSettingsPasswordDialogField.PASSWORD\"\n [label]=\"'kit.usersSettings.passwordDialog.newPassword' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsPasswordDialogField.PASSWORD)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsPasswordDialogField.PASSWORD) | translate\"></kit-textbox>\n <kit-textbox type=\"password\"\n class=\"kit-users-settings-password-dialog-textbox\"\n [formControlName]=\"kitUsersSettingsPasswordDialogField.REPEAT_PASSWORD\"\n [label]=\"'kit.usersSettings.passwordDialog.repeatNewPassword' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsPasswordDialogField.REPEAT_PASSWORD)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsPasswordDialogField.REPEAT_PASSWORD) | translate\"></kit-textbox>\n <kit-toggle class=\"kit-users-settings-password-dialog-toggle\"\n [formControlName]=\"kitUsersSettingsPasswordDialogField.FORCE_PASSWORD\"\n [label]=\"'kit.usersSettings.passwordDialog.forcePassword' | translate\"></kit-toggle>\n</form>\n\n<kit-dialog-actions>\n <kit-button [label]=\"'kit.usersSettings.passwordDialog.cancel' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"dialog.close()\" />\n <kit-button [label]=\"'kit.usersSettings.passwordDialog.confirm' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [disabled]=\"isFormDisabled\"\n (clicked)=\"onConfirm()\" />\n</kit-dialog-actions>\n", styles: [".kit-users-settings-password-dialog-content{width:600px;display:flex;flex-direction:column;gap:15px}.kit-users-settings-password-dialog-toggle ::ng-deep .kit-toggle{display:flex;align-items:center;justify-content:space-between;gap:15px}\n"], dependencies: [{ kind: "component", type: KitDialogActionsComponent, selector: "kit-dialog-actions" }, { kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "component", type: KitTextboxComponent, selector: "kit-textbox", inputs: ["placeholder", "label", "labelTooltip", "defaultValue", "messageIcon", "messageText", "messageTemplate", "disabled", "maxlength", "state", "size", "icon", "clearButton", "showStateIcon", "readonly", "customStateIcon", "type"], outputs: ["defaultValueChange", "disabledChange", "blured", "focused", "changed"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$8.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$8.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: KitToggleComponent, selector: "kit-toggle", inputs: ["label", "disabled", "readonly", "defaultChecked", "leftLabel", "rightLabel", "messageIcon", "messageText", "size"], outputs: ["disabledChange", "defaultCheckedChange", "changed"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10706
11047
|
}
|
|
10707
11048
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsPasswordDialogComponent, decorators: [{
|
|
10708
11049
|
type: Component,
|
|
10709
11050
|
args: [{ selector: 'kit-users-settings-password-dialog', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
10710
|
-
KitDialogComponent,
|
|
10711
|
-
KitDialogTitlebarComponent,
|
|
10712
11051
|
KitDialogActionsComponent,
|
|
10713
11052
|
KitButtonComponent,
|
|
10714
11053
|
TranslatePipe,
|
|
10715
11054
|
KitTextboxComponent,
|
|
10716
11055
|
ReactiveFormsModule,
|
|
10717
11056
|
KitToggleComponent,
|
|
10718
|
-
], providers: [KitFormErrors], template: "
|
|
10719
|
-
}],
|
|
11057
|
+
], providers: [KitFormErrors], template: "<form class=\"kit-users-settings-password-dialog-content\"\n [formGroup]=\"form\">\n <kit-textbox type=\"password\"\n class=\"kit-users-settings-password-dialog-textbox\"\n [formControlName]=\"kitUsersSettingsPasswordDialogField.PASSWORD\"\n [label]=\"'kit.usersSettings.passwordDialog.newPassword' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsPasswordDialogField.PASSWORD)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsPasswordDialogField.PASSWORD) | translate\"></kit-textbox>\n <kit-textbox type=\"password\"\n class=\"kit-users-settings-password-dialog-textbox\"\n [formControlName]=\"kitUsersSettingsPasswordDialogField.REPEAT_PASSWORD\"\n [label]=\"'kit.usersSettings.passwordDialog.repeatNewPassword' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form, kitUsersSettingsPasswordDialogField.REPEAT_PASSWORD)\"\n [messageText]=\"getFormErrorMessages(form, kitUsersSettingsPasswordDialogField.REPEAT_PASSWORD) | translate\"></kit-textbox>\n <kit-toggle class=\"kit-users-settings-password-dialog-toggle\"\n [formControlName]=\"kitUsersSettingsPasswordDialogField.FORCE_PASSWORD\"\n [label]=\"'kit.usersSettings.passwordDialog.forcePassword' | translate\"></kit-toggle>\n</form>\n\n<kit-dialog-actions>\n <kit-button [label]=\"'kit.usersSettings.passwordDialog.cancel' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"dialog.close()\" />\n <kit-button [label]=\"'kit.usersSettings.passwordDialog.confirm' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [disabled]=\"isFormDisabled\"\n (clicked)=\"onConfirm()\" />\n</kit-dialog-actions>\n", styles: [".kit-users-settings-password-dialog-content{width:600px;display:flex;flex-direction:column;gap:15px}.kit-users-settings-password-dialog-toggle ::ng-deep .kit-toggle{display:flex;align-items:center;justify-content:space-between;gap:15px}\n"] }]
|
|
11058
|
+
}], ctorParameters: () => [] });
|
|
10720
11059
|
|
|
10721
11060
|
var KitUsersSettingsProfileTab;
|
|
10722
11061
|
(function (KitUsersSettingsProfileTab) {
|
|
@@ -10724,70 +11063,6 @@ var KitUsersSettingsProfileTab;
|
|
|
10724
11063
|
KitUsersSettingsProfileTab["ENTITLEMENTS"] = "entitlements";
|
|
10725
11064
|
})(KitUsersSettingsProfileTab || (KitUsersSettingsProfileTab = {}));
|
|
10726
11065
|
|
|
10727
|
-
class KitUsersSettingsEntitlementsComponent {
|
|
10728
|
-
constructor() {
|
|
10729
|
-
this.store = inject(Store);
|
|
10730
|
-
this.entitlementsForm = viewChild(KitUsersSettingsEntitlementsFormComponent, ...(ngDevMode ? [{ debugName: "entitlementsForm" }] : /* istanbul ignore next */ []));
|
|
10731
|
-
this.collapsedList = viewChild(KitCollapsedListComponent, ...(ngDevMode ? [{ debugName: "collapsedList" }] : /* istanbul ignore next */ []));
|
|
10732
|
-
this.showIdentityType = input.required(...(ngDevMode ? [{ debugName: "showIdentityType" }] : /* istanbul ignore next */ []));
|
|
10733
|
-
this.userEntitlements = computed(() => this.store.selectSignal(KIT_USERS_SETTINGS_ENTITLEMENTS_STATE_TOKEN)().userEntitlements, ...(ngDevMode ? [{ debugName: "userEntitlements" }] : /* istanbul ignore next */ []));
|
|
10734
|
-
this.userDetailsId = computed(() => (this.store.selectSignal(KIT_USERS_SETTINGS_STATE_TOKEN)().userDetails.data?.id), ...(ngDevMode ? [{ debugName: "userDetailsId" }] : /* istanbul ignore next */ []));
|
|
10735
|
-
this.entitlementItems = computed(() => (this.userEntitlements().data).map(entitlement => ({ text: entitlement.alias, value: String(entitlement.id) })), ...(ngDevMode ? [{ debugName: "entitlementItems" }] : /* istanbul ignore next */ []));
|
|
10736
|
-
this.selectedEntitlementId = signal(null, ...(ngDevMode ? [{ debugName: "selectedEntitlementId" }] : /* istanbul ignore next */ []));
|
|
10737
|
-
effect(() => this.fetchEntitlements());
|
|
10738
|
-
effect(() => this.fetchEntitlementDetails());
|
|
10739
|
-
effect(() => this.selectFirstItem());
|
|
10740
|
-
}
|
|
10741
|
-
get isFormDisabled() {
|
|
10742
|
-
const formComponent = this.entitlementsForm();
|
|
10743
|
-
return !formComponent || formComponent.form.pristine || formComponent.form.invalid;
|
|
10744
|
-
}
|
|
10745
|
-
selectItem(item) {
|
|
10746
|
-
const collapsedList = this.collapsedList();
|
|
10747
|
-
if (collapsedList) {
|
|
10748
|
-
collapsedList.setSelectedItem(item);
|
|
10749
|
-
this.selectedEntitlementId.set(+item.value);
|
|
10750
|
-
}
|
|
10751
|
-
;
|
|
10752
|
-
}
|
|
10753
|
-
submit() {
|
|
10754
|
-
this.entitlementsForm()?.submit();
|
|
10755
|
-
}
|
|
10756
|
-
fetchEntitlements() {
|
|
10757
|
-
const userId = this.userDetailsId();
|
|
10758
|
-
if (userId) {
|
|
10759
|
-
this.selectedEntitlementId.set(null);
|
|
10760
|
-
this.store.dispatch(new KitFetchUsersSettingsEntitlements(userId));
|
|
10761
|
-
}
|
|
10762
|
-
}
|
|
10763
|
-
selectFirstItem() {
|
|
10764
|
-
const firstItem = this.userEntitlements().data[0];
|
|
10765
|
-
if (firstItem) {
|
|
10766
|
-
this.selectItem({ text: firstItem.alias, value: String(firstItem.id) });
|
|
10767
|
-
}
|
|
10768
|
-
}
|
|
10769
|
-
fetchEntitlementDetails() {
|
|
10770
|
-
const entitlementId = this.selectedEntitlementId();
|
|
10771
|
-
const userId = this.userDetailsId();
|
|
10772
|
-
if (entitlementId && userId) {
|
|
10773
|
-
this.store.dispatch(new KitFetchUsersSettingsEntitlementDetails({
|
|
10774
|
-
userId,
|
|
10775
|
-
entitlementId,
|
|
10776
|
-
}));
|
|
10777
|
-
}
|
|
10778
|
-
}
|
|
10779
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10780
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitUsersSettingsEntitlementsComponent, isStandalone: true, selector: "kit-users-settings-entitlements", inputs: { showIdentityType: { classPropertyName: "showIdentityType", publicName: "showIdentityType", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "entitlementsForm", first: true, predicate: KitUsersSettingsEntitlementsFormComponent, descendants: true, isSignal: true }, { propertyName: "collapsedList", first: true, predicate: KitCollapsedListComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"kit-users-settings-entitlements\">\n @if (userEntitlements().loading) {\n <kit-skeleton [height]=\"24\" />\n } @else {\n <kit-collapsed-list [itemList]=\"entitlementItems()\"\n (selectItem)=\"selectItem($event)\" />\n }\n <kit-users-settings-entitlements-form [showIdentityType]=\"showIdentityType()\" />\n <ng-content />\n</div>\n", styles: [".kit-users-settings-entitlements{display:flex;flex-direction:column;gap:16px}\n"], dependencies: [{ kind: "component", type: KitCollapsedListComponent, selector: "kit-collapsed-list", inputs: ["itemList", "lineHeight", "dropdownDefaultValueText", "gap", "disableActions", "itemTemplate", "dropdownFooterTemplate", "dropdownItemTemplate", "dropdownNoDataTemplate", "appendTo", "alwaysShowDropdown", "dropdownAlign"], outputs: ["selectItem"] }, { kind: "component", type: KitSkeletonComponent, selector: "kit-skeleton", inputs: ["width", "height", "shape", "animation"] }, { kind: "component", type: KitUsersSettingsEntitlementsFormComponent, selector: "kit-users-settings-entitlements-form", inputs: ["isCreating", "showIdentityType"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10781
|
-
}
|
|
10782
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsComponent, decorators: [{
|
|
10783
|
-
type: Component,
|
|
10784
|
-
args: [{ selector: 'kit-users-settings-entitlements', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
10785
|
-
KitCollapsedListComponent,
|
|
10786
|
-
KitSkeletonComponent,
|
|
10787
|
-
KitUsersSettingsEntitlementsFormComponent,
|
|
10788
|
-
], template: "<div class=\"kit-users-settings-entitlements\">\n @if (userEntitlements().loading) {\n <kit-skeleton [height]=\"24\" />\n } @else {\n <kit-collapsed-list [itemList]=\"entitlementItems()\"\n (selectItem)=\"selectItem($event)\" />\n }\n <kit-users-settings-entitlements-form [showIdentityType]=\"showIdentityType()\" />\n <ng-content />\n</div>\n", styles: [".kit-users-settings-entitlements{display:flex;flex-direction:column;gap:16px}\n"] }]
|
|
10789
|
-
}], ctorParameters: () => [], propDecorators: { entitlementsForm: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitUsersSettingsEntitlementsFormComponent), { isSignal: true }] }], collapsedList: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitCollapsedListComponent), { isSignal: true }] }], showIdentityType: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIdentityType", required: true }] }] } });
|
|
10790
|
-
|
|
10791
11066
|
class KitUsersSettingsProfileComponent {
|
|
10792
11067
|
constructor() {
|
|
10793
11068
|
this.store = inject(Store);
|
|
@@ -10798,11 +11073,14 @@ class KitUsersSettingsProfileComponent {
|
|
|
10798
11073
|
this.detailsForm = viewChild(KitUsersSettingsDetailsFormComponent, ...(ngDevMode ? [{ debugName: "detailsForm" }] : /* istanbul ignore next */ []));
|
|
10799
11074
|
this.entitlementsForm = viewChild(KitUsersSettingsEntitlementsComponent, ...(ngDevMode ? [{ debugName: "entitlementsForm" }] : /* istanbul ignore next */ []));
|
|
10800
11075
|
this.showIdentityType = input.required(...(ngDevMode ? [{ debugName: "showIdentityType" }] : /* istanbul ignore next */ []));
|
|
10801
|
-
this.
|
|
11076
|
+
this.permissionCategory = input.required(...(ngDevMode ? [{ debugName: "permissionCategory" }] : /* istanbul ignore next */ []));
|
|
11077
|
+
this.updated = output();
|
|
11078
|
+
this.userPermissions = this.store.selectSignal(KIT_USER_PERMISSIONS_STATE_TOKEN);
|
|
11079
|
+
this.userPermissionTypes = computed(() => kitGetPermissionTypesByCategory(this.permissionCategory(), this.userPermissions()) ?? [], ...(ngDevMode ? [{ debugName: "userPermissionTypes" }] : /* istanbul ignore next */ []));
|
|
11080
|
+
this.permissionTypes = KitPermissionTypes;
|
|
10802
11081
|
this.userDetails = computed(() => this.store.selectSignal(KIT_USERS_SETTINGS_STATE_TOKEN)().userDetails, ...(ngDevMode ? [{ debugName: "userDetails" }] : /* istanbul ignore next */ []));
|
|
10803
11082
|
this.userEntitlementsDetails = computed(() => this.store.selectSignal(KIT_USERS_SETTINGS_ENTITLEMENTS_STATE_TOKEN)().userEntitlementDetails, ...(ngDevMode ? [{ debugName: "userEntitlementsDetails" }] : /* istanbul ignore next */ []));
|
|
10804
11083
|
this.currentTab = signal(KitUsersSettingsProfileTab.DETAILS, ...(ngDevMode ? [{ debugName: "currentTab" }] : /* istanbul ignore next */ []));
|
|
10805
|
-
this.isPasswordDialogOpened = signal(false, ...(ngDevMode ? [{ debugName: "isPasswordDialogOpened" }] : /* istanbul ignore next */ []));
|
|
10806
11084
|
this.isEntitlementDialogOpened = signal(false, ...(ngDevMode ? [{ debugName: "isEntitlementDialogOpened" }] : /* istanbul ignore next */ []));
|
|
10807
11085
|
this.kitButtonKind = KitButtonKind;
|
|
10808
11086
|
this.kitButtonType = KitButtonType;
|
|
@@ -10822,9 +11100,10 @@ class KitUsersSettingsProfileComponent {
|
|
|
10822
11100
|
get isFormDisabled() {
|
|
10823
11101
|
if (this.currentTab() === KitUsersSettingsProfileTab.DETAILS) {
|
|
10824
11102
|
const detailsForm = this.detailsForm();
|
|
10825
|
-
return !detailsForm || detailsForm.form.pristine || detailsForm.form.invalid;
|
|
11103
|
+
return !detailsForm || detailsForm.form.pristine || detailsForm.form.invalid || detailsForm.isSaving();
|
|
10826
11104
|
}
|
|
10827
|
-
|
|
11105
|
+
const entitlementsForm = this.entitlementsForm();
|
|
11106
|
+
return !entitlementsForm || entitlementsForm.isSaveBtnDisabled;
|
|
10828
11107
|
}
|
|
10829
11108
|
get isSaveLoading() {
|
|
10830
11109
|
if (this.currentTab() === KitUsersSettingsProfileTab.DETAILS) {
|
|
@@ -10834,12 +11113,11 @@ class KitUsersSettingsProfileComponent {
|
|
|
10834
11113
|
}
|
|
10835
11114
|
onSave() {
|
|
10836
11115
|
if (this.currentTab() === KitUsersSettingsProfileTab.DETAILS) {
|
|
10837
|
-
this.detailsForm()?.submit();
|
|
11116
|
+
this.detailsForm()?.submit().pipe(takeUntilDestroyed(this.destroyRef)).subscribe();
|
|
10838
11117
|
}
|
|
10839
11118
|
else {
|
|
10840
|
-
this.entitlementsForm()?.submit();
|
|
11119
|
+
this.entitlementsForm()?.submit().pipe(takeUntilDestroyed(this.destroyRef)).subscribe();
|
|
10841
11120
|
}
|
|
10842
|
-
this.saveClicked.emit();
|
|
10843
11121
|
}
|
|
10844
11122
|
onTabSelected(event) {
|
|
10845
11123
|
const tabs = Object.values(KitUsersSettingsProfileTab);
|
|
@@ -10864,328 +11142,165 @@ class KitUsersSettingsProfileComponent {
|
|
|
10864
11142
|
entitlementId: entitlementsDetails.id,
|
|
10865
11143
|
})))).subscribe();
|
|
10866
11144
|
}
|
|
10867
|
-
|
|
10868
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitUsersSettingsProfileComponent, isStandalone: true, selector: "kit-users-settings-profile", inputs: { showIdentityType: { classPropertyName: "showIdentityType", publicName: "showIdentityType", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { saveClicked: "saveClicked" }, viewQueries: [{ propertyName: "detailsForm", first: true, predicate: KitUsersSettingsDetailsFormComponent, descendants: true, isSignal: true }, { propertyName: "entitlementsForm", first: true, predicate: KitUsersSettingsEntitlementsComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"kit-user-settings-profile\">\n <kit-entity-section-container>\n <ng-container title>\n <div class=\"kit-user-settings-profile-header\">\n <kit-tabs class=\"kit-user-settings-profile-tabs\"\n (tabSelected)=\"onTabSelected($event)\">\n <kit-tab [title]=\"'kit.usersSettings.profile.tabs.details' | translate\"\n [selected]=\"true\" />\n <kit-tab [title]=\"'kit.usersSettings.profile.tabs.entitlements' | translate\" />\n </kit-tabs>\n <div class=\"kit-user-settings-profile-actions\">\n @if (currentTab() === kitUsersSettingsProfileTab.DETAILS) {\n <kit-button [label]=\"'kit.usersSettings.profile.changePassword' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n [disabled]=\"userDetails().loading\"\n (clicked)=\"isPasswordDialogOpened.set(true)\" />\n } @else {\n <kit-button [label]=\"'kit.usersSettings.profile.createEntitlement' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n [disabled]=\"userDetails().loading\"\n [icon]=\"kitSvgIcon.PLUS\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"isEntitlementDialogOpened.set(true)\" />\n <kit-button [label]=\"'kit.usersSettings.profile.delete' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n [disabled]=\"userEntitlementsDetails().loading || !userEntitlementsDetails().data\"\n [icon]=\"kitSvgIcon.TRASH\"\n [iconType]=\"kitSvgIconType.STROKE\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"onDeleteEntitlement()\" />\n }\n <kit-button [label]=\"'kit.usersSettings.profile.save' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [icon]=\"kitSvgIcon.DISKETTE\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [disabled]=\"isFormDisabled || isSaveLoading\"\n (clicked)=\"onSave()\" />\n </div>\n </div>\n </ng-container>\n </kit-entity-section-container>\n @if (currentTab() === kitUsersSettingsProfileTab.DETAILS) {\n <kit-users-settings-details-form />\n \n <kit-users-settings-password-dialog [(opened)]=\"isPasswordDialogOpened\" />\n } @else {\n <ng-template #entitlementsExtraContent>\n <ng-content />\n </ng-template>\n\n <kit-users-settings-create-entitlement-dialog [showIdentityType]=\"showIdentityType()\"\n [(opened)]=\"isEntitlementDialogOpened\">\n </kit-users-settings-create-entitlement-dialog>\n\n <kit-users-settings-entitlements [showIdentityType]=\"showIdentityType()\">\n <ng-container [ngTemplateOutlet]=\"entitlementsExtraContent\" />\n </kit-users-settings-entitlements>\n }\n</div>", styles: [".kit-user-settings-profile-header{display:flex;align-items:center;justify-content:space-between}.kit-user-settings-profile-actions{display:flex;gap:8px}.kit-user-settings-profile ::ng-deep .kit-entity-section-container{padding-bottom:0;gap:0;margin-bottom:15px}.kit-user-settings-profile ::ng-deep .kit-user-settings-profile-tabs .k-link{display:inline-block;height:100%}\n"], dependencies: [{ kind: "component", type: KitEntitySectionContainerComponent, selector: "kit-entity-section-container" }, { kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "component", type: KitUsersSettingsCreateEntitlementDialogComponent, selector: "kit-users-settings-create-entitlement-dialog", inputs: ["showIdentityType", "opened"], outputs: ["openedChange"] }, { kind: "component", type: KitUsersSettingsPasswordDialogComponent, selector: "kit-users-settings-password-dialog", inputs: ["opened"], outputs: ["openedChange"] }, { kind: "component", type: KitUsersSettingsDetailsFormComponent, selector: "kit-users-settings-details-form", inputs: ["isCreatingNewUser"] }, { kind: "component", type: KitUsersSettingsEntitlementsComponent, selector: "kit-users-settings-entitlements", inputs: ["showIdentityType"] }, { kind: "component", type: KitTabsComponent, selector: "kit-tabs", inputs: ["type", "size", "animate"], outputs: ["tabSelected"] }, { kind: "component", type: KitTabComponent, selector: "kit-tab", inputs: ["title", "icon", "iconType", "selected", "disabled"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10869
|
-
}
|
|
10870
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsProfileComponent, decorators: [{
|
|
10871
|
-
type: Component,
|
|
10872
|
-
args: [{ selector: 'kit-users-settings-profile', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
10873
|
-
KitEntitySectionContainerComponent,
|
|
10874
|
-
KitButtonComponent,
|
|
10875
|
-
TranslatePipe,
|
|
10876
|
-
KitUsersSettingsCreateEntitlementDialogComponent,
|
|
10877
|
-
KitUsersSettingsPasswordDialogComponent,
|
|
10878
|
-
KitUsersSettingsDetailsFormComponent,
|
|
10879
|
-
KitUsersSettingsEntitlementsComponent,
|
|
10880
|
-
KitTabsComponent,
|
|
10881
|
-
KitTabComponent,
|
|
10882
|
-
NgTemplateOutlet,
|
|
10883
|
-
], template: "<div class=\"kit-user-settings-profile\">\n <kit-entity-section-container>\n <ng-container title>\n <div class=\"kit-user-settings-profile-header\">\n <kit-tabs class=\"kit-user-settings-profile-tabs\"\n (tabSelected)=\"onTabSelected($event)\">\n <kit-tab [title]=\"'kit.usersSettings.profile.tabs.details' | translate\"\n [selected]=\"true\" />\n <kit-tab [title]=\"'kit.usersSettings.profile.tabs.entitlements' | translate\" />\n </kit-tabs>\n <div class=\"kit-user-settings-profile-actions\">\n @if (currentTab() === kitUsersSettingsProfileTab.DETAILS) {\n <kit-button [label]=\"'kit.usersSettings.profile.changePassword' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n [disabled]=\"userDetails().loading\"\n (clicked)=\"isPasswordDialogOpened.set(true)\" />\n } @else {\n <kit-button [label]=\"'kit.usersSettings.profile.createEntitlement' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n [disabled]=\"userDetails().loading\"\n [icon]=\"kitSvgIcon.PLUS\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"isEntitlementDialogOpened.set(true)\" />\n <kit-button [label]=\"'kit.usersSettings.profile.delete' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n [disabled]=\"userEntitlementsDetails().loading || !userEntitlementsDetails().data\"\n [icon]=\"kitSvgIcon.TRASH\"\n [iconType]=\"kitSvgIconType.STROKE\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"onDeleteEntitlement()\" />\n }\n <kit-button [label]=\"'kit.usersSettings.profile.save' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [icon]=\"kitSvgIcon.DISKETTE\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [disabled]=\"isFormDisabled || isSaveLoading\"\n (clicked)=\"onSave()\" />\n </div>\n </div>\n </ng-container>\n </kit-entity-section-container>\n @if (currentTab() === kitUsersSettingsProfileTab.DETAILS) {\n <kit-users-settings-details-form />\n \n <kit-users-settings-password-dialog [(opened)]=\"isPasswordDialogOpened\" />\n } @else {\n <ng-template #entitlementsExtraContent>\n <ng-content />\n </ng-template>\n\n <kit-users-settings-create-entitlement-dialog [showIdentityType]=\"showIdentityType()\"\n [(opened)]=\"isEntitlementDialogOpened\">\n </kit-users-settings-create-entitlement-dialog>\n\n <kit-users-settings-entitlements [showIdentityType]=\"showIdentityType()\">\n <ng-container [ngTemplateOutlet]=\"entitlementsExtraContent\" />\n </kit-users-settings-entitlements>\n }\n</div>", styles: [".kit-user-settings-profile-header{display:flex;align-items:center;justify-content:space-between}.kit-user-settings-profile-actions{display:flex;gap:8px}.kit-user-settings-profile ::ng-deep .kit-entity-section-container{padding-bottom:0;gap:0;margin-bottom:15px}.kit-user-settings-profile ::ng-deep .kit-user-settings-profile-tabs .k-link{display:inline-block;height:100%}\n"] }]
|
|
10884
|
-
}], propDecorators: { detailsForm: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitUsersSettingsDetailsFormComponent), { isSignal: true }] }], entitlementsForm: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitUsersSettingsEntitlementsComponent), { isSignal: true }] }], showIdentityType: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIdentityType", required: true }] }], saveClicked: [{ type: i0.Output, args: ["saveClicked"] }] } });
|
|
10885
|
-
|
|
10886
|
-
class KitUsersSettingsComponent {
|
|
10887
|
-
constructor() {
|
|
10888
|
-
this.destroyRef = inject(DestroyRef);
|
|
10889
|
-
this.store = inject(Store);
|
|
10890
|
-
this.kitDialogService = inject(KitDialogService);
|
|
10891
|
-
this.translateService = inject(TranslateService);
|
|
10892
|
-
this.viewContainerRef = inject(ViewContainerRef);
|
|
10893
|
-
this.cardDetailsComponent = viewChild.required(KitCardDetailsComponent);
|
|
10894
|
-
this.deleteDialogActionsTemplate = viewChild.required('deleteDialogActions', { read: TemplateRef });
|
|
10895
|
-
this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
10896
|
-
this.showIdentityType = input(true, ...(ngDevMode ? [{ debugName: "showIdentityType" }] : /* istanbul ignore next */ []));
|
|
10897
|
-
this.saveClicked = output();
|
|
10898
|
-
this.currentUserId = this.store.selectSignal((state) => state.user?.data?.id?.toString() ?? null);
|
|
10899
|
-
this.isCreatingNewUser = signal(false, ...(ngDevMode ? [{ debugName: "isCreatingNewUser" }] : /* istanbul ignore next */ []));
|
|
10900
|
-
this.pendingDeleteUser = signal(null, ...(ngDevMode ? [{ debugName: "pendingDeleteUser" }] : /* istanbul ignore next */ []));
|
|
10901
|
-
this.cardData$ = this.store.select(KIT_USERS_SETTINGS_STATE_TOKEN).pipe(map(state => kitBuildGridDataResults(state?.users?.data ?? [], state?.users?.loading ?? false, state?.users?.total ?? 0)));
|
|
10902
|
-
this.pageSize = 10;
|
|
10903
|
-
this.kitSvgIcon = KitSvgIcon;
|
|
10904
|
-
this.kitButtonIconPosition = KitButtonIconPosition;
|
|
10905
|
-
this.kitButtonKind = KitButtonKind;
|
|
10906
|
-
this.kitButtonType = KitButtonType;
|
|
10907
|
-
this.kitSvgIconType = KitSvgIconType;
|
|
10908
|
-
}
|
|
10909
|
-
onDataStateChanged({ skip, take, search, filters }) {
|
|
10910
|
-
this.store.dispatch(new KitFetchUsersSettings({
|
|
10911
|
-
skip,
|
|
10912
|
-
take,
|
|
10913
|
-
filter: this.buildFilter(search, filters),
|
|
10914
|
-
}));
|
|
10915
|
-
}
|
|
10916
|
-
onCardSelected(card) {
|
|
10917
|
-
this.store.dispatch(new KitFetchUsersSettingsDetails(card.id));
|
|
10918
|
-
}
|
|
10919
|
-
isDeleteDisabled(userId) {
|
|
10920
|
-
return this.currentUserId() === userId.toString();
|
|
10921
|
-
}
|
|
10922
|
-
getUserDisplayName(user) {
|
|
10923
|
-
const fullName = [
|
|
10924
|
-
user.firstName,
|
|
10925
|
-
user.lastName,
|
|
10926
|
-
].filter(Boolean).join(' ').trim();
|
|
10927
|
-
return fullName || user.userName;
|
|
10928
|
-
}
|
|
10929
|
-
onDeleteUser(user) {
|
|
10930
|
-
this.pendingDeleteUser.set(user);
|
|
11145
|
+
openChangePasswordDialog() {
|
|
10931
11146
|
this.kitDialogService.openDialog({
|
|
10932
|
-
title: this.translateService.instant('kit.usersSettings.
|
|
10933
|
-
content:
|
|
10934
|
-
name: this.getUserDisplayName(user),
|
|
10935
|
-
}),
|
|
10936
|
-
actions: this.deleteDialogActionsTemplate(),
|
|
11147
|
+
title: this.translateService.instant('kit.usersSettings.passwordDialog.title'),
|
|
11148
|
+
content: KitUsersSettingsPasswordDialogComponent,
|
|
10937
11149
|
appendTo: this.viewContainerRef,
|
|
10938
11150
|
});
|
|
10939
11151
|
}
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
this.pendingDeleteUser.set(null);
|
|
10943
|
-
}
|
|
10944
|
-
confirmDeleteUser() {
|
|
10945
|
-
const user = this.pendingDeleteUser();
|
|
10946
|
-
if (!user) {
|
|
10947
|
-
return;
|
|
10948
|
-
}
|
|
10949
|
-
this.store.dispatch(new KitDeleteUsersSettingsUser(user.id)).pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
10950
|
-
this.cardDetailsComponent().deleteCard(user.id);
|
|
10951
|
-
this.closeDeleteDialog();
|
|
10952
|
-
});
|
|
10953
|
-
}
|
|
10954
|
-
buildFilter(search, filters) {
|
|
10955
|
-
if (!search) {
|
|
10956
|
-
return filters;
|
|
10957
|
-
}
|
|
10958
|
-
return {
|
|
10959
|
-
logic: KitFilterLogic.AND,
|
|
10960
|
-
filters: [
|
|
10961
|
-
{ field: 'name', operator: 'contains', value: search },
|
|
10962
|
-
...(filters?.filters ?? []),
|
|
10963
|
-
],
|
|
10964
|
-
};
|
|
10965
|
-
}
|
|
10966
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10967
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.4", type: KitUsersSettingsComponent, isStandalone: true, selector: "kit-users-settings", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, showIdentityType: { classPropertyName: "showIdentityType", publicName: "showIdentityType", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { saveClicked: "saveClicked" }, viewQueries: [{ propertyName: "cardDetailsComponent", first: true, predicate: KitCardDetailsComponent, descendants: true, isSignal: true }, { propertyName: "deleteDialogActionsTemplate", first: true, predicate: ["deleteDialogActions"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<div class=\"kit-users-settings\">\n <kit-card-details [title]=\"title()\"\n [pageSize]=\"pageSize\"\n [cardData$]=\"cardData$\"\n (cardClicked)=\"onCardSelected($event)\"\n (dataStateChanged)=\"onDataStateChanged($event)\">\n <ng-template #headerActions>\n <kit-button [label]=\"'kit.usersSettings.details.createNewUser' | translate\"\n [icon]=\"kitSvgIcon.PLUS\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"isCreatingNewUser.set(true)\" />\n </ng-template>\n\n <ng-template #cardElement\n let-user>\n <div class=\"kit-users-settings-card-row\">\n <kit-truncate-text class=\"kit-users-settings-card\">{{ getUserDisplayName(user) }}</kit-truncate-text>\n <kit-button [icon]=\"kitSvgIcon.TRASH\"\n [kind]=\"kitButtonKind.SMALL\"\n [type]=\"kitButtonType.TEXT\"\n [iconType]=\"kitSvgIconType.STROKE\"\n [disabled]=\"isDeleteDisabled(user.id)\"\n (clicked)=\"onDeleteUser(user)\" />\n </div>\n </ng-template>\n\n <ng-template #details\n let-activeId>\n <kit-users-settings-profile [showIdentityType]=\"showIdentityType()\"\n (saveClicked)=\"saveClicked.emit()\">\n <ng-content select=\"[extended-entitlements]\" />\n </kit-users-settings-profile>\n </ng-template>\n </kit-card-details>\n\n <kit-users-settings-create-dialog [(opened)]=\"isCreatingNewUser\" />\n\n <ng-template #deleteDialogActions>\n <div class=\"kit-users-settings-delete-dialog-actions\">\n <kit-button [label]=\"'kit.usersSettings.deleteDialog.cancel' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"closeDeleteDialog()\" />\n <kit-button [label]=\"'kit.usersSettings.deleteDialog.confirm' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n (clicked)=\"confirmDeleteUser()\" />\n </div>\n </ng-template>\n</div>\n", styles: [".kit-users-settings-card-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.kit-users-settings-card{margin:10px 0;min-width:0}::ng-deep .kit-users-settings-delete-dialog-actions{display:flex;justify-content:space-between}\n"], dependencies: [{ kind: "component", type: KitCardDetailsComponent, selector: "kit-card-details", inputs: ["cardData$", "pageSize", "title", "cardSkeletonConfig"], outputs: ["dataStateChanged", "cardClicked"] }, { kind: "component", type: KitTruncateTextComponent, selector: "kit-truncate-text", inputs: ["tooltipText"] }, { kind: "component", type: KitUsersSettingsProfileComponent, selector: "kit-users-settings-profile", inputs: ["showIdentityType"], outputs: ["saveClicked"] }, { kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "component", type: KitUsersSettingsCreateDialogComponent, selector: "kit-users-settings-create-dialog", inputs: ["opened"], outputs: ["openedChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
11152
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsProfileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11153
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: KitUsersSettingsProfileComponent, isStandalone: true, selector: "kit-users-settings-profile", inputs: { showIdentityType: { classPropertyName: "showIdentityType", publicName: "showIdentityType", isSignal: true, isRequired: true, transformFunction: null }, permissionCategory: { classPropertyName: "permissionCategory", publicName: "permissionCategory", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { updated: "updated" }, viewQueries: [{ propertyName: "detailsForm", first: true, predicate: KitUsersSettingsDetailsFormComponent, descendants: true, isSignal: true }, { propertyName: "entitlementsForm", first: true, predicate: KitUsersSettingsEntitlementsComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"kit-user-settings-profile\">\n <kit-entity-section-container>\n <ng-container title>\n <div class=\"kit-user-settings-profile-header\">\n <kit-tabs class=\"kit-user-settings-profile-tabs\"\n (tabSelected)=\"onTabSelected($event)\">\n <kit-tab [title]=\"'kit.usersSettings.profile.tabs.details' | translate\"\n [selected]=\"true\" />\n <kit-tab *kitPermission=\"[permissionTypes.Set]; user: userPermissionTypes()\"\n [title]=\"'kit.usersSettings.profile.tabs.entitlements' | translate\" />\n </kit-tabs>\n <div class=\"kit-user-settings-profile-actions\">\n @if (currentTab() === kitUsersSettingsProfileTab.DETAILS) {\n <kit-button [label]=\"'kit.usersSettings.profile.changePassword' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n [disabled]=\"userDetails().loading\"\n (clicked)=\"openChangePasswordDialog()\" />\n } @else {\n <kit-button [label]=\"'kit.usersSettings.profile.createEntitlement' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n [disabled]=\"userDetails().loading\"\n [icon]=\"kitSvgIcon.PLUS\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"isEntitlementDialogOpened.set(true)\" />\n <kit-button [label]=\"'kit.usersSettings.profile.delete' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n [disabled]=\"userEntitlementsDetails().loading || !userEntitlementsDetails().data\"\n [icon]=\"kitSvgIcon.TRASH\"\n [iconType]=\"kitSvgIconType.STROKE\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"onDeleteEntitlement()\" />\n }\n <kit-button [label]=\"'kit.usersSettings.profile.save' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [icon]=\"kitSvgIcon.DISKETTE\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [disabled]=\"isFormDisabled || isSaveLoading\"\n (clicked)=\"onSave()\" />\n </div>\n </div>\n </ng-container>\n </kit-entity-section-container>\n @if (currentTab() === kitUsersSettingsProfileTab.DETAILS) {\n <kit-users-settings-details-form (updated)=\"updated.emit($event)\" />\n } @else {\n <kit-users-settings-create-entitlement-dialog [showIdentityType]=\"showIdentityType()\"\n [(opened)]=\"isEntitlementDialogOpened\" />\n <kit-users-settings-entitlements [showIdentityType]=\"showIdentityType()\" />\n }\n</div>\n", styles: [".kit-user-settings-profile-header{display:flex;align-items:center;justify-content:space-between}.kit-user-settings-profile-actions{display:flex;gap:8px}.kit-user-settings-profile ::ng-deep .kit-entity-section-container{padding-bottom:0;gap:0;margin-bottom:15px}.kit-user-settings-profile ::ng-deep .kit-user-settings-profile-tabs .k-link{display:inline-block;height:100%}\n"], dependencies: [{ kind: "component", type: KitEntitySectionContainerComponent, selector: "kit-entity-section-container" }, { kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "component", type: KitUsersSettingsCreateEntitlementDialogComponent, selector: "kit-users-settings-create-entitlement-dialog", inputs: ["showIdentityType", "opened"], outputs: ["openedChange"] }, { kind: "component", type: KitUsersSettingsDetailsFormComponent, selector: "kit-users-settings-details-form", inputs: ["isCreateMode"], outputs: ["updated"] }, { kind: "component", type: KitUsersSettingsEntitlementsComponent, selector: "kit-users-settings-entitlements", inputs: ["showIdentityType"] }, { kind: "component", type: KitTabsComponent, selector: "kit-tabs", inputs: ["type", "size", "animate"], outputs: ["tabSelected"] }, { kind: "component", type: KitTabComponent, selector: "kit-tab", inputs: ["title", "icon", "iconType", "selected", "disabled"] }, { kind: "directive", type: KitPermissionDirective, selector: "[kitPermission]", inputs: ["kitPermission", "kitPermissionUser"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10968
11154
|
}
|
|
10969
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type:
|
|
11155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsProfileComponent, decorators: [{
|
|
10970
11156
|
type: Component,
|
|
10971
|
-
args: [{ selector: 'kit-users-settings', imports: [
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
const KIT_USER_APPLICATIONS_PATH = new InjectionToken('kitUserApplicationsPath');
|
|
10984
|
-
|
|
10985
|
-
class KitUserApiService {
|
|
10986
|
-
constructor() {
|
|
10987
|
-
this.httpClient = inject(HttpClient);
|
|
10988
|
-
this.basePath = inject(KIT_BASE_PATH);
|
|
10989
|
-
this.userPath = inject(KIT_USER_PATH);
|
|
10990
|
-
this.userApplicationsPath = inject(KIT_USER_APPLICATIONS_PATH);
|
|
10991
|
-
}
|
|
10992
|
-
getUserInfo() {
|
|
10993
|
-
const url = `${this.basePath}/${this.userPath}`;
|
|
10994
|
-
return this.httpClient.get(url);
|
|
10995
|
-
}
|
|
10996
|
-
getUserApplicationList() {
|
|
10997
|
-
const url = `${this.basePath}/${this.userApplicationsPath}`;
|
|
10998
|
-
return this.httpClient.get(url);
|
|
10999
|
-
}
|
|
11000
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
11001
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserApiService, providedIn: 'root' }); }
|
|
11002
|
-
}
|
|
11003
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserApiService, decorators: [{
|
|
11004
|
-
type: Injectable,
|
|
11005
|
-
args: [{
|
|
11006
|
-
providedIn: 'root',
|
|
11007
|
-
}]
|
|
11008
|
-
}] });
|
|
11009
|
-
|
|
11010
|
-
class FetchUser {
|
|
11011
|
-
static { this.type = '[User] Fetch'; }
|
|
11012
|
-
}
|
|
11013
|
-
|
|
11014
|
-
const KIT_USER_STATE_TOKEN = new StateToken('user');
|
|
11015
|
-
let KitUserState = class KitUserState {
|
|
11016
|
-
constructor() {
|
|
11017
|
-
this.kitUserApiService = inject(KitUserApiService);
|
|
11018
|
-
}
|
|
11019
|
-
fetchUser(ctx) {
|
|
11020
|
-
return this.kitUserApiService.getUserInfo().pipe(tap(user => ctx.setState({
|
|
11021
|
-
data: user,
|
|
11022
|
-
loading: false,
|
|
11023
|
-
})));
|
|
11024
|
-
}
|
|
11025
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserState, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
11026
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserState }); }
|
|
11027
|
-
};
|
|
11028
|
-
__decorate([
|
|
11029
|
-
Action(FetchUser)
|
|
11030
|
-
], KitUserState.prototype, "fetchUser", null);
|
|
11031
|
-
KitUserState = __decorate([
|
|
11032
|
-
State({
|
|
11033
|
-
name: KIT_USER_STATE_TOKEN,
|
|
11034
|
-
defaults: {
|
|
11035
|
-
data: null,
|
|
11036
|
-
loading: true,
|
|
11037
|
-
},
|
|
11038
|
-
})
|
|
11039
|
-
], KitUserState);
|
|
11040
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserState, decorators: [{
|
|
11041
|
-
type: Injectable
|
|
11042
|
-
}], propDecorators: { fetchUser: [] } });
|
|
11043
|
-
|
|
11044
|
-
class KitGridCellService {
|
|
11045
|
-
constructor() {
|
|
11046
|
-
this.translateService = inject(TranslateService);
|
|
11047
|
-
this.decimalPipe = inject(DecimalPipe);
|
|
11048
|
-
this.datePipe = inject(DatePipe);
|
|
11049
|
-
this.dateFormatConfig = inject(KIT_GRID_CELL_DATE_FORMAT_CONFIG, { optional: true });
|
|
11050
|
-
this.store = inject(Store);
|
|
11051
|
-
this.userState = this.store.selectSignal(KIT_USER_STATE_TOKEN)();
|
|
11052
|
-
const dateFormatConfig = this.dateFormatConfig;
|
|
11053
|
-
this.dateFormat = dateFormatConfig?.dateFormat ?? KIT_DATE_FORMAT;
|
|
11054
|
-
this.dateTimeFormat = dateFormatConfig?.dateTimeFormat ?? KIT_DATETIME_FORMAT_LONG;
|
|
11055
|
-
}
|
|
11056
|
-
createCellValue(columnType, columnField, dataItem, translationMap = {}, defaultValue = '', valueTransforms = {}) {
|
|
11057
|
-
const rawValue = this.getCellValue(dataItem, columnField);
|
|
11058
|
-
const value = valueTransforms[columnField]?.(rawValue) ?? rawValue;
|
|
11059
|
-
if (columnField in translationMap && value != null && value !== '') {
|
|
11060
|
-
return this.translateService.instant(translationMap[columnField](value)) ?? defaultValue;
|
|
11061
|
-
}
|
|
11062
|
-
switch (columnType) {
|
|
11063
|
-
case 'number':
|
|
11064
|
-
return this.decimalPipe.transform(value) ?? defaultValue;
|
|
11065
|
-
case 'plainNumber':
|
|
11066
|
-
return value || defaultValue;
|
|
11067
|
-
case 'date':
|
|
11068
|
-
return this.datePipe.transform(value, this.dateFormat, 'UTC') ?? defaultValue;
|
|
11069
|
-
case 'dateTime':
|
|
11070
|
-
return this.datePipe.transform(value, this.dateTimeFormat, 'UTC') ?? defaultValue;
|
|
11071
|
-
case 'dateLocal':
|
|
11072
|
-
return this.datePipe.transform(value, this.dateFormat) ?? defaultValue;
|
|
11073
|
-
case 'dateTimeLocal':
|
|
11074
|
-
return this.datePipe.transform(value, this.dateTimeFormat) ?? defaultValue;
|
|
11075
|
-
case 'dateZone':
|
|
11076
|
-
return value ? formatInTimeZone(value, this.userState.data?.namedTimeZone ?? 'UTC', this.dateFormat) : defaultValue;
|
|
11077
|
-
case 'dateTimeZone':
|
|
11078
|
-
return value ? formatInTimeZone(value, this.userState.data?.namedTimeZone ?? 'UTC', this.dateTimeFormat) : defaultValue;
|
|
11079
|
-
case 'boolean':
|
|
11080
|
-
return this.translateService.instant(value ? 'common.yes' : 'common.no');
|
|
11081
|
-
default:
|
|
11082
|
-
return value || defaultValue;
|
|
11083
|
-
}
|
|
11084
|
-
}
|
|
11085
|
-
getCellValue(dataItem, field) {
|
|
11086
|
-
let value = dataItem[field];
|
|
11087
|
-
if (!value) {
|
|
11088
|
-
value = this.getNestedGridCellValue(dataItem, field);
|
|
11089
|
-
}
|
|
11090
|
-
return value;
|
|
11091
|
-
}
|
|
11092
|
-
getNestedGridCellValue(dataItem, field) {
|
|
11093
|
-
const value = field.split('.').reduce((acc, key) => acc !== null && typeof acc === 'object' && key in acc
|
|
11094
|
-
? acc[key]
|
|
11095
|
-
: undefined, dataItem);
|
|
11096
|
-
return value === 0 ? 0 : value || '';
|
|
11097
|
-
}
|
|
11098
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitGridCellService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
11099
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitGridCellService }); }
|
|
11100
|
-
}
|
|
11101
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitGridCellService, decorators: [{
|
|
11102
|
-
type: Injectable
|
|
11103
|
-
}], ctorParameters: () => [] });
|
|
11157
|
+
args: [{ selector: 'kit-users-settings-profile', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
11158
|
+
KitEntitySectionContainerComponent,
|
|
11159
|
+
KitButtonComponent,
|
|
11160
|
+
TranslatePipe,
|
|
11161
|
+
KitUsersSettingsCreateEntitlementDialogComponent,
|
|
11162
|
+
KitUsersSettingsDetailsFormComponent,
|
|
11163
|
+
KitUsersSettingsEntitlementsComponent,
|
|
11164
|
+
KitTabsComponent,
|
|
11165
|
+
KitTabComponent,
|
|
11166
|
+
KitPermissionDirective,
|
|
11167
|
+
], template: "<div class=\"kit-user-settings-profile\">\n <kit-entity-section-container>\n <ng-container title>\n <div class=\"kit-user-settings-profile-header\">\n <kit-tabs class=\"kit-user-settings-profile-tabs\"\n (tabSelected)=\"onTabSelected($event)\">\n <kit-tab [title]=\"'kit.usersSettings.profile.tabs.details' | translate\"\n [selected]=\"true\" />\n <kit-tab *kitPermission=\"[permissionTypes.Set]; user: userPermissionTypes()\"\n [title]=\"'kit.usersSettings.profile.tabs.entitlements' | translate\" />\n </kit-tabs>\n <div class=\"kit-user-settings-profile-actions\">\n @if (currentTab() === kitUsersSettingsProfileTab.DETAILS) {\n <kit-button [label]=\"'kit.usersSettings.profile.changePassword' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n [disabled]=\"userDetails().loading\"\n (clicked)=\"openChangePasswordDialog()\" />\n } @else {\n <kit-button [label]=\"'kit.usersSettings.profile.createEntitlement' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n [disabled]=\"userDetails().loading\"\n [icon]=\"kitSvgIcon.PLUS\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"isEntitlementDialogOpened.set(true)\" />\n <kit-button [label]=\"'kit.usersSettings.profile.delete' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n [disabled]=\"userEntitlementsDetails().loading || !userEntitlementsDetails().data\"\n [icon]=\"kitSvgIcon.TRASH\"\n [iconType]=\"kitSvgIconType.STROKE\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n (clicked)=\"onDeleteEntitlement()\" />\n }\n <kit-button [label]=\"'kit.usersSettings.profile.save' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [icon]=\"kitSvgIcon.DISKETTE\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [disabled]=\"isFormDisabled || isSaveLoading\"\n (clicked)=\"onSave()\" />\n </div>\n </div>\n </ng-container>\n </kit-entity-section-container>\n @if (currentTab() === kitUsersSettingsProfileTab.DETAILS) {\n <kit-users-settings-details-form (updated)=\"updated.emit($event)\" />\n } @else {\n <kit-users-settings-create-entitlement-dialog [showIdentityType]=\"showIdentityType()\"\n [(opened)]=\"isEntitlementDialogOpened\" />\n <kit-users-settings-entitlements [showIdentityType]=\"showIdentityType()\" />\n }\n</div>\n", styles: [".kit-user-settings-profile-header{display:flex;align-items:center;justify-content:space-between}.kit-user-settings-profile-actions{display:flex;gap:8px}.kit-user-settings-profile ::ng-deep .kit-entity-section-container{padding-bottom:0;gap:0;margin-bottom:15px}.kit-user-settings-profile ::ng-deep .kit-user-settings-profile-tabs .k-link{display:inline-block;height:100%}\n"] }]
|
|
11168
|
+
}], propDecorators: { detailsForm: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitUsersSettingsDetailsFormComponent), { isSignal: true }] }], entitlementsForm: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitUsersSettingsEntitlementsComponent), { isSignal: true }] }], showIdentityType: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIdentityType", required: true }] }], permissionCategory: [{ type: i0.Input, args: [{ isSignal: true, alias: "permissionCategory", required: true }] }], updated: [{ type: i0.Output, args: ["updated"] }] } });
|
|
11104
11169
|
|
|
11105
|
-
|
|
11170
|
+
const defaultUserSort = [{ field: 'name', dir: 'asc' }];
|
|
11171
|
+
const exportedUserColumns = [
|
|
11172
|
+
kitBuildGridColumn('userName', 'User Name', 'string', false, false, KIT_GRID_COLUMN_WIDTH),
|
|
11173
|
+
kitBuildGridColumn('name', 'Name', 'string', false, false, KIT_GRID_COLUMN_WIDTH),
|
|
11174
|
+
];
|
|
11175
|
+
|
|
11176
|
+
class KitUsersSettingsComponent {
|
|
11106
11177
|
constructor() {
|
|
11107
|
-
this.translateService = inject(TranslateService);
|
|
11108
11178
|
this.store = inject(Store);
|
|
11109
|
-
this.
|
|
11179
|
+
this.kitDialogService = inject(KitDialogService);
|
|
11180
|
+
this.translateService = inject(TranslateService);
|
|
11181
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
11182
|
+
this.kitUsersService = inject(KitUsersService);
|
|
11183
|
+
this.injector = inject(Injector);
|
|
11184
|
+
this.kitExcelExportService = inject(KitExcelExportService);
|
|
11185
|
+
this.cardDetailsComponent = viewChild.required((KitCardDetailsComponent));
|
|
11186
|
+
this.deleteDialogActionsTemplate = viewChild.required('deleteDialogActions', { read: TemplateRef });
|
|
11187
|
+
this.showIdentityType = input.required(...(ngDevMode ? [{ debugName: "showIdentityType" }] : /* istanbul ignore next */ []));
|
|
11188
|
+
this.permissionCategory = input.required(...(ngDevMode ? [{ debugName: "permissionCategory" }] : /* istanbul ignore next */ []));
|
|
11189
|
+
this.currentUser = this.store.selectSignal(KIT_USER_STATE_TOKEN);
|
|
11190
|
+
this.currentUserId = computed(() => this.currentUser()?.data?.id ?? null, ...(ngDevMode ? [{ debugName: "currentUserId" }] : /* istanbul ignore next */ []));
|
|
11191
|
+
this.isCreateMode = signal(false, ...(ngDevMode ? [{ debugName: "isCreateMode" }] : /* istanbul ignore next */ []));
|
|
11192
|
+
this.cardData$ = this.store.select(KIT_USERS_SETTINGS_STATE_TOKEN).pipe(map(state => kitBuildGridDataResults(state?.users?.data ?? [], state?.users?.loading ?? false, state?.users?.total ?? 0)));
|
|
11193
|
+
this.pageSize = 10;
|
|
11194
|
+
this.kitSvgIcon = KitSvgIcon;
|
|
11195
|
+
this.kitButtonIconPosition = KitButtonIconPosition;
|
|
11196
|
+
this.kitButtonKind = KitButtonKind;
|
|
11197
|
+
this.kitButtonType = KitButtonType;
|
|
11198
|
+
this.kitSvgIconType = KitSvgIconType;
|
|
11199
|
+
this.cardDetailsSkeletonConfig = {
|
|
11200
|
+
itemHeight: 72,
|
|
11201
|
+
itemsCount: 10,
|
|
11202
|
+
};
|
|
11203
|
+
this.cancelAction = {
|
|
11204
|
+
text: this.translateService.instant('kit.common.cancel'),
|
|
11205
|
+
cssClass: `${KitButtonType.GHOST} ${KitButtonState.DEFAULT} ${KitButtonKind.MEDIUM}`,
|
|
11206
|
+
};
|
|
11207
|
+
this.deleteAction = {
|
|
11208
|
+
text: this.translateService.instant('kit.common.delete'),
|
|
11209
|
+
cssClass: `${KitButtonType.PRIMARY} ${KitButtonState.ERROR} ${KitButtonKind.MEDIUM}`,
|
|
11210
|
+
};
|
|
11110
11211
|
}
|
|
11111
|
-
|
|
11112
|
-
const
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
}));
|
|
11120
|
-
workbook.sheets[0].rows = this.getExportedExcelRows(columns, data, exportedColumns, translationMap, userTimezone, valueTransforms);
|
|
11121
|
-
workbook.sheets[0].columns = columns;
|
|
11122
|
-
const dataUrl = await new Workbook(workbook).toDataURL();
|
|
11123
|
-
return saveAs(dataUrl, `${exportedFileName}.xlsx`);
|
|
11212
|
+
onDataStateChanged({ skip, take, search, filters }) {
|
|
11213
|
+
const filter = {
|
|
11214
|
+
logic: filters?.logic ?? KitFilterLogic.AND,
|
|
11215
|
+
filters: [
|
|
11216
|
+
...(search ? [{ field: 'name', operator: 'contains', value: search }] : []),
|
|
11217
|
+
...(filters?.filters || []),
|
|
11218
|
+
],
|
|
11219
|
+
};
|
|
11220
|
+
this.store.dispatch(new KitFetchUsersSettings({ skip, take, filter, sort: defaultUserSort }));
|
|
11124
11221
|
}
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
for (const row of data) {
|
|
11128
|
-
const rowCells = gridColumns.map((column) => {
|
|
11129
|
-
const rawValue = this.gridCellService.getCellValue(row, column.field);
|
|
11130
|
-
const value = valueTransforms[column.field]?.(rawValue) ?? rawValue;
|
|
11131
|
-
switch (column.type) {
|
|
11132
|
-
case 'number': {
|
|
11133
|
-
return { value: (value ?? undefined) };
|
|
11134
|
-
}
|
|
11135
|
-
case 'time':
|
|
11136
|
-
return { format: column.excelFormat, value: this.timeStringToExcelFraction(value) };
|
|
11137
|
-
case 'date':
|
|
11138
|
-
case 'dateTime': {
|
|
11139
|
-
const format = column.excelFormat || (column.type === 'date' ? KIT_DATE_FORMAT : KIT_DATETIME_FORMAT_LONG);
|
|
11140
|
-
const dateValue = value ? this.truncateToSeconds(this.convertToUtcDate(value)) : undefined;
|
|
11141
|
-
return { format, value: dateValue };
|
|
11142
|
-
}
|
|
11143
|
-
case 'dateLocal':
|
|
11144
|
-
case 'dateTimeLocal': {
|
|
11145
|
-
const format = column.excelFormat || (column.type === 'dateLocal' ? KIT_DATE_FORMAT : KIT_DATETIME_FORMAT_LONG);
|
|
11146
|
-
const dateValue = value ? this.truncateToSeconds(new Date(value)) : undefined;
|
|
11147
|
-
return { format, value: dateValue };
|
|
11148
|
-
}
|
|
11149
|
-
case 'dateZone':
|
|
11150
|
-
case 'dateTimeZone': {
|
|
11151
|
-
const format = column.excelFormat || (column.type === 'dateZone' ? KIT_DATE_FORMAT : KIT_DATETIME_FORMAT_LONG);
|
|
11152
|
-
const dateValue = value
|
|
11153
|
-
? this.truncateToSeconds(toZonedTime(new Date(value), userTimezone))
|
|
11154
|
-
: undefined;
|
|
11155
|
-
return { format, value: dateValue };
|
|
11156
|
-
}
|
|
11157
|
-
}
|
|
11158
|
-
return { value: this.gridCellService.createCellValue(column.type, column.field, row, translationMap, '', valueTransforms) };
|
|
11159
|
-
});
|
|
11160
|
-
rows.push({ cells: rowCells, type: 'data' });
|
|
11161
|
-
}
|
|
11162
|
-
return rows;
|
|
11222
|
+
onCardSelected(card) {
|
|
11223
|
+
this.store.dispatch(new KitFetchUsersSettingsDetails(card.id));
|
|
11163
11224
|
}
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
return '';
|
|
11167
|
-
}
|
|
11168
|
-
const [hoursStr, minutesStr,] = time.split(':');
|
|
11169
|
-
const hours = Number.parseInt(hoursStr, 10);
|
|
11170
|
-
const minutes = Number.parseInt(minutesStr, 10);
|
|
11171
|
-
return (hours * 60 + minutes) / (24 * 60);
|
|
11225
|
+
isDeleteDisabled(userId) {
|
|
11226
|
+
return this.currentUserId() === userId;
|
|
11172
11227
|
}
|
|
11173
|
-
|
|
11174
|
-
const
|
|
11175
|
-
|
|
11176
|
-
|
|
11228
|
+
getUserDisplayName(user) {
|
|
11229
|
+
const fullName = [
|
|
11230
|
+
user.firstName,
|
|
11231
|
+
user.lastName,
|
|
11232
|
+
].filter(Boolean).join(' ').trim();
|
|
11233
|
+
return fullName;
|
|
11177
11234
|
}
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
|
|
11181
|
-
|
|
11235
|
+
onDeleteUser(user) {
|
|
11236
|
+
this.kitDialogService.openDialog({
|
|
11237
|
+
title: this.translateService.instant('kit.usersSettings.deleteDialog.title'),
|
|
11238
|
+
content: this.translateService.instant('kit.usersSettings.deleteDialog.content', {
|
|
11239
|
+
name: this.getUserDisplayName(user),
|
|
11240
|
+
}),
|
|
11241
|
+
appendTo: this.viewContainerRef,
|
|
11242
|
+
actions: [
|
|
11243
|
+
this.cancelAction,
|
|
11244
|
+
this.deleteAction,
|
|
11245
|
+
],
|
|
11246
|
+
cssClass: 'confirmation-dialog-limited-width',
|
|
11247
|
+
});
|
|
11248
|
+
this.kitDialogService.dialogRef?.result.pipe(take(1)).subscribe(action => {
|
|
11249
|
+
if (action === this.deleteAction) {
|
|
11250
|
+
this.store.dispatch(new KitDeleteUsersSettingsUser(user.id)).subscribe(() => {
|
|
11251
|
+
this.cardDetailsComponent().deleteCard(user.id);
|
|
11252
|
+
});
|
|
11253
|
+
}
|
|
11254
|
+
});
|
|
11182
11255
|
}
|
|
11183
|
-
|
|
11184
|
-
|
|
11256
|
+
exportExcel() {
|
|
11257
|
+
this.kitUsersService.fetchUsers({}).subscribe(data => {
|
|
11258
|
+
runInInjectionContext(this.injector, () => {
|
|
11259
|
+
this.kitExcelExportService.export(data.data, exportedUserColumns, 'Users', {});
|
|
11260
|
+
});
|
|
11261
|
+
});
|
|
11262
|
+
}
|
|
11263
|
+
openCreateUserDialog() {
|
|
11264
|
+
this.kitDialogService.openDialog({
|
|
11265
|
+
title: this.translateService.instant('kit.usersSettings.createDialog.title'),
|
|
11266
|
+
content: KitUsersSettingsCreateDialogComponent,
|
|
11267
|
+
appendTo: this.viewContainerRef,
|
|
11268
|
+
cssClass: 'kit-user-settings-create-dialog',
|
|
11269
|
+
});
|
|
11270
|
+
this.kitDialogService.dialogRef?.result.pipe(take(1)).subscribe((result) => {
|
|
11271
|
+
if (result && 'id' in result) {
|
|
11272
|
+
this.cardDetailsComponent().appendCard(result);
|
|
11273
|
+
this.cardDetailsComponent().onCardClick(result);
|
|
11274
|
+
requestAnimationFrame(() => this.cardDetailsComponent().scrollToCardById(result.id.toString()));
|
|
11275
|
+
}
|
|
11276
|
+
});
|
|
11277
|
+
}
|
|
11278
|
+
updateCardData(updatedUser) {
|
|
11279
|
+
this.cardDetailsComponent().updateSpecificCardData(updatedUser);
|
|
11280
|
+
}
|
|
11281
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11282
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.4", type: KitUsersSettingsComponent, isStandalone: true, selector: "kit-users-settings", inputs: { showIdentityType: { classPropertyName: "showIdentityType", publicName: "showIdentityType", isSignal: true, isRequired: true, transformFunction: null }, permissionCategory: { classPropertyName: "permissionCategory", publicName: "permissionCategory", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
|
|
11283
|
+
KitExcelExportService,
|
|
11284
|
+
KitGridCellService,
|
|
11285
|
+
DecimalPipe,
|
|
11286
|
+
DatePipe,
|
|
11287
|
+
], viewQueries: [{ propertyName: "cardDetailsComponent", first: true, predicate: (KitCardDetailsComponent), descendants: true, isSignal: true }, { propertyName: "deleteDialogActionsTemplate", first: true, predicate: ["deleteDialogActions"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<div class=\"kit-users-settings\">\n <kit-card-details [title]=\"'kit.usersSettings.title' | translate\"\n [pageSize]=\"pageSize\"\n [cardData$]=\"cardData$\"\n [cardSkeletonConfig]=\"cardDetailsSkeletonConfig\"\n (cardClicked)=\"onCardSelected($event)\"\n (dataStateChanged)=\"onDataStateChanged($event)\">\n <ng-template #headerActions>\n <div class=\"kit-users-settings-header-actions\">\n <kit-button [label]=\"'Buttons.Export' | translate\"\n [icon]=\"kitSvgIcon.EXPORT\"\n [iconType]=\"kitSvgIconType.STROKE\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"exportExcel()\" />\n <kit-button [label]=\"'kit.usersSettings.details.createNewUser' | translate\"\n [icon]=\"kitSvgIcon.PLUS\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"openCreateUserDialog()\" />\n </div>\n </ng-template>\n\n <ng-template #cardElement\n let-user>\n <div class=\"kit-users-settings-card\">\n <div class=\"kit-users-settings-card-text\">\n <kit-truncate-text>{{ getUserDisplayName(user) }}</kit-truncate-text>\n <kit-truncate-text>{{ user.userName }}</kit-truncate-text>\n </div>\n <kit-button [icon]=\"kitSvgIcon.TRASH\"\n [kind]=\"kitButtonKind.SMALL\"\n [type]=\"kitButtonType.TEXT\"\n [iconType]=\"kitSvgIconType.STROKE\"\n [disabled]=\"isDeleteDisabled(user.id)\"\n (clicked)=\"onDeleteUser(user)\" />\n </div>\n </ng-template>\n\n <ng-template #details\n let-activeId>\n <kit-users-settings-profile [showIdentityType]=\"showIdentityType()\"\n [permissionCategory]=\"permissionCategory()\"\n (updated)=\"updateCardData($event)\" />\n </ng-template>\n </kit-card-details>\n</div>\n", styles: [".kit-users-settings-header-actions{display:flex;align-items:center;gap:8px}.kit-users-settings-card{display:flex;align-items:center;justify-content:space-between;gap:8px}.kit-users-settings-card-text{max-width:150px;display:flex;flex-direction:column;gap:8px;padding:8px 5px}::ng-deep .kit-textbox.disabled .k-input-inner{background-color:var(--ui-kit-color-grey-13)}\n"], dependencies: [{ kind: "component", type: KitCardDetailsComponent, selector: "kit-card-details", inputs: ["cardData$", "pageSize", "title", "cardSkeletonConfig"], outputs: ["dataStateChanged", "cardClicked"] }, { kind: "component", type: KitTruncateTextComponent, selector: "kit-truncate-text", inputs: ["tooltipText"] }, { kind: "component", type: KitUsersSettingsProfileComponent, selector: "kit-users-settings-profile", inputs: ["showIdentityType", "permissionCategory"], outputs: ["updated"] }, { kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
11185
11288
|
}
|
|
11186
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type:
|
|
11187
|
-
type:
|
|
11188
|
-
|
|
11289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsComponent, decorators: [{
|
|
11290
|
+
type: Component,
|
|
11291
|
+
args: [{ selector: 'kit-users-settings', imports: [
|
|
11292
|
+
KitCardDetailsComponent,
|
|
11293
|
+
KitTruncateTextComponent,
|
|
11294
|
+
KitUsersSettingsProfileComponent,
|
|
11295
|
+
KitButtonComponent,
|
|
11296
|
+
TranslatePipe,
|
|
11297
|
+
], providers: [
|
|
11298
|
+
KitExcelExportService,
|
|
11299
|
+
KitGridCellService,
|
|
11300
|
+
DecimalPipe,
|
|
11301
|
+
DatePipe,
|
|
11302
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"kit-users-settings\">\n <kit-card-details [title]=\"'kit.usersSettings.title' | translate\"\n [pageSize]=\"pageSize\"\n [cardData$]=\"cardData$\"\n [cardSkeletonConfig]=\"cardDetailsSkeletonConfig\"\n (cardClicked)=\"onCardSelected($event)\"\n (dataStateChanged)=\"onDataStateChanged($event)\">\n <ng-template #headerActions>\n <div class=\"kit-users-settings-header-actions\">\n <kit-button [label]=\"'Buttons.Export' | translate\"\n [icon]=\"kitSvgIcon.EXPORT\"\n [iconType]=\"kitSvgIconType.STROKE\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"exportExcel()\" />\n <kit-button [label]=\"'kit.usersSettings.details.createNewUser' | translate\"\n [icon]=\"kitSvgIcon.PLUS\"\n [iconPosition]=\"kitButtonIconPosition.LEADING\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"openCreateUserDialog()\" />\n </div>\n </ng-template>\n\n <ng-template #cardElement\n let-user>\n <div class=\"kit-users-settings-card\">\n <div class=\"kit-users-settings-card-text\">\n <kit-truncate-text>{{ getUserDisplayName(user) }}</kit-truncate-text>\n <kit-truncate-text>{{ user.userName }}</kit-truncate-text>\n </div>\n <kit-button [icon]=\"kitSvgIcon.TRASH\"\n [kind]=\"kitButtonKind.SMALL\"\n [type]=\"kitButtonType.TEXT\"\n [iconType]=\"kitSvgIconType.STROKE\"\n [disabled]=\"isDeleteDisabled(user.id)\"\n (clicked)=\"onDeleteUser(user)\" />\n </div>\n </ng-template>\n\n <ng-template #details\n let-activeId>\n <kit-users-settings-profile [showIdentityType]=\"showIdentityType()\"\n [permissionCategory]=\"permissionCategory()\"\n (updated)=\"updateCardData($event)\" />\n </ng-template>\n </kit-card-details>\n</div>\n", styles: [".kit-users-settings-header-actions{display:flex;align-items:center;gap:8px}.kit-users-settings-card{display:flex;align-items:center;justify-content:space-between;gap:8px}.kit-users-settings-card-text{max-width:150px;display:flex;flex-direction:column;gap:8px;padding:8px 5px}::ng-deep .kit-textbox.disabled .k-input-inner{background-color:var(--ui-kit-color-grey-13)}\n"] }]
|
|
11303
|
+
}], propDecorators: { cardDetailsComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KitCardDetailsComponent), { isSignal: true }] }], deleteDialogActionsTemplate: [{ type: i0.ViewChild, args: ['deleteDialogActions', { ...{ read: TemplateRef }, isSignal: true }] }], showIdentityType: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIdentityType", required: true }] }], permissionCategory: [{ type: i0.Input, args: [{ isSignal: true, alias: "permissionCategory", required: true }] }] } });
|
|
11189
11304
|
|
|
11190
11305
|
const KIT_ENTITY_CREATE_SERVICE = new InjectionToken('kitEntityCreateService');
|
|
11191
11306
|
class KitCreateEntityDialogComponent extends DialogContentBase {
|
|
@@ -11241,23 +11356,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
11241
11356
|
], providers: [KitFormErrors], template: "<div [formGroup]=\"form\">\n <kit-textbox class=\"textbox\"\n formControlName=\"name\"\n [label]=\"'Name' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form.get('name'))\"\n [messageText]=\"getFormErrorMessages(form, 'name')\" />\n\n <kit-dialog-actions>\n <kit-button [label]=\"'Cancel' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"dialog.close()\" />\n <kit-button [label]=\"'Save' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [disabled]=\"form.invalid || isSaving()\"\n (clicked)=\"createEntity()\" />\n </kit-dialog-actions>\n</div>\n", styles: ["::ng-deep .kit-dialog .k-dialog{min-width:400px}::ng-deep .kit-dialog .k-dialog .k-dialog-content{padding:20px 25px}\n"] }]
|
|
11242
11357
|
}], ctorParameters: () => [], propDecorators: { maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }] } });
|
|
11243
11358
|
|
|
11244
|
-
const KIT_GRID_COLUMN_WIDTH = 170;
|
|
11245
|
-
const KIT_GRID_PAGE_SIZE = 10;
|
|
11246
|
-
|
|
11247
|
-
var KitPermissionTypes;
|
|
11248
|
-
(function (KitPermissionTypes) {
|
|
11249
|
-
KitPermissionTypes["Create"] = "Create";
|
|
11250
|
-
KitPermissionTypes["Delete"] = "Delete";
|
|
11251
|
-
KitPermissionTypes["Edit"] = "Edit";
|
|
11252
|
-
KitPermissionTypes["View"] = "View";
|
|
11253
|
-
KitPermissionTypes["Set"] = "Set";
|
|
11254
|
-
KitPermissionTypes["Use"] = "Use";
|
|
11255
|
-
})(KitPermissionTypes || (KitPermissionTypes = {}));
|
|
11256
|
-
const defaultUserRolesSort = [{ field: 'name', dir: 'asc' }];
|
|
11257
|
-
const exportedUserRoleColumns = [
|
|
11258
|
-
kitBuildGridColumn('name', 'Name', 'string', false, false, KIT_GRID_COLUMN_WIDTH),
|
|
11259
|
-
];
|
|
11260
|
-
|
|
11261
11359
|
class KitPartnerDetailsComponent {
|
|
11262
11360
|
constructor() {
|
|
11263
11361
|
this.kitDialogService = inject(KitDialogService);
|
|
@@ -11324,51 +11422,6 @@ const exportedPartnerColumns = [
|
|
|
11324
11422
|
kitBuildGridColumn('name', 'Name', 'string', false, false, KIT_GRID_COLUMN_WIDTH),
|
|
11325
11423
|
];
|
|
11326
11424
|
|
|
11327
|
-
class KitHttpErrorHandlerService {
|
|
11328
|
-
constructor() {
|
|
11329
|
-
this.kitNotificationService = inject(KitNotificationService);
|
|
11330
|
-
this.translateService = inject(TranslateService);
|
|
11331
|
-
this.router = inject(Router);
|
|
11332
|
-
}
|
|
11333
|
-
handleServerError(error) {
|
|
11334
|
-
if (error.error instanceof ErrorEvent) {
|
|
11335
|
-
this.showErrorNotification(`${this.translateService.instant('kit.http.clientError')} ${error.error.message}`);
|
|
11336
|
-
return throwError(() => error);
|
|
11337
|
-
}
|
|
11338
|
-
switch (error.status) {
|
|
11339
|
-
case HttpStatusCode.Unauthorized:
|
|
11340
|
-
this.showErrorNotification(this.translateService.instant('kit.http.unauthorized'));
|
|
11341
|
-
break;
|
|
11342
|
-
case HttpStatusCode.Forbidden:
|
|
11343
|
-
this.showErrorNotification(this.translateService.instant('kit.http.forbidden'));
|
|
11344
|
-
this.router.navigate(['forbidden']);
|
|
11345
|
-
break;
|
|
11346
|
-
case HttpStatusCode.NotFound:
|
|
11347
|
-
this.showErrorNotification(this.translateService.instant('kit.http.notFound'));
|
|
11348
|
-
break;
|
|
11349
|
-
case HttpStatusCode.BadRequest:
|
|
11350
|
-
this.showErrorNotification(`${this.translateService.instant('kit.http.validationError')} ${error.error?.title ?? ''}`);
|
|
11351
|
-
break;
|
|
11352
|
-
default:
|
|
11353
|
-
if (error.status >= HttpStatusCode.InternalServerError) {
|
|
11354
|
-
this.showErrorNotification(`${this.translateService.instant('kit.http.serverError')} ${error.error?.title ?? ''}`);
|
|
11355
|
-
}
|
|
11356
|
-
}
|
|
11357
|
-
return throwError(() => error);
|
|
11358
|
-
}
|
|
11359
|
-
showSuccessNotification(message) {
|
|
11360
|
-
this.kitNotificationService.addNotification(KitNotificationType.SUCCESS, message, true, 3000);
|
|
11361
|
-
}
|
|
11362
|
-
showErrorNotification(message) {
|
|
11363
|
-
this.kitNotificationService.addNotification(KitNotificationType.ERROR, message);
|
|
11364
|
-
}
|
|
11365
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitHttpErrorHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
11366
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitHttpErrorHandlerService }); }
|
|
11367
|
-
}
|
|
11368
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitHttpErrorHandlerService, decorators: [{
|
|
11369
|
-
type: Injectable
|
|
11370
|
-
}] });
|
|
11371
|
-
|
|
11372
11425
|
class KitPartnerService {
|
|
11373
11426
|
constructor() {
|
|
11374
11427
|
this.httpClient = inject(HttpClient);
|
|
@@ -11745,6 +11798,7 @@ const kitTranslations = {
|
|
|
11745
11798
|
closeButtonLabel: 'Close',
|
|
11746
11799
|
},
|
|
11747
11800
|
usersSettings: {
|
|
11801
|
+
title: 'User Maintenance',
|
|
11748
11802
|
details: {
|
|
11749
11803
|
title: 'User Details',
|
|
11750
11804
|
loginId: 'Login ID',
|
|
@@ -11755,9 +11809,6 @@ const kitTranslations = {
|
|
|
11755
11809
|
mfa: 'Multi-Factor Authentication',
|
|
11756
11810
|
createNewUser: 'Create New User',
|
|
11757
11811
|
password: 'Password',
|
|
11758
|
-
passwordRequired: 'Password is required',
|
|
11759
|
-
passwordTooWeak: 'Your password is too weak.',
|
|
11760
|
-
userNameInvalid: 'You have specified invalid Login ID.',
|
|
11761
11812
|
},
|
|
11762
11813
|
passwordDialog: {
|
|
11763
11814
|
title: 'Change Password',
|
|
@@ -11765,9 +11816,6 @@ const kitTranslations = {
|
|
|
11765
11816
|
cancel: 'Cancel',
|
|
11766
11817
|
newPassword: 'New Password',
|
|
11767
11818
|
repeatNewPassword: 'Repeat New Password',
|
|
11768
|
-
newPasswordRequired: 'New password is required',
|
|
11769
|
-
repeatNewPasswordRequired: 'Please repeat the new password',
|
|
11770
|
-
passwordsDoNotMatch: 'Passwords do not match',
|
|
11771
11819
|
forcePassword: 'Force Password Reset',
|
|
11772
11820
|
},
|
|
11773
11821
|
createDialog: {
|
|
@@ -11792,6 +11840,7 @@ const kitTranslations = {
|
|
|
11792
11840
|
},
|
|
11793
11841
|
},
|
|
11794
11842
|
entitlements: {
|
|
11843
|
+
empty: 'No entitlements available for this user',
|
|
11795
11844
|
identityType: 'Identity Type',
|
|
11796
11845
|
partners: 'Partners',
|
|
11797
11846
|
alias: 'Alias',
|
|
@@ -11846,6 +11895,7 @@ const kitTranslations = {
|
|
|
11846
11895
|
selectValue: 'Select value',
|
|
11847
11896
|
create: 'Create New',
|
|
11848
11897
|
delete: 'Delete',
|
|
11898
|
+
cancel: 'Cancel',
|
|
11849
11899
|
confirmationDelete: 'Are you sure you want to permanently delete {{name}}?',
|
|
11850
11900
|
name: 'Name',
|
|
11851
11901
|
save: 'Save',
|
|
@@ -11883,6 +11933,7 @@ const kitTranslations = {
|
|
|
11883
11933
|
duplicate: 'Duplicate value',
|
|
11884
11934
|
maxNumber: 'The value should be less than or equal to {{ maxNumber }}',
|
|
11885
11935
|
minNumber: 'The value should be greater than or equal to {{ minNumber }}',
|
|
11936
|
+
passwordsMismatch: 'Passwords do not match',
|
|
11886
11937
|
},
|
|
11887
11938
|
liveUpdates: {
|
|
11888
11939
|
pause: 'Pause Live Feed',
|
|
@@ -12029,6 +12080,7 @@ const kitTranslations = {
|
|
|
12029
12080
|
closeButtonLabel: 'Закрыть',
|
|
12030
12081
|
},
|
|
12031
12082
|
usersSettings: {
|
|
12083
|
+
title: 'Настройка пользователей',
|
|
12032
12084
|
details: {
|
|
12033
12085
|
title: 'Детали пользователя',
|
|
12034
12086
|
loginId: 'Логин',
|
|
@@ -12039,9 +12091,6 @@ const kitTranslations = {
|
|
|
12039
12091
|
mfa: 'Многофакторная аутентификация',
|
|
12040
12092
|
createNewUser: 'Создать нового пользователя',
|
|
12041
12093
|
password: 'Пароль',
|
|
12042
|
-
passwordRequired: 'Пароль обязателен',
|
|
12043
|
-
passwordTooWeak: 'Пароль слишком слабый.',
|
|
12044
|
-
userNameInvalid: 'Указан некорректный Логин.',
|
|
12045
12094
|
},
|
|
12046
12095
|
passwordDialog: {
|
|
12047
12096
|
title: 'Изменить пароль',
|
|
@@ -12049,9 +12098,6 @@ const kitTranslations = {
|
|
|
12049
12098
|
cancel: 'Отмена',
|
|
12050
12099
|
newPassword: 'Новый пароль',
|
|
12051
12100
|
repeatNewPassword: 'Повторите новый пароль',
|
|
12052
|
-
newPasswordRequired: 'Новый пароль обязателен',
|
|
12053
|
-
repeatNewPasswordRequired: 'Пожалуйста, повторите новый пароль',
|
|
12054
|
-
passwordsDoNotMatch: 'Пароли не совпадают',
|
|
12055
12101
|
forcePassword: 'Принудительно изменить пароль',
|
|
12056
12102
|
},
|
|
12057
12103
|
createDialog: {
|
|
@@ -12076,6 +12122,7 @@ const kitTranslations = {
|
|
|
12076
12122
|
},
|
|
12077
12123
|
},
|
|
12078
12124
|
entitlements: {
|
|
12125
|
+
empty: 'Нет доступных прав доступа для этого пользователя',
|
|
12079
12126
|
identityType: 'Тип удостоверения',
|
|
12080
12127
|
partners: 'Партнеры',
|
|
12081
12128
|
alias: 'Псевдоним',
|
|
@@ -12130,6 +12177,7 @@ const kitTranslations = {
|
|
|
12130
12177
|
selectValue: 'Выберите значение',
|
|
12131
12178
|
create: 'Создать',
|
|
12132
12179
|
delete: 'Удалить',
|
|
12180
|
+
cancel: 'Отмена',
|
|
12133
12181
|
confirmationDelete: 'Вы уверены, что хотите безвозвратно удалить {{name}}?',
|
|
12134
12182
|
name: 'Название',
|
|
12135
12183
|
save: 'Сохранить',
|
|
@@ -12164,6 +12212,10 @@ const kitTranslations = {
|
|
|
12164
12212
|
required: 'Обязательно для заполнения',
|
|
12165
12213
|
invalidLength: 'Значение должно быть меньше, чем {{ requiredLength }} символов',
|
|
12166
12214
|
invalidEmailFormat: 'Невалидный имэйл',
|
|
12215
|
+
duplicate: 'Дублирующее значение',
|
|
12216
|
+
maxNumber: 'Значение должно быть меньше или равно {{ maxNumber }}',
|
|
12217
|
+
minNumber: 'Значение должно быть больше или равно {{ minNumber }}',
|
|
12218
|
+
passwordsMismatch: 'Пароли не совпадают',
|
|
12167
12219
|
},
|
|
12168
12220
|
liveUpdates: {
|
|
12169
12221
|
pause: 'Остановить обновление',
|
|
@@ -15699,17 +15751,6 @@ class KitAbstractIdPayloadAction {
|
|
|
15699
15751
|
}
|
|
15700
15752
|
}
|
|
15701
15753
|
|
|
15702
|
-
class KitSkeletonSectionComponent {
|
|
15703
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitSkeletonSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15704
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: KitSkeletonSectionComponent, isStandalone: true, selector: "kit-skeleton-section", ngImport: i0, template: "<div class=\"kit-skeleton-section\">\n <kit-skeleton [height]=\"24\"\n [width]=\"250\"\n ></kit-skeleton>\n\n <kit-skeleton [height]=\"500\"\n ></kit-skeleton>\n</div>\n", styles: [".kit-skeleton-section{display:flex;flex-direction:column;gap:30px}\n"], dependencies: [{ kind: "component", type: KitSkeletonComponent, selector: "kit-skeleton", inputs: ["width", "height", "shape", "animation"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
15705
|
-
}
|
|
15706
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitSkeletonSectionComponent, decorators: [{
|
|
15707
|
-
type: Component,
|
|
15708
|
-
args: [{ selector: 'kit-skeleton-section', imports: [
|
|
15709
|
-
KitSkeletonComponent,
|
|
15710
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"kit-skeleton-section\">\n <kit-skeleton [height]=\"24\"\n [width]=\"250\"\n ></kit-skeleton>\n\n <kit-skeleton [height]=\"500\"\n ></kit-skeleton>\n</div>\n", styles: [".kit-skeleton-section{display:flex;flex-direction:column;gap:30px}\n"] }]
|
|
15711
|
-
}] });
|
|
15712
|
-
|
|
15713
15754
|
class KitGridLiveUpdatesControlComponent {
|
|
15714
15755
|
constructor() {
|
|
15715
15756
|
this.source = input.required(...(ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []));
|
|
@@ -17115,6 +17156,7 @@ class KitUserRolesComponent {
|
|
|
17115
17156
|
DecimalPipe,
|
|
17116
17157
|
DatePipe,
|
|
17117
17158
|
KitExcelExportService,
|
|
17159
|
+
KitHttpErrorHandlerService,
|
|
17118
17160
|
{
|
|
17119
17161
|
provide: KIT_ENTITY_CREATE_SERVICE,
|
|
17120
17162
|
useExisting: KitUserRolesService,
|
|
@@ -17135,6 +17177,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
17135
17177
|
DecimalPipe,
|
|
17136
17178
|
DatePipe,
|
|
17137
17179
|
KitExcelExportService,
|
|
17180
|
+
KitHttpErrorHandlerService,
|
|
17138
17181
|
{
|
|
17139
17182
|
provide: KIT_ENTITY_CREATE_SERVICE,
|
|
17140
17183
|
useExisting: KitUserRolesService,
|
|
@@ -17148,5 +17191,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
17148
17191
|
* Generated bundle index. Do not edit.
|
|
17149
17192
|
*/
|
|
17150
17193
|
|
|
17151
|
-
export { AbstractKitCtaPanelConfirmationComponent, AddGridFilter, DeletePartner, FetchApiTokens, FetchPartners, FetchUser, FetchUserIdentities, FetchUserPermissions, FetchUserSettings, HighlightPipe, KIT_ALL_PERMISSIONS_PATH, KIT_API_TOKENS_STATE_TOKEN, KIT_BASE_PATH, KIT_DATETIME_FORMAT_LONG, KIT_DATE_FORMAT, KIT_DATE_FORMAT_SHORT, KIT_ENTITY_CREATE_SERVICE, KIT_GRID_CELL_DATE_FORMAT_CONFIG, KIT_GRID_COLUMN_WIDTH, KIT_GRID_PAGE_SIZE, KIT_GRID_STATE_TOKEN, KIT_PARTNERS_STATE_TOKEN, KIT_TIME_FORMAT_SHORT, KIT_USER_APPLICATIONS_PATH, KIT_USER_IDENTITIES_STATE_TOKEN, KIT_USER_PATH, KIT_USER_PERMISSIONS_PATH, KIT_USER_PERMISSIONS_STATE_TOKEN, KIT_USER_STATE_TOKEN, KitAbstractIdPayloadAction, KitAbstractPayloadAction, KitAccountService, KitApiTokenMaintenanceListComponent, KitApiTokenMaintenanceListState, KitApiTokensPermissionCategories, KitAutocompleteComponent, KitAutocompleteDirective, KitAvatarComponent, KitAvatarSize, KitBackButtonComponent, KitBadgeDirective, KitBadgeTheme, KitBreadcrumbsComponent, KitBreadcrumbsService, KitButtonComponent, KitButtonIconPosition, KitButtonKind, KitButtonState, KitButtonType, KitCardComponent, KitCardDetailsComponent, KitCardTheme, KitCheckboxComponent, KitCheckboxState, KitClipboardService, KitCodeEditorComponent, KitCodeEditorLanguage, KitCodeEditorMode, KitCollapsedListComponent, KitCollapsedListDropdownAlign, KitCopyTextComponent, KitCreateEntityDialogComponent, KitCtaPanelAbstractConfirmationComponent, KitCtaPanelActionComponent, KitCtaPanelConfirmationComponent, KitCtaPanelItemComponent, KitCtaPanelItemType, KitDataFieldComponent, KitDataFieldState, KitDateRangeSingleInput, KitDatepickerComponent, KitDatepickerSize, KitDaterangeComponent, KitDaterangeType, KitDatetimepickerComponent, KitDeferredFailedRequestService, KitDialogActionsComponent, KitDialogComponent, KitDialogService, KitDialogTitlebarComponent, KitDialogType, KitDrawerComponent, KitDrawerContentTemplateDirective, KitDrawerFooterTemplateDirective, KitDrawerMode, KitDropdownComponent, KitDropdownItemTemplateDirective, KitDropdownSize, KitEmptySectionComponent, KitEmptySectionSize, KitEntityGridComponent, KitEntitySectionComponent, KitEntitySectionContainerComponent, KitEntitySectionEditableActionsTemplateDirective, KitEntitySectionEditableComponent, KitEntitySectionEditableEditTemplateDirective, KitEntitySectionEditableMode, KitEntitySectionEditableViewTemplateDirective, KitEntityTitleComponent, KitExcelExportService, KitExpansionPanelComponent, KitExpansionPanelHeaderTemplateDirective, KitExpansionPanelToggleMode, KitExpansionPanelView, KitFileCardComponent, KitFileCardMessagesComponent, KitFileCardSize, KitFileUploadComponent, KitFilterCheckboxComponent, KitFilterDateRange, KitFilterLogic, KitFilterOperator, KitFilterType, KitForbiddenComponent, KitFormErrors, KitFormFieldComponent, KitFormLabelComponent, KitFormMessageComponent, KitGlobalSearchComponent, KitGridActionComponent, KitGridArchiveToggle, KitGridCellComponent, KitGridCellService, KitGridCellTemplateDirective, KitGridCheckboxColumnComponent, KitGridCheckboxColumnType, KitGridColumnComponent, KitGridColumnManagerComponent, KitGridComponent, KitGridDetailTemplateDirective, KitGridDetailsButtonComponent, KitGridDropPosition, KitGridExportComponent, KitGridFiltersComponent, KitGridFiltersToggleComponent, KitGridLiveUpdatesControlComponent, KitGridSearchComponent, KitGridSortSettingsMode, KitGridState, KitGridUrlStateService, KitGridViewType, KitGridViewsComponent, KitGridViewsState, KitHttpErrorHandlerService, KitListComponent, KitLoaderComponent, KitLocationStepperComponent, KitLocationStepperIconTheme, KitLocationStepperTheme, KitMobileHeaderComponent, KitMobileMenuComponent, KitMobileMenuState, KitMultiselectComponent, KitMultiselectGroupTagTemplateDirective, KitMultiselectItemsDirection, KitMultiselectSize, KitNavigationMenuComponent, KitNavigationMenuService, KitNavigationMenuSubmenuComponent, KitNavigationTabsComponent, KitNavigationTabsType, KitNotFoundComponent, KitNoteComponent, KitNotificationComponent, KitNotificationService, KitNotificationType, KitNumericTextboxComponent, KitNumericTextboxSize, KitNumericTextboxState, KitOptionToggleComponent, KitOptionToggleSize, KitPageLayoutComponent, KitPartnerComponent, KitPartnerService, KitPartnerState, KitPermissionDirective, KitPillComponent, KitPillTheme, KitPillType, KitPopoverAnchorDirective, KitPopoverComponent, KitPopoverPosition, KitPopoverShowOption, KitPopupAlignHorizontal, KitPopupAlignVertical, KitPopupComponent, KitPopupPositionMode, KitProfileMenuComponent, KitQueryParamsName, KitQueryParamsService, KitRadioButtonComponent, KitRadioButtonType, KitRoutePathComponent, KitSchedulerAgendaTimeTemplateDirective, KitSchedulerComponent, KitSchedulerCustomViewTemplateDirective, KitSchedulerMonthEventTemplateDirective, KitSchedulerMonthHeaderCellTemplateDirective, KitSchedulerToolbarTemplateDirective, KitSchedulerWeekEventTemplateDirective, KitScrollNavigationComponent, KitScrollNavigationSectionComponent, KitSearchBarComponent, KitSelectableCardComponent, KitSidebarComponent, KitSkeletonAnimation, KitSkeletonComponent, KitSkeletonGridComponent, KitSkeletonSectionComponent, KitSkeletonShape, KitSortDirection, KitSortableComponent, KitSplitContainerComponent, KitStatusLabelColor, KitStatusLabelComponent, KitStatusLabelSize, KitSvgIcon, KitSvgIconComponent, KitSvgIconType, KitSvgSpriteComponent, KitSwitchComponent, KitSwitchMode, KitSwitchState, KitTabComponent, KitTabContentDirective, KitTabsComponent, KitTabsSize, KitTabsType, KitTextLabelComponent, KitTextLabelState, KitTextareaAutoresizeDirective, KitTextareaComponent, KitTextareaState, KitTextboxActionsComponent, KitTextboxComponent, KitTextboxSize, KitTextboxState, KitThemeService, KitThemes, KitTileLayoutComponent, KitTileLayoutItemComponent, KitTimelineCardComponent, KitTimelineCompactComponent, KitTimelineCompactItemTheme, KitTimelineComponent, KitTimelineTheme, KitTimelineType, KitTimepickerComponent, KitTitleTemplateDirective, KitToastrModule, KitToastrPosition, KitToastrService, KitToastrType, KitToggleComponent, KitToggleSize, KitTooltipDirective, KitTooltipPosition, KitTopBarComponent, KitTrackingCardComponent, KitTrackingTimelineComponent, KitTranslateLoader, KitTranslateService, KitTreeComponent, KitTreeContentDirective, KitTreeContentFormat, KitTreeViewMode, KitTruncateTextComponent, KitUnitsTextboxComponent, KitUnitsTextboxDropdownPosition, KitUnitsTextboxType, KitUserApplicationsState, KitUserIdentitiesInterceptor, KitUserIdentitiesSelector, KitUserIdentitiesState, KitUserPermissionsState, KitUserRoleDetailsComponent, KitUserRolesComponent, KitUserRolesService, KitUserRolesState, KitUserSettingsComponent, KitUserSettingsKeys, KitUserSettingsState, KitUserState, KitUserType, KitUsersSettingsComponent, KitUsersSettingsEntitlementsService, KitUsersSettingsEntitlementsState, KitUsersSettingsReferenceService,
|
|
17194
|
+
export { AbstractKitCtaPanelConfirmationComponent, AddGridFilter, DeletePartner, FetchApiTokens, FetchPartners, FetchUser, FetchUserIdentities, FetchUserPermissions, FetchUserSettings, HighlightPipe, KIT_ALL_PERMISSIONS_PATH, KIT_API_TOKENS_STATE_TOKEN, KIT_BASE_PATH, KIT_DATETIME_FORMAT_LONG, KIT_DATE_FORMAT, KIT_DATE_FORMAT_SHORT, KIT_ENTITY_CREATE_SERVICE, KIT_GRID_CELL_DATE_FORMAT_CONFIG, KIT_GRID_COLUMN_WIDTH, KIT_GRID_PAGE_SIZE, KIT_GRID_STATE_TOKEN, KIT_PARTNERS_STATE_TOKEN, KIT_TIME_FORMAT_SHORT, KIT_USER_APPLICATIONS_PATH, KIT_USER_IDENTITIES_STATE_TOKEN, KIT_USER_PATH, KIT_USER_PERMISSIONS_PATH, KIT_USER_PERMISSIONS_STATE_TOKEN, KIT_USER_STATE_TOKEN, KitAbstractIdPayloadAction, KitAbstractPayloadAction, KitAccountService, KitApiTokenMaintenanceListComponent, KitApiTokenMaintenanceListState, KitApiTokensPermissionCategories, KitAutocompleteComponent, KitAutocompleteDirective, KitAvatarComponent, KitAvatarSize, KitBackButtonComponent, KitBadgeDirective, KitBadgeTheme, KitBreadcrumbsComponent, KitBreadcrumbsService, KitButtonComponent, KitButtonIconPosition, KitButtonKind, KitButtonState, KitButtonType, KitCardComponent, KitCardDetailsComponent, KitCardTheme, KitCheckboxComponent, KitCheckboxState, KitClipboardService, KitCodeEditorComponent, KitCodeEditorLanguage, KitCodeEditorMode, KitCollapsedListComponent, KitCollapsedListDropdownAlign, KitCopyTextComponent, KitCreateEntityDialogComponent, KitCtaPanelAbstractConfirmationComponent, KitCtaPanelActionComponent, KitCtaPanelConfirmationComponent, KitCtaPanelItemComponent, KitCtaPanelItemType, KitDataFieldComponent, KitDataFieldState, KitDateRangeSingleInput, KitDatepickerComponent, KitDatepickerSize, KitDaterangeComponent, KitDaterangeType, KitDatetimepickerComponent, KitDeferredFailedRequestService, KitDialogActionsComponent, KitDialogComponent, KitDialogService, KitDialogTitlebarComponent, KitDialogType, KitDrawerComponent, KitDrawerContentTemplateDirective, KitDrawerFooterTemplateDirective, KitDrawerMode, KitDropdownComponent, KitDropdownItemTemplateDirective, KitDropdownSize, KitEmptySectionComponent, KitEmptySectionSize, KitEntityGridComponent, KitEntitySectionComponent, KitEntitySectionContainerComponent, KitEntitySectionEditableActionsTemplateDirective, KitEntitySectionEditableComponent, KitEntitySectionEditableEditTemplateDirective, KitEntitySectionEditableMode, KitEntitySectionEditableViewTemplateDirective, KitEntityTitleComponent, KitExcelExportService, KitExpansionPanelComponent, KitExpansionPanelHeaderTemplateDirective, KitExpansionPanelToggleMode, KitExpansionPanelView, KitFileCardComponent, KitFileCardMessagesComponent, KitFileCardSize, KitFileUploadComponent, KitFilterCheckboxComponent, KitFilterDateRange, KitFilterLogic, KitFilterOperator, KitFilterType, KitForbiddenComponent, KitFormErrors, KitFormFieldComponent, KitFormLabelComponent, KitFormMessageComponent, KitGlobalSearchComponent, KitGridActionComponent, KitGridArchiveToggle, KitGridCellComponent, KitGridCellService, KitGridCellTemplateDirective, KitGridCheckboxColumnComponent, KitGridCheckboxColumnType, KitGridColumnComponent, KitGridColumnManagerComponent, KitGridComponent, KitGridDetailTemplateDirective, KitGridDetailsButtonComponent, KitGridDropPosition, KitGridExportComponent, KitGridFiltersComponent, KitGridFiltersToggleComponent, KitGridLiveUpdatesControlComponent, KitGridSearchComponent, KitGridSortSettingsMode, KitGridState, KitGridUrlStateService, KitGridViewType, KitGridViewsComponent, KitGridViewsState, KitHttpErrorHandlerService, KitListComponent, KitLoaderComponent, KitLocationStepperComponent, KitLocationStepperIconTheme, KitLocationStepperTheme, KitMobileHeaderComponent, KitMobileMenuComponent, KitMobileMenuState, KitMultiselectComponent, KitMultiselectGroupTagTemplateDirective, KitMultiselectItemsDirection, KitMultiselectSize, KitNavigationMenuComponent, KitNavigationMenuService, KitNavigationMenuSubmenuComponent, KitNavigationTabsComponent, KitNavigationTabsType, KitNotFoundComponent, KitNoteComponent, KitNotificationComponent, KitNotificationService, KitNotificationType, KitNumericTextboxComponent, KitNumericTextboxSize, KitNumericTextboxState, KitOptionToggleComponent, KitOptionToggleSize, KitPageLayoutComponent, KitPartnerComponent, KitPartnerService, KitPartnerState, KitPermissionDirective, KitPillComponent, KitPillTheme, KitPillType, KitPopoverAnchorDirective, KitPopoverComponent, KitPopoverPosition, KitPopoverShowOption, KitPopupAlignHorizontal, KitPopupAlignVertical, KitPopupComponent, KitPopupPositionMode, KitProfileMenuComponent, KitQueryParamsName, KitQueryParamsService, KitRadioButtonComponent, KitRadioButtonType, KitRoutePathComponent, KitSchedulerAgendaTimeTemplateDirective, KitSchedulerComponent, KitSchedulerCustomViewTemplateDirective, KitSchedulerMonthEventTemplateDirective, KitSchedulerMonthHeaderCellTemplateDirective, KitSchedulerToolbarTemplateDirective, KitSchedulerWeekEventTemplateDirective, KitScrollNavigationComponent, KitScrollNavigationSectionComponent, KitSearchBarComponent, KitSelectableCardComponent, KitSidebarComponent, KitSkeletonAnimation, KitSkeletonComponent, KitSkeletonGridComponent, KitSkeletonSectionComponent, KitSkeletonShape, KitSortDirection, KitSortableComponent, KitSplitContainerComponent, KitStatusLabelColor, KitStatusLabelComponent, KitStatusLabelSize, KitSvgIcon, KitSvgIconComponent, KitSvgIconType, KitSvgSpriteComponent, KitSwitchComponent, KitSwitchMode, KitSwitchState, KitTabComponent, KitTabContentDirective, KitTabsComponent, KitTabsSize, KitTabsType, KitTextLabelComponent, KitTextLabelState, KitTextareaAutoresizeDirective, KitTextareaComponent, KitTextareaState, KitTextboxActionsComponent, KitTextboxComponent, KitTextboxSize, KitTextboxState, KitThemeService, KitThemes, KitTileLayoutComponent, KitTileLayoutItemComponent, KitTimelineCardComponent, KitTimelineCompactComponent, KitTimelineCompactItemTheme, KitTimelineComponent, KitTimelineTheme, KitTimelineType, KitTimepickerComponent, KitTitleTemplateDirective, KitToastrModule, KitToastrPosition, KitToastrService, KitToastrType, KitToggleComponent, KitToggleSize, KitTooltipDirective, KitTooltipPosition, KitTopBarComponent, KitTrackingCardComponent, KitTrackingTimelineComponent, KitTranslateLoader, KitTranslateService, KitTreeComponent, KitTreeContentDirective, KitTreeContentFormat, KitTreeViewMode, KitTruncateTextComponent, KitUnitsTextboxComponent, KitUnitsTextboxDropdownPosition, KitUnitsTextboxType, KitUserApplicationsState, KitUserIdentitiesInterceptor, KitUserIdentitiesSelector, KitUserIdentitiesState, KitUserPermissionsState, KitUserRoleDetailsComponent, KitUserRolesComponent, KitUserRolesService, KitUserRolesState, KitUserSettingsComponent, KitUserSettingsKeys, KitUserSettingsState, KitUserState, KitUserType, KitUsersService, KitUsersSettingsComponent, KitUsersSettingsEntitlementType, KitUsersSettingsEntitlementsService, KitUsersSettingsEntitlementsState, KitUsersSettingsReferenceService, KitUsersSettingsState, RemoveGridFilter, SetGridColumns, SetGridFilters, SetGridSearch, SetGridSkip, SetGridSort, SetGridTake, SetUserIdentity, UpdateGridFilter, UpdatePartnerName, buildRandomUUID, changeFilterField, createDataFetcherFactory, findMatches, getTextboxState, isKitFilterDescriptor, kitApiResponseDefaultEntities, kitApiTokenMaintenanceConfig, kitApiTokenMaintenanceRoutes, kitBuildFilterBooleanOptions, kitBuildFilterListOptions, kitBuildFilters, kitBuildGridColumn, kitBuildGridDataResults, kitBuildHttpParams, kitBuildOdataFilter, kitBuildSortString, kitDataStateToODataString, kitEncodeViewNameToUrl, kitFetchExportGridData, kitFetchGridData, kitFilterBy, kitFormatStringForSearch, kitGetPermissionTypesByCategory, kitHasPermission, kitNormalizeDateToUtc, kitShouldResetGridState, kitTranslations, kitUserPermissionsGuard, kitUserRolesConfig, kitUsersSettingsConfig, kitWhitespaceValidator, mapGlobalSearchResult, trimTrailingSlash };
|
|
17152
17195
|
//# sourceMappingURL=indigina-ui-kit.mjs.map
|