@tuki-io/tuki-widgets 0.0.197 → 0.0.199
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/esm2020/di2mt/shared/components/stat-card/stat-card.component.mjs +2 -2
- package/esm2020/user-creation/src/app.constants.mjs +2 -16
- package/esm2020/user-creation/src/shared/material.module.mjs +7 -35
- package/esm2020/user-creation/src/shared/services/user-creation-api.service.mjs +19 -43
- package/esm2020/user-creation/src/shared/shared.module.mjs +4 -27
- package/esm2020/user-creation/src/user-creation.module.mjs +7 -40
- package/esm2020/user-creation/src/widgets/user-creation-wizard/components/user-details-step/user-details-step.component.mjs +20 -512
- package/esm2020/user-creation/src/widgets/user-creation-wizard/components/user-overview-step/user-overview-step.component.mjs +3 -3
- package/esm2020/user-creation/src/widgets/user-creation-wizard/components/user-template-step/user-template-step.component.mjs +34 -80
- package/esm2020/user-creation/src/widgets/user-creation-wizard/user-creation-wizard.component.mjs +19 -83
- package/esm2020/user-creation/src/widgets/user-creation-wizard/user-creation-wizard.service.mjs +124 -594
- package/fesm2015/tuki-io-tuki-widgets-di2mt.mjs +1 -1
- package/fesm2015/tuki-io-tuki-widgets-di2mt.mjs.map +1 -1
- package/fesm2015/tuki-io-tuki-widgets-user-creation.mjs +325 -1913
- package/fesm2015/tuki-io-tuki-widgets-user-creation.mjs.map +1 -1
- package/fesm2020/tuki-io-tuki-widgets-di2mt.mjs +1 -1
- package/fesm2020/tuki-io-tuki-widgets-di2mt.mjs.map +1 -1
- package/fesm2020/tuki-io-tuki-widgets-user-creation.mjs +313 -1868
- package/fesm2020/tuki-io-tuki-widgets-user-creation.mjs.map +1 -1
- package/package.json +1 -1
- package/user-creation/src/app.constants.d.ts +0 -10
- package/user-creation/src/shared/material.module.d.ts +1 -5
- package/user-creation/src/shared/services/user-creation-api.service.d.ts +2 -8
- package/user-creation/src/shared/shared.module.d.ts +1 -3
- package/user-creation/src/user-creation.module.d.ts +10 -17
- package/user-creation/src/widgets/user-creation-wizard/components/user-details-step/user-details-step.component.d.ts +7 -83
- package/user-creation/src/widgets/user-creation-wizard/components/user-template-step/user-template-step.component.d.ts +4 -11
- package/user-creation/src/widgets/user-creation-wizard/user-creation-wizard.component.d.ts +0 -18
- package/user-creation/src/widgets/user-creation-wizard/user-creation-wizard.service.d.ts +56 -71
- package/esm2020/user-creation/src/classes/notification.mjs +0 -32
- package/esm2020/user-creation/src/environments/environment.mjs +0 -11
- package/esm2020/user-creation/src/interfaces/user-creation-wizard.interfaces.mjs +0 -19
- package/esm2020/user-creation/src/shared/components/notification/notification.component.mjs +0 -38
- package/esm2020/user-creation/src/shared/pipes/truncate.pipe.mjs +0 -30
- package/esm2020/user-creation/src/shared/services/notification.service.mjs +0 -62
- package/esm2020/user-creation/src/utils/app-loader/app-loader.mjs +0 -14
- package/esm2020/user-creation/src/utils/build-savable-end-user.mjs +0 -147
- package/esm2020/user-creation/src/utils/device-name-validation.mjs +0 -23
- package/esm2020/user-creation/src/utils/parse-device-name-rule.mjs +0 -26
- package/user-creation/src/classes/notification.d.ts +0 -18
- package/user-creation/src/environments/environment.d.ts +0 -9
- package/user-creation/src/interfaces/user-creation-wizard.interfaces.d.ts +0 -502
- package/user-creation/src/shared/components/notification/notification.component.d.ts +0 -19
- package/user-creation/src/shared/pipes/truncate.pipe.d.ts +0 -7
- package/user-creation/src/shared/services/notification.service.d.ts +0 -18
- package/user-creation/src/utils/app-loader/app-loader.d.ts +0 -6
- package/user-creation/src/utils/build-savable-end-user.d.ts +0 -23
- package/user-creation/src/utils/device-name-validation.d.ts +0 -6
- package/user-creation/src/utils/parse-device-name-rule.d.ts +0 -8
|
@@ -1,236 +1,34 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as i4 from '@angular/common';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable,
|
|
5
|
-
import * as
|
|
6
|
-
import {
|
|
7
|
-
import * as
|
|
4
|
+
import { NgModule, Injectable, inject, Component, Input, EventEmitter, ViewEncapsulation, Output } from '@angular/core';
|
|
5
|
+
import * as i3$1 from '@angular/forms';
|
|
6
|
+
import { FormBuilder, Validators, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import * as i9 from '@angular/material/expansion';
|
|
8
8
|
import { MatExpansionModule } from '@angular/material/expansion';
|
|
9
9
|
import { MatRadioModule } from '@angular/material/radio';
|
|
10
|
-
import * as
|
|
10
|
+
import * as i3$2 from '@angular/material/stepper';
|
|
11
11
|
import { MatStepperModule } from '@angular/material/stepper';
|
|
12
|
-
import { Subject, BehaviorSubject, tap, forkJoin, map, switchMap, of, catchError, takeUntil, take, finalize, startWith, debounceTime, timer, filter, distinctUntilChanged } from 'rxjs';
|
|
13
|
-
import * as i3 from '@angular/material/button';
|
|
14
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
15
12
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
16
|
-
import * as
|
|
13
|
+
import * as i3 from '@angular/material/table';
|
|
17
14
|
import { MatTableModule } from '@angular/material/table';
|
|
18
15
|
import * as i5$1 from '@angular/material/tooltip';
|
|
19
16
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
20
17
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
21
|
-
import * as
|
|
18
|
+
import * as i4$1 from '@angular/material/button';
|
|
19
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
22
20
|
import { MatIconModule } from '@angular/material/icon';
|
|
23
|
-
import * as
|
|
21
|
+
import * as i5 from '@angular/material/form-field';
|
|
24
22
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
25
|
-
import * as
|
|
23
|
+
import * as i6 from '@angular/material/input';
|
|
26
24
|
import { MatInputModule } from '@angular/material/input';
|
|
27
|
-
import * as i7
|
|
25
|
+
import * as i7 from '@angular/material/select';
|
|
28
26
|
import { MatSelectModule } from '@angular/material/select';
|
|
29
|
-
import
|
|
30
|
-
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
31
|
-
import * as i1$1 from '@angular/material/progress-spinner';
|
|
32
|
-
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
33
|
-
import * as i13 from '@angular/material/paginator';
|
|
34
|
-
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
35
|
-
import * as i14 from '@angular/material/chips';
|
|
36
|
-
import { MatChipsModule } from '@angular/material/chips';
|
|
27
|
+
import { BehaviorSubject, tap, forkJoin, map, Subject, takeUntil, startWith, switchMap, filter, of } from 'rxjs';
|
|
37
28
|
import * as i1 from '@angular/common/http';
|
|
38
|
-
import { HttpHeaders, HttpClientModule
|
|
29
|
+
import { HttpHeaders, HttpClientModule } from '@angular/common/http';
|
|
39
30
|
import { NgApexchartsModule } from 'ng-apexcharts';
|
|
40
|
-
import
|
|
41
|
-
import * as i11 from '@angular/material/core';
|
|
42
|
-
import * as i1$3 from '@ngx-translate/core';
|
|
43
|
-
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
|
44
|
-
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
|
45
|
-
|
|
46
|
-
const environment = {
|
|
47
|
-
production: false,
|
|
48
|
-
// apiUrl: 'http://localhost:4200',
|
|
49
|
-
apiUrl: 'http://192.168.0.191:8080',
|
|
50
|
-
notificationsLifetime: 30000,
|
|
51
|
-
longNotificationsLifetime: 45000,
|
|
52
|
-
cashCleanTimer: 900000,
|
|
53
|
-
cashArrayLength: 10000,
|
|
54
|
-
matomoUrl: 'http://192.168.0.136/matomo/',
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const TTL_DEFAULT = environment.notificationsLifetime;
|
|
58
|
-
const TTL_LONG_DEFAULT = environment.longNotificationsLifetime;
|
|
59
|
-
var NotificationType;
|
|
60
|
-
(function (NotificationType) {
|
|
61
|
-
NotificationType["info"] = "info";
|
|
62
|
-
NotificationType["error"] = "error";
|
|
63
|
-
NotificationType["success"] = "success";
|
|
64
|
-
NotificationType["warning"] = "warning";
|
|
65
|
-
})(NotificationType || (NotificationType = {}));
|
|
66
|
-
class Notification {
|
|
67
|
-
constructor(data) {
|
|
68
|
-
this.ttl = TTL_DEFAULT;
|
|
69
|
-
Object.assign(this, data || {});
|
|
70
|
-
if (this.ttl === undefined) {
|
|
71
|
-
this.ttl = this.message && this.message.length && this.message.length < 80 ? TTL_DEFAULT : TTL_LONG_DEFAULT;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
isInfo() {
|
|
75
|
-
return this.type === NotificationType.info;
|
|
76
|
-
}
|
|
77
|
-
isError() {
|
|
78
|
-
return this.type === NotificationType.error;
|
|
79
|
-
}
|
|
80
|
-
isSuccess() {
|
|
81
|
-
return this.type === NotificationType.success;
|
|
82
|
-
}
|
|
83
|
-
isWarning() {
|
|
84
|
-
return this.type === NotificationType.warning;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const SUCCESS_TIME = 5000;
|
|
89
|
-
const INACTIVE_SESSION_MESSAGE = 'Your session was lost due to inactivity. Please login again';
|
|
90
|
-
const INACTIVE_SESSION = 'SESSION_INACTIVE';
|
|
91
|
-
class NotificationService {
|
|
92
|
-
constructor() {
|
|
93
|
-
this.listChange = new Subject();
|
|
94
|
-
this.max = 0;
|
|
95
|
-
this.list = [];
|
|
96
|
-
}
|
|
97
|
-
error(message, ttl) {
|
|
98
|
-
this.notify('error', message, ttl);
|
|
99
|
-
}
|
|
100
|
-
success(message, ttl) {
|
|
101
|
-
this.notify('success', message, (!ttl) ? SUCCESS_TIME : ttl);
|
|
102
|
-
}
|
|
103
|
-
warning(message, ttl) {
|
|
104
|
-
this.notify('warning', message, ttl);
|
|
105
|
-
}
|
|
106
|
-
info(message, ttl) {
|
|
107
|
-
this.notify('info', message, ttl);
|
|
108
|
-
}
|
|
109
|
-
notify(type, message, ttl) {
|
|
110
|
-
const found = this.list.find((n) => n.message === message);
|
|
111
|
-
if (found) {
|
|
112
|
-
this.remove(found);
|
|
113
|
-
}
|
|
114
|
-
const notification = new Notification({
|
|
115
|
-
id: ++this.max,
|
|
116
|
-
type, message, ttl
|
|
117
|
-
});
|
|
118
|
-
if (notification.ttl > 0) {
|
|
119
|
-
notification.timerId = setTimeout(() => this.remove(notification, true), notification.ttl);
|
|
120
|
-
}
|
|
121
|
-
this.list.push(notification);
|
|
122
|
-
this.listChange.next(this.list);
|
|
123
|
-
}
|
|
124
|
-
remove(notification, auto) {
|
|
125
|
-
if (!auto && notification.timerId) {
|
|
126
|
-
// clear timeout in case of manual remove
|
|
127
|
-
clearInterval(notification.timerId);
|
|
128
|
-
}
|
|
129
|
-
this.list = this.list.filter(n => n.id !== notification.id);
|
|
130
|
-
this.listChange.next(this.list);
|
|
131
|
-
}
|
|
132
|
-
removeInactiveSessionError() {
|
|
133
|
-
if (!this.list || !this.list.length) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
this.list = this.list.filter(n => n.message !== INACTIVE_SESSION_MESSAGE && n.message !== INACTIVE_SESSION);
|
|
137
|
-
this.listChange.next(this.list);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
NotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
141
|
-
NotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService });
|
|
142
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService, decorators: [{
|
|
143
|
-
type: Injectable
|
|
144
|
-
}], ctorParameters: function () { return []; } });
|
|
145
|
-
|
|
146
|
-
const API = {
|
|
147
|
-
WEBEX_CHECK_CONTROL_HUB_INTEGRATION: "/webex/api/search/webex/customers/:customerId/controlhubexists",
|
|
148
|
-
SITES: "/dcp/api/customers/:customerId/sites",
|
|
149
|
-
SITE: "/dcp/api/sites/:siteId",
|
|
150
|
-
DEVICE_TYPES: "/dcp/api/provision/options/:siteId/devicetypes",
|
|
151
|
-
SITE_SETTINGS: "/dcp/api/sites/:siteId/settings",
|
|
152
|
-
VM_USER_TEMPLATES: "/dcp/api/provision/options/:siteId/vmusertemplates",
|
|
153
|
-
EXISTING_USERS: "/dcp/api/provision/:siteId/users",
|
|
154
|
-
USER_TEMPLATES_UPLOAD_LIST: "/dcp/api/searchbulkupdate/uploadedusertemplatelist",
|
|
155
|
-
USER_TEMPLATE_TOKEN: "/dcp/api/bulkupdate/:customerId/usertemplate/:id/token",
|
|
156
|
-
AVAILABLE_DN_IN_RANGES: "/dcp/api/sites/:siteId/available-dn-in-ranges",
|
|
157
|
-
USER_CHECK_ID_EXISTING: "/dcp/api/provision/:siteId/users/:userId",
|
|
158
|
-
LDAP_USERS: "/dcp/api/provision/:siteId/users",
|
|
159
|
-
USERS: "/dcp/api/provision/:siteId/users",
|
|
160
|
-
CREATE_NEW_USER_FROM_TEMPLATE: "/dcp/api/provision/newUserFromUserTemplate",
|
|
161
|
-
DEVICE_DEFAULTS: "/api/provision/options/:siteId/devicedefaults/:deviceType",
|
|
162
|
-
};
|
|
163
|
-
const USER_CREATION_TYPES = {
|
|
164
|
-
CUCM: 'CUCM',
|
|
165
|
-
MT: 'MT'
|
|
166
|
-
};
|
|
167
|
-
const MAX_INTEGER = 2147483647;
|
|
168
|
-
const CUTTING_SYMBOLS = [
|
|
169
|
-
" ",
|
|
170
|
-
"_",
|
|
171
|
-
"-"
|
|
172
|
-
];
|
|
173
|
-
const BREADCRUMB_LENGTH_LIMIT = 20;
|
|
174
|
-
const DEFAULT_CUTTING_LENGTH = 15;
|
|
175
|
-
|
|
176
|
-
class TruncatePipe {
|
|
177
|
-
transform(value, args) {
|
|
178
|
-
if (!value) {
|
|
179
|
-
return '';
|
|
180
|
-
}
|
|
181
|
-
if (args) {
|
|
182
|
-
const limit = args.length > 0 ? parseInt(args[0], 10) : 20;
|
|
183
|
-
const trail = args.length > 1 ? args[1] : '...';
|
|
184
|
-
return value.length > limit ? value.substring(0, limit) + trail : value;
|
|
185
|
-
}
|
|
186
|
-
if (value.length <= BREADCRUMB_LENGTH_LIMIT) {
|
|
187
|
-
return value;
|
|
188
|
-
}
|
|
189
|
-
const foundSymbol = CUTTING_SYMBOLS.find((symbol) => value.includes(symbol, DEFAULT_CUTTING_LENGTH));
|
|
190
|
-
const cutIndex = foundSymbol ? value.indexOf(foundSymbol, DEFAULT_CUTTING_LENGTH) : BREADCRUMB_LENGTH_LIMIT;
|
|
191
|
-
return value.substring(0, cutIndex) + '...';
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
TruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
195
|
-
TruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: TruncatePipe, name: "truncate" });
|
|
196
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TruncatePipe, decorators: [{
|
|
197
|
-
type: Pipe,
|
|
198
|
-
args: [{
|
|
199
|
-
name: 'truncate'
|
|
200
|
-
}]
|
|
201
|
-
}] });
|
|
202
|
-
|
|
203
|
-
class NotificationsComponent {
|
|
204
|
-
constructor(notificationService, ref) {
|
|
205
|
-
this.notificationService = notificationService;
|
|
206
|
-
this.ref = ref;
|
|
207
|
-
}
|
|
208
|
-
ngOnInit() {
|
|
209
|
-
this.listChangeSubscribe();
|
|
210
|
-
}
|
|
211
|
-
ngOnDestroy() {
|
|
212
|
-
this.listSubscription.unsubscribe();
|
|
213
|
-
}
|
|
214
|
-
readMore() {
|
|
215
|
-
this.isReadMore = !this.isReadMore;
|
|
216
|
-
}
|
|
217
|
-
removeNotification(notification) {
|
|
218
|
-
this.notificationService.remove(notification);
|
|
219
|
-
}
|
|
220
|
-
listChangeSubscribe() {
|
|
221
|
-
this.listSubscription = this.notificationService.listChange
|
|
222
|
-
.subscribe((list) => {
|
|
223
|
-
this.list = list;
|
|
224
|
-
this.ref.detectChanges();
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
NotificationsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationsComponent, deps: [{ token: NotificationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
229
|
-
NotificationsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: NotificationsComponent, selector: "app-notification", ngImport: i0, template: "\n\n<div class=\"notification-block\" role=\"alert\" aria-live=\"assertive\">\n <div class=\"notification\"\n *ngFor=\"let notification of list\"\n [ngClass]=\"{'error': notification.isError(), 'success': notification.isSuccess()}\">\n\n <div class=\"flex-box\">\n <div class=\"notification-icons-block\">\n <i *ngIf=\"notification.isError()\" class=\"fa fa-exclamation-triangle\"></i>\n <i *ngIf=\"notification.isWarning()\" class=\"fa fa-hand-paper-o\"></i>\n <i *ngIf=\"notification.isSuccess()\" class=\"fa fa-check\"></i>\n <i *ngIf=\"notification.isInfo()\" class=\"fa fa-info-circle\"></i>\n </div>\n <div *ngIf=\"!isReadMore\" class=\"message-block\">\n {{notification.message | truncate:[93]}}\n </div>\n <div *ngIf=\"isReadMore\" class=\"message-block\">\n {{notification.message}}\n </div>\n </div>\n <div class=\"read-more-error link clickable\" *ngIf=\"notification.message && notification.message.length > 93\"\n (click)=\"readMore()\">{{(isReadMore ? 'Collapse' : 'Read More')}}</div>\n <button\n class=\"close\"\n mat-icon-button\n (click)=\"removeNotification(notification)\">\n <img class=\"notification-icon-close\" src=\"assets/icons/close_icon_modal.svg\" alt=\"\">\n </button>\n </div>\n</div>\n\n", styles: ["@import\"https://fonts.googleapis.com/css?family=Poppins:400,100,200,300,500,600,800,700,900\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap\";.notification-block{right:10px;top:80px;position:absolute;z-index:100}.notification-block .read-more-error{margin:10px 13px 3px 0;text-align:right}.notification-block .notification{padding:15px 0 10px 10px;margin-bottom:18px;color:#333;border-radius:3px;border-top:1.5px solid #e5e1cd;background:#fcf8e3;box-shadow:0 8px 12px #091e4226,0 0 1px #091e424f;width:368px;position:relative}.notification-block .notification .message-block{font-size:14px;font-family:Poppins,Poppins,sans-serif!important;word-break:break-word;width:270px}.notification-block .notification .notification-icon-close{height:24px}.notification-block .notification.error{background:#FFE9E9;border-top:1.5px solid #E16D6D}.notification-block .notification.success{background:#e3f4dc;border-top:1.5px solid #b3d692}.notification-block .notification .fa-exclamation-triangle{color:#e16d6d!important}.notification-block .notification .fa-check{color:#a0c37f!important}.notification-block .notification .fa-info-circle,.notification-block .notification .fa-hand-paper-o{color:#bdb89e!important}.notification-block .notification .fa{font-size:20px}.notification-block .notification .close{position:absolute;top:2px;right:-5px}.notification-block .notification .close .fa{font-size:14px}.notification-block .notification .fa{margin:0;color:inherit}@media screen and (max-width: 600px){.notification-block{width:50%;min-width:150px}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: TruncatePipe, name: "truncate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
230
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationsComponent, decorators: [{
|
|
231
|
-
type: Component,
|
|
232
|
-
args: [{ selector: 'app-notification', changeDetection: ChangeDetectionStrategy.OnPush, template: "\n\n<div class=\"notification-block\" role=\"alert\" aria-live=\"assertive\">\n <div class=\"notification\"\n *ngFor=\"let notification of list\"\n [ngClass]=\"{'error': notification.isError(), 'success': notification.isSuccess()}\">\n\n <div class=\"flex-box\">\n <div class=\"notification-icons-block\">\n <i *ngIf=\"notification.isError()\" class=\"fa fa-exclamation-triangle\"></i>\n <i *ngIf=\"notification.isWarning()\" class=\"fa fa-hand-paper-o\"></i>\n <i *ngIf=\"notification.isSuccess()\" class=\"fa fa-check\"></i>\n <i *ngIf=\"notification.isInfo()\" class=\"fa fa-info-circle\"></i>\n </div>\n <div *ngIf=\"!isReadMore\" class=\"message-block\">\n {{notification.message | truncate:[93]}}\n </div>\n <div *ngIf=\"isReadMore\" class=\"message-block\">\n {{notification.message}}\n </div>\n </div>\n <div class=\"read-more-error link clickable\" *ngIf=\"notification.message && notification.message.length > 93\"\n (click)=\"readMore()\">{{(isReadMore ? 'Collapse' : 'Read More')}}</div>\n <button\n class=\"close\"\n mat-icon-button\n (click)=\"removeNotification(notification)\">\n <img class=\"notification-icon-close\" src=\"assets/icons/close_icon_modal.svg\" alt=\"\">\n </button>\n </div>\n</div>\n\n", styles: ["@import\"https://fonts.googleapis.com/css?family=Poppins:400,100,200,300,500,600,800,700,900\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap\";.notification-block{right:10px;top:80px;position:absolute;z-index:100}.notification-block .read-more-error{margin:10px 13px 3px 0;text-align:right}.notification-block .notification{padding:15px 0 10px 10px;margin-bottom:18px;color:#333;border-radius:3px;border-top:1.5px solid #e5e1cd;background:#fcf8e3;box-shadow:0 8px 12px #091e4226,0 0 1px #091e424f;width:368px;position:relative}.notification-block .notification .message-block{font-size:14px;font-family:Poppins,Poppins,sans-serif!important;word-break:break-word;width:270px}.notification-block .notification .notification-icon-close{height:24px}.notification-block .notification.error{background:#FFE9E9;border-top:1.5px solid #E16D6D}.notification-block .notification.success{background:#e3f4dc;border-top:1.5px solid #b3d692}.notification-block .notification .fa-exclamation-triangle{color:#e16d6d!important}.notification-block .notification .fa-check{color:#a0c37f!important}.notification-block .notification .fa-info-circle,.notification-block .notification .fa-hand-paper-o{color:#bdb89e!important}.notification-block .notification .fa{font-size:20px}.notification-block .notification .close{position:absolute;top:2px;right:-5px}.notification-block .notification .close .fa{font-size:14px}.notification-block .notification .fa{margin:0;color:inherit}@media screen and (max-width: 600px){.notification-block{width:50%;min-width:150px}}\n"] }]
|
|
233
|
-
}], ctorParameters: function () { return [{ type: NotificationService }, { type: i0.ChangeDetectorRef }]; } });
|
|
31
|
+
import * as i8 from '@angular/material/core';
|
|
234
32
|
|
|
235
33
|
class MaterialModule {
|
|
236
34
|
}
|
|
@@ -243,11 +41,7 @@ MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
243
41
|
MatIconModule,
|
|
244
42
|
MatFormFieldModule,
|
|
245
43
|
MatInputModule,
|
|
246
|
-
MatSelectModule,
|
|
247
|
-
MatAutocompleteModule,
|
|
248
|
-
MatProgressSpinnerModule,
|
|
249
|
-
MatPaginatorModule,
|
|
250
|
-
MatChipsModule], exports: [MatProgressBarModule,
|
|
44
|
+
MatSelectModule], exports: [MatProgressBarModule,
|
|
251
45
|
MatTooltipModule,
|
|
252
46
|
MatTableModule,
|
|
253
47
|
MatCheckboxModule,
|
|
@@ -255,11 +49,7 @@ MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
255
49
|
MatIconModule,
|
|
256
50
|
MatFormFieldModule,
|
|
257
51
|
MatInputModule,
|
|
258
|
-
MatSelectModule
|
|
259
|
-
MatAutocompleteModule,
|
|
260
|
-
MatProgressSpinnerModule,
|
|
261
|
-
MatPaginatorModule,
|
|
262
|
-
MatChipsModule] });
|
|
52
|
+
MatSelectModule] });
|
|
263
53
|
MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, imports: [MatProgressBarModule,
|
|
264
54
|
MatTooltipModule,
|
|
265
55
|
MatTableModule,
|
|
@@ -268,11 +58,7 @@ MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
|
|
|
268
58
|
MatIconModule,
|
|
269
59
|
MatFormFieldModule,
|
|
270
60
|
MatInputModule,
|
|
271
|
-
MatSelectModule,
|
|
272
|
-
MatAutocompleteModule,
|
|
273
|
-
MatProgressSpinnerModule,
|
|
274
|
-
MatPaginatorModule,
|
|
275
|
-
MatChipsModule, MatProgressBarModule,
|
|
61
|
+
MatSelectModule, MatProgressBarModule,
|
|
276
62
|
MatTooltipModule,
|
|
277
63
|
MatTableModule,
|
|
278
64
|
MatCheckboxModule,
|
|
@@ -280,11 +66,7 @@ MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version:
|
|
|
280
66
|
MatIconModule,
|
|
281
67
|
MatFormFieldModule,
|
|
282
68
|
MatInputModule,
|
|
283
|
-
MatSelectModule
|
|
284
|
-
MatAutocompleteModule,
|
|
285
|
-
MatProgressSpinnerModule,
|
|
286
|
-
MatPaginatorModule,
|
|
287
|
-
MatChipsModule] });
|
|
69
|
+
MatSelectModule] });
|
|
288
70
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, decorators: [{
|
|
289
71
|
type: NgModule,
|
|
290
72
|
args: [{
|
|
@@ -297,11 +79,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
297
79
|
MatIconModule,
|
|
298
80
|
MatFormFieldModule,
|
|
299
81
|
MatInputModule,
|
|
300
|
-
MatSelectModule
|
|
301
|
-
MatAutocompleteModule,
|
|
302
|
-
MatProgressSpinnerModule,
|
|
303
|
-
MatPaginatorModule,
|
|
304
|
-
MatChipsModule,
|
|
82
|
+
MatSelectModule
|
|
305
83
|
],
|
|
306
84
|
exports: [
|
|
307
85
|
MatProgressBarModule,
|
|
@@ -312,15 +90,97 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
312
90
|
MatIconModule,
|
|
313
91
|
MatFormFieldModule,
|
|
314
92
|
MatInputModule,
|
|
315
|
-
MatSelectModule
|
|
316
|
-
MatAutocompleteModule,
|
|
317
|
-
MatProgressSpinnerModule,
|
|
318
|
-
MatPaginatorModule,
|
|
319
|
-
MatChipsModule,
|
|
93
|
+
MatSelectModule
|
|
320
94
|
]
|
|
321
95
|
}]
|
|
322
96
|
}] });
|
|
323
97
|
|
|
98
|
+
const getSavableData = (model, exclude) => {
|
|
99
|
+
let result = Object.keys(model);
|
|
100
|
+
if (exclude && exclude.length) {
|
|
101
|
+
result = result.filter(key => !exclude.some(item => item === key));
|
|
102
|
+
}
|
|
103
|
+
return result.reduce((result, key) => {
|
|
104
|
+
if (model[key] instanceof Array && model[key].length && model[key][0].getSavableData) {
|
|
105
|
+
result[key] = model[key].map((item) => item.getSavableData());
|
|
106
|
+
}
|
|
107
|
+
else if (model[key] instanceof Object && model[key].getSavableData) {
|
|
108
|
+
result[key] = model[key].getSavableData();
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
result[key] = model[key];
|
|
112
|
+
}
|
|
113
|
+
return result;
|
|
114
|
+
}, {});
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
class Site {
|
|
118
|
+
constructor(site) {
|
|
119
|
+
Object.assign(this, site);
|
|
120
|
+
this.initForm();
|
|
121
|
+
}
|
|
122
|
+
initForm() {
|
|
123
|
+
const formBuilder = new FormBuilder();
|
|
124
|
+
const formSettings = {
|
|
125
|
+
name: [this.name || '', [Validators.required]],
|
|
126
|
+
shortName: [this.shortName || '', [Validators.required]],
|
|
127
|
+
cucm: [this.cucm || ''],
|
|
128
|
+
cuc: [this.cuc || ''],
|
|
129
|
+
address1: [this.address1 || ''],
|
|
130
|
+
zipCode: [this.country || ''],
|
|
131
|
+
city: [this.city || ''],
|
|
132
|
+
state: [this.state || ''],
|
|
133
|
+
country: [this.country || '', [Validators.required]],
|
|
134
|
+
isAfterTtu: [this.isAfterTtu || ''],
|
|
135
|
+
ttuEnableDate: [this.ttuEnableDate || '']
|
|
136
|
+
};
|
|
137
|
+
this.form = formBuilder.group(formSettings);
|
|
138
|
+
}
|
|
139
|
+
getSavableData() {
|
|
140
|
+
const nonSavableData = ['form'];
|
|
141
|
+
return getSavableData(this, nonSavableData);
|
|
142
|
+
}
|
|
143
|
+
getId() {
|
|
144
|
+
return this.id;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
class SiteDefaults {
|
|
148
|
+
constructor(siteDefaults, isSharedLineSite) {
|
|
149
|
+
this.routePartitionFilter = [];
|
|
150
|
+
this.devicePoolFilter = [];
|
|
151
|
+
this.cssFilter = [];
|
|
152
|
+
this.voicemailProfileFilter = [];
|
|
153
|
+
if (siteDefaults) {
|
|
154
|
+
Object.assign(this, siteDefaults);
|
|
155
|
+
this.enableEm = siteDefaults.enableEm === 'true';
|
|
156
|
+
this.routePartitionFilter.sort();
|
|
157
|
+
this.devicePoolFilter.sort();
|
|
158
|
+
this.cssFilter.sort();
|
|
159
|
+
this.voicemailProfileFilter.sort();
|
|
160
|
+
}
|
|
161
|
+
if (isSharedLineSite) {
|
|
162
|
+
this.cssFilter = siteDefaults?.sharedSitesCssFilter || [];
|
|
163
|
+
this.routePartitionFilter = siteDefaults?.sharedSitesRPFilter || [];
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const API = {
|
|
169
|
+
WEBEX_CHECK_CONTROL_HUB_INTEGRATION: "/webex/api/search/webex/customers/:customerId/controlhubexists",
|
|
170
|
+
SITES: "/api/customers/:customerId/sites",
|
|
171
|
+
SITE: "/dcp/api/sites/:siteId",
|
|
172
|
+
DEVICE_TYPES: "/dcp/api/provision/options/:siteId/devicetypes",
|
|
173
|
+
SITE_SETTINGS: "/dcp/api/sites/:siteId/settings",
|
|
174
|
+
VM_USER_TEMPLATES: "/dcp/api/provision/options/:siteId/vmusertemplates",
|
|
175
|
+
USER_TEMPLATES_UPLOAD_LIST: "/dcp/api/searchbulkupdate/uploadedusertemplatelist",
|
|
176
|
+
USER_TEMPLATE_TOKEN: "/dcp/api/bulkupdate/:customerId/usertemplate/:id/token",
|
|
177
|
+
};
|
|
178
|
+
const USER_CREATION_TYPES = {
|
|
179
|
+
CUCM: 'CUCM',
|
|
180
|
+
MT: 'MT'
|
|
181
|
+
};
|
|
182
|
+
const MAX_INTEGER = 2147483647;
|
|
183
|
+
|
|
324
184
|
class APIService {
|
|
325
185
|
constructor(httpClient) {
|
|
326
186
|
this.httpClient = httpClient;
|
|
@@ -398,26 +258,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
398
258
|
}]
|
|
399
259
|
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
400
260
|
|
|
401
|
-
const BERLIN_MT_SITE = {
|
|
402
|
-
address2: "Address 2",
|
|
403
|
-
address3: "Address 3",
|
|
404
|
-
country: "IL",
|
|
405
|
-
cucm: {
|
|
406
|
-
platformType: "CUCM",
|
|
407
|
-
id: 2073,
|
|
408
|
-
name: "DI_220"
|
|
409
|
-
},
|
|
410
|
-
id: 9329,
|
|
411
|
-
name: "Berlin_MT",
|
|
412
|
-
hqStatus: false,
|
|
413
|
-
hasActivated: true,
|
|
414
|
-
isAfterTtu: false,
|
|
415
|
-
prefetchDn: false,
|
|
416
|
-
settings: [],
|
|
417
|
-
shortName: "Berl1758105407",
|
|
418
|
-
state: "",
|
|
419
|
-
timezone: "GMT"
|
|
420
|
-
};
|
|
421
261
|
class UserCreationApiService {
|
|
422
262
|
constructor() {
|
|
423
263
|
this._allSites = [];
|
|
@@ -447,21 +287,32 @@ class UserCreationApiService {
|
|
|
447
287
|
// }
|
|
448
288
|
// this.allCustomerSites$.next(true);
|
|
449
289
|
// return this._allSites;
|
|
450
|
-
this.sitesListSubject$.next(
|
|
290
|
+
this.sitesListSubject$.next(res.pageData);
|
|
451
291
|
}));
|
|
452
292
|
// .pipe(this.handleError(true));
|
|
453
293
|
}
|
|
454
|
-
|
|
294
|
+
getSiteData(siteId) {
|
|
455
295
|
// this.dataPending = true;
|
|
456
296
|
return forkJoin([
|
|
457
297
|
this.getSite(siteId),
|
|
298
|
+
this.getDeviceTypes(siteId),
|
|
458
299
|
this.getSiteDefaults(siteId, false),
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
300
|
+
this.getVoiceMailUserTemplates(siteId)
|
|
301
|
+
]).pipe(tap(() => {
|
|
302
|
+
// this.userFeaturesService.setDefaultUcProfile();
|
|
303
|
+
}));
|
|
462
304
|
}
|
|
463
305
|
getSite(siteId, isEdit) {
|
|
464
|
-
return this.apiService.fetch(API.SITE.replace(':siteId', String(siteId)), null, false)
|
|
306
|
+
return this.apiService.fetch(API.SITE.replace(':siteId', String(siteId)), null, false)
|
|
307
|
+
.pipe(map((siteData) => {
|
|
308
|
+
const site = new Site(siteData);
|
|
309
|
+
// if (isEdit) {
|
|
310
|
+
// this.setEditSite(site);
|
|
311
|
+
// } else {
|
|
312
|
+
// this.setCurrentSite(site);
|
|
313
|
+
// }
|
|
314
|
+
return site;
|
|
315
|
+
}));
|
|
465
316
|
}
|
|
466
317
|
getDeviceTypes(siteId) {
|
|
467
318
|
return this.apiService.fetch(API.DEVICE_TYPES.replace(':siteId', String(siteId)), null, true);
|
|
@@ -505,22 +356,6 @@ class UserCreationApiService {
|
|
|
505
356
|
return this.apiService.fetch(API.USER_TEMPLATE_TOKEN.replace(':customerId', customerId).replace(':id', id));
|
|
506
357
|
// .pipe(this.handleError(false, true));
|
|
507
358
|
}
|
|
508
|
-
getAvailableDnInRanges(siteId, params) {
|
|
509
|
-
return this.apiService.fetch(API.AVAILABLE_DN_IN_RANGES.replace(':siteId', siteId), params);
|
|
510
|
-
}
|
|
511
|
-
getLdapUsers(siteId, params) {
|
|
512
|
-
return this.apiService.fetch(API.LDAP_USERS.replace(':siteId', siteId), params);
|
|
513
|
-
}
|
|
514
|
-
checkUserIdExisting(siteId, userId) {
|
|
515
|
-
return this.apiService.fetch(API.USER_CHECK_ID_EXISTING.replace(':siteId', siteId).replace(':userId', userId));
|
|
516
|
-
}
|
|
517
|
-
saveTemplateUser(user, templateId, siteId) {
|
|
518
|
-
return this.apiService.post(API.CREATE_NEW_USER_FROM_TEMPLATE, user, { siteId: siteId, templateId: templateId });
|
|
519
|
-
}
|
|
520
|
-
getDeviceDefaults(siteId, deviceType) {
|
|
521
|
-
const encodedType = encodeURIComponent(deviceType);
|
|
522
|
-
return this.apiService.fetch(API.DEVICE_DEFAULTS.replace(':siteId', siteId).replace(':deviceType', encodedType));
|
|
523
|
-
}
|
|
524
359
|
}
|
|
525
360
|
UserCreationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
526
361
|
UserCreationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationApiService });
|
|
@@ -534,25 +369,11 @@ SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "1
|
|
|
534
369
|
SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, imports: [CommonModule,
|
|
535
370
|
MaterialModule,
|
|
536
371
|
NgApexchartsModule,
|
|
537
|
-
HttpClientModule,
|
|
538
|
-
ReactiveFormsModule,
|
|
539
|
-
FormsModule], exports: [MaterialModule,
|
|
540
|
-
ReactiveFormsModule,
|
|
541
|
-
FormsModule,
|
|
542
|
-
MatTableModule,
|
|
543
|
-
NgApexchartsModule,
|
|
544
|
-
HttpClientModule] });
|
|
372
|
+
HttpClientModule], exports: [MaterialModule] });
|
|
545
373
|
SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, imports: [CommonModule,
|
|
546
374
|
MaterialModule,
|
|
547
375
|
NgApexchartsModule,
|
|
548
|
-
HttpClientModule,
|
|
549
|
-
ReactiveFormsModule,
|
|
550
|
-
FormsModule, MaterialModule,
|
|
551
|
-
ReactiveFormsModule,
|
|
552
|
-
FormsModule,
|
|
553
|
-
MatTableModule,
|
|
554
|
-
NgApexchartsModule,
|
|
555
|
-
HttpClientModule] });
|
|
376
|
+
HttpClientModule, MaterialModule] });
|
|
556
377
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, decorators: [{
|
|
557
378
|
type: NgModule,
|
|
558
379
|
args: [{
|
|
@@ -562,329 +383,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
562
383
|
MaterialModule,
|
|
563
384
|
NgApexchartsModule,
|
|
564
385
|
HttpClientModule,
|
|
565
|
-
ReactiveFormsModule,
|
|
566
|
-
FormsModule,
|
|
567
386
|
],
|
|
568
387
|
exports: [
|
|
569
|
-
MaterialModule
|
|
570
|
-
ReactiveFormsModule,
|
|
571
|
-
FormsModule,
|
|
572
|
-
MatTableModule,
|
|
573
|
-
NgApexchartsModule,
|
|
574
|
-
HttpClientModule,
|
|
388
|
+
MaterialModule
|
|
575
389
|
]
|
|
576
390
|
}]
|
|
577
391
|
}] });
|
|
578
392
|
|
|
579
|
-
function deviceNameValidator(options) {
|
|
580
|
-
return (control) => {
|
|
581
|
-
const raw = String(control.value ?? '').trim();
|
|
582
|
-
if (!raw || !options.regex?.trim()) {
|
|
583
|
-
return null;
|
|
584
|
-
}
|
|
585
|
-
try {
|
|
586
|
-
const rule = new RegExp(`^(?:${options.regex})$`);
|
|
587
|
-
if (!rule.test(raw)) {
|
|
588
|
-
return {
|
|
589
|
-
deviceName: {
|
|
590
|
-
caption: options.caption || options.regex,
|
|
591
|
-
},
|
|
592
|
-
};
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
catch {
|
|
596
|
-
return null;
|
|
597
|
-
}
|
|
598
|
-
return null;
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
const getSavableData = (model, exclude) => {
|
|
603
|
-
let result = Object.keys(model);
|
|
604
|
-
if (exclude && exclude.length) {
|
|
605
|
-
result = result.filter(key => !exclude.some(item => item === key));
|
|
606
|
-
}
|
|
607
|
-
return result.reduce((result, key) => {
|
|
608
|
-
if (model[key] instanceof Array && model[key].length && model[key][0].getSavableData) {
|
|
609
|
-
result[key] = model[key].map((item) => item.getSavableData());
|
|
610
|
-
}
|
|
611
|
-
else if (model[key] instanceof Object && model[key].getSavableData) {
|
|
612
|
-
result[key] = model[key].getSavableData();
|
|
613
|
-
}
|
|
614
|
-
else {
|
|
615
|
-
result[key] = model[key];
|
|
616
|
-
}
|
|
617
|
-
return result;
|
|
618
|
-
}, {});
|
|
619
|
-
};
|
|
620
|
-
|
|
621
|
-
class Site {
|
|
622
|
-
constructor(site) {
|
|
623
|
-
Object.assign(this, site);
|
|
624
|
-
this.initForm();
|
|
625
|
-
}
|
|
626
|
-
initForm() {
|
|
627
|
-
const formBuilder = new FormBuilder();
|
|
628
|
-
const formSettings = {
|
|
629
|
-
name: [this.name || '', [Validators.required]],
|
|
630
|
-
shortName: [this.shortName || '', [Validators.required]],
|
|
631
|
-
cucm: [this.cucm || ''],
|
|
632
|
-
cuc: [this.cuc || ''],
|
|
633
|
-
address1: [this.address1 || ''],
|
|
634
|
-
zipCode: [this.country || ''],
|
|
635
|
-
city: [this.city || ''],
|
|
636
|
-
state: [this.state || ''],
|
|
637
|
-
country: [this.country || '', [Validators.required]],
|
|
638
|
-
isAfterTtu: [this.isAfterTtu || ''],
|
|
639
|
-
ttuEnableDate: [this.ttuEnableDate || '']
|
|
640
|
-
};
|
|
641
|
-
this.form = formBuilder.group(formSettings);
|
|
642
|
-
}
|
|
643
|
-
getSavableData() {
|
|
644
|
-
const nonSavableData = ['form'];
|
|
645
|
-
return getSavableData(this, nonSavableData);
|
|
646
|
-
}
|
|
647
|
-
getId() {
|
|
648
|
-
return this.id;
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
class SiteDefaults {
|
|
652
|
-
constructor(siteDefaults, isSharedLineSite) {
|
|
653
|
-
this.routePartitionFilter = [];
|
|
654
|
-
this.devicePoolFilter = [];
|
|
655
|
-
this.cssFilter = [];
|
|
656
|
-
this.voicemailProfileFilter = [];
|
|
657
|
-
if (siteDefaults) {
|
|
658
|
-
Object.assign(this, siteDefaults);
|
|
659
|
-
this.enableEm = siteDefaults.enableEm === 'true';
|
|
660
|
-
this.routePartitionFilter.sort();
|
|
661
|
-
this.devicePoolFilter.sort();
|
|
662
|
-
this.cssFilter.sort();
|
|
663
|
-
this.voicemailProfileFilter.sort();
|
|
664
|
-
}
|
|
665
|
-
if (isSharedLineSite) {
|
|
666
|
-
this.cssFilter = siteDefaults?.sharedSitesCssFilter || [];
|
|
667
|
-
this.routePartitionFilter = siteDefaults?.sharedSitesRPFilter || [];
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
var DnRangeType;
|
|
673
|
-
(function (DnRangeType) {
|
|
674
|
-
DnRangeType["extension"] = "EXTENSION";
|
|
675
|
-
DnRangeType["cpg"] = "CPG";
|
|
676
|
-
DnRangeType["callpark"] = "CALLPARK";
|
|
677
|
-
DnRangeType["huntgroup"] = "HUNTGROUP";
|
|
678
|
-
DnRangeType["meetme"] = "MEETME";
|
|
679
|
-
DnRangeType["did"] = "DID";
|
|
680
|
-
})(DnRangeType || (DnRangeType = {}));
|
|
681
|
-
var UserViewType;
|
|
682
|
-
(function (UserViewType) {
|
|
683
|
-
UserViewType[UserViewType["details"] = 0] = "details";
|
|
684
|
-
UserViewType[UserViewType["devices"] = 1] = "devices";
|
|
685
|
-
UserViewType[UserViewType["lines"] = 2] = "lines";
|
|
686
|
-
UserViewType[UserViewType["snr"] = 3] = "snr";
|
|
687
|
-
UserViewType[UserViewType["features"] = 4] = "features";
|
|
688
|
-
UserViewType[UserViewType["overview"] = 5] = "overview";
|
|
689
|
-
})(UserViewType || (UserViewType = {}));
|
|
690
|
-
|
|
691
|
-
const ENTITY_CHANGE_TYPE = {
|
|
692
|
-
ADDED: 'added',
|
|
693
|
-
UPDATED: 'updated',
|
|
694
|
-
EXISTING: 'existing',
|
|
695
|
-
REMOVED: 'removed',
|
|
696
|
-
};
|
|
697
|
-
function deepClone(value) {
|
|
698
|
-
return JSON.parse(JSON.stringify(value));
|
|
699
|
-
}
|
|
700
|
-
function toApiBooleanString(value) {
|
|
701
|
-
if (value === true || value === 'true') {
|
|
702
|
-
return 'true';
|
|
703
|
-
}
|
|
704
|
-
if (value === false || value === 'false') {
|
|
705
|
-
return 'false';
|
|
706
|
-
}
|
|
707
|
-
return value == null || value === '' ? '' : String(value);
|
|
708
|
-
}
|
|
709
|
-
function toApiStringValue(value) {
|
|
710
|
-
if (value === true) {
|
|
711
|
-
return 'true';
|
|
712
|
-
}
|
|
713
|
-
if (value === false) {
|
|
714
|
-
return 'false';
|
|
715
|
-
}
|
|
716
|
-
return value == null ? '' : String(value);
|
|
717
|
-
}
|
|
718
|
-
function normalizeCallInfoDisplay(callInfoDisplay) {
|
|
719
|
-
if (!callInfoDisplay) {
|
|
720
|
-
return null;
|
|
721
|
-
}
|
|
722
|
-
if (typeof callInfoDisplay === 'string') {
|
|
723
|
-
try {
|
|
724
|
-
const parsed = JSON.parse(callInfoDisplay);
|
|
725
|
-
return normalizeCallInfoDisplay(parsed);
|
|
726
|
-
}
|
|
727
|
-
catch {
|
|
728
|
-
return null;
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
if (typeof callInfoDisplay !== 'object') {
|
|
732
|
-
return null;
|
|
733
|
-
}
|
|
734
|
-
const source = callInfoDisplay;
|
|
735
|
-
return {
|
|
736
|
-
callerName: source['callerName'] != null ? toApiBooleanString(source['callerName']) : null,
|
|
737
|
-
callerNumber: source['callerNumber'] != null ? toApiBooleanString(source['callerNumber']) : null,
|
|
738
|
-
redirectedNumber: source['redirectedNumber'] != null ? toApiBooleanString(source['redirectedNumber']) : null,
|
|
739
|
-
dialedNumber: source['dialedNumber'] != null ? toApiBooleanString(source['dialedNumber']) : null,
|
|
740
|
-
};
|
|
741
|
-
}
|
|
742
|
-
function normalizeDidPattern(didPattern, line, directoryNumber) {
|
|
743
|
-
if (didPattern && typeof didPattern === 'object') {
|
|
744
|
-
return didPattern;
|
|
745
|
-
}
|
|
746
|
-
if (typeof didPattern === 'string' && didPattern.trim()) {
|
|
747
|
-
return { calledPartyTransformationMask: didPattern };
|
|
748
|
-
}
|
|
749
|
-
const dn = directoryNumber || line?.directoryNumber?.directoryNumber;
|
|
750
|
-
if (dn) {
|
|
751
|
-
return { calledPartyTransformationMask: dn };
|
|
752
|
-
}
|
|
753
|
-
return null;
|
|
754
|
-
}
|
|
755
|
-
function normalizeDirectoryNumber(directoryNumber) {
|
|
756
|
-
const { displayValue: _displayValue, ...rest } = directoryNumber;
|
|
757
|
-
return {
|
|
758
|
-
directoryNumber: rest.directoryNumber ?? '',
|
|
759
|
-
routePartitionName: rest.routePartitionName ?? '',
|
|
760
|
-
templateDirectoryNumber: rest.templateDirectoryNumber,
|
|
761
|
-
pkid: rest.pkid || null,
|
|
762
|
-
dnType: rest.dnType || null,
|
|
763
|
-
subType: rest.subType ?? null,
|
|
764
|
-
};
|
|
765
|
-
}
|
|
766
|
-
function prepareLineAssociation(association, line) {
|
|
767
|
-
const prepared = deepClone(association);
|
|
768
|
-
const lineDn = line?.directoryNumber;
|
|
769
|
-
if (lineDn) {
|
|
770
|
-
prepared.directoryNumber = {
|
|
771
|
-
...prepared.directoryNumber,
|
|
772
|
-
directoryNumber: lineDn.directoryNumber || '',
|
|
773
|
-
routePartitionName: lineDn.routePartitionName || '',
|
|
774
|
-
templateDirectoryNumber: lineDn.templateDirectoryNumber ??
|
|
775
|
-
prepared.directoryNumber?.templateDirectoryNumber,
|
|
776
|
-
};
|
|
777
|
-
}
|
|
778
|
-
prepared.directoryNumber = normalizeDirectoryNumber(prepared.directoryNumber);
|
|
779
|
-
prepared.entityChangeType = prepared.entityChangeType || ENTITY_CHANGE_TYPE.ADDED;
|
|
780
|
-
prepared.logMissedCall = toApiBooleanString(prepared.logMissedCall);
|
|
781
|
-
prepared.callInfoDisplay = normalizeCallInfoDisplay(prepared.callInfoDisplay);
|
|
782
|
-
prepared.didPattern = normalizeDidPattern(prepared.didPattern, line, prepared.directoryNumber?.directoryNumber);
|
|
783
|
-
prepared.visualMWI = toApiStringValue(prepared.visualMWI);
|
|
784
|
-
prepared.audibleMWI = toApiStringValue(prepared.audibleMWI);
|
|
785
|
-
prepared.associated = prepared.associated ?? true;
|
|
786
|
-
return prepared;
|
|
787
|
-
}
|
|
788
|
-
function prepareLine(line) {
|
|
789
|
-
const prepared = deepClone(line);
|
|
790
|
-
prepared.entityChangeType = prepared.entityChangeType || ENTITY_CHANGE_TYPE.ADDED;
|
|
791
|
-
if (prepared.directoryNumber) {
|
|
792
|
-
prepared.directoryNumber = normalizeDirectoryNumber(prepared.directoryNumber);
|
|
793
|
-
}
|
|
794
|
-
return prepared;
|
|
795
|
-
}
|
|
796
|
-
function syncDeviceLineAssociations(device, lines) {
|
|
797
|
-
device.lineAssociations = (device.lineAssociations || []).map((association, index) => prepareLineAssociation(association, lines[index]));
|
|
798
|
-
}
|
|
799
|
-
function prepareDeviceForSave(device, userId, lines, deviceName) {
|
|
800
|
-
const prepared = deepClone(device);
|
|
801
|
-
const resolvedName = deviceName.trim();
|
|
802
|
-
prepared.name = resolvedName;
|
|
803
|
-
prepared.newName = resolvedName;
|
|
804
|
-
prepared.entityChangeType = prepared.entityChangeType || ENTITY_CHANGE_TYPE.ADDED;
|
|
805
|
-
prepared.createDeviceMode = prepared.createDeviceMode ?? false;
|
|
806
|
-
if (prepared.extraOptions) {
|
|
807
|
-
prepared.extraOptions.mobilityUserId = userId;
|
|
808
|
-
}
|
|
809
|
-
syncDeviceLineAssociations(prepared, lines);
|
|
810
|
-
return prepared;
|
|
811
|
-
}
|
|
812
|
-
function resolvePrimaryLineReference(user) {
|
|
813
|
-
const firstDeviceAssociation = user.devices?.[0]?.lineAssociations?.[0]?.directoryNumber;
|
|
814
|
-
if (firstDeviceAssociation) {
|
|
815
|
-
return firstDeviceAssociation;
|
|
816
|
-
}
|
|
817
|
-
const firstLineDn = user.lines?.[0]?.directoryNumber;
|
|
818
|
-
return firstLineDn ?? null;
|
|
819
|
-
}
|
|
820
|
-
function buildSavableEndUser(endUser, lines, devices, deviceProfiles, form, options = {}) {
|
|
821
|
-
const user = deepClone(endUser);
|
|
822
|
-
user.userid = form.userId || user.userid || '';
|
|
823
|
-
user.firstName = form.firstName || user.firstName || '';
|
|
824
|
-
user.lastName = form.lastName || user.lastName || '';
|
|
825
|
-
user.email = form.email || user.email || '';
|
|
826
|
-
user.createUserMode = false;
|
|
827
|
-
user.lines = (lines || []).map(line => prepareLine(line));
|
|
828
|
-
user.devices = (devices || []).map((device, index) => prepareDeviceForSave(device, user.userid || '', user.lines, options.resolveDeviceName?.(index, device) ?? device.name ?? device.newName ?? ''));
|
|
829
|
-
user.deviceProfiles = (deviceProfiles || []).map((profile, index) => prepareDeviceForSave(profile, user.userid || '', user.lines, options.resolveDeviceProfileName?.(index, profile) ?? profile.name ?? profile.newName ?? ''));
|
|
830
|
-
user.primaryLineReference = resolvePrimaryLineReference(user);
|
|
831
|
-
const snr = user.singleNumberReach;
|
|
832
|
-
if (snr && !snr.remoteDestinationProfileName) {
|
|
833
|
-
user.singleNumberReach = null;
|
|
834
|
-
}
|
|
835
|
-
return user;
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
/**
|
|
839
|
-
* Strips a leading device-prefix group from `deviceNameRegex`, returning the pattern
|
|
840
|
-
* to validate the name field value (without matPrefix).
|
|
841
|
-
*
|
|
842
|
-
* - `([sS][eE][pP]|BAT)[0-9a-fA-F]{12}` → `[0-9a-fA-F]{12}`
|
|
843
|
-
* - `[a-zA-Z0-9]{1,15}` → `[a-zA-Z0-9]{1,15}` (unchanged)
|
|
844
|
-
*/
|
|
845
|
-
function parseDeviceNameRegexBody(deviceNameRegex) {
|
|
846
|
-
const fullRegex = deviceNameRegex?.trim() ?? '';
|
|
847
|
-
if (!fullRegex) {
|
|
848
|
-
return '';
|
|
849
|
-
}
|
|
850
|
-
return stripLeadingPrefixGroup(fullRegex);
|
|
851
|
-
}
|
|
852
|
-
function stripLeadingPrefixGroup(regex) {
|
|
853
|
-
const parenMatch = regex.match(/^(\(.+?\))(.+)$/s);
|
|
854
|
-
if (parenMatch?.[2]?.trim()) {
|
|
855
|
-
return parenMatch[2];
|
|
856
|
-
}
|
|
857
|
-
const literalMatch = regex.match(/^([A-Za-z]+)(\[.+\])$/s);
|
|
858
|
-
if (literalMatch?.[2]?.trim()) {
|
|
859
|
-
return literalMatch[2];
|
|
860
|
-
}
|
|
861
|
-
return regex;
|
|
862
|
-
}
|
|
863
|
-
|
|
864
393
|
class UserCreationWizardService {
|
|
865
|
-
get currentSite() {
|
|
866
|
-
return this._currentSite;
|
|
867
|
-
}
|
|
868
|
-
get firstLineRoutePartition() {
|
|
869
|
-
return this.lines[0]?.directoryNumber?.routePartitionName ?? '';
|
|
870
|
-
}
|
|
871
|
-
get siteDefaultRoutePartition() {
|
|
872
|
-
return this.siteDefaults?.routePartition || '';
|
|
873
|
-
}
|
|
874
|
-
get routePartitionNamesList() {
|
|
875
|
-
return this.siteDefaults ? this.siteDefaults.routePartitionFilter : [];
|
|
876
|
-
}
|
|
877
394
|
constructor() {
|
|
878
|
-
this.
|
|
395
|
+
this.api = inject(UserCreationApiService);
|
|
879
396
|
this.ldapTableColumns = ['userId', 'firstName', 'lastName', 'email', 'add'];
|
|
880
397
|
this.userCreationTypes = ['CUCM', 'MT'];
|
|
881
|
-
this.template = null;
|
|
882
|
-
this.endUser = null;
|
|
883
|
-
this.lines = [];
|
|
884
|
-
this.devices = [];
|
|
885
|
-
this.deviceProfiles = [];
|
|
886
|
-
this.templateLinesSnapshot = null;
|
|
887
|
-
this._currentSite = null;
|
|
888
398
|
this.siteOptions = [];
|
|
889
399
|
this.templateOptions = [];
|
|
890
400
|
this.lineOptions = [];
|
|
@@ -894,89 +404,40 @@ class UserCreationWizardService {
|
|
|
894
404
|
this.overviewUsers = [];
|
|
895
405
|
this.overviewLines = [];
|
|
896
406
|
this.overviewDevices = [];
|
|
897
|
-
this.overviewDeviceProfiles = [];
|
|
898
|
-
this.userDetailsFormValue = null;
|
|
899
407
|
this.userDetailsForm = {
|
|
900
408
|
userId: '',
|
|
901
409
|
firstName: '',
|
|
902
410
|
lastName: '',
|
|
903
|
-
email: ''
|
|
411
|
+
email: ''
|
|
904
412
|
};
|
|
905
413
|
this.lineSelections = [];
|
|
906
414
|
this.deviceEntries = [];
|
|
907
|
-
this.availableNumbers = [];
|
|
908
|
-
this.deviceTypes = [];
|
|
909
|
-
this.siteDefaults = null;
|
|
910
|
-
this.originalSiteDefaults = null;
|
|
911
|
-
this.templateLines = [];
|
|
912
|
-
this.templateDevices = [];
|
|
913
|
-
this.templateUserDetails = {};
|
|
914
415
|
this.selectedSite = null;
|
|
915
|
-
this.
|
|
916
|
-
this.selectedTemplateId = null;
|
|
416
|
+
this.selectedTemplate = null;
|
|
917
417
|
this.selectedUserCreationType = 'CUCM';
|
|
918
|
-
this.
|
|
919
|
-
this.
|
|
920
|
-
this.deviceDefaultsLoaded$ = this.deviceDefaultsLoadedSubject.asObservable();
|
|
921
|
-
this.selectedLdapUser = null;
|
|
922
|
-
this.ldapUsersTotal = 0;
|
|
923
|
-
// this.loadPlaceholderData();
|
|
924
|
-
}
|
|
925
|
-
get isLdapIntegrated() {
|
|
926
|
-
return !!this.endUser?.ldapIntegrated;
|
|
927
|
-
}
|
|
928
|
-
selectLdapUser(user) {
|
|
929
|
-
this.selectedLdapUser = user;
|
|
930
|
-
if (this.endUser) {
|
|
931
|
-
this.endUser.ldapIntegrated = true;
|
|
932
|
-
this.endUser.userid = user.userid;
|
|
933
|
-
this.endUser.firstName = user.firstName ?? '';
|
|
934
|
-
this.endUser.lastName = user.lastName ?? '';
|
|
935
|
-
this.endUser.email = user.email ?? '';
|
|
936
|
-
}
|
|
937
|
-
this.userDetailsForm = {
|
|
938
|
-
userId: user.userid,
|
|
939
|
-
firstName: user.firstName ?? '',
|
|
940
|
-
lastName: user.lastName ?? '',
|
|
941
|
-
email: user.email ?? '',
|
|
942
|
-
};
|
|
943
|
-
this.rebuildOverviewUsers();
|
|
418
|
+
this.addedLdapUserIds = new Set();
|
|
419
|
+
this.loadPlaceholderData();
|
|
944
420
|
}
|
|
945
|
-
|
|
946
|
-
this.selectedLdapUser = null;
|
|
947
|
-
if (this.endUser) {
|
|
948
|
-
this.endUser.ldapIntegrated = false;
|
|
949
|
-
this.endUser.userid = '';
|
|
950
|
-
this.endUser.firstName = '';
|
|
951
|
-
this.endUser.lastName = '';
|
|
952
|
-
this.endUser.email = '';
|
|
953
|
-
}
|
|
421
|
+
addLdapUser(row) {
|
|
954
422
|
this.userDetailsForm = {
|
|
955
|
-
userId:
|
|
956
|
-
firstName:
|
|
957
|
-
lastName:
|
|
958
|
-
email:
|
|
423
|
+
userId: row.userId,
|
|
424
|
+
firstName: row.firstName,
|
|
425
|
+
lastName: row.lastName,
|
|
426
|
+
email: row.email
|
|
959
427
|
};
|
|
428
|
+
this.addedLdapUserIds.add(row.userId);
|
|
960
429
|
this.rebuildOverviewUsers();
|
|
961
430
|
}
|
|
962
|
-
|
|
963
|
-
return this.
|
|
964
|
-
}
|
|
965
|
-
setLdapUsersResult(users, total) {
|
|
966
|
-
this.ldapUsers = users;
|
|
967
|
-
this.ldapUsersTotal = total;
|
|
431
|
+
isLdapUserAdded(row) {
|
|
432
|
+
return this.addedLdapUserIds.has(row.userId);
|
|
968
433
|
}
|
|
969
434
|
setSelectedSite(site) {
|
|
970
|
-
this.selectedSite = site
|
|
435
|
+
this.selectedSite = site;
|
|
971
436
|
}
|
|
972
437
|
setSelectedTemplate(template) {
|
|
973
|
-
this.
|
|
974
|
-
this.selectedTemplateId = template?.id || null;
|
|
438
|
+
this.selectedTemplate = template;
|
|
975
439
|
this.rebuildOverviewUsers();
|
|
976
440
|
}
|
|
977
|
-
setCurrentSite(site) {
|
|
978
|
-
this._currentSite = site;
|
|
979
|
-
}
|
|
980
441
|
resetTemplateDrivenData() {
|
|
981
442
|
this.lineOptions = [];
|
|
982
443
|
this.routePartitionOptions = [];
|
|
@@ -987,121 +448,69 @@ class UserCreationWizardService {
|
|
|
987
448
|
this.rebuildOverviewDevices();
|
|
988
449
|
}
|
|
989
450
|
applyTemplateTokenPayload(payload) {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
this.deviceProfiles = this.endUser && Array.isArray(this.endUser?.deviceProfiles) ? this.endUser.deviceProfiles : [];
|
|
995
|
-
this.initTemplateDnsNamesForLines();
|
|
996
|
-
// this.userDetailsForm = {
|
|
997
|
-
// userId: this.valueToString(this.endUser?.userid ?? ''),
|
|
998
|
-
// firstName: this.valueToString(this.endUser?.firstName ?? ''),
|
|
999
|
-
// lastName: this.valueToString(this.endUser?.lastName ?? ''),
|
|
1000
|
-
// email: this.valueToString(this.endUser?.email ?? '')
|
|
1001
|
-
// };
|
|
1002
|
-
// const mappedLineOptions: LineOption[] = linesFromTemplate
|
|
1003
|
-
// .map(line => ({
|
|
1004
|
-
// number: this.valueToString(line?.directoryNumber?.directoryNumber),
|
|
1005
|
-
// did: this.valueToString(line?.didPatterns?.[0]?.pattern || line?.directoryNumber?.directoryNumber),
|
|
1006
|
-
// css: this.valueToString(
|
|
1007
|
-
// typeof line?.callingSearchSpace === 'string'
|
|
1008
|
-
// ? line.callingSearchSpace
|
|
1009
|
-
// : line?.callingSearchSpace?.name
|
|
1010
|
-
// ),
|
|
1011
|
-
// description: this.valueToString(line?.description)
|
|
1012
|
-
// }))
|
|
1013
|
-
// .filter(line => line.number.trim().length > 0);
|
|
1014
|
-
this.devices.forEach(device => this.initDeviceWithSiteInfo(device));
|
|
1015
|
-
this.deviceProfiles.forEach(device => this.initDeviceWithSiteInfo(device));
|
|
1016
|
-
this.lines.forEach(line => this.initLineWithSiteInfo(line));
|
|
1017
|
-
this.captureTemplateLinesSnapshot();
|
|
1018
|
-
if (this.selectedSite) {
|
|
1019
|
-
this.loadDeviceDefaultsForDevices(this.selectedSite).subscribe();
|
|
1020
|
-
}
|
|
1021
|
-
// if (mappedLineOptions.length) {
|
|
1022
|
-
// this.lineOptions = this.uniqueByNumber(mappedLineOptions);
|
|
1023
|
-
// this.lineSelections = this.lineOptions.map(line => ({
|
|
1024
|
-
// lineNumber: line.number,
|
|
1025
|
-
// routePartitionName: linesFromTemplate.find(
|
|
1026
|
-
// source => (source?.directoryNumber?.directoryNumber || '') === line.number
|
|
1027
|
-
// )?.directoryNumber?.routePartitionName || null
|
|
1028
|
-
// }));
|
|
1029
|
-
// } else {
|
|
1030
|
-
// const lineAssociations = devicesFromTemplate.flatMap(device => device.lineAssociations || []);
|
|
1031
|
-
// const associatedLineOptions: LineOption[] = lineAssociations
|
|
1032
|
-
// .map(association => {
|
|
1033
|
-
// const number = association?.directoryNumber?.directoryNumber || '';
|
|
1034
|
-
// return {
|
|
1035
|
-
// number,
|
|
1036
|
-
// did: number,
|
|
1037
|
-
// css: '',
|
|
1038
|
-
// description: ''
|
|
1039
|
-
// };
|
|
1040
|
-
// })
|
|
1041
|
-
// .filter(line => line.number.trim().length > 0);
|
|
1042
|
-
// this.lineOptions = this.uniqueByNumber(associatedLineOptions);
|
|
1043
|
-
// this.lineSelections = this.lineOptions.map(line => ({
|
|
1044
|
-
// lineNumber: line.number,
|
|
1045
|
-
// routePartitionName: lineAssociations.find(
|
|
1046
|
-
// source => (source?.directoryNumber?.directoryNumber || '') === line.number
|
|
1047
|
-
// )?.directoryNumber?.routePartitionName || null
|
|
1048
|
-
// }));
|
|
1049
|
-
// this.templateLines.forEach((line: any) => this.initLineWithSiteInfo(line));
|
|
1050
|
-
// this.initTemplateDnsNamesForLines(this.templateLines);
|
|
1051
|
-
// }
|
|
1052
|
-
// const routePartitions = this.lineSelections
|
|
1053
|
-
// .map(line => line.routePartitionName)
|
|
1054
|
-
// .filter((value): value is string => !!value && value.trim().length > 0);
|
|
1055
|
-
// this.routePartitionOptions = this.uniqueStrings(routePartitions);
|
|
1056
|
-
// this.deviceEntries = devicesFromTemplate.map(device => ({
|
|
1057
|
-
// deviceType: this.valueToString(device.deviceType),
|
|
1058
|
-
// protocol: this.valueToString(device.protocol),
|
|
1059
|
-
// buttonTemplate: this.valueToString(device.buttonTemplate),
|
|
1060
|
-
// name: this.valueToString(device.name)
|
|
1061
|
-
// }));
|
|
1062
|
-
// this.deviceRows = this.deviceEntries.map((_, index) => index + 1);
|
|
1063
|
-
// this.rebuildOverviewUsers();
|
|
1064
|
-
// this.rebuildOverviewLines();
|
|
1065
|
-
// this.rebuildOverviewDevices();
|
|
1066
|
-
}
|
|
1067
|
-
setSelectedUserCreationType(type) {
|
|
1068
|
-
this.selectedUserCreationType = type;
|
|
1069
|
-
}
|
|
1070
|
-
resetUserDetailsStepState() {
|
|
1071
|
-
this.userDetailsFormValue = null;
|
|
451
|
+
const template = this.extractTemplateFromTokenPayload(payload);
|
|
452
|
+
const endUser = template?.endUser || {};
|
|
453
|
+
const linesFromTemplate = Array.isArray(endUser.lines) ? endUser.lines : [];
|
|
454
|
+
const devicesFromTemplate = Array.isArray(endUser.devices) ? endUser.devices : [];
|
|
1072
455
|
this.userDetailsForm = {
|
|
1073
|
-
userId:
|
|
1074
|
-
firstName:
|
|
1075
|
-
lastName:
|
|
1076
|
-
email:
|
|
456
|
+
userId: this.valueToString(endUser.userid),
|
|
457
|
+
firstName: this.valueToString(endUser.firstName),
|
|
458
|
+
lastName: this.valueToString(endUser.lastName),
|
|
459
|
+
email: this.valueToString(endUser.email)
|
|
1077
460
|
};
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
this.
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
})
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
this.endUser.email = '';
|
|
1095
|
-
this.endUser.ldapIntegrated = false;
|
|
1096
|
-
this.endUser.lines = this.lines;
|
|
461
|
+
const mappedLineOptions = linesFromTemplate
|
|
462
|
+
.map(line => ({
|
|
463
|
+
number: this.valueToString(line?.directoryNumber?.directoryNumber),
|
|
464
|
+
did: this.valueToString(line?.didPatterns?.[0]?.pattern || line?.directoryNumber?.directoryNumber),
|
|
465
|
+
css: this.valueToString(typeof line?.callingSearchSpace === 'string'
|
|
466
|
+
? line.callingSearchSpace
|
|
467
|
+
: line?.callingSearchSpace?.name),
|
|
468
|
+
description: this.valueToString(line?.description)
|
|
469
|
+
}))
|
|
470
|
+
.filter(line => line.number.trim().length > 0);
|
|
471
|
+
if (mappedLineOptions.length) {
|
|
472
|
+
this.lineOptions = this.uniqueByNumber(mappedLineOptions);
|
|
473
|
+
this.lineSelections = this.lineOptions.map(line => ({
|
|
474
|
+
lineNumber: line.number,
|
|
475
|
+
routePartitionName: linesFromTemplate.find(source => (source?.directoryNumber?.directoryNumber || '') === line.number)?.directoryNumber?.routePartitionName || null
|
|
476
|
+
}));
|
|
1097
477
|
}
|
|
1098
|
-
|
|
478
|
+
else {
|
|
479
|
+
const lineAssociations = devicesFromTemplate.flatMap(device => device.lineAssociations || []);
|
|
480
|
+
const associatedLineOptions = lineAssociations
|
|
481
|
+
.map(association => {
|
|
482
|
+
const number = association?.directoryNumber?.directoryNumber || '';
|
|
483
|
+
return {
|
|
484
|
+
number,
|
|
485
|
+
did: number,
|
|
486
|
+
css: '',
|
|
487
|
+
description: ''
|
|
488
|
+
};
|
|
489
|
+
})
|
|
490
|
+
.filter(line => line.number.trim().length > 0);
|
|
491
|
+
this.lineOptions = this.uniqueByNumber(associatedLineOptions);
|
|
492
|
+
this.lineSelections = this.lineOptions.map(line => ({
|
|
493
|
+
lineNumber: line.number,
|
|
494
|
+
routePartitionName: lineAssociations.find(source => (source?.directoryNumber?.directoryNumber || '') === line.number)?.directoryNumber?.routePartitionName || null
|
|
495
|
+
}));
|
|
496
|
+
}
|
|
497
|
+
const routePartitions = this.lineSelections
|
|
498
|
+
.map(line => line.routePartitionName)
|
|
499
|
+
.filter((value) => !!value && value.trim().length > 0);
|
|
500
|
+
this.routePartitionOptions = this.uniqueStrings(routePartitions);
|
|
501
|
+
this.deviceEntries = devicesFromTemplate.map(device => ({
|
|
502
|
+
deviceType: this.valueToString(device.deviceType),
|
|
503
|
+
protocol: this.valueToString(device.protocol),
|
|
504
|
+
buttonTemplate: this.valueToString(device.buttonTemplate),
|
|
505
|
+
name: this.valueToString(device.name)
|
|
506
|
+
}));
|
|
507
|
+
this.deviceRows = this.deviceEntries.map((_, index) => index + 1);
|
|
508
|
+
this.rebuildOverviewUsers();
|
|
1099
509
|
this.rebuildOverviewLines();
|
|
1100
510
|
this.rebuildOverviewDevices();
|
|
1101
|
-
this.rebuildOverviewDeviceProfiles();
|
|
1102
511
|
}
|
|
1103
|
-
|
|
1104
|
-
this.
|
|
512
|
+
setSelectedUserCreationType(type) {
|
|
513
|
+
this.selectedUserCreationType = type;
|
|
1105
514
|
}
|
|
1106
515
|
setUserDetailsField(field, value) {
|
|
1107
516
|
this.userDetailsForm = {
|
|
@@ -1110,47 +519,6 @@ class UserCreationWizardService {
|
|
|
1110
519
|
};
|
|
1111
520
|
this.rebuildOverviewUsers();
|
|
1112
521
|
}
|
|
1113
|
-
applyUserDetailsFormValue(formValue) {
|
|
1114
|
-
this.userDetailsFormValue = formValue;
|
|
1115
|
-
this.userDetailsForm = {
|
|
1116
|
-
userId: formValue.userId || '',
|
|
1117
|
-
firstName: formValue.firstName || '',
|
|
1118
|
-
lastName: formValue.lastName || '',
|
|
1119
|
-
email: formValue.email || '',
|
|
1120
|
-
};
|
|
1121
|
-
formValue.lines?.forEach((lineValue, index) => {
|
|
1122
|
-
const line = this.lines[index];
|
|
1123
|
-
if (!line?.directoryNumber) {
|
|
1124
|
-
return;
|
|
1125
|
-
}
|
|
1126
|
-
line.directoryNumber.directoryNumber = lineValue.number || '';
|
|
1127
|
-
line.directoryNumber.routePartitionName = lineValue.routePartition || '';
|
|
1128
|
-
});
|
|
1129
|
-
formValue.devices?.forEach((deviceValue, index) => {
|
|
1130
|
-
const device = this.devices[index];
|
|
1131
|
-
if (!device) {
|
|
1132
|
-
return;
|
|
1133
|
-
}
|
|
1134
|
-
device.name = deviceValue.name || '';
|
|
1135
|
-
});
|
|
1136
|
-
formValue.deviceProfiles?.forEach((profileValue, index) => {
|
|
1137
|
-
const profile = this.deviceProfiles[index];
|
|
1138
|
-
if (!profile) {
|
|
1139
|
-
return;
|
|
1140
|
-
}
|
|
1141
|
-
profile.name = profileValue.name || '';
|
|
1142
|
-
});
|
|
1143
|
-
if (this.endUser) {
|
|
1144
|
-
this.endUser.userid = formValue.userId || '';
|
|
1145
|
-
this.endUser.firstName = formValue.firstName || '';
|
|
1146
|
-
this.endUser.lastName = formValue.lastName || '';
|
|
1147
|
-
this.endUser.email = formValue.email || '';
|
|
1148
|
-
}
|
|
1149
|
-
this.rebuildOverviewUsers();
|
|
1150
|
-
this.rebuildOverviewLines();
|
|
1151
|
-
this.rebuildOverviewDevices();
|
|
1152
|
-
this.rebuildOverviewDeviceProfiles();
|
|
1153
|
-
}
|
|
1154
522
|
setLineSelection(index, lineNumber) {
|
|
1155
523
|
if (!this.lineSelections[index]) {
|
|
1156
524
|
return;
|
|
@@ -1200,83 +568,63 @@ class UserCreationWizardService {
|
|
|
1200
568
|
}
|
|
1201
569
|
return entry.name || '';
|
|
1202
570
|
}
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
571
|
+
// Placeholder bootstrap until backend APIs are connected.
|
|
572
|
+
loadPlaceholderData() {
|
|
573
|
+
this.siteOptions = ['Site 1', 'Site 2', 'Site 3'];
|
|
574
|
+
this.templateOptions = ['User 8851 Office'];
|
|
575
|
+
this.lineOptions = [
|
|
576
|
+
{
|
|
577
|
+
number: '557046',
|
|
578
|
+
did: '+13125557046',
|
|
579
|
+
css: 'Atlanta_internal_css',
|
|
580
|
+
description: ''
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
number: '557047',
|
|
584
|
+
did: '+13125557047',
|
|
585
|
+
css: 'Atlanta_internal_css',
|
|
586
|
+
description: ''
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
number: '557048',
|
|
590
|
+
did: '+13125557048',
|
|
591
|
+
css: 'Atlanta_internal_css',
|
|
592
|
+
description: ''
|
|
1208
593
|
}
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
594
|
+
];
|
|
595
|
+
this.routePartitionOptions = ['Atlanta_internal_PT', 'Beijing_national_PT'];
|
|
596
|
+
this.deviceRows = [1, 2];
|
|
597
|
+
this.ldapUsers = [
|
|
598
|
+
{ userId: 'John.Doe', firstName: 'John', lastName: 'Doe', email: 'john.doe@car.west.io' },
|
|
599
|
+
{ userId: 'Jane.Smith', firstName: 'Jane', lastName: 'Smith', email: 'jane.smith@car.west.io' }
|
|
600
|
+
];
|
|
601
|
+
this.lineSelections = [
|
|
602
|
+
{
|
|
603
|
+
lineNumber: null,
|
|
604
|
+
routePartitionName: this.routePartitionOptions[0] || null
|
|
1213
605
|
}
|
|
1214
|
-
|
|
1215
|
-
|
|
606
|
+
];
|
|
607
|
+
this.deviceEntries = [
|
|
608
|
+
{
|
|
609
|
+
deviceType: 'Cisco 8851',
|
|
610
|
+
protocol: 'SIP',
|
|
611
|
+
buttonTemplate: 'Standard 8851 SIP',
|
|
612
|
+
name: ''
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
deviceType: 'Cisco Unified Client Services Framework',
|
|
616
|
+
protocol: 'SIP',
|
|
617
|
+
buttonTemplate: 'Standard Client Services Framework',
|
|
618
|
+
name: ''
|
|
1216
619
|
}
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
return of(undefined);
|
|
1223
|
-
}
|
|
1224
|
-
const requests = deviceTypes.map(deviceType => this.userCreationApiService.getDeviceDefaults(String(siteId), deviceType).pipe(tap(defaults => this.applyDeviceDefaultsToType(deviceType, defaults)), catchError(() => of(null))));
|
|
1225
|
-
return forkJoin(requests).pipe(tap(() => this.deviceDefaultsLoadedSubject.next()), map(() => undefined));
|
|
1226
|
-
}
|
|
1227
|
-
getUniqueDeviceTypes() {
|
|
1228
|
-
const types = [
|
|
1229
|
-
...this.devices.map(device => device.deviceType),
|
|
1230
|
-
...this.deviceProfiles.map(profile => profile.deviceType),
|
|
1231
|
-
].filter((type) => !!type && type.trim().length > 0);
|
|
1232
|
-
return [...new Set(types)];
|
|
1233
|
-
}
|
|
1234
|
-
applyDeviceDefaultsToType(deviceType, defaults) {
|
|
1235
|
-
const nameValidationRegex = parseDeviceNameRegexBody(defaults.deviceNameRegex);
|
|
1236
|
-
const targets = [...this.devices, ...this.deviceProfiles].filter(device => device.deviceType === deviceType);
|
|
1237
|
-
targets.forEach(device => {
|
|
1238
|
-
device.deviceDefaults = defaults;
|
|
1239
|
-
device.nameValidationRegex = nameValidationRegex;
|
|
1240
|
-
device.nameValidationCaption = defaults.deviceNameExplained;
|
|
1241
|
-
});
|
|
1242
|
-
}
|
|
1243
|
-
getDeviceNamePrefix(deviceIndex, isProfile = false) {
|
|
1244
|
-
const device = isProfile ? this.deviceProfiles[deviceIndex] : this.devices[deviceIndex];
|
|
1245
|
-
const prefix = device?.prefix?.trim();
|
|
1246
|
-
return prefix || null;
|
|
1247
|
-
}
|
|
1248
|
-
getDeviceNameValidationCaption(deviceIndex, isProfile = false) {
|
|
1249
|
-
const device = isProfile ? this.deviceProfiles[deviceIndex] : this.devices[deviceIndex];
|
|
1250
|
-
return device?.nameValidationCaption || device?.deviceDefaults?.deviceNameExplained || '';
|
|
1251
|
-
}
|
|
1252
|
-
getDeviceNameValidationOptions(deviceIndex, isProfile = false) {
|
|
1253
|
-
const device = isProfile ? this.deviceProfiles[deviceIndex] : this.devices[deviceIndex];
|
|
1254
|
-
const regex = device?.nameValidationRegex?.trim() ||
|
|
1255
|
-
parseDeviceNameRegexBody(device?.deviceDefaults?.deviceNameRegex);
|
|
1256
|
-
if (!regex) {
|
|
1257
|
-
return null;
|
|
1258
|
-
}
|
|
1259
|
-
return {
|
|
1260
|
-
regex,
|
|
1261
|
-
caption: this.getDeviceNameValidationCaption(deviceIndex, isProfile),
|
|
1262
|
-
};
|
|
1263
|
-
}
|
|
1264
|
-
getNumberRange(siteId, routePartition) {
|
|
1265
|
-
this.availableDidPatternsMappedToDn = {};
|
|
1266
|
-
const pageSize = 9999;
|
|
1267
|
-
const params = { dntype: DnRangeType.extension, routepartition: routePartition, size: pageSize, page: 0 };
|
|
1268
|
-
this.availableNumbers = [];
|
|
1269
|
-
return this.userCreationApiService.getAvailableDnInRanges(siteId, params)
|
|
1270
|
-
.pipe(map((res) => {
|
|
1271
|
-
res.availableNumberList.forEach((availableNumber) => {
|
|
1272
|
-
this.setAvailableDidMappedToDn(availableNumber);
|
|
1273
|
-
this.availableNumbers = [...this.availableNumbers, ...this.getUnwrapNumberRange(availableNumber)];
|
|
1274
|
-
});
|
|
1275
|
-
}));
|
|
1276
|
-
// .pipe(this.handleError(true, false));
|
|
620
|
+
];
|
|
621
|
+
this.selectedTemplate = this.selectedTemplate ?? null;
|
|
622
|
+
this.rebuildOverviewUsers();
|
|
623
|
+
this.rebuildOverviewLines();
|
|
624
|
+
this.rebuildOverviewDevices();
|
|
1277
625
|
}
|
|
1278
626
|
rebuildOverviewUsers() {
|
|
1279
|
-
const userTemplate = this.
|
|
627
|
+
const userTemplate = this.selectedTemplate || '';
|
|
1280
628
|
const hasUserData = Object.values(this.userDetailsForm).some(value => value.trim().length > 0);
|
|
1281
629
|
this.overviewUsers = hasUserData
|
|
1282
630
|
? [{
|
|
@@ -1289,23 +637,6 @@ class UserCreationWizardService {
|
|
|
1289
637
|
: [];
|
|
1290
638
|
}
|
|
1291
639
|
rebuildOverviewLines() {
|
|
1292
|
-
const formLines = this.userDetailsFormValue?.lines;
|
|
1293
|
-
if (formLines?.length) {
|
|
1294
|
-
this.overviewLines = formLines
|
|
1295
|
-
.filter(line => !!line?.number?.trim())
|
|
1296
|
-
.map((lineValue, index) => {
|
|
1297
|
-
const templateLine = this.lines[index];
|
|
1298
|
-
const css = this.valueToString(templateLine?.callingSearchSpace);
|
|
1299
|
-
return {
|
|
1300
|
-
number: lineValue.number,
|
|
1301
|
-
did: lineValue.lineNumber || lineValue.number,
|
|
1302
|
-
routePartitionName: lineValue.routePartition || '',
|
|
1303
|
-
css,
|
|
1304
|
-
description: this.valueToString(templateLine?.description),
|
|
1305
|
-
};
|
|
1306
|
-
});
|
|
1307
|
-
return;
|
|
1308
|
-
}
|
|
1309
640
|
this.overviewLines = this.lineSelections
|
|
1310
641
|
.map(selection => {
|
|
1311
642
|
if (!selection?.lineNumber) {
|
|
@@ -1327,18 +658,6 @@ class UserCreationWizardService {
|
|
|
1327
658
|
}
|
|
1328
659
|
rebuildOverviewDevices() {
|
|
1329
660
|
const selectedLineNumbers = this.overviewLines.map(line => line.number).join(', ');
|
|
1330
|
-
const formDevices = this.userDetailsFormValue?.devices;
|
|
1331
|
-
if (formDevices?.length) {
|
|
1332
|
-
this.overviewDevices = formDevices
|
|
1333
|
-
.filter(device => !!device.deviceType?.trim() || !!device.name?.trim())
|
|
1334
|
-
.map(device => ({
|
|
1335
|
-
name: device.name || '',
|
|
1336
|
-
deviceType: device.deviceType || '',
|
|
1337
|
-
lines: selectedLineNumbers,
|
|
1338
|
-
description: `${device.protocol || ''} / ${device.buttonTemplate || ''}`.trim(),
|
|
1339
|
-
}));
|
|
1340
|
-
return;
|
|
1341
|
-
}
|
|
1342
661
|
this.overviewDevices = this.deviceEntries
|
|
1343
662
|
.map((device, index) => ({
|
|
1344
663
|
device,
|
|
@@ -1352,22 +671,6 @@ class UserCreationWizardService {
|
|
|
1352
671
|
description: `${device.protocol} / ${device.buttonTemplate}`
|
|
1353
672
|
}));
|
|
1354
673
|
}
|
|
1355
|
-
rebuildOverviewDeviceProfiles() {
|
|
1356
|
-
const selectedLineNumbers = this.overviewLines.map(line => line.number).join(', ');
|
|
1357
|
-
const formProfiles = this.userDetailsFormValue?.deviceProfiles;
|
|
1358
|
-
if (!formProfiles?.length) {
|
|
1359
|
-
this.overviewDeviceProfiles = [];
|
|
1360
|
-
return;
|
|
1361
|
-
}
|
|
1362
|
-
this.overviewDeviceProfiles = formProfiles
|
|
1363
|
-
.filter(profile => !!profile.deviceType?.trim() || !!profile.name?.trim())
|
|
1364
|
-
.map(profile => ({
|
|
1365
|
-
name: profile.name || '',
|
|
1366
|
-
deviceType: profile.deviceType || '',
|
|
1367
|
-
lines: selectedLineNumbers,
|
|
1368
|
-
description: `${profile.protocol || ''} / ${profile.buttonTemplate || ''}`.trim(),
|
|
1369
|
-
}));
|
|
1370
|
-
}
|
|
1371
674
|
extractTemplateFromTokenPayload(payload) {
|
|
1372
675
|
if (!payload || typeof payload !== 'object') {
|
|
1373
676
|
return null;
|
|
@@ -1394,247 +697,10 @@ class UserCreationWizardService {
|
|
|
1394
697
|
valueToString(value) {
|
|
1395
698
|
return typeof value === 'string' ? value : '';
|
|
1396
699
|
}
|
|
1397
|
-
getUnwrapNumberRange(availableNumber) {
|
|
1398
|
-
let unwrapNumberRange = this.unwrapNumberRange(availableNumber.phoneNumberRange.from, availableNumber.phoneNumberRange.to)
|
|
1399
|
-
.map((unwrappedNumber) => {
|
|
1400
|
-
const dn = availableNumber.phoneNumberRange.prefix + unwrappedNumber;
|
|
1401
|
-
let str = dn;
|
|
1402
|
-
if (this.availableDidPatternsMappedToDn[dn] && this.availableDidPatternsMappedToDn[dn].length > 0) {
|
|
1403
|
-
if (this.availableDidPatternsMappedToDn[dn][0]['mappedDids'] && this.availableDidPatternsMappedToDn[dn][0]['mappedDids'].length > 0) {
|
|
1404
|
-
str += ' DID: ' + (this.availableDidPatternsMappedToDn[dn][0]['mappedDids'].length > 1 ? 'multiple' :
|
|
1405
|
-
this.availableDidPatternsMappedToDn[dn][0]['mappedDids'][0]);
|
|
1406
|
-
}
|
|
1407
|
-
if (this.availableDidPatternsMappedToDn[dn][0]['vm']) {
|
|
1408
|
-
str += ' In Use - VM';
|
|
1409
|
-
}
|
|
1410
|
-
}
|
|
1411
|
-
return str;
|
|
1412
|
-
});
|
|
1413
|
-
unwrapNumberRange = unwrapNumberRange.filter((unwrappedNumber) => !availableNumber.usedNumbers.includes(unwrappedNumber));
|
|
1414
|
-
return unwrapNumberRange;
|
|
1415
|
-
}
|
|
1416
|
-
unwrapNumberRange(start, end) {
|
|
1417
|
-
const regExp = /(^0+)/;
|
|
1418
|
-
let leadingZeros = '';
|
|
1419
|
-
const matches = start.match(regExp);
|
|
1420
|
-
if (matches) {
|
|
1421
|
-
leadingZeros = matches[1];
|
|
1422
|
-
}
|
|
1423
|
-
const startNumeric = new Big(start);
|
|
1424
|
-
const endNumeric = new Big(end);
|
|
1425
|
-
return Array.from({ length: Number(endNumeric.minus(startNumeric).plus(new Big(1)).toFixed(0)) }, (v, k) => {
|
|
1426
|
-
const number = String(startNumeric.plus(new Big(k.toString())).toFixed(0));
|
|
1427
|
-
if ((leadingZeros + number).length > start.length) {
|
|
1428
|
-
leadingZeros = leadingZeros.substr(1);
|
|
1429
|
-
}
|
|
1430
|
-
return leadingZeros + number;
|
|
1431
|
-
});
|
|
1432
|
-
}
|
|
1433
|
-
setAvailableDidMappedToDn(availableNumber) {
|
|
1434
|
-
if (availableNumber.unUsedNumbersWithDids && availableNumber.unUsedNumbersWithDids.length) {
|
|
1435
|
-
availableNumber.unUsedNumbersWithDids.forEach((numberWithDids) => {
|
|
1436
|
-
const dn = numberWithDids['unUsedNumber'];
|
|
1437
|
-
this.availableDidPatternsMappedToDn[dn] = [{}];
|
|
1438
|
-
if (numberWithDids['translationPatternList'] && numberWithDids['translationPatternList'].length > 0) {
|
|
1439
|
-
this.availableDidPatternsMappedToDn[dn] = numberWithDids['translationPatternList'];
|
|
1440
|
-
this.availableDidPatternsMappedToDn[dn][0]['mappedDids'] = [{}];
|
|
1441
|
-
if (numberWithDids['mappedDids'] && numberWithDids['mappedDids'].length > 0) {
|
|
1442
|
-
this.availableDidPatternsMappedToDn[dn][0]['mappedDids'] = numberWithDids['mappedDids'];
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
this.availableDidPatternsMappedToDn[dn][0]['vm'] = numberWithDids['vm'];
|
|
1446
|
-
});
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
700
|
// TODO: replace placeholders with real API integration.
|
|
1450
701
|
loadDataFromApi() {
|
|
1451
702
|
// this.api.getWizardBootstrapData().subscribe(...)
|
|
1452
703
|
}
|
|
1453
|
-
initLineWithSiteInfo(line) {
|
|
1454
|
-
line.directoryNumber.routePartitionName = this.siteDefaults?.routePartition || '';
|
|
1455
|
-
let callingSearchSpaceVal = this.siteDefaults?.lineCss || '';
|
|
1456
|
-
line.callingSearchSpace = callingSearchSpaceVal;
|
|
1457
|
-
}
|
|
1458
|
-
// private initTemplateDnsNamesForLines(userLines: TemplateLineLike[]): void {
|
|
1459
|
-
// const routePartition = this.siteDefaults?.routePartition || '';
|
|
1460
|
-
// if (userLines && userLines.length > 0) {
|
|
1461
|
-
// userLines.forEach((line, index) => {
|
|
1462
|
-
// line && line.directoryNumber && (line.directoryNumber.templateDirectoryNumber = line.directoryNumber.directoryNumber);
|
|
1463
|
-
// line && line.directoryNumber && (line.directoryNumber.directoryNumber = '');
|
|
1464
|
-
// return line;
|
|
1465
|
-
// });
|
|
1466
|
-
// // const routePartition = this.siteDefaults?.routePartition || '';
|
|
1467
|
-
// // if (line.lineAssociations && line.lineAssociations.length) {
|
|
1468
|
-
// // this.setLineAssociationsForDevice(line, routePartition);
|
|
1469
|
-
// // }
|
|
1470
|
-
// }
|
|
1471
|
-
// this.templateDevices.forEach(device => {
|
|
1472
|
-
// if (device.lineAssociations && device.lineAssociations.length) {
|
|
1473
|
-
// this.setLineAssociationsForDevice(device, routePartition);
|
|
1474
|
-
// }
|
|
1475
|
-
// });
|
|
1476
|
-
// }
|
|
1477
|
-
setLineAssociationsForDevice(device, routePartition) {
|
|
1478
|
-
const lineAssociations = device.lineAssociations || [];
|
|
1479
|
-
if (lineAssociations && lineAssociations.length) {
|
|
1480
|
-
lineAssociations.forEach(lineAssociation => {
|
|
1481
|
-
lineAssociation && lineAssociation.directoryNumber && (lineAssociation.directoryNumber.templateDirectoryNumber = lineAssociation.directoryNumber.directoryNumber || '');
|
|
1482
|
-
lineAssociation && lineAssociation.directoryNumber && (lineAssociation.directoryNumber.routePartitionName = routePartition);
|
|
1483
|
-
});
|
|
1484
|
-
}
|
|
1485
|
-
}
|
|
1486
|
-
initDeviceWithSiteInfo(device) {
|
|
1487
|
-
device.newName = device.name;
|
|
1488
|
-
device.name = '';
|
|
1489
|
-
if (!device['enabledExtensionMobility']) {
|
|
1490
|
-
device.enabledExtensionMobility = this.siteDefaults?.enableEm ?? false;
|
|
1491
|
-
}
|
|
1492
|
-
else if (device['enabledExtensionMobility'].toString() === 'Yes') {
|
|
1493
|
-
device.enabledExtensionMobility = true;
|
|
1494
|
-
}
|
|
1495
|
-
else if (device['enabledExtensionMobility'].toString() === 'No') {
|
|
1496
|
-
device.enabledExtensionMobility = false;
|
|
1497
|
-
}
|
|
1498
|
-
if (device.location) {
|
|
1499
|
-
const replacedValue = this.replaceDynamicValueSiteInfo(device.location, this.currentSite?.shortName ?? '') ?? null;
|
|
1500
|
-
device.location = replacedValue;
|
|
1501
|
-
}
|
|
1502
|
-
if (device.location) {
|
|
1503
|
-
const replacedValue = this.replaceDynamicValueSiteInfo(device.devicePoolName, this.currentSite?.shortName ?? '') ?? null;
|
|
1504
|
-
device.devicePoolName = replacedValue;
|
|
1505
|
-
}
|
|
1506
|
-
if (device.location) {
|
|
1507
|
-
const replacedValue = this.replaceDynamicValueSiteInfo(device.callingSearchSpaceName, this.currentSite?.shortName ?? '') ?? null;
|
|
1508
|
-
device.callingSearchSpaceName = replacedValue;
|
|
1509
|
-
}
|
|
1510
|
-
if (device.extraOptions) {
|
|
1511
|
-
const replacedValue = this.replaceDynamicValueSiteInfo(device.extraOptions.aarCss, this.currentSite?.shortName ?? '') ?? null;
|
|
1512
|
-
device.extraOptions.aarCss = replacedValue;
|
|
1513
|
-
}
|
|
1514
|
-
if (!device.description && this.siteDefaults) {
|
|
1515
|
-
device.description = this.siteDefaults.deviceDescription;
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
replaceDynamicValueSiteInfo(fieldValue, siteShortName) {
|
|
1519
|
-
if (fieldValue) {
|
|
1520
|
-
fieldValue = this.replaceDynamicValueFormat(fieldValue);
|
|
1521
|
-
const paramsToReplaces = { 'SiteShortName': siteShortName };
|
|
1522
|
-
return this.mutliStringReplace(paramsToReplaces, fieldValue);
|
|
1523
|
-
}
|
|
1524
|
-
return null;
|
|
1525
|
-
}
|
|
1526
|
-
replaceDynamicValueFormat(str) {
|
|
1527
|
-
str = str.replace(/\[FN\]/ig, '[FN]').replace(/\[LN\]/ig, '[LN]').replace(/\[ID\]/ig, '[UserId]')
|
|
1528
|
-
.replace(/\[UserId\]/ig, '[UserId]').replace(/<Match User ID>/ig, '[UserId]')
|
|
1529
|
-
.replace(/\[Email\]/ig, '[Email]').replace(/\[DN\(/ig, '[DN(')
|
|
1530
|
-
.replace(/\[SiteShortName\]/ig, '[SiteShortName]').replace(/\$\(SiteShortName\)/ig, '[SiteShortName]')
|
|
1531
|
-
.replace(/\$\{SiteShortName\}/ig, '[SiteShortName]').replace(/{SiteShortName}/ig, '[SiteShortName]')
|
|
1532
|
-
.replace(/\[FN\(/ig, '[FN(').replace(/\[LN\(/ig, '[LN(')
|
|
1533
|
-
.replace(/\[ID\(/ig, '[ID(');
|
|
1534
|
-
return str;
|
|
1535
|
-
}
|
|
1536
|
-
mutliStringReplace(object, input, directoryNumber, user) {
|
|
1537
|
-
var val = input;
|
|
1538
|
-
if (val.includes('[DN]') && directoryNumber && !directoryNumber.includes('Line')) {
|
|
1539
|
-
val = val.replace('[DN]', directoryNumber);
|
|
1540
|
-
}
|
|
1541
|
-
var indexOfDN = val.indexOf('[DN(');
|
|
1542
|
-
if (indexOfDN !== -1 && directoryNumber) {
|
|
1543
|
-
var digit = val.substring(indexOfDN + 4, val.indexOf(')', indexOfDN + 4));
|
|
1544
|
-
var digitCount = Number(digit) || 0;
|
|
1545
|
-
var dnDigit = (digitCount > val.length) ? directoryNumber : directoryNumber.substring(directoryNumber.length - digitCount, directoryNumber.length);
|
|
1546
|
-
val = val.replace('[DN(' + digit + ')]', dnDigit);
|
|
1547
|
-
}
|
|
1548
|
-
var indexOfFN = val.indexOf('[FN(');
|
|
1549
|
-
if (indexOfFN !== -1 && user && user.firstName) {
|
|
1550
|
-
var digit = val.substring(indexOfFN + 4, val.indexOf(')', indexOfFN + 4));
|
|
1551
|
-
var fnDigit = user.firstName.substring(0, digit);
|
|
1552
|
-
val = val.replace('[FN(' + digit + ')]', fnDigit);
|
|
1553
|
-
}
|
|
1554
|
-
var indexOfLN = val.indexOf('[LN(');
|
|
1555
|
-
if (indexOfLN !== -1 && user && user.lastName) {
|
|
1556
|
-
var digit = val.substring(indexOfLN + 4, val.indexOf(')', indexOfLN + 4));
|
|
1557
|
-
var lnDigit = user.lastName.substring(0, digit);
|
|
1558
|
-
val = val.replace('[LN(' + digit + ')]', lnDigit);
|
|
1559
|
-
}
|
|
1560
|
-
var indexOfID = val.indexOf('[ID(');
|
|
1561
|
-
if (indexOfID !== -1 && user && user.userid) {
|
|
1562
|
-
var digit = val.substring(indexOfID + 4, val.indexOf(')', indexOfID + 4));
|
|
1563
|
-
var idDigit = user.userid.substring(0, digit);
|
|
1564
|
-
val = val.replace('[ID(' + digit + ')]', idDigit);
|
|
1565
|
-
}
|
|
1566
|
-
var entries = Object.entries(object);
|
|
1567
|
-
entries.forEach((para) => {
|
|
1568
|
-
var find = '[' + para[0] + ']';
|
|
1569
|
-
var replacement = para[1] != null ? String(para[1]) : '';
|
|
1570
|
-
val = val.split(find).join(replacement);
|
|
1571
|
-
});
|
|
1572
|
-
return val;
|
|
1573
|
-
}
|
|
1574
|
-
initTemplateDnsNamesForLines() {
|
|
1575
|
-
if (this.lines && this.lines.length > 0) {
|
|
1576
|
-
this.lines.forEach((line, index) => {
|
|
1577
|
-
line.directoryNumber.templateDirectoryNumber = line.directoryNumber.directoryNumber;
|
|
1578
|
-
line.directoryNumber.directoryNumber = '';
|
|
1579
|
-
return line;
|
|
1580
|
-
});
|
|
1581
|
-
const routePartition = this.siteDefaults?.routePartition || '';
|
|
1582
|
-
this.devices.forEach(device => {
|
|
1583
|
-
if (device.lineAssociations && device.lineAssociations.length) {
|
|
1584
|
-
this.setLineAssociationsForDevice(device, routePartition);
|
|
1585
|
-
}
|
|
1586
|
-
});
|
|
1587
|
-
this.deviceProfiles.forEach(deviceProfile => {
|
|
1588
|
-
if (deviceProfile.lineAssociations && deviceProfile.lineAssociations.length) {
|
|
1589
|
-
this.setLineAssociationsForDevice(deviceProfile, routePartition);
|
|
1590
|
-
}
|
|
1591
|
-
});
|
|
1592
|
-
if (this.endUser?.singleNumberReach && this.endUser.singleNumberReach.associatedLines && this.endUser.singleNumberReach.associatedLines.length) {
|
|
1593
|
-
if (this.endUser.singleNumberReach.associatedLines && this.endUser.singleNumberReach.associatedLines.length) {
|
|
1594
|
-
this.endUser.singleNumberReach.associatedLines.map(lineAssociation => {
|
|
1595
|
-
lineAssociation.directoryNumber.templateDirectoryNumber = lineAssociation.directoryNumber.directoryNumber;
|
|
1596
|
-
lineAssociation.directoryNumber.routePartitionName = routePartition;
|
|
1597
|
-
});
|
|
1598
|
-
}
|
|
1599
|
-
if (this.endUser.singleNumberReach.remoteDestinations && this.endUser.singleNumberReach.remoteDestinations.length) {
|
|
1600
|
-
this.endUser.singleNumberReach.remoteDestinations.forEach(remoteDestination => {
|
|
1601
|
-
if (remoteDestination.lineAssociations && remoteDestination.lineAssociations.length) {
|
|
1602
|
-
remoteDestination.lineAssociations.map(lineAssociation => {
|
|
1603
|
-
lineAssociation.directoryNumber.templateDirectoryNumber = lineAssociation.directoryNumber.directoryNumber;
|
|
1604
|
-
lineAssociation.directoryNumber.routePartitionName = routePartition;
|
|
1605
|
-
});
|
|
1606
|
-
}
|
|
1607
|
-
});
|
|
1608
|
-
}
|
|
1609
|
-
}
|
|
1610
|
-
}
|
|
1611
|
-
}
|
|
1612
|
-
buildSavableEndUser() {
|
|
1613
|
-
if (!this.endUser) {
|
|
1614
|
-
throw new Error('No template user loaded');
|
|
1615
|
-
}
|
|
1616
|
-
return buildSavableEndUser(this.endUser, this.lines, this.devices, this.deviceProfiles, this.userDetailsForm, {
|
|
1617
|
-
resolveDeviceName: (index, device) => this.resolveDeviceNameForSave(index, device),
|
|
1618
|
-
resolveDeviceProfileName: (index, profile) => this.resolveDeviceNameForSave(index, profile),
|
|
1619
|
-
});
|
|
1620
|
-
}
|
|
1621
|
-
resolveDeviceNameForSave(_index, device) {
|
|
1622
|
-
const rawName = (device.name || device.newName || '').trim();
|
|
1623
|
-
if (!rawName) {
|
|
1624
|
-
return '';
|
|
1625
|
-
}
|
|
1626
|
-
const prefix = device.prefix?.trim();
|
|
1627
|
-
if (prefix && !rawName.toUpperCase().startsWith(prefix.toUpperCase())) {
|
|
1628
|
-
return `${prefix}${rawName}`;
|
|
1629
|
-
}
|
|
1630
|
-
return rawName;
|
|
1631
|
-
}
|
|
1632
|
-
saveNewUser() {
|
|
1633
|
-
const user = this.buildSavableEndUser();
|
|
1634
|
-
const siteId = String(this.selectedSite ?? '');
|
|
1635
|
-
const templateId = String(this.selectedTemplateId ?? '');
|
|
1636
|
-
return this.userCreationApiService.saveTemplateUser(user, templateId, siteId);
|
|
1637
|
-
}
|
|
1638
704
|
}
|
|
1639
705
|
UserCreationWizardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1640
706
|
UserCreationWizardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardService });
|
|
@@ -1642,516 +708,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1642
708
|
type: Injectable
|
|
1643
709
|
}], ctorParameters: function () { return []; } });
|
|
1644
710
|
|
|
1645
|
-
class AppLoaderComponent {
|
|
1646
|
-
constructor() {
|
|
1647
|
-
}
|
|
1648
|
-
}
|
|
1649
|
-
AppLoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1650
|
-
AppLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AppLoaderComponent, selector: "app-loader", ngImport: i0, template: "<div class=\"overlay\">\n <mat-progress-spinner\n class=\"page-spinner\"\n mode=\"indeterminate\"\n [diameter]=\"70\"\n strokeWidth=\"3\"></mat-progress-spinner>\n</div>\n", styles: [".overlay{position:fixed;width:100%;height:100%;inset:0;background-color:#fff3;z-index:200;display:flex;justify-content:center;align-items:center}\n"], dependencies: [{ kind: "component", type: i1$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1651
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppLoaderComponent, decorators: [{
|
|
1652
|
-
type: Component,
|
|
1653
|
-
args: [{ selector: 'app-loader', encapsulation: ViewEncapsulation.None, template: "<div class=\"overlay\">\n <mat-progress-spinner\n class=\"page-spinner\"\n mode=\"indeterminate\"\n [diameter]=\"70\"\n strokeWidth=\"3\"></mat-progress-spinner>\n</div>\n", styles: [".overlay{position:fixed;width:100%;height:100%;inset:0;background-color:#fff3;z-index:200;display:flex;justify-content:center;align-items:center}\n"] }]
|
|
1654
|
-
}], ctorParameters: function () { return []; } });
|
|
1655
|
-
|
|
1656
|
-
const LDAP_PAGE_SIZE = 10;
|
|
1657
711
|
class UserDetailsStepComponent {
|
|
1658
|
-
|
|
1659
|
-
return this.userDetailsForm.get('lines');
|
|
1660
|
-
}
|
|
1661
|
-
get devicesFormArray() {
|
|
1662
|
-
return this.userDetailsForm.get('devices');
|
|
1663
|
-
}
|
|
1664
|
-
get deviceProfilesFormArray() {
|
|
1665
|
-
return this.userDetailsForm.get('deviceProfiles');
|
|
1666
|
-
}
|
|
1667
|
-
get selectedLdapUser() {
|
|
1668
|
-
return this.userCreationWizardService.selectedLdapUser;
|
|
1669
|
-
}
|
|
1670
|
-
get ldapTotalCount() {
|
|
1671
|
-
return this.userCreationWizardService.ldapUsersTotal;
|
|
1672
|
-
}
|
|
1673
|
-
get hasLdapUsers() {
|
|
1674
|
-
return this.userCreationWizardService.ldapUsers.length > 0;
|
|
1675
|
-
}
|
|
1676
|
-
constructor(fb, userCreationApiService, userCreationWizardService) {
|
|
1677
|
-
this.fb = fb;
|
|
1678
|
-
this.userCreationApiService = userCreationApiService;
|
|
712
|
+
constructor(userCreationWizardService) {
|
|
1679
713
|
this.userCreationWizardService = userCreationWizardService;
|
|
1680
|
-
this.validityChange = new EventEmitter();
|
|
1681
|
-
this.userIdCheckPending = false;
|
|
1682
|
-
this.loadingAvailableNumbers = false;
|
|
1683
|
-
this.ldapLoading = false;
|
|
1684
|
-
this.ldapSearchAttempted = false;
|
|
1685
|
-
this.ldapPageSize = LDAP_PAGE_SIZE;
|
|
1686
|
-
this.ldapPageIndex = 0;
|
|
1687
|
-
this.ldapQueryTypeOptions = [
|
|
1688
|
-
{ label: 'User ID', value: 'userId' },
|
|
1689
|
-
{ label: 'First Name', value: 'firstName' },
|
|
1690
|
-
{ label: 'Last Name', value: 'lastName' },
|
|
1691
|
-
];
|
|
1692
|
-
this.filteredAvailableNumbersByLine = [];
|
|
1693
|
-
this.filteredRoutePartitionsByLine = [];
|
|
1694
|
-
this.destroy$ = new Subject();
|
|
1695
|
-
this.userIdAsyncValidator = this.createUserIdAsyncValidator();
|
|
1696
|
-
this.ldapSearchForm = this.fb.group({
|
|
1697
|
-
queryValue: [''],
|
|
1698
|
-
queryType: ['userId'],
|
|
1699
|
-
});
|
|
1700
|
-
this.userDetailsForm = this.fb.group({
|
|
1701
|
-
userId: ['', [Validators.required], [this.userIdAsyncValidator]],
|
|
1702
|
-
firstName: ['', Validators.required],
|
|
1703
|
-
lastName: ['', Validators.required],
|
|
1704
|
-
email: ['', [Validators.required, Validators.email]],
|
|
1705
|
-
lines: this.fb.array([]),
|
|
1706
|
-
devices: this.fb.array([]),
|
|
1707
|
-
deviceProfiles: this.fb.array([]),
|
|
1708
|
-
});
|
|
1709
|
-
}
|
|
1710
|
-
ngOnInit() {
|
|
1711
|
-
const savedFormValue = this.userCreationWizardService.userDetailsFormValue;
|
|
1712
|
-
const isRestoringPreviousEntry = !!savedFormValue;
|
|
1713
|
-
if (!isRestoringPreviousEntry) {
|
|
1714
|
-
this.resetLdapSearchForm();
|
|
1715
|
-
}
|
|
1716
|
-
this.buildDynamicFormArrays(savedFormValue);
|
|
1717
|
-
if (isRestoringPreviousEntry) {
|
|
1718
|
-
this.patchUserFieldsFromSavedValue(savedFormValue);
|
|
1719
|
-
}
|
|
1720
|
-
else {
|
|
1721
|
-
this.patchUserFieldsFromService();
|
|
1722
|
-
}
|
|
1723
|
-
this.initLineFilters();
|
|
1724
|
-
this.setupFormSync();
|
|
1725
|
-
this.setupValidityEmitter();
|
|
1726
|
-
this.fetchInitialAvailableNumbers();
|
|
1727
|
-
if (!isRestoringPreviousEntry) {
|
|
1728
|
-
this.userCreationWizardService.applyUserDetailsFormValue(this.userDetailsForm.getRawValue());
|
|
1729
|
-
}
|
|
1730
|
-
this.applyDeviceNameValidators();
|
|
1731
|
-
this.userCreationWizardService.deviceDefaultsLoaded$
|
|
1732
|
-
.pipe(takeUntil(this.destroy$))
|
|
1733
|
-
.subscribe(() => {
|
|
1734
|
-
this.applyDeviceNameValidators();
|
|
1735
|
-
this.emitValidity();
|
|
1736
|
-
});
|
|
1737
|
-
if (this.userCreationWizardService.isLdapIntegrated && this.selectedLdapUser) {
|
|
1738
|
-
this.applyLdapIntegratedFormState();
|
|
1739
|
-
}
|
|
1740
|
-
this.emitValidity();
|
|
1741
|
-
}
|
|
1742
|
-
ngOnDestroy() {
|
|
1743
|
-
this.destroy$.next();
|
|
1744
|
-
this.destroy$.complete();
|
|
1745
|
-
}
|
|
1746
|
-
isStepValid() {
|
|
1747
|
-
return this.userDetailsForm.valid && !this.userIdCheckPending;
|
|
1748
|
-
}
|
|
1749
|
-
markAllAsTouched() {
|
|
1750
|
-
this.userDetailsForm.markAllAsTouched();
|
|
1751
|
-
this.emitValidity();
|
|
1752
|
-
}
|
|
1753
|
-
syncToService() {
|
|
1754
|
-
this.userCreationWizardService.applyUserDetailsFormValue(this.userDetailsForm.getRawValue());
|
|
1755
|
-
}
|
|
1756
|
-
getLineGroup(index) {
|
|
1757
|
-
return this.linesFormArray.at(index);
|
|
1758
|
-
}
|
|
1759
|
-
getDeviceGroup(index) {
|
|
1760
|
-
return this.devicesFormArray.at(index);
|
|
1761
714
|
}
|
|
1762
|
-
|
|
1763
|
-
|
|
715
|
+
onAddUser(row) {
|
|
716
|
+
this.userCreationWizardService.addLdapUser(row);
|
|
1764
717
|
}
|
|
1765
|
-
|
|
1766
|
-
return this.userCreationWizardService.
|
|
1767
|
-
}
|
|
1768
|
-
getDeviceProfileNamePrefix(index) {
|
|
1769
|
-
return this.userCreationWizardService.getDeviceNamePrefix(index, true);
|
|
1770
|
-
}
|
|
1771
|
-
getDeviceNameValidationCaption(index) {
|
|
1772
|
-
return this.userCreationWizardService.getDeviceNameValidationCaption(index, false);
|
|
1773
|
-
}
|
|
1774
|
-
getDeviceProfileNameValidationCaption(index) {
|
|
1775
|
-
return this.userCreationWizardService.getDeviceNameValidationCaption(index, true);
|
|
1776
|
-
}
|
|
1777
|
-
getFilteredNumbers(lineIndex) {
|
|
1778
|
-
return this.filteredAvailableNumbersByLine[lineIndex] ?? [];
|
|
1779
|
-
}
|
|
1780
|
-
getFilteredRoutePartitions(lineIndex) {
|
|
1781
|
-
return this.filteredRoutePartitionsByLine[lineIndex] ?? [];
|
|
1782
|
-
}
|
|
1783
|
-
filterAvailableNumbers(lineIndex, event) {
|
|
1784
|
-
const raw = event.target?.value || '';
|
|
1785
|
-
this.applyNumberFilter(lineIndex, raw);
|
|
1786
|
-
}
|
|
1787
|
-
filterRoutePartitions(lineIndex, event) {
|
|
1788
|
-
const raw = event.target?.value || '';
|
|
1789
|
-
this.applyRoutePartitionFilter(lineIndex, raw);
|
|
1790
|
-
}
|
|
1791
|
-
onRoutePartitionSelected(lineIndex, routePartition) {
|
|
1792
|
-
const lineGroup = this.linesFormArray.at(lineIndex);
|
|
1793
|
-
lineGroup.get('routePartition')?.setValue(routePartition, { emitEvent: false });
|
|
1794
|
-
lineGroup.get('number')?.setValue('');
|
|
1795
|
-
this.applyRoutePartitionFilter(lineIndex, routePartition);
|
|
1796
|
-
this.loadAvailableNumbersForLine(lineIndex, routePartition);
|
|
1797
|
-
}
|
|
1798
|
-
onNumberSelected(lineIndex, number) {
|
|
1799
|
-
const lineGroup = this.linesFormArray.at(lineIndex);
|
|
1800
|
-
const displayNumber = this.extractDirectoryNumber(number);
|
|
1801
|
-
lineGroup.get('number')?.setValue(displayNumber, { emitEvent: true });
|
|
1802
|
-
}
|
|
1803
|
-
searchLdapUsers(pageIndex = 0) {
|
|
1804
|
-
const queryValue = String(this.ldapSearchForm.get('queryValue')?.value).trim() || undefined;
|
|
1805
|
-
const siteId = this.userCreationWizardService.selectedSite;
|
|
1806
|
-
if (!siteId) {
|
|
1807
|
-
this.userCreationWizardService.setLdapUsersResult([], 0);
|
|
1808
|
-
this.ldapPageIndex = 0;
|
|
1809
|
-
this.ldapSearchAttempted = false;
|
|
1810
|
-
return;
|
|
1811
|
-
}
|
|
1812
|
-
this.ldapPageIndex = pageIndex;
|
|
1813
|
-
const queryType = this.ldapSearchForm.get('queryType')?.value;
|
|
1814
|
-
const params = {
|
|
1815
|
-
size: String(LDAP_PAGE_SIZE),
|
|
1816
|
-
page: String(pageIndex),
|
|
1817
|
-
deviceless: 'true',
|
|
1818
|
-
querytype: queryType,
|
|
1819
|
-
withEmailOnly: 'true',
|
|
1820
|
-
queryvalue: queryValue,
|
|
1821
|
-
};
|
|
1822
|
-
this.ldapLoading = true;
|
|
1823
|
-
this.userCreationApiService
|
|
1824
|
-
.getLdapUsers(String(siteId), params)
|
|
1825
|
-
.pipe(take(1), map((res) => ({
|
|
1826
|
-
users: res?.pageData ?? [],
|
|
1827
|
-
total: res?.total ?? 0,
|
|
1828
|
-
})), catchError(() => of({ users: [], total: 0 })), finalize(() => {
|
|
1829
|
-
this.ldapLoading = false;
|
|
1830
|
-
}))
|
|
1831
|
-
.subscribe(({ users, total }) => {
|
|
1832
|
-
this.ldapSearchAttempted = true;
|
|
1833
|
-
this.userCreationWizardService.setLdapUsersResult(users, total);
|
|
1834
|
-
});
|
|
1835
|
-
}
|
|
1836
|
-
onLdapPageChange(event) {
|
|
1837
|
-
this.searchLdapUsers(event.pageIndex);
|
|
1838
|
-
}
|
|
1839
|
-
onAddLdapUser(row) {
|
|
1840
|
-
this.userCreationWizardService.selectLdapUser(row);
|
|
1841
|
-
this.userDetailsForm.patchValue({
|
|
1842
|
-
userId: row.userid,
|
|
1843
|
-
firstName: row.firstName ?? '',
|
|
1844
|
-
lastName: row.lastName ?? '',
|
|
1845
|
-
email: row.email ?? '',
|
|
1846
|
-
});
|
|
1847
|
-
this.applyLdapIntegratedFormState();
|
|
1848
|
-
this.emitValidity();
|
|
1849
|
-
}
|
|
1850
|
-
onDeleteLdapUser(row) {
|
|
1851
|
-
if (!this.userCreationWizardService.isLdapUserRowSelected(row)) {
|
|
1852
|
-
return;
|
|
1853
|
-
}
|
|
1854
|
-
this.clearLdapSelection();
|
|
1855
|
-
}
|
|
1856
|
-
onRemoveLdapTag() {
|
|
1857
|
-
this.clearLdapSelection();
|
|
1858
|
-
}
|
|
1859
|
-
isLdapUserRowSelected(row) {
|
|
1860
|
-
return this.userCreationWizardService.isLdapUserRowSelected(row);
|
|
1861
|
-
}
|
|
1862
|
-
clearLdapSelection() {
|
|
1863
|
-
this.userCreationWizardService.clearLdapUserSelection();
|
|
1864
|
-
this.userDetailsForm.patchValue({
|
|
1865
|
-
userId: '',
|
|
1866
|
-
firstName: '',
|
|
1867
|
-
lastName: '',
|
|
1868
|
-
email: '',
|
|
1869
|
-
});
|
|
1870
|
-
this.restoreManualEntryFormState();
|
|
1871
|
-
this.emitValidity();
|
|
1872
|
-
}
|
|
1873
|
-
applyLdapIntegratedFormState() {
|
|
1874
|
-
this.setUserIdentityFieldsReadonly(true);
|
|
1875
|
-
this.toggleUserIdAsyncValidator(false);
|
|
1876
|
-
this.userDetailsForm.get('userId')?.updateValueAndValidity({ emitEvent: false });
|
|
1877
|
-
}
|
|
1878
|
-
restoreManualEntryFormState() {
|
|
1879
|
-
this.setUserIdentityFieldsReadonly(false);
|
|
1880
|
-
this.toggleUserIdAsyncValidator(true);
|
|
1881
|
-
this.userDetailsForm.get('userId')?.updateValueAndValidity();
|
|
1882
|
-
}
|
|
1883
|
-
setUserIdentityFieldsReadonly(readonly) {
|
|
1884
|
-
['userId', 'firstName', 'lastName', 'email'].forEach(fieldName => {
|
|
1885
|
-
const control = this.userDetailsForm.get(fieldName);
|
|
1886
|
-
if (!control) {
|
|
1887
|
-
return;
|
|
1888
|
-
}
|
|
1889
|
-
if (readonly) {
|
|
1890
|
-
control.disable({ emitEvent: false });
|
|
1891
|
-
}
|
|
1892
|
-
else {
|
|
1893
|
-
control.enable({ emitEvent: false });
|
|
1894
|
-
}
|
|
1895
|
-
});
|
|
1896
|
-
}
|
|
1897
|
-
toggleUserIdAsyncValidator(enabled) {
|
|
1898
|
-
const control = this.userDetailsForm.get('userId');
|
|
1899
|
-
if (!control) {
|
|
1900
|
-
return;
|
|
1901
|
-
}
|
|
1902
|
-
if (enabled) {
|
|
1903
|
-
control.setAsyncValidators([this.userIdAsyncValidator]);
|
|
1904
|
-
}
|
|
1905
|
-
else {
|
|
1906
|
-
control.clearAsyncValidators();
|
|
1907
|
-
}
|
|
1908
|
-
control.updateValueAndValidity({ emitEvent: false });
|
|
1909
|
-
}
|
|
1910
|
-
setupValidityEmitter() {
|
|
1911
|
-
this.userDetailsForm.statusChanges
|
|
1912
|
-
.pipe(startWith(this.userDetailsForm.status), takeUntil(this.destroy$))
|
|
1913
|
-
.subscribe(() => this.emitValidity());
|
|
1914
|
-
}
|
|
1915
|
-
emitValidity() {
|
|
1916
|
-
this.validityChange.emit(this.isStepValid());
|
|
1917
|
-
}
|
|
1918
|
-
buildDynamicFormArrays(savedFormValue) {
|
|
1919
|
-
const service = this.userCreationWizardService;
|
|
1920
|
-
const linesArray = this.linesFormArray;
|
|
1921
|
-
const devicesArray = this.devicesFormArray;
|
|
1922
|
-
const profilesArray = this.deviceProfilesFormArray;
|
|
1923
|
-
while (linesArray.length) {
|
|
1924
|
-
linesArray.removeAt(0);
|
|
1925
|
-
}
|
|
1926
|
-
while (devicesArray.length) {
|
|
1927
|
-
devicesArray.removeAt(0);
|
|
1928
|
-
}
|
|
1929
|
-
while (profilesArray.length) {
|
|
1930
|
-
profilesArray.removeAt(0);
|
|
1931
|
-
}
|
|
1932
|
-
service.lines.forEach((line, index) => {
|
|
1933
|
-
const savedLine = savedFormValue?.lines?.[index];
|
|
1934
|
-
const lineGroup = this.fb.group({
|
|
1935
|
-
lineNumber: [
|
|
1936
|
-
{
|
|
1937
|
-
value: line.directoryNumber?.templateDirectoryNumber || '',
|
|
1938
|
-
disabled: true,
|
|
1939
|
-
},
|
|
1940
|
-
],
|
|
1941
|
-
number: [
|
|
1942
|
-
savedLine?.number ?? line.directoryNumber?.directoryNumber ?? '',
|
|
1943
|
-
Validators.required,
|
|
1944
|
-
],
|
|
1945
|
-
routePartition: [
|
|
1946
|
-
savedLine?.routePartition ?? line.directoryNumber?.routePartitionName ?? '',
|
|
1947
|
-
Validators.required,
|
|
1948
|
-
],
|
|
1949
|
-
});
|
|
1950
|
-
linesArray.push(lineGroup);
|
|
1951
|
-
this.setupLineListeners(index, lineGroup);
|
|
1952
|
-
});
|
|
1953
|
-
service.devices.forEach((device, index) => {
|
|
1954
|
-
const savedDevice = savedFormValue?.devices?.[index];
|
|
1955
|
-
devicesArray.push(this.fb.group({
|
|
1956
|
-
deviceType: [{ value: device.deviceType || '', disabled: true }],
|
|
1957
|
-
protocol: [{ value: device.protocol || '', disabled: true }],
|
|
1958
|
-
buttonTemplate: [{ value: device.buttonTemplate || '', disabled: true }],
|
|
1959
|
-
name: [
|
|
1960
|
-
savedDevice?.name ?? device.name ?? '',
|
|
1961
|
-
this.buildDeviceNameValidators(index, false),
|
|
1962
|
-
],
|
|
1963
|
-
}));
|
|
1964
|
-
});
|
|
1965
|
-
service.deviceProfiles.forEach((profile, index) => {
|
|
1966
|
-
const savedProfile = savedFormValue?.deviceProfiles?.[index];
|
|
1967
|
-
profilesArray.push(this.fb.group({
|
|
1968
|
-
deviceType: [{ value: profile.deviceType || '', disabled: true }],
|
|
1969
|
-
protocol: [{ value: profile.protocol || '', disabled: true }],
|
|
1970
|
-
buttonTemplate: [{ value: profile.buttonTemplate || '', disabled: true }],
|
|
1971
|
-
name: [
|
|
1972
|
-
savedProfile?.name ?? profile.name ?? '',
|
|
1973
|
-
this.buildDeviceNameValidators(index, true),
|
|
1974
|
-
],
|
|
1975
|
-
}));
|
|
1976
|
-
});
|
|
1977
|
-
}
|
|
1978
|
-
buildDeviceNameValidators(deviceIndex, isProfile) {
|
|
1979
|
-
const validators = isProfile ? [] : [Validators.required];
|
|
1980
|
-
const options = this.userCreationWizardService.getDeviceNameValidationOptions(deviceIndex, isProfile);
|
|
1981
|
-
if (options) {
|
|
1982
|
-
validators.push(deviceNameValidator(options));
|
|
1983
|
-
}
|
|
1984
|
-
return validators;
|
|
1985
|
-
}
|
|
1986
|
-
applyDeviceNameValidators() {
|
|
1987
|
-
this.devicesFormArray.controls.forEach((_, index) => {
|
|
1988
|
-
const nameControl = this.getDeviceGroup(index).get('name');
|
|
1989
|
-
nameControl?.setValidators(this.buildDeviceNameValidators(index, false));
|
|
1990
|
-
nameControl?.updateValueAndValidity({ emitEvent: false });
|
|
1991
|
-
});
|
|
1992
|
-
this.deviceProfilesFormArray.controls.forEach((_, index) => {
|
|
1993
|
-
const nameControl = this.getDeviceProfileGroup(index).get('name');
|
|
1994
|
-
nameControl?.setValidators(this.buildDeviceNameValidators(index, true));
|
|
1995
|
-
nameControl?.updateValueAndValidity({ emitEvent: false });
|
|
1996
|
-
});
|
|
1997
|
-
}
|
|
1998
|
-
resetLdapSearchForm() {
|
|
1999
|
-
this.ldapSearchForm.reset({
|
|
2000
|
-
queryValue: '',
|
|
2001
|
-
queryType: 'userId',
|
|
2002
|
-
});
|
|
2003
|
-
this.ldapSearchAttempted = false;
|
|
2004
|
-
this.ldapPageIndex = 0;
|
|
2005
|
-
this.userIdCheckPending = false;
|
|
2006
|
-
}
|
|
2007
|
-
patchUserFieldsFromSavedValue(saved) {
|
|
2008
|
-
this.userDetailsForm.patchValue({
|
|
2009
|
-
userId: saved.userId || '',
|
|
2010
|
-
firstName: saved.firstName || '',
|
|
2011
|
-
lastName: saved.lastName || '',
|
|
2012
|
-
email: saved.email || '',
|
|
2013
|
-
});
|
|
2014
|
-
}
|
|
2015
|
-
patchUserFieldsFromService() {
|
|
2016
|
-
const service = this.userCreationWizardService;
|
|
2017
|
-
const endUser = service.endUser;
|
|
2018
|
-
this.userDetailsForm.patchValue({
|
|
2019
|
-
userId: endUser?.userid || service.userDetailsForm.userId || '',
|
|
2020
|
-
firstName: endUser?.firstName || service.userDetailsForm.firstName || '',
|
|
2021
|
-
lastName: endUser?.lastName || service.userDetailsForm.lastName || '',
|
|
2022
|
-
email: endUser?.email || service.userDetailsForm.email || '',
|
|
2023
|
-
});
|
|
2024
|
-
this.userDetailsForm.markAsPristine();
|
|
2025
|
-
this.userDetailsForm.markAsUntouched();
|
|
2026
|
-
}
|
|
2027
|
-
setupLineListeners(lineIndex, lineGroup) {
|
|
2028
|
-
lineGroup
|
|
2029
|
-
.get('routePartition')
|
|
2030
|
-
?.valueChanges.pipe(debounceTime(300), takeUntil(this.destroy$))
|
|
2031
|
-
.subscribe(value => {
|
|
2032
|
-
this.applyRoutePartitionFilter(lineIndex, String(value ?? ''));
|
|
2033
|
-
});
|
|
2034
|
-
lineGroup
|
|
2035
|
-
.get('number')
|
|
2036
|
-
?.valueChanges.pipe(debounceTime(150), takeUntil(this.destroy$))
|
|
2037
|
-
.subscribe(value => {
|
|
2038
|
-
this.applyNumberFilter(lineIndex, String(value ?? ''));
|
|
2039
|
-
});
|
|
2040
|
-
}
|
|
2041
|
-
initLineFilters() {
|
|
2042
|
-
const partitions = this.userCreationWizardService.routePartitionOptions;
|
|
2043
|
-
const numbers = this.userCreationWizardService.availableNumbers;
|
|
2044
|
-
this.filteredRoutePartitionsByLine = this.linesFormArray.controls.map((_, index) => {
|
|
2045
|
-
const current = String(this.linesFormArray.at(index).get('routePartition')?.value ?? '');
|
|
2046
|
-
return this.filterOptions(partitions, current);
|
|
2047
|
-
});
|
|
2048
|
-
this.filteredAvailableNumbersByLine = this.linesFormArray.controls.map((_, index) => {
|
|
2049
|
-
const current = String(this.linesFormArray.at(index).get('number')?.value ?? '');
|
|
2050
|
-
return this.filterOptions(numbers, current);
|
|
2051
|
-
});
|
|
2052
|
-
}
|
|
2053
|
-
setupFormSync() {
|
|
2054
|
-
this.userDetailsForm.valueChanges
|
|
2055
|
-
.pipe(debounceTime(200), takeUntil(this.destroy$))
|
|
2056
|
-
.subscribe(() => {
|
|
2057
|
-
this.userCreationWizardService.applyUserDetailsFormValue(this.userDetailsForm.getRawValue());
|
|
2058
|
-
});
|
|
2059
|
-
}
|
|
2060
|
-
fetchInitialAvailableNumbers() {
|
|
2061
|
-
const firstPartition = this.linesFormArray.length > 0
|
|
2062
|
-
? String(this.linesFormArray.at(0).get('routePartition')?.value ?? '').trim()
|
|
2063
|
-
: this.userCreationWizardService.firstLineRoutePartition ||
|
|
2064
|
-
this.userCreationWizardService.siteDefaultRoutePartition ||
|
|
2065
|
-
'';
|
|
2066
|
-
if (firstPartition) {
|
|
2067
|
-
this.loadAvailableNumbersForLine(0, firstPartition, false);
|
|
2068
|
-
}
|
|
2069
|
-
}
|
|
2070
|
-
loadAvailableNumbersForLine(lineIndex, routePartition, clearNumber = true) {
|
|
2071
|
-
const siteId = this.userCreationWizardService.selectedSite;
|
|
2072
|
-
if (!siteId || !routePartition.trim()) {
|
|
2073
|
-
return;
|
|
2074
|
-
}
|
|
2075
|
-
if (clearNumber) {
|
|
2076
|
-
this.linesFormArray.at(lineIndex).get('number')?.setValue('');
|
|
2077
|
-
}
|
|
2078
|
-
this.loadingAvailableNumbers = true;
|
|
2079
|
-
this.userCreationWizardService
|
|
2080
|
-
.getNumberRange(String(siteId), routePartition)
|
|
2081
|
-
.pipe(take(1), catchError(() => of(null)), finalize(() => {
|
|
2082
|
-
this.loadingAvailableNumbers = false;
|
|
2083
|
-
this.refreshNumberFilters();
|
|
2084
|
-
}))
|
|
2085
|
-
.subscribe();
|
|
2086
|
-
}
|
|
2087
|
-
refreshNumberFilters() {
|
|
2088
|
-
const numbers = this.userCreationWizardService.availableNumbers;
|
|
2089
|
-
this.filteredAvailableNumbersByLine = this.linesFormArray.controls.map((_, index) => {
|
|
2090
|
-
const current = String(this.linesFormArray.at(index).get('number')?.value ?? '');
|
|
2091
|
-
return this.filterOptions(numbers, current);
|
|
2092
|
-
});
|
|
2093
|
-
}
|
|
2094
|
-
applyNumberFilter(lineIndex, raw) {
|
|
2095
|
-
const value = raw.trim().toLowerCase();
|
|
2096
|
-
const source = this.userCreationWizardService.availableNumbers || [];
|
|
2097
|
-
this.filteredAvailableNumbersByLine[lineIndex] = value.length
|
|
2098
|
-
? source.filter(n => !!n && n.toLowerCase().includes(value))
|
|
2099
|
-
: [...source];
|
|
2100
|
-
}
|
|
2101
|
-
applyRoutePartitionFilter(lineIndex, raw) {
|
|
2102
|
-
const value = raw.trim().toLowerCase();
|
|
2103
|
-
const source = this.userCreationWizardService.routePartitionOptions || [];
|
|
2104
|
-
this.filteredRoutePartitionsByLine[lineIndex] = value.length
|
|
2105
|
-
? source.filter(n => !!n && n.toLowerCase().includes(value))
|
|
2106
|
-
: [...source];
|
|
2107
|
-
}
|
|
2108
|
-
filterOptions(source, raw) {
|
|
2109
|
-
const value = raw.trim().toLowerCase();
|
|
2110
|
-
if (!value.length) {
|
|
2111
|
-
return [...source];
|
|
2112
|
-
}
|
|
2113
|
-
return source.filter(item => !!item && item.toLowerCase().includes(value));
|
|
2114
|
-
}
|
|
2115
|
-
extractDirectoryNumber(value) {
|
|
2116
|
-
const trimmed = value.trim();
|
|
2117
|
-
const spaceIndex = trimmed.indexOf(' ');
|
|
2118
|
-
return spaceIndex > -1 ? trimmed.substring(0, spaceIndex) : trimmed;
|
|
2119
|
-
}
|
|
2120
|
-
createUserIdAsyncValidator() {
|
|
2121
|
-
return (control) => {
|
|
2122
|
-
if (this.userCreationWizardService.isLdapIntegrated) {
|
|
2123
|
-
this.userIdCheckPending = false;
|
|
2124
|
-
return of(null);
|
|
2125
|
-
}
|
|
2126
|
-
const userId = String(control.value ?? '').trim();
|
|
2127
|
-
const siteId = this.userCreationWizardService.selectedSite;
|
|
2128
|
-
if (!userId || !siteId) {
|
|
2129
|
-
this.userIdCheckPending = false;
|
|
2130
|
-
this.emitValidity();
|
|
2131
|
-
return of(null);
|
|
2132
|
-
}
|
|
2133
|
-
this.userIdCheckPending = true;
|
|
2134
|
-
this.emitValidity();
|
|
2135
|
-
return timer(500).pipe(switchMap(() => this.userCreationApiService
|
|
2136
|
-
.checkUserIdExisting(String(siteId), encodeURIComponent(encodeURIComponent(userId)))
|
|
2137
|
-
.pipe(map(() => ({ userIdExists: true })), catchError(() => of(null)))), tap(() => {
|
|
2138
|
-
this.userIdCheckPending = false;
|
|
2139
|
-
this.emitValidity();
|
|
2140
|
-
}), finalize(() => {
|
|
2141
|
-
this.userIdCheckPending = false;
|
|
2142
|
-
this.emitValidity();
|
|
2143
|
-
}));
|
|
2144
|
-
};
|
|
718
|
+
getDeviceName(index) {
|
|
719
|
+
return this.userCreationWizardService.getDeviceDisplayName(index);
|
|
2145
720
|
}
|
|
2146
721
|
}
|
|
2147
|
-
UserDetailsStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserDetailsStepComponent, deps: [{ token:
|
|
2148
|
-
UserDetailsStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserDetailsStepComponent, selector: "tk-user-details-step", outputs: { validityChange: "validityChange" }, ngImport: i0, template: "<app-loader *ngIf=\"loadingAvailableNumbers\"></app-loader>\r\n<section class=\"details-step-content\">\r\n <form [formGroup]=\"userDetailsForm\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"details-step-section__part\">\r\n <div class=\"details-inline-fields\">\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User ID</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"User ID\" formControlName=\"userId\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('userId')?.hasError('required') && userDetailsForm.get('userId')?.touched\">\r\n User ID is required\r\n </mat-error>\r\n <mat-error *ngIf=\"userDetailsForm.get('userId')?.hasError('userIdExists') && userDetailsForm.get('userId')?.touched\">\r\n User ID already exists\r\n </mat-error>\r\n <mat-hint *ngIf=\"userIdCheckPending\">Checking user ID...</mat-hint>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">First Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"First Name\" formControlName=\"firstName\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('firstName')?.hasError('required') && userDetailsForm.get('firstName')?.touched\">\r\n First name is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Last Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"Last Name\" formControlName=\"lastName\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('lastName')?.hasError('required') && userDetailsForm.get('lastName')?.touched\">\r\n Last name is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Email</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('email')?.invalid && userDetailsForm.get('email')?.touched\">\r\n <span *ngIf=\"userDetailsForm.get('email')?.hasError('required')\">Email is required</span>\r\n <span *ngIf=\"userDetailsForm.get('email')?.hasError('email')\">Please enter a valid email</span>\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"User Template\"\r\n [value]=\"userCreationWizardService.selectedTemplateName || ''\"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"details-step-section__part\">\r\n <mat-accordion class=\"details-user-accordion\">\r\n <mat-expansion-panel togglePosition=\"before\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>Choose an existing or a LDAP user</mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div class=\"details-user-accordion__content\">\r\n <div class=\"details-ldap-search\" [formGroup]=\"ldapSearchForm\">\r\n <mat-form-field\r\n class=\"details-ldap-search__input\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n >\r\n <input\r\n matInput\r\n placeholder=\"Search\"\r\n formControlName=\"queryValue\"\r\n (keyup.enter)=\"searchLdapUsers()\"\r\n />\r\n </mat-form-field>\r\n\r\n <mat-form-field\r\n class=\"details-ldap-search__select\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n >\r\n <mat-select formControlName=\"queryType\">\r\n <mat-option *ngFor=\"let option of ldapQueryTypeOptions\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-chip-list *ngIf=\"selectedLdapUser\" class=\"details-ldap-search__chip\">\r\n <mat-chip removable (removed)=\"onRemoveLdapTag()\">\r\n {{ selectedLdapUser.userid }}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n </mat-chip-list>\r\n\r\n <button\r\n mat-button\r\n class=\"details-ldap-search__btn\"\r\n type=\"button\"\r\n [disabled]=\"ldapLoading\"\r\n (click)=\"searchLdapUsers()\"\r\n >\r\n Search\r\n </button>\r\n </div>\r\n\r\n <app-loader *ngIf=\"ldapLoading\"></app-loader>\r\n\r\n <p\r\n *ngIf=\"!ldapLoading && ldapSearchAttempted && !hasLdapUsers\"\r\n class=\"details-ldap-table__empty\"\r\n >\r\n No users found\r\n </p>\r\n\r\n <table\r\n *ngIf=\"!ldapLoading && hasLdapUsers\"\r\n mat-table\r\n [dataSource]=\"userCreationWizardService.ldapUsers\"\r\n class=\"details-ldap-table\"\r\n >\r\n <ng-container matColumnDef=\"userId\">\r\n <th mat-header-cell *matHeaderCellDef>User Id</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.userid }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"firstName\">\r\n <th mat-header-cell *matHeaderCellDef>First Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.firstName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"lastName\">\r\n <th mat-header-cell *matHeaderCellDef>Last Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.lastName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"email\">\r\n <th mat-header-cell *matHeaderCellDef>Email</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.email }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"add\">\r\n <th mat-header-cell *matHeaderCellDef>Add</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <button\r\n *ngIf=\"!isLdapUserRowSelected(row); else deleteLdapUserBtn\"\r\n mat-button\r\n class=\"details-ldap-table__add-btn\"\r\n type=\"button\"\r\n (click)=\"onAddLdapUser(row)\"\r\n >\r\n Add User\r\n </button>\r\n <ng-template #deleteLdapUserBtn>\r\n <button\r\n mat-button\r\n class=\"details-ldap-table__add-btn details-ldap-table__add-btn--delete\"\r\n type=\"button\"\r\n (click)=\"onDeleteLdapUser(row)\"\r\n >\r\n Delete user\r\n </button>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"userCreationWizardService.ldapTableColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: userCreationWizardService.ldapTableColumns\"></tr>\r\n </table>\r\n\r\n <mat-paginator\r\n *ngIf=\"!ldapLoading && hasLdapUsers\"\r\n class=\"details-ldap-paginator\"\r\n [length]=\"ldapTotalCount\"\r\n [pageSize]=\"ldapPageSize\"\r\n [pageIndex]=\"ldapPageIndex\"\r\n [pageSizeOptions]=\"[ldapPageSize]\"\r\n [hidePageSize]=\"true\"\r\n [disabled]=\"ldapLoading\"\r\n (page)=\"onLdapPageChange($event)\"\r\n ></mat-paginator>\r\n </div>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\" formArrayName=\"lines\">\r\n <div class=\"line-route-list\">\r\n <div\r\n class=\"line-route-row\"\r\n *ngFor=\"let lineGroup of linesFormArray.controls; let idx = index\"\r\n [formGroupName]=\"idx\"\r\n >\r\n <div class=\"line-info\">\r\n <mat-form-field\r\n class=\"details-step-input line-route-field\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n hideRequiredMarker\r\n >\r\n <input matInput placeholder=\"Line number\" formControlName=\"lineNumber\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field\r\n class=\"details-step-input line-route-field\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n hideRequiredMarker\r\n >\r\n <input\r\n matInput\r\n placeholder=\"Search for a number\"\r\n formControlName=\"number\"\r\n [matAutocomplete]=\"numberAuto\"\r\n (input)=\"filterAvailableNumbers(idx, $event)\"\r\n />\r\n <mat-autocomplete\r\n #numberAuto=\"matAutocomplete\"\r\n [panelWidth]=\"'auto'\"\r\n (optionSelected)=\"onNumberSelected(idx, $event.option.value)\"\r\n >\r\n <mat-option *ngFor=\"let option of getFilteredNumbers(idx)\" [value]=\"option\">\r\n {{ option }}\r\n </mat-option>\r\n </mat-autocomplete>\r\n <mat-error *ngIf=\"getLineGroup(idx).get('number')?.invalid && getLineGroup(idx).get('number')?.touched\">\r\n Number is required\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n <mat-form-field\r\n class=\"details-step-input line-route-field\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n hideRequiredMarker\r\n >\r\n <input\r\n matInput\r\n placeholder=\"Select route partition\"\r\n formControlName=\"routePartition\"\r\n [matAutocomplete]=\"routePartitionAuto\"\r\n (input)=\"filterRoutePartitions(idx, $event)\"\r\n />\r\n <mat-autocomplete\r\n #routePartitionAuto=\"matAutocomplete\"\r\n (optionSelected)=\"onRoutePartitionSelected(idx, $event.option.value)\"\r\n >\r\n <mat-option\r\n *ngFor=\"let routePartition of getFilteredRoutePartitions(idx)\"\r\n [value]=\"routePartition\"\r\n >\r\n {{ routePartition }}\r\n </mat-option>\r\n </mat-autocomplete>\r\n <mat-error *ngIf=\"getLineGroup(idx).get('routePartition')?.invalid && getLineGroup(idx).get('routePartition')?.touched\">\r\n Route partition is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\" formArrayName=\"devices\">\r\n <div class=\"devices-rows\">\r\n <div\r\n class=\"details-inline-fields details-inline-fields--four\"\r\n *ngFor=\"let deviceGroup of devicesFormArray.controls; let idx = index\"\r\n [formGroupName]=\"idx\"\r\n >\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Device type</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"deviceType\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Protocol</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"protocol\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Button Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"buttonTemplate\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <span matPrefix *ngIf=\"getDeviceNamePrefix(idx) as devicePrefix\">{{ devicePrefix }}</span>\r\n <input matInput placeholder=\"Name\" formControlName=\"name\" />\r\n <mat-error *ngIf=\"getDeviceGroup(idx).get('name')?.hasError('deviceName') && getDeviceGroup(idx).get('name')?.touched\">\r\n {{ getDeviceGroup(idx).get('name')?.getError('deviceName')?.caption || getDeviceNameValidationCaption(idx) || 'Please enter a valid device name' }}\r\n </mat-error>\r\n <mat-error *ngIf=\"getDeviceGroup(idx).get('name')?.hasError('required') && getDeviceGroup(idx).get('name')?.touched\">\r\n Name is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\" *ngIf=\"deviceProfilesFormArray.length\">\r\n <h3 class=\"details-step-section__title\">Device profiles</h3>\r\n <div class=\"details-step-section__content\" formArrayName=\"deviceProfiles\">\r\n <div class=\"devices-rows\">\r\n <div\r\n class=\"details-inline-fields details-inline-fields--four\"\r\n *ngFor=\"let profileGroup of deviceProfilesFormArray.controls; let idx = index\"\r\n [formGroupName]=\"idx\"\r\n >\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Device type</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"deviceType\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Protocol</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"protocol\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Button Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"buttonTemplate\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <span matPrefix *ngIf=\"getDeviceProfileNamePrefix(idx) as profilePrefix\">{{ profilePrefix }}</span>\r\n <input matInput placeholder=\"Name\" formControlName=\"name\" />\r\n <mat-error *ngIf=\"getDeviceProfileGroup(idx).get('name')?.hasError('deviceName') && getDeviceProfileGroup(idx).get('name')?.touched\">\r\n {{ getDeviceProfileGroup(idx).get('name')?.getError('deviceName')?.caption || getDeviceProfileNameValidationCaption(idx) || 'Please enter a valid device name' }}\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n </form>\r\n</section>\r\n", styles: [".details-step-content{display:flex;flex-direction:column;gap:0}.details-step-dropdowns{display:flex;flex-direction:column;gap:1rem}.details-step-field{display:flex;flex-direction:column;gap:8px}.details-step-label{font-size:16px;font-weight:400;line-height:100%;letter-spacing:0;color:#333}.details-step-select{width:333px}.details-step-divider{border-top:1px solid #d9d9d9;margin-top:24px}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:0;padding:24px 0}.details-step-sections>.details-step-section:first-child{padding-top:0}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.details-step-section__content{margin-top:24px}.details-step-section__part+.details-step-section__part{margin-top:24px}.details-user-accordion{width:100%}.details-user-accordion__content{padding:12px 0 0}.details-ldap-search{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:16px}.details-ldap-search__input{min-width:180px;width:180px}.details-ldap-search__select{flex:0 1 180px;min-width:160px}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-wrapper,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-wrapper{padding-bottom:0;margin:0}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-flex,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:4px;padding:0 12px}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline,:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline-start,:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline-end,:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline-gap,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline-start,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline-end,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-infix,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-infix{width:100%;border-top:0;padding:0;display:flex;align-items:center;min-height:unset}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-input-element,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-input-element{margin:0;line-height:20px}:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-select-trigger{display:flex;align-items:center;width:100%;height:100%}:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-select-value{display:flex;align-items:center;max-width:100%}:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-select-arrow-wrapper{display:flex;align-items:center}.details-ldap-search__chip{flex:0 0 auto}.details-ldap-search__btn{flex:0 0 auto;min-width:0;padding:0 12px;font-family:Inter,sans-serif;font-size:14px;font-weight:500;color:#0d56aa}.details-ldap-paginator{margin-top:8px}.details-ldap-table__add-btn--delete{color:#c62828}.details-ldap-table{width:100%}.details-ldap-table__empty{margin:16px 0 8px;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#737480;text-align:center}.details-ldap-table__row--disabled{opacity:.35}.details-ldap-table__add-btn{min-width:0;padding:0;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#0d56aa}:host ::ng-deep .details-ldap-table .mat-header-cell{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:16px;letter-spacing:0;color:#737480;height:30px;padding:7px 8px}:host ::ng-deep .details-ldap-table .mat-cell{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0;color:#333;height:40px;padding:8px}.details-inline-fields{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}.details-inline-fields--four{grid-template-columns:repeat(4,minmax(0,1fr))}.devices-rows{display:flex;flex-direction:column;gap:24px}.details-inline-field{display:flex;flex-direction:column;gap:4px}.details-inline-field__label{color:#c0c2ce;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0}.details-step-input{width:100%}.line-route-list{display:flex;flex-direction:column;gap:16px}.line-route-row{display:flex;gap:16px}.line-info{display:flex;align-items:flex-start;gap:16px}.line-route-field{flex:1 1 180px;min-width:160px}.line-route-field{display:flex;flex-direction:column;gap:0}.line-route-field:nth-of-type(1) .line-route-select{width:230px}.line-route-field .line-route-select{width:185px}:host ::ng-deep .details-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-input .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-select .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .details-step-input .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:4px;padding:10px 8px}:host ::ng-deep .details-step-select .mat-form-field-outline,:host ::ng-deep .details-step-select .mat-form-field-outline-start,:host ::ng-deep .details-step-select .mat-form-field-outline-end,:host ::ng-deep .details-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-input .mat-form-field-outline,:host ::ng-deep .details-step-input .mat-form-field-outline-start,:host ::ng-deep .details-step-input .mat-form-field-outline-end,:host ::ng-deep .details-step-input .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-input .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}:host ::ng-deep .details-step-input .mat-input-element{height:100%;margin:0}:host ::ng-deep .details-step-input.mat-form-field-disabled .mat-form-field-flex{background-color:#f5f6fa;border-color:#b8beca;opacity:.55;cursor:not-allowed}:host ::ng-deep .details-step-input .mat-input-element:disabled{color:#7f8694;-webkit-text-fill-color:#7f8694;cursor:not-allowed}:host ::ng-deep .line-info .details-step-input .mat-form-field-flex{height:36px;padding:0 8px}:host ::ng-deep .line-info .details-step-input .mat-form-field-infix{padding:0}:host ::ng-deep .line-info .details-step-input .mat-input-element{font-size:14px;line-height:20px}:host ::ng-deep .mat-form-field-subscript-wrapper{position:relative}:host ::ng-deep .line-info .details-step-input .mat-form-field-subscript-wrapper{margin-top:4px;position:relative}:host ::ng-deep .details-user-accordion .mat-expansion-panel{border:0;border-radius:0!important;background:transparent;box-shadow:none!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header{padding:0 0 0 8px;min-height:32px;height:32px}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header-title{margin:0;display:flex;align-items:center;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#333}:host ::ng-deep .details-user-accordion .mat-expansion-panel-body{padding:0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-content{display:flex;align-items:center}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator{display:block!important;opacity:1!important;color:#333!important;align-self:center;margin:0 8px 0 0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator:after{color:#333!important;border-color:#333!important;position:relative;top:-4px}:host ::ng-deep .devices-rows .details-inline-fields .details-inline-field .mat-form-field .mat-form-field-flex{display:flex;gap:3px}:host ::ng-deep .devices-rows .details-inline-fields .details-inline-field .mat-form-field .mat-form-field-flex .mat-form-field-prefix{top:1px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i8.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i8.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i9.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i7$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i11.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i12.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i12.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i13.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: i14.MatChipList, selector: "mat-chip-list", inputs: ["role", "aria-describedby", "errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { kind: "directive", type: i14.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { kind: "directive", type: i14.MatChipRemove, selector: "[matChipRemove]" }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i15.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i15.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i15.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i15.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "component", type: AppLoaderComponent, selector: "app-loader" }] });
|
|
722
|
+
UserDetailsStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserDetailsStepComponent, deps: [{ token: UserCreationWizardService }], target: i0.ɵɵFactoryTarget.Component });
|
|
723
|
+
UserDetailsStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserDetailsStepComponent, selector: "tk-user-details-step", ngImport: i0, template: "<section class=\"details-step-content\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"details-step-section__part\">\r\n <div class=\"details-inline-fields\">\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User ID</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"User ID\"\r\n [value]=\"userCreationWizardService.userDetailsForm.userId\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'userId',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">First Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"First Name\"\r\n [value]=\"userCreationWizardService.userDetailsForm.firstName\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'firstName',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Last Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Last Name\"\r\n [value]=\"userCreationWizardService.userDetailsForm.lastName\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'lastName',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Email</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Email\"\r\n [value]=\"userCreationWizardService.userDetailsForm.email\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'email',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"User Template\"\r\n [value]=\"userCreationWizardService.selectedTemplate || ''\"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"details-step-section__part\">\r\n <mat-accordion class=\"details-user-accordion\">\r\n <mat-expansion-panel togglePosition=\"before\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title\r\n >Choose an existing or a LDAP user</mat-panel-title\r\n >\r\n </mat-expansion-panel-header>\r\n <div class=\"details-user-accordion__content\">\r\n <table\r\n mat-table\r\n [dataSource]=\"userCreationWizardService.ldapUsers\"\r\n class=\"details-ldap-table\"\r\n >\r\n <ng-container matColumnDef=\"userId\">\r\n <th mat-header-cell *matHeaderCellDef>User ID</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.userId }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"firstName\">\r\n <th mat-header-cell *matHeaderCellDef>First Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.firstName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"lastName\">\r\n <th mat-header-cell *matHeaderCellDef>Last Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.lastName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"email\">\r\n <th mat-header-cell *matHeaderCellDef>Email</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.email }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"add\">\r\n <th mat-header-cell *matHeaderCellDef>Add</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <button\r\n mat-button\r\n class=\"details-ldap-table__add-btn\"\r\n type=\"button\"\r\n [disabled]=\"\r\n userCreationWizardService.isLdapUserAdded(row)\r\n \"\r\n (click)=\"onAddUser(row)\"\r\n >\r\n Add user\r\n </button>\r\n </td>\r\n </ng-container>\r\n\r\n <tr\r\n mat-header-row\r\n *matHeaderRowDef=\"\r\n userCreationWizardService.ldapTableColumns\r\n \"\r\n ></tr>\r\n <tr\r\n mat-row\r\n *matRowDef=\"\r\n let row;\r\n columns: userCreationWizardService.ldapTableColumns\r\n \"\r\n [class.details-ldap-table__row--disabled]=\"\r\n userCreationWizardService.isLdapUserAdded(row)\r\n \"\r\n ></tr>\r\n </table>\r\n </div>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"line-route-list\">\r\n <div\r\n class=\"line-route-row\"\r\n *ngFor=\"\r\n let lineSelection of userCreationWizardService.lineSelections;\r\n let idx = index\r\n \"\r\n >\r\n <div class=\"line-route-field\">\r\n <mat-form-field\r\n class=\"details-step-select line-route-select\"\r\n appearance=\"outline\"\r\n >\r\n <mat-select\r\n placeholder=\"Select line\"\r\n [value]=\"lineSelection.lineNumber\"\r\n (selectionChange)=\"\r\n userCreationWizardService.setLineSelection(\r\n idx,\r\n $event.value\r\n )\r\n \"\r\n >\r\n <mat-option\r\n *ngFor=\"let line of userCreationWizardService.lineOptions\"\r\n [value]=\"line.number\"\r\n >\r\n {{ line.number }} - {{ line.did }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"line-route-field\">\r\n <mat-form-field\r\n class=\"details-step-select line-route-select\"\r\n appearance=\"outline\"\r\n >\r\n <mat-select\r\n placeholder=\"Select route partition\"\r\n [value]=\"lineSelection.routePartitionName\"\r\n (selectionChange)=\"\r\n userCreationWizardService.setRoutePartitionSelection(\r\n idx,\r\n $event.value\r\n )\r\n \"\r\n >\r\n <mat-option\r\n *ngFor=\"\r\n let partition of userCreationWizardService.routePartitionOptions\r\n \"\r\n [value]=\"partition\"\r\n >\r\n {{ partition }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"devices-rows\">\r\n <div\r\n class=\"details-inline-fields details-inline-fields--four\"\r\n *ngFor=\"\r\n let _row of userCreationWizardService.deviceRows;\r\n let idx = index\r\n \"\r\n >\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Device type</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Device type\"\r\n [value]=\"\r\n userCreationWizardService.deviceEntries[idx].deviceType ||\r\n ''\r\n \"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Protocol</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Protocol\"\r\n [value]=\"\r\n userCreationWizardService.deviceEntries[idx].protocol || ''\r\n \"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Button Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Button Template\"\r\n [value]=\"\r\n userCreationWizardService.deviceEntries[idx]\r\n .buttonTemplate || ''\r\n \"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Name\"\r\n [value]=\"getDeviceName(idx)\"\r\n (input)=\"\r\n userCreationWizardService.setDeviceName(\r\n idx,\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n</section>\r\n", styles: [".details-step-content{display:flex;flex-direction:column;gap:0}.details-step-dropdowns{display:flex;flex-direction:column;gap:1rem}.details-step-field{display:flex;flex-direction:column;gap:8px}.details-step-label{font-size:16px;font-weight:400;line-height:100%;letter-spacing:0;color:#333}.details-step-select{width:333px}.details-step-divider{border-top:1px solid #d9d9d9;margin-top:24px}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:0;padding:24px 0}.details-step-sections>.details-step-section:first-child{padding-top:0}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.details-step-section__content{margin-top:24px}.details-step-section__part+.details-step-section__part{margin-top:24px}.details-user-accordion{width:100%}.details-user-accordion__content{padding:12px 0 0}.details-ldap-table{width:100%}.details-ldap-table__row--disabled{opacity:.35}.details-ldap-table__add-btn{min-width:0;padding:0;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#0d56aa}:host ::ng-deep .details-ldap-table .mat-header-cell{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:16px;letter-spacing:0;color:#737480;height:30px;padding:7px 8px}:host ::ng-deep .details-ldap-table .mat-cell{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0;color:#333;height:40px;padding:8px}.details-inline-fields{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}.details-inline-fields--four{grid-template-columns:repeat(4,minmax(0,1fr))}.devices-rows{display:flex;flex-direction:column;gap:24px}.details-inline-field{display:flex;flex-direction:column;gap:4px}.details-inline-field__label{color:#c0c2ce;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0}.details-step-input{width:100%}.line-route-list{display:flex;flex-direction:column;gap:16px}.line-route-row{display:flex;gap:16px}.line-route-field{display:flex;flex-direction:column;gap:0}.line-route-field:nth-of-type(1) .line-route-select{width:230px}.line-route-field .line-route-select{width:185px}:host ::ng-deep .details-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-input .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-select .mat-form-field-flex{align-items:center;height:32px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .details-step-input .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:4px;padding:10px 8px}:host ::ng-deep .details-step-select .mat-form-field-outline,:host ::ng-deep .details-step-select .mat-form-field-outline-start,:host ::ng-deep .details-step-select .mat-form-field-outline-end,:host ::ng-deep .details-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-input .mat-form-field-outline,:host ::ng-deep .details-step-input .mat-form-field-outline-start,:host ::ng-deep .details-step-input .mat-form-field-outline-end,:host ::ng-deep .details-step-input .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-input .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}:host ::ng-deep .details-step-input .mat-input-element{height:100%;margin:0}:host ::ng-deep .details-step-input.mat-form-field-disabled .mat-form-field-flex{background-color:#f5f6fa;border-color:#b8beca;opacity:.55;cursor:not-allowed}:host ::ng-deep .details-step-input .mat-input-element:disabled{color:#7f8694;-webkit-text-fill-color:#7f8694;cursor:not-allowed}:host ::ng-deep .details-user-accordion .mat-expansion-panel{border:0;border-radius:0!important;background:transparent;box-shadow:none!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header{padding:0 0 0 8px;min-height:32px;height:32px}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header-title{margin:0;display:flex;align-items:center;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#333}:host ::ng-deep .details-user-accordion .mat-expansion-panel-body{padding:0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-content{display:flex;align-items:center}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator{display:block!important;opacity:1!important;color:#333!important;align-self:center;margin:0 8px 0 0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator:after{color:#333!important;border-color:#333!important;position:relative;top:-4px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i4$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i9.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i9.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i9.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i9.MatExpansionPanelTitle, selector: "mat-panel-title" }] });
|
|
2149
724
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserDetailsStepComponent, decorators: [{
|
|
2150
725
|
type: Component,
|
|
2151
|
-
args: [{ selector: 'tk-user-details-step', template: "<app-loader *ngIf=\"loadingAvailableNumbers\"></app-loader>\r\n<section class=\"details-step-content\">\r\n <form [formGroup]=\"userDetailsForm\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"details-step-section__part\">\r\n <div class=\"details-inline-fields\">\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User ID</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"User ID\" formControlName=\"userId\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('userId')?.hasError('required') && userDetailsForm.get('userId')?.touched\">\r\n User ID is required\r\n </mat-error>\r\n <mat-error *ngIf=\"userDetailsForm.get('userId')?.hasError('userIdExists') && userDetailsForm.get('userId')?.touched\">\r\n User ID already exists\r\n </mat-error>\r\n <mat-hint *ngIf=\"userIdCheckPending\">Checking user ID...</mat-hint>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">First Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"First Name\" formControlName=\"firstName\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('firstName')?.hasError('required') && userDetailsForm.get('firstName')?.touched\">\r\n First name is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Last Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"Last Name\" formControlName=\"lastName\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('lastName')?.hasError('required') && userDetailsForm.get('lastName')?.touched\">\r\n Last name is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Email</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\" />\r\n <mat-error *ngIf=\"userDetailsForm.get('email')?.invalid && userDetailsForm.get('email')?.touched\">\r\n <span *ngIf=\"userDetailsForm.get('email')?.hasError('required')\">Email is required</span>\r\n <span *ngIf=\"userDetailsForm.get('email')?.hasError('email')\">Please enter a valid email</span>\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"User Template\"\r\n [value]=\"userCreationWizardService.selectedTemplateName || ''\"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"details-step-section__part\">\r\n <mat-accordion class=\"details-user-accordion\">\r\n <mat-expansion-panel togglePosition=\"before\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>Choose an existing or a LDAP user</mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div class=\"details-user-accordion__content\">\r\n <div class=\"details-ldap-search\" [formGroup]=\"ldapSearchForm\">\r\n <mat-form-field\r\n class=\"details-ldap-search__input\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n >\r\n <input\r\n matInput\r\n placeholder=\"Search\"\r\n formControlName=\"queryValue\"\r\n (keyup.enter)=\"searchLdapUsers()\"\r\n />\r\n </mat-form-field>\r\n\r\n <mat-form-field\r\n class=\"details-ldap-search__select\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n >\r\n <mat-select formControlName=\"queryType\">\r\n <mat-option *ngFor=\"let option of ldapQueryTypeOptions\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-chip-list *ngIf=\"selectedLdapUser\" class=\"details-ldap-search__chip\">\r\n <mat-chip removable (removed)=\"onRemoveLdapTag()\">\r\n {{ selectedLdapUser.userid }}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip>\r\n </mat-chip-list>\r\n\r\n <button\r\n mat-button\r\n class=\"details-ldap-search__btn\"\r\n type=\"button\"\r\n [disabled]=\"ldapLoading\"\r\n (click)=\"searchLdapUsers()\"\r\n >\r\n Search\r\n </button>\r\n </div>\r\n\r\n <app-loader *ngIf=\"ldapLoading\"></app-loader>\r\n\r\n <p\r\n *ngIf=\"!ldapLoading && ldapSearchAttempted && !hasLdapUsers\"\r\n class=\"details-ldap-table__empty\"\r\n >\r\n No users found\r\n </p>\r\n\r\n <table\r\n *ngIf=\"!ldapLoading && hasLdapUsers\"\r\n mat-table\r\n [dataSource]=\"userCreationWizardService.ldapUsers\"\r\n class=\"details-ldap-table\"\r\n >\r\n <ng-container matColumnDef=\"userId\">\r\n <th mat-header-cell *matHeaderCellDef>User Id</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.userid }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"firstName\">\r\n <th mat-header-cell *matHeaderCellDef>First Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.firstName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"lastName\">\r\n <th mat-header-cell *matHeaderCellDef>Last Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.lastName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"email\">\r\n <th mat-header-cell *matHeaderCellDef>Email</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.email }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"add\">\r\n <th mat-header-cell *matHeaderCellDef>Add</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <button\r\n *ngIf=\"!isLdapUserRowSelected(row); else deleteLdapUserBtn\"\r\n mat-button\r\n class=\"details-ldap-table__add-btn\"\r\n type=\"button\"\r\n (click)=\"onAddLdapUser(row)\"\r\n >\r\n Add User\r\n </button>\r\n <ng-template #deleteLdapUserBtn>\r\n <button\r\n mat-button\r\n class=\"details-ldap-table__add-btn details-ldap-table__add-btn--delete\"\r\n type=\"button\"\r\n (click)=\"onDeleteLdapUser(row)\"\r\n >\r\n Delete user\r\n </button>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"userCreationWizardService.ldapTableColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: userCreationWizardService.ldapTableColumns\"></tr>\r\n </table>\r\n\r\n <mat-paginator\r\n *ngIf=\"!ldapLoading && hasLdapUsers\"\r\n class=\"details-ldap-paginator\"\r\n [length]=\"ldapTotalCount\"\r\n [pageSize]=\"ldapPageSize\"\r\n [pageIndex]=\"ldapPageIndex\"\r\n [pageSizeOptions]=\"[ldapPageSize]\"\r\n [hidePageSize]=\"true\"\r\n [disabled]=\"ldapLoading\"\r\n (page)=\"onLdapPageChange($event)\"\r\n ></mat-paginator>\r\n </div>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\" formArrayName=\"lines\">\r\n <div class=\"line-route-list\">\r\n <div\r\n class=\"line-route-row\"\r\n *ngFor=\"let lineGroup of linesFormArray.controls; let idx = index\"\r\n [formGroupName]=\"idx\"\r\n >\r\n <div class=\"line-info\">\r\n <mat-form-field\r\n class=\"details-step-input line-route-field\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n hideRequiredMarker\r\n >\r\n <input matInput placeholder=\"Line number\" formControlName=\"lineNumber\" />\r\n </mat-form-field>\r\n\r\n <mat-form-field\r\n class=\"details-step-input line-route-field\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n hideRequiredMarker\r\n >\r\n <input\r\n matInput\r\n placeholder=\"Search for a number\"\r\n formControlName=\"number\"\r\n [matAutocomplete]=\"numberAuto\"\r\n (input)=\"filterAvailableNumbers(idx, $event)\"\r\n />\r\n <mat-autocomplete\r\n #numberAuto=\"matAutocomplete\"\r\n [panelWidth]=\"'auto'\"\r\n (optionSelected)=\"onNumberSelected(idx, $event.option.value)\"\r\n >\r\n <mat-option *ngFor=\"let option of getFilteredNumbers(idx)\" [value]=\"option\">\r\n {{ option }}\r\n </mat-option>\r\n </mat-autocomplete>\r\n <mat-error *ngIf=\"getLineGroup(idx).get('number')?.invalid && getLineGroup(idx).get('number')?.touched\">\r\n Number is required\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n <mat-form-field\r\n class=\"details-step-input line-route-field\"\r\n appearance=\"outline\"\r\n floatLabel=\"never\"\r\n hideRequiredMarker\r\n >\r\n <input\r\n matInput\r\n placeholder=\"Select route partition\"\r\n formControlName=\"routePartition\"\r\n [matAutocomplete]=\"routePartitionAuto\"\r\n (input)=\"filterRoutePartitions(idx, $event)\"\r\n />\r\n <mat-autocomplete\r\n #routePartitionAuto=\"matAutocomplete\"\r\n (optionSelected)=\"onRoutePartitionSelected(idx, $event.option.value)\"\r\n >\r\n <mat-option\r\n *ngFor=\"let routePartition of getFilteredRoutePartitions(idx)\"\r\n [value]=\"routePartition\"\r\n >\r\n {{ routePartition }}\r\n </mat-option>\r\n </mat-autocomplete>\r\n <mat-error *ngIf=\"getLineGroup(idx).get('routePartition')?.invalid && getLineGroup(idx).get('routePartition')?.touched\">\r\n Route partition is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\" formArrayName=\"devices\">\r\n <div class=\"devices-rows\">\r\n <div\r\n class=\"details-inline-fields details-inline-fields--four\"\r\n *ngFor=\"let deviceGroup of devicesFormArray.controls; let idx = index\"\r\n [formGroupName]=\"idx\"\r\n >\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Device type</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"deviceType\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Protocol</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"protocol\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Button Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"buttonTemplate\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <span matPrefix *ngIf=\"getDeviceNamePrefix(idx) as devicePrefix\">{{ devicePrefix }}</span>\r\n <input matInput placeholder=\"Name\" formControlName=\"name\" />\r\n <mat-error *ngIf=\"getDeviceGroup(idx).get('name')?.hasError('deviceName') && getDeviceGroup(idx).get('name')?.touched\">\r\n {{ getDeviceGroup(idx).get('name')?.getError('deviceName')?.caption || getDeviceNameValidationCaption(idx) || 'Please enter a valid device name' }}\r\n </mat-error>\r\n <mat-error *ngIf=\"getDeviceGroup(idx).get('name')?.hasError('required') && getDeviceGroup(idx).get('name')?.touched\">\r\n Name is required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\" *ngIf=\"deviceProfilesFormArray.length\">\r\n <h3 class=\"details-step-section__title\">Device profiles</h3>\r\n <div class=\"details-step-section__content\" formArrayName=\"deviceProfiles\">\r\n <div class=\"devices-rows\">\r\n <div\r\n class=\"details-inline-fields details-inline-fields--four\"\r\n *ngFor=\"let profileGroup of deviceProfilesFormArray.controls; let idx = index\"\r\n [formGroupName]=\"idx\"\r\n >\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Device type</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"deviceType\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Protocol</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"protocol\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Button Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input matInput formControlName=\"buttonTemplate\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <span matPrefix *ngIf=\"getDeviceProfileNamePrefix(idx) as profilePrefix\">{{ profilePrefix }}</span>\r\n <input matInput placeholder=\"Name\" formControlName=\"name\" />\r\n <mat-error *ngIf=\"getDeviceProfileGroup(idx).get('name')?.hasError('deviceName') && getDeviceProfileGroup(idx).get('name')?.touched\">\r\n {{ getDeviceProfileGroup(idx).get('name')?.getError('deviceName')?.caption || getDeviceProfileNameValidationCaption(idx) || 'Please enter a valid device name' }}\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n </form>\r\n</section>\r\n", styles: [".details-step-content{display:flex;flex-direction:column;gap:0}.details-step-dropdowns{display:flex;flex-direction:column;gap:1rem}.details-step-field{display:flex;flex-direction:column;gap:8px}.details-step-label{font-size:16px;font-weight:400;line-height:100%;letter-spacing:0;color:#333}.details-step-select{width:333px}.details-step-divider{border-top:1px solid #d9d9d9;margin-top:24px}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:0;padding:24px 0}.details-step-sections>.details-step-section:first-child{padding-top:0}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.details-step-section__content{margin-top:24px}.details-step-section__part+.details-step-section__part{margin-top:24px}.details-user-accordion{width:100%}.details-user-accordion__content{padding:12px 0 0}.details-ldap-search{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:16px}.details-ldap-search__input{min-width:180px;width:180px}.details-ldap-search__select{flex:0 1 180px;min-width:160px}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-wrapper,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-wrapper{padding-bottom:0;margin:0}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-flex,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:4px;padding:0 12px}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline,:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline-start,:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline-end,:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-outline-gap,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline-start,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline-end,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-form-field-infix,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-form-field-infix{width:100%;border-top:0;padding:0;display:flex;align-items:center;min-height:unset}:host ::ng-deep .details-ldap-search__input.mat-form-field .mat-input-element,:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-input-element{margin:0;line-height:20px}:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-select-trigger{display:flex;align-items:center;width:100%;height:100%}:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-select-value{display:flex;align-items:center;max-width:100%}:host ::ng-deep .details-ldap-search__select.mat-form-field .mat-select-arrow-wrapper{display:flex;align-items:center}.details-ldap-search__chip{flex:0 0 auto}.details-ldap-search__btn{flex:0 0 auto;min-width:0;padding:0 12px;font-family:Inter,sans-serif;font-size:14px;font-weight:500;color:#0d56aa}.details-ldap-paginator{margin-top:8px}.details-ldap-table__add-btn--delete{color:#c62828}.details-ldap-table{width:100%}.details-ldap-table__empty{margin:16px 0 8px;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#737480;text-align:center}.details-ldap-table__row--disabled{opacity:.35}.details-ldap-table__add-btn{min-width:0;padding:0;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#0d56aa}:host ::ng-deep .details-ldap-table .mat-header-cell{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:16px;letter-spacing:0;color:#737480;height:30px;padding:7px 8px}:host ::ng-deep .details-ldap-table .mat-cell{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0;color:#333;height:40px;padding:8px}.details-inline-fields{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}.details-inline-fields--four{grid-template-columns:repeat(4,minmax(0,1fr))}.devices-rows{display:flex;flex-direction:column;gap:24px}.details-inline-field{display:flex;flex-direction:column;gap:4px}.details-inline-field__label{color:#c0c2ce;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0}.details-step-input{width:100%}.line-route-list{display:flex;flex-direction:column;gap:16px}.line-route-row{display:flex;gap:16px}.line-info{display:flex;align-items:flex-start;gap:16px}.line-route-field{flex:1 1 180px;min-width:160px}.line-route-field{display:flex;flex-direction:column;gap:0}.line-route-field:nth-of-type(1) .line-route-select{width:230px}.line-route-field .line-route-select{width:185px}:host ::ng-deep .details-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-input .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-select .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .details-step-input .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:4px;padding:10px 8px}:host ::ng-deep .details-step-select .mat-form-field-outline,:host ::ng-deep .details-step-select .mat-form-field-outline-start,:host ::ng-deep .details-step-select .mat-form-field-outline-end,:host ::ng-deep .details-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-input .mat-form-field-outline,:host ::ng-deep .details-step-input .mat-form-field-outline-start,:host ::ng-deep .details-step-input .mat-form-field-outline-end,:host ::ng-deep .details-step-input .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-input .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}:host ::ng-deep .details-step-input .mat-input-element{height:100%;margin:0}:host ::ng-deep .details-step-input.mat-form-field-disabled .mat-form-field-flex{background-color:#f5f6fa;border-color:#b8beca;opacity:.55;cursor:not-allowed}:host ::ng-deep .details-step-input .mat-input-element:disabled{color:#7f8694;-webkit-text-fill-color:#7f8694;cursor:not-allowed}:host ::ng-deep .line-info .details-step-input .mat-form-field-flex{height:36px;padding:0 8px}:host ::ng-deep .line-info .details-step-input .mat-form-field-infix{padding:0}:host ::ng-deep .line-info .details-step-input .mat-input-element{font-size:14px;line-height:20px}:host ::ng-deep .mat-form-field-subscript-wrapper{position:relative}:host ::ng-deep .line-info .details-step-input .mat-form-field-subscript-wrapper{margin-top:4px;position:relative}:host ::ng-deep .details-user-accordion .mat-expansion-panel{border:0;border-radius:0!important;background:transparent;box-shadow:none!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header{padding:0 0 0 8px;min-height:32px;height:32px}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header-title{margin:0;display:flex;align-items:center;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#333}:host ::ng-deep .details-user-accordion .mat-expansion-panel-body{padding:0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-content{display:flex;align-items:center}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator{display:block!important;opacity:1!important;color:#333!important;align-self:center;margin:0 8px 0 0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator:after{color:#333!important;border-color:#333!important;position:relative;top:-4px}:host ::ng-deep .devices-rows .details-inline-fields .details-inline-field .mat-form-field .mat-form-field-flex{display:flex;gap:3px}:host ::ng-deep .devices-rows .details-inline-fields .details-inline-field .mat-form-field .mat-form-field-flex .mat-form-field-prefix{top:1px}\n"] }]
|
|
2152
|
-
}], ctorParameters: function () { return [{ type:
|
|
2153
|
-
type: Output
|
|
2154
|
-
}] } });
|
|
726
|
+
args: [{ selector: 'tk-user-details-step', template: "<section class=\"details-step-content\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"details-step-section__part\">\r\n <div class=\"details-inline-fields\">\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User ID</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"User ID\"\r\n [value]=\"userCreationWizardService.userDetailsForm.userId\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'userId',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">First Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"First Name\"\r\n [value]=\"userCreationWizardService.userDetailsForm.firstName\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'firstName',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Last Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Last Name\"\r\n [value]=\"userCreationWizardService.userDetailsForm.lastName\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'lastName',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Email</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Email\"\r\n [value]=\"userCreationWizardService.userDetailsForm.email\"\r\n (input)=\"\r\n userCreationWizardService.setUserDetailsField(\r\n 'email',\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">User Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"User Template\"\r\n [value]=\"userCreationWizardService.selectedTemplate || ''\"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"details-step-section__part\">\r\n <mat-accordion class=\"details-user-accordion\">\r\n <mat-expansion-panel togglePosition=\"before\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title\r\n >Choose an existing or a LDAP user</mat-panel-title\r\n >\r\n </mat-expansion-panel-header>\r\n <div class=\"details-user-accordion__content\">\r\n <table\r\n mat-table\r\n [dataSource]=\"userCreationWizardService.ldapUsers\"\r\n class=\"details-ldap-table\"\r\n >\r\n <ng-container matColumnDef=\"userId\">\r\n <th mat-header-cell *matHeaderCellDef>User ID</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.userId }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"firstName\">\r\n <th mat-header-cell *matHeaderCellDef>First Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.firstName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"lastName\">\r\n <th mat-header-cell *matHeaderCellDef>Last Name</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.lastName }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"email\">\r\n <th mat-header-cell *matHeaderCellDef>Email</th>\r\n <td mat-cell *matCellDef=\"let row\">{{ row.email }}</td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"add\">\r\n <th mat-header-cell *matHeaderCellDef>Add</th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <button\r\n mat-button\r\n class=\"details-ldap-table__add-btn\"\r\n type=\"button\"\r\n [disabled]=\"\r\n userCreationWizardService.isLdapUserAdded(row)\r\n \"\r\n (click)=\"onAddUser(row)\"\r\n >\r\n Add user\r\n </button>\r\n </td>\r\n </ng-container>\r\n\r\n <tr\r\n mat-header-row\r\n *matHeaderRowDef=\"\r\n userCreationWizardService.ldapTableColumns\r\n \"\r\n ></tr>\r\n <tr\r\n mat-row\r\n *matRowDef=\"\r\n let row;\r\n columns: userCreationWizardService.ldapTableColumns\r\n \"\r\n [class.details-ldap-table__row--disabled]=\"\r\n userCreationWizardService.isLdapUserAdded(row)\r\n \"\r\n ></tr>\r\n </table>\r\n </div>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"line-route-list\">\r\n <div\r\n class=\"line-route-row\"\r\n *ngFor=\"\r\n let lineSelection of userCreationWizardService.lineSelections;\r\n let idx = index\r\n \"\r\n >\r\n <div class=\"line-route-field\">\r\n <mat-form-field\r\n class=\"details-step-select line-route-select\"\r\n appearance=\"outline\"\r\n >\r\n <mat-select\r\n placeholder=\"Select line\"\r\n [value]=\"lineSelection.lineNumber\"\r\n (selectionChange)=\"\r\n userCreationWizardService.setLineSelection(\r\n idx,\r\n $event.value\r\n )\r\n \"\r\n >\r\n <mat-option\r\n *ngFor=\"let line of userCreationWizardService.lineOptions\"\r\n [value]=\"line.number\"\r\n >\r\n {{ line.number }} - {{ line.did }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"line-route-field\">\r\n <mat-form-field\r\n class=\"details-step-select line-route-select\"\r\n appearance=\"outline\"\r\n >\r\n <mat-select\r\n placeholder=\"Select route partition\"\r\n [value]=\"lineSelection.routePartitionName\"\r\n (selectionChange)=\"\r\n userCreationWizardService.setRoutePartitionSelection(\r\n idx,\r\n $event.value\r\n )\r\n \"\r\n >\r\n <mat-option\r\n *ngFor=\"\r\n let partition of userCreationWizardService.routePartitionOptions\r\n \"\r\n [value]=\"partition\"\r\n >\r\n {{ partition }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"devices-rows\">\r\n <div\r\n class=\"details-inline-fields details-inline-fields--four\"\r\n *ngFor=\"\r\n let _row of userCreationWizardService.deviceRows;\r\n let idx = index\r\n \"\r\n >\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Device type</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Device type\"\r\n [value]=\"\r\n userCreationWizardService.deviceEntries[idx].deviceType ||\r\n ''\r\n \"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Protocol</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Protocol\"\r\n [value]=\"\r\n userCreationWizardService.deviceEntries[idx].protocol || ''\r\n \"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Button Template</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Button Template\"\r\n [value]=\"\r\n userCreationWizardService.deviceEntries[idx]\r\n .buttonTemplate || ''\r\n \"\r\n [disabled]=\"true\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class=\"details-inline-field\">\r\n <label class=\"details-inline-field__label\">Name</label>\r\n <mat-form-field class=\"details-step-input\" appearance=\"outline\">\r\n <input\r\n matInput\r\n placeholder=\"Name\"\r\n [value]=\"getDeviceName(idx)\"\r\n (input)=\"\r\n userCreationWizardService.setDeviceName(\r\n idx,\r\n $any($event.target).value\r\n )\r\n \"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n</section>\r\n", styles: [".details-step-content{display:flex;flex-direction:column;gap:0}.details-step-dropdowns{display:flex;flex-direction:column;gap:1rem}.details-step-field{display:flex;flex-direction:column;gap:8px}.details-step-label{font-size:16px;font-weight:400;line-height:100%;letter-spacing:0;color:#333}.details-step-select{width:333px}.details-step-divider{border-top:1px solid #d9d9d9;margin-top:24px}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:0;padding:24px 0}.details-step-sections>.details-step-section:first-child{padding-top:0}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.details-step-section__content{margin-top:24px}.details-step-section__part+.details-step-section__part{margin-top:24px}.details-user-accordion{width:100%}.details-user-accordion__content{padding:12px 0 0}.details-ldap-table{width:100%}.details-ldap-table__row--disabled{opacity:.35}.details-ldap-table__add-btn{min-width:0;padding:0;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#0d56aa}:host ::ng-deep .details-ldap-table .mat-header-cell{font-family:Inter,sans-serif;font-size:12px;font-weight:500;line-height:16px;letter-spacing:0;color:#737480;height:30px;padding:7px 8px}:host ::ng-deep .details-ldap-table .mat-cell{font-family:Inter,sans-serif;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0;color:#333;height:40px;padding:8px}.details-inline-fields{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}.details-inline-fields--four{grid-template-columns:repeat(4,minmax(0,1fr))}.devices-rows{display:flex;flex-direction:column;gap:24px}.details-inline-field{display:flex;flex-direction:column;gap:4px}.details-inline-field__label{color:#c0c2ce;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0}.details-step-input{width:100%}.line-route-list{display:flex;flex-direction:column;gap:16px}.line-route-row{display:flex;gap:16px}.line-route-field{display:flex;flex-direction:column;gap:0}.line-route-field:nth-of-type(1) .line-route-select{width:230px}.line-route-field .line-route-select{width:185px}:host ::ng-deep .details-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-input .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .details-step-select .mat-form-field-flex{align-items:center;height:32px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .details-step-input .mat-form-field-flex{align-items:center;height:36px;border:1px solid #767676;border-radius:4px;padding:10px 8px}:host ::ng-deep .details-step-select .mat-form-field-outline,:host ::ng-deep .details-step-select .mat-form-field-outline-start,:host ::ng-deep .details-step-select .mat-form-field-outline-end,:host ::ng-deep .details-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-input .mat-form-field-outline,:host ::ng-deep .details-step-input .mat-form-field-outline-start,:host ::ng-deep .details-step-input .mat-form-field-outline-end,:host ::ng-deep .details-step-input .mat-form-field-outline-gap{display:none}:host ::ng-deep .details-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-input .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .details-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}:host ::ng-deep .details-step-input .mat-input-element{height:100%;margin:0}:host ::ng-deep .details-step-input.mat-form-field-disabled .mat-form-field-flex{background-color:#f5f6fa;border-color:#b8beca;opacity:.55;cursor:not-allowed}:host ::ng-deep .details-step-input .mat-input-element:disabled{color:#7f8694;-webkit-text-fill-color:#7f8694;cursor:not-allowed}:host ::ng-deep .details-user-accordion .mat-expansion-panel{border:0;border-radius:0!important;background:transparent;box-shadow:none!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header{padding:0 0 0 8px;min-height:32px;height:32px}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header-title{margin:0;display:flex;align-items:center;font-family:Inter,sans-serif;font-size:14px;font-weight:500;line-height:20px;letter-spacing:0;color:#333}:host ::ng-deep .details-user-accordion .mat-expansion-panel-body{padding:0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-content{display:flex;align-items:center}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator{display:block!important;opacity:1!important;color:#333!important;align-self:center;margin:0 8px 0 0!important}:host ::ng-deep .details-user-accordion .mat-expansion-panel-header .mat-expansion-indicator:after{color:#333!important;border-color:#333!important;position:relative;top:-4px}\n"] }]
|
|
727
|
+
}], ctorParameters: function () { return [{ type: UserCreationWizardService }]; } });
|
|
2155
728
|
|
|
2156
729
|
class UserOverviewStepComponent {
|
|
2157
730
|
constructor(userCreationWizardService) {
|
|
@@ -2162,21 +735,17 @@ class UserOverviewStepComponent {
|
|
|
2162
735
|
}
|
|
2163
736
|
}
|
|
2164
737
|
UserOverviewStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserOverviewStepComponent, deps: [{ token: UserCreationWizardService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2165
|
-
UserOverviewStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserOverviewStepComponent, selector: "tk-user-overview-step", ngImport: i0, template: "<section class=\"details-step-content\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"USER_DETAILS_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of USER_DETAILS_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let user of userCreationWizardService.overviewUsers\">\r\n <span>{{ user.userId }}</span>\r\n <span>{{ user.firstName }}</span>\r\n <span>{{ user.lastName }}</span>\r\n <span>{{ user.email }}</span>\r\n <span>{{ user.userTemplate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"LINES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of LINES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let line of userCreationWizardService.overviewLines\">\r\n <span>{{ line.number }}</span>\r\n <span>{{ line.did }}</span>\r\n <span>{{ line.routePartitionName }}</span>\r\n <span>{{ line.css }}</span>\r\n <span>{{ line.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"DEVICES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of DEVICES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let device of userCreationWizardService.overviewDevices\">\r\n <span>{{ device.name }}</span>\r\n <span>{{ device.deviceType }}</span>\r\n <span>{{ device.lines }}</span>\r\n <span>{{ device.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <
|
|
738
|
+
UserOverviewStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserOverviewStepComponent, selector: "tk-user-overview-step", ngImport: i0, template: "<section class=\"details-step-content\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"USER_DETAILS_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of USER_DETAILS_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let user of userCreationWizardService.overviewUsers\">\r\n <span>{{ user.userId }}</span>\r\n <span>{{ user.firstName }}</span>\r\n <span>{{ user.lastName }}</span>\r\n <span>{{ user.email }}</span>\r\n <span>{{ user.userTemplate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n \r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"LINES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of LINES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let line of userCreationWizardService.overviewLines\">\r\n <span>{{ line.number }}</span>\r\n <span>{{ line.did }}</span>\r\n <span>{{ line.routePartitionName }}</span>\r\n <span>{{ line.css }}</span>\r\n <span>{{ line.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n \r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"DEVICES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of DEVICES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let device of userCreationWizardService.overviewDevices\">\r\n <span>{{ device.name }}</span>\r\n <span>{{ device.deviceType }}</span>\r\n <span>{{ device.lines }}</span>\r\n <span>{{ device.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Single Number Reach</h3>\r\n <div class=\"details-step-section__content\"></div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Features</h3>\r\n <div class=\"details-step-section__content\">\r\n <span style=\"margin-right: 1rem;\">Voicemail</span> 557046\r\n </div>\r\n </section>\r\n </div>\r\n\r\n</section>", styles: [".details-step-content{display:flex;flex-direction:column;gap:24px}.details-step-divider{border-top:1px solid #d9d9d9}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:16px}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.preview-list{display:flex;flex-direction:column;gap:4px}.preview-list__header,.preview-list__row{display:grid;grid-template-columns:repeat(var(--preview-cols, 1),minmax(0,1fr));column-gap:24px}.preview-list__header>span,.preview-list__row>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--Gray-700, #737480);font-family:Inter,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:16px}.preview-list__row>span{min-width:0;color:var(--Gray-700, #333);font-family:Inter,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:150%}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
2166
739
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserOverviewStepComponent, decorators: [{
|
|
2167
740
|
type: Component,
|
|
2168
|
-
args: [{ selector: 'tk-user-overview-step', template: "<section class=\"details-step-content\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"USER_DETAILS_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of USER_DETAILS_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let user of userCreationWizardService.overviewUsers\">\r\n <span>{{ user.userId }}</span>\r\n <span>{{ user.firstName }}</span>\r\n <span>{{ user.lastName }}</span>\r\n <span>{{ user.email }}</span>\r\n <span>{{ user.userTemplate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"LINES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of LINES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let line of userCreationWizardService.overviewLines\">\r\n <span>{{ line.number }}</span>\r\n <span>{{ line.did }}</span>\r\n <span>{{ line.routePartitionName }}</span>\r\n <span>{{ line.css }}</span>\r\n <span>{{ line.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"DEVICES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of DEVICES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let device of userCreationWizardService.overviewDevices\">\r\n <span>{{ device.name }}</span>\r\n <span>{{ device.deviceType }}</span>\r\n <span>{{ device.lines }}</span>\r\n <span>{{ device.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <
|
|
741
|
+
args: [{ selector: 'tk-user-overview-step', template: "<section class=\"details-step-content\">\r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">User details</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"USER_DETAILS_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of USER_DETAILS_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let user of userCreationWizardService.overviewUsers\">\r\n <span>{{ user.userId }}</span>\r\n <span>{{ user.firstName }}</span>\r\n <span>{{ user.lastName }}</span>\r\n <span>{{ user.email }}</span>\r\n <span>{{ user.userTemplate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n \r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Lines</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"LINES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of LINES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let line of userCreationWizardService.overviewLines\">\r\n <span>{{ line.number }}</span>\r\n <span>{{ line.did }}</span>\r\n <span>{{ line.routePartitionName }}</span>\r\n <span>{{ line.css }}</span>\r\n <span>{{ line.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n \r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Devices</h3>\r\n <div class=\"details-step-section__content\">\r\n <div class=\"preview-list\" [style.--preview-cols]=\"DEVICES_COLS.length\">\r\n <div class=\"preview-list__header\">\r\n <span *ngFor=\"let col of DEVICES_COLS\">{{ col }}</span>\r\n </div>\r\n <div class=\"preview-list__row\" *ngFor=\"let device of userCreationWizardService.overviewDevices\">\r\n <span>{{ device.name }}</span>\r\n <span>{{ device.deviceType }}</span>\r\n <span>{{ device.lines }}</span>\r\n <span>{{ device.description }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Single Number Reach</h3>\r\n <div class=\"details-step-section__content\"></div>\r\n </section>\r\n </div>\r\n\r\n <div class=\"details-step-divider\"></div>\r\n \r\n <div class=\"details-step-sections\">\r\n <section class=\"details-step-section\">\r\n <h3 class=\"details-step-section__title\">Features</h3>\r\n <div class=\"details-step-section__content\">\r\n <span style=\"margin-right: 1rem;\">Voicemail</span> 557046\r\n </div>\r\n </section>\r\n </div>\r\n\r\n</section>", styles: [".details-step-content{display:flex;flex-direction:column;gap:24px}.details-step-divider{border-top:1px solid #d9d9d9}.details-step-sections{display:flex;flex-direction:column}.details-step-section{display:flex;flex-direction:column;gap:16px}.details-step-section+.details-step-section{border-top:1px solid #d9d9d9}.details-step-section__title{margin:0;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:100%;letter-spacing:0;color:#333}.preview-list{display:flex;flex-direction:column;gap:4px}.preview-list__header,.preview-list__row{display:grid;grid-template-columns:repeat(var(--preview-cols, 1),minmax(0,1fr));column-gap:24px}.preview-list__header>span,.preview-list__row>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--Gray-700, #737480);font-family:Inter,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:16px}.preview-list__row>span{min-width:0;color:var(--Gray-700, #333);font-family:Inter,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:150%}\n"] }]
|
|
2169
742
|
}], ctorParameters: function () { return [{ type: UserCreationWizardService }]; } });
|
|
2170
743
|
|
|
2171
744
|
class UserTemplateStepComponent {
|
|
2172
|
-
get isLoading() {
|
|
2173
|
-
return this.loadingSites || this.loadingSiteData;
|
|
2174
|
-
}
|
|
2175
745
|
constructor(userCreationWizardService, userCreationService, fb) {
|
|
2176
746
|
this.userCreationWizardService = userCreationWizardService;
|
|
2177
747
|
this.userCreationService = userCreationService;
|
|
2178
748
|
this.fb = fb;
|
|
2179
|
-
this.validityChange = new EventEmitter();
|
|
2180
749
|
this.formGroup = this.fb.group({
|
|
2181
750
|
userType: [USER_CREATION_TYPES.CUCM],
|
|
2182
751
|
siteId: [null],
|
|
@@ -2184,8 +753,8 @@ class UserTemplateStepComponent {
|
|
|
2184
753
|
});
|
|
2185
754
|
this.userCreationType = USER_CREATION_TYPES.CUCM;
|
|
2186
755
|
this.USER_CREATION_TYPES = USER_CREATION_TYPES;
|
|
2187
|
-
|
|
2188
|
-
|
|
756
|
+
this.defaultTemplateName = 'User 8851 Office';
|
|
757
|
+
this.fallbackTemplateId = '-1';
|
|
2189
758
|
this.destroy$ = new Subject();
|
|
2190
759
|
this.sitesList = [];
|
|
2191
760
|
this.sitesList$ = this.userCreationService.sitesList$.pipe(takeUntil(this.destroy$), tap((res) => this.sitesList = res));
|
|
@@ -2194,19 +763,15 @@ class UserTemplateStepComponent {
|
|
|
2194
763
|
const templateControl = this.formGroup.get('userTemplateId');
|
|
2195
764
|
const currentTemplateId = templateControl?.value;
|
|
2196
765
|
const selectedSiteId = this.formGroup.get('siteId')?.value;
|
|
2197
|
-
|
|
2198
|
-
// template => template.name === this.defaultTemplateName
|
|
2199
|
-
// );
|
|
766
|
+
const defaultTemplate = this.templates.find(template => template.name === this.defaultTemplateName);
|
|
2200
767
|
const hasSelectedSite = selectedSiteId !== null && selectedSiteId !== undefined;
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
768
|
+
if (hasSelectedSite && defaultTemplate && String(currentTemplateId || '') !== String(defaultTemplate.id)) {
|
|
769
|
+
templateControl?.setValue(String(defaultTemplate.id));
|
|
770
|
+
}
|
|
2204
771
|
}), takeUntil(this.destroy$));
|
|
2205
772
|
this.isTemplateSelectable = false;
|
|
2206
773
|
this.templates = [];
|
|
2207
|
-
this.
|
|
2208
|
-
this.loadingSiteData = false;
|
|
2209
|
-
this.templateToggleFormControl = new FormControl(false);
|
|
774
|
+
this.templateToggleFormControl = new FormControl(true);
|
|
2210
775
|
}
|
|
2211
776
|
ngOnInit() {
|
|
2212
777
|
this.formGroup.get('userType').valueChanges
|
|
@@ -2220,24 +785,10 @@ class UserTemplateStepComponent {
|
|
|
2220
785
|
.pipe(
|
|
2221
786
|
// filter((value) => value !== null && value !== undefined),
|
|
2222
787
|
tap((value) => {
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
}
|
|
2228
|
-
return this.userCreationWizardService.setSelectedSite(value);
|
|
2229
|
-
}), takeUntil(this.destroy$), switchMap((value) => {
|
|
2230
|
-
if (value === null || value === undefined || value === '') {
|
|
2231
|
-
this.loadingSiteData = false;
|
|
2232
|
-
return of(null);
|
|
2233
|
-
}
|
|
2234
|
-
this.loadingSiteData = true;
|
|
2235
|
-
return forkJoin([
|
|
2236
|
-
this.userCreationService.fetchAllUserTemplates(Number(value)),
|
|
2237
|
-
this.userCreationWizardService.getSiteAllData(Number(value)),
|
|
2238
|
-
]).pipe(finalize(() => {
|
|
2239
|
-
this.loadingSiteData = false;
|
|
2240
|
-
}));
|
|
788
|
+
this.formGroup.get('userTemplateId')?.setValue(this.fallbackTemplateId);
|
|
789
|
+
// return this.userCreationWizardService.setSelectedTemplate(value);
|
|
790
|
+
}), startWith(this.formGroup.get('siteId')?.value), takeUntil(this.destroy$), switchMap((value) => {
|
|
791
|
+
return this.userCreationService.fetchAllUserTemplates(Number(value));
|
|
2241
792
|
}))
|
|
2242
793
|
.subscribe();
|
|
2243
794
|
// .subscribe((value) => {
|
|
@@ -2245,39 +796,35 @@ class UserTemplateStepComponent {
|
|
|
2245
796
|
// })
|
|
2246
797
|
this.formGroup.get('userTemplateId').valueChanges
|
|
2247
798
|
.pipe(filter((value) => value !== null && value !== undefined && String(value).trim().length > 0), takeUntil(this.destroy$), switchMap((value) => {
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
799
|
+
if (String(value) === this.fallbackTemplateId) {
|
|
800
|
+
this.userCreationWizardService.setSelectedTemplate(this.defaultTemplateName);
|
|
801
|
+
return of(null);
|
|
802
|
+
}
|
|
2252
803
|
return this.userCreationService.getUserTemplateToken(String(value), String(String(this.customerId)))
|
|
2253
804
|
.pipe(tap((payload) => {
|
|
2254
805
|
const selectedTemplate = this.templates.find(template => String(template.id) === String(value));
|
|
2255
|
-
this.userCreationWizardService.setSelectedTemplate(selectedTemplate);
|
|
806
|
+
this.userCreationWizardService.setSelectedTemplate(selectedTemplate?.name || null);
|
|
2256
807
|
this.userCreationWizardService.applyTemplateTokenPayload(payload);
|
|
2257
808
|
}));
|
|
2258
809
|
}))
|
|
2259
810
|
.subscribe();
|
|
2260
|
-
this.templateToggleFormControl.valueChanges
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
});
|
|
811
|
+
// this.templateToggleFormControl.valueChanges
|
|
812
|
+
// .pipe(startWith(true), takeUntil(this.destroy$), distinctUntilChanged())
|
|
813
|
+
// .subscribe((value) => {
|
|
814
|
+
// if(value === true) {
|
|
815
|
+
// const siteId = this.formGroup.get('siteId')?.value || 7095;
|
|
816
|
+
// this.userCreationService.fetchAllUserTemplates(siteId)
|
|
817
|
+
// .subscribe();
|
|
818
|
+
// } else {
|
|
819
|
+
// this.formGroup.get('userTemplateId')?.reset();
|
|
820
|
+
// }
|
|
821
|
+
// });
|
|
2272
822
|
this.getData();
|
|
2273
|
-
this.formGroup.statusChanges
|
|
2274
|
-
.pipe(startWith(this.formGroup.status), takeUntil(this.destroy$))
|
|
2275
|
-
.subscribe(() => this.validityChange.emit(this.isStepValid()));
|
|
2276
823
|
}
|
|
2277
824
|
reseFieldstForm() {
|
|
2278
825
|
this.formGroup.get('siteId')?.reset();
|
|
2279
826
|
this.formGroup.get('userTemplateId')?.reset();
|
|
2280
|
-
this.userCreationWizardService.setSelectedTemplate();
|
|
827
|
+
this.userCreationWizardService.setSelectedTemplate(null);
|
|
2281
828
|
this.userCreationWizardService.resetTemplateDrivenData();
|
|
2282
829
|
}
|
|
2283
830
|
getData() {
|
|
@@ -2287,10 +834,7 @@ class UserTemplateStepComponent {
|
|
|
2287
834
|
.subscribe();
|
|
2288
835
|
}
|
|
2289
836
|
getSites(isOnlyWithLocations) {
|
|
2290
|
-
this.
|
|
2291
|
-
return this.userCreationService.getAllCustomerSites(String(this.customerId), isOnlyWithLocations).pipe(finalize(() => {
|
|
2292
|
-
this.loadingSites = false;
|
|
2293
|
-
}));
|
|
837
|
+
return this.userCreationService.getAllCustomerSites(String(this.customerId), isOnlyWithLocations);
|
|
2294
838
|
}
|
|
2295
839
|
isCUCM(site) {
|
|
2296
840
|
return site?.cucm?.id === 2542;
|
|
@@ -2300,51 +844,28 @@ class UserTemplateStepComponent {
|
|
|
2300
844
|
const foundedSite = this.sitesList.find((site) => site.id === siteId);
|
|
2301
845
|
return siteId && foundedSite ? foundedSite.name : '';
|
|
2302
846
|
}
|
|
2303
|
-
getSelectedTemplateName() {
|
|
2304
|
-
const templateId = this.formGroup.get('userTemplateId')?.value;
|
|
2305
|
-
const foundedTemplate = this.templates.find((template) => String(template.id) === String(templateId));
|
|
2306
|
-
return templateId && foundedTemplate ? foundedTemplate.name : '';
|
|
2307
|
-
}
|
|
2308
|
-
isStepValid() {
|
|
2309
|
-
const siteId = this.formGroup.get('siteId')?.value;
|
|
2310
|
-
const templateId = this.formGroup.get('userTemplateId')?.value;
|
|
2311
|
-
return siteId !== null && siteId !== undefined && String(templateId || '').trim().length > 0;
|
|
2312
|
-
}
|
|
2313
|
-
markStepTouched() {
|
|
2314
|
-
this.formGroup.get('siteId')?.markAsTouched();
|
|
2315
|
-
this.formGroup.get('userTemplateId')?.markAsTouched();
|
|
2316
|
-
}
|
|
2317
847
|
ngOnDestroy() {
|
|
2318
848
|
this.destroy$.next();
|
|
2319
849
|
this.destroy$.complete();
|
|
2320
850
|
}
|
|
2321
851
|
}
|
|
2322
|
-
UserTemplateStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserTemplateStepComponent, deps: [{ token: UserCreationWizardService }, { token: UserCreationApiService }, { token:
|
|
2323
|
-
UserTemplateStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserTemplateStepComponent, selector: "tk-user-template-step", inputs: { customerId: "customerId" },
|
|
852
|
+
UserTemplateStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserTemplateStepComponent, deps: [{ token: UserCreationWizardService }, { token: UserCreationApiService }, { token: i3$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
853
|
+
UserTemplateStepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserTemplateStepComponent, selector: "tk-user-template-step", inputs: { customerId: "customerId" }, ngImport: i0, template: "<section class=\"template-step-content\">\r\n <ng-container [formGroup]=\"formGroup\">\r\n <!-- <div class=\"template-step-field template-step-field--user-type\">\r\n <label class=\"template-step-label\">User type</label>\r\n <mat-radio-group class=\"user-type-mat-radio-group\" formControlName=\"userType\">\r\n <mat-radio-button class=\"user-type-mat-radio\" id=\"userCreationCucm\" [value]=\"USER_CREATION_TYPES.CUCM\">\r\n UCM/DI\r\n </mat-radio-button>\r\n <mat-radio-button class=\"user-type-mat-radio\" id=\"userCreationMT\" [value]=\"USER_CREATION_TYPES.MT\">\r\n MT\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n </div> -->\r\n\r\n <div class=\"template-step-field\">\r\n <label class=\"template-step-label\">Select site</label>\r\n <mat-form-field class=\"template-step-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Site name\"\r\n formControlName=\"siteId\">\r\n\r\n <mat-select-trigger>\r\n {{ getSelectedSiteName() }}\r\n </mat-select-trigger>\r\n\r\n <mat-option *ngFor=\"let site of sitesList$ | async\" [value]=\"site.id\">\r\n <div class=\"option-row\">\r\n <span class=\"name\">{{ site.name }}</span>\r\n <span *ngIf=\"site.name === 'Berlin' else notBerlinSite\" class=\"type\">{{ 'Multi Tenant' }}</span>\r\n <ng-template #notBerlinSite>\r\n <span class=\"type\">{{ isCUCM(site) ? 'UCM' : 'Dedicated Instance' }}</span>\r\n </ng-template>\r\n </div>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <ng-container *ngIf=\"formGroup.get('userType')?.value === USER_CREATION_TYPES.CUCM\">\r\n <div class=\"template-step-field\">\r\n <!-- <label class=\"template-step-label\">Would you like to use a template for the user creation?</label>\r\n <mat-radio-group [formControl]=\"templateToggleFormControl\">\r\n <mat-radio-button [color]=\"'primary'\" [value]=\"true\">\r\n {{ 'Yes' }}\r\n </mat-radio-button>\r\n <mat-radio-button [color]=\"'primary'\" [value]=\"false\">\r\n {{ 'No' }}\r\n </mat-radio-button>\r\n </mat-radio-group> -->\r\n\r\n <!-- <ng-container *ngIf=\"templateToggleFormControl.value === true\"> -->\r\n <label class=\"template-step-label\">Select user template</label>\r\n <mat-form-field class=\"template-step-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Templates\"\r\n formControlName=\"userTemplateId\">\r\n <mat-select-trigger>\r\n <span matTooltip=\"'A new user will be created based on the selected template, including a Cisco 8851 physical device with a single line configured, without SNR (Single Number Reach) and without voicemail.'\">\r\n {{ defaultTemplateName }}\r\n </span>\r\n </mat-select-trigger>\r\n <mat-option [value]=\"fallbackTemplateId\">\r\n {{ defaultTemplateName }}\r\n </mat-option>\r\n <mat-option *ngFor=\"let template of templatesList$ | async\" [value]=\"template.id\">\r\n {{ template.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <!-- </ng-container> -->\r\n </div>\r\n </ng-container>\r\n \r\n </ng-container>\r\n</section>\r\n", styles: [".template-step-content{display:flex;flex-direction:column;gap:20px;max-width:420px}.template-step-field{display:flex;flex-direction:column;gap:10px}.template-step-field--user-type{margin-bottom:6px}.template-step-label{font-size:14px;font-weight:600;line-height:100%;letter-spacing:.1px;color:#2a2f3b}.template-step-select{width:100%;max-width:333px}.user-type-mat-radio-group{display:flex;flex-direction:column;gap:10px;margin-left:16px;margin-top:8px}.user-type-mat-radio{color:#2a2f3b;font-size:14px;font-weight:500}:host ::ng-deep .user-type-mat-radio .mat-radio-label{gap:10px}:host ::ng-deep .user-type-mat-radio .mat-radio-outer-circle{border-color:#8a93a3;border-width:2px}:host ::ng-deep .user-type-mat-radio .mat-radio-inner-circle{background-color:#1170cf}:host ::ng-deep .user-type-mat-radio.mat-radio-checked .mat-radio-outer-circle{border-color:#1170cf}:host ::ng-deep .user-type-mat-radio.mat-radio-checked .mat-radio-ripple .mat-ripple-element{background-color:#1176ce26!important}:host ::ng-deep .user-type-mat-radio .mdc-radio__outer-circle{border-color:#8a93a3!important;border-width:2px!important}:host ::ng-deep .user-type-mat-radio .mdc-radio__inner-circle{border-color:#1170cf!important}:host ::ng-deep .user-type-mat-radio.mat-mdc-radio-checked .mdc-radio__outer-circle{border-color:#1170cf!important}:host ::ng-deep .user-type-mat-radio.mat-mdc-radio-checked .mdc-radio__background:before{background-color:#1176ce1f!important}:host ::ng-deep .template-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .template-step-select .mat-form-field-flex{align-items:center;height:32px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .template-step-select .mat-form-field-outline,:host ::ng-deep .template-step-select .mat-form-field-outline-start,:host ::ng-deep .template-step-select .mat-form-field-outline-end,:host ::ng-deep .template-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .template-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .template-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}::ng-deep .option-row{display:flex;justify-content:space-between;align-items:center;width:100%}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "directive", type: i7.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
|
|
2324
854
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserTemplateStepComponent, decorators: [{
|
|
2325
855
|
type: Component,
|
|
2326
|
-
args: [{ selector: 'tk-user-template-step', template: "<section class=\"template-step-content\">\r\n <
|
|
2327
|
-
}], ctorParameters: function () { return [{ type: UserCreationWizardService }, { type: UserCreationApiService }, { type:
|
|
856
|
+
args: [{ selector: 'tk-user-template-step', template: "<section class=\"template-step-content\">\r\n <ng-container [formGroup]=\"formGroup\">\r\n <!-- <div class=\"template-step-field template-step-field--user-type\">\r\n <label class=\"template-step-label\">User type</label>\r\n <mat-radio-group class=\"user-type-mat-radio-group\" formControlName=\"userType\">\r\n <mat-radio-button class=\"user-type-mat-radio\" id=\"userCreationCucm\" [value]=\"USER_CREATION_TYPES.CUCM\">\r\n UCM/DI\r\n </mat-radio-button>\r\n <mat-radio-button class=\"user-type-mat-radio\" id=\"userCreationMT\" [value]=\"USER_CREATION_TYPES.MT\">\r\n MT\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n </div> -->\r\n\r\n <div class=\"template-step-field\">\r\n <label class=\"template-step-label\">Select site</label>\r\n <mat-form-field class=\"template-step-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Site name\"\r\n formControlName=\"siteId\">\r\n\r\n <mat-select-trigger>\r\n {{ getSelectedSiteName() }}\r\n </mat-select-trigger>\r\n\r\n <mat-option *ngFor=\"let site of sitesList$ | async\" [value]=\"site.id\">\r\n <div class=\"option-row\">\r\n <span class=\"name\">{{ site.name }}</span>\r\n <span *ngIf=\"site.name === 'Berlin' else notBerlinSite\" class=\"type\">{{ 'Multi Tenant' }}</span>\r\n <ng-template #notBerlinSite>\r\n <span class=\"type\">{{ isCUCM(site) ? 'UCM' : 'Dedicated Instance' }}</span>\r\n </ng-template>\r\n </div>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <ng-container *ngIf=\"formGroup.get('userType')?.value === USER_CREATION_TYPES.CUCM\">\r\n <div class=\"template-step-field\">\r\n <!-- <label class=\"template-step-label\">Would you like to use a template for the user creation?</label>\r\n <mat-radio-group [formControl]=\"templateToggleFormControl\">\r\n <mat-radio-button [color]=\"'primary'\" [value]=\"true\">\r\n {{ 'Yes' }}\r\n </mat-radio-button>\r\n <mat-radio-button [color]=\"'primary'\" [value]=\"false\">\r\n {{ 'No' }}\r\n </mat-radio-button>\r\n </mat-radio-group> -->\r\n\r\n <!-- <ng-container *ngIf=\"templateToggleFormControl.value === true\"> -->\r\n <label class=\"template-step-label\">Select user template</label>\r\n <mat-form-field class=\"template-step-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Templates\"\r\n formControlName=\"userTemplateId\">\r\n <mat-select-trigger>\r\n <span matTooltip=\"'A new user will be created based on the selected template, including a Cisco 8851 physical device with a single line configured, without SNR (Single Number Reach) and without voicemail.'\">\r\n {{ defaultTemplateName }}\r\n </span>\r\n </mat-select-trigger>\r\n <mat-option [value]=\"fallbackTemplateId\">\r\n {{ defaultTemplateName }}\r\n </mat-option>\r\n <mat-option *ngFor=\"let template of templatesList$ | async\" [value]=\"template.id\">\r\n {{ template.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <!-- </ng-container> -->\r\n </div>\r\n </ng-container>\r\n \r\n </ng-container>\r\n</section>\r\n", styles: [".template-step-content{display:flex;flex-direction:column;gap:20px;max-width:420px}.template-step-field{display:flex;flex-direction:column;gap:10px}.template-step-field--user-type{margin-bottom:6px}.template-step-label{font-size:14px;font-weight:600;line-height:100%;letter-spacing:.1px;color:#2a2f3b}.template-step-select{width:100%;max-width:333px}.user-type-mat-radio-group{display:flex;flex-direction:column;gap:10px;margin-left:16px;margin-top:8px}.user-type-mat-radio{color:#2a2f3b;font-size:14px;font-weight:500}:host ::ng-deep .user-type-mat-radio .mat-radio-label{gap:10px}:host ::ng-deep .user-type-mat-radio .mat-radio-outer-circle{border-color:#8a93a3;border-width:2px}:host ::ng-deep .user-type-mat-radio .mat-radio-inner-circle{background-color:#1170cf}:host ::ng-deep .user-type-mat-radio.mat-radio-checked .mat-radio-outer-circle{border-color:#1170cf}:host ::ng-deep .user-type-mat-radio.mat-radio-checked .mat-radio-ripple .mat-ripple-element{background-color:#1176ce26!important}:host ::ng-deep .user-type-mat-radio .mdc-radio__outer-circle{border-color:#8a93a3!important;border-width:2px!important}:host ::ng-deep .user-type-mat-radio .mdc-radio__inner-circle{border-color:#1170cf!important}:host ::ng-deep .user-type-mat-radio.mat-mdc-radio-checked .mdc-radio__outer-circle{border-color:#1170cf!important}:host ::ng-deep .user-type-mat-radio.mat-mdc-radio-checked .mdc-radio__background:before{background-color:#1176ce1f!important}:host ::ng-deep .template-step-select .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .template-step-select .mat-form-field-flex{align-items:center;height:32px;border:1px solid #767676;border-radius:6px;padding:0 12px}:host ::ng-deep .template-step-select .mat-form-field-outline,:host ::ng-deep .template-step-select .mat-form-field-outline-start,:host ::ng-deep .template-step-select .mat-form-field-outline-end,:host ::ng-deep .template-step-select .mat-form-field-outline-gap{display:none}:host ::ng-deep .template-step-select .mat-form-field-infix{width:100%;border-top:0;padding:0}:host ::ng-deep .template-step-select .mat-select-trigger{display:flex;align-items:center;justify-content:space-between;height:100%}::ng-deep .option-row{display:flex;justify-content:space-between;align-items:center;width:100%}\n"] }]
|
|
857
|
+
}], ctorParameters: function () { return [{ type: UserCreationWizardService }, { type: UserCreationApiService }, { type: i3$1.FormBuilder }]; }, propDecorators: { customerId: [{
|
|
2328
858
|
type: Input
|
|
2329
|
-
}], validityChange: [{
|
|
2330
|
-
type: Output
|
|
2331
859
|
}] } });
|
|
2332
860
|
|
|
2333
|
-
const USER_CREATED_SUCCESSFLLY = 'User created successfully';
|
|
2334
861
|
class UserCreationWizardComponent {
|
|
2335
|
-
constructor(
|
|
2336
|
-
this.notificationService = notificationService;
|
|
862
|
+
constructor() {
|
|
2337
863
|
this.apiService = inject(APIService);
|
|
2338
|
-
this.userCreationWizardService = inject(UserCreationWizardService);
|
|
2339
864
|
this.title = 'Create User';
|
|
2340
865
|
this.cancel = new EventEmitter();
|
|
2341
866
|
this.submit = new EventEmitter();
|
|
2342
867
|
this.isSubmitting = false;
|
|
2343
868
|
this.submitTimerId = null;
|
|
2344
|
-
this.selectedIndex = 0;
|
|
2345
|
-
this.templateStepValid = false;
|
|
2346
|
-
this.detailsStepValid = false;
|
|
2347
|
-
this.isLoading = false;
|
|
2348
869
|
}
|
|
2349
870
|
ngOnInit() {
|
|
2350
871
|
this.apiService.token = this.token;
|
|
@@ -2353,42 +874,17 @@ class UserCreationWizardComponent {
|
|
|
2353
874
|
onCancel() {
|
|
2354
875
|
this.cancel.emit();
|
|
2355
876
|
}
|
|
2356
|
-
onStepSelectionChange(event) {
|
|
2357
|
-
this.selectedIndex = event.selectedIndex;
|
|
2358
|
-
if (event.selectedIndex === 1 && event.previouslySelectedIndex === 0) {
|
|
2359
|
-
this.userCreationWizardService.resetUserDetailsStepState();
|
|
2360
|
-
this.detailsStepValid = false;
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
onStepperNext(stepper) {
|
|
2364
|
-
if (stepper.selectedIndex === 0) {
|
|
2365
|
-
if (!this.templateStep?.isStepValid()) {
|
|
2366
|
-
this.templateStep?.markStepTouched();
|
|
2367
|
-
return;
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
if (stepper.selectedIndex === 1) {
|
|
2371
|
-
if (!this.detailsStep?.isStepValid()) {
|
|
2372
|
-
this.detailsStep?.markAllAsTouched();
|
|
2373
|
-
return;
|
|
2374
|
-
}
|
|
2375
|
-
this.detailsStep?.syncToService();
|
|
2376
|
-
}
|
|
2377
|
-
stepper.next();
|
|
2378
|
-
}
|
|
2379
877
|
onSubmit() {
|
|
2380
878
|
if (this.isSubmitting) {
|
|
2381
879
|
return;
|
|
2382
880
|
}
|
|
2383
881
|
this.isSubmitting = true;
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
// }, delayMs);
|
|
2391
|
-
this._saveChanges();
|
|
882
|
+
const delayMs = 3000 + Math.floor(Math.random() * 1001);
|
|
883
|
+
this.submitTimerId = window.setTimeout(() => {
|
|
884
|
+
this.isSubmitting = false;
|
|
885
|
+
this.submitTimerId = null;
|
|
886
|
+
this.submit.emit();
|
|
887
|
+
}, delayMs);
|
|
2392
888
|
}
|
|
2393
889
|
ngOnDestroy() {
|
|
2394
890
|
if (this.submitTimerId) {
|
|
@@ -2396,33 +892,13 @@ class UserCreationWizardComponent {
|
|
|
2396
892
|
this.submitTimerId = null;
|
|
2397
893
|
}
|
|
2398
894
|
}
|
|
2399
|
-
_saveChanges() {
|
|
2400
|
-
this.isLoading = true;
|
|
2401
|
-
this.userCreationWizardService.saveNewUser()
|
|
2402
|
-
.subscribe((res) => {
|
|
2403
|
-
this.isLoading = false;
|
|
2404
|
-
this.isSubmitting = false;
|
|
2405
|
-
this.notificationService.success('User created successfully!');
|
|
2406
|
-
this.submit.emit();
|
|
2407
|
-
}, (error) => {
|
|
2408
|
-
this.isLoading = false;
|
|
2409
|
-
this.isSubmitting = false;
|
|
2410
|
-
if (typeof error === 'string' && error.indexOf(USER_CREATED_SUCCESSFLLY) > -1) {
|
|
2411
|
-
this.notificationService.success('User created successfully!');
|
|
2412
|
-
this.submit.emit();
|
|
2413
|
-
}
|
|
2414
|
-
else {
|
|
2415
|
-
this.notificationService.error(error?.error?.message || 'An error occurred while creating the user. Please try again.');
|
|
2416
|
-
}
|
|
2417
|
-
});
|
|
2418
|
-
}
|
|
2419
895
|
}
|
|
2420
|
-
UserCreationWizardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardComponent, deps: [
|
|
2421
|
-
UserCreationWizardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserCreationWizardComponent, selector: "tk-user-creation-wizard", inputs: { title: "title", host: "host", token: "token", customerId: "customerId" }, outputs: { cancel: "cancel", submit: "submit" }, viewQueries: [{ propertyName: "templateStep", first: true, predicate: UserTemplateStepComponent, descendants: true }, { propertyName: "detailsStep", first: true, predicate: UserDetailsStepComponent, descendants: true }], ngImport: i0, template: "<app-notification></app-notification>\n<app-loader *ngIf=\"isLoading\"></app-loader>\n<div class=\"move-user-stepper-container\" [attr.aria-busy]=\"isSubmitting\">\n <header class=\"move-user-header\">\n <div class=\"move-user-header__title\">{{ title }}</div>\n <div class=\"move-user-header__close\">\n <span class=\"app-icon user-creation-close-icon\" (click)=\"onCancel()\"></span>\n </div>\n </header>\n\n <div id=\"user-creation-stepper\">\n <mat-stepper [linear]=\"false\" labelPosition=\"bottom\" #stepper\n [selectedIndex]=\"selectedIndex\"\n (selectionChange)=\"onStepSelectionChange($event)\">\n\n <mat-step>\n <div class=\"step-title\">Step 1: User creation with template</div>\n <ng-template matStepLabel>User creation</ng-template>\n\n <ng-container *ngIf=\"selectedIndex === 0\">\n <div class=\"move-user-tab-content-box\">\n <tk-user-template-step\n [customerId]=\"customerId\"\n (validityChange)=\"templateStepValid = $event\"\n ></tk-user-template-step>\n </div>\n </ng-container>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 2 : User details</div>\n <ng-template matStepLabel>User details</ng-template>\n\n <ng-container *ngIf=\"selectedIndex === 1\">\n <div class=\"move-user-tab-content-box\">\n <tk-user-details-step (validityChange)=\"detailsStepValid = $event\"></tk-user-details-step>\n </div>\n </ng-container>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 3: Review</div>\n <ng-template matStepLabel>Review</ng-template>\n\n <ng-container *ngIf=\"selectedIndex === 2\">\n <div class=\"move-user-tab-content-box\">\n <tk-user-overview-step></tk-user-overview-step>\n </div>\n </ng-container>\n </mat-step>\n </mat-stepper>\n\n <div class=\"wizard-actions\">\n <ng-container [ngSwitch]=\"stepper.selectedIndex\">\n <ng-container *ngSwitchCase=\"0\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"!templateStepValid\"\n (click)=\"onStepperNext(stepper)\"\n >\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"onCancel()\">\n Cancel\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"1\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"!detailsStepValid\"\n (click)=\"onStepperNext(stepper)\"\n >\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"stepper.previous()\">\n Previous\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"2\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"onSubmit()\"\n >\n <span class=\"uc-btn__inline-content\">\n <span class=\"uc-btn__spinner\" *ngIf=\"isSubmitting\" aria-hidden=\"true\"></span>\n <span>{{ isSubmitting ? 'Creating...' : 'Create' }}</span>\n </span>\n </button>\n <button\n mat-button\n class=\"uc-btn uc-btn-secondary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"stepper.previous()\"\n >\n Previous\n </button>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"wizard-loading-overlay\" [class.wizard-loading-overlay--visible]=\"isSubmitting\" aria-hidden=\"true\"></div>\n</div>", styles: [".move-user-stepper-container{background-color:#f3f3f3;padding:0 0 16px;position:relative;overflow:hidden}.move-user-header{background-color:#1170cf;height:45px;padding:1rem 1.5rem;display:flex;align-items:center;justify-content:space-between;color:#fff;font-size:18px;font-weight:500}.move-user-header__close{cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:0}.move-user-header__close i{font-size:25px;font-weight:100}.app-icon{height:20px;width:20px;display:block;cursor:pointer;background-repeat:no-repeat;background-position:center}.user-creation-close-icon{background-image:url(\"data:image/svg+xml,%3Csvg width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M13.0606 11.9998L19.2803 5.78001C19.35 5.71038 19.4052 5.6277 19.4429 5.53672C19.4806 5.44573 19.5 5.34822 19.5 5.24974C19.5 5.15126 19.4806 5.05374 19.4429 4.96276C19.4052 4.87177 19.3499 4.7891 19.2803 4.71947C19.2107 4.64983 19.128 4.5946 19.037 4.55691C18.946 4.51923 18.8485 4.49983 18.75 4.49983C18.6515 4.49984 18.554 4.51924 18.463 4.55692C18.3721 4.59461 18.2894 4.64985 18.2198 4.71949L12 10.9392L5.78026 4.71949C5.71077 4.64921 5.62807 4.59335 5.53691 4.55514C5.44576 4.51692 5.34795 4.49711 5.24911 4.49683C5.15027 4.49655 5.05235 4.51581 4.96098 4.55351C4.86961 4.59121 4.78659 4.64659 4.7167 4.71648C4.64681 4.78638 4.59143 4.8694 4.55374 4.96077C4.51605 5.05214 4.49679 5.15006 4.49707 5.2489C4.49736 5.34774 4.51718 5.44555 4.5554 5.5367C4.59361 5.62786 4.64947 5.71055 4.71976 5.78004L10.9395 11.9998L4.71976 18.2195C4.65013 18.2892 4.59489 18.3718 4.5572 18.4628C4.51951 18.5538 4.50011 18.6513 4.50011 18.7498C4.50011 18.8483 4.51951 18.9458 4.5572 19.0368C4.59488 19.1278 4.65012 19.2105 4.71976 19.2801C4.7894 19.3497 4.87207 19.405 4.96305 19.4427C5.05403 19.4803 5.15155 19.4997 5.25003 19.4997C5.34851 19.4997 5.44603 19.4803 5.53701 19.4427C5.628 19.405 5.71067 19.3497 5.78031 19.2801L12.0001 13.0603L18.2198 19.2801C18.3604 19.4207 18.5512 19.4997 18.7501 19.4997C18.949 19.4997 19.1397 19.4207 19.2804 19.2801C19.421 19.1395 19.5 18.9487 19.5 18.7498C19.5 18.5509 19.421 18.3602 19.2804 18.2195L13.0606 11.9998Z%22 fill%3D%22white%22 fill-opacity%3D%220.95%22%2F%3E%3C%2Fsvg%3E\");background-size:20px 20px}#user-creation-stepper{display:flex;flex-direction:column;width:100%}#user-creation-stepper .mat-stepper-horizontal{margin:0 auto;width:100%;background-color:transparent}#user-creation-stepper .mat-horizontal-stepper-header-container{margin:0 auto;width:800px}#user-creation-stepper .mat-step-icon{width:28px;height:28px;border:3px solid hsl(0,0%,50.2%)}#user-creation-stepper .mat-step-icon-selected{background-color:#c6c6c6!important;border-color:#19487d}#user-creation-stepper .mat-step-icon-state-number{background-color:#fff}#user-creation-stepper .mat-step-icon-state-edit,#user-creation-stepper .mat-step-header .mat-step-icon-state-done{background-color:#1170cf;border-color:#1170cf}#user-creation-stepper .mat-step-icon-content{display:none}#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):before,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):before,#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):after,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):after{border-top-width:3px!important}#user-creation-stepper .mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header:after,#user-creation-stepper .mat-stepper-horizontal-line{border-top-color:#1170cf!important;border-top-width:3px!important;border-top-style:solid!important}#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-stepper-horizontal-line,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:after{border-top-width:3px!important;background-color:#7b7b7b!important;border-top-color:#7b7b7b!important}#user-creation-stepper .mat-horizontal-content-container{padding:0!important;margin-top:3rem}#user-creation-stepper .mat-horizontal-stepper-content[aria-expanded=true]{padding-bottom:0}.step-title{font-size:26px;font-weight:500;width:70%;margin:0 auto 1rem;min-height:32px;display:flex;align-items:center}.wizard-actions{display:flex;flex-flow:row-reverse;justify-content:flex-start;align-items:center;margin:16px 16px 0 0;align-self:flex-end;gap:1rem;position:relative;z-index:30}.uc-btn{border-radius:50px!important;padding:8px 16px!important;min-width:80px!important;line-height:normal!important;cursor:pointer}.uc-btn__inline-content{display:inline-flex;align-items:center;gap:8px}.uc-btn__spinner{width:14px;height:14px;border:2px solid rgba(255,255,255,.5);border-top-color:#fff;border-radius:50%;animation:uc-btn-spin .7s linear infinite}@keyframes uc-btn-spin{to{transform:rotate(360deg)}}.uc-btn-primary{background-color:#000!important;color:#fff!important;border:1px solid black!important}.uc-btn-secondary{background-color:#fff!important;color:#000!important;border:1px solid black!important}.move-user-tab-content-box{width:70%;margin:0 auto;background-color:#fff;min-height:350px;border:1px solid #C3C1C1;border-radius:8px;box-sizing:border-box;padding:25px}.wizard-loading-overlay{position:absolute;inset:0;background:rgba(243,243,243,.72);backdrop-filter:blur(1px);opacity:0;pointer-events:none;transition:opacity .18s ease;z-index:20}.wizard-loading-overlay--visible{opacity:1;pointer-events:auto}.wizard-actions .uc-btn-primary.mat-button-disabled{background-color:#bbb;color:#fff;border:1px solid grey;cursor:default!important;opacity:.3}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i4.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i4.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["selectedIndex", "disableRipple", "color", "labelPosition", "headerPosition", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }, { kind: "component", type: UserTemplateStepComponent, selector: "tk-user-template-step", inputs: ["customerId"], outputs: ["validityChange"] }, { kind: "component", type: NotificationsComponent, selector: "app-notification" }, { kind: "component", type: UserDetailsStepComponent, selector: "tk-user-details-step", outputs: ["validityChange"] }, { kind: "component", type: UserOverviewStepComponent, selector: "tk-user-overview-step" }, { kind: "component", type: AppLoaderComponent, selector: "app-loader" }], encapsulation: i0.ViewEncapsulation.None });
|
|
896
|
+
UserCreationWizardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
897
|
+
UserCreationWizardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserCreationWizardComponent, selector: "tk-user-creation-wizard", inputs: { title: "title", host: "host", token: "token", customerId: "customerId" }, outputs: { cancel: "cancel", submit: "submit" }, ngImport: i0, template: "<div class=\"move-user-stepper-container\" [attr.aria-busy]=\"isSubmitting\">\n <header class=\"move-user-header\">\n <div class=\"move-user-header__title\">{{ title }}</div>\n <div class=\"move-user-header__close\">\n <span class=\"app-icon user-creation-close-icon\" (click)=\"onCancel()\"></span>\n </div>\n </header>\n\n <div id=\"user-creation-stepper\">\n <mat-stepper [linear]=\"false\" labelPosition=\"bottom\" #stepper>\n <mat-step>\n <div class=\"step-title\">Step 1: User creation with template</div>\n <ng-template matStepLabel>User creation</ng-template>\n\n <div class=\"move-user-tab-content-box\">\n <tk-user-template-step [customerId]=\"customerId\"></tk-user-template-step>\n </div>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 2 : User details</div>\n <ng-template matStepLabel>User details</ng-template>\n\n <div class=\"move-user-tab-content-box\">\n <tk-user-details-step></tk-user-details-step>\n </div>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 3: Review</div>\n <ng-template matStepLabel>Review</ng-template>\n\n <div class=\"move-user-tab-content-box\">\n <tk-user-overview-step></tk-user-overview-step>\n </div>\n </mat-step>\n </mat-stepper>\n\n <div class=\"wizard-actions\">\n <ng-container [ngSwitch]=\"stepper.selectedIndex\">\n <ng-container *ngSwitchCase=\"0\">\n <button mat-button class=\"uc-btn uc-btn-primary\" type=\"button\" (click)=\"stepper.next()\">\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"onCancel()\">\n Cancel\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"1\">\n <button mat-button class=\"uc-btn uc-btn-primary\" type=\"button\" (click)=\"stepper.next()\">\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"stepper.previous()\">\n Previous\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"2\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"onSubmit()\"\n >\n <span class=\"uc-btn__inline-content\">\n <span class=\"uc-btn__spinner\" *ngIf=\"isSubmitting\" aria-hidden=\"true\"></span>\n <span>{{ isSubmitting ? 'Creating...' : 'Create' }}</span>\n </span>\n </button>\n <button\n mat-button\n class=\"uc-btn uc-btn-secondary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"stepper.previous()\"\n >\n Previous\n </button>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"wizard-loading-overlay\" [class.wizard-loading-overlay--visible]=\"isSubmitting\" aria-hidden=\"true\"></div>\n</div>\n", styles: [".move-user-stepper-container{background-color:#f3f3f3;padding:0 0 16px;position:relative;overflow:hidden}.move-user-header{background-color:#1170cf;height:45px;padding:1rem 1.5rem;display:flex;align-items:center;justify-content:space-between;color:#fff;font-size:18px;font-weight:500}.move-user-header__close{cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:0}.move-user-header__close i{font-size:25px;font-weight:100}.app-icon{height:20px;width:20px;display:block;cursor:pointer;background-repeat:no-repeat;background-position:center}.user-creation-close-icon{background-image:url(\"data:image/svg+xml,%3Csvg width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M13.0606 11.9998L19.2803 5.78001C19.35 5.71038 19.4052 5.6277 19.4429 5.53672C19.4806 5.44573 19.5 5.34822 19.5 5.24974C19.5 5.15126 19.4806 5.05374 19.4429 4.96276C19.4052 4.87177 19.3499 4.7891 19.2803 4.71947C19.2107 4.64983 19.128 4.5946 19.037 4.55691C18.946 4.51923 18.8485 4.49983 18.75 4.49983C18.6515 4.49984 18.554 4.51924 18.463 4.55692C18.3721 4.59461 18.2894 4.64985 18.2198 4.71949L12 10.9392L5.78026 4.71949C5.71077 4.64921 5.62807 4.59335 5.53691 4.55514C5.44576 4.51692 5.34795 4.49711 5.24911 4.49683C5.15027 4.49655 5.05235 4.51581 4.96098 4.55351C4.86961 4.59121 4.78659 4.64659 4.7167 4.71648C4.64681 4.78638 4.59143 4.8694 4.55374 4.96077C4.51605 5.05214 4.49679 5.15006 4.49707 5.2489C4.49736 5.34774 4.51718 5.44555 4.5554 5.5367C4.59361 5.62786 4.64947 5.71055 4.71976 5.78004L10.9395 11.9998L4.71976 18.2195C4.65013 18.2892 4.59489 18.3718 4.5572 18.4628C4.51951 18.5538 4.50011 18.6513 4.50011 18.7498C4.50011 18.8483 4.51951 18.9458 4.5572 19.0368C4.59488 19.1278 4.65012 19.2105 4.71976 19.2801C4.7894 19.3497 4.87207 19.405 4.96305 19.4427C5.05403 19.4803 5.15155 19.4997 5.25003 19.4997C5.34851 19.4997 5.44603 19.4803 5.53701 19.4427C5.628 19.405 5.71067 19.3497 5.78031 19.2801L12.0001 13.0603L18.2198 19.2801C18.3604 19.4207 18.5512 19.4997 18.7501 19.4997C18.949 19.4997 19.1397 19.4207 19.2804 19.2801C19.421 19.1395 19.5 18.9487 19.5 18.7498C19.5 18.5509 19.421 18.3602 19.2804 18.2195L13.0606 11.9998Z%22 fill%3D%22white%22 fill-opacity%3D%220.95%22%2F%3E%3C%2Fsvg%3E\");background-size:20px 20px}#user-creation-stepper{display:flex;flex-direction:column;width:100%}#user-creation-stepper .mat-stepper-horizontal{margin:0 auto;width:100%;background-color:transparent}#user-creation-stepper .mat-horizontal-stepper-header-container{margin:0 auto;width:800px}#user-creation-stepper .mat-step-icon{width:28px;height:28px;border:3px solid hsl(0,0%,50.2%)}#user-creation-stepper .mat-step-icon-selected{background-color:#c6c6c6!important;border-color:#19487d}#user-creation-stepper .mat-step-icon-state-number{background-color:#fff}#user-creation-stepper .mat-step-icon-state-edit,#user-creation-stepper .mat-step-header .mat-step-icon-state-done{background-color:#1170cf;border-color:#1170cf}#user-creation-stepper .mat-step-icon-content{display:none}#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):before,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):before,#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):after,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):after{border-top-width:3px!important}#user-creation-stepper .mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header:after,#user-creation-stepper .mat-stepper-horizontal-line{border-top-color:#1170cf!important;border-top-width:3px!important;border-top-style:solid!important}#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-stepper-horizontal-line,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:after{border-top-width:3px!important;background-color:#7b7b7b!important;border-top-color:#7b7b7b!important}#user-creation-stepper .mat-horizontal-content-container{padding:0!important;margin-top:3rem}#user-creation-stepper .mat-horizontal-stepper-content[aria-expanded=true]{padding-bottom:0}.step-title{font-size:26px;font-weight:500;width:70%;margin:0 auto 1rem;min-height:32px;display:flex;align-items:center}.wizard-actions{display:flex;flex-flow:row-reverse;justify-content:flex-start;align-items:center;margin:16px 16px 0 0;align-self:flex-end;gap:1rem;position:relative;z-index:30}.uc-btn{border-radius:50px!important;padding:8px 16px!important;min-width:80px!important;line-height:normal!important;cursor:pointer}.uc-btn__inline-content{display:inline-flex;align-items:center;gap:8px}.uc-btn__spinner{width:14px;height:14px;border:2px solid rgba(255,255,255,.5);border-top-color:#fff;border-radius:50%;animation:uc-btn-spin .7s linear infinite}@keyframes uc-btn-spin{to{transform:rotate(360deg)}}.uc-btn-primary{background-color:#000!important;color:#fff!important;border:1px solid black!important}.uc-btn-secondary{background-color:#fff!important;color:#000!important;border:1px solid black!important}.move-user-tab-content-box{width:70%;margin:0 auto;background-color:#fff;min-height:350px;border:1px solid #C3C1C1;border-radius:8px;box-sizing:border-box;padding:25px}.wizard-loading-overlay{position:absolute;inset:0;background:rgba(243,243,243,.72);backdrop-filter:blur(1px);opacity:0;pointer-events:none;transition:opacity .18s ease;z-index:20}.wizard-loading-overlay--visible{opacity:1;pointer-events:auto}.mat-button-disabled{background-color:#bbb;color:#fff;border:1px solid grey;cursor:default!important}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i4$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$2.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i3$2.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i3$2.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["selectedIndex", "disableRipple", "color", "labelPosition", "headerPosition", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }, { kind: "component", type: UserTemplateStepComponent, selector: "tk-user-template-step", inputs: ["customerId"] }, { kind: "component", type: UserDetailsStepComponent, selector: "tk-user-details-step" }, { kind: "component", type: UserOverviewStepComponent, selector: "tk-user-overview-step" }], encapsulation: i0.ViewEncapsulation.None });
|
|
2422
898
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardComponent, decorators: [{
|
|
2423
899
|
type: Component,
|
|
2424
|
-
args: [{ selector: 'tk-user-creation-wizard', encapsulation: ViewEncapsulation.None, template: "<app-notification></app-notification>\n<app-loader *ngIf=\"isLoading\"></app-loader>\n<div class=\"move-user-stepper-container\" [attr.aria-busy]=\"isSubmitting\">\n <header class=\"move-user-header\">\n <div class=\"move-user-header__title\">{{ title }}</div>\n <div class=\"move-user-header__close\">\n <span class=\"app-icon user-creation-close-icon\" (click)=\"onCancel()\"></span>\n </div>\n </header>\n\n <div id=\"user-creation-stepper\">\n <mat-stepper [linear]=\"false\" labelPosition=\"bottom\" #stepper\n [selectedIndex]=\"selectedIndex\"\n (selectionChange)=\"onStepSelectionChange($event)\">\n\n <mat-step>\n <div class=\"step-title\">Step 1: User creation with template</div>\n <ng-template matStepLabel>User creation</ng-template>\n\n <ng-container *ngIf=\"selectedIndex === 0\">\n <div class=\"move-user-tab-content-box\">\n <tk-user-template-step\n [customerId]=\"customerId\"\n (validityChange)=\"templateStepValid = $event\"\n ></tk-user-template-step>\n </div>\n </ng-container>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 2 : User details</div>\n <ng-template matStepLabel>User details</ng-template>\n\n <ng-container *ngIf=\"selectedIndex === 1\">\n <div class=\"move-user-tab-content-box\">\n <tk-user-details-step (validityChange)=\"detailsStepValid = $event\"></tk-user-details-step>\n </div>\n </ng-container>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 3: Review</div>\n <ng-template matStepLabel>Review</ng-template>\n\n <ng-container *ngIf=\"selectedIndex === 2\">\n <div class=\"move-user-tab-content-box\">\n <tk-user-overview-step></tk-user-overview-step>\n </div>\n </ng-container>\n </mat-step>\n </mat-stepper>\n\n <div class=\"wizard-actions\">\n <ng-container [ngSwitch]=\"stepper.selectedIndex\">\n <ng-container *ngSwitchCase=\"0\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"!templateStepValid\"\n (click)=\"onStepperNext(stepper)\"\n >\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"onCancel()\">\n Cancel\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"1\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"!detailsStepValid\"\n (click)=\"onStepperNext(stepper)\"\n >\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"stepper.previous()\">\n Previous\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"2\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"onSubmit()\"\n >\n <span class=\"uc-btn__inline-content\">\n <span class=\"uc-btn__spinner\" *ngIf=\"isSubmitting\" aria-hidden=\"true\"></span>\n <span>{{ isSubmitting ? 'Creating...' : 'Create' }}</span>\n </span>\n </button>\n <button\n mat-button\n class=\"uc-btn uc-btn-secondary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"stepper.previous()\"\n >\n Previous\n </button>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"wizard-loading-overlay\" [class.wizard-loading-overlay--visible]=\"isSubmitting\" aria-hidden=\"true\"></div>\n</div>", styles: [".move-user-stepper-container{background-color:#f3f3f3;padding:0 0 16px;position:relative;overflow:hidden}.move-user-header{background-color:#1170cf;height:45px;padding:1rem 1.5rem;display:flex;align-items:center;justify-content:space-between;color:#fff;font-size:18px;font-weight:500}.move-user-header__close{cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:0}.move-user-header__close i{font-size:25px;font-weight:100}.app-icon{height:20px;width:20px;display:block;cursor:pointer;background-repeat:no-repeat;background-position:center}.user-creation-close-icon{background-image:url(\"data:image/svg+xml,%3Csvg width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M13.0606 11.9998L19.2803 5.78001C19.35 5.71038 19.4052 5.6277 19.4429 5.53672C19.4806 5.44573 19.5 5.34822 19.5 5.24974C19.5 5.15126 19.4806 5.05374 19.4429 4.96276C19.4052 4.87177 19.3499 4.7891 19.2803 4.71947C19.2107 4.64983 19.128 4.5946 19.037 4.55691C18.946 4.51923 18.8485 4.49983 18.75 4.49983C18.6515 4.49984 18.554 4.51924 18.463 4.55692C18.3721 4.59461 18.2894 4.64985 18.2198 4.71949L12 10.9392L5.78026 4.71949C5.71077 4.64921 5.62807 4.59335 5.53691 4.55514C5.44576 4.51692 5.34795 4.49711 5.24911 4.49683C5.15027 4.49655 5.05235 4.51581 4.96098 4.55351C4.86961 4.59121 4.78659 4.64659 4.7167 4.71648C4.64681 4.78638 4.59143 4.8694 4.55374 4.96077C4.51605 5.05214 4.49679 5.15006 4.49707 5.2489C4.49736 5.34774 4.51718 5.44555 4.5554 5.5367C4.59361 5.62786 4.64947 5.71055 4.71976 5.78004L10.9395 11.9998L4.71976 18.2195C4.65013 18.2892 4.59489 18.3718 4.5572 18.4628C4.51951 18.5538 4.50011 18.6513 4.50011 18.7498C4.50011 18.8483 4.51951 18.9458 4.5572 19.0368C4.59488 19.1278 4.65012 19.2105 4.71976 19.2801C4.7894 19.3497 4.87207 19.405 4.96305 19.4427C5.05403 19.4803 5.15155 19.4997 5.25003 19.4997C5.34851 19.4997 5.44603 19.4803 5.53701 19.4427C5.628 19.405 5.71067 19.3497 5.78031 19.2801L12.0001 13.0603L18.2198 19.2801C18.3604 19.4207 18.5512 19.4997 18.7501 19.4997C18.949 19.4997 19.1397 19.4207 19.2804 19.2801C19.421 19.1395 19.5 18.9487 19.5 18.7498C19.5 18.5509 19.421 18.3602 19.2804 18.2195L13.0606 11.9998Z%22 fill%3D%22white%22 fill-opacity%3D%220.95%22%2F%3E%3C%2Fsvg%3E\");background-size:20px 20px}#user-creation-stepper{display:flex;flex-direction:column;width:100%}#user-creation-stepper .mat-stepper-horizontal{margin:0 auto;width:100%;background-color:transparent}#user-creation-stepper .mat-horizontal-stepper-header-container{margin:0 auto;width:800px}#user-creation-stepper .mat-step-icon{width:28px;height:28px;border:3px solid hsl(0,0%,50.2%)}#user-creation-stepper .mat-step-icon-selected{background-color:#c6c6c6!important;border-color:#19487d}#user-creation-stepper .mat-step-icon-state-number{background-color:#fff}#user-creation-stepper .mat-step-icon-state-edit,#user-creation-stepper .mat-step-header .mat-step-icon-state-done{background-color:#1170cf;border-color:#1170cf}#user-creation-stepper .mat-step-icon-content{display:none}#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):before,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):before,#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):after,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):after{border-top-width:3px!important}#user-creation-stepper .mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header:after,#user-creation-stepper .mat-stepper-horizontal-line{border-top-color:#1170cf!important;border-top-width:3px!important;border-top-style:solid!important}#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-stepper-horizontal-line,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:after{border-top-width:3px!important;background-color:#7b7b7b!important;border-top-color:#7b7b7b!important}#user-creation-stepper .mat-horizontal-content-container{padding:0!important;margin-top:3rem}#user-creation-stepper .mat-horizontal-stepper-content[aria-expanded=true]{padding-bottom:0}.step-title{font-size:26px;font-weight:500;width:70%;margin:0 auto 1rem;min-height:32px;display:flex;align-items:center}.wizard-actions{display:flex;flex-flow:row-reverse;justify-content:flex-start;align-items:center;margin:16px 16px 0 0;align-self:flex-end;gap:1rem;position:relative;z-index:30}.uc-btn{border-radius:50px!important;padding:8px 16px!important;min-width:80px!important;line-height:normal!important;cursor:pointer}.uc-btn__inline-content{display:inline-flex;align-items:center;gap:8px}.uc-btn__spinner{width:14px;height:14px;border:2px solid rgba(255,255,255,.5);border-top-color:#fff;border-radius:50%;animation:uc-btn-spin .7s linear infinite}@keyframes uc-btn-spin{to{transform:rotate(360deg)}}.uc-btn-primary{background-color:#000!important;color:#fff!important;border:1px solid black!important}.uc-btn-secondary{background-color:#fff!important;color:#000!important;border:1px solid black!important}.move-user-tab-content-box{width:70%;margin:0 auto;background-color:#fff;min-height:350px;border:1px solid #C3C1C1;border-radius:8px;box-sizing:border-box;padding:25px}.wizard-loading-overlay{position:absolute;inset:0;background:rgba(243,243,243,.72);backdrop-filter:blur(1px);opacity:0;pointer-events:none;transition:opacity .18s ease;z-index:20}.wizard-loading-overlay--visible{opacity:1;pointer-events:auto}.wizard-actions .uc-btn-primary.mat-button-disabled{background-color:#bbb;color:#fff;border:1px solid grey;cursor:default!important;opacity:.3}\n"] }]
|
|
2425
|
-
}],
|
|
900
|
+
args: [{ selector: 'tk-user-creation-wizard', encapsulation: ViewEncapsulation.None, template: "<div class=\"move-user-stepper-container\" [attr.aria-busy]=\"isSubmitting\">\n <header class=\"move-user-header\">\n <div class=\"move-user-header__title\">{{ title }}</div>\n <div class=\"move-user-header__close\">\n <span class=\"app-icon user-creation-close-icon\" (click)=\"onCancel()\"></span>\n </div>\n </header>\n\n <div id=\"user-creation-stepper\">\n <mat-stepper [linear]=\"false\" labelPosition=\"bottom\" #stepper>\n <mat-step>\n <div class=\"step-title\">Step 1: User creation with template</div>\n <ng-template matStepLabel>User creation</ng-template>\n\n <div class=\"move-user-tab-content-box\">\n <tk-user-template-step [customerId]=\"customerId\"></tk-user-template-step>\n </div>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 2 : User details</div>\n <ng-template matStepLabel>User details</ng-template>\n\n <div class=\"move-user-tab-content-box\">\n <tk-user-details-step></tk-user-details-step>\n </div>\n </mat-step>\n\n <mat-step>\n <div class=\"step-title\">Step 3: Review</div>\n <ng-template matStepLabel>Review</ng-template>\n\n <div class=\"move-user-tab-content-box\">\n <tk-user-overview-step></tk-user-overview-step>\n </div>\n </mat-step>\n </mat-stepper>\n\n <div class=\"wizard-actions\">\n <ng-container [ngSwitch]=\"stepper.selectedIndex\">\n <ng-container *ngSwitchCase=\"0\">\n <button mat-button class=\"uc-btn uc-btn-primary\" type=\"button\" (click)=\"stepper.next()\">\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"onCancel()\">\n Cancel\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"1\">\n <button mat-button class=\"uc-btn uc-btn-primary\" type=\"button\" (click)=\"stepper.next()\">\n Next\n </button>\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"stepper.previous()\">\n Previous\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"2\">\n <button\n mat-button\n class=\"uc-btn uc-btn-primary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"onSubmit()\"\n >\n <span class=\"uc-btn__inline-content\">\n <span class=\"uc-btn__spinner\" *ngIf=\"isSubmitting\" aria-hidden=\"true\"></span>\n <span>{{ isSubmitting ? 'Creating...' : 'Create' }}</span>\n </span>\n </button>\n <button\n mat-button\n class=\"uc-btn uc-btn-secondary\"\n type=\"button\"\n [disabled]=\"isSubmitting\"\n (click)=\"stepper.previous()\"\n >\n Previous\n </button>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"wizard-loading-overlay\" [class.wizard-loading-overlay--visible]=\"isSubmitting\" aria-hidden=\"true\"></div>\n</div>\n", styles: [".move-user-stepper-container{background-color:#f3f3f3;padding:0 0 16px;position:relative;overflow:hidden}.move-user-header{background-color:#1170cf;height:45px;padding:1rem 1.5rem;display:flex;align-items:center;justify-content:space-between;color:#fff;font-size:18px;font-weight:500}.move-user-header__close{cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:0}.move-user-header__close i{font-size:25px;font-weight:100}.app-icon{height:20px;width:20px;display:block;cursor:pointer;background-repeat:no-repeat;background-position:center}.user-creation-close-icon{background-image:url(\"data:image/svg+xml,%3Csvg width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M13.0606 11.9998L19.2803 5.78001C19.35 5.71038 19.4052 5.6277 19.4429 5.53672C19.4806 5.44573 19.5 5.34822 19.5 5.24974C19.5 5.15126 19.4806 5.05374 19.4429 4.96276C19.4052 4.87177 19.3499 4.7891 19.2803 4.71947C19.2107 4.64983 19.128 4.5946 19.037 4.55691C18.946 4.51923 18.8485 4.49983 18.75 4.49983C18.6515 4.49984 18.554 4.51924 18.463 4.55692C18.3721 4.59461 18.2894 4.64985 18.2198 4.71949L12 10.9392L5.78026 4.71949C5.71077 4.64921 5.62807 4.59335 5.53691 4.55514C5.44576 4.51692 5.34795 4.49711 5.24911 4.49683C5.15027 4.49655 5.05235 4.51581 4.96098 4.55351C4.86961 4.59121 4.78659 4.64659 4.7167 4.71648C4.64681 4.78638 4.59143 4.8694 4.55374 4.96077C4.51605 5.05214 4.49679 5.15006 4.49707 5.2489C4.49736 5.34774 4.51718 5.44555 4.5554 5.5367C4.59361 5.62786 4.64947 5.71055 4.71976 5.78004L10.9395 11.9998L4.71976 18.2195C4.65013 18.2892 4.59489 18.3718 4.5572 18.4628C4.51951 18.5538 4.50011 18.6513 4.50011 18.7498C4.50011 18.8483 4.51951 18.9458 4.5572 19.0368C4.59488 19.1278 4.65012 19.2105 4.71976 19.2801C4.7894 19.3497 4.87207 19.405 4.96305 19.4427C5.05403 19.4803 5.15155 19.4997 5.25003 19.4997C5.34851 19.4997 5.44603 19.4803 5.53701 19.4427C5.628 19.405 5.71067 19.3497 5.78031 19.2801L12.0001 13.0603L18.2198 19.2801C18.3604 19.4207 18.5512 19.4997 18.7501 19.4997C18.949 19.4997 19.1397 19.4207 19.2804 19.2801C19.421 19.1395 19.5 18.9487 19.5 18.7498C19.5 18.5509 19.421 18.3602 19.2804 18.2195L13.0606 11.9998Z%22 fill%3D%22white%22 fill-opacity%3D%220.95%22%2F%3E%3C%2Fsvg%3E\");background-size:20px 20px}#user-creation-stepper{display:flex;flex-direction:column;width:100%}#user-creation-stepper .mat-stepper-horizontal{margin:0 auto;width:100%;background-color:transparent}#user-creation-stepper .mat-horizontal-stepper-header-container{margin:0 auto;width:800px}#user-creation-stepper .mat-step-icon{width:28px;height:28px;border:3px solid hsl(0,0%,50.2%)}#user-creation-stepper .mat-step-icon-selected{background-color:#c6c6c6!important;border-color:#19487d}#user-creation-stepper .mat-step-icon-state-number{background-color:#fff}#user-creation-stepper .mat-step-icon-state-edit,#user-creation-stepper .mat-step-header .mat-step-icon-state-done{background-color:#1170cf;border-color:#1170cf}#user-creation-stepper .mat-step-icon-content{display:none}#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):before,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):before,#user-creation-stepper .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child):after,#user-creation-stepper [dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child):after{border-top-width:3px!important}#user-creation-stepper .mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header:after,#user-creation-stepper .mat-stepper-horizontal-line{border-top-color:#1170cf!important;border-top-width:3px!important;border-top-style:solid!important}#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-stepper-horizontal-line,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:before,#user-creation-stepper .mat-horizontal-stepper-header[aria-selected=true]~.mat-horizontal-stepper-header:after{border-top-width:3px!important;background-color:#7b7b7b!important;border-top-color:#7b7b7b!important}#user-creation-stepper .mat-horizontal-content-container{padding:0!important;margin-top:3rem}#user-creation-stepper .mat-horizontal-stepper-content[aria-expanded=true]{padding-bottom:0}.step-title{font-size:26px;font-weight:500;width:70%;margin:0 auto 1rem;min-height:32px;display:flex;align-items:center}.wizard-actions{display:flex;flex-flow:row-reverse;justify-content:flex-start;align-items:center;margin:16px 16px 0 0;align-self:flex-end;gap:1rem;position:relative;z-index:30}.uc-btn{border-radius:50px!important;padding:8px 16px!important;min-width:80px!important;line-height:normal!important;cursor:pointer}.uc-btn__inline-content{display:inline-flex;align-items:center;gap:8px}.uc-btn__spinner{width:14px;height:14px;border:2px solid rgba(255,255,255,.5);border-top-color:#fff;border-radius:50%;animation:uc-btn-spin .7s linear infinite}@keyframes uc-btn-spin{to{transform:rotate(360deg)}}.uc-btn-primary{background-color:#000!important;color:#fff!important;border:1px solid black!important}.uc-btn-secondary{background-color:#fff!important;color:#000!important;border:1px solid black!important}.move-user-tab-content-box{width:70%;margin:0 auto;background-color:#fff;min-height:350px;border:1px solid #C3C1C1;border-radius:8px;box-sizing:border-box;padding:25px}.wizard-loading-overlay{position:absolute;inset:0;background:rgba(243,243,243,.72);backdrop-filter:blur(1px);opacity:0;pointer-events:none;transition:opacity .18s ease;z-index:20}.wizard-loading-overlay--visible{opacity:1;pointer-events:auto}.mat-button-disabled{background-color:#bbb;color:#fff;border:1px solid grey;cursor:default!important}\n"] }]
|
|
901
|
+
}], propDecorators: { title: [{
|
|
2426
902
|
type: Input
|
|
2427
903
|
}], host: [{
|
|
2428
904
|
type: Input
|
|
@@ -2434,38 +910,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2434
910
|
type: Output
|
|
2435
911
|
}], submit: [{
|
|
2436
912
|
type: Output
|
|
2437
|
-
}], templateStep: [{
|
|
2438
|
-
type: ViewChild,
|
|
2439
|
-
args: [UserTemplateStepComponent]
|
|
2440
|
-
}], detailsStep: [{
|
|
2441
|
-
type: ViewChild,
|
|
2442
|
-
args: [UserDetailsStepComponent]
|
|
2443
913
|
}] } });
|
|
2444
914
|
|
|
2445
|
-
function HttpLoaderFactory(http) {
|
|
2446
|
-
return new TranslateHttpLoader(http);
|
|
2447
|
-
}
|
|
2448
915
|
class UserCreationModule {
|
|
2449
916
|
}
|
|
2450
917
|
UserCreationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2451
918
|
UserCreationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UserCreationModule, declarations: [UserCreationWizardComponent,
|
|
2452
919
|
UserTemplateStepComponent,
|
|
2453
|
-
NotificationsComponent,
|
|
2454
920
|
UserDetailsStepComponent,
|
|
2455
|
-
UserOverviewStepComponent,
|
|
2456
|
-
AppLoaderComponent,
|
|
2457
|
-
TruncatePipe], imports: [CommonModule,
|
|
921
|
+
UserOverviewStepComponent], imports: [CommonModule,
|
|
2458
922
|
SharedModule,
|
|
2459
923
|
MaterialModule,
|
|
2460
924
|
MatStepperModule,
|
|
2461
925
|
MatExpansionModule,
|
|
2462
926
|
FormsModule,
|
|
2463
927
|
ReactiveFormsModule,
|
|
2464
|
-
MatRadioModule
|
|
928
|
+
MatRadioModule], exports: [UserCreationWizardComponent] });
|
|
2465
929
|
UserCreationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationModule, providers: [
|
|
2466
930
|
UserCreationApiService,
|
|
2467
931
|
UserCreationWizardService,
|
|
2468
|
-
NotificationService,
|
|
2469
932
|
], imports: [CommonModule,
|
|
2470
933
|
SharedModule,
|
|
2471
934
|
MaterialModule,
|
|
@@ -2473,25 +936,15 @@ UserCreationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", vers
|
|
|
2473
936
|
MatExpansionModule,
|
|
2474
937
|
FormsModule,
|
|
2475
938
|
ReactiveFormsModule,
|
|
2476
|
-
MatRadioModule
|
|
2477
|
-
TranslateModule.forRoot({
|
|
2478
|
-
loader: {
|
|
2479
|
-
provide: TranslateLoader,
|
|
2480
|
-
useFactory: HttpLoaderFactory,
|
|
2481
|
-
deps: [HttpClient]
|
|
2482
|
-
}
|
|
2483
|
-
})] });
|
|
939
|
+
MatRadioModule] });
|
|
2484
940
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationModule, decorators: [{
|
|
2485
941
|
type: NgModule,
|
|
2486
942
|
args: [{
|
|
2487
943
|
declarations: [
|
|
2488
944
|
UserCreationWizardComponent,
|
|
2489
945
|
UserTemplateStepComponent,
|
|
2490
|
-
NotificationsComponent,
|
|
2491
946
|
UserDetailsStepComponent,
|
|
2492
|
-
UserOverviewStepComponent
|
|
2493
|
-
AppLoaderComponent,
|
|
2494
|
-
TruncatePipe,
|
|
947
|
+
UserOverviewStepComponent
|
|
2495
948
|
],
|
|
2496
949
|
imports: [
|
|
2497
950
|
CommonModule,
|
|
@@ -2501,22 +954,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2501
954
|
MatExpansionModule,
|
|
2502
955
|
FormsModule,
|
|
2503
956
|
ReactiveFormsModule,
|
|
2504
|
-
MatRadioModule
|
|
2505
|
-
TranslateModule.forRoot({
|
|
2506
|
-
loader: {
|
|
2507
|
-
provide: TranslateLoader,
|
|
2508
|
-
useFactory: HttpLoaderFactory,
|
|
2509
|
-
deps: [HttpClient]
|
|
2510
|
-
}
|
|
2511
|
-
}),
|
|
957
|
+
MatRadioModule
|
|
2512
958
|
],
|
|
2513
959
|
exports: [
|
|
2514
|
-
UserCreationWizardComponent
|
|
960
|
+
UserCreationWizardComponent
|
|
2515
961
|
],
|
|
2516
962
|
providers: [
|
|
2517
963
|
UserCreationApiService,
|
|
2518
964
|
UserCreationWizardService,
|
|
2519
|
-
NotificationService,
|
|
2520
965
|
]
|
|
2521
966
|
}]
|
|
2522
967
|
}] });
|
|
@@ -2534,5 +979,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2534
979
|
* Generated bundle index. Do not edit.
|
|
2535
980
|
*/
|
|
2536
981
|
|
|
2537
|
-
export {
|
|
982
|
+
export { UserCreationModule, UserCreationWizardComponent };
|
|
2538
983
|
//# sourceMappingURL=tuki-io-tuki-widgets-user-creation.mjs.map
|