@tuki-io/tuki-widgets 0.0.166 → 0.0.168
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/services/api.service.mjs +3 -3
- package/esm2020/user-creation/public-api.mjs +13 -0
- package/esm2020/user-creation/src/app.constants.mjs +16 -0
- package/esm2020/user-creation/src/classes/site.mjs +53 -0
- package/esm2020/user-creation/src/shared/api/api.service.mjs +86 -0
- package/esm2020/user-creation/src/shared/material.module.mjs +76 -0
- package/esm2020/user-creation/src/shared/services/user-creation-api.service.mjs +112 -0
- package/esm2020/user-creation/src/shared/services/utils.mjs +19 -0
- package/esm2020/user-creation/src/shared/shared.module.mjs +33 -0
- package/esm2020/user-creation/src/user-creation.module.mjs +69 -0
- package/esm2020/user-creation/src/widgets/user-creation-wizard/components/user-details-step/user-details-step.component.mjs +23 -0
- package/esm2020/user-creation/src/widgets/user-creation-wizard/components/user-overview-step/user-overview-step.component.mjs +19 -0
- package/esm2020/user-creation/src/widgets/user-creation-wizard/components/user-template-step/user-template-step.component.mjs +114 -0
- package/esm2020/user-creation/src/widgets/user-creation-wizard/user-creation-wizard.component.mjs +60 -0
- package/esm2020/user-creation/src/widgets/user-creation-wizard/user-creation-wizard.service.mjs +273 -0
- package/esm2020/user-creation/tuki-io-tuki-widgets-user-creation.mjs +5 -0
- package/esm2020/users-list/src/components/table-toolbar/table-toolbar.component.mjs +9 -3
- package/esm2020/users-list/src/users-list.component.mjs +9 -3
- package/fesm2015/tuki-io-tuki-widgets-di2mt.mjs +2 -2
- package/fesm2015/tuki-io-tuki-widgets-di2mt.mjs.map +1 -1
- package/fesm2015/tuki-io-tuki-widgets-user-creation.mjs +919 -0
- package/fesm2015/tuki-io-tuki-widgets-user-creation.mjs.map +1 -0
- package/fesm2015/tuki-io-tuki-widgets-users-list.mjs +16 -4
- package/fesm2015/tuki-io-tuki-widgets-users-list.mjs.map +1 -1
- package/fesm2020/tuki-io-tuki-widgets-di2mt.mjs +2 -2
- package/fesm2020/tuki-io-tuki-widgets-di2mt.mjs.map +1 -1
- package/fesm2020/tuki-io-tuki-widgets-user-creation.mjs +915 -0
- package/fesm2020/tuki-io-tuki-widgets-user-creation.mjs.map +1 -0
- package/fesm2020/tuki-io-tuki-widgets-users-list.mjs +16 -4
- package/fesm2020/tuki-io-tuki-widgets-users-list.mjs.map +1 -1
- package/package.json +9 -1
- package/user-creation/index.d.ts +5 -0
- package/user-creation/public-api.d.ts +2 -0
- package/user-creation/src/app.constants.d.ts +15 -0
- package/user-creation/src/classes/site.d.ts +203 -0
- package/user-creation/src/shared/api/api.service.d.ts +20 -0
- package/user-creation/src/shared/material.module.d.ts +15 -0
- package/user-creation/src/shared/services/user-creation-api.service.d.ts +24 -0
- package/user-creation/src/shared/services/utils.d.ts +1 -0
- package/user-creation/src/shared/shared.module.d.ts +10 -0
- package/user-creation/src/user-creation.module.d.ts +17 -0
- package/user-creation/src/widgets/user-creation-wizard/components/user-details-step/user-details-step.component.d.ts +8 -0
- package/user-creation/src/widgets/user-creation-wizard/components/user-overview-step/user-overview-step.component.d.ts +11 -0
- package/user-creation/src/widgets/user-creation-wizard/components/user-template-step/user-template-step.component.d.ts +37 -0
- package/user-creation/src/widgets/user-creation-wizard/user-creation-wizard.component.d.ts +18 -0
- package/user-creation/src/widgets/user-creation-wizard/user-creation-wizard.service.d.ts +87 -0
- package/users-list/src/components/table-toolbar/table-toolbar.component.d.ts +3 -1
- package/users-list/src/users-list.component.d.ts +3 -1
|
@@ -0,0 +1,919 @@
|
|
|
1
|
+
import * as i4 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
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
|
+
import { MatExpansionModule } from '@angular/material/expansion';
|
|
9
|
+
import * as i8$1 from '@angular/material/radio';
|
|
10
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
11
|
+
import * as i3$2 from '@angular/material/stepper';
|
|
12
|
+
import { MatStepperModule } from '@angular/material/stepper';
|
|
13
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
14
|
+
import * as i3 from '@angular/material/table';
|
|
15
|
+
import { MatTableModule } from '@angular/material/table';
|
|
16
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
17
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
18
|
+
import * as i4$1 from '@angular/material/button';
|
|
19
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
20
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
21
|
+
import * as i5 from '@angular/material/form-field';
|
|
22
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
23
|
+
import * as i6 from '@angular/material/input';
|
|
24
|
+
import { MatInputModule } from '@angular/material/input';
|
|
25
|
+
import * as i7 from '@angular/material/select';
|
|
26
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
27
|
+
import { BehaviorSubject, tap, forkJoin, map, Subject, takeUntil, filter, startWith, switchMap, of } from 'rxjs';
|
|
28
|
+
import * as i1 from '@angular/common/http';
|
|
29
|
+
import { HttpHeaders, HttpClientModule } from '@angular/common/http';
|
|
30
|
+
import { NgApexchartsModule } from 'ng-apexcharts';
|
|
31
|
+
import * as i8 from '@angular/material/core';
|
|
32
|
+
|
|
33
|
+
class MaterialModule {
|
|
34
|
+
}
|
|
35
|
+
MaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
36
|
+
MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, imports: [MatProgressBarModule,
|
|
37
|
+
MatTooltipModule,
|
|
38
|
+
MatTableModule,
|
|
39
|
+
MatCheckboxModule,
|
|
40
|
+
MatButtonModule,
|
|
41
|
+
MatIconModule,
|
|
42
|
+
MatFormFieldModule,
|
|
43
|
+
MatInputModule,
|
|
44
|
+
MatSelectModule], exports: [MatProgressBarModule,
|
|
45
|
+
MatTooltipModule,
|
|
46
|
+
MatTableModule,
|
|
47
|
+
MatCheckboxModule,
|
|
48
|
+
MatButtonModule,
|
|
49
|
+
MatIconModule,
|
|
50
|
+
MatFormFieldModule,
|
|
51
|
+
MatInputModule,
|
|
52
|
+
MatSelectModule] });
|
|
53
|
+
MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, imports: [MatProgressBarModule,
|
|
54
|
+
MatTooltipModule,
|
|
55
|
+
MatTableModule,
|
|
56
|
+
MatCheckboxModule,
|
|
57
|
+
MatButtonModule,
|
|
58
|
+
MatIconModule,
|
|
59
|
+
MatFormFieldModule,
|
|
60
|
+
MatInputModule,
|
|
61
|
+
MatSelectModule, MatProgressBarModule,
|
|
62
|
+
MatTooltipModule,
|
|
63
|
+
MatTableModule,
|
|
64
|
+
MatCheckboxModule,
|
|
65
|
+
MatButtonModule,
|
|
66
|
+
MatIconModule,
|
|
67
|
+
MatFormFieldModule,
|
|
68
|
+
MatInputModule,
|
|
69
|
+
MatSelectModule] });
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, decorators: [{
|
|
71
|
+
type: NgModule,
|
|
72
|
+
args: [{
|
|
73
|
+
imports: [
|
|
74
|
+
MatProgressBarModule,
|
|
75
|
+
MatTooltipModule,
|
|
76
|
+
MatTableModule,
|
|
77
|
+
MatCheckboxModule,
|
|
78
|
+
MatButtonModule,
|
|
79
|
+
MatIconModule,
|
|
80
|
+
MatFormFieldModule,
|
|
81
|
+
MatInputModule,
|
|
82
|
+
MatSelectModule
|
|
83
|
+
],
|
|
84
|
+
exports: [
|
|
85
|
+
MatProgressBarModule,
|
|
86
|
+
MatTooltipModule,
|
|
87
|
+
MatTableModule,
|
|
88
|
+
MatCheckboxModule,
|
|
89
|
+
MatButtonModule,
|
|
90
|
+
MatIconModule,
|
|
91
|
+
MatFormFieldModule,
|
|
92
|
+
MatInputModule,
|
|
93
|
+
MatSelectModule
|
|
94
|
+
]
|
|
95
|
+
}]
|
|
96
|
+
}] });
|
|
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 === null || siteDefaults === void 0 ? void 0 : siteDefaults.sharedSitesCssFilter) || [];
|
|
163
|
+
this.routePartitionFilter = (siteDefaults === null || siteDefaults === void 0 ? void 0 : 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
|
+
|
|
184
|
+
class APIService {
|
|
185
|
+
constructor(httpClient) {
|
|
186
|
+
this.httpClient = httpClient;
|
|
187
|
+
this.apiUrl = window.location.protocol + '//' + window.location.hostname + '/dcp';
|
|
188
|
+
this.token = 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbkBjb3JyZW5ldC5jb20iLCJyb2xlcyI6IlNVUEVSX1VTRVIiLCJpYXQiOjE3NzM5NDcwMTcsImV4cCI6MTc3Mzk2NTAxN30.D2siE2z4BgOHAzRJ9x2jq7kTmTYdxRdq65m-Fs200Hk';
|
|
189
|
+
// this.apiUrl = window.location.protocol + '//' + window.location.host + '/dcp';
|
|
190
|
+
this.apiUrl = 'https://dev.tuki.io';
|
|
191
|
+
// this.apiUrl = 'http://localhost:8088/dcp';
|
|
192
|
+
}
|
|
193
|
+
fetch(url, params, cache) {
|
|
194
|
+
const headers = this.getHeaders(cache);
|
|
195
|
+
params = params || {};
|
|
196
|
+
return this.httpClient.get(this.apiUrl + url, { params: this.prepareEncodedParams(params), headers });
|
|
197
|
+
}
|
|
198
|
+
post(url, body, params = {}) {
|
|
199
|
+
body = body || null;
|
|
200
|
+
const headers = this.getHeaders();
|
|
201
|
+
return this.httpClient.post(this.apiUrl + url, body, { params: this.prepareEncodedParams(params), headers });
|
|
202
|
+
}
|
|
203
|
+
// use when response extended data is necessary:
|
|
204
|
+
postExtended(url, body = null, params = {}, headers = {}) {
|
|
205
|
+
headers = headers || this.getHeaders();
|
|
206
|
+
return this.httpClient.post(this.apiUrl + url, body, {
|
|
207
|
+
headers,
|
|
208
|
+
observe: 'response',
|
|
209
|
+
params: this.prepareEncodedParams(params)
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
put(url, body = null, params = {}) {
|
|
213
|
+
const headers = this.getHeaders();
|
|
214
|
+
return this.httpClient.put(this.apiUrl + url, body, { headers, params: this.prepareEncodedParams(params) });
|
|
215
|
+
}
|
|
216
|
+
delete(url, params = {}) {
|
|
217
|
+
const headers = this.getHeaders();
|
|
218
|
+
return this.httpClient.delete(this.apiUrl + url, { headers, params: this.prepareEncodedParams(params) });
|
|
219
|
+
}
|
|
220
|
+
fetchPagination(url, pageSize, pageNumber, additionalParams = {}, cache) {
|
|
221
|
+
const copyAdditionalParams = JSON.parse(JSON.stringify(additionalParams));
|
|
222
|
+
const params = Object.assign(copyAdditionalParams, { size: pageSize.toString(), page: pageNumber.toString() });
|
|
223
|
+
return this.fetch(url, params, cache);
|
|
224
|
+
}
|
|
225
|
+
prepareEncodedParams(params) {
|
|
226
|
+
const result = {};
|
|
227
|
+
if (!params) {
|
|
228
|
+
return {};
|
|
229
|
+
}
|
|
230
|
+
for (const key of Object.keys(params)) {
|
|
231
|
+
if (params[key]) {
|
|
232
|
+
const stringParam = params[key].toString();
|
|
233
|
+
result[key] = stringParam.includes('+') ? encodeURIComponent(stringParam) : stringParam;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return result;
|
|
237
|
+
}
|
|
238
|
+
getHeaders(cache) {
|
|
239
|
+
let headers = new HttpHeaders();
|
|
240
|
+
if (cache) {
|
|
241
|
+
headers = headers.append('_Cache', 'true ');
|
|
242
|
+
}
|
|
243
|
+
const token = this.token || this.getParameterByName('token');
|
|
244
|
+
headers = headers.append('Authorization', 'Bearer ' + token);
|
|
245
|
+
return headers;
|
|
246
|
+
}
|
|
247
|
+
getParameterByName(name, url = window.location.href) {
|
|
248
|
+
name = name.replace(/[\[\]]/g, '\\$&');
|
|
249
|
+
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url);
|
|
250
|
+
if (!results)
|
|
251
|
+
return null;
|
|
252
|
+
if (!results[2])
|
|
253
|
+
return '';
|
|
254
|
+
return decodeURIComponent(results[2].replace(/\+/g, ' '));
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
APIService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
258
|
+
APIService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService, providedIn: 'root' });
|
|
259
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService, decorators: [{
|
|
260
|
+
type: Injectable,
|
|
261
|
+
args: [{
|
|
262
|
+
providedIn: 'root'
|
|
263
|
+
}]
|
|
264
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
265
|
+
|
|
266
|
+
class UserCreationApiService {
|
|
267
|
+
constructor() {
|
|
268
|
+
this._allSites = [];
|
|
269
|
+
this.sitesListSubject$ = new BehaviorSubject([]);
|
|
270
|
+
this.sitesList$ = this.sitesListSubject$.asObservable();
|
|
271
|
+
this.templatesListSubject$ = new BehaviorSubject([]);
|
|
272
|
+
this.templatesList$ = this.templatesListSubject$.asObservable();
|
|
273
|
+
this.apiService = inject(APIService);
|
|
274
|
+
}
|
|
275
|
+
getSitesList() {
|
|
276
|
+
}
|
|
277
|
+
checkControlHubIntegration(customerId) {
|
|
278
|
+
const URL = API.WEBEX_CHECK_CONTROL_HUB_INTEGRATION.replace(':customerId', String(customerId));
|
|
279
|
+
return this.apiService.fetch(URL);
|
|
280
|
+
// .pipe(this.handleError(true, true));
|
|
281
|
+
}
|
|
282
|
+
getAllCustomerSites(customerId, onlySitesWithLocation) {
|
|
283
|
+
const params = {};
|
|
284
|
+
if (onlySitesWithLocation) {
|
|
285
|
+
params['onlySitesWithLocation'] = 'true';
|
|
286
|
+
}
|
|
287
|
+
return this.apiService.fetchPagination(API.SITES.replace(':customerId', String(customerId)), MAX_INTEGER, 0, params, false)
|
|
288
|
+
.pipe(tap((res) => {
|
|
289
|
+
// this._allSites = [];
|
|
290
|
+
// if (res.pageData && res.pageData.length) {
|
|
291
|
+
// this.assignAllSites(customerId, res.pageData);
|
|
292
|
+
// }
|
|
293
|
+
// this.allCustomerSites$.next(true);
|
|
294
|
+
// return this._allSites;
|
|
295
|
+
this.sitesListSubject$.next(res.pageData);
|
|
296
|
+
}));
|
|
297
|
+
// .pipe(this.handleError(true));
|
|
298
|
+
}
|
|
299
|
+
getSiteData(siteId) {
|
|
300
|
+
// this.dataPending = true;
|
|
301
|
+
return forkJoin([
|
|
302
|
+
this.getSite(siteId),
|
|
303
|
+
this.getDeviceTypes(siteId),
|
|
304
|
+
this.getSiteDefaults(siteId, false),
|
|
305
|
+
this.getVoiceMailUserTemplates(siteId)
|
|
306
|
+
]).pipe(tap(() => {
|
|
307
|
+
// this.userFeaturesService.setDefaultUcProfile();
|
|
308
|
+
}));
|
|
309
|
+
}
|
|
310
|
+
getSite(siteId, isEdit) {
|
|
311
|
+
return this.apiService.fetch(API.SITE.replace(':siteId', String(siteId)), null, false)
|
|
312
|
+
.pipe(map((siteData) => {
|
|
313
|
+
const site = new Site(siteData);
|
|
314
|
+
// if (isEdit) {
|
|
315
|
+
// this.setEditSite(site);
|
|
316
|
+
// } else {
|
|
317
|
+
// this.setCurrentSite(site);
|
|
318
|
+
// }
|
|
319
|
+
return site;
|
|
320
|
+
}));
|
|
321
|
+
}
|
|
322
|
+
getDeviceTypes(siteId) {
|
|
323
|
+
return this.apiService.fetch(API.DEVICE_TYPES.replace(':siteId', String(siteId)), null, true);
|
|
324
|
+
// .pipe(
|
|
325
|
+
// map((types: string[]) => {
|
|
326
|
+
// // this.deviceTypes = types)
|
|
327
|
+
// })
|
|
328
|
+
// );
|
|
329
|
+
// .pipe(this.handleError(false, true));
|
|
330
|
+
}
|
|
331
|
+
getSiteDefaults(siteId, directAccess, sharedLineSiteIds) {
|
|
332
|
+
const params = { directAccess: directAccess };
|
|
333
|
+
// if (sharedLineSiteIds) {
|
|
334
|
+
// params['sharedLineSiteIds'] = sharedLineSiteIds;
|
|
335
|
+
// }
|
|
336
|
+
return this.apiService.fetch(API.SITE_SETTINGS.replace(':siteId', String(siteId)), params);
|
|
337
|
+
// .pipe(map((siteDefaults: SiteTemplateInterface) => {
|
|
338
|
+
// // this.siteDefaults = new SiteDefaults(siteDefaults, !!sharedLineSiteIds);
|
|
339
|
+
// // const copiedSiteDefaults = JSON.parse(JSON.stringify(siteDefaults));
|
|
340
|
+
// // this.originalSiteDefaults = new SiteDefaults(copiedSiteDefaults, !!sharedLineSiteIds);
|
|
341
|
+
// }));
|
|
342
|
+
// .pipe(this.handleError(true, true));
|
|
343
|
+
}
|
|
344
|
+
getVoiceMailUserTemplates(siteId) {
|
|
345
|
+
return this.apiService.fetch(API.VM_USER_TEMPLATES.replace(':siteId', String(siteId)), null, true)
|
|
346
|
+
.pipe(map((templates) => {
|
|
347
|
+
// this.voiceMailTemplates = templates;
|
|
348
|
+
}));
|
|
349
|
+
// .pipe(this.handleError(false, true));
|
|
350
|
+
}
|
|
351
|
+
fetchAllUserTemplates(siteId) {
|
|
352
|
+
const params = {
|
|
353
|
+
siteId: siteId,
|
|
354
|
+
};
|
|
355
|
+
return this.apiService.fetch(API.USER_TEMPLATES_UPLOAD_LIST, params)
|
|
356
|
+
.pipe(tap((result) => {
|
|
357
|
+
this.templatesListSubject$.next(result);
|
|
358
|
+
}));
|
|
359
|
+
}
|
|
360
|
+
getUserTemplateToken(id, customerId) {
|
|
361
|
+
return this.apiService.fetch(API.USER_TEMPLATE_TOKEN.replace(':customerId', customerId).replace(':id', id));
|
|
362
|
+
// .pipe(this.handleError(false, true));
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
UserCreationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
366
|
+
UserCreationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationApiService });
|
|
367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationApiService, decorators: [{
|
|
368
|
+
type: Injectable
|
|
369
|
+
}], ctorParameters: function () { return []; } });
|
|
370
|
+
|
|
371
|
+
class SharedModule {
|
|
372
|
+
}
|
|
373
|
+
SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
374
|
+
SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, imports: [CommonModule,
|
|
375
|
+
MaterialModule,
|
|
376
|
+
NgApexchartsModule,
|
|
377
|
+
HttpClientModule], exports: [MaterialModule] });
|
|
378
|
+
SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, imports: [CommonModule,
|
|
379
|
+
MaterialModule,
|
|
380
|
+
NgApexchartsModule,
|
|
381
|
+
HttpClientModule, MaterialModule] });
|
|
382
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, decorators: [{
|
|
383
|
+
type: NgModule,
|
|
384
|
+
args: [{
|
|
385
|
+
declarations: [],
|
|
386
|
+
imports: [
|
|
387
|
+
CommonModule,
|
|
388
|
+
MaterialModule,
|
|
389
|
+
NgApexchartsModule,
|
|
390
|
+
HttpClientModule,
|
|
391
|
+
],
|
|
392
|
+
exports: [
|
|
393
|
+
MaterialModule
|
|
394
|
+
]
|
|
395
|
+
}]
|
|
396
|
+
}] });
|
|
397
|
+
|
|
398
|
+
class UserCreationWizardService {
|
|
399
|
+
constructor() {
|
|
400
|
+
this.api = inject(UserCreationApiService);
|
|
401
|
+
this.ldapTableColumns = ['userId', 'firstName', 'lastName', 'email', 'add'];
|
|
402
|
+
this.userCreationTypes = ['CUCM', 'MT'];
|
|
403
|
+
this.siteOptions = [];
|
|
404
|
+
this.templateOptions = [];
|
|
405
|
+
this.lineOptions = [];
|
|
406
|
+
this.routePartitionOptions = [];
|
|
407
|
+
this.deviceRows = [];
|
|
408
|
+
this.ldapUsers = [];
|
|
409
|
+
this.overviewUsers = [];
|
|
410
|
+
this.overviewLines = [];
|
|
411
|
+
this.overviewDevices = [];
|
|
412
|
+
this.userDetailsForm = {
|
|
413
|
+
userId: '',
|
|
414
|
+
firstName: '',
|
|
415
|
+
lastName: '',
|
|
416
|
+
email: ''
|
|
417
|
+
};
|
|
418
|
+
this.lineSelections = [];
|
|
419
|
+
this.deviceEntries = [];
|
|
420
|
+
this.selectedSite = null;
|
|
421
|
+
this.selectedTemplate = null;
|
|
422
|
+
this.selectedUserCreationType = 'CUCM';
|
|
423
|
+
this.loadPlaceholderData();
|
|
424
|
+
}
|
|
425
|
+
setSelectedSite(site) {
|
|
426
|
+
this.selectedSite = site;
|
|
427
|
+
}
|
|
428
|
+
setSelectedTemplate(template) {
|
|
429
|
+
this.selectedTemplate = template;
|
|
430
|
+
this.rebuildOverviewUsers();
|
|
431
|
+
}
|
|
432
|
+
resetTemplateDrivenData() {
|
|
433
|
+
this.lineOptions = [];
|
|
434
|
+
this.routePartitionOptions = [];
|
|
435
|
+
this.lineSelections = [];
|
|
436
|
+
this.deviceEntries = [];
|
|
437
|
+
this.deviceRows = [];
|
|
438
|
+
this.rebuildOverviewLines();
|
|
439
|
+
this.rebuildOverviewDevices();
|
|
440
|
+
}
|
|
441
|
+
applyTemplateTokenPayload(payload) {
|
|
442
|
+
const template = this.extractTemplateFromTokenPayload(payload);
|
|
443
|
+
const endUser = (template === null || template === void 0 ? void 0 : template.endUser) || {};
|
|
444
|
+
const linesFromTemplate = Array.isArray(endUser.lines) ? endUser.lines : [];
|
|
445
|
+
const devicesFromTemplate = Array.isArray(endUser.devices) ? endUser.devices : [];
|
|
446
|
+
this.userDetailsForm = {
|
|
447
|
+
userId: this.valueToString(endUser.userid),
|
|
448
|
+
firstName: this.valueToString(endUser.firstName),
|
|
449
|
+
lastName: this.valueToString(endUser.lastName),
|
|
450
|
+
email: this.valueToString(endUser.email)
|
|
451
|
+
};
|
|
452
|
+
const mappedLineOptions = linesFromTemplate
|
|
453
|
+
.map(line => {
|
|
454
|
+
var _a, _b, _c, _d, _e;
|
|
455
|
+
return ({
|
|
456
|
+
number: this.valueToString((_a = line === null || line === void 0 ? void 0 : line.directoryNumber) === null || _a === void 0 ? void 0 : _a.directoryNumber),
|
|
457
|
+
did: this.valueToString(((_c = (_b = line === null || line === void 0 ? void 0 : line.didPatterns) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.pattern) || ((_d = line === null || line === void 0 ? void 0 : line.directoryNumber) === null || _d === void 0 ? void 0 : _d.directoryNumber)),
|
|
458
|
+
css: this.valueToString(typeof (line === null || line === void 0 ? void 0 : line.callingSearchSpace) === 'string'
|
|
459
|
+
? line.callingSearchSpace
|
|
460
|
+
: (_e = line === null || line === void 0 ? void 0 : line.callingSearchSpace) === null || _e === void 0 ? void 0 : _e.name),
|
|
461
|
+
description: this.valueToString(line === null || line === void 0 ? void 0 : line.description)
|
|
462
|
+
});
|
|
463
|
+
})
|
|
464
|
+
.filter(line => line.number.trim().length > 0);
|
|
465
|
+
if (mappedLineOptions.length) {
|
|
466
|
+
this.lineOptions = this.uniqueByNumber(mappedLineOptions);
|
|
467
|
+
this.lineSelections = this.lineOptions.map(line => {
|
|
468
|
+
var _a, _b;
|
|
469
|
+
return ({
|
|
470
|
+
lineNumber: line.number,
|
|
471
|
+
routePartitionName: ((_b = (_a = linesFromTemplate.find(source => { var _a; return (((_a = source === null || source === void 0 ? void 0 : source.directoryNumber) === null || _a === void 0 ? void 0 : _a.directoryNumber) || '') === line.number; })) === null || _a === void 0 ? void 0 : _a.directoryNumber) === null || _b === void 0 ? void 0 : _b.routePartitionName) || null
|
|
472
|
+
});
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
const lineAssociations = devicesFromTemplate.flatMap(device => device.lineAssociations || []);
|
|
477
|
+
const associatedLineOptions = lineAssociations
|
|
478
|
+
.map(association => {
|
|
479
|
+
var _a;
|
|
480
|
+
const number = ((_a = association === null || association === void 0 ? void 0 : association.directoryNumber) === null || _a === void 0 ? void 0 : _a.directoryNumber) || '';
|
|
481
|
+
return {
|
|
482
|
+
number,
|
|
483
|
+
did: number,
|
|
484
|
+
css: '',
|
|
485
|
+
description: ''
|
|
486
|
+
};
|
|
487
|
+
})
|
|
488
|
+
.filter(line => line.number.trim().length > 0);
|
|
489
|
+
this.lineOptions = this.uniqueByNumber(associatedLineOptions);
|
|
490
|
+
this.lineSelections = this.lineOptions.map(line => {
|
|
491
|
+
var _a, _b;
|
|
492
|
+
return ({
|
|
493
|
+
lineNumber: line.number,
|
|
494
|
+
routePartitionName: ((_b = (_a = lineAssociations.find(source => { var _a; return (((_a = source === null || source === void 0 ? void 0 : source.directoryNumber) === null || _a === void 0 ? void 0 : _a.directoryNumber) || '') === line.number; })) === null || _a === void 0 ? void 0 : _a.directoryNumber) === null || _b === void 0 ? void 0 : _b.routePartitionName) || null
|
|
495
|
+
});
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
const routePartitions = this.lineSelections
|
|
499
|
+
.map(line => line.routePartitionName)
|
|
500
|
+
.filter((value) => !!value && value.trim().length > 0);
|
|
501
|
+
this.routePartitionOptions = this.uniqueStrings(routePartitions);
|
|
502
|
+
this.deviceEntries = devicesFromTemplate.map(device => ({
|
|
503
|
+
deviceType: this.valueToString(device.deviceType),
|
|
504
|
+
protocol: this.valueToString(device.protocol),
|
|
505
|
+
buttonTemplate: this.valueToString(device.buttonTemplate),
|
|
506
|
+
name: this.valueToString(device.name)
|
|
507
|
+
}));
|
|
508
|
+
this.deviceRows = this.deviceEntries.map((_, index) => index + 1);
|
|
509
|
+
this.rebuildOverviewUsers();
|
|
510
|
+
this.rebuildOverviewLines();
|
|
511
|
+
this.rebuildOverviewDevices();
|
|
512
|
+
}
|
|
513
|
+
setSelectedUserCreationType(type) {
|
|
514
|
+
this.selectedUserCreationType = type;
|
|
515
|
+
}
|
|
516
|
+
setUserDetailsField(field, value) {
|
|
517
|
+
this.userDetailsForm = Object.assign(Object.assign({}, this.userDetailsForm), { [field]: value });
|
|
518
|
+
this.rebuildOverviewUsers();
|
|
519
|
+
}
|
|
520
|
+
setLineSelection(index, lineNumber) {
|
|
521
|
+
if (!this.lineSelections[index]) {
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
this.lineSelections[index] = Object.assign(Object.assign({}, this.lineSelections[index]), { lineNumber });
|
|
525
|
+
this.rebuildOverviewLines();
|
|
526
|
+
this.rebuildOverviewDevices();
|
|
527
|
+
}
|
|
528
|
+
setRoutePartitionSelection(index, routePartitionName) {
|
|
529
|
+
if (!this.lineSelections[index]) {
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
this.lineSelections[index] = Object.assign(Object.assign({}, this.lineSelections[index]), { routePartitionName });
|
|
533
|
+
this.rebuildOverviewLines();
|
|
534
|
+
}
|
|
535
|
+
setDeviceName(index, name) {
|
|
536
|
+
if (!this.deviceEntries[index]) {
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
this.deviceEntries[index] = Object.assign(Object.assign({}, this.deviceEntries[index]), { name });
|
|
540
|
+
this.rebuildOverviewDevices();
|
|
541
|
+
}
|
|
542
|
+
// Placeholder bootstrap until backend APIs are connected.
|
|
543
|
+
loadPlaceholderData() {
|
|
544
|
+
var _a, _b;
|
|
545
|
+
this.siteOptions = ['Site 1', 'Site 2', 'Site 3'];
|
|
546
|
+
this.templateOptions = ['User 8851 Office'];
|
|
547
|
+
this.lineOptions = [
|
|
548
|
+
{
|
|
549
|
+
number: '557046',
|
|
550
|
+
did: '+13125557046',
|
|
551
|
+
css: 'Atlanta_internal_css',
|
|
552
|
+
description: ''
|
|
553
|
+
}
|
|
554
|
+
];
|
|
555
|
+
this.routePartitionOptions = ['Atlanta_internal_PT', 'Beijing_national_PT'];
|
|
556
|
+
this.deviceRows = [1, 2];
|
|
557
|
+
this.ldapUsers = [
|
|
558
|
+
{ userId: 'John.Doe', firstName: 'John', lastName: 'Doe', email: 'john.doe@car.west.io' },
|
|
559
|
+
{ userId: 'Jane.Smith', firstName: 'Jane', lastName: 'Smith', email: 'jane.smith@car.west.io' }
|
|
560
|
+
];
|
|
561
|
+
this.lineSelections = [
|
|
562
|
+
{
|
|
563
|
+
lineNumber: ((_a = this.lineOptions[0]) === null || _a === void 0 ? void 0 : _a.number) || null,
|
|
564
|
+
routePartitionName: this.routePartitionOptions[0] || null
|
|
565
|
+
}
|
|
566
|
+
];
|
|
567
|
+
this.deviceEntries = [
|
|
568
|
+
{
|
|
569
|
+
deviceType: 'Cisco 8851',
|
|
570
|
+
protocol: 'SIP',
|
|
571
|
+
buttonTemplate: 'Standard 8851 SIP',
|
|
572
|
+
name: ''
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
deviceType: 'Cisco Unified Client Services Framework',
|
|
576
|
+
protocol: 'SIP',
|
|
577
|
+
buttonTemplate: 'Standard Client Services Framework',
|
|
578
|
+
name: ''
|
|
579
|
+
}
|
|
580
|
+
];
|
|
581
|
+
this.selectedTemplate = (_b = this.selectedTemplate) !== null && _b !== void 0 ? _b : null;
|
|
582
|
+
this.rebuildOverviewUsers();
|
|
583
|
+
this.rebuildOverviewLines();
|
|
584
|
+
this.rebuildOverviewDevices();
|
|
585
|
+
}
|
|
586
|
+
rebuildOverviewUsers() {
|
|
587
|
+
const userTemplate = this.selectedTemplate || '';
|
|
588
|
+
const hasUserData = Object.values(this.userDetailsForm).some(value => value.trim().length > 0);
|
|
589
|
+
this.overviewUsers = hasUserData
|
|
590
|
+
? [{
|
|
591
|
+
userId: this.userDetailsForm.userId,
|
|
592
|
+
firstName: this.userDetailsForm.firstName,
|
|
593
|
+
lastName: this.userDetailsForm.lastName,
|
|
594
|
+
email: this.userDetailsForm.email,
|
|
595
|
+
userTemplate
|
|
596
|
+
}]
|
|
597
|
+
: [];
|
|
598
|
+
}
|
|
599
|
+
rebuildOverviewLines() {
|
|
600
|
+
this.overviewLines = this.lineSelections
|
|
601
|
+
.map(selection => {
|
|
602
|
+
if (!(selection === null || selection === void 0 ? void 0 : selection.lineNumber)) {
|
|
603
|
+
return null;
|
|
604
|
+
}
|
|
605
|
+
const selectedLine = this.lineOptions.find(line => line.number === selection.lineNumber);
|
|
606
|
+
if (!selectedLine) {
|
|
607
|
+
return null;
|
|
608
|
+
}
|
|
609
|
+
return {
|
|
610
|
+
number: selectedLine.number,
|
|
611
|
+
did: selectedLine.did,
|
|
612
|
+
routePartitionName: selection.routePartitionName || this.routePartitionOptions[0] || '',
|
|
613
|
+
css: selectedLine.css,
|
|
614
|
+
description: selectedLine.description
|
|
615
|
+
};
|
|
616
|
+
})
|
|
617
|
+
.filter((line) => !!line);
|
|
618
|
+
}
|
|
619
|
+
rebuildOverviewDevices() {
|
|
620
|
+
const selectedLineNumbers = this.overviewLines.map(line => line.number).join(', ');
|
|
621
|
+
this.overviewDevices = this.deviceEntries
|
|
622
|
+
.filter(device => device.name.trim().length > 0 || device.deviceType.trim().length > 0)
|
|
623
|
+
.map(device => ({
|
|
624
|
+
name: device.name,
|
|
625
|
+
deviceType: device.deviceType,
|
|
626
|
+
lines: selectedLineNumbers,
|
|
627
|
+
description: `${device.protocol} / ${device.buttonTemplate}`
|
|
628
|
+
}));
|
|
629
|
+
}
|
|
630
|
+
extractTemplateFromTokenPayload(payload) {
|
|
631
|
+
if (!payload || typeof payload !== 'object') {
|
|
632
|
+
return null;
|
|
633
|
+
}
|
|
634
|
+
if (Array.isArray(payload)) {
|
|
635
|
+
return payload[0] || null;
|
|
636
|
+
}
|
|
637
|
+
const firstKey = Object.keys(payload)[0];
|
|
638
|
+
return firstKey ? payload[firstKey] : null;
|
|
639
|
+
}
|
|
640
|
+
uniqueByNumber(lines) {
|
|
641
|
+
const seen = new Set();
|
|
642
|
+
return lines.filter(line => {
|
|
643
|
+
if (seen.has(line.number)) {
|
|
644
|
+
return false;
|
|
645
|
+
}
|
|
646
|
+
seen.add(line.number);
|
|
647
|
+
return true;
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
uniqueStrings(items) {
|
|
651
|
+
return Array.from(new Set(items));
|
|
652
|
+
}
|
|
653
|
+
valueToString(value) {
|
|
654
|
+
return typeof value === 'string' ? value : '';
|
|
655
|
+
}
|
|
656
|
+
// TODO: replace placeholders with real API integration.
|
|
657
|
+
loadDataFromApi() {
|
|
658
|
+
// this.api.getWizardBootstrapData().subscribe(...)
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
UserCreationWizardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
662
|
+
UserCreationWizardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardService });
|
|
663
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardService, decorators: [{
|
|
664
|
+
type: Injectable
|
|
665
|
+
}], ctorParameters: function () { return []; } });
|
|
666
|
+
|
|
667
|
+
class UserDetailsStepComponent {
|
|
668
|
+
constructor(userCreationWizardService) {
|
|
669
|
+
this.userCreationWizardService = userCreationWizardService;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
UserDetailsStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserDetailsStepComponent, deps: [{ token: UserCreationWizardService }], target: i0.ɵɵFactoryTarget.Component });
|
|
673
|
+
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)=\"userCreationWizardService.setUserDetailsField('userId', $any($event.target).value)\"\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)=\"userCreationWizardService.setUserDetailsField('firstName', $any($event.target).value)\"\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)=\"userCreationWizardService.setUserDetailsField('lastName', $any($event.target).value)\"\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)=\"userCreationWizardService.setUserDetailsField('email', $any($event.target).value)\"\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>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 <table mat-table [dataSource]=\"userCreationWizardService.ldapUsers\" class=\"details-ldap-table\">\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>\r\n <button mat-button class=\"details-ldap-table__add-btn\" type=\"button\">Add user</button>\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 </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 class=\"line-route-row\" *ngFor=\"let lineSelection of userCreationWizardService.lineSelections; let idx = index\">\r\n <div class=\"line-route-field\">\r\n <mat-form-field class=\"details-step-select line-route-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Select line\"\r\n [value]=\"lineSelection.lineNumber\"\r\n (selectionChange)=\"userCreationWizardService.setLineSelection(idx, $event.value)\"\r\n >\r\n <mat-option *ngFor=\"let line of userCreationWizardService.lineOptions\" [value]=\"line.number\">\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 class=\"details-step-select line-route-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Select route partition\"\r\n [value]=\"lineSelection.routePartitionName\"\r\n (selectionChange)=\"userCreationWizardService.setRoutePartitionSelection(idx, $event.value)\"\r\n >\r\n <mat-option *ngFor=\"let partition of userCreationWizardService.routePartitionOptions\" [value]=\"partition\">\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 class=\"details-inline-fields details-inline-fields--four\" *ngFor=\"let _row of userCreationWizardService.deviceRows; let idx = index\">\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]=\"userCreationWizardService.deviceEntries[idx].deviceType || ''\"\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]=\"userCreationWizardService.deviceEntries[idx].protocol || ''\"\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]=\"userCreationWizardService.deviceEntries[idx].buttonTemplate || ''\"\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]=\"userCreationWizardService.deviceEntries[idx].name || ''\"\r\n (input)=\"userCreationWizardService.setDeviceName(idx, $any($event.target).value)\"\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__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-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" }] });
|
|
674
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserDetailsStepComponent, decorators: [{
|
|
675
|
+
type: Component,
|
|
676
|
+
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)=\"userCreationWizardService.setUserDetailsField('userId', $any($event.target).value)\"\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)=\"userCreationWizardService.setUserDetailsField('firstName', $any($event.target).value)\"\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)=\"userCreationWizardService.setUserDetailsField('lastName', $any($event.target).value)\"\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)=\"userCreationWizardService.setUserDetailsField('email', $any($event.target).value)\"\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>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 <table mat-table [dataSource]=\"userCreationWizardService.ldapUsers\" class=\"details-ldap-table\">\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>\r\n <button mat-button class=\"details-ldap-table__add-btn\" type=\"button\">Add user</button>\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 </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 class=\"line-route-row\" *ngFor=\"let lineSelection of userCreationWizardService.lineSelections; let idx = index\">\r\n <div class=\"line-route-field\">\r\n <mat-form-field class=\"details-step-select line-route-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Select line\"\r\n [value]=\"lineSelection.lineNumber\"\r\n (selectionChange)=\"userCreationWizardService.setLineSelection(idx, $event.value)\"\r\n >\r\n <mat-option *ngFor=\"let line of userCreationWizardService.lineOptions\" [value]=\"line.number\">\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 class=\"details-step-select line-route-select\" appearance=\"outline\">\r\n <mat-select\r\n placeholder=\"Select route partition\"\r\n [value]=\"lineSelection.routePartitionName\"\r\n (selectionChange)=\"userCreationWizardService.setRoutePartitionSelection(idx, $event.value)\"\r\n >\r\n <mat-option *ngFor=\"let partition of userCreationWizardService.routePartitionOptions\" [value]=\"partition\">\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 class=\"details-inline-fields details-inline-fields--four\" *ngFor=\"let _row of userCreationWizardService.deviceRows; let idx = index\">\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]=\"userCreationWizardService.deviceEntries[idx].deviceType || ''\"\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]=\"userCreationWizardService.deviceEntries[idx].protocol || ''\"\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]=\"userCreationWizardService.deviceEntries[idx].buttonTemplate || ''\"\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]=\"userCreationWizardService.deviceEntries[idx].name || ''\"\r\n (input)=\"userCreationWizardService.setDeviceName(idx, $any($event.target).value)\"\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__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-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"] }]
|
|
677
|
+
}], ctorParameters: function () { return [{ type: UserCreationWizardService }]; } });
|
|
678
|
+
|
|
679
|
+
class UserOverviewStepComponent {
|
|
680
|
+
constructor(userCreationWizardService) {
|
|
681
|
+
this.userCreationWizardService = userCreationWizardService;
|
|
682
|
+
this.USER_DETAILS_COLS = ['User ID', 'First name', 'Last name', 'Email', 'User templates'];
|
|
683
|
+
this.LINES_COLS = ['Number', 'DID', 'Route partition name', 'CSS', 'Description'];
|
|
684
|
+
this.DEVICES_COLS = ['Name', 'Device type', 'Lines', 'Description'];
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
UserOverviewStepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserOverviewStepComponent, deps: [{ token: UserCreationWizardService }], target: i0.ɵɵFactoryTarget.Component });
|
|
688
|
+
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\"></div>\r\n </section>\r\n </div>\r\n\r\n</section>\r\n", 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"] }] });
|
|
689
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserOverviewStepComponent, decorators: [{
|
|
690
|
+
type: Component,
|
|
691
|
+
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\"></div>\r\n </section>\r\n </div>\r\n\r\n</section>\r\n", 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"] }]
|
|
692
|
+
}], ctorParameters: function () { return [{ type: UserCreationWizardService }]; } });
|
|
693
|
+
|
|
694
|
+
class UserTemplateStepComponent {
|
|
695
|
+
constructor(userCreationWizardService, userCreationService, fb) {
|
|
696
|
+
this.userCreationWizardService = userCreationWizardService;
|
|
697
|
+
this.userCreationService = userCreationService;
|
|
698
|
+
this.fb = fb;
|
|
699
|
+
this.formGroup = this.fb.group({
|
|
700
|
+
userType: [USER_CREATION_TYPES.CUCM],
|
|
701
|
+
siteId: [null],
|
|
702
|
+
userTemplateId: [''],
|
|
703
|
+
});
|
|
704
|
+
this.userCreationType = USER_CREATION_TYPES.CUCM;
|
|
705
|
+
this.USER_CREATION_TYPES = USER_CREATION_TYPES;
|
|
706
|
+
this.defaultTemplateName = 'User 8851 Office';
|
|
707
|
+
this.fallbackTemplateId = '-1';
|
|
708
|
+
this.destroy$ = new Subject();
|
|
709
|
+
this.sitesList$ = this.userCreationService.sitesList$.pipe(takeUntil(this.destroy$));
|
|
710
|
+
this.templatesList$ = this.userCreationService.templatesList$.pipe(tap((templates) => {
|
|
711
|
+
var _a;
|
|
712
|
+
this.templates = templates || [];
|
|
713
|
+
const templateControl = this.formGroup.get('userTemplateId');
|
|
714
|
+
const currentTemplateId = templateControl === null || templateControl === void 0 ? void 0 : templateControl.value;
|
|
715
|
+
const selectedSiteId = (_a = this.formGroup.get('siteId')) === null || _a === void 0 ? void 0 : _a.value;
|
|
716
|
+
const defaultTemplate = this.templates.find(template => template.name === this.defaultTemplateName);
|
|
717
|
+
const hasSelectedSite = selectedSiteId !== null && selectedSiteId !== undefined;
|
|
718
|
+
if (hasSelectedSite && defaultTemplate && String(currentTemplateId || '') !== String(defaultTemplate.id)) {
|
|
719
|
+
templateControl === null || templateControl === void 0 ? void 0 : templateControl.setValue(String(defaultTemplate.id));
|
|
720
|
+
}
|
|
721
|
+
}), takeUntil(this.destroy$));
|
|
722
|
+
this.isTemplateSelectable = false;
|
|
723
|
+
this.templates = [];
|
|
724
|
+
this.templateToggleFormControl = new FormControl(true);
|
|
725
|
+
}
|
|
726
|
+
ngOnInit() {
|
|
727
|
+
var _a;
|
|
728
|
+
this.formGroup.get('userType').valueChanges
|
|
729
|
+
.pipe(takeUntil(this.destroy$))
|
|
730
|
+
.subscribe((value) => {
|
|
731
|
+
const isOnlyWithLocations = value === USER_CREATION_TYPES.MT ? true : false;
|
|
732
|
+
this.getSites(isOnlyWithLocations).subscribe();
|
|
733
|
+
this.reseFieldstForm();
|
|
734
|
+
});
|
|
735
|
+
this.formGroup.get('siteId').valueChanges
|
|
736
|
+
.pipe(filter((value) => value !== null && value !== undefined), tap(() => {
|
|
737
|
+
var _a;
|
|
738
|
+
(_a = this.formGroup.get('userTemplateId')) === null || _a === void 0 ? void 0 : _a.setValue(this.fallbackTemplateId);
|
|
739
|
+
this.userCreationWizardService.setSelectedTemplate(this.defaultTemplateName);
|
|
740
|
+
}), startWith((_a = this.formGroup.get('siteId')) === null || _a === void 0 ? void 0 : _a.value), takeUntil(this.destroy$), switchMap((value) => this.userCreationService.fetchAllUserTemplates(Number(value))))
|
|
741
|
+
.subscribe();
|
|
742
|
+
this.formGroup.get('userTemplateId').valueChanges
|
|
743
|
+
.pipe(filter((value) => value !== null && value !== undefined && String(value).trim().length > 0), takeUntil(this.destroy$), switchMap((value) => {
|
|
744
|
+
if (String(value) === this.fallbackTemplateId) {
|
|
745
|
+
this.userCreationWizardService.setSelectedTemplate(this.defaultTemplateName);
|
|
746
|
+
return of(null);
|
|
747
|
+
}
|
|
748
|
+
return this.userCreationService.getUserTemplateToken(String(value), String(String(this.customerId)))
|
|
749
|
+
.pipe(tap((payload) => {
|
|
750
|
+
const selectedTemplate = this.templates.find(template => String(template.id) === String(value));
|
|
751
|
+
this.userCreationWizardService.setSelectedTemplate((selectedTemplate === null || selectedTemplate === void 0 ? void 0 : selectedTemplate.name) || null);
|
|
752
|
+
this.userCreationWizardService.applyTemplateTokenPayload(payload);
|
|
753
|
+
}));
|
|
754
|
+
}))
|
|
755
|
+
.subscribe();
|
|
756
|
+
// this.templateToggleFormControl.valueChanges
|
|
757
|
+
// .pipe(startWith(true), takeUntil(this.destroy$), distinctUntilChanged())
|
|
758
|
+
// .subscribe((value) => {
|
|
759
|
+
// if(value === true) {
|
|
760
|
+
// const siteId = this.formGroup.get('siteId')?.value || 7095;
|
|
761
|
+
// this.userCreationService.fetchAllUserTemplates(siteId)
|
|
762
|
+
// .subscribe();
|
|
763
|
+
// } else {
|
|
764
|
+
// this.formGroup.get('userTemplateId')?.reset();
|
|
765
|
+
// }
|
|
766
|
+
// });
|
|
767
|
+
this.getData();
|
|
768
|
+
}
|
|
769
|
+
reseFieldstForm() {
|
|
770
|
+
var _a, _b;
|
|
771
|
+
(_a = this.formGroup.get('siteId')) === null || _a === void 0 ? void 0 : _a.reset();
|
|
772
|
+
(_b = this.formGroup.get('userTemplateId')) === null || _b === void 0 ? void 0 : _b.reset();
|
|
773
|
+
this.userCreationWizardService.setSelectedTemplate(null);
|
|
774
|
+
this.userCreationWizardService.resetTemplateDrivenData();
|
|
775
|
+
}
|
|
776
|
+
getData() {
|
|
777
|
+
var _a;
|
|
778
|
+
const isOnlyWithLocations = ((_a = this.formGroup.get('userType')) === null || _a === void 0 ? void 0 : _a.value) === USER_CREATION_TYPES.MT ? true : false;
|
|
779
|
+
this.userCreationService.checkControlHubIntegration(String(this.customerId))
|
|
780
|
+
.pipe(switchMap(() => this.getSites(isOnlyWithLocations)))
|
|
781
|
+
.subscribe();
|
|
782
|
+
}
|
|
783
|
+
getSites(isOnlyWithLocations) {
|
|
784
|
+
return this.userCreationService.getAllCustomerSites(String(this.customerId), isOnlyWithLocations);
|
|
785
|
+
}
|
|
786
|
+
ngOnDestroy() {
|
|
787
|
+
this.destroy$.next();
|
|
788
|
+
this.destroy$.complete();
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
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 });
|
|
792
|
+
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 <mat-option *ngFor=\"let site of sitesList$ | async\" [value]=\"site.id\">\r\n {{ site.name }}\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-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%}\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: "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: "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: "directive", type: i8$1.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i8$1.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
|
|
793
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserTemplateStepComponent, decorators: [{
|
|
794
|
+
type: Component,
|
|
795
|
+
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 <mat-option *ngFor=\"let site of sitesList$ | async\" [value]=\"site.id\">\r\n {{ site.name }}\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-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%}\n"] }]
|
|
796
|
+
}], ctorParameters: function () { return [{ type: UserCreationWizardService }, { type: UserCreationApiService }, { type: i3$1.FormBuilder }]; }, propDecorators: { customerId: [{
|
|
797
|
+
type: Input
|
|
798
|
+
}] } });
|
|
799
|
+
|
|
800
|
+
class UserCreationWizardComponent {
|
|
801
|
+
constructor() {
|
|
802
|
+
this.apiService = inject(APIService);
|
|
803
|
+
this.title = 'Create User';
|
|
804
|
+
this.cancel = new EventEmitter();
|
|
805
|
+
this.submit = new EventEmitter();
|
|
806
|
+
this.isSubmitting = false;
|
|
807
|
+
this.submitTimerId = null;
|
|
808
|
+
}
|
|
809
|
+
ngOnInit() {
|
|
810
|
+
this.apiService.token = this.token;
|
|
811
|
+
}
|
|
812
|
+
onCancel() {
|
|
813
|
+
this.cancel.emit();
|
|
814
|
+
}
|
|
815
|
+
onSubmit() {
|
|
816
|
+
if (this.isSubmitting) {
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
this.isSubmitting = true;
|
|
820
|
+
const delayMs = 3000 + Math.floor(Math.random() * 1001);
|
|
821
|
+
this.submitTimerId = window.setTimeout(() => {
|
|
822
|
+
this.isSubmitting = false;
|
|
823
|
+
this.submitTimerId = null;
|
|
824
|
+
this.submit.emit();
|
|
825
|
+
}, delayMs);
|
|
826
|
+
}
|
|
827
|
+
ngOnDestroy() {
|
|
828
|
+
if (this.submitTimerId) {
|
|
829
|
+
window.clearTimeout(this.submitTimerId);
|
|
830
|
+
this.submitTimerId = null;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
UserCreationWizardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
835
|
+
UserCreationWizardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserCreationWizardComponent, selector: "tk-user-creation-wizard", inputs: { title: "title", token: "token", customerId: "customerId" }, outputs: { cancel: "cancel", submit: "submit" }, ngImport: i0, template: "<div class=\"move-user-stepper-container\" [attr.aria-busy]=\"isSubmitting\">\r\n <header class=\"move-user-header\">\r\n <div class=\"move-user-header__title\">{{ title }}</div>\r\n <div class=\"move-user-header__close\">\r\n <span class=\"app-icon user-creation-close-icon\" (click)=\"onCancel()\"></span>\r\n </div>\r\n </header>\r\n\r\n <div id=\"user-creation-stepper\">\r\n <mat-stepper [linear]=\"false\" labelPosition=\"bottom\" #stepper>\r\n <mat-step>\r\n <div class=\"step-title\">Step 1: User creation with template</div>\r\n <ng-template matStepLabel>User creation</ng-template>\r\n\r\n <div class=\"move-user-tab-content-box\">\r\n <tk-user-template-step [customerId]=\"customerId\"></tk-user-template-step>\r\n </div>\r\n </mat-step>\r\n\r\n <mat-step>\r\n <div class=\"step-title\">Step 2 : User details</div>\r\n <ng-template matStepLabel>User details</ng-template>\r\n\r\n <div class=\"move-user-tab-content-box\">\r\n <tk-user-details-step></tk-user-details-step>\r\n </div>\r\n </mat-step>\r\n\r\n <mat-step>\r\n <div class=\"step-title\">Step 3: Review</div>\r\n <ng-template matStepLabel>Review</ng-template>\r\n\r\n <div class=\"move-user-tab-content-box\">\r\n <tk-user-overview-step></tk-user-overview-step>\r\n </div>\r\n </mat-step>\r\n </mat-stepper>\r\n\r\n <div class=\"wizard-actions\">\r\n <ng-container [ngSwitch]=\"stepper.selectedIndex\">\r\n <ng-container *ngSwitchCase=\"0\">\r\n <button mat-button class=\"uc-btn uc-btn-primary\" type=\"button\" (click)=\"stepper.next()\">\r\n Next\r\n </button>\r\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"onCancel()\">\r\n Cancel\r\n </button>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"1\">\r\n <button mat-button class=\"uc-btn uc-btn-primary\" type=\"button\" (click)=\"stepper.next()\">\r\n Next\r\n </button>\r\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"stepper.previous()\">\r\n Previous\r\n </button>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"2\">\r\n <button\r\n mat-button\r\n class=\"uc-btn uc-btn-primary\"\r\n type=\"button\"\r\n [disabled]=\"isSubmitting\"\r\n (click)=\"onSubmit()\"\r\n >\r\n <span class=\"uc-btn__inline-content\">\r\n <span class=\"uc-btn__spinner\" *ngIf=\"isSubmitting\" aria-hidden=\"true\"></span>\r\n <span>{{ isSubmitting ? 'Creating...' : 'Create' }}</span>\r\n </span>\r\n </button>\r\n <button\r\n mat-button\r\n class=\"uc-btn uc-btn-secondary\"\r\n type=\"button\"\r\n [disabled]=\"isSubmitting\"\r\n (click)=\"stepper.previous()\"\r\n >\r\n Previous\r\n </button>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </div>\r\n\r\n <div class=\"wizard-loading-overlay\" [class.wizard-loading-overlay--visible]=\"isSubmitting\" aria-hidden=\"true\"></div>\r\n</div>\r\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%0D%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%0D%3C%2Fsvg%3E%0D\");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 });
|
|
836
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationWizardComponent, decorators: [{
|
|
837
|
+
type: Component,
|
|
838
|
+
args: [{ selector: 'tk-user-creation-wizard', encapsulation: ViewEncapsulation.None, template: "<div class=\"move-user-stepper-container\" [attr.aria-busy]=\"isSubmitting\">\r\n <header class=\"move-user-header\">\r\n <div class=\"move-user-header__title\">{{ title }}</div>\r\n <div class=\"move-user-header__close\">\r\n <span class=\"app-icon user-creation-close-icon\" (click)=\"onCancel()\"></span>\r\n </div>\r\n </header>\r\n\r\n <div id=\"user-creation-stepper\">\r\n <mat-stepper [linear]=\"false\" labelPosition=\"bottom\" #stepper>\r\n <mat-step>\r\n <div class=\"step-title\">Step 1: User creation with template</div>\r\n <ng-template matStepLabel>User creation</ng-template>\r\n\r\n <div class=\"move-user-tab-content-box\">\r\n <tk-user-template-step [customerId]=\"customerId\"></tk-user-template-step>\r\n </div>\r\n </mat-step>\r\n\r\n <mat-step>\r\n <div class=\"step-title\">Step 2 : User details</div>\r\n <ng-template matStepLabel>User details</ng-template>\r\n\r\n <div class=\"move-user-tab-content-box\">\r\n <tk-user-details-step></tk-user-details-step>\r\n </div>\r\n </mat-step>\r\n\r\n <mat-step>\r\n <div class=\"step-title\">Step 3: Review</div>\r\n <ng-template matStepLabel>Review</ng-template>\r\n\r\n <div class=\"move-user-tab-content-box\">\r\n <tk-user-overview-step></tk-user-overview-step>\r\n </div>\r\n </mat-step>\r\n </mat-stepper>\r\n\r\n <div class=\"wizard-actions\">\r\n <ng-container [ngSwitch]=\"stepper.selectedIndex\">\r\n <ng-container *ngSwitchCase=\"0\">\r\n <button mat-button class=\"uc-btn uc-btn-primary\" type=\"button\" (click)=\"stepper.next()\">\r\n Next\r\n </button>\r\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"onCancel()\">\r\n Cancel\r\n </button>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"1\">\r\n <button mat-button class=\"uc-btn uc-btn-primary\" type=\"button\" (click)=\"stepper.next()\">\r\n Next\r\n </button>\r\n <button mat-button class=\"uc-btn uc-btn-secondary\" type=\"button\" (click)=\"stepper.previous()\">\r\n Previous\r\n </button>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"2\">\r\n <button\r\n mat-button\r\n class=\"uc-btn uc-btn-primary\"\r\n type=\"button\"\r\n [disabled]=\"isSubmitting\"\r\n (click)=\"onSubmit()\"\r\n >\r\n <span class=\"uc-btn__inline-content\">\r\n <span class=\"uc-btn__spinner\" *ngIf=\"isSubmitting\" aria-hidden=\"true\"></span>\r\n <span>{{ isSubmitting ? 'Creating...' : 'Create' }}</span>\r\n </span>\r\n </button>\r\n <button\r\n mat-button\r\n class=\"uc-btn uc-btn-secondary\"\r\n type=\"button\"\r\n [disabled]=\"isSubmitting\"\r\n (click)=\"stepper.previous()\"\r\n >\r\n Previous\r\n </button>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </div>\r\n\r\n <div class=\"wizard-loading-overlay\" [class.wizard-loading-overlay--visible]=\"isSubmitting\" aria-hidden=\"true\"></div>\r\n</div>\r\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%0D%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%0D%3C%2Fsvg%3E%0D\");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"] }]
|
|
839
|
+
}], propDecorators: { title: [{
|
|
840
|
+
type: Input
|
|
841
|
+
}], token: [{
|
|
842
|
+
type: Input
|
|
843
|
+
}], customerId: [{
|
|
844
|
+
type: Input
|
|
845
|
+
}], cancel: [{
|
|
846
|
+
type: Output
|
|
847
|
+
}], submit: [{
|
|
848
|
+
type: Output
|
|
849
|
+
}] } });
|
|
850
|
+
|
|
851
|
+
class UserCreationModule {
|
|
852
|
+
}
|
|
853
|
+
UserCreationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
854
|
+
UserCreationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UserCreationModule, declarations: [UserCreationWizardComponent,
|
|
855
|
+
UserTemplateStepComponent,
|
|
856
|
+
UserDetailsStepComponent,
|
|
857
|
+
UserOverviewStepComponent], imports: [CommonModule,
|
|
858
|
+
SharedModule,
|
|
859
|
+
MaterialModule,
|
|
860
|
+
MatStepperModule,
|
|
861
|
+
MatExpansionModule,
|
|
862
|
+
FormsModule,
|
|
863
|
+
ReactiveFormsModule,
|
|
864
|
+
MatRadioModule], exports: [UserCreationWizardComponent] });
|
|
865
|
+
UserCreationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationModule, providers: [
|
|
866
|
+
UserCreationApiService,
|
|
867
|
+
UserCreationWizardService,
|
|
868
|
+
], imports: [CommonModule,
|
|
869
|
+
SharedModule,
|
|
870
|
+
MaterialModule,
|
|
871
|
+
MatStepperModule,
|
|
872
|
+
MatExpansionModule,
|
|
873
|
+
FormsModule,
|
|
874
|
+
ReactiveFormsModule,
|
|
875
|
+
MatRadioModule] });
|
|
876
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserCreationModule, decorators: [{
|
|
877
|
+
type: NgModule,
|
|
878
|
+
args: [{
|
|
879
|
+
declarations: [
|
|
880
|
+
UserCreationWizardComponent,
|
|
881
|
+
UserTemplateStepComponent,
|
|
882
|
+
UserDetailsStepComponent,
|
|
883
|
+
UserOverviewStepComponent
|
|
884
|
+
],
|
|
885
|
+
imports: [
|
|
886
|
+
CommonModule,
|
|
887
|
+
SharedModule,
|
|
888
|
+
MaterialModule,
|
|
889
|
+
MatStepperModule,
|
|
890
|
+
MatExpansionModule,
|
|
891
|
+
FormsModule,
|
|
892
|
+
ReactiveFormsModule,
|
|
893
|
+
MatRadioModule
|
|
894
|
+
],
|
|
895
|
+
exports: [
|
|
896
|
+
UserCreationWizardComponent
|
|
897
|
+
],
|
|
898
|
+
providers: [
|
|
899
|
+
UserCreationApiService,
|
|
900
|
+
UserCreationWizardService,
|
|
901
|
+
]
|
|
902
|
+
}]
|
|
903
|
+
}] });
|
|
904
|
+
|
|
905
|
+
/*
|
|
906
|
+
* Public API Surface of @tuki-io/tuki-widgets
|
|
907
|
+
*/
|
|
908
|
+
// Shared Components
|
|
909
|
+
// export * from './shared/shared.module';
|
|
910
|
+
// Widget Modules
|
|
911
|
+
// Types
|
|
912
|
+
// export * from './shared/types/data-table';
|
|
913
|
+
|
|
914
|
+
/**
|
|
915
|
+
* Generated bundle index. Do not edit.
|
|
916
|
+
*/
|
|
917
|
+
|
|
918
|
+
export { UserCreationModule, UserCreationWizardComponent };
|
|
919
|
+
//# sourceMappingURL=tuki-io-tuki-widgets-user-creation.mjs.map
|