@indigina/ui-kit 1.1.552 → 1.1.554
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 +809 -767
- package/fesm2022/indigina-ui-kit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/indigina-ui-kit.d.ts +86 -73
|
@@ -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,14 +52,14 @@ 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';
|
|
59
|
+
import { signalSetFn, SIGNAL } from '@angular/core/primitives/signals';
|
|
57
60
|
import { StateReset } from 'ngxs-reset-plugin';
|
|
58
|
-
import { saveAs, encodeBase64 } from '@progress/kendo-file-saver';
|
|
59
|
-
import { Workbook } from '@progress/kendo-ooxml';
|
|
60
61
|
import { catchError as catchError$1, tap as tap$1, map as map$1 } from 'rxjs/operators';
|
|
61
62
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
62
|
-
import { signalSetFn, SIGNAL } from '@angular/core/primitives/signals';
|
|
63
63
|
import { pdf } from '@progress/kendo-drawing';
|
|
64
64
|
import { json2csv } from 'json-2-csv';
|
|
65
65
|
import * as i1$f from '@progress/kendo-angular-scheduler';
|
|
@@ -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;
|
|
@@ -9085,6 +9087,215 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
9085
9087
|
type: Input
|
|
9086
9088
|
}], dragEnd: [{ type: i0.Output, args: ["dragEnd"] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
|
|
9087
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
|
+
|
|
9088
9299
|
class KitCardDetailsComponent {
|
|
9089
9300
|
constructor() {
|
|
9090
9301
|
this.router = inject(Router);
|
|
@@ -9768,16 +9979,6 @@ const kitShouldResetGridState = ({ stateColumns, availableColumns, }) => {
|
|
|
9768
9979
|
return !stateTitles.every(field => availableTitles.has(field));
|
|
9769
9980
|
};
|
|
9770
9981
|
|
|
9771
|
-
var KitUsersSettingsServerErrorTitle;
|
|
9772
|
-
(function (KitUsersSettingsServerErrorTitle) {
|
|
9773
|
-
KitUsersSettingsServerErrorTitle["PASSWORD_TOO_WEAK"] = "Your password is too weak.";
|
|
9774
|
-
KitUsersSettingsServerErrorTitle["INVALID_USER_NAME"] = "You have specified invalid UserName.";
|
|
9775
|
-
})(KitUsersSettingsServerErrorTitle || (KitUsersSettingsServerErrorTitle = {}));
|
|
9776
|
-
const kitUsersSettingsErrorTranslationMap = {
|
|
9777
|
-
[KitUsersSettingsServerErrorTitle.PASSWORD_TOO_WEAK]: 'kit.usersSettings.details.passwordTooWeak',
|
|
9778
|
-
[KitUsersSettingsServerErrorTitle.INVALID_USER_NAME]: 'kit.usersSettings.details.userNameInvalid',
|
|
9779
|
-
};
|
|
9780
|
-
|
|
9781
9982
|
class KitFetchUsersSettings extends KitAbstractPayloadAction {
|
|
9782
9983
|
static { this.type = '[KitUsersSettings] Fetch Users'; }
|
|
9783
9984
|
}
|
|
@@ -9794,6 +9995,12 @@ class KitDeleteUsersSettingsUser extends KitAbstractPayloadAction {
|
|
|
9794
9995
|
static { this.type = '[KitUsersSettings] Delete User'; }
|
|
9795
9996
|
}
|
|
9796
9997
|
|
|
9998
|
+
const kitApiResponseDefaultEntities = () => ({
|
|
9999
|
+
data: [],
|
|
10000
|
+
total: 0,
|
|
10001
|
+
loading: true,
|
|
10002
|
+
});
|
|
10003
|
+
|
|
9797
10004
|
const kitBuildHttpParams = (obj) => {
|
|
9798
10005
|
let params = new HttpParams();
|
|
9799
10006
|
Object.entries(obj).forEach(([key, value,]) => {
|
|
@@ -9805,71 +10012,96 @@ const kitBuildHttpParams = (obj) => {
|
|
|
9805
10012
|
return params;
|
|
9806
10013
|
};
|
|
9807
10014
|
|
|
9808
|
-
class
|
|
10015
|
+
class KitHttpErrorHandlerService {
|
|
9809
10016
|
constructor() {
|
|
9810
|
-
this.
|
|
9811
|
-
this.
|
|
9812
|
-
|
|
9813
|
-
fetchUsers(state) {
|
|
9814
|
-
const url = `${this.baseUrl}users`;
|
|
9815
|
-
const { $skip, $top, $orderby, $filter } = this.getRequestParams(state);
|
|
9816
|
-
return this.httpClient.get(url, { params: kitBuildHttpParams({ $skip, $top, $orderby, $filter }) });
|
|
9817
|
-
}
|
|
9818
|
-
fetchUserDetails(id) {
|
|
9819
|
-
const url = `${this.baseUrl}users/${id}`;
|
|
9820
|
-
return this.httpClient.get(url);
|
|
9821
|
-
}
|
|
9822
|
-
updateUserDetails(payload) {
|
|
9823
|
-
const url = `${this.baseUrl}users/${payload.id}`;
|
|
9824
|
-
return this.httpClient.put(url, payload);
|
|
9825
|
-
}
|
|
9826
|
-
createUser(payload) {
|
|
9827
|
-
const url = `${this.baseUrl}users`;
|
|
9828
|
-
return this.httpClient.post(url, payload);
|
|
9829
|
-
}
|
|
9830
|
-
deleteUser(id) {
|
|
9831
|
-
const url = `${this.baseUrl}users/${id}`;
|
|
9832
|
-
return this.httpClient.delete(url);
|
|
9833
|
-
}
|
|
9834
|
-
getRequestParams(state) {
|
|
9835
|
-
const $skip = state.skip && state.skip > 0 ? state.skip : undefined;
|
|
9836
|
-
const $top = state.take;
|
|
9837
|
-
const $orderby = state.sort?.length
|
|
9838
|
-
? state.sort.map(sort => `${sort.field} ${sort.dir ?? KitSortDirection.ASC}`).join(',')
|
|
9839
|
-
: 'name asc';
|
|
9840
|
-
const $filter = state.filter
|
|
9841
|
-
? kitDataStateToODataString({ filter: state.filter }).replace('$filter=', '')
|
|
9842
|
-
: undefined;
|
|
9843
|
-
return {
|
|
9844
|
-
$skip,
|
|
9845
|
-
$top,
|
|
9846
|
-
$orderby,
|
|
9847
|
-
$filter,
|
|
9848
|
-
};
|
|
10017
|
+
this.kitNotificationService = inject(KitNotificationService);
|
|
10018
|
+
this.translateService = inject(TranslateService);
|
|
10019
|
+
this.router = inject(Router);
|
|
9849
10020
|
}
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
}
|
|
9853
|
-
|
|
9854
|
-
|
|
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
|
|
9855
10058
|
}] });
|
|
9856
10059
|
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
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
|
+
}] });
|
|
9862
10094
|
|
|
9863
10095
|
const KIT_USERS_SETTINGS_STATE_TOKEN = new StateToken('usersSettings');
|
|
9864
10096
|
let KitUsersSettingsState = class KitUsersSettingsState {
|
|
9865
10097
|
constructor() {
|
|
9866
|
-
this.
|
|
10098
|
+
this.kitUsersService = inject(KitUsersService);
|
|
9867
10099
|
}
|
|
9868
10100
|
fetchUsers(ctx, action) {
|
|
9869
10101
|
ctx.patchState({
|
|
9870
10102
|
users: { ...ctx.getState().users, loading: true },
|
|
9871
10103
|
});
|
|
9872
|
-
return this.
|
|
10104
|
+
return this.kitUsersService.fetchUsers(action.payload).pipe(tap(data => {
|
|
9873
10105
|
ctx.patchState({
|
|
9874
10106
|
users: {
|
|
9875
10107
|
loading: false,
|
|
@@ -9892,7 +10124,7 @@ let KitUsersSettingsState = class KitUsersSettingsState {
|
|
|
9892
10124
|
ctx.patchState({
|
|
9893
10125
|
userDetails: { loading: true, data: null },
|
|
9894
10126
|
});
|
|
9895
|
-
return this.
|
|
10127
|
+
return this.kitUsersService.fetchUserDetails(action.payload).pipe(tap(data => {
|
|
9896
10128
|
ctx.patchState({
|
|
9897
10129
|
userDetails: {
|
|
9898
10130
|
loading: false,
|
|
@@ -9913,7 +10145,7 @@ let KitUsersSettingsState = class KitUsersSettingsState {
|
|
|
9913
10145
|
loading: true,
|
|
9914
10146
|
},
|
|
9915
10147
|
});
|
|
9916
|
-
return this.
|
|
10148
|
+
return this.kitUsersService.updateUserDetails(action.payload).pipe(tap(data => {
|
|
9917
10149
|
const state = ctx.getState();
|
|
9918
10150
|
ctx.patchState({
|
|
9919
10151
|
users: {
|
|
@@ -9936,34 +10168,30 @@ let KitUsersSettingsState = class KitUsersSettingsState {
|
|
|
9936
10168
|
}));
|
|
9937
10169
|
}
|
|
9938
10170
|
createUser(ctx, action) {
|
|
9939
|
-
|
|
9940
|
-
users: {
|
|
9941
|
-
...ctx.getState().users,
|
|
9942
|
-
loading: true,
|
|
9943
|
-
},
|
|
9944
|
-
});
|
|
9945
|
-
return this.kitUsersSettingsService.createUser(action.payload).pipe(finalize(() => {
|
|
10171
|
+
return this.kitUsersService.createUser(action.payload).pipe(tap(data => {
|
|
9946
10172
|
ctx.patchState({
|
|
9947
|
-
|
|
9948
|
-
...ctx.getState().users,
|
|
10173
|
+
userDetails: {
|
|
9949
10174
|
loading: false,
|
|
10175
|
+
data,
|
|
9950
10176
|
},
|
|
9951
10177
|
});
|
|
9952
10178
|
}));
|
|
9953
10179
|
}
|
|
9954
10180
|
deleteUser(ctx, action) {
|
|
9955
|
-
return this.
|
|
10181
|
+
return this.kitUsersService.deleteUser(action.payload).pipe(tap(() => {
|
|
9956
10182
|
const state = ctx.getState();
|
|
9957
|
-
const
|
|
10183
|
+
const filteredData = state.users.data.filter(user => user.id !== action.payload);
|
|
10184
|
+
const wasDeleted = filteredData.length < state.users.data.length;
|
|
9958
10185
|
ctx.patchState({
|
|
9959
10186
|
users: {
|
|
9960
|
-
|
|
9961
|
-
data:
|
|
9962
|
-
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,
|
|
9963
10194
|
},
|
|
9964
|
-
userDetails: state.userDetails.data?.id === action.payload
|
|
9965
|
-
? { ...state.userDetails, data: null }
|
|
9966
|
-
: state.userDetails,
|
|
9967
10195
|
});
|
|
9968
10196
|
}));
|
|
9969
10197
|
}
|
|
@@ -9971,10 +10199,10 @@ let KitUsersSettingsState = class KitUsersSettingsState {
|
|
|
9971
10199
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsState }); }
|
|
9972
10200
|
};
|
|
9973
10201
|
__decorate([
|
|
9974
|
-
Action(KitFetchUsersSettings)
|
|
10202
|
+
Action(KitFetchUsersSettings, { cancelUncompleted: true })
|
|
9975
10203
|
], KitUsersSettingsState.prototype, "fetchUsers", null);
|
|
9976
10204
|
__decorate([
|
|
9977
|
-
Action(KitFetchUsersSettingsDetails)
|
|
10205
|
+
Action(KitFetchUsersSettingsDetails, { cancelUncompleted: true })
|
|
9978
10206
|
], KitUsersSettingsState.prototype, "fetchUserDetails", null);
|
|
9979
10207
|
__decorate([
|
|
9980
10208
|
Action(KitUpdateUsersSettingsDetails)
|
|
@@ -10008,10 +10236,6 @@ var KitUsersSettingsDetailsField;
|
|
|
10008
10236
|
KitUsersSettingsDetailsField["MFA"] = "mfaEnabled";
|
|
10009
10237
|
KitUsersSettingsDetailsField["FORCE_PASSWORD"] = "forcePassword";
|
|
10010
10238
|
})(KitUsersSettingsDetailsField || (KitUsersSettingsDetailsField = {}));
|
|
10011
|
-
const kitUsersSettingsDetailsFormServerErrorFieldMap = {
|
|
10012
|
-
[KitUsersSettingsServerErrorTitle.PASSWORD_TOO_WEAK]: KitUsersSettingsDetailsField.PASSWORD,
|
|
10013
|
-
[KitUsersSettingsServerErrorTitle.INVALID_USER_NAME]: KitUsersSettingsDetailsField.USER_NAME,
|
|
10014
|
-
};
|
|
10015
10239
|
|
|
10016
10240
|
class KitUsersSettingsDetailsFormComponent {
|
|
10017
10241
|
constructor() {
|
|
@@ -10019,7 +10243,8 @@ class KitUsersSettingsDetailsFormComponent {
|
|
|
10019
10243
|
this.store = inject(Store);
|
|
10020
10244
|
this.kitFormErrors = inject(KitFormErrors);
|
|
10021
10245
|
this.destroyRef = inject(DestroyRef);
|
|
10022
|
-
this.
|
|
10246
|
+
this.isCreateMode = input(false, ...(ngDevMode ? [{ debugName: "isCreateMode" }] : /* istanbul ignore next */ []));
|
|
10247
|
+
this.updated = output();
|
|
10023
10248
|
this.usersSettingsState = this.store.selectSignal(KIT_USERS_SETTINGS_STATE_TOKEN);
|
|
10024
10249
|
this.userDetails = computed(() => this.usersSettingsState().userDetails, ...(ngDevMode ? [{ debugName: "userDetails" }] : /* istanbul ignore next */ []));
|
|
10025
10250
|
this.kitUsersSettingsDetailsField = KitUsersSettingsDetailsField;
|
|
@@ -10035,55 +10260,61 @@ class KitUsersSettingsDetailsFormComponent {
|
|
|
10035
10260
|
[KitUsersSettingsDetailsField.MFA]: this.formBuilder.nonNullable.control(false),
|
|
10036
10261
|
[KitUsersSettingsDetailsField.FORCE_PASSWORD]: this.formBuilder.nonNullable.control(false),
|
|
10037
10262
|
});
|
|
10263
|
+
this.isSaving = signal(false, ...(ngDevMode ? [{ debugName: "isSaving" }] : /* istanbul ignore next */ []));
|
|
10264
|
+
this.lastPatchedUserId = null;
|
|
10038
10265
|
effect(() => {
|
|
10039
|
-
if (!this.
|
|
10266
|
+
if (!this.isCreateMode()) {
|
|
10040
10267
|
const { data: userDetails, loading } = this.userDetails();
|
|
10041
10268
|
loading ? this.form.disable({ emitEvent: false }) : this.form.enable({ emitEvent: false });
|
|
10042
|
-
if (userDetails) {
|
|
10269
|
+
if (userDetails && userDetails.id !== this.lastPatchedUserId) {
|
|
10270
|
+
this.lastPatchedUserId = userDetails.id;
|
|
10043
10271
|
this.patchForm(userDetails);
|
|
10044
10272
|
}
|
|
10045
10273
|
}
|
|
10046
10274
|
});
|
|
10047
10275
|
}
|
|
10048
10276
|
ngOnInit() {
|
|
10049
|
-
if (this.
|
|
10277
|
+
if (this.isCreateMode()) {
|
|
10050
10278
|
this.enablePasswordControl();
|
|
10051
10279
|
}
|
|
10052
10280
|
}
|
|
10053
|
-
getTextboxState(
|
|
10054
|
-
|
|
10055
|
-
return control?.touched && control?.invalid && control?.dirty
|
|
10056
|
-
? KitTextboxState.ERROR
|
|
10057
|
-
: KitTextboxState.DEFAULT;
|
|
10281
|
+
getTextboxState(form, controlName) {
|
|
10282
|
+
return this.kitFormErrors.getErrors(form.controls[controlName]).length && KitTextboxState.ERROR || KitTextboxState.DEFAULT;
|
|
10058
10283
|
}
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
if (!control || !(control.touched || control.dirty)) {
|
|
10062
|
-
return undefined;
|
|
10063
|
-
}
|
|
10064
|
-
if (control.errors?.['serverError']) {
|
|
10065
|
-
return control.errors['serverError'];
|
|
10066
|
-
}
|
|
10067
|
-
return this.kitFormErrors.getErrors(control)[0];
|
|
10284
|
+
getFormErrorMessages(form, controlName) {
|
|
10285
|
+
return this.kitFormErrors.getErrors(form.controls[controlName]).join('. ');
|
|
10068
10286
|
}
|
|
10069
10287
|
submit() {
|
|
10070
|
-
|
|
10288
|
+
this.isSaving.set(true);
|
|
10289
|
+
return this.isCreateMode()
|
|
10071
10290
|
? this.createUser()
|
|
10072
10291
|
: this.updateUser();
|
|
10073
10292
|
}
|
|
10074
10293
|
createUser() {
|
|
10075
|
-
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)));
|
|
10076
10298
|
}
|
|
10077
10299
|
updateUser() {
|
|
10078
10300
|
const id = this.userDetails().data?.id;
|
|
10079
10301
|
if (!id) {
|
|
10302
|
+
this.isSaving.set(false);
|
|
10080
10303
|
return EMPTY;
|
|
10081
10304
|
}
|
|
10082
10305
|
const { password, forcePassword, ...userDetails } = this.form.getRawValue();
|
|
10083
10306
|
return this.store.dispatch(new KitUpdateUsersSettingsDetails({
|
|
10084
10307
|
...userDetails,
|
|
10085
10308
|
id,
|
|
10086
|
-
})).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)));
|
|
10087
10318
|
}
|
|
10088
10319
|
enablePasswordControl() {
|
|
10089
10320
|
const passwordControl = this.form.get(KitUsersSettingsDetailsField.PASSWORD);
|
|
@@ -10102,23 +10333,8 @@ class KitUsersSettingsDetailsFormComponent {
|
|
|
10102
10333
|
[KitUsersSettingsDetailsField.FORCE_PASSWORD]: false,
|
|
10103
10334
|
}, { emitEvent: false });
|
|
10104
10335
|
}
|
|
10105
|
-
handleSubmitError(error) {
|
|
10106
|
-
this.applyServerError(error?.error?.title ?? '');
|
|
10107
|
-
return EMPTY;
|
|
10108
|
-
}
|
|
10109
|
-
applyServerError(title) {
|
|
10110
|
-
const field = kitUsersSettingsDetailsFormServerErrorFieldMap[title];
|
|
10111
|
-
const translationKey = kitUsersSettingsErrorTranslationMap[title];
|
|
10112
|
-
const control = this.form.get(field);
|
|
10113
|
-
if (!field || !translationKey || !control) {
|
|
10114
|
-
return;
|
|
10115
|
-
}
|
|
10116
|
-
control.setErrors({ serverError: translationKey });
|
|
10117
|
-
control.markAsTouched();
|
|
10118
|
-
control.markAsDirty();
|
|
10119
|
-
}
|
|
10120
10336
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsDetailsFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10121
|
-
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 }); }
|
|
10122
10338
|
}
|
|
10123
10339
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsDetailsFormComponent, decorators: [{
|
|
10124
10340
|
type: Component,
|
|
@@ -10127,49 +10343,74 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
10127
10343
|
KitTextboxComponent,
|
|
10128
10344
|
ReactiveFormsModule,
|
|
10129
10345
|
KitToggleComponent,
|
|
10130
|
-
], 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]=\"
|
|
10131
|
-
}], 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"] }] } });
|
|
10132
10348
|
|
|
10133
|
-
class KitUsersSettingsCreateDialogComponent {
|
|
10349
|
+
class KitUsersSettingsCreateDialogComponent extends DialogContentBase {
|
|
10134
10350
|
constructor() {
|
|
10351
|
+
const dialog = inject(DialogRef);
|
|
10352
|
+
super(dialog);
|
|
10135
10353
|
this.destroyRef = inject(DestroyRef);
|
|
10136
10354
|
this.detailsForm = viewChild.required(KitUsersSettingsDetailsFormComponent);
|
|
10137
|
-
this.opened = model(false, ...(ngDevMode ? [{ debugName: "opened" }] : /* istanbul ignore next */ []));
|
|
10138
|
-
this.kitDialogType = KitDialogType;
|
|
10139
10355
|
this.kitButtonKind = KitButtonKind;
|
|
10140
10356
|
this.kitButtonType = KitButtonType;
|
|
10141
10357
|
}
|
|
10142
10358
|
get isFormDisabled() {
|
|
10143
|
-
return this.detailsForm().form.pristine || this.detailsForm().form.invalid;
|
|
10359
|
+
return this.detailsForm().form.pristine || this.detailsForm().form.invalid || this.detailsForm().isSaving();
|
|
10144
10360
|
}
|
|
10145
10361
|
onConfirm() {
|
|
10146
|
-
this.detailsForm().submit().pipe(takeUntilDestroyed(this.destroyRef)).subscribe(
|
|
10147
|
-
this.
|
|
10362
|
+
this.detailsForm().submit().pipe(takeUntilDestroyed(this.destroyRef)).subscribe(createdUser => {
|
|
10363
|
+
this.dialog.close(createdUser);
|
|
10148
10364
|
});
|
|
10149
10365
|
}
|
|
10150
10366
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsCreateDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10151
|
-
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 }); }
|
|
10152
10368
|
}
|
|
10153
10369
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsCreateDialogComponent, decorators: [{
|
|
10154
10370
|
type: Component,
|
|
10155
10371
|
args: [{ selector: 'kit-users-settings-create-dialog', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
10156
|
-
KitDialogComponent,
|
|
10157
|
-
KitDialogTitlebarComponent,
|
|
10158
10372
|
KitDialogActionsComponent,
|
|
10159
10373
|
KitButtonComponent,
|
|
10160
10374
|
TranslatePipe,
|
|
10161
10375
|
KitUsersSettingsDetailsFormComponent,
|
|
10162
|
-
], template: "
|
|
10163
|
-
}], 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 }] }] } });
|
|
10164
10378
|
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
;
|
|
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
|
+
});
|
|
10173
10414
|
|
|
10174
10415
|
var KitUsersSettingsEntitlementType;
|
|
10175
10416
|
(function (KitUsersSettingsEntitlementType) {
|
|
@@ -10183,7 +10424,7 @@ class KitUsersSettingsReferenceService {
|
|
|
10183
10424
|
this.baseUrl = `${trimTrailingSlash(inject(KIT_BASE_PATH))}/`;
|
|
10184
10425
|
}
|
|
10185
10426
|
getPartners() {
|
|
10186
|
-
const url = `${this.baseUrl}
|
|
10427
|
+
const url = `${this.baseUrl}partners`;
|
|
10187
10428
|
return this.httpClient.get(url, {
|
|
10188
10429
|
params: kitBuildHttpParams({ $orderby: 'name' }),
|
|
10189
10430
|
}).pipe(map((response) => response.data));
|
|
@@ -10221,10 +10462,11 @@ class KitUsersSettingsEntitlementsService {
|
|
|
10221
10462
|
constructor() {
|
|
10222
10463
|
this.httpClient = inject(HttpClient);
|
|
10223
10464
|
this.baseUrl = `${trimTrailingSlash(inject(KIT_BASE_PATH))}/`;
|
|
10465
|
+
this.kitHttpErrorHandlerService = inject(KitHttpErrorHandlerService);
|
|
10224
10466
|
}
|
|
10225
10467
|
getUserEntitlements(id) {
|
|
10226
10468
|
const url = `${this.baseUrl}users/${id}/identities`;
|
|
10227
|
-
return this.httpClient.get(url);
|
|
10469
|
+
return this.httpClient.get(url).pipe(catchError((err) => this.kitHttpErrorHandlerService.handleServerError(err)));
|
|
10228
10470
|
}
|
|
10229
10471
|
getEntitlementDetails(userId, entitlementId) {
|
|
10230
10472
|
const url = `${this.baseUrl}users/${userId}/identities/${entitlementId}`;
|
|
@@ -10232,15 +10474,15 @@ class KitUsersSettingsEntitlementsService {
|
|
|
10232
10474
|
}
|
|
10233
10475
|
createEntitlement(userId, payload) {
|
|
10234
10476
|
const url = `${this.baseUrl}users/${userId}/identities`;
|
|
10235
|
-
return this.httpClient.post(url, payload);
|
|
10477
|
+
return this.httpClient.post(url, payload).pipe(catchError((err) => this.kitHttpErrorHandlerService.handleServerError(err)));
|
|
10236
10478
|
}
|
|
10237
10479
|
updateEntitlement(userId, entitlementId, payload) {
|
|
10238
10480
|
const url = `${this.baseUrl}users/${userId}/identities/${entitlementId}`;
|
|
10239
|
-
return this.httpClient.put(url, payload);
|
|
10481
|
+
return this.httpClient.put(url, payload).pipe(catchError((err) => this.kitHttpErrorHandlerService.handleServerError(err)));
|
|
10240
10482
|
}
|
|
10241
10483
|
deleteEntitlement(userId, entitlementId) {
|
|
10242
10484
|
const url = `${this.baseUrl}users/${userId}/identities/${entitlementId}`;
|
|
10243
|
-
return this.httpClient.delete(url);
|
|
10485
|
+
return this.httpClient.delete(url).pipe(catchError((err) => this.kitHttpErrorHandlerService.handleServerError(err)));
|
|
10244
10486
|
}
|
|
10245
10487
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
10246
10488
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsService }); }
|
|
@@ -10252,14 +10494,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
10252
10494
|
const KIT_USERS_SETTINGS_ENTITLEMENTS_STATE_TOKEN = new StateToken('usersSettingsEntitlements');
|
|
10253
10495
|
let KitUsersSettingsEntitlementsState = class KitUsersSettingsEntitlementsState {
|
|
10254
10496
|
constructor() {
|
|
10255
|
-
this.
|
|
10497
|
+
this.kitUserService = inject(KitUsersSettingsEntitlementsService);
|
|
10256
10498
|
}
|
|
10257
10499
|
fetchUserEntitlements(ctx, action) {
|
|
10258
10500
|
const currentState = ctx.getState();
|
|
10259
10501
|
ctx.patchState({
|
|
10260
10502
|
userEntitlements: { ...currentState.userEntitlements, loading: true },
|
|
10261
10503
|
});
|
|
10262
|
-
return this.
|
|
10504
|
+
return this.kitUserService.getUserEntitlements(action.payload).pipe(tap(data => {
|
|
10263
10505
|
ctx.patchState({
|
|
10264
10506
|
userEntitlements: {
|
|
10265
10507
|
loading: false,
|
|
@@ -10277,7 +10519,7 @@ let KitUsersSettingsEntitlementsState = class KitUsersSettingsEntitlementsState
|
|
|
10277
10519
|
ctx.patchState({
|
|
10278
10520
|
userEntitlementDetails: { loading: true, data: null },
|
|
10279
10521
|
});
|
|
10280
|
-
return this.
|
|
10522
|
+
return this.kitUserService.getEntitlementDetails(action.payload.userId, action.payload.entitlementId).pipe(tap(data => {
|
|
10281
10523
|
ctx.patchState({
|
|
10282
10524
|
userEntitlementDetails: { loading: false, data },
|
|
10283
10525
|
});
|
|
@@ -10289,7 +10531,7 @@ let KitUsersSettingsEntitlementsState = class KitUsersSettingsEntitlementsState
|
|
|
10289
10531
|
}));
|
|
10290
10532
|
}
|
|
10291
10533
|
deleteEntitlement(ctx, action) {
|
|
10292
|
-
return this.
|
|
10534
|
+
return this.kitUserService.deleteEntitlement(action.payload.userId, action.payload.entitlementId).pipe(tap(() => {
|
|
10293
10535
|
const currentState = ctx.getState();
|
|
10294
10536
|
ctx.patchState({
|
|
10295
10537
|
userEntitlements: {
|
|
@@ -10301,7 +10543,7 @@ let KitUsersSettingsEntitlementsState = class KitUsersSettingsEntitlementsState
|
|
|
10301
10543
|
}));
|
|
10302
10544
|
}
|
|
10303
10545
|
createEntitlement(ctx, action) {
|
|
10304
|
-
return this.
|
|
10546
|
+
return this.kitUserService.createEntitlement(action.payload.userId, action.payload.payload).pipe(tap(data => {
|
|
10305
10547
|
const currentState = ctx.getState();
|
|
10306
10548
|
ctx.patchState({
|
|
10307
10549
|
userEntitlements: {
|
|
@@ -10320,8 +10562,13 @@ let KitUsersSettingsEntitlementsState = class KitUsersSettingsEntitlementsState
|
|
|
10320
10562
|
}));
|
|
10321
10563
|
}
|
|
10322
10564
|
updateEntitlement(ctx, action) {
|
|
10323
|
-
return this.
|
|
10565
|
+
return this.kitUserService.updateEntitlement(action.payload.userId, action.payload.entitlementId, action.payload.payload).pipe(tap(data => {
|
|
10566
|
+
const currentState = ctx.getState();
|
|
10324
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
|
+
},
|
|
10325
10572
|
userEntitlementDetails: { loading: false, data },
|
|
10326
10573
|
});
|
|
10327
10574
|
}), catchError(err => {
|
|
@@ -10365,94 +10612,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
10365
10612
|
type: Injectable
|
|
10366
10613
|
}], propDecorators: { fetchUserEntitlements: [], fetchUserEntitlementDetails: [], deleteEntitlement: [], createEntitlement: [], updateEntitlement: [] } });
|
|
10367
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
|
+
|
|
10368
10625
|
class KitUsersSettingsEntitlementsFormComponent {
|
|
10369
10626
|
constructor() {
|
|
10370
10627
|
this.formBuilder = inject(FormBuilder);
|
|
10371
10628
|
this.store = inject(Store);
|
|
10372
|
-
this.
|
|
10629
|
+
this.kitFormErrors = inject(KitFormErrors);
|
|
10373
10630
|
this.referenceService = inject(KitUsersSettingsReferenceService);
|
|
10631
|
+
this.config = inject(kitUsersSettingsConfig);
|
|
10374
10632
|
this.isCreating = input(false, ...(ngDevMode ? [{ debugName: "isCreating" }] : /* istanbul ignore next */ []));
|
|
10375
10633
|
this.showIdentityType = input.required(...(ngDevMode ? [{ debugName: "showIdentityType" }] : /* istanbul ignore next */ []));
|
|
10376
|
-
this.identityTypeItems = computed(() => [
|
|
10377
|
-
{
|
|
10378
|
-
text: this.translateService.instant('kit.common.selectValue'),
|
|
10379
|
-
value: null,
|
|
10380
|
-
},
|
|
10381
|
-
...Object.values(KitUsersSettingsEntitlementType).map((value) => ({ text: value, value })),
|
|
10382
|
-
], ...(ngDevMode ? [{ debugName: "identityTypeItems" }] : /* istanbul ignore next */ []));
|
|
10634
|
+
this.identityTypeItems = computed(() => Object.values(KitUsersSettingsEntitlementType).map((value) => ({ text: value, value })), ...(ngDevMode ? [{ debugName: "identityTypeItems" }] : /* istanbul ignore next */ []));
|
|
10383
10635
|
this.kitUsersSettingsEntitlementsField = KitUsersSettingsEntitlementsField;
|
|
10384
10636
|
this.form = this.formBuilder.group({
|
|
10385
|
-
[KitUsersSettingsEntitlementsField.IDENTITY_TYPE]: this.formBuilder.control(null),
|
|
10637
|
+
[KitUsersSettingsEntitlementsField.IDENTITY_TYPE]: this.formBuilder.control(null, Validators.required),
|
|
10386
10638
|
[KitUsersSettingsEntitlementsField.PARTNERS]: this.formBuilder.control(null),
|
|
10387
10639
|
[KitUsersSettingsEntitlementsField.ALIAS]: this.formBuilder.nonNullable.control('', Validators.required),
|
|
10388
10640
|
[KitUsersSettingsEntitlementsField.ROLES]: this.formBuilder.control(null, Validators.required),
|
|
10641
|
+
[KitUsersSettingsEntitlementsField.SCOPES]: this.formBuilder.control(null),
|
|
10389
10642
|
});
|
|
10643
|
+
this.scopesComponent = this.config.scopesComponent ?? null;
|
|
10390
10644
|
this.kitUsersSettingsEntitlementType = KitUsersSettingsEntitlementType;
|
|
10391
10645
|
this.roleItems = computed(() => this.roles().map((role) => ({
|
|
10392
10646
|
text: role.name,
|
|
10393
10647
|
value: role.id.toString(),
|
|
10394
10648
|
})), ...(ngDevMode ? [{ debugName: "roleItems" }] : /* istanbul ignore next */ []));
|
|
10395
|
-
this.partnerItems = computed(() => {
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
this.userEntitlements = computed(() => this.store.selectSignal(KIT_USERS_SETTINGS_ENTITLEMENTS_STATE_TOKEN)().userEntitlements, ...(ngDevMode ? [{ debugName: "userEntitlements" }] : /* istanbul ignore next */ []));
|
|
10409
|
-
this.userEntitlementDetails = computed(() => (this.store.selectSignal(KIT_USERS_SETTINGS_ENTITLEMENTS_STATE_TOKEN)().userEntitlementDetails.data), ...(ngDevMode ? [{ debugName: "userEntitlementDetails" }] : /* istanbul ignore next */ []));
|
|
10410
|
-
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 */ []));
|
|
10411
10662
|
this.partners = signal([], ...(ngDevMode ? [{ debugName: "partners" }] : /* istanbul ignore next */ []));
|
|
10412
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 } });
|
|
10413
10668
|
effect(() => this.updateFormFields());
|
|
10414
10669
|
effect(() => this.loadFormData());
|
|
10415
|
-
effect(() => this.
|
|
10670
|
+
effect(() => this.updatePartnersValidator());
|
|
10671
|
+
}
|
|
10672
|
+
isControlInvalid(form, controlName) {
|
|
10673
|
+
return !!this.kitFormErrors.getErrors(form.controls[controlName]).length;
|
|
10416
10674
|
}
|
|
10417
|
-
|
|
10418
|
-
return this.
|
|
10419
|
-
this.showIdentityType();
|
|
10675
|
+
getFormErrorMessages(form, controlName) {
|
|
10676
|
+
return this.kitFormErrors.getErrors(form.controls[controlName]).join('. ');
|
|
10420
10677
|
}
|
|
10421
10678
|
submit() {
|
|
10422
10679
|
const userId = this.userId();
|
|
10423
10680
|
if (!userId) {
|
|
10424
|
-
return;
|
|
10681
|
+
return of(false);
|
|
10425
10682
|
}
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
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);
|
|
10433
10689
|
}
|
|
10434
|
-
this.
|
|
10690
|
+
this.isSaving.set(true);
|
|
10691
|
+
return this.dispatchAndMarkPristine(action);
|
|
10435
10692
|
}
|
|
10436
|
-
|
|
10437
|
-
const formValue = this.form.getRawValue();
|
|
10693
|
+
buildUpdateAction(userId, formValue) {
|
|
10438
10694
|
const entitlementDetails = this.userEntitlementDetails();
|
|
10439
10695
|
if (!entitlementDetails) {
|
|
10440
|
-
return;
|
|
10696
|
+
return null;
|
|
10441
10697
|
}
|
|
10442
|
-
|
|
10443
|
-
this.dispatchAndMarkPristine(new KitUpdateUsersSettingsEntitlement({
|
|
10698
|
+
return new KitUpdateUsersSettingsEntitlement({
|
|
10444
10699
|
userId,
|
|
10445
10700
|
entitlementId: entitlementDetails.id,
|
|
10446
|
-
payload:
|
|
10447
|
-
})
|
|
10701
|
+
payload: this.buildUpdatePayload(formValue, entitlementDetails, userId),
|
|
10702
|
+
});
|
|
10448
10703
|
}
|
|
10449
|
-
buildCreatePayload() {
|
|
10450
|
-
const formValue = this.form.getRawValue();
|
|
10704
|
+
buildCreatePayload(formValue) {
|
|
10451
10705
|
return {
|
|
10452
10706
|
alias: formValue.alias,
|
|
10453
10707
|
type: formValue.identityType ?? undefined,
|
|
10454
10708
|
roles: (formValue.roles ?? []).map(Number),
|
|
10455
10709
|
partnerId: this.resolvePartnerId(formValue.identityType, formValue.partners),
|
|
10710
|
+
scopes: formValue.scopes ?? undefined,
|
|
10456
10711
|
};
|
|
10457
10712
|
}
|
|
10458
10713
|
buildUpdatePayload(formValue, entitlementDetails, userId) {
|
|
@@ -10463,7 +10718,7 @@ class KitUsersSettingsEntitlementsFormComponent {
|
|
|
10463
10718
|
alias: formValue.alias,
|
|
10464
10719
|
partnerId: this.resolvePartnerId(formValue.identityType, formValue.partners),
|
|
10465
10720
|
roles: (formValue.roles ?? []).map(Number),
|
|
10466
|
-
scopes: entitlementDetails.scopes,
|
|
10721
|
+
scopes: formValue.scopes ?? entitlementDetails.scopes,
|
|
10467
10722
|
};
|
|
10468
10723
|
}
|
|
10469
10724
|
resolvePartnerId(identityType, partnerId) {
|
|
@@ -10473,18 +10728,10 @@ class KitUsersSettingsEntitlementsFormComponent {
|
|
|
10473
10728
|
return undefined;
|
|
10474
10729
|
}
|
|
10475
10730
|
dispatchAndMarkPristine(action) {
|
|
10476
|
-
this.store.dispatch(action).pipe(tap(() => this.form.markAsPristine()))
|
|
10477
|
-
|
|
10478
|
-
|
|
10479
|
-
|
|
10480
|
-
if (disabled) {
|
|
10481
|
-
this.form.get(KitUsersSettingsEntitlementsField.ALIAS)?.disable();
|
|
10482
|
-
this.form.get(KitUsersSettingsEntitlementsField.ROLES)?.disable();
|
|
10483
|
-
}
|
|
10484
|
-
else {
|
|
10485
|
-
this.form.get(KitUsersSettingsEntitlementsField.ALIAS)?.enable();
|
|
10486
|
-
this.form.get(KitUsersSettingsEntitlementsField.ROLES)?.enable();
|
|
10487
|
-
}
|
|
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)));
|
|
10488
10735
|
}
|
|
10489
10736
|
updateFormFields() {
|
|
10490
10737
|
const userEntitlementDetails = this.userEntitlementDetails();
|
|
@@ -10494,12 +10741,23 @@ class KitUsersSettingsEntitlementsFormComponent {
|
|
|
10494
10741
|
[KitUsersSettingsEntitlementsField.PARTNERS]: userEntitlementDetails.partnerId?.toString() ?? null,
|
|
10495
10742
|
[KitUsersSettingsEntitlementsField.ALIAS]: userEntitlementDetails.alias,
|
|
10496
10743
|
[KitUsersSettingsEntitlementsField.ROLES]: userEntitlementDetails.roles?.map(String) ?? null,
|
|
10744
|
+
[KitUsersSettingsEntitlementsField.SCOPES]: userEntitlementDetails.scopes ?? null,
|
|
10497
10745
|
});
|
|
10498
10746
|
this.form.get(KitUsersSettingsEntitlementsField.IDENTITY_TYPE)?.disable();
|
|
10499
10747
|
this.form.get(KitUsersSettingsEntitlementsField.PARTNERS)?.disable();
|
|
10500
10748
|
this.form.markAsPristine();
|
|
10501
10749
|
}
|
|
10502
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
|
+
}
|
|
10503
10761
|
loadFormData() {
|
|
10504
10762
|
const context = this.getFormDataContext();
|
|
10505
10763
|
if (!context) {
|
|
@@ -10511,11 +10769,10 @@ class KitUsersSettingsEntitlementsFormComponent {
|
|
|
10511
10769
|
}
|
|
10512
10770
|
getFormDataContext() {
|
|
10513
10771
|
if (this.isCreating()) {
|
|
10514
|
-
const
|
|
10515
|
-
const formIdentityType = this.form.value[KitUsersSettingsEntitlementsField.IDENTITY_TYPE] ?? null;
|
|
10772
|
+
const { identityType, partnerId } = this.creatingFormContext();
|
|
10516
10773
|
return {
|
|
10517
|
-
partnerId:
|
|
10518
|
-
identityType
|
|
10774
|
+
partnerId: Number(partnerId) || null,
|
|
10775
|
+
identityType,
|
|
10519
10776
|
};
|
|
10520
10777
|
}
|
|
10521
10778
|
const details = this.userEntitlementDetails();
|
|
@@ -10540,10 +10797,11 @@ class KitUsersSettingsEntitlementsFormComponent {
|
|
|
10540
10797
|
})).subscribe();
|
|
10541
10798
|
}
|
|
10542
10799
|
buildRolesFilter(identityType, partnerId) {
|
|
10543
|
-
const
|
|
10544
|
-
if (!identityType ||
|
|
10800
|
+
const isUserWithoutPartner = identityType === KitUsersSettingsEntitlementType.USER && !partnerId;
|
|
10801
|
+
if (!identityType || !this.showIdentityType() || isUserWithoutPartner) {
|
|
10545
10802
|
return undefined;
|
|
10546
10803
|
}
|
|
10804
|
+
const filters = [];
|
|
10547
10805
|
if (identityType === KitUsersSettingsEntitlementType.ADMIN) {
|
|
10548
10806
|
const adminFilter = {
|
|
10549
10807
|
field: 'type',
|
|
@@ -10573,7 +10831,7 @@ class KitUsersSettingsEntitlementsFormComponent {
|
|
|
10573
10831
|
}).replace('$filter=', '');
|
|
10574
10832
|
}
|
|
10575
10833
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10576
|
-
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 }); }
|
|
10577
10835
|
}
|
|
10578
10836
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsFormComponent, decorators: [{
|
|
10579
10837
|
type: Component,
|
|
@@ -10583,11 +10841,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
10583
10841
|
KitDropdownComponent,
|
|
10584
10842
|
KitMultiselectComponent,
|
|
10585
10843
|
ReactiveFormsModule,
|
|
10586
|
-
|
|
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"] }]
|
|
10587
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 }] }] } });
|
|
10588
10848
|
|
|
10589
10849
|
class KitUsersSettingsCreateEntitlementDialogComponent {
|
|
10590
10850
|
constructor() {
|
|
10851
|
+
this.destroyRef = inject(DestroyRef);
|
|
10591
10852
|
this.entitlementsForm = viewChild.required(KitUsersSettingsEntitlementsFormComponent);
|
|
10592
10853
|
this.showIdentityType = input.required(...(ngDevMode ? [{ debugName: "showIdentityType" }] : /* istanbul ignore next */ []));
|
|
10593
10854
|
this.opened = model(false, ...(ngDevMode ? [{ debugName: "opened" }] : /* istanbul ignore next */ []));
|
|
@@ -10596,17 +10857,20 @@ class KitUsersSettingsCreateEntitlementDialogComponent {
|
|
|
10596
10857
|
this.kitButtonType = KitButtonType;
|
|
10597
10858
|
}
|
|
10598
10859
|
get isFormDisabled() {
|
|
10599
|
-
return this.entitlementsForm().form.pristine || this.entitlementsForm().form.invalid;
|
|
10860
|
+
return this.entitlementsForm().form.pristine || this.entitlementsForm().form.invalid || this.entitlementsForm().isSaving();
|
|
10600
10861
|
}
|
|
10601
10862
|
onConfirm() {
|
|
10602
|
-
this.entitlementsForm().submit()
|
|
10603
|
-
|
|
10863
|
+
this.entitlementsForm().submit().pipe(takeUntilDestroyed(this.destroyRef)).subscribe(success => {
|
|
10864
|
+
if (success) {
|
|
10865
|
+
this.opened.set(false);
|
|
10866
|
+
}
|
|
10867
|
+
});
|
|
10604
10868
|
}
|
|
10605
10869
|
onClose() {
|
|
10606
10870
|
this.opened.set(false);
|
|
10607
10871
|
}
|
|
10608
10872
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsCreateEntitlementDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10609
|
-
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 }); }
|
|
10610
10874
|
}
|
|
10611
10875
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsCreateEntitlementDialogComponent, decorators: [{
|
|
10612
10876
|
type: Component,
|
|
@@ -10617,71 +10881,151 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
10617
10881
|
KitButtonComponent,
|
|
10618
10882
|
TranslatePipe,
|
|
10619
10883
|
KitUsersSettingsEntitlementsFormComponent,
|
|
10620
|
-
], 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"] }]
|
|
10621
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"] }] } });
|
|
10622
10886
|
|
|
10623
|
-
|
|
10624
|
-
(function (KitUsersSettingsPasswordDialogField) {
|
|
10625
|
-
KitUsersSettingsPasswordDialogField["PASSWORD"] = "password";
|
|
10626
|
-
KitUsersSettingsPasswordDialogField["REPEAT_PASSWORD"] = "repeatPassword";
|
|
10627
|
-
KitUsersSettingsPasswordDialogField["FORCE_PASSWORD"] = "forcePassword";
|
|
10628
|
-
})(KitUsersSettingsPasswordDialogField || (KitUsersSettingsPasswordDialogField = {}));
|
|
10629
|
-
|
|
10630
|
-
class KitUsersSettingsPasswordDialogComponent {
|
|
10887
|
+
class KitUsersSettingsEntitlementsComponent {
|
|
10631
10888
|
constructor() {
|
|
10632
|
-
this.kitFormErrors = inject(KitFormErrors);
|
|
10633
|
-
this.formBuilder = inject(FormBuilder);
|
|
10634
10889
|
this.store = inject(Store);
|
|
10635
|
-
this.
|
|
10636
|
-
this.
|
|
10637
|
-
this.
|
|
10638
|
-
this.
|
|
10639
|
-
this.
|
|
10640
|
-
this.
|
|
10641
|
-
this.
|
|
10642
|
-
this.
|
|
10643
|
-
this.
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
}, { 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());
|
|
10648
10902
|
}
|
|
10649
|
-
get
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
|
|
10654
|
-
const
|
|
10655
|
-
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
isTouchedAndDirty;
|
|
10659
|
-
return hasFieldError || hasMatchError ? KitTextboxState.ERROR : KitTextboxState.DEFAULT;
|
|
10660
|
-
}
|
|
10661
|
-
getTextboxMessageText(field) {
|
|
10662
|
-
const control = this.form.get(field);
|
|
10663
|
-
if (!control || !(control.touched || control.dirty)) {
|
|
10664
|
-
return undefined;
|
|
10665
|
-
}
|
|
10666
|
-
if (field === 'repeatPassword' && this.form.errors?.['passwordsMismatch'] && control.dirty) {
|
|
10667
|
-
return 'kit.usersSettings.passwordDialog.passwordsDoNotMatch';
|
|
10668
|
-
}
|
|
10669
|
-
if (control.errors?.['serverError']) {
|
|
10670
|
-
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);
|
|
10671
10912
|
}
|
|
10672
|
-
|
|
10913
|
+
;
|
|
10673
10914
|
}
|
|
10674
|
-
|
|
10675
|
-
|
|
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() {
|
|
11015
|
+
const userDetails = this.userDetails().data;
|
|
10676
11016
|
if (!userDetails) {
|
|
10677
11017
|
return;
|
|
10678
11018
|
}
|
|
11019
|
+
this.isSaving.set(true);
|
|
10679
11020
|
this.store.dispatch(new KitUpdateUsersSettingsDetails({
|
|
10680
11021
|
...userDetails,
|
|
10681
11022
|
password: this.form.get(KitUsersSettingsPasswordDialogField.PASSWORD)?.value ?? undefined,
|
|
10682
11023
|
forcePasswordResetOnNextLogin: this.form.get(KitUsersSettingsPasswordDialogField.FORCE_PASSWORD)?.value ?? false,
|
|
10683
|
-
})).pipe(catchError(
|
|
10684
|
-
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();
|
|
10685
11029
|
});
|
|
10686
11030
|
}
|
|
10687
11031
|
passwordsMatchValidator(group) {
|
|
@@ -10689,36 +11033,29 @@ class KitUsersSettingsPasswordDialogComponent {
|
|
|
10689
11033
|
const repeatPassword = group.get(KitUsersSettingsPasswordDialogField.REPEAT_PASSWORD)?.value ?? '';
|
|
10690
11034
|
return password === repeatPassword ? null : { passwordsMismatch: true };
|
|
10691
11035
|
}
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
const translationKey = kitUsersSettingsErrorTranslationMap[title];
|
|
10698
|
-
const control = this.form.get(KitUsersSettingsPasswordDialogField.PASSWORD);
|
|
10699
|
-
if (!translationKey || !control) {
|
|
10700
|
-
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;
|
|
10701
11041
|
}
|
|
10702
|
-
|
|
10703
|
-
control.
|
|
10704
|
-
control.markAsDirty();
|
|
11042
|
+
const isRepeatPassword = controlName === KitUsersSettingsPasswordDialogField.REPEAT_PASSWORD;
|
|
11043
|
+
return isRepeatPassword && control?.dirty ? this.kitFormErrors.getErrors(form) : [];
|
|
10705
11044
|
}
|
|
10706
11045
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsPasswordDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10707
|
-
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 }); }
|
|
10708
11047
|
}
|
|
10709
11048
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsPasswordDialogComponent, decorators: [{
|
|
10710
11049
|
type: Component,
|
|
10711
11050
|
args: [{ selector: 'kit-users-settings-password-dialog', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
10712
|
-
KitDialogComponent,
|
|
10713
|
-
KitDialogTitlebarComponent,
|
|
10714
11051
|
KitDialogActionsComponent,
|
|
10715
11052
|
KitButtonComponent,
|
|
10716
11053
|
TranslatePipe,
|
|
10717
11054
|
KitTextboxComponent,
|
|
10718
11055
|
ReactiveFormsModule,
|
|
10719
11056
|
KitToggleComponent,
|
|
10720
|
-
], providers: [KitFormErrors], template: "
|
|
10721
|
-
}],
|
|
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: () => [] });
|
|
10722
11059
|
|
|
10723
11060
|
var KitUsersSettingsProfileTab;
|
|
10724
11061
|
(function (KitUsersSettingsProfileTab) {
|
|
@@ -10726,70 +11063,6 @@ var KitUsersSettingsProfileTab;
|
|
|
10726
11063
|
KitUsersSettingsProfileTab["ENTITLEMENTS"] = "entitlements";
|
|
10727
11064
|
})(KitUsersSettingsProfileTab || (KitUsersSettingsProfileTab = {}));
|
|
10728
11065
|
|
|
10729
|
-
class KitUsersSettingsEntitlementsComponent {
|
|
10730
|
-
constructor() {
|
|
10731
|
-
this.store = inject(Store);
|
|
10732
|
-
this.entitlementsForm = viewChild(KitUsersSettingsEntitlementsFormComponent, ...(ngDevMode ? [{ debugName: "entitlementsForm" }] : /* istanbul ignore next */ []));
|
|
10733
|
-
this.collapsedList = viewChild(KitCollapsedListComponent, ...(ngDevMode ? [{ debugName: "collapsedList" }] : /* istanbul ignore next */ []));
|
|
10734
|
-
this.showIdentityType = input.required(...(ngDevMode ? [{ debugName: "showIdentityType" }] : /* istanbul ignore next */ []));
|
|
10735
|
-
this.userEntitlements = computed(() => this.store.selectSignal(KIT_USERS_SETTINGS_ENTITLEMENTS_STATE_TOKEN)().userEntitlements, ...(ngDevMode ? [{ debugName: "userEntitlements" }] : /* istanbul ignore next */ []));
|
|
10736
|
-
this.userDetailsId = computed(() => (this.store.selectSignal(KIT_USERS_SETTINGS_STATE_TOKEN)().userDetails.data?.id), ...(ngDevMode ? [{ debugName: "userDetailsId" }] : /* istanbul ignore next */ []));
|
|
10737
|
-
this.entitlementItems = computed(() => (this.userEntitlements().data).map(entitlement => ({ text: entitlement.alias, value: String(entitlement.id) })), ...(ngDevMode ? [{ debugName: "entitlementItems" }] : /* istanbul ignore next */ []));
|
|
10738
|
-
this.selectedEntitlementId = signal(null, ...(ngDevMode ? [{ debugName: "selectedEntitlementId" }] : /* istanbul ignore next */ []));
|
|
10739
|
-
effect(() => this.fetchEntitlements());
|
|
10740
|
-
effect(() => this.fetchEntitlementDetails());
|
|
10741
|
-
effect(() => this.selectFirstItem());
|
|
10742
|
-
}
|
|
10743
|
-
get isFormDisabled() {
|
|
10744
|
-
const formComponent = this.entitlementsForm();
|
|
10745
|
-
return !formComponent || formComponent.form.pristine || formComponent.form.invalid;
|
|
10746
|
-
}
|
|
10747
|
-
selectItem(item) {
|
|
10748
|
-
const collapsedList = this.collapsedList();
|
|
10749
|
-
if (collapsedList) {
|
|
10750
|
-
collapsedList.setSelectedItem(item);
|
|
10751
|
-
this.selectedEntitlementId.set(+item.value);
|
|
10752
|
-
}
|
|
10753
|
-
;
|
|
10754
|
-
}
|
|
10755
|
-
submit() {
|
|
10756
|
-
this.entitlementsForm()?.submit();
|
|
10757
|
-
}
|
|
10758
|
-
fetchEntitlements() {
|
|
10759
|
-
const userId = this.userDetailsId();
|
|
10760
|
-
if (userId) {
|
|
10761
|
-
this.selectedEntitlementId.set(null);
|
|
10762
|
-
this.store.dispatch(new KitFetchUsersSettingsEntitlements(userId));
|
|
10763
|
-
}
|
|
10764
|
-
}
|
|
10765
|
-
selectFirstItem() {
|
|
10766
|
-
const firstItem = this.userEntitlements().data[0];
|
|
10767
|
-
if (firstItem) {
|
|
10768
|
-
this.selectItem({ text: firstItem.alias, value: String(firstItem.id) });
|
|
10769
|
-
}
|
|
10770
|
-
}
|
|
10771
|
-
fetchEntitlementDetails() {
|
|
10772
|
-
const entitlementId = this.selectedEntitlementId();
|
|
10773
|
-
const userId = this.userDetailsId();
|
|
10774
|
-
if (entitlementId && userId) {
|
|
10775
|
-
this.store.dispatch(new KitFetchUsersSettingsEntitlementDetails({
|
|
10776
|
-
userId,
|
|
10777
|
-
entitlementId,
|
|
10778
|
-
}));
|
|
10779
|
-
}
|
|
10780
|
-
}
|
|
10781
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10782
|
-
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 }); }
|
|
10783
|
-
}
|
|
10784
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsEntitlementsComponent, decorators: [{
|
|
10785
|
-
type: Component,
|
|
10786
|
-
args: [{ selector: 'kit-users-settings-entitlements', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
10787
|
-
KitCollapsedListComponent,
|
|
10788
|
-
KitSkeletonComponent,
|
|
10789
|
-
KitUsersSettingsEntitlementsFormComponent,
|
|
10790
|
-
], 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"] }]
|
|
10791
|
-
}], 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 }] }] } });
|
|
10792
|
-
|
|
10793
11066
|
class KitUsersSettingsProfileComponent {
|
|
10794
11067
|
constructor() {
|
|
10795
11068
|
this.store = inject(Store);
|
|
@@ -10800,11 +11073,14 @@ class KitUsersSettingsProfileComponent {
|
|
|
10800
11073
|
this.detailsForm = viewChild(KitUsersSettingsDetailsFormComponent, ...(ngDevMode ? [{ debugName: "detailsForm" }] : /* istanbul ignore next */ []));
|
|
10801
11074
|
this.entitlementsForm = viewChild(KitUsersSettingsEntitlementsComponent, ...(ngDevMode ? [{ debugName: "entitlementsForm" }] : /* istanbul ignore next */ []));
|
|
10802
11075
|
this.showIdentityType = input.required(...(ngDevMode ? [{ debugName: "showIdentityType" }] : /* istanbul ignore next */ []));
|
|
10803
|
-
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;
|
|
10804
11081
|
this.userDetails = computed(() => this.store.selectSignal(KIT_USERS_SETTINGS_STATE_TOKEN)().userDetails, ...(ngDevMode ? [{ debugName: "userDetails" }] : /* istanbul ignore next */ []));
|
|
10805
11082
|
this.userEntitlementsDetails = computed(() => this.store.selectSignal(KIT_USERS_SETTINGS_ENTITLEMENTS_STATE_TOKEN)().userEntitlementDetails, ...(ngDevMode ? [{ debugName: "userEntitlementsDetails" }] : /* istanbul ignore next */ []));
|
|
10806
11083
|
this.currentTab = signal(KitUsersSettingsProfileTab.DETAILS, ...(ngDevMode ? [{ debugName: "currentTab" }] : /* istanbul ignore next */ []));
|
|
10807
|
-
this.isPasswordDialogOpened = signal(false, ...(ngDevMode ? [{ debugName: "isPasswordDialogOpened" }] : /* istanbul ignore next */ []));
|
|
10808
11084
|
this.isEntitlementDialogOpened = signal(false, ...(ngDevMode ? [{ debugName: "isEntitlementDialogOpened" }] : /* istanbul ignore next */ []));
|
|
10809
11085
|
this.kitButtonKind = KitButtonKind;
|
|
10810
11086
|
this.kitButtonType = KitButtonType;
|
|
@@ -10824,9 +11100,10 @@ class KitUsersSettingsProfileComponent {
|
|
|
10824
11100
|
get isFormDisabled() {
|
|
10825
11101
|
if (this.currentTab() === KitUsersSettingsProfileTab.DETAILS) {
|
|
10826
11102
|
const detailsForm = this.detailsForm();
|
|
10827
|
-
return !detailsForm || detailsForm.form.pristine || detailsForm.form.invalid;
|
|
11103
|
+
return !detailsForm || detailsForm.form.pristine || detailsForm.form.invalid || detailsForm.isSaving();
|
|
10828
11104
|
}
|
|
10829
|
-
|
|
11105
|
+
const entitlementsForm = this.entitlementsForm();
|
|
11106
|
+
return !entitlementsForm || entitlementsForm.isSaveBtnDisabled;
|
|
10830
11107
|
}
|
|
10831
11108
|
get isSaveLoading() {
|
|
10832
11109
|
if (this.currentTab() === KitUsersSettingsProfileTab.DETAILS) {
|
|
@@ -10836,12 +11113,11 @@ class KitUsersSettingsProfileComponent {
|
|
|
10836
11113
|
}
|
|
10837
11114
|
onSave() {
|
|
10838
11115
|
if (this.currentTab() === KitUsersSettingsProfileTab.DETAILS) {
|
|
10839
|
-
this.detailsForm()?.submit();
|
|
11116
|
+
this.detailsForm()?.submit().pipe(takeUntilDestroyed(this.destroyRef)).subscribe();
|
|
10840
11117
|
}
|
|
10841
11118
|
else {
|
|
10842
|
-
this.entitlementsForm()?.submit();
|
|
11119
|
+
this.entitlementsForm()?.submit().pipe(takeUntilDestroyed(this.destroyRef)).subscribe();
|
|
10843
11120
|
}
|
|
10844
|
-
this.saveClicked.emit();
|
|
10845
11121
|
}
|
|
10846
11122
|
onTabSelected(event) {
|
|
10847
11123
|
const tabs = Object.values(KitUsersSettingsProfileTab);
|
|
@@ -10866,328 +11142,165 @@ class KitUsersSettingsProfileComponent {
|
|
|
10866
11142
|
entitlementId: entitlementsDetails.id,
|
|
10867
11143
|
})))).subscribe();
|
|
10868
11144
|
}
|
|
10869
|
-
|
|
10870
|
-
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 }); }
|
|
10871
|
-
}
|
|
10872
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsProfileComponent, decorators: [{
|
|
10873
|
-
type: Component,
|
|
10874
|
-
args: [{ selector: 'kit-users-settings-profile', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
10875
|
-
KitEntitySectionContainerComponent,
|
|
10876
|
-
KitButtonComponent,
|
|
10877
|
-
TranslatePipe,
|
|
10878
|
-
KitUsersSettingsCreateEntitlementDialogComponent,
|
|
10879
|
-
KitUsersSettingsPasswordDialogComponent,
|
|
10880
|
-
KitUsersSettingsDetailsFormComponent,
|
|
10881
|
-
KitUsersSettingsEntitlementsComponent,
|
|
10882
|
-
KitTabsComponent,
|
|
10883
|
-
KitTabComponent,
|
|
10884
|
-
NgTemplateOutlet,
|
|
10885
|
-
], 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"] }]
|
|
10886
|
-
}], 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"] }] } });
|
|
10887
|
-
|
|
10888
|
-
class KitUsersSettingsComponent {
|
|
10889
|
-
constructor() {
|
|
10890
|
-
this.destroyRef = inject(DestroyRef);
|
|
10891
|
-
this.store = inject(Store);
|
|
10892
|
-
this.kitDialogService = inject(KitDialogService);
|
|
10893
|
-
this.translateService = inject(TranslateService);
|
|
10894
|
-
this.viewContainerRef = inject(ViewContainerRef);
|
|
10895
|
-
this.cardDetailsComponent = viewChild.required(KitCardDetailsComponent);
|
|
10896
|
-
this.deleteDialogActionsTemplate = viewChild.required('deleteDialogActions', { read: TemplateRef });
|
|
10897
|
-
this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
10898
|
-
this.showIdentityType = input(true, ...(ngDevMode ? [{ debugName: "showIdentityType" }] : /* istanbul ignore next */ []));
|
|
10899
|
-
this.saveClicked = output();
|
|
10900
|
-
this.currentUserId = this.store.selectSignal((state) => state.user?.data?.id?.toString() ?? null);
|
|
10901
|
-
this.isCreatingNewUser = signal(false, ...(ngDevMode ? [{ debugName: "isCreatingNewUser" }] : /* istanbul ignore next */ []));
|
|
10902
|
-
this.pendingDeleteUser = signal(null, ...(ngDevMode ? [{ debugName: "pendingDeleteUser" }] : /* istanbul ignore next */ []));
|
|
10903
|
-
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)));
|
|
10904
|
-
this.pageSize = 10;
|
|
10905
|
-
this.kitSvgIcon = KitSvgIcon;
|
|
10906
|
-
this.kitButtonIconPosition = KitButtonIconPosition;
|
|
10907
|
-
this.kitButtonKind = KitButtonKind;
|
|
10908
|
-
this.kitButtonType = KitButtonType;
|
|
10909
|
-
this.kitSvgIconType = KitSvgIconType;
|
|
10910
|
-
}
|
|
10911
|
-
onDataStateChanged({ skip, take, search, filters }) {
|
|
10912
|
-
this.store.dispatch(new KitFetchUsersSettings({
|
|
10913
|
-
skip,
|
|
10914
|
-
take,
|
|
10915
|
-
filter: this.buildFilter(search, filters),
|
|
10916
|
-
}));
|
|
10917
|
-
}
|
|
10918
|
-
onCardSelected(card) {
|
|
10919
|
-
this.store.dispatch(new KitFetchUsersSettingsDetails(card.id));
|
|
10920
|
-
}
|
|
10921
|
-
isDeleteDisabled(userId) {
|
|
10922
|
-
return this.currentUserId() === userId.toString();
|
|
10923
|
-
}
|
|
10924
|
-
getUserDisplayName(user) {
|
|
10925
|
-
const fullName = [
|
|
10926
|
-
user.firstName,
|
|
10927
|
-
user.lastName,
|
|
10928
|
-
].filter(Boolean).join(' ').trim();
|
|
10929
|
-
return fullName || user.userName;
|
|
10930
|
-
}
|
|
10931
|
-
onDeleteUser(user) {
|
|
10932
|
-
this.pendingDeleteUser.set(user);
|
|
11145
|
+
openChangePasswordDialog() {
|
|
10933
11146
|
this.kitDialogService.openDialog({
|
|
10934
|
-
title: this.translateService.instant('kit.usersSettings.
|
|
10935
|
-
content:
|
|
10936
|
-
name: this.getUserDisplayName(user),
|
|
10937
|
-
}),
|
|
10938
|
-
actions: this.deleteDialogActionsTemplate(),
|
|
11147
|
+
title: this.translateService.instant('kit.usersSettings.passwordDialog.title'),
|
|
11148
|
+
content: KitUsersSettingsPasswordDialogComponent,
|
|
10939
11149
|
appendTo: this.viewContainerRef,
|
|
10940
11150
|
});
|
|
10941
11151
|
}
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
this.pendingDeleteUser.set(null);
|
|
10945
|
-
}
|
|
10946
|
-
confirmDeleteUser() {
|
|
10947
|
-
const user = this.pendingDeleteUser();
|
|
10948
|
-
if (!user) {
|
|
10949
|
-
return;
|
|
10950
|
-
}
|
|
10951
|
-
this.store.dispatch(new KitDeleteUsersSettingsUser(user.id)).pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
10952
|
-
this.cardDetailsComponent().deleteCard(user.id);
|
|
10953
|
-
this.closeDeleteDialog();
|
|
10954
|
-
});
|
|
10955
|
-
}
|
|
10956
|
-
buildFilter(search, filters) {
|
|
10957
|
-
if (!search) {
|
|
10958
|
-
return filters;
|
|
10959
|
-
}
|
|
10960
|
-
return {
|
|
10961
|
-
logic: KitFilterLogic.AND,
|
|
10962
|
-
filters: [
|
|
10963
|
-
{ field: 'name', operator: 'contains', value: search },
|
|
10964
|
-
...(filters?.filters ?? []),
|
|
10965
|
-
],
|
|
10966
|
-
};
|
|
10967
|
-
}
|
|
10968
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUsersSettingsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10969
|
-
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 }); }
|
|
10970
11154
|
}
|
|
10971
|
-
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: [{
|
|
10972
11156
|
type: Component,
|
|
10973
|
-
args: [{ selector: 'kit-users-settings', imports: [
|
|
10974
|
-
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
const KIT_USER_APPLICATIONS_PATH = new InjectionToken('kitUserApplicationsPath');
|
|
10986
|
-
|
|
10987
|
-
class KitUserApiService {
|
|
10988
|
-
constructor() {
|
|
10989
|
-
this.httpClient = inject(HttpClient);
|
|
10990
|
-
this.basePath = inject(KIT_BASE_PATH);
|
|
10991
|
-
this.userPath = inject(KIT_USER_PATH);
|
|
10992
|
-
this.userApplicationsPath = inject(KIT_USER_APPLICATIONS_PATH);
|
|
10993
|
-
}
|
|
10994
|
-
getUserInfo() {
|
|
10995
|
-
const url = `${this.basePath}/${this.userPath}`;
|
|
10996
|
-
return this.httpClient.get(url);
|
|
10997
|
-
}
|
|
10998
|
-
getUserApplicationList() {
|
|
10999
|
-
const url = `${this.basePath}/${this.userApplicationsPath}`;
|
|
11000
|
-
return this.httpClient.get(url);
|
|
11001
|
-
}
|
|
11002
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
11003
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserApiService, providedIn: 'root' }); }
|
|
11004
|
-
}
|
|
11005
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserApiService, decorators: [{
|
|
11006
|
-
type: Injectable,
|
|
11007
|
-
args: [{
|
|
11008
|
-
providedIn: 'root',
|
|
11009
|
-
}]
|
|
11010
|
-
}] });
|
|
11011
|
-
|
|
11012
|
-
class FetchUser {
|
|
11013
|
-
static { this.type = '[User] Fetch'; }
|
|
11014
|
-
}
|
|
11015
|
-
|
|
11016
|
-
const KIT_USER_STATE_TOKEN = new StateToken('user');
|
|
11017
|
-
let KitUserState = class KitUserState {
|
|
11018
|
-
constructor() {
|
|
11019
|
-
this.kitUserApiService = inject(KitUserApiService);
|
|
11020
|
-
}
|
|
11021
|
-
fetchUser(ctx) {
|
|
11022
|
-
return this.kitUserApiService.getUserInfo().pipe(tap(user => ctx.setState({
|
|
11023
|
-
data: user,
|
|
11024
|
-
loading: false,
|
|
11025
|
-
})));
|
|
11026
|
-
}
|
|
11027
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserState, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
11028
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserState }); }
|
|
11029
|
-
};
|
|
11030
|
-
__decorate([
|
|
11031
|
-
Action(FetchUser)
|
|
11032
|
-
], KitUserState.prototype, "fetchUser", null);
|
|
11033
|
-
KitUserState = __decorate([
|
|
11034
|
-
State({
|
|
11035
|
-
name: KIT_USER_STATE_TOKEN,
|
|
11036
|
-
defaults: {
|
|
11037
|
-
data: null,
|
|
11038
|
-
loading: true,
|
|
11039
|
-
},
|
|
11040
|
-
})
|
|
11041
|
-
], KitUserState);
|
|
11042
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitUserState, decorators: [{
|
|
11043
|
-
type: Injectable
|
|
11044
|
-
}], propDecorators: { fetchUser: [] } });
|
|
11045
|
-
|
|
11046
|
-
class KitGridCellService {
|
|
11047
|
-
constructor() {
|
|
11048
|
-
this.translateService = inject(TranslateService);
|
|
11049
|
-
this.decimalPipe = inject(DecimalPipe);
|
|
11050
|
-
this.datePipe = inject(DatePipe);
|
|
11051
|
-
this.dateFormatConfig = inject(KIT_GRID_CELL_DATE_FORMAT_CONFIG, { optional: true });
|
|
11052
|
-
this.store = inject(Store);
|
|
11053
|
-
this.userState = this.store.selectSignal(KIT_USER_STATE_TOKEN)();
|
|
11054
|
-
const dateFormatConfig = this.dateFormatConfig;
|
|
11055
|
-
this.dateFormat = dateFormatConfig?.dateFormat ?? KIT_DATE_FORMAT;
|
|
11056
|
-
this.dateTimeFormat = dateFormatConfig?.dateTimeFormat ?? KIT_DATETIME_FORMAT_LONG;
|
|
11057
|
-
}
|
|
11058
|
-
createCellValue(columnType, columnField, dataItem, translationMap = {}, defaultValue = '', valueTransforms = {}) {
|
|
11059
|
-
const rawValue = this.getCellValue(dataItem, columnField);
|
|
11060
|
-
const value = valueTransforms[columnField]?.(rawValue) ?? rawValue;
|
|
11061
|
-
if (columnField in translationMap && value != null && value !== '') {
|
|
11062
|
-
return this.translateService.instant(translationMap[columnField](value)) ?? defaultValue;
|
|
11063
|
-
}
|
|
11064
|
-
switch (columnType) {
|
|
11065
|
-
case 'number':
|
|
11066
|
-
return this.decimalPipe.transform(value) ?? defaultValue;
|
|
11067
|
-
case 'plainNumber':
|
|
11068
|
-
return value || defaultValue;
|
|
11069
|
-
case 'date':
|
|
11070
|
-
return this.datePipe.transform(value, this.dateFormat, 'UTC') ?? defaultValue;
|
|
11071
|
-
case 'dateTime':
|
|
11072
|
-
return this.datePipe.transform(value, this.dateTimeFormat, 'UTC') ?? defaultValue;
|
|
11073
|
-
case 'dateLocal':
|
|
11074
|
-
return this.datePipe.transform(value, this.dateFormat) ?? defaultValue;
|
|
11075
|
-
case 'dateTimeLocal':
|
|
11076
|
-
return this.datePipe.transform(value, this.dateTimeFormat) ?? defaultValue;
|
|
11077
|
-
case 'dateZone':
|
|
11078
|
-
return value ? formatInTimeZone(value, this.userState.data?.namedTimeZone ?? 'UTC', this.dateFormat) : defaultValue;
|
|
11079
|
-
case 'dateTimeZone':
|
|
11080
|
-
return value ? formatInTimeZone(value, this.userState.data?.namedTimeZone ?? 'UTC', this.dateTimeFormat) : defaultValue;
|
|
11081
|
-
case 'boolean':
|
|
11082
|
-
return this.translateService.instant(value ? 'common.yes' : 'common.no');
|
|
11083
|
-
default:
|
|
11084
|
-
return value || defaultValue;
|
|
11085
|
-
}
|
|
11086
|
-
}
|
|
11087
|
-
getCellValue(dataItem, field) {
|
|
11088
|
-
let value = dataItem[field];
|
|
11089
|
-
if (!value) {
|
|
11090
|
-
value = this.getNestedGridCellValue(dataItem, field);
|
|
11091
|
-
}
|
|
11092
|
-
return value;
|
|
11093
|
-
}
|
|
11094
|
-
getNestedGridCellValue(dataItem, field) {
|
|
11095
|
-
const value = field.split('.').reduce((acc, key) => acc !== null && typeof acc === 'object' && key in acc
|
|
11096
|
-
? acc[key]
|
|
11097
|
-
: undefined, dataItem);
|
|
11098
|
-
return value === 0 ? 0 : value || '';
|
|
11099
|
-
}
|
|
11100
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitGridCellService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
11101
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitGridCellService }); }
|
|
11102
|
-
}
|
|
11103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitGridCellService, decorators: [{
|
|
11104
|
-
type: Injectable
|
|
11105
|
-
}], 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"] }] } });
|
|
11106
11169
|
|
|
11107
|
-
|
|
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 {
|
|
11108
11177
|
constructor() {
|
|
11109
|
-
this.translateService = inject(TranslateService);
|
|
11110
11178
|
this.store = inject(Store);
|
|
11111
|
-
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
|
+
};
|
|
11112
11211
|
}
|
|
11113
|
-
|
|
11114
|
-
const
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
}));
|
|
11122
|
-
workbook.sheets[0].rows = this.getExportedExcelRows(columns, data, exportedColumns, translationMap, userTimezone, valueTransforms);
|
|
11123
|
-
workbook.sheets[0].columns = columns;
|
|
11124
|
-
const dataUrl = await new Workbook(workbook).toDataURL();
|
|
11125
|
-
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 }));
|
|
11126
11221
|
}
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
for (const row of data) {
|
|
11130
|
-
const rowCells = gridColumns.map((column) => {
|
|
11131
|
-
const rawValue = this.gridCellService.getCellValue(row, column.field);
|
|
11132
|
-
const value = valueTransforms[column.field]?.(rawValue) ?? rawValue;
|
|
11133
|
-
switch (column.type) {
|
|
11134
|
-
case 'number': {
|
|
11135
|
-
return { value: (value ?? undefined) };
|
|
11136
|
-
}
|
|
11137
|
-
case 'time':
|
|
11138
|
-
return { format: column.excelFormat, value: this.timeStringToExcelFraction(value) };
|
|
11139
|
-
case 'date':
|
|
11140
|
-
case 'dateTime': {
|
|
11141
|
-
const format = column.excelFormat || (column.type === 'date' ? KIT_DATE_FORMAT : KIT_DATETIME_FORMAT_LONG);
|
|
11142
|
-
const dateValue = value ? this.truncateToSeconds(this.convertToUtcDate(value)) : undefined;
|
|
11143
|
-
return { format, value: dateValue };
|
|
11144
|
-
}
|
|
11145
|
-
case 'dateLocal':
|
|
11146
|
-
case 'dateTimeLocal': {
|
|
11147
|
-
const format = column.excelFormat || (column.type === 'dateLocal' ? KIT_DATE_FORMAT : KIT_DATETIME_FORMAT_LONG);
|
|
11148
|
-
const dateValue = value ? this.truncateToSeconds(new Date(value)) : undefined;
|
|
11149
|
-
return { format, value: dateValue };
|
|
11150
|
-
}
|
|
11151
|
-
case 'dateZone':
|
|
11152
|
-
case 'dateTimeZone': {
|
|
11153
|
-
const format = column.excelFormat || (column.type === 'dateZone' ? KIT_DATE_FORMAT : KIT_DATETIME_FORMAT_LONG);
|
|
11154
|
-
const dateValue = value
|
|
11155
|
-
? this.truncateToSeconds(toZonedTime(new Date(value), userTimezone))
|
|
11156
|
-
: undefined;
|
|
11157
|
-
return { format, value: dateValue };
|
|
11158
|
-
}
|
|
11159
|
-
}
|
|
11160
|
-
return { value: this.gridCellService.createCellValue(column.type, column.field, row, translationMap, '', valueTransforms) };
|
|
11161
|
-
});
|
|
11162
|
-
rows.push({ cells: rowCells, type: 'data' });
|
|
11163
|
-
}
|
|
11164
|
-
return rows;
|
|
11222
|
+
onCardSelected(card) {
|
|
11223
|
+
this.store.dispatch(new KitFetchUsersSettingsDetails(card.id));
|
|
11165
11224
|
}
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
return '';
|
|
11169
|
-
}
|
|
11170
|
-
const [hoursStr, minutesStr,] = time.split(':');
|
|
11171
|
-
const hours = Number.parseInt(hoursStr, 10);
|
|
11172
|
-
const minutes = Number.parseInt(minutesStr, 10);
|
|
11173
|
-
return (hours * 60 + minutes) / (24 * 60);
|
|
11225
|
+
isDeleteDisabled(userId) {
|
|
11226
|
+
return this.currentUserId() === userId;
|
|
11174
11227
|
}
|
|
11175
|
-
|
|
11176
|
-
const
|
|
11177
|
-
|
|
11178
|
-
|
|
11228
|
+
getUserDisplayName(user) {
|
|
11229
|
+
const fullName = [
|
|
11230
|
+
user.firstName,
|
|
11231
|
+
user.lastName,
|
|
11232
|
+
].filter(Boolean).join(' ').trim();
|
|
11233
|
+
return fullName;
|
|
11179
11234
|
}
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
|
|
11183
|
-
|
|
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
|
+
});
|
|
11184
11255
|
}
|
|
11185
|
-
|
|
11186
|
-
|
|
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 }); }
|
|
11187
11288
|
}
|
|
11188
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type:
|
|
11189
|
-
type:
|
|
11190
|
-
|
|
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 }] }] } });
|
|
11191
11304
|
|
|
11192
11305
|
const KIT_ENTITY_CREATE_SERVICE = new InjectionToken('kitEntityCreateService');
|
|
11193
11306
|
class KitCreateEntityDialogComponent extends DialogContentBase {
|
|
@@ -11243,23 +11356,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
11243
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"] }]
|
|
11244
11357
|
}], ctorParameters: () => [], propDecorators: { maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }] } });
|
|
11245
11358
|
|
|
11246
|
-
const KIT_GRID_COLUMN_WIDTH = 170;
|
|
11247
|
-
const KIT_GRID_PAGE_SIZE = 10;
|
|
11248
|
-
|
|
11249
|
-
var KitPermissionTypes;
|
|
11250
|
-
(function (KitPermissionTypes) {
|
|
11251
|
-
KitPermissionTypes["Create"] = "Create";
|
|
11252
|
-
KitPermissionTypes["Delete"] = "Delete";
|
|
11253
|
-
KitPermissionTypes["Edit"] = "Edit";
|
|
11254
|
-
KitPermissionTypes["View"] = "View";
|
|
11255
|
-
KitPermissionTypes["Set"] = "Set";
|
|
11256
|
-
KitPermissionTypes["Use"] = "Use";
|
|
11257
|
-
})(KitPermissionTypes || (KitPermissionTypes = {}));
|
|
11258
|
-
const defaultUserRolesSort = [{ field: 'name', dir: 'asc' }];
|
|
11259
|
-
const exportedUserRoleColumns = [
|
|
11260
|
-
kitBuildGridColumn('name', 'Name', 'string', false, false, KIT_GRID_COLUMN_WIDTH),
|
|
11261
|
-
];
|
|
11262
|
-
|
|
11263
11359
|
class KitPartnerDetailsComponent {
|
|
11264
11360
|
constructor() {
|
|
11265
11361
|
this.kitDialogService = inject(KitDialogService);
|
|
@@ -11326,51 +11422,6 @@ const exportedPartnerColumns = [
|
|
|
11326
11422
|
kitBuildGridColumn('name', 'Name', 'string', false, false, KIT_GRID_COLUMN_WIDTH),
|
|
11327
11423
|
];
|
|
11328
11424
|
|
|
11329
|
-
class KitHttpErrorHandlerService {
|
|
11330
|
-
constructor() {
|
|
11331
|
-
this.kitNotificationService = inject(KitNotificationService);
|
|
11332
|
-
this.translateService = inject(TranslateService);
|
|
11333
|
-
this.router = inject(Router);
|
|
11334
|
-
}
|
|
11335
|
-
handleServerError(error) {
|
|
11336
|
-
if (error.error instanceof ErrorEvent) {
|
|
11337
|
-
this.showErrorNotification(`${this.translateService.instant('kit.http.clientError')} ${error.error.message}`);
|
|
11338
|
-
return throwError(() => error);
|
|
11339
|
-
}
|
|
11340
|
-
switch (error.status) {
|
|
11341
|
-
case HttpStatusCode.Unauthorized:
|
|
11342
|
-
this.showErrorNotification(this.translateService.instant('kit.http.unauthorized'));
|
|
11343
|
-
break;
|
|
11344
|
-
case HttpStatusCode.Forbidden:
|
|
11345
|
-
this.showErrorNotification(this.translateService.instant('kit.http.forbidden'));
|
|
11346
|
-
this.router.navigate(['forbidden']);
|
|
11347
|
-
break;
|
|
11348
|
-
case HttpStatusCode.NotFound:
|
|
11349
|
-
this.showErrorNotification(this.translateService.instant('kit.http.notFound'));
|
|
11350
|
-
break;
|
|
11351
|
-
case HttpStatusCode.BadRequest:
|
|
11352
|
-
this.showErrorNotification(`${this.translateService.instant('kit.http.validationError')} ${error.error?.title ?? ''}`);
|
|
11353
|
-
break;
|
|
11354
|
-
default:
|
|
11355
|
-
if (error.status >= HttpStatusCode.InternalServerError) {
|
|
11356
|
-
this.showErrorNotification(`${this.translateService.instant('kit.http.serverError')} ${error.error?.title ?? ''}`);
|
|
11357
|
-
}
|
|
11358
|
-
}
|
|
11359
|
-
return throwError(() => error);
|
|
11360
|
-
}
|
|
11361
|
-
showSuccessNotification(message) {
|
|
11362
|
-
this.kitNotificationService.addNotification(KitNotificationType.SUCCESS, message, true, 3000);
|
|
11363
|
-
}
|
|
11364
|
-
showErrorNotification(message) {
|
|
11365
|
-
this.kitNotificationService.addNotification(KitNotificationType.ERROR, message);
|
|
11366
|
-
}
|
|
11367
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitHttpErrorHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
11368
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitHttpErrorHandlerService }); }
|
|
11369
|
-
}
|
|
11370
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitHttpErrorHandlerService, decorators: [{
|
|
11371
|
-
type: Injectable
|
|
11372
|
-
}] });
|
|
11373
|
-
|
|
11374
11425
|
class KitPartnerService {
|
|
11375
11426
|
constructor() {
|
|
11376
11427
|
this.httpClient = inject(HttpClient);
|
|
@@ -11528,6 +11579,7 @@ class KitPartnerComponent {
|
|
|
11528
11579
|
content: KitCreateEntityDialogComponent,
|
|
11529
11580
|
appendTo: this.viewContainerRef,
|
|
11530
11581
|
});
|
|
11582
|
+
signalSetFn(this.kitDialogService.dialogInstance.maxLength[SIGNAL], 48);
|
|
11531
11583
|
this.kitDialogService.dialogRef?.result.pipe(take(1)).subscribe((result) => {
|
|
11532
11584
|
if (result && 'id' in result) {
|
|
11533
11585
|
this.appendCard(result);
|
|
@@ -11747,6 +11799,7 @@ const kitTranslations = {
|
|
|
11747
11799
|
closeButtonLabel: 'Close',
|
|
11748
11800
|
},
|
|
11749
11801
|
usersSettings: {
|
|
11802
|
+
title: 'User Maintenance',
|
|
11750
11803
|
details: {
|
|
11751
11804
|
title: 'User Details',
|
|
11752
11805
|
loginId: 'Login ID',
|
|
@@ -11757,9 +11810,6 @@ const kitTranslations = {
|
|
|
11757
11810
|
mfa: 'Multi-Factor Authentication',
|
|
11758
11811
|
createNewUser: 'Create New User',
|
|
11759
11812
|
password: 'Password',
|
|
11760
|
-
passwordRequired: 'Password is required',
|
|
11761
|
-
passwordTooWeak: 'Your password is too weak.',
|
|
11762
|
-
userNameInvalid: 'You have specified invalid Login ID.',
|
|
11763
11813
|
},
|
|
11764
11814
|
passwordDialog: {
|
|
11765
11815
|
title: 'Change Password',
|
|
@@ -11767,9 +11817,6 @@ const kitTranslations = {
|
|
|
11767
11817
|
cancel: 'Cancel',
|
|
11768
11818
|
newPassword: 'New Password',
|
|
11769
11819
|
repeatNewPassword: 'Repeat New Password',
|
|
11770
|
-
newPasswordRequired: 'New password is required',
|
|
11771
|
-
repeatNewPasswordRequired: 'Please repeat the new password',
|
|
11772
|
-
passwordsDoNotMatch: 'Passwords do not match',
|
|
11773
11820
|
forcePassword: 'Force Password Reset',
|
|
11774
11821
|
},
|
|
11775
11822
|
createDialog: {
|
|
@@ -11794,6 +11841,7 @@ const kitTranslations = {
|
|
|
11794
11841
|
},
|
|
11795
11842
|
},
|
|
11796
11843
|
entitlements: {
|
|
11844
|
+
empty: 'No entitlements available for this user',
|
|
11797
11845
|
identityType: 'Identity Type',
|
|
11798
11846
|
partners: 'Partners',
|
|
11799
11847
|
alias: 'Alias',
|
|
@@ -11848,6 +11896,7 @@ const kitTranslations = {
|
|
|
11848
11896
|
selectValue: 'Select value',
|
|
11849
11897
|
create: 'Create New',
|
|
11850
11898
|
delete: 'Delete',
|
|
11899
|
+
cancel: 'Cancel',
|
|
11851
11900
|
confirmationDelete: 'Are you sure you want to permanently delete {{name}}?',
|
|
11852
11901
|
name: 'Name',
|
|
11853
11902
|
save: 'Save',
|
|
@@ -11885,6 +11934,7 @@ const kitTranslations = {
|
|
|
11885
11934
|
duplicate: 'Duplicate value',
|
|
11886
11935
|
maxNumber: 'The value should be less than or equal to {{ maxNumber }}',
|
|
11887
11936
|
minNumber: 'The value should be greater than or equal to {{ minNumber }}',
|
|
11937
|
+
passwordsMismatch: 'Passwords do not match',
|
|
11888
11938
|
},
|
|
11889
11939
|
liveUpdates: {
|
|
11890
11940
|
pause: 'Pause Live Feed',
|
|
@@ -12031,6 +12081,7 @@ const kitTranslations = {
|
|
|
12031
12081
|
closeButtonLabel: 'Закрыть',
|
|
12032
12082
|
},
|
|
12033
12083
|
usersSettings: {
|
|
12084
|
+
title: 'Настройка пользователей',
|
|
12034
12085
|
details: {
|
|
12035
12086
|
title: 'Детали пользователя',
|
|
12036
12087
|
loginId: 'Логин',
|
|
@@ -12041,9 +12092,6 @@ const kitTranslations = {
|
|
|
12041
12092
|
mfa: 'Многофакторная аутентификация',
|
|
12042
12093
|
createNewUser: 'Создать нового пользователя',
|
|
12043
12094
|
password: 'Пароль',
|
|
12044
|
-
passwordRequired: 'Пароль обязателен',
|
|
12045
|
-
passwordTooWeak: 'Пароль слишком слабый.',
|
|
12046
|
-
userNameInvalid: 'Указан некорректный Логин.',
|
|
12047
12095
|
},
|
|
12048
12096
|
passwordDialog: {
|
|
12049
12097
|
title: 'Изменить пароль',
|
|
@@ -12051,9 +12099,6 @@ const kitTranslations = {
|
|
|
12051
12099
|
cancel: 'Отмена',
|
|
12052
12100
|
newPassword: 'Новый пароль',
|
|
12053
12101
|
repeatNewPassword: 'Повторите новый пароль',
|
|
12054
|
-
newPasswordRequired: 'Новый пароль обязателен',
|
|
12055
|
-
repeatNewPasswordRequired: 'Пожалуйста, повторите новый пароль',
|
|
12056
|
-
passwordsDoNotMatch: 'Пароли не совпадают',
|
|
12057
12102
|
forcePassword: 'Принудительно изменить пароль',
|
|
12058
12103
|
},
|
|
12059
12104
|
createDialog: {
|
|
@@ -12078,6 +12123,7 @@ const kitTranslations = {
|
|
|
12078
12123
|
},
|
|
12079
12124
|
},
|
|
12080
12125
|
entitlements: {
|
|
12126
|
+
empty: 'Нет доступных прав доступа для этого пользователя',
|
|
12081
12127
|
identityType: 'Тип удостоверения',
|
|
12082
12128
|
partners: 'Партнеры',
|
|
12083
12129
|
alias: 'Псевдоним',
|
|
@@ -12132,6 +12178,7 @@ const kitTranslations = {
|
|
|
12132
12178
|
selectValue: 'Выберите значение',
|
|
12133
12179
|
create: 'Создать',
|
|
12134
12180
|
delete: 'Удалить',
|
|
12181
|
+
cancel: 'Отмена',
|
|
12135
12182
|
confirmationDelete: 'Вы уверены, что хотите безвозвратно удалить {{name}}?',
|
|
12136
12183
|
name: 'Название',
|
|
12137
12184
|
save: 'Сохранить',
|
|
@@ -12166,6 +12213,10 @@ const kitTranslations = {
|
|
|
12166
12213
|
required: 'Обязательно для заполнения',
|
|
12167
12214
|
invalidLength: 'Значение должно быть меньше, чем {{ requiredLength }} символов',
|
|
12168
12215
|
invalidEmailFormat: 'Невалидный имэйл',
|
|
12216
|
+
duplicate: 'Дублирующее значение',
|
|
12217
|
+
maxNumber: 'Значение должно быть меньше или равно {{ maxNumber }}',
|
|
12218
|
+
minNumber: 'Значение должно быть больше или равно {{ minNumber }}',
|
|
12219
|
+
passwordsMismatch: 'Пароли не совпадают',
|
|
12169
12220
|
},
|
|
12170
12221
|
liveUpdates: {
|
|
12171
12222
|
pause: 'Остановить обновление',
|
|
@@ -15701,17 +15752,6 @@ class KitAbstractIdPayloadAction {
|
|
|
15701
15752
|
}
|
|
15702
15753
|
}
|
|
15703
15754
|
|
|
15704
|
-
class KitSkeletonSectionComponent {
|
|
15705
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitSkeletonSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15706
|
-
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 }); }
|
|
15707
|
-
}
|
|
15708
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitSkeletonSectionComponent, decorators: [{
|
|
15709
|
-
type: Component,
|
|
15710
|
-
args: [{ selector: 'kit-skeleton-section', imports: [
|
|
15711
|
-
KitSkeletonComponent,
|
|
15712
|
-
], 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"] }]
|
|
15713
|
-
}] });
|
|
15714
|
-
|
|
15715
15755
|
class KitGridLiveUpdatesControlComponent {
|
|
15716
15756
|
constructor() {
|
|
15717
15757
|
this.source = input.required(...(ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []));
|
|
@@ -17117,6 +17157,7 @@ class KitUserRolesComponent {
|
|
|
17117
17157
|
DecimalPipe,
|
|
17118
17158
|
DatePipe,
|
|
17119
17159
|
KitExcelExportService,
|
|
17160
|
+
KitHttpErrorHandlerService,
|
|
17120
17161
|
{
|
|
17121
17162
|
provide: KIT_ENTITY_CREATE_SERVICE,
|
|
17122
17163
|
useExisting: KitUserRolesService,
|
|
@@ -17137,6 +17178,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
17137
17178
|
DecimalPipe,
|
|
17138
17179
|
DatePipe,
|
|
17139
17180
|
KitExcelExportService,
|
|
17181
|
+
KitHttpErrorHandlerService,
|
|
17140
17182
|
{
|
|
17141
17183
|
provide: KIT_ENTITY_CREATE_SERVICE,
|
|
17142
17184
|
useExisting: KitUserRolesService,
|
|
@@ -17150,5 +17192,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
17150
17192
|
* Generated bundle index. Do not edit.
|
|
17151
17193
|
*/
|
|
17152
17194
|
|
|
17153
|
-
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,
|
|
17195
|
+
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 };
|
|
17154
17196
|
//# sourceMappingURL=indigina-ui-kit.mjs.map
|