@myrmidon/auth-jwt-admin 4.0.0 → 4.1.0
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/esm2022/lib/auth-jwt-admin.module.mjs +4 -4
- package/esm2022/lib/components/auth-jwt-registration/auth-jwt-registration.component.mjs +20 -16
- package/esm2022/lib/components/confirm-dialog/confirm-dialog.component.mjs +8 -8
- package/esm2022/lib/components/password-strength-bar/password-strength-bar.component.mjs +4 -4
- package/esm2022/lib/components/state/user-list.repository.mjs +4 -4
- package/esm2022/lib/components/user-editor/user-editor.component.mjs +5 -5
- package/esm2022/lib/components/user-filter/user-filter.component.mjs +5 -5
- package/esm2022/lib/components/user-list/user-list.component.mjs +6 -6
- package/esm2022/lib/services/auth-jwt-account.service.mjs +32 -10
- package/esm2022/lib/services/dialog.service.mjs +6 -6
- package/esm2022/lib/validators/password.validators.mjs +1 -1
- package/fesm2022/myrmidon-auth-jwt-admin.mjs +205 -180
- package/fesm2022/myrmidon-auth-jwt-admin.mjs.map +1 -1
- package/lib/components/auth-jwt-registration/auth-jwt-registration.component.d.ts +4 -1
- package/lib/services/auth-jwt-account.service.d.ts +1 -0
- package/package.json +1 -1
- package/src/locale/messages.it.xlf +559 -0
- package/src/locale/messages.xlf +495 -0
|
@@ -2,32 +2,32 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, EventEmitter, Component, Input, Output, Optional, Inject, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/forms';
|
|
4
4
|
import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import { retry, catchError, take } from 'rxjs/operators';
|
|
5
|
+
import { retry, map, catchError, take } from 'rxjs/operators';
|
|
6
6
|
import * as i2$1 from '@angular/material/snack-bar';
|
|
7
7
|
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
8
8
|
import * as i1 from '@angular/common/http';
|
|
9
9
|
import { HttpParams, HttpClientModule } from '@angular/common/http';
|
|
10
10
|
import * as i2 from '@myrmidon/ng-tools';
|
|
11
11
|
import { NgToolsModule } from '@myrmidon/ng-tools';
|
|
12
|
+
import { BehaviorSubject, tap } from 'rxjs';
|
|
13
|
+
import { PagedListStore } from '@myrmidon/paged-data-browsers';
|
|
12
14
|
import * as i4 from '@angular/common';
|
|
13
15
|
import { CommonModule } from '@angular/common';
|
|
14
|
-
import * as
|
|
16
|
+
import * as i6 from '@angular/material/button';
|
|
15
17
|
import { MatButtonModule } from '@angular/material/button';
|
|
16
|
-
import * as
|
|
18
|
+
import * as i7 from '@angular/material/icon';
|
|
17
19
|
import { MatIconModule } from '@angular/material/icon';
|
|
18
|
-
import * as
|
|
20
|
+
import * as i8 from '@angular/material/input';
|
|
19
21
|
import { MatInputModule } from '@angular/material/input';
|
|
20
|
-
import * as
|
|
21
|
-
import * as
|
|
22
|
+
import * as i9 from '@angular/material/form-field';
|
|
23
|
+
import * as i10 from '@angular/material/progress-spinner';
|
|
22
24
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
23
25
|
import * as i6$1 from '@angular/material/tooltip';
|
|
24
26
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
25
27
|
import '@angular/localize/init';
|
|
26
|
-
import { BehaviorSubject, tap } from 'rxjs';
|
|
27
|
-
import { PagedListStore } from '@myrmidon/paged-data-browsers';
|
|
28
28
|
import * as i1$2 from '@angular/material/dialog';
|
|
29
29
|
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
30
|
-
import * as i2$
|
|
30
|
+
import * as i2$2 from '@myrmidon/auth-jwt-login';
|
|
31
31
|
import { AuthJwtLoginModule } from '@myrmidon/auth-jwt-login';
|
|
32
32
|
import * as i6$2 from '@angular/material/expansion';
|
|
33
33
|
import { MatExpansionModule } from '@angular/material/expansion';
|
|
@@ -146,12 +146,25 @@ class AuthJwtAccountService {
|
|
|
146
146
|
requestPasswordReset(email) {
|
|
147
147
|
return this._http.post(this._env.get('apiUrl') + 'accounts/resetpassword/request', { email });
|
|
148
148
|
}
|
|
149
|
+
getUserFromWrapper(response) {
|
|
150
|
+
return response.user
|
|
151
|
+
? {
|
|
152
|
+
...response.user,
|
|
153
|
+
roles: response.roles || [],
|
|
154
|
+
}
|
|
155
|
+
: response;
|
|
156
|
+
}
|
|
149
157
|
getAllUsers() {
|
|
150
158
|
return this._http
|
|
151
159
|
.get(this._env.get('apiUrl') + 'users', {
|
|
152
160
|
params: new HttpParams().set('pageNumber', '1'),
|
|
153
161
|
})
|
|
154
|
-
.pipe(retry(3),
|
|
162
|
+
.pipe(retry(3), map((dataPage) => {
|
|
163
|
+
return {
|
|
164
|
+
...dataPage,
|
|
165
|
+
items: dataPage.items.map(this.getUserFromWrapper),
|
|
166
|
+
};
|
|
167
|
+
}), catchError(this._error.handleError));
|
|
155
168
|
}
|
|
156
169
|
getUsers(filter, pageNumber = 1, pageSize = 20) {
|
|
157
170
|
let httpParams = new HttpParams();
|
|
@@ -164,7 +177,12 @@ class AuthJwtAccountService {
|
|
|
164
177
|
.get(this._env.get('apiUrl') + 'users', {
|
|
165
178
|
params: httpParams,
|
|
166
179
|
})
|
|
167
|
-
.pipe(retry(3),
|
|
180
|
+
.pipe(retry(3), map((dataPage) => {
|
|
181
|
+
return {
|
|
182
|
+
...dataPage,
|
|
183
|
+
items: dataPage.items.map(this.getUserFromWrapper),
|
|
184
|
+
};
|
|
185
|
+
}), catchError(this._error.handleError));
|
|
168
186
|
}
|
|
169
187
|
/**
|
|
170
188
|
* Get the top N users matching the specified name filter.
|
|
@@ -185,7 +203,9 @@ class AuthJwtAccountService {
|
|
|
185
203
|
: {};
|
|
186
204
|
return this._http
|
|
187
205
|
.get(this._env.get('apiUrl') + 'users', options)
|
|
188
|
-
.pipe(retry(3),
|
|
206
|
+
.pipe(retry(3), map((users) => {
|
|
207
|
+
return users.map(this.getUserFromWrapper);
|
|
208
|
+
}), catchError(this._error.handleError));
|
|
189
209
|
}
|
|
190
210
|
/**
|
|
191
211
|
* Get information about all the users listed in the specified names.
|
|
@@ -203,7 +223,9 @@ class AuthJwtAccountService {
|
|
|
203
223
|
: {};
|
|
204
224
|
return this._http
|
|
205
225
|
.get(this._env.get('apiUrl') + 'users-from-names', options)
|
|
206
|
-
.pipe(retry(3),
|
|
226
|
+
.pipe(retry(3), map((users) => {
|
|
227
|
+
return users.map(this.getUserFromWrapper);
|
|
228
|
+
}), catchError(this._error.handleError));
|
|
207
229
|
}
|
|
208
230
|
/**
|
|
209
231
|
* Get data about the specified user.
|
|
@@ -212,7 +234,7 @@ class AuthJwtAccountService {
|
|
|
212
234
|
getUser(name) {
|
|
213
235
|
return this._http
|
|
214
236
|
.get(this._env.get('apiUrl') + 'users/' + name)
|
|
215
|
-
.pipe(retry(3), catchError(this._error.handleError));
|
|
237
|
+
.pipe(retry(3), map(this.getUserFromWrapper), catchError(this._error.handleError));
|
|
216
238
|
}
|
|
217
239
|
/**
|
|
218
240
|
* Update the editable data for the specified user.
|
|
@@ -254,16 +276,137 @@ class AuthJwtAccountService {
|
|
|
254
276
|
.delete(this._env.get('apiUrl') + 'accounts/' + name)
|
|
255
277
|
.pipe(catchError(this._error.handleError));
|
|
256
278
|
}
|
|
257
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
258
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
|
279
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: AuthJwtAccountService, deps: [{ token: i1.HttpClient }, { token: i2.ErrorService }, { token: i2.EnvService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
280
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: AuthJwtAccountService, providedIn: 'root' }); }
|
|
259
281
|
}
|
|
260
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: AuthJwtAccountService, decorators: [{
|
|
261
283
|
type: Injectable,
|
|
262
284
|
args: [{
|
|
263
285
|
providedIn: 'root',
|
|
264
286
|
}]
|
|
265
287
|
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.ErrorService }, { type: i2.EnvService }] });
|
|
266
288
|
|
|
289
|
+
class UserListRepository {
|
|
290
|
+
get activeUser$() {
|
|
291
|
+
return this._activeUser$.asObservable();
|
|
292
|
+
}
|
|
293
|
+
get filter$() {
|
|
294
|
+
return this._store.filter$;
|
|
295
|
+
}
|
|
296
|
+
get page$() {
|
|
297
|
+
return this._store.page$;
|
|
298
|
+
}
|
|
299
|
+
get loading$() {
|
|
300
|
+
return this._loading$.asObservable();
|
|
301
|
+
}
|
|
302
|
+
get saving$() {
|
|
303
|
+
return this._saving$.asObservable();
|
|
304
|
+
}
|
|
305
|
+
constructor(_accService) {
|
|
306
|
+
this._accService = _accService;
|
|
307
|
+
this._store = new PagedListStore(this);
|
|
308
|
+
this._activeUser$ = new BehaviorSubject(undefined);
|
|
309
|
+
this._loading$ = new BehaviorSubject(false);
|
|
310
|
+
this._saving$ = new BehaviorSubject(false);
|
|
311
|
+
this._store.reset();
|
|
312
|
+
}
|
|
313
|
+
loadPage(pageNumber, pageSize, filter) {
|
|
314
|
+
this._loading$.next(true);
|
|
315
|
+
return this._accService.getUsers(filter, pageNumber, pageSize).pipe(tap({
|
|
316
|
+
next: () => this._loading$.next(false),
|
|
317
|
+
error: () => this._loading$.next(false),
|
|
318
|
+
}));
|
|
319
|
+
}
|
|
320
|
+
async reset() {
|
|
321
|
+
this._loading$.next(true);
|
|
322
|
+
try {
|
|
323
|
+
await this._store.reset();
|
|
324
|
+
}
|
|
325
|
+
catch (error) {
|
|
326
|
+
throw error;
|
|
327
|
+
}
|
|
328
|
+
finally {
|
|
329
|
+
this._loading$.next(false);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
async setFilter(filter) {
|
|
333
|
+
this._loading$.next(true);
|
|
334
|
+
try {
|
|
335
|
+
await this._store.setFilter(filter);
|
|
336
|
+
}
|
|
337
|
+
catch (error) {
|
|
338
|
+
throw error;
|
|
339
|
+
}
|
|
340
|
+
finally {
|
|
341
|
+
this._loading$.next(false);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
getFilter() {
|
|
345
|
+
return this._store.getFilter();
|
|
346
|
+
}
|
|
347
|
+
async setPage(pageNumber, pageSize) {
|
|
348
|
+
this._loading$.next(true);
|
|
349
|
+
try {
|
|
350
|
+
await this._store.setPage(pageNumber, pageSize);
|
|
351
|
+
}
|
|
352
|
+
catch (error) {
|
|
353
|
+
throw error;
|
|
354
|
+
}
|
|
355
|
+
finally {
|
|
356
|
+
this._loading$.next(false);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
setActiveUser(user) {
|
|
360
|
+
this._activeUser$.next(user || undefined);
|
|
361
|
+
}
|
|
362
|
+
updateActiveUser(user) {
|
|
363
|
+
const promise = new Promise((resolve, reject) => {
|
|
364
|
+
this._saving$.next(true);
|
|
365
|
+
this._accService.updateUser(user).subscribe({
|
|
366
|
+
next: (_) => {
|
|
367
|
+
this._saving$.next(false);
|
|
368
|
+
this._store.reset();
|
|
369
|
+
resolve(true);
|
|
370
|
+
},
|
|
371
|
+
error: (error) => {
|
|
372
|
+
this._saving$.next(false);
|
|
373
|
+
console.error(`Error updating user ${user.userName}: ` +
|
|
374
|
+
JSON.stringify(error || {}));
|
|
375
|
+
resolve(false);
|
|
376
|
+
},
|
|
377
|
+
});
|
|
378
|
+
});
|
|
379
|
+
return promise;
|
|
380
|
+
}
|
|
381
|
+
deleteUser(name) {
|
|
382
|
+
const promise = new Promise((resolve, reject) => {
|
|
383
|
+
if (this._activeUser$.value?.userName === name) {
|
|
384
|
+
this._activeUser$.next(undefined);
|
|
385
|
+
}
|
|
386
|
+
this._saving$.next(true);
|
|
387
|
+
this._accService.deleteUser(name).subscribe({
|
|
388
|
+
next: (_) => {
|
|
389
|
+
this._saving$.next(false);
|
|
390
|
+
this._store.reset();
|
|
391
|
+
resolve(true);
|
|
392
|
+
},
|
|
393
|
+
error: (error) => {
|
|
394
|
+
this._saving$.next(false);
|
|
395
|
+
console.error(`Error deleting user ${name}: ` + JSON.stringify(error || {}));
|
|
396
|
+
reject(error);
|
|
397
|
+
},
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
return promise;
|
|
401
|
+
}
|
|
402
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: UserListRepository, deps: [{ token: AuthJwtAccountService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
403
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: UserListRepository, providedIn: 'root' }); }
|
|
404
|
+
}
|
|
405
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: UserListRepository, decorators: [{
|
|
406
|
+
type: Injectable,
|
|
407
|
+
args: [{ providedIn: 'root' }]
|
|
408
|
+
}], ctorParameters: () => [{ type: AuthJwtAccountService }] });
|
|
409
|
+
|
|
267
410
|
class PasswordStrengthBarComponent {
|
|
268
411
|
constructor() {
|
|
269
412
|
this._colors = ['#F00', '#F90', '#FF0', '#9F0', '#0F0'];
|
|
@@ -330,10 +473,10 @@ class PasswordStrengthBarComponent {
|
|
|
330
473
|
this.bars[n] = col;
|
|
331
474
|
}
|
|
332
475
|
}
|
|
333
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
334
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.
|
|
476
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: PasswordStrengthBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
477
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.8", type: PasswordStrengthBarComponent, selector: "auth-jwt-password-strength-bar", inputs: { passwordToCheck: "passwordToCheck" }, outputs: { strengthChange: "strengthChange" }, usesOnChanges: true, ngImport: i0, template: "<div id=\"strength\">\n <small>strength:</small>\n <ul id=\"strengthBar\">\n <li class=\"point\" [style.background-color]=\"bars[0]\"></li>\n <li class=\"point\" [style.background-color]=\"bars[1]\"></li>\n <li class=\"point\" [style.background-color]=\"bars[2]\"></li>\n <li class=\"point\" [style.background-color]=\"bars[3]\"></li>\n <li class=\"point\" [style.background-color]=\"bars[4]\"></li>\n </ul>\n</div>\n", styles: ["ul#strengthBar{display:inline;list-style:none;margin:0 0 0 15px;padding:0;vertical-align:2px}li.point:last{margin:0!important}li.point{background:#ddd;border-radius:2px;display:inline-block;height:5px;margin-right:1px;width:20px}\n"] }); }
|
|
335
478
|
}
|
|
336
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
479
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: PasswordStrengthBarComponent, decorators: [{
|
|
337
480
|
type: Component,
|
|
338
481
|
args: [{ selector: 'auth-jwt-password-strength-bar', template: "<div id=\"strength\">\n <small>strength:</small>\n <ul id=\"strengthBar\">\n <li class=\"point\" [style.background-color]=\"bars[0]\"></li>\n <li class=\"point\" [style.background-color]=\"bars[1]\"></li>\n <li class=\"point\" [style.background-color]=\"bars[2]\"></li>\n <li class=\"point\" [style.background-color]=\"bars[3]\"></li>\n <li class=\"point\" [style.background-color]=\"bars[4]\"></li>\n </ul>\n</div>\n", styles: ["ul#strengthBar{display:inline;list-style:none;margin:0 0 0 15px;padding:0;vertical-align:2px}li.point:last{margin:0!important}li.point{background:#ddd;border-radius:2px;display:inline-block;height:5px;margin-right:1px;width:20px}\n"] }]
|
|
339
482
|
}], ctorParameters: () => [], propDecorators: { passwordToCheck: [{
|
|
@@ -343,9 +486,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImpor
|
|
|
343
486
|
}] } });
|
|
344
487
|
|
|
345
488
|
class AuthJwtRegistrationComponent {
|
|
346
|
-
constructor(formBuilder, _snackbar, _accountService) {
|
|
489
|
+
constructor(formBuilder, _snackbar, _accountService, _userRepository) {
|
|
347
490
|
this._snackbar = _snackbar;
|
|
348
491
|
this._accountService = _accountService;
|
|
492
|
+
this._userRepository = _userRepository;
|
|
493
|
+
this.hide = true;
|
|
349
494
|
this.registered = new EventEmitter();
|
|
350
495
|
// form
|
|
351
496
|
this.email = formBuilder.control('', {
|
|
@@ -471,23 +616,24 @@ class AuthJwtRegistrationComponent {
|
|
|
471
616
|
.subscribe({
|
|
472
617
|
next: () => {
|
|
473
618
|
this.busy = false;
|
|
474
|
-
this._snackbar.open($localize
|
|
619
|
+
this._snackbar.open($localize `:auth-jwt-admin:Registration succeeded`, 'OK');
|
|
620
|
+
this._userRepository.reset();
|
|
475
621
|
this.registered.emit();
|
|
476
622
|
},
|
|
477
623
|
error: (error) => {
|
|
478
624
|
this.busy = false;
|
|
479
625
|
console.error('Registration error' + (error ? JSON.stringify(error) : ''));
|
|
480
|
-
this._snackbar.open($localize
|
|
626
|
+
this._snackbar.open($localize `:auth-jwt-admin:Registration error`, 'OK');
|
|
481
627
|
},
|
|
482
628
|
});
|
|
483
629
|
}
|
|
484
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
485
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.1", type: AuthJwtRegistrationComponent, selector: "auth-jwt-registration", outputs: { registered: "registered" }, ngImport: i0, template: "<div>\r\n <form role=\"form\" [formGroup]=\"form\" (submit)=\"onSubmit()\">\r\n <fieldset>\r\n <legend i18n>registration</legend>\r\n <!-- email -->\r\n <div class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label i18n>email</mat-label>\r\n <input\r\n matInput\r\n type=\"email\"\r\n id=\"email\"\r\n maxlength=\"256\"\r\n required\r\n autofocus\r\n spellcheck=\"false\"\r\n [formControl]=\"email\"\r\n />\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(email).errors?.required && (email.dirty || email.touched)\r\n \"\r\n >email required</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"$any(email).errors?.email && (email.dirty || email.touched)\"\r\n >invalid email</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(email).errors?.uniqueEmail && (email.dirty || email.touched)\r\n \"\r\n >email already registered</mat-error\r\n >\r\n </mat-form-field>\r\n <mat-icon *ngIf=\"email.pending\">hourglass</mat-icon>\r\n </div>\r\n\r\n <!-- name -->\r\n <div class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label i18n>username</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"name\"\r\n maxlength=\"50\"\r\n required\r\n pattern=\"^[a-zA-Z][a-zA-Z0-9]{2,49}$\"\r\n spellcheck=\"false\"\r\n [formControl]=\"name\"\r\n />\r\n <mat-error\r\n i18n\r\n *ngIf=\"$any(name).errors?.required && (name.dirty || name.touched)\"\r\n >username required</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"$any(name).errors?.pattern && (name.dirty || name.touched)\"\r\n >invalid username</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(name).errors?.uniqueName && (name.dirty || name.touched)\r\n \"\r\n >username already registered</mat-error\r\n >\r\n </mat-form-field>\r\n <mat-icon *ngIf=\"name.pending\">hourglass</mat-icon>\r\n </div>\r\n\r\n <!-- first name -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n>first name</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"firstName\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"firstName\"\r\n />\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n firstName.hasError('required') &&\r\n (firstName.dirty || firstName.touched)\r\n \"\r\n class=\"text-danger small\"\r\n >\r\n first name required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- last name -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n>last name</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"lastName\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"lastName\"\r\n />\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n lastName.hasError('required') &&\r\n (lastName.dirty || lastName.touched)\r\n \"\r\n class=\"text-danger small\"\r\n >\r\n last name required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- <div [formGroup]=\"passwords\"> -->\r\n <!-- password -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n>password</mat-label>\r\n <input\r\n matInput\r\n type=\"password\"\r\n name=\"password\"\r\n autocomplete=\"new-password\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"password\"\r\n />\r\n <auth-jwt-password-strength-bar [passwordToCheck]=\"password.value\">\r\n </auth-jwt-password-strength-bar>\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(password).errors?.required &&\r\n (password.dirty || password.touched)\r\n \"\r\n >password required</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(password).errors?.passwordtooshort &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 8 characters</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(password).errors?.noupperinpassword &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 1 uppercase letter</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(password).errors?.nolowerinpassword &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 1 lowercase letter</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(password).errors?.nosymbolinpassword &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 1 punctuation/symbol</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- confirm password -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n>confirm password</mat-label>\r\n <input\r\n matInput\r\n type=\"password\"\r\n name=\"confirmPassword\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"confirmPassword\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div\r\n i18n\r\n *ngIf=\"form.errors?.areequal && confirmPassword.touched\"\r\n style=\"color: red\"\r\n >\r\n password differs from confirmation password\r\n </div>\r\n\r\n <button i18n\r\n mat-raised-button\r\n type=\"submit\"\r\n color=\"primary\"\r\n [disabled]=\"\r\n form.invalid || form.pristine || busy || name.pending || email.pending\r\n \"\r\n >\r\n register\r\n </button>\r\n <mat-progress-spinner diameter=\"20\" *ngIf=\"busy\"></mat-progress-spinner>\r\n </fieldset>\r\n </form>\r\n\r\n <details>\r\n <summary i18n>Hints</summary>\r\n <p i18n>\r\n To register a new user, you must provide his email address, choose a\r\n password, and choose a username, which must be unique (you will be\r\n notified if another user has already taken that name). The username must\r\n include only letters/digits, start with a letter, and be no shorter than 3\r\n characters, nor longer than 50.\r\n </p>\r\n <p i18n>\r\n To promote a decent security level, the password must include at least 8\r\n characters, uppercase and lowercase letters, digits, and punctuation (like\r\n dashes, stops, parentheses, etc.).\r\n </p>\r\n <p i18n>\r\n Once registered, if messaging is enabled on the server side the user will\r\n receive an email message to the email address you specified; he will have\r\n to click on the provided link to complete the registration process.\r\n Otherwise, you should edit the newly created user and confirm the email\r\n registration.\r\n </p>\r\n </details>\r\n</div>\r\n", styles: ["mat-form-field{width:400px}fieldset{border:1px solid silver;border-radius:8px;padding:16px}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}details{margin:8px}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i2$2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7.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: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i8.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: PasswordStrengthBarComponent, selector: "auth-jwt-password-strength-bar", inputs: ["passwordToCheck"], outputs: ["strengthChange"] }] }); }
|
|
630
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: AuthJwtRegistrationComponent, deps: [{ token: i1$1.FormBuilder }, { token: i2$1.MatSnackBar }, { token: AuthJwtAccountService }, { token: UserListRepository }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
631
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.8", type: AuthJwtRegistrationComponent, selector: "auth-jwt-registration", outputs: { registered: "registered" }, ngImport: i0, template: "<div>\r\n <form role=\"form\" [formGroup]=\"form\" (submit)=\"onSubmit()\">\r\n <fieldset>\r\n <legend i18n=\"auth-jwt-admin\">registration</legend>\r\n <!-- email -->\r\n <div class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label i18n>email</mat-label>\r\n <input\r\n matInput\r\n type=\"email\"\r\n id=\"email\"\r\n maxlength=\"256\"\r\n required\r\n autofocus\r\n spellcheck=\"false\"\r\n [formControl]=\"email\"\r\n />\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(email).errors?.required && (email.dirty || email.touched)\r\n \"\r\n >email required</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"$any(email).errors?.email && (email.dirty || email.touched)\"\r\n >invalid email</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(email).errors?.uniqueEmail && (email.dirty || email.touched)\r\n \"\r\n >email already registered</mat-error\r\n >\r\n </mat-form-field>\r\n <mat-icon *ngIf=\"email.pending\">hourglass</mat-icon>\r\n </div>\r\n\r\n <!-- name -->\r\n <div class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label i18n=\"auth-jwt-admin\">username</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"name\"\r\n maxlength=\"50\"\r\n required\r\n pattern=\"^[a-zA-Z][a-zA-Z0-9]{2,49}$\"\r\n spellcheck=\"false\"\r\n [formControl]=\"name\"\r\n />\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"$any(name).errors?.required && (name.dirty || name.touched)\"\r\n >username required</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"$any(name).errors?.pattern && (name.dirty || name.touched)\"\r\n >invalid username</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(name).errors?.uniqueName && (name.dirty || name.touched)\r\n \"\r\n >username already registered</mat-error\r\n >\r\n </mat-form-field>\r\n <mat-icon *ngIf=\"name.pending\">hourglass</mat-icon>\r\n </div>\r\n\r\n <!-- first name -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n=\"auth-jwt-admin\">first name</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"firstName\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"firstName\"\r\n />\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n firstName.hasError('required') &&\r\n (firstName.dirty || firstName.touched)\r\n \"\r\n class=\"text-danger small\"\r\n >\r\n first name required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- last name -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n=\"auth-jwt-admin\">last name</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"lastName\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"lastName\"\r\n />\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n lastName.hasError('required') &&\r\n (lastName.dirty || lastName.touched)\r\n \"\r\n class=\"text-danger small\"\r\n >\r\n last name required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- <div [formGroup]=\"passwords\"> -->\r\n <!-- password -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n=\"auth-jwt-admin\">password</mat-label>\r\n <input\r\n matInput\r\n [type]=\"hide ? 'password' : 'text'\"\r\n name=\"password\"\r\n autocomplete=\"new-password\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"password\"\r\n />\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matSuffix\r\n (click)=\"hide = !hide\"\r\n i18n-aria-label=\"auth-jwt-login\"\r\n aria-label=\"Hide password\"\r\n [attr.aria-pressed]=\"hide\"\r\n >\r\n <mat-icon>{{ hide ? \"visibility_off\" : \"visibility\" }}</mat-icon>\r\n </button>\r\n <auth-jwt-password-strength-bar [passwordToCheck]=\"password.value\">\r\n </auth-jwt-password-strength-bar>\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(password).errors?.required &&\r\n (password.dirty || password.touched)\r\n \"\r\n >password required</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(password).errors?.passwordtooshort &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 8 characters</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(password).errors?.noupperinpassword &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 1 uppercase letter</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(password).errors?.nolowerinpassword &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 1 lowercase letter</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(password).errors?.nosymbolinpassword &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 1 punctuation/symbol</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- confirm password -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n=\"auth-jwt-admin\">confirm password</mat-label>\r\n <input\r\n matInput\r\n [type]=\"hide ? 'password' : 'text'\"\r\n name=\"confirmPassword\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"confirmPassword\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"form.errors?.areequal && confirmPassword.touched\"\r\n style=\"color: red\"\r\n >\r\n password differs from confirmation password\r\n </div>\r\n\r\n <button\r\n i18n=\"auth-jwt-admin\"\r\n mat-raised-button\r\n type=\"submit\"\r\n color=\"primary\"\r\n [disabled]=\"\r\n form.invalid || form.pristine || busy || name.pending || email.pending\r\n \"\r\n >\r\n register\r\n </button>\r\n <mat-progress-spinner diameter=\"20\" *ngIf=\"busy\"></mat-progress-spinner>\r\n </fieldset>\r\n </form>\r\n\r\n <details>\r\n <summary i18n=\"auth-jwt-admin\">Hints</summary>\r\n <div class=\"info\">\r\n <p i18n=\"auth-jwt-admin\">\r\n To register a new user, you must provide his email address, choose a\r\n password, and choose a username, which must be unique (you will be\r\n notified if another user has already taken that name). The username must\r\n include only letters/digits, start with a letter, and be no shorter than\r\n 3 characters, nor longer than 50.\r\n </p>\r\n <p i18n=\"auth-jwt-admin\">\r\n To promote a decent security level, the password must include at least 8\r\n characters, uppercase and lowercase letters, digits, and punctuation\r\n (like dashes, stops, parentheses, etc.).\r\n </p>\r\n <p i18n=\"auth-jwt-admin\">\r\n Once registered, if messaging is enabled on the server side the user\r\n will receive an email message to the email address you specified; he\r\n will have to click on the provided link to complete the registration\r\n process. Otherwise, you should edit the newly created user and confirm\r\n the email registration.\r\n </p>\r\n </div>\r\n </details>\r\n</div>\r\n", styles: ["mat-form-field{width:400px}fieldset{border:1px solid silver;border-radius:8px;padding:16px}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}details{margin:8px}.info{column-width:600px}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i6.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i6.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i8.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: i9.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i9.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i10.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: PasswordStrengthBarComponent, selector: "auth-jwt-password-strength-bar", inputs: ["passwordToCheck"], outputs: ["strengthChange"] }] }); }
|
|
486
632
|
}
|
|
487
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
633
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: AuthJwtRegistrationComponent, decorators: [{
|
|
488
634
|
type: Component,
|
|
489
|
-
args: [{ selector: 'auth-jwt-registration', template: "<div>\r\n <form role=\"form\" [formGroup]=\"form\" (submit)=\"onSubmit()\">\r\n <fieldset>\r\n <legend i18n>registration</legend>\r\n <!-- email -->\r\n <div class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label i18n>email</mat-label>\r\n <input\r\n matInput\r\n type=\"email\"\r\n id=\"email\"\r\n maxlength=\"256\"\r\n required\r\n autofocus\r\n spellcheck=\"false\"\r\n [formControl]=\"email\"\r\n />\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(email).errors?.required && (email.dirty || email.touched)\r\n \"\r\n >email required</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"$any(email).errors?.email && (email.dirty || email.touched)\"\r\n >invalid email</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(email).errors?.uniqueEmail && (email.dirty || email.touched)\r\n \"\r\n >email already registered</mat-error\r\n >\r\n </mat-form-field>\r\n <mat-icon *ngIf=\"email.pending\">hourglass</mat-icon>\r\n </div>\r\n\r\n <!-- name -->\r\n <div class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label i18n>username</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"name\"\r\n maxlength=\"50\"\r\n required\r\n pattern=\"^[a-zA-Z][a-zA-Z0-9]{2,49}$\"\r\n spellcheck=\"false\"\r\n [formControl]=\"name\"\r\n />\r\n <mat-error\r\n i18n\r\n *ngIf=\"$any(name).errors?.required && (name.dirty || name.touched)\"\r\n >username required</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"$any(name).errors?.pattern && (name.dirty || name.touched)\"\r\n >invalid username</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(name).errors?.uniqueName && (name.dirty || name.touched)\r\n \"\r\n >username already registered</mat-error\r\n >\r\n </mat-form-field>\r\n <mat-icon *ngIf=\"name.pending\">hourglass</mat-icon>\r\n </div>\r\n\r\n <!-- first name -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n>first name</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"firstName\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"firstName\"\r\n />\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n firstName.hasError('required') &&\r\n (firstName.dirty || firstName.touched)\r\n \"\r\n class=\"text-danger small\"\r\n >\r\n first name required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- last name -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n>last name</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"lastName\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"lastName\"\r\n />\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n lastName.hasError('required') &&\r\n (lastName.dirty || lastName.touched)\r\n \"\r\n class=\"text-danger small\"\r\n >\r\n last name required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- <div [formGroup]=\"passwords\"> -->\r\n <!-- password -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n>password</mat-label>\r\n <input\r\n matInput\r\n type=\"password\"\r\n name=\"password\"\r\n autocomplete=\"new-password\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"password\"\r\n />\r\n <auth-jwt-password-strength-bar [passwordToCheck]=\"password.value\">\r\n </auth-jwt-password-strength-bar>\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(password).errors?.required &&\r\n (password.dirty || password.touched)\r\n \"\r\n >password required</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(password).errors?.passwordtooshort &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 8 characters</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(password).errors?.noupperinpassword &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 1 uppercase letter</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(password).errors?.nolowerinpassword &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 1 lowercase letter</mat-error\r\n >\r\n <mat-error\r\n i18n\r\n *ngIf=\"\r\n $any(password).errors?.nosymbolinpassword &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 1 punctuation/symbol</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- confirm password -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n>confirm password</mat-label>\r\n <input\r\n matInput\r\n type=\"password\"\r\n name=\"confirmPassword\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"confirmPassword\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div\r\n i18n\r\n *ngIf=\"form.errors?.areequal && confirmPassword.touched\"\r\n style=\"color: red\"\r\n >\r\n password differs from confirmation password\r\n </div>\r\n\r\n <button
|
|
490
|
-
}], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: i2$1.MatSnackBar }, { type: AuthJwtAccountService }], propDecorators: { registered: [{
|
|
635
|
+
args: [{ selector: 'auth-jwt-registration', template: "<div>\r\n <form role=\"form\" [formGroup]=\"form\" (submit)=\"onSubmit()\">\r\n <fieldset>\r\n <legend i18n=\"auth-jwt-admin\">registration</legend>\r\n <!-- email -->\r\n <div class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label i18n>email</mat-label>\r\n <input\r\n matInput\r\n type=\"email\"\r\n id=\"email\"\r\n maxlength=\"256\"\r\n required\r\n autofocus\r\n spellcheck=\"false\"\r\n [formControl]=\"email\"\r\n />\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(email).errors?.required && (email.dirty || email.touched)\r\n \"\r\n >email required</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"$any(email).errors?.email && (email.dirty || email.touched)\"\r\n >invalid email</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(email).errors?.uniqueEmail && (email.dirty || email.touched)\r\n \"\r\n >email already registered</mat-error\r\n >\r\n </mat-form-field>\r\n <mat-icon *ngIf=\"email.pending\">hourglass</mat-icon>\r\n </div>\r\n\r\n <!-- name -->\r\n <div class=\"form-row\">\r\n <mat-form-field>\r\n <mat-label i18n=\"auth-jwt-admin\">username</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"name\"\r\n maxlength=\"50\"\r\n required\r\n pattern=\"^[a-zA-Z][a-zA-Z0-9]{2,49}$\"\r\n spellcheck=\"false\"\r\n [formControl]=\"name\"\r\n />\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"$any(name).errors?.required && (name.dirty || name.touched)\"\r\n >username required</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"$any(name).errors?.pattern && (name.dirty || name.touched)\"\r\n >invalid username</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(name).errors?.uniqueName && (name.dirty || name.touched)\r\n \"\r\n >username already registered</mat-error\r\n >\r\n </mat-form-field>\r\n <mat-icon *ngIf=\"name.pending\">hourglass</mat-icon>\r\n </div>\r\n\r\n <!-- first name -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n=\"auth-jwt-admin\">first name</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"firstName\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"firstName\"\r\n />\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n firstName.hasError('required') &&\r\n (firstName.dirty || firstName.touched)\r\n \"\r\n class=\"text-danger small\"\r\n >\r\n first name required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- last name -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n=\"auth-jwt-admin\">last name</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"lastName\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"lastName\"\r\n />\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n lastName.hasError('required') &&\r\n (lastName.dirty || lastName.touched)\r\n \"\r\n class=\"text-danger small\"\r\n >\r\n last name required\r\n </mat-error>\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- <div [formGroup]=\"passwords\"> -->\r\n <!-- password -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n=\"auth-jwt-admin\">password</mat-label>\r\n <input\r\n matInput\r\n [type]=\"hide ? 'password' : 'text'\"\r\n name=\"password\"\r\n autocomplete=\"new-password\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"password\"\r\n />\r\n <button\r\n type=\"button\"\r\n mat-icon-button\r\n matSuffix\r\n (click)=\"hide = !hide\"\r\n i18n-aria-label=\"auth-jwt-login\"\r\n aria-label=\"Hide password\"\r\n [attr.aria-pressed]=\"hide\"\r\n >\r\n <mat-icon>{{ hide ? \"visibility_off\" : \"visibility\" }}</mat-icon>\r\n </button>\r\n <auth-jwt-password-strength-bar [passwordToCheck]=\"password.value\">\r\n </auth-jwt-password-strength-bar>\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(password).errors?.required &&\r\n (password.dirty || password.touched)\r\n \"\r\n >password required</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(password).errors?.passwordtooshort &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 8 characters</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(password).errors?.noupperinpassword &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 1 uppercase letter</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(password).errors?.nolowerinpassword &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 1 lowercase letter</mat-error\r\n >\r\n <mat-error\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"\r\n $any(password).errors?.nosymbolinpassword &&\r\n (password.dirty || password.touched)\r\n \"\r\n >at least 1 punctuation/symbol</mat-error\r\n >\r\n </mat-form-field>\r\n </div>\r\n\r\n <!-- confirm password -->\r\n <div>\r\n <mat-form-field>\r\n <mat-label i18n=\"auth-jwt-admin\">confirm password</mat-label>\r\n <input\r\n matInput\r\n [type]=\"hide ? 'password' : 'text'\"\r\n name=\"confirmPassword\"\r\n maxlength=\"50\"\r\n required\r\n spellcheck=\"false\"\r\n [formControl]=\"confirmPassword\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n <div\r\n i18n=\"auth-jwt-admin\"\r\n *ngIf=\"form.errors?.areequal && confirmPassword.touched\"\r\n style=\"color: red\"\r\n >\r\n password differs from confirmation password\r\n </div>\r\n\r\n <button\r\n i18n=\"auth-jwt-admin\"\r\n mat-raised-button\r\n type=\"submit\"\r\n color=\"primary\"\r\n [disabled]=\"\r\n form.invalid || form.pristine || busy || name.pending || email.pending\r\n \"\r\n >\r\n register\r\n </button>\r\n <mat-progress-spinner diameter=\"20\" *ngIf=\"busy\"></mat-progress-spinner>\r\n </fieldset>\r\n </form>\r\n\r\n <details>\r\n <summary i18n=\"auth-jwt-admin\">Hints</summary>\r\n <div class=\"info\">\r\n <p i18n=\"auth-jwt-admin\">\r\n To register a new user, you must provide his email address, choose a\r\n password, and choose a username, which must be unique (you will be\r\n notified if another user has already taken that name). The username must\r\n include only letters/digits, start with a letter, and be no shorter than\r\n 3 characters, nor longer than 50.\r\n </p>\r\n <p i18n=\"auth-jwt-admin\">\r\n To promote a decent security level, the password must include at least 8\r\n characters, uppercase and lowercase letters, digits, and punctuation\r\n (like dashes, stops, parentheses, etc.).\r\n </p>\r\n <p i18n=\"auth-jwt-admin\">\r\n Once registered, if messaging is enabled on the server side the user\r\n will receive an email message to the email address you specified; he\r\n will have to click on the provided link to complete the registration\r\n process. Otherwise, you should edit the newly created user and confirm\r\n the email registration.\r\n </p>\r\n </div>\r\n </details>\r\n</div>\r\n", styles: ["mat-form-field{width:400px}fieldset{border:1px solid silver;border-radius:8px;padding:16px}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}details{margin:8px}.info{column-width:600px}\n"] }]
|
|
636
|
+
}], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: i2$1.MatSnackBar }, { type: AuthJwtAccountService }, { type: UserListRepository }], propDecorators: { registered: [{
|
|
491
637
|
type: Output
|
|
492
638
|
}] } });
|
|
493
639
|
|
|
@@ -533,12 +679,12 @@ class UserFilterComponent {
|
|
|
533
679
|
this._filter = this.getFilter();
|
|
534
680
|
this.filterChange.emit(this._filter);
|
|
535
681
|
}
|
|
536
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
537
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.
|
|
682
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: UserFilterComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
683
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.8", type: UserFilterComponent, selector: "auth-jwt-user-filter", inputs: { filter: "filter", disabled: "disabled" }, outputs: { filterChange: "filterChange" }, ngImport: i0, template: "<form [formGroup]=\"form\" (submit)=\"apply()\" ng-disabled=\"disabled\">\n <div class=\"form-row\">\n <mat-form-field>\n <mat-label i18n=\"auth-jwt-admin\">name or ID</mat-label>\n <input matInput [formControl]=\"name\" />\n <button\n mat-icon-button\n matSuffix\n type=\"button\"\n (click)=\"reset()\"\n color=\"warn\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Reset filters\"\n [disabled]=\"disabled\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n </mat-form-field>\n\n <button\n id=\"apply\"\n type=\"submit\"\n mat-icon-button\n color=\"primary\"\n [disabled]=\"disabled\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Apply filters\"\n >\n <mat-icon>check_circle</mat-icon>\n </button>\n </div>\n</form>\n", styles: [".form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}#apply{margin-top:-20px}\n"], dependencies: [{ kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i6.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i8.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: i9.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i6$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
|
|
538
684
|
}
|
|
539
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
685
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: UserFilterComponent, decorators: [{
|
|
540
686
|
type: Component,
|
|
541
|
-
args: [{ selector: 'auth-jwt-user-filter', template: "<form [formGroup]=\"form\" (submit)=\"apply()\" ng-disabled=\"disabled\">\n <div class=\"form-row\">\n <mat-form-field>\n <mat-label i18n>name or ID</mat-label>\n <input matInput [formControl]=\"name\" />\n <button\n mat-icon-button\n matSuffix\n type=\"button\"\n (click)=\"reset()\"\n color=\"warn\"\n i18n-matTooltip\n matTooltip=\"Reset filters\"\n [disabled]=\"disabled\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n </mat-form-field>\n\n <button\n id=\"apply\"\n type=\"submit\"\n mat-icon-button\n color=\"primary\"\n [disabled]=\"disabled\"\n i18n-matTooltip\n matTooltip=\"Apply filters\"\n >\n <mat-icon>check_circle</mat-icon>\n </button>\n </div>\n</form>\n", styles: [".form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}#apply{margin-top:-20px}\n"] }]
|
|
687
|
+
args: [{ selector: 'auth-jwt-user-filter', template: "<form [formGroup]=\"form\" (submit)=\"apply()\" ng-disabled=\"disabled\">\n <div class=\"form-row\">\n <mat-form-field>\n <mat-label i18n=\"auth-jwt-admin\">name or ID</mat-label>\n <input matInput [formControl]=\"name\" />\n <button\n mat-icon-button\n matSuffix\n type=\"button\"\n (click)=\"reset()\"\n color=\"warn\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Reset filters\"\n [disabled]=\"disabled\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n </mat-form-field>\n\n <button\n id=\"apply\"\n type=\"submit\"\n mat-icon-button\n color=\"primary\"\n [disabled]=\"disabled\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Apply filters\"\n >\n <mat-icon>check_circle</mat-icon>\n </button>\n </div>\n</form>\n", styles: [".form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}#apply{margin-top:-20px}\n"] }]
|
|
542
688
|
}], ctorParameters: () => [{ type: i1$1.FormBuilder }], propDecorators: { filter: [{
|
|
543
689
|
type: Input
|
|
544
690
|
}], disabled: [{
|
|
@@ -547,142 +693,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImpor
|
|
|
547
693
|
type: Output
|
|
548
694
|
}] } });
|
|
549
695
|
|
|
550
|
-
class UserListRepository {
|
|
551
|
-
get activeUser$() {
|
|
552
|
-
return this._activeUser$.asObservable();
|
|
553
|
-
}
|
|
554
|
-
get filter$() {
|
|
555
|
-
return this._store.filter$;
|
|
556
|
-
}
|
|
557
|
-
get page$() {
|
|
558
|
-
return this._store.page$;
|
|
559
|
-
}
|
|
560
|
-
get loading$() {
|
|
561
|
-
return this._loading$.asObservable();
|
|
562
|
-
}
|
|
563
|
-
get saving$() {
|
|
564
|
-
return this._saving$.asObservable();
|
|
565
|
-
}
|
|
566
|
-
constructor(_accService) {
|
|
567
|
-
this._accService = _accService;
|
|
568
|
-
this._store = new PagedListStore(this);
|
|
569
|
-
this._activeUser$ = new BehaviorSubject(undefined);
|
|
570
|
-
this._loading$ = new BehaviorSubject(false);
|
|
571
|
-
this._saving$ = new BehaviorSubject(false);
|
|
572
|
-
this._store.reset();
|
|
573
|
-
}
|
|
574
|
-
loadPage(pageNumber, pageSize, filter) {
|
|
575
|
-
this._loading$.next(true);
|
|
576
|
-
return this._accService.getUsers(filter, pageNumber, pageSize).pipe(tap({
|
|
577
|
-
next: () => this._loading$.next(false),
|
|
578
|
-
error: () => this._loading$.next(false),
|
|
579
|
-
}));
|
|
580
|
-
}
|
|
581
|
-
async reset() {
|
|
582
|
-
this._loading$.next(true);
|
|
583
|
-
try {
|
|
584
|
-
await this._store.reset();
|
|
585
|
-
}
|
|
586
|
-
catch (error) {
|
|
587
|
-
throw error;
|
|
588
|
-
}
|
|
589
|
-
finally {
|
|
590
|
-
this._loading$.next(false);
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
async setFilter(filter) {
|
|
594
|
-
this._loading$.next(true);
|
|
595
|
-
try {
|
|
596
|
-
await this._store.setFilter(filter);
|
|
597
|
-
}
|
|
598
|
-
catch (error) {
|
|
599
|
-
throw error;
|
|
600
|
-
}
|
|
601
|
-
finally {
|
|
602
|
-
this._loading$.next(false);
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
getFilter() {
|
|
606
|
-
return this._store.getFilter();
|
|
607
|
-
}
|
|
608
|
-
async setPage(pageNumber, pageSize) {
|
|
609
|
-
this._loading$.next(true);
|
|
610
|
-
try {
|
|
611
|
-
await this._store.setPage(pageNumber, pageSize);
|
|
612
|
-
}
|
|
613
|
-
catch (error) {
|
|
614
|
-
throw error;
|
|
615
|
-
}
|
|
616
|
-
finally {
|
|
617
|
-
this._loading$.next(false);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
setActiveUser(user) {
|
|
621
|
-
this._activeUser$.next(user || undefined);
|
|
622
|
-
}
|
|
623
|
-
updateActiveUser(user) {
|
|
624
|
-
const promise = new Promise((resolve, reject) => {
|
|
625
|
-
this._saving$.next(true);
|
|
626
|
-
this._accService.updateUser(user).subscribe({
|
|
627
|
-
next: (_) => {
|
|
628
|
-
this._saving$.next(false);
|
|
629
|
-
this._store.reset();
|
|
630
|
-
resolve(true);
|
|
631
|
-
},
|
|
632
|
-
error: (error) => {
|
|
633
|
-
this._saving$.next(false);
|
|
634
|
-
console.error(`Error updating user ${user.userName}: ` +
|
|
635
|
-
JSON.stringify(error || {}));
|
|
636
|
-
resolve(false);
|
|
637
|
-
},
|
|
638
|
-
});
|
|
639
|
-
});
|
|
640
|
-
return promise;
|
|
641
|
-
}
|
|
642
|
-
deleteUser(name) {
|
|
643
|
-
const promise = new Promise((resolve, reject) => {
|
|
644
|
-
if (this._activeUser$.value?.userName === name) {
|
|
645
|
-
this._activeUser$.next(undefined);
|
|
646
|
-
}
|
|
647
|
-
this._saving$.next(true);
|
|
648
|
-
this._accService.deleteUser(name).subscribe({
|
|
649
|
-
next: (_) => {
|
|
650
|
-
this._saving$.next(false);
|
|
651
|
-
this._store.reset();
|
|
652
|
-
resolve(true);
|
|
653
|
-
},
|
|
654
|
-
error: (error) => {
|
|
655
|
-
this._saving$.next(false);
|
|
656
|
-
console.error(`Error deleting user ${name}: ` + JSON.stringify(error || {}));
|
|
657
|
-
reject(error);
|
|
658
|
-
},
|
|
659
|
-
});
|
|
660
|
-
});
|
|
661
|
-
return promise;
|
|
662
|
-
}
|
|
663
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: UserListRepository, deps: [{ token: AuthJwtAccountService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
664
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: UserListRepository, providedIn: 'root' }); }
|
|
665
|
-
}
|
|
666
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: UserListRepository, decorators: [{
|
|
667
|
-
type: Injectable,
|
|
668
|
-
args: [{ providedIn: 'root' }]
|
|
669
|
-
}], ctorParameters: () => [{ type: AuthJwtAccountService }] });
|
|
670
|
-
|
|
671
696
|
// https://medium.com/@tarik.nzl/making-use-of-dialogs-in-material-2-mddialog-7533d27df41
|
|
672
697
|
class ConfirmDialogComponent {
|
|
673
698
|
constructor(dialogRef, data) {
|
|
674
699
|
this.dialogRef = dialogRef;
|
|
675
700
|
this.data = data;
|
|
676
|
-
this.title = $localize
|
|
677
|
-
this.prompt = $localize
|
|
678
|
-
this.ok = $localize
|
|
679
|
-
this.cancel = $localize
|
|
701
|
+
this.title = $localize `:auth-jwt-admin:Confirm`;
|
|
702
|
+
this.prompt = $localize `:auth-jwt-admin:Confirm operation?`;
|
|
703
|
+
this.ok = $localize `:auth-jwt-admin:yes`;
|
|
704
|
+
this.cancel = $localize `:auth-jwt-admin:no`;
|
|
680
705
|
}
|
|
681
706
|
ngOnInit() { }
|
|
682
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
683
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.
|
|
707
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: ConfirmDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
708
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.8", type: ConfirmDialogComponent, selector: "ng-component", ngImport: i0, template: "<h1 mat-dialog-title>{{ title }}</h1>\r\n<mat-dialog-content>\r\n {{ prompt }}\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button\r\n type=\"button\"\r\n mat-raised-button\r\n color=\"warn\"\r\n (click)=\"dialogRef.close(true)\"\r\n >\r\n {{ ok }}\r\n </button>\r\n <button type=\"button\" mat-button (click)=\"dialogRef.close()\">\r\n {{ cancel }}\r\n </button>\r\n</mat-dialog-actions>\r\n", styles: [""], dependencies: [{ kind: "component", type: i6.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }] }); }
|
|
684
709
|
}
|
|
685
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
710
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
|
|
686
711
|
type: Component,
|
|
687
712
|
args: [{ template: "<h1 mat-dialog-title>{{ title }}</h1>\r\n<mat-dialog-content>\r\n {{ prompt }}\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button\r\n type=\"button\"\r\n mat-raised-button\r\n color=\"warn\"\r\n (click)=\"dialogRef.close(true)\"\r\n >\r\n {{ ok }}\r\n </button>\r\n <button type=\"button\" mat-button (click)=\"dialogRef.close()\">\r\n {{ cancel }}\r\n </button>\r\n</mat-dialog-actions>\r\n" }]
|
|
688
713
|
}], ctorParameters: () => [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
|
|
@@ -706,7 +731,7 @@ class DialogService {
|
|
|
706
731
|
constructor(dialog) {
|
|
707
732
|
this.dialog = dialog;
|
|
708
733
|
}
|
|
709
|
-
confirm(title, prompt, ok = $localize
|
|
734
|
+
confirm(title, prompt, ok = $localize `:auth-jwt-admin:yes`, cancel = $localize `:auth-jwt-admin:no`) {
|
|
710
735
|
let dialogRef;
|
|
711
736
|
dialogRef = this.dialog.open(ConfirmDialogComponent);
|
|
712
737
|
dialogRef.componentInstance.title = title;
|
|
@@ -715,13 +740,13 @@ class DialogService {
|
|
|
715
740
|
dialogRef.componentInstance.cancel = cancel;
|
|
716
741
|
return dialogRef.afterClosed();
|
|
717
742
|
}
|
|
718
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
719
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
|
743
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: DialogService, deps: [{ token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
744
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: DialogService, providedIn: 'root' }); }
|
|
720
745
|
}
|
|
721
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
746
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: DialogService, decorators: [{
|
|
722
747
|
type: Injectable,
|
|
723
748
|
args: [{
|
|
724
|
-
providedIn: 'root'
|
|
749
|
+
providedIn: 'root',
|
|
725
750
|
}]
|
|
726
751
|
}], ctorParameters: () => [{ type: i1$2.MatDialog }] });
|
|
727
752
|
|
|
@@ -811,13 +836,13 @@ class UserEditorComponent {
|
|
|
811
836
|
}
|
|
812
837
|
this.userChange.emit(this.getUserFromForm());
|
|
813
838
|
}
|
|
814
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
815
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.
|
|
839
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: UserEditorComponent, deps: [{ token: i1$1.UntypedFormBuilder }, { token: i2$2.AuthJwtService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
840
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.8", type: UserEditorComponent, selector: "auth-jwt-user-editor", inputs: { user: "user" }, outputs: { userChange: "userChange", editorClose: "editorClose" }, ngImport: i0, template: "<form [formGroup]=\"form\" (submit)=\"save()\">\n <div class=\"form-row\">\n <!-- email -->\n <mat-form-field>\n <mat-label i18n=\"auth-jwt-admin\">email</mat-label>\n <input type=\"text\" matInput [formControl]=\"email\" />\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"email.hasError('required') && (email.dirty || email.touched)\"\n >\n email address required\n </mat-error>\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"email.hasError('pattern') && (email.dirty || email.touched)\"\n >\n invalid email address\n </mat-error>\n </mat-form-field>\n\n <!-- emailConfirmed -->\n <mat-checkbox [formControl]=\"emailConfirmed\" i18n=\"auth-jwt-admin\"\n >email address confirmed</mat-checkbox\n >\n </div>\n\n <!-- lockoutEnabled -->\n <div class=\"form-row\">\n <mat-checkbox [formControl]=\"lockoutEnabled\" i18n=\"auth-jwt-admin\"\n >lockout enabled</mat-checkbox\n >\n <button\n mat-icon-button\n color=\"primary\"\n (click)=\"endLockout()\"\n [disabled]=\"unlocked\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Unlock this user if locked\"\n >\n <mat-icon>lock_open</mat-icon>\n </button>\n </div>\n\n <div class=\"form-row\">\n <!-- firstName -->\n <mat-form-field>\n <mat-label i18n=\"auth-jwt-admin\">first name</mat-label>\n <input type=\"text\" matInput [formControl]=\"firstName\" />\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"\n firstName.hasError('required') &&\n (firstName.dirty || firstName.touched)\n \"\n >\n first name required\n </mat-error>\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"\n firstName.hasError('maxlength') &&\n (firstName.dirty || firstName.touched)\n \"\n >\n first name too long\n </mat-error>\n </mat-form-field>\n\n <!-- lastName -->\n <mat-form-field>\n <mat-label i18n=\"auth-jwt-admin\">last name</mat-label>\n <input type=\"text\" matInput [formControl]=\"lastName\" />\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"\n lastName.hasError('required') && (lastName.dirty || lastName.touched)\n \"\n >\n last name required\n </mat-error>\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"\n lastName.hasError('maxlength') && (lastName.dirty || lastName.touched)\n \"\n >\n last name too long\n </mat-error>\n </mat-form-field>\n </div>\n\n <!-- roles -->\n <div>\n <mat-form-field style=\"width: 16em\">\n <mat-label i18n=\"auth-jwt-admin\">roles</mat-label>\n <input type=\"text\" matInput [formControl]=\"roles\" />\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"roles.hasError('maxlength') && (roles.dirty || roles.touched)\"\n >\n too long\n </mat-error>\n <mat-hint i18n>roles (separated by space)</mat-hint>\n </mat-form-field>\n </div>\n\n <!-- buttons -->\n <br />\n <div>\n <button\n type=\"button\"\n mat-icon-button\n color=\"warn\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Close\"\n (click)=\"close()\"\n >\n <mat-icon>cancel</mat-icon>\n </button>\n <button\n type=\"submit\"\n mat-icon-button\n color=\"primary\"\n [disabled]=\"form.invalid\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Save user\"\n >\n <mat-icon>check_circle</mat-icon>\n </button>\n </div>\n</form>\n", styles: [".form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i6.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i5.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i8.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: i9.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i9.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i6$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
|
|
816
841
|
}
|
|
817
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
842
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: UserEditorComponent, decorators: [{
|
|
818
843
|
type: Component,
|
|
819
|
-
args: [{ selector: 'auth-jwt-user-editor', template: "<form [formGroup]=\"form\" (submit)=\"save()\">\n <div class=\"form-row\">\n <!-- email -->\n <mat-form-field>\n <mat-label i18n>email</mat-label>\n <input type=\"text\" matInput [formControl]=\"email\" />\n <mat-error\n i18n\n *ngIf=\"email.hasError('required') && (email.dirty || email.touched)\"\n >\n email address required\n </mat-error>\n <mat-error\n i18n\n *ngIf=\"email.hasError('pattern') && (email.dirty || email.touched)\"\n >\n invalid email address\n </mat-error>\n </mat-form-field>\n\n <!-- emailConfirmed -->\n <mat-checkbox [formControl]=\"emailConfirmed\" i18n\n >email address confirmed</mat-checkbox\n >\n </div>\n\n <!-- lockoutEnabled -->\n <div class=\"form-row\">\n <mat-checkbox [formControl]=\"lockoutEnabled\" i18n\n >lockout enabled</mat-checkbox\n >\n <button\n mat-icon-button\n color=\"primary\"\n (click)=\"endLockout()\"\n [disabled]=\"unlocked\"\n i18n-matTooltip\n matTooltip=\"Unlock this user if locked\"\n >\n <mat-icon>lock_open</mat-icon>\n </button>\n </div>\n\n <div class=\"form-row\">\n <!-- firstName -->\n <mat-form-field>\n <mat-label i18n>first name</mat-label>\n <input type=\"text\" matInput [formControl]=\"firstName\" />\n <mat-error\n i18n\n *ngIf=\"\n firstName.hasError('required') &&\n (firstName.dirty || firstName.touched)\n \"\n >\n first name required\n </mat-error>\n <mat-error\n i18n\n *ngIf=\"\n firstName.hasError('maxlength') &&\n (firstName.dirty || firstName.touched)\n \"\n >\n first name too long\n </mat-error>\n </mat-form-field>\n\n <!-- lastName -->\n <mat-form-field>\n <mat-label i18n>last name</mat-label>\n <input type=\"text\" matInput [formControl]=\"lastName\" />\n <mat-error\n i18n\n *ngIf=\"\n lastName.hasError('required') && (lastName.dirty || lastName.touched)\n \"\n >\n last name required\n </mat-error>\n <mat-error\n i18n\n *ngIf=\"\n lastName.hasError('maxlength') && (lastName.dirty || lastName.touched)\n \"\n >\n last name too long\n </mat-error>\n </mat-form-field>\n </div>\n\n <!-- roles -->\n <div>\n <mat-form-field style=\"width: 16em\">\n <mat-label i18n>roles</mat-label>\n <input type=\"text\" matInput [formControl]=\"roles\" />\n <mat-error\n i18n\n *ngIf=\"roles.hasError('maxlength') && (roles.dirty || roles.touched)\"\n >\n too long\n </mat-error>\n <mat-hint i18n>roles (separated by space)</mat-hint>\n </mat-form-field>\n </div>\n\n <!-- buttons -->\n <br />\n <div>\n <button\n type=\"button\"\n mat-icon-button\n color=\"warn\"\n i18n-matTooltip\n matTooltip=\"Close\"\n (click)=\"close()\"\n >\n <mat-icon>cancel</mat-icon>\n </button>\n <button\n type=\"submit\"\n mat-icon-button\n color=\"primary\"\n [disabled]=\"form.invalid\"\n i18n-matTooltip\n matTooltip=\"Save user\"\n >\n <mat-icon>check_circle</mat-icon>\n </button>\n </div>\n</form>\n", styles: [".form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}\n"] }]
|
|
820
|
-
}], ctorParameters: () => [{ type: i1$1.UntypedFormBuilder }, { type: i2$
|
|
844
|
+
args: [{ selector: 'auth-jwt-user-editor', template: "<form [formGroup]=\"form\" (submit)=\"save()\">\n <div class=\"form-row\">\n <!-- email -->\n <mat-form-field>\n <mat-label i18n=\"auth-jwt-admin\">email</mat-label>\n <input type=\"text\" matInput [formControl]=\"email\" />\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"email.hasError('required') && (email.dirty || email.touched)\"\n >\n email address required\n </mat-error>\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"email.hasError('pattern') && (email.dirty || email.touched)\"\n >\n invalid email address\n </mat-error>\n </mat-form-field>\n\n <!-- emailConfirmed -->\n <mat-checkbox [formControl]=\"emailConfirmed\" i18n=\"auth-jwt-admin\"\n >email address confirmed</mat-checkbox\n >\n </div>\n\n <!-- lockoutEnabled -->\n <div class=\"form-row\">\n <mat-checkbox [formControl]=\"lockoutEnabled\" i18n=\"auth-jwt-admin\"\n >lockout enabled</mat-checkbox\n >\n <button\n mat-icon-button\n color=\"primary\"\n (click)=\"endLockout()\"\n [disabled]=\"unlocked\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Unlock this user if locked\"\n >\n <mat-icon>lock_open</mat-icon>\n </button>\n </div>\n\n <div class=\"form-row\">\n <!-- firstName -->\n <mat-form-field>\n <mat-label i18n=\"auth-jwt-admin\">first name</mat-label>\n <input type=\"text\" matInput [formControl]=\"firstName\" />\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"\n firstName.hasError('required') &&\n (firstName.dirty || firstName.touched)\n \"\n >\n first name required\n </mat-error>\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"\n firstName.hasError('maxlength') &&\n (firstName.dirty || firstName.touched)\n \"\n >\n first name too long\n </mat-error>\n </mat-form-field>\n\n <!-- lastName -->\n <mat-form-field>\n <mat-label i18n=\"auth-jwt-admin\">last name</mat-label>\n <input type=\"text\" matInput [formControl]=\"lastName\" />\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"\n lastName.hasError('required') && (lastName.dirty || lastName.touched)\n \"\n >\n last name required\n </mat-error>\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"\n lastName.hasError('maxlength') && (lastName.dirty || lastName.touched)\n \"\n >\n last name too long\n </mat-error>\n </mat-form-field>\n </div>\n\n <!-- roles -->\n <div>\n <mat-form-field style=\"width: 16em\">\n <mat-label i18n=\"auth-jwt-admin\">roles</mat-label>\n <input type=\"text\" matInput [formControl]=\"roles\" />\n <mat-error\n i18n=\"auth-jwt-admin\"\n *ngIf=\"roles.hasError('maxlength') && (roles.dirty || roles.touched)\"\n >\n too long\n </mat-error>\n <mat-hint i18n>roles (separated by space)</mat-hint>\n </mat-form-field>\n </div>\n\n <!-- buttons -->\n <br />\n <div>\n <button\n type=\"button\"\n mat-icon-button\n color=\"warn\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Close\"\n (click)=\"close()\"\n >\n <mat-icon>cancel</mat-icon>\n </button>\n <button\n type=\"submit\"\n mat-icon-button\n color=\"primary\"\n [disabled]=\"form.invalid\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Save user\"\n >\n <mat-icon>check_circle</mat-icon>\n </button>\n </div>\n</form>\n", styles: [".form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}\n"] }]
|
|
845
|
+
}], ctorParameters: () => [{ type: i1$1.UntypedFormBuilder }, { type: i2$2.AuthJwtService }], propDecorators: { user: [{
|
|
821
846
|
type: Input
|
|
822
847
|
}], userChange: [{
|
|
823
848
|
type: Output
|
|
@@ -846,7 +871,7 @@ class UserListComponent {
|
|
|
846
871
|
}
|
|
847
872
|
deleteUser(user) {
|
|
848
873
|
this._dialogService
|
|
849
|
-
.confirm($localize
|
|
874
|
+
.confirm($localize `:auth-jwt-admin:Confirm`, $localize `:auth-jwt-admin:Delete user` + user.userName + '?')
|
|
850
875
|
.subscribe((yes) => {
|
|
851
876
|
if (yes) {
|
|
852
877
|
this._repository.deleteUser(user.userName);
|
|
@@ -869,17 +894,17 @@ class UserListComponent {
|
|
|
869
894
|
getGravatarUrl(email, size = 80) {
|
|
870
895
|
return this._gravatarService.buildGravatarUrl(email, size);
|
|
871
896
|
}
|
|
872
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
873
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.
|
|
897
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: UserListComponent, deps: [{ token: UserListRepository }, { token: DialogService }, { token: i2$2.GravatarService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
898
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.8", type: UserListComponent, selector: "auth-jwt-user-list", ngImport: i0, template: "<div id=\"container\">\n <div>\n <!-- filters -->\n <div id=\"filters\">\n <auth-jwt-user-filter\n [filter]=\"filter$ | async\"\n (filterChange)=\"onFilterChange($event)\"\n ></auth-jwt-user-filter>\n </div>\n\n <!-- list -->\n <div id=\"list\" *ngIf=\"page$ | async as page\">\n <div *ngIf=\"loading$ | async\">\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n <table>\n <thead>\n <td></td>\n <td></td>\n <th i18n=\"auth-jwt-admin\">name</th>\n <th i18n=\"auth-jwt-admin\" class=\"noif-lt-md\">first</th>\n <th i18n=\"auth-jwt-admin\" class=\"noif-lt-md\">last</th>\n <th i18n=\"auth-jwt-admin\" class=\"noif-lt-md\">email</th>\n <th i18n=\"auth-jwt-admin\">roles</th>\n <th i18n=\"auth-jwt-admin\" class=\"noif-lt-md\">lock end</th>\n </thead>\n <tbody>\n <tr *ngFor=\"let user of page.items\">\n <td class=\"fit-width\">\n <button\n mat-icon-button\n type=\"button\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Edit this user\"\n color=\"primary\"\n (click)=\"setActiveUser(user)\"\n >\n <mat-icon>mode_edit</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Delete this user\"\n color=\"warn\"\n (click)=\"deleteUser(user)\"\n >\n <mat-icon>remove_circle</mat-icon>\n </button>\n </td>\n <td class=\"fit-width\">\n <img\n alt=\"avatar\"\n [src]=\"getGravatarUrl(user.email, 32)\"\n [alt]=\"user.userName\"\n />\n </td>\n <td>{{ user.userName }}</td>\n <td class=\"noif-lt-md\">{{ user.firstName }}</td>\n <td class=\"noif-lt-md\">{{ user.lastName }}</td>\n <td class=\"noif-lt-md\">\n <a [href]=\"'mailto:' + user.email\">{{ user.email }}</a>\n </td>\n <td>{{ user.roles.join(\" \") }}</td>\n <td class=\"noif-lt-md\">{{ user.lockoutEnd }}</td>\n </tr>\n </tbody>\n </table>\n\n <!-- paginator -->\n <div class=\"form-row\">\n <button\n type=\"button\"\n mat-icon-button\n color=\"warn\"\n i18n-matmatTooltip=\"auth-jwt-admin\"\n matTooltip=\"Refresh list\"\n (click)=\"reset()\"\n >\n <mat-icon>autorenew</mat-icon>\n </button>\n\n <mat-paginator\n [length]=\"page.total\"\n [pageIndex]=\"page.pageNumber - 1\"\n [pageSize]=\"page.pageSize\"\n [pageSizeOptions]=\"[5, 10, 20, 50, 100]\"\n (page)=\"onPageChange($event)\"\n [showFirstLastButtons]=\"true\"\n ></mat-paginator>\n </div>\n </div>\n </div>\n\n <!-- editor -->\n <mat-expansion-panel\n id=\"editor\"\n [expanded]=\"active$ | async\"\n [disabled]=\"!(active$ | async)\"\n >\n <div *ngIf=\"active$ | async as active\">\n <fieldset>\n <legend>{{ active.userName }}</legend>\n <auth-jwt-user-editor\n [user]=\"active\"\n (userChange)=\"saveActiveUser($event)\"\n (editorClose)=\"resetActiveUser()\"\n ></auth-jwt-user-editor>\n </fieldset>\n </div>\n </mat-expansion-panel>\n</div>\n", styles: ["tr:nth-child(odd){background-color:#f8f8f8}th{padding:0 8px;text-align:left;color:silver;font-weight:400}td{padding:0 8px}td.fit-width{width:1px;white-space:nowrap}table{width:100%;border-collapse:collapse}fieldset{border:1px solid silver;border-radius:8px;padding:16px}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}div#filters{grid-area:filters}div#list{grid-area:list}div#editor{grid-area:editor}div#container{display:grid;grid-template-rows:auto 1fr auto;grid-template-columns:1fr;grid-template-areas:\"filters\" \"list\" \"editor\";gap:8px}@media only screen and (max-width: 959px){.noif-lt-md{display:none}}@media only screen and (min-width: 1920px){div#container{grid-template-rows:auto 1fr;grid-template-columns:1fr auto;grid-template-areas:\"filters filters\" \"list editor\"}}\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: i6.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i6$2.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i8$1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "component", type: i9$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: i6$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: UserFilterComponent, selector: "auth-jwt-user-filter", inputs: ["filter", "disabled"], outputs: ["filterChange"] }, { kind: "component", type: UserEditorComponent, selector: "auth-jwt-user-editor", inputs: ["user"], outputs: ["userChange", "editorClose"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] }); }
|
|
874
899
|
}
|
|
875
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
900
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: UserListComponent, decorators: [{
|
|
876
901
|
type: Component,
|
|
877
|
-
args: [{ selector: 'auth-jwt-user-list', template: "<div id=\"container\">\n <div>\n <!-- filters -->\n <div id=\"filters\">\n <auth-jwt-user-filter\n [filter]=\"filter$ | async\"\n (filterChange)=\"onFilterChange($event)\"\n ></auth-jwt-user-filter>\n </div>\n\n <!-- list -->\n <div id=\"list\" *ngIf=\"page$ | async as page\">\n <div *ngIf=\"loading$ | async\">\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n <table>\n <thead>\n <td></td>\n <td></td>\n <th i18n>name</th>\n <th i18n class=\"noif-lt-md\">first</th>\n <th i18n class=\"noif-lt-md\">last</th>\n <th i18n class=\"noif-lt-md\">email</th>\n <th i18n>roles</th>\n <th i18n class=\"noif-lt-md\">lock end</th>\n </thead>\n <tbody>\n <tr *ngFor=\"let user of page.items\">\n <td class=\"fit-width\">\n <button\n mat-icon-button\n type=\"button\"\n i18n-matTooltip\n matTooltip=\"Edit this user\"\n color=\"primary\"\n (click)=\"setActiveUser(user)\"\n >\n <mat-icon>mode_edit</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n i18n-matTooltip\n matTooltip=\"Delete this user\"\n color=\"warn\"\n (click)=\"deleteUser(user)\"\n >\n <mat-icon>remove_circle</mat-icon>\n </button>\n </td>\n <td class=\"fit-width\">\n <img\n alt=\"avatar\"\n [src]=\"getGravatarUrl(user.email, 32)\"\n [alt]=\"user.userName\"\n />\n </td>\n <td>{{ user.userName }}</td>\n <td class=\"noif-lt-md\">{{ user.firstName }}</td>\n <td class=\"noif-lt-md\">{{ user.lastName }}</td>\n <td class=\"noif-lt-md\">\n <a [href]=\"'mailto:' + user.email\">{{ user.email }}</a>\n </td>\n <td>{{ user.roles.join(\" \") }}</td>\n <td class=\"noif-lt-md\">{{ user.lockoutEnd }}</td>\n </tr>\n </tbody>\n </table>\n\n <!-- paginator -->\n <div class=\"form-row\">\n <button\n type=\"button\"\n mat-icon-button\n color=\"warn\"\n i18n-matmatTooltip\n matTooltip=\"Refresh list\"\n (click)=\"reset()\"\n >\n <mat-icon>autorenew</mat-icon>\n </button>\n\n <mat-paginator\n [length]=\"page.total\"\n [pageIndex]=\"page.pageNumber - 1\"\n [pageSize]=\"page.pageSize\"\n [pageSizeOptions]=\"[5, 10, 20, 50, 100]\"\n (page)=\"onPageChange($event)\"\n [showFirstLastButtons]=\"true\"\n ></mat-paginator>\n </div>\n </div>\n </div>\n\n <!-- editor -->\n <mat-expansion-panel\n id=\"editor\"\n [expanded]=\"active$ | async\"\n [disabled]=\"!(active$ | async)\"\n >\n <div *ngIf=\"active$ | async as active\">\n <fieldset>\n <legend>{{ active.userName }}</legend>\n <auth-jwt-user-editor\n [user]=\"active\"\n (userChange)=\"saveActiveUser($event)\"\n (editorClose)=\"resetActiveUser()\"\n ></auth-jwt-user-editor>\n </fieldset>\n </div>\n </mat-expansion-panel>\n</div>\n", styles: ["tr:nth-child(odd){background-color:#f8f8f8}th{padding:0 8px;text-align:left;color:silver;font-weight:400}td{padding:0 8px}td.fit-width{width:1px;white-space:nowrap}table{width:100%;border-collapse:collapse}fieldset{border:1px solid silver;border-radius:8px;padding:16px}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}div#filters{grid-area:filters}div#list{grid-area:list}div#editor{grid-area:editor}div#container{display:grid;grid-template-rows:auto 1fr auto;grid-template-columns:1fr;grid-template-areas:\"filters\" \"list\" \"editor\";gap:8px}@media only screen and (max-width: 959px){.noif-lt-md{display:none}}@media only screen and (min-width: 1920px){div#container{grid-template-rows:auto 1fr;grid-template-columns:1fr auto;grid-template-areas:\"filters filters\" \"list editor\"}}\n"] }]
|
|
878
|
-
}], ctorParameters: () => [{ type: UserListRepository }, { type: DialogService }, { type: i2$
|
|
902
|
+
args: [{ selector: 'auth-jwt-user-list', template: "<div id=\"container\">\n <div>\n <!-- filters -->\n <div id=\"filters\">\n <auth-jwt-user-filter\n [filter]=\"filter$ | async\"\n (filterChange)=\"onFilterChange($event)\"\n ></auth-jwt-user-filter>\n </div>\n\n <!-- list -->\n <div id=\"list\" *ngIf=\"page$ | async as page\">\n <div *ngIf=\"loading$ | async\">\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n <table>\n <thead>\n <td></td>\n <td></td>\n <th i18n=\"auth-jwt-admin\">name</th>\n <th i18n=\"auth-jwt-admin\" class=\"noif-lt-md\">first</th>\n <th i18n=\"auth-jwt-admin\" class=\"noif-lt-md\">last</th>\n <th i18n=\"auth-jwt-admin\" class=\"noif-lt-md\">email</th>\n <th i18n=\"auth-jwt-admin\">roles</th>\n <th i18n=\"auth-jwt-admin\" class=\"noif-lt-md\">lock end</th>\n </thead>\n <tbody>\n <tr *ngFor=\"let user of page.items\">\n <td class=\"fit-width\">\n <button\n mat-icon-button\n type=\"button\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Edit this user\"\n color=\"primary\"\n (click)=\"setActiveUser(user)\"\n >\n <mat-icon>mode_edit</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n i18n-matTooltip=\"auth-jwt-admin\"\n matTooltip=\"Delete this user\"\n color=\"warn\"\n (click)=\"deleteUser(user)\"\n >\n <mat-icon>remove_circle</mat-icon>\n </button>\n </td>\n <td class=\"fit-width\">\n <img\n alt=\"avatar\"\n [src]=\"getGravatarUrl(user.email, 32)\"\n [alt]=\"user.userName\"\n />\n </td>\n <td>{{ user.userName }}</td>\n <td class=\"noif-lt-md\">{{ user.firstName }}</td>\n <td class=\"noif-lt-md\">{{ user.lastName }}</td>\n <td class=\"noif-lt-md\">\n <a [href]=\"'mailto:' + user.email\">{{ user.email }}</a>\n </td>\n <td>{{ user.roles.join(\" \") }}</td>\n <td class=\"noif-lt-md\">{{ user.lockoutEnd }}</td>\n </tr>\n </tbody>\n </table>\n\n <!-- paginator -->\n <div class=\"form-row\">\n <button\n type=\"button\"\n mat-icon-button\n color=\"warn\"\n i18n-matmatTooltip=\"auth-jwt-admin\"\n matTooltip=\"Refresh list\"\n (click)=\"reset()\"\n >\n <mat-icon>autorenew</mat-icon>\n </button>\n\n <mat-paginator\n [length]=\"page.total\"\n [pageIndex]=\"page.pageNumber - 1\"\n [pageSize]=\"page.pageSize\"\n [pageSizeOptions]=\"[5, 10, 20, 50, 100]\"\n (page)=\"onPageChange($event)\"\n [showFirstLastButtons]=\"true\"\n ></mat-paginator>\n </div>\n </div>\n </div>\n\n <!-- editor -->\n <mat-expansion-panel\n id=\"editor\"\n [expanded]=\"active$ | async\"\n [disabled]=\"!(active$ | async)\"\n >\n <div *ngIf=\"active$ | async as active\">\n <fieldset>\n <legend>{{ active.userName }}</legend>\n <auth-jwt-user-editor\n [user]=\"active\"\n (userChange)=\"saveActiveUser($event)\"\n (editorClose)=\"resetActiveUser()\"\n ></auth-jwt-user-editor>\n </fieldset>\n </div>\n </mat-expansion-panel>\n</div>\n", styles: ["tr:nth-child(odd){background-color:#f8f8f8}th{padding:0 8px;text-align:left;color:silver;font-weight:400}td{padding:0 8px}td.fit-width{width:1px;white-space:nowrap}table{width:100%;border-collapse:collapse}fieldset{border:1px solid silver;border-radius:8px;padding:16px}.form-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.form-row *{flex:0 0 auto}div#filters{grid-area:filters}div#list{grid-area:list}div#editor{grid-area:editor}div#container{display:grid;grid-template-rows:auto 1fr auto;grid-template-columns:1fr;grid-template-areas:\"filters\" \"list\" \"editor\";gap:8px}@media only screen and (max-width: 959px){.noif-lt-md{display:none}}@media only screen and (min-width: 1920px){div#container{grid-template-rows:auto 1fr;grid-template-columns:1fr auto;grid-template-areas:\"filters filters\" \"list editor\"}}\n"] }]
|
|
903
|
+
}], ctorParameters: () => [{ type: UserListRepository }, { type: DialogService }, { type: i2$2.GravatarService }] });
|
|
879
904
|
|
|
880
905
|
class AuthJwtAdminModule {
|
|
881
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
882
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
|
906
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: AuthJwtAdminModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
907
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.8", ngImport: i0, type: AuthJwtAdminModule, declarations: [AuthJwtRegistrationComponent,
|
|
883
908
|
PasswordStrengthBarComponent,
|
|
884
909
|
UserFilterComponent,
|
|
885
910
|
UserListComponent,
|
|
@@ -907,7 +932,7 @@ class AuthJwtAdminModule {
|
|
|
907
932
|
PasswordStrengthBarComponent,
|
|
908
933
|
UserFilterComponent,
|
|
909
934
|
UserListComponent] }); }
|
|
910
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
|
935
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: AuthJwtAdminModule, imports: [CommonModule,
|
|
911
936
|
HttpClientModule,
|
|
912
937
|
FormsModule,
|
|
913
938
|
RouterModule,
|
|
@@ -928,7 +953,7 @@ class AuthJwtAdminModule {
|
|
|
928
953
|
AuthJwtLoginModule,
|
|
929
954
|
NgToolsModule] }); }
|
|
930
955
|
}
|
|
931
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
956
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: AuthJwtAdminModule, decorators: [{
|
|
932
957
|
type: NgModule,
|
|
933
958
|
args: [{
|
|
934
959
|
declarations: [
|