spiderly 19.4.0-preview.0 → 19.5.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/fesm2022/spiderly.mjs +690 -991
- package/fesm2022/spiderly.mjs.map +1 -1
- package/lib/components/auth/login/login.component.d.ts +3 -3
- package/lib/components/auth/partials/auth.component.d.ts +3 -4
- package/lib/components/auth/partials/login-verification.component.d.ts +2 -2
- package/lib/components/footer/footer.component.d.ts +2 -2
- package/lib/components/layout/layout.component.d.ts +3 -3
- package/lib/components/layout/profile-avatar/profile-avatar.component.d.ts +6 -6
- package/lib/components/layout/sidebar/menuitem.component.d.ts +5 -5
- package/lib/components/layout/sidebar/sidebar-menu.component.d.ts +5 -5
- package/lib/components/layout/sidemenu-topbar/sidemenu-topbar.component.d.ts +4 -4
- package/lib/components/layout/topbar/topbar.component.d.ts +3 -3
- package/lib/components/not-found/not-found.component.d.ts +2 -2
- package/lib/entities/security-entities.d.ts +6 -184
- package/lib/guards/auth.guard.d.ts +3 -3
- package/lib/guards/not-auth.guard.d.ts +2 -2
- package/lib/handlers/spiderly-error-handler.d.ts +2 -2
- package/lib/services/api.service.security.d.ts +5 -18
- package/lib/services/app-initializer.d.ts +2 -2
- package/lib/services/{app-layout-base.service.d.ts → app-layout.service.base.d.ts} +8 -8
- package/lib/services/{auth-base.service.d.ts → auth.service.base.d.ts} +6 -6
- package/lib/services/{config-base.service.d.ts → config.service.base.d.ts} +3 -4
- package/lib/services/spiderly-transloco-loader.d.ts +2 -2
- package/package.json +1 -1
- package/public-api.d.ts +3 -4
- package/lib/components/base-details/role-base-details.component.d.ts +0 -43
package/fesm2022/spiderly.mjs
CHANGED
|
@@ -30,7 +30,7 @@ import * as i1$1 from 'primeng/button';
|
|
|
30
30
|
import { ButtonModule } from 'primeng/button';
|
|
31
31
|
import * as i1$5 from 'primeng/splitbutton';
|
|
32
32
|
import { SplitButtonModule } from 'primeng/splitbutton';
|
|
33
|
-
import { Subject, throttleTime, map, BehaviorSubject, of, firstValueFrom,
|
|
33
|
+
import { Subject, throttleTime, map, BehaviorSubject, of, firstValueFrom, delay as delay$1, withLatestFrom, combineLatest, filter as filter$1, finalize as finalize$1, tap as tap$1 } from 'rxjs';
|
|
34
34
|
import * as i3$2 from '@angular/router';
|
|
35
35
|
import { RouterModule, NavigationEnd } from '@angular/router';
|
|
36
36
|
import * as FileSaver from 'file-saver';
|
|
@@ -45,14 +45,14 @@ import * as i4$7 from 'primeng/password';
|
|
|
45
45
|
import { PasswordModule } from 'primeng/password';
|
|
46
46
|
import * as i4$8 from 'primeng/textarea';
|
|
47
47
|
import { TextareaModule } from 'primeng/textarea';
|
|
48
|
-
import * as i1$3 from '
|
|
48
|
+
import * as i1$3 from '@angular/common/http';
|
|
49
|
+
import { HttpParams, HttpHeaders, HttpErrorResponse, HttpResponse } from '@angular/common/http';
|
|
50
|
+
import * as i1$4 from 'primeng/skeleton';
|
|
49
51
|
import { SkeletonModule } from 'primeng/skeleton';
|
|
50
52
|
import * as i2$1 from 'primeng/menu';
|
|
51
53
|
import { MenuModule } from 'primeng/menu';
|
|
52
54
|
import * as i4$9 from 'primeng/panel';
|
|
53
55
|
import { PanelModule } from 'primeng/panel';
|
|
54
|
-
import * as i1$4 from '@angular/common/http';
|
|
55
|
-
import { HttpParams, HttpHeaders, HttpErrorResponse, HttpResponse } from '@angular/common/http';
|
|
56
56
|
import { map as map$1, finalize, delay, tap, filter, catchError } from 'rxjs/operators';
|
|
57
57
|
import * as i3$4 from '@abacritt/angularx-social-login';
|
|
58
58
|
import * as i9 from 'primeng/table';
|
|
@@ -1307,372 +1307,553 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
1307
1307
|
}]
|
|
1308
1308
|
}] });
|
|
1309
1309
|
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
}
|
|
1315
|
-
static { this.typeName = 'IsAuthorizedForSaveEvent'; }
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
class Namebook extends BaseEntity {
|
|
1319
|
-
constructor({ id, displayName, } = {}) {
|
|
1320
|
-
super();
|
|
1321
|
-
this.id = id;
|
|
1322
|
-
this.displayName = displayName;
|
|
1310
|
+
// When we call it, inside the console, it will show SpiderlyError: ...
|
|
1311
|
+
class SpiderlyError extends Error {
|
|
1312
|
+
constructor(message) {
|
|
1313
|
+
super(message);
|
|
1323
1314
|
}
|
|
1324
|
-
static { this.schema = {
|
|
1325
|
-
id: {
|
|
1326
|
-
type: 'any',
|
|
1327
|
-
},
|
|
1328
|
-
displayName: {
|
|
1329
|
-
type: 'string',
|
|
1330
|
-
},
|
|
1331
|
-
}; }
|
|
1332
|
-
static { this.typeName = 'Namebook'; }
|
|
1333
1315
|
}
|
|
1334
1316
|
|
|
1335
|
-
class
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
this.
|
|
1340
|
-
this.email = email;
|
|
1341
|
-
}
|
|
1342
|
-
static { this.schema = {
|
|
1343
|
-
id: {
|
|
1344
|
-
type: 'number',
|
|
1345
|
-
},
|
|
1346
|
-
email: {
|
|
1347
|
-
type: 'string',
|
|
1348
|
-
},
|
|
1349
|
-
}; }
|
|
1350
|
-
}
|
|
1351
|
-
class RolePermission extends BaseEntity {
|
|
1352
|
-
static { this.typeName = 'RolePermission'; }
|
|
1353
|
-
constructor({ roleDisplayName, roleId, permissionDisplayName, permissionId } = {}) {
|
|
1354
|
-
super();
|
|
1355
|
-
this.roleDisplayName = roleDisplayName;
|
|
1356
|
-
this.roleId = roleId;
|
|
1357
|
-
this.permissionDisplayName = permissionDisplayName;
|
|
1358
|
-
this.permissionId = permissionId;
|
|
1359
|
-
}
|
|
1360
|
-
static { this.schema = {
|
|
1361
|
-
roleDisplayName: {
|
|
1362
|
-
type: 'string',
|
|
1363
|
-
},
|
|
1364
|
-
roleId: {
|
|
1365
|
-
type: 'number',
|
|
1366
|
-
},
|
|
1367
|
-
permissionDisplayName: {
|
|
1368
|
-
type: 'string',
|
|
1369
|
-
},
|
|
1370
|
-
permissionId: {
|
|
1371
|
-
type: 'number',
|
|
1372
|
-
},
|
|
1373
|
-
}; }
|
|
1374
|
-
}
|
|
1375
|
-
class RolePermissionSaveBody extends BaseEntity {
|
|
1376
|
-
static { this.typeName = 'RolePermissionSaveBody'; }
|
|
1377
|
-
constructor({ rolePermissionDTO } = {}) {
|
|
1378
|
-
super();
|
|
1379
|
-
this.rolePermissionDTO = rolePermissionDTO;
|
|
1380
|
-
}
|
|
1381
|
-
static { this.schema = {
|
|
1382
|
-
rolePermissionDTO: {
|
|
1383
|
-
type: 'RolePermission',
|
|
1384
|
-
get nestedConstructor() { return RolePermission; },
|
|
1385
|
-
},
|
|
1386
|
-
}; }
|
|
1387
|
-
}
|
|
1388
|
-
class AuthResult extends BaseEntity {
|
|
1389
|
-
static { this.typeName = 'AuthResult'; }
|
|
1390
|
-
constructor({ userId, email, accessToken, refreshToken } = {}) {
|
|
1391
|
-
super();
|
|
1392
|
-
this.userId = userId;
|
|
1393
|
-
this.email = email;
|
|
1394
|
-
this.accessToken = accessToken;
|
|
1395
|
-
this.refreshToken = refreshToken;
|
|
1396
|
-
}
|
|
1397
|
-
static { this.schema = {
|
|
1398
|
-
userId: {
|
|
1399
|
-
type: 'number',
|
|
1400
|
-
},
|
|
1401
|
-
email: {
|
|
1402
|
-
type: 'string',
|
|
1403
|
-
},
|
|
1404
|
-
accessToken: {
|
|
1405
|
-
type: 'string',
|
|
1406
|
-
},
|
|
1407
|
-
refreshToken: {
|
|
1408
|
-
type: 'string',
|
|
1409
|
-
},
|
|
1410
|
-
}; }
|
|
1411
|
-
}
|
|
1412
|
-
class VerificationTokenRequest extends BaseEntity {
|
|
1413
|
-
static { this.typeName = 'VerificationTokenRequest'; }
|
|
1414
|
-
constructor({ verificationCode, browserId, email } = {}) {
|
|
1415
|
-
super();
|
|
1416
|
-
this.verificationCode = verificationCode;
|
|
1417
|
-
this.browserId = browserId;
|
|
1418
|
-
this.email = email;
|
|
1419
|
-
}
|
|
1420
|
-
static { this.schema = {
|
|
1421
|
-
verificationCode: {
|
|
1422
|
-
type: 'string',
|
|
1423
|
-
},
|
|
1424
|
-
browserId: {
|
|
1425
|
-
type: 'string',
|
|
1426
|
-
},
|
|
1427
|
-
email: {
|
|
1428
|
-
type: 'string',
|
|
1429
|
-
},
|
|
1430
|
-
}; }
|
|
1431
|
-
}
|
|
1432
|
-
class ExternalProvider extends BaseEntity {
|
|
1433
|
-
static { this.typeName = 'ExternalProvider'; }
|
|
1434
|
-
constructor({ idToken, browserId } = {}) {
|
|
1435
|
-
super();
|
|
1436
|
-
this.idToken = idToken;
|
|
1437
|
-
this.browserId = browserId;
|
|
1317
|
+
class SpiderlyMessageService {
|
|
1318
|
+
constructor(messageService, translocoService, ngZone) {
|
|
1319
|
+
this.messageService = messageService;
|
|
1320
|
+
this.translocoService = translocoService;
|
|
1321
|
+
this.ngZone = ngZone;
|
|
1438
1322
|
}
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
}
|
|
1446
|
-
}; }
|
|
1447
|
-
}
|
|
1448
|
-
class UserRole extends BaseEntity {
|
|
1449
|
-
static { this.typeName = 'UserRole'; }
|
|
1450
|
-
constructor({ roleId, userId } = {}) {
|
|
1451
|
-
super();
|
|
1452
|
-
this.roleId = roleId;
|
|
1453
|
-
this.userId = userId;
|
|
1323
|
+
successMessage(detail, title = this.translocoService.translate('SuccessfulAction')) {
|
|
1324
|
+
this.messageService.add({
|
|
1325
|
+
severity: 'success',
|
|
1326
|
+
summary: title,
|
|
1327
|
+
detail: detail,
|
|
1328
|
+
life: 10000,
|
|
1329
|
+
});
|
|
1454
1330
|
}
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
}
|
|
1464
|
-
class UserRoleSaveBody extends BaseEntity {
|
|
1465
|
-
static { this.typeName = 'UserRoleSaveBody'; }
|
|
1466
|
-
constructor({ userRoleDTO } = {}) {
|
|
1467
|
-
super();
|
|
1468
|
-
this.userRoleDTO = userRoleDTO;
|
|
1331
|
+
warningMessage(detail, title, sticky) {
|
|
1332
|
+
this.messageService.add({
|
|
1333
|
+
severity: 'warn',
|
|
1334
|
+
summary: title ?? this.translocoService.translate('Warning'),
|
|
1335
|
+
detail: detail,
|
|
1336
|
+
life: 10000,
|
|
1337
|
+
sticky: sticky
|
|
1338
|
+
});
|
|
1469
1339
|
}
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
}
|
|
1477
|
-
class LoginVerificationToken extends BaseEntity {
|
|
1478
|
-
static { this.typeName = 'LoginVerificationToken'; }
|
|
1479
|
-
constructor({ email, userId, browserId, expireAt } = {}) {
|
|
1480
|
-
super();
|
|
1481
|
-
this.email = email;
|
|
1482
|
-
this.userId = userId;
|
|
1483
|
-
this.browserId = browserId;
|
|
1484
|
-
this.expireAt = expireAt;
|
|
1340
|
+
errorMessage(detail, title = this.translocoService.translate('Error')) {
|
|
1341
|
+
this.messageService.add({
|
|
1342
|
+
severity: 'error',
|
|
1343
|
+
summary: title,
|
|
1344
|
+
detail: detail,
|
|
1345
|
+
life: 10000,
|
|
1346
|
+
});
|
|
1485
1347
|
}
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
type: 'string',
|
|
1495
|
-
},
|
|
1496
|
-
expireAt: {
|
|
1497
|
-
type: 'Date',
|
|
1498
|
-
},
|
|
1499
|
-
}; }
|
|
1500
|
-
}
|
|
1501
|
-
class Login extends BaseEntity {
|
|
1502
|
-
static { this.typeName = 'Login'; }
|
|
1503
|
-
constructor({ email, browserId } = {}) {
|
|
1504
|
-
super();
|
|
1505
|
-
this.email = email;
|
|
1506
|
-
this.browserId = browserId;
|
|
1348
|
+
infoMessage(detail, title, sticky) {
|
|
1349
|
+
this.messageService.add({
|
|
1350
|
+
severity: 'info',
|
|
1351
|
+
summary: title ?? this.translocoService.translate('Info'),
|
|
1352
|
+
detail: detail,
|
|
1353
|
+
life: 10000,
|
|
1354
|
+
sticky: sticky,
|
|
1355
|
+
});
|
|
1507
1356
|
}
|
|
1508
|
-
static { this
|
|
1509
|
-
|
|
1510
|
-
type: 'string',
|
|
1511
|
-
},
|
|
1512
|
-
browserId: {
|
|
1513
|
-
type: 'string',
|
|
1514
|
-
},
|
|
1515
|
-
}; }
|
|
1357
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyMessageService, deps: [{ token: i1$2.MessageService }, { token: i1.TranslocoService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1358
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyMessageService, providedIn: 'root' }); }
|
|
1516
1359
|
}
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1360
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyMessageService, decorators: [{
|
|
1361
|
+
type: Injectable,
|
|
1362
|
+
args: [{
|
|
1363
|
+
providedIn: 'root',
|
|
1364
|
+
}]
|
|
1365
|
+
}], ctorParameters: () => [{ type: i1$2.MessageService }, { type: i1.TranslocoService }, { type: i0.NgZone }] });
|
|
1366
|
+
|
|
1367
|
+
class TranslateLabelsAbstractService {
|
|
1368
|
+
constructor() {
|
|
1523
1369
|
}
|
|
1524
|
-
static { this
|
|
1525
|
-
|
|
1526
|
-
type: 'string',
|
|
1527
|
-
},
|
|
1528
|
-
browserId: {
|
|
1529
|
-
type: 'string',
|
|
1530
|
-
},
|
|
1531
|
-
}; }
|
|
1370
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: TranslateLabelsAbstractService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1371
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: TranslateLabelsAbstractService, providedIn: 'root' }); }
|
|
1532
1372
|
}
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
this.
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: TranslateLabelsAbstractService, decorators: [{
|
|
1374
|
+
type: Injectable,
|
|
1375
|
+
args: [{
|
|
1376
|
+
providedIn: 'root',
|
|
1377
|
+
}]
|
|
1378
|
+
}], ctorParameters: () => [] });
|
|
1379
|
+
|
|
1380
|
+
class BaseFormService {
|
|
1381
|
+
constructor(translateLabelsService, validatorService, messageService, translocoService) {
|
|
1382
|
+
this.translateLabelsService = translateLabelsService;
|
|
1383
|
+
this.validatorService = validatorService;
|
|
1384
|
+
this.messageService = messageService;
|
|
1385
|
+
this.translocoService = translocoService;
|
|
1386
|
+
this.initFormGroup = (formGroup, targetClass, initialValues, updateOnChangeControls) => {
|
|
1387
|
+
if (!formGroup)
|
|
1388
|
+
throw new SpiderlyError('You need to instantiate the form group.');
|
|
1389
|
+
if (!targetClass)
|
|
1390
|
+
throw new SpiderlyError('You need to pass targetClass.');
|
|
1391
|
+
if (!initialValues)
|
|
1392
|
+
initialValues = {};
|
|
1393
|
+
Object.keys(targetClass.schema).forEach((formControlName) => {
|
|
1394
|
+
const propSchema = targetClass.schema[formControlName];
|
|
1395
|
+
let propInitialValue = initialValues[formControlName];
|
|
1396
|
+
const existingControl = formGroup.get(formControlName);
|
|
1397
|
+
if (propSchema.type.endsWith('[]') &&
|
|
1398
|
+
propSchema.nestedConstructor &&
|
|
1399
|
+
propSchema.type !== 'Namebook[]') {
|
|
1400
|
+
if (existingControl instanceof SpiderlyFormArray) {
|
|
1401
|
+
this.initFormArray(existingControl, propSchema.nestedConstructor, propInitialValue);
|
|
1402
|
+
}
|
|
1403
|
+
else {
|
|
1404
|
+
const control = new SpiderlyFormArray([], this.translocoService, this);
|
|
1405
|
+
this.initFormArray(control, propSchema.nestedConstructor, propInitialValue);
|
|
1406
|
+
control.label = formControlName;
|
|
1407
|
+
control.labelForDisplay = this.getTranslatedLabel(formControlName);
|
|
1408
|
+
formGroup.setControl(formControlName, control);
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
else if (propSchema.nestedConstructor &&
|
|
1412
|
+
propSchema.type !== 'Namebook[]') {
|
|
1413
|
+
if (existingControl instanceof SpiderlyFormGroup) {
|
|
1414
|
+
this.initFormGroup(existingControl, propSchema.nestedConstructor, propInitialValue);
|
|
1415
|
+
}
|
|
1416
|
+
else {
|
|
1417
|
+
const control = new SpiderlyFormGroup({});
|
|
1418
|
+
this.initFormGroup(control, propSchema.nestedConstructor, propInitialValue);
|
|
1419
|
+
formGroup.setControl(formControlName, control);
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
else {
|
|
1423
|
+
// HACK: Because on the backend id type is not nullable on generated DTOs, we need to do this, it's ugly hack and we should make it better.
|
|
1424
|
+
if (formControlName === 'id' && !propInitialValue) {
|
|
1425
|
+
propInitialValue = 0;
|
|
1426
|
+
}
|
|
1427
|
+
if (existingControl instanceof SpiderlyFormControl) {
|
|
1428
|
+
existingControl.setValue(propInitialValue);
|
|
1429
|
+
}
|
|
1430
|
+
else {
|
|
1431
|
+
let control;
|
|
1432
|
+
if (updateOnChangeControls?.includes(formControlName) ||
|
|
1433
|
+
(formControlName.endsWith('Id') && formControlName.length > 2) ||
|
|
1434
|
+
propSchema.type === 'Date' ||
|
|
1435
|
+
propSchema.type === 'Namebook[]') {
|
|
1436
|
+
control = new SpiderlyFormControl(propInitialValue, { updateOn: 'change' });
|
|
1437
|
+
}
|
|
1438
|
+
else {
|
|
1439
|
+
control = new SpiderlyFormControl(propInitialValue, { updateOn: 'blur' });
|
|
1440
|
+
}
|
|
1441
|
+
control.label = formControlName;
|
|
1442
|
+
control.labelForDisplay = this.getTranslatedLabel(formControlName);
|
|
1443
|
+
control.parentClassName = targetClass.typeName;
|
|
1444
|
+
this.validatorService.setValidator(control, targetClass.typeName);
|
|
1445
|
+
formGroup.setControl(formControlName, control);
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
});
|
|
1449
|
+
formGroup.targetClass = targetClass;
|
|
1450
|
+
return formGroup;
|
|
1451
|
+
};
|
|
1452
|
+
//#region Helpers
|
|
1453
|
+
this.showInvalidFieldsMessage = () => {
|
|
1454
|
+
this.messageService.warningMessage(this.translocoService.translate('YouHaveSomeInvalidFieldsDescription'), this.translocoService.translate('YouHaveSomeInvalidFieldsTitle'));
|
|
1455
|
+
};
|
|
1456
|
+
this.getSaveBodyMainDTOKey = (saveBodyClass) => {
|
|
1457
|
+
const schema = saveBodyClass.schema;
|
|
1458
|
+
return Object.keys(schema).find(k => schema[k].isSaveBodyMainDTO === true);
|
|
1459
|
+
};
|
|
1460
|
+
this.mapMainUIFormToSaveBody = (mainUIFormClass, mainUIFormValues) => {
|
|
1461
|
+
let saveBody = {};
|
|
1462
|
+
Object.keys(mainUIFormClass.schema).forEach(propName => {
|
|
1463
|
+
const property = mainUIFormClass.schema[propName];
|
|
1464
|
+
const value = mainUIFormValues[propName];
|
|
1465
|
+
// Handle ordered one-to-many (e.g., "orderedItemsMainUIFormDTO" -> "orderedItemsSaveBodyDTO")
|
|
1466
|
+
if (propName.startsWith('ordered') && propName.endsWith('MainUIFormDTO')) {
|
|
1467
|
+
const newKey = propName.replace('MainUIFormDTO', 'SaveBodyDTO');
|
|
1468
|
+
// Recursively map nested DTOs
|
|
1469
|
+
const relatedEntity = property.nestedConstructor;
|
|
1470
|
+
saveBody[newKey] = value?.map(item => this.mapMainUIFormToSaveBody(relatedEntity, item)) ?? [];
|
|
1471
|
+
}
|
|
1472
|
+
// Handle multi-select (e.g., "itemsIds" -> "selectedItemsIds")
|
|
1473
|
+
else if (propName.endsWith('Ids')) {
|
|
1474
|
+
saveBody[`selected${capitalizeFirstChar(propName)}`] = value ?? [];
|
|
1475
|
+
}
|
|
1476
|
+
// Handle multi-autocomplete (e.g., "itemsNamebookDTOList" -> "selectedItemsIds")
|
|
1477
|
+
else if (propName.endsWith('NamebookDTOList')) {
|
|
1478
|
+
saveBody[`selected${capitalizeFirstChar(propName)}`] = value ?? [];
|
|
1479
|
+
}
|
|
1480
|
+
// Handle the main DTO object (e.g., "entityDTO")
|
|
1481
|
+
else {
|
|
1482
|
+
saveBody[propName] = value;
|
|
1483
|
+
}
|
|
1484
|
+
});
|
|
1485
|
+
return saveBody;
|
|
1486
|
+
};
|
|
1487
|
+
}
|
|
1488
|
+
getTranslatedLabel(formControlName) {
|
|
1489
|
+
if (formControlName.endsWith('Id') && formControlName.length > 2) {
|
|
1490
|
+
formControlName = formControlName.substring(0, formControlName.length - 2);
|
|
1491
|
+
}
|
|
1492
|
+
else if (formControlName.endsWith('DisplayName')) {
|
|
1493
|
+
formControlName = formControlName.replace('DisplayName', '');
|
|
1494
|
+
}
|
|
1495
|
+
return this.translateLabelsService.translate(formControlName);
|
|
1496
|
+
}
|
|
1497
|
+
addNewFormGroupToFormArray(formArray, targetClass, initialValues, index) {
|
|
1498
|
+
let helperFormGroup = new SpiderlyFormGroup({});
|
|
1499
|
+
this.initFormGroup(helperFormGroup, targetClass, initialValues);
|
|
1500
|
+
if (index == null) {
|
|
1501
|
+
formArray.push(helperFormGroup);
|
|
1502
|
+
}
|
|
1503
|
+
else {
|
|
1504
|
+
formArray.insert(index, helperFormGroup);
|
|
1505
|
+
}
|
|
1506
|
+
return helperFormGroup;
|
|
1507
|
+
}
|
|
1508
|
+
removeFormControlFromTheFormArray(formArray, index) {
|
|
1509
|
+
if (index == null)
|
|
1510
|
+
throw new SpiderlyError('Can not pass null index.');
|
|
1511
|
+
formArray.removeAt(index);
|
|
1512
|
+
}
|
|
1513
|
+
initFormArray(formArray, targetClass, initialValues = []) {
|
|
1514
|
+
if (!formArray)
|
|
1515
|
+
throw new SpiderlyError('You must pass a FormArray instance to be initialized or updated.');
|
|
1516
|
+
if (!targetClass)
|
|
1517
|
+
throw new SpiderlyError('You did not initialize targetClass');
|
|
1518
|
+
formArray.formGroupInitialValues = {}; // When we need we can pass formGroupInitialValues to this method instead of assigning it to empty object
|
|
1519
|
+
formArray.targetClass = targetClass;
|
|
1520
|
+
initialValues.forEach((model, index) => {
|
|
1521
|
+
const existingControl = formArray.at(index);
|
|
1522
|
+
if (existingControl instanceof SpiderlyFormGroup) {
|
|
1523
|
+
this.initFormGroup(existingControl, targetClass, model);
|
|
1524
|
+
}
|
|
1525
|
+
else {
|
|
1526
|
+
let helperFormGroup = new SpiderlyFormGroup({});
|
|
1527
|
+
this.initFormGroup(helperFormGroup, targetClass, model);
|
|
1528
|
+
formArray.push(helperFormGroup);
|
|
1529
|
+
}
|
|
1530
|
+
});
|
|
1531
|
+
return formArray;
|
|
1532
|
+
}
|
|
1533
|
+
generateNewNegativeId(formArray) {
|
|
1534
|
+
return -formArray.getRawValue().filter(x => x.id < 0).length - 1;
|
|
1535
|
+
}
|
|
1536
|
+
isControlValid(control, controlNamesFromHtml) {
|
|
1537
|
+
let invalid = false;
|
|
1538
|
+
if (control instanceof SpiderlyFormControl) {
|
|
1539
|
+
if (control.invalid &&
|
|
1540
|
+
(controlNamesFromHtml == null || controlNamesFromHtml?.includes(control.label))) {
|
|
1541
|
+
control.markAsDirty();
|
|
1542
|
+
invalid = true;
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
else if (control instanceof SpiderlyFormGroup) {
|
|
1546
|
+
Object.keys(control.controls).forEach(key => {
|
|
1547
|
+
const nestedControl = control.controls[key];
|
|
1548
|
+
if (!this.isControlValid(nestedControl, control.controlNamesFromHtml)) {
|
|
1549
|
+
invalid = true;
|
|
1550
|
+
}
|
|
1551
|
+
});
|
|
1552
|
+
}
|
|
1553
|
+
else if (control instanceof SpiderlyFormArray) {
|
|
1554
|
+
control.controls.forEach((nestedControl) => {
|
|
1555
|
+
if (!this.isControlValid(nestedControl)) {
|
|
1556
|
+
invalid = true;
|
|
1557
|
+
}
|
|
1558
|
+
});
|
|
1559
|
+
}
|
|
1560
|
+
if (invalid) {
|
|
1561
|
+
return false;
|
|
1562
|
+
}
|
|
1563
|
+
return true;
|
|
1564
|
+
}
|
|
1565
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: BaseFormService, deps: [{ token: TranslateLabelsAbstractService }, { token: ValidatorAbstractService }, { token: SpiderlyMessageService }, { token: i1.TranslocoService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1566
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: BaseFormService, providedIn: 'root' }); }
|
|
1567
|
+
}
|
|
1568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: BaseFormService, decorators: [{
|
|
1569
|
+
type: Injectable,
|
|
1570
|
+
args: [{
|
|
1571
|
+
providedIn: 'root',
|
|
1572
|
+
}]
|
|
1573
|
+
}], ctorParameters: () => [{ type: TranslateLabelsAbstractService }, { type: ValidatorAbstractService }, { type: SpiderlyMessageService }, { type: i1.TranslocoService }] });
|
|
1574
|
+
|
|
1575
|
+
class BaseFormCopy {
|
|
1576
|
+
constructor(differs, http, messageService, changeDetectorRef, router, route, translocoService, baseFormService) {
|
|
1577
|
+
this.differs = differs;
|
|
1578
|
+
this.http = http;
|
|
1579
|
+
this.messageService = messageService;
|
|
1580
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
1581
|
+
this.router = router;
|
|
1582
|
+
this.route = route;
|
|
1583
|
+
this.translocoService = translocoService;
|
|
1584
|
+
this.baseFormService = baseFormService;
|
|
1585
|
+
this.parentFormGroup = new SpiderlyFormGroup({});
|
|
1586
|
+
this.successfulSaveToastDescription = this.translocoService.translate('SuccessfulSaveToastDescription');
|
|
1587
|
+
//#region Model
|
|
1588
|
+
// onSave method is here only because of the hooks, we should move everything except them to the BaseFromService
|
|
1589
|
+
this.onSave = (reroute = true) => {
|
|
1590
|
+
if (!this.saveBodyClass)
|
|
1591
|
+
throw new SpiderlyError('You did not initialize saveBodyClass');
|
|
1592
|
+
if (!this.mainUIFormClass)
|
|
1593
|
+
throw new SpiderlyError('You did not initialize mainUIFormClass');
|
|
1594
|
+
this.saveBody = this.parentFormGroup.initSaveBody();
|
|
1595
|
+
this.onBeforeSave(this.saveBody);
|
|
1596
|
+
this.saveBody = this.saveBody ?? this.parentFormGroup.getRawValue();
|
|
1597
|
+
const isValid = this.baseFormService.isControlValid(this.parentFormGroup);
|
|
1598
|
+
if (isValid) {
|
|
1599
|
+
this.parentFormGroup.saveObservableMethod(this.saveBody).subscribe(res => {
|
|
1600
|
+
this.messageService.successMessage(this.successfulSaveToastDescription);
|
|
1601
|
+
this.baseFormService.initFormGroup(this.parentFormGroup, this.mainUIFormClass, res);
|
|
1602
|
+
if (reroute) {
|
|
1603
|
+
const saveBodyMainDTOKey = this.baseFormService.getSaveBodyMainDTOKey(this.saveBodyClass);
|
|
1604
|
+
const savedObjectId = res[saveBodyMainDTOKey]?.id;
|
|
1605
|
+
this.rerouteToSavedObject(savedObjectId); // You always need to have id, because of id == 0 and version change
|
|
1606
|
+
}
|
|
1607
|
+
this.onAfterSave();
|
|
1608
|
+
});
|
|
1609
|
+
this.onAfterSaveRequest();
|
|
1610
|
+
}
|
|
1611
|
+
else {
|
|
1612
|
+
this.baseFormService.showInvalidFieldsMessage();
|
|
1613
|
+
}
|
|
1614
|
+
};
|
|
1615
|
+
this.rerouteToSavedObject = (rerouteId) => {
|
|
1616
|
+
if (rerouteId == null) {
|
|
1617
|
+
const currentUrl = this.router.url;
|
|
1618
|
+
const parentUrl = getParentUrl(currentUrl);
|
|
1619
|
+
this.router.navigateByUrl(parentUrl);
|
|
1620
|
+
return;
|
|
1621
|
+
}
|
|
1622
|
+
const segments = this.router.url.split('/');
|
|
1623
|
+
segments[segments.length - 1] = rerouteId.toString();
|
|
1624
|
+
const newUrl = segments.join('/');
|
|
1625
|
+
this.router.navigateByUrl(newUrl);
|
|
1626
|
+
};
|
|
1627
|
+
this.onBeforeSave = (saveBody) => { };
|
|
1628
|
+
this.onAfterSave = () => { };
|
|
1629
|
+
this.onAfterSaveRequest = () => { };
|
|
1630
|
+
}
|
|
1631
|
+
ngOnInit() {
|
|
1632
|
+
}
|
|
1633
|
+
//#endregion
|
|
1634
|
+
//#region Model List
|
|
1635
|
+
getFormArrayControlByIndex(formControlName, formArray, index, filter) {
|
|
1636
|
+
// if(formArray.controlNamesFromHtml.findIndex(x => x === formControlName) === -1)
|
|
1637
|
+
// formArray.controlNamesFromHtml.push(formControlName);
|
|
1638
|
+
let filteredFormGroups;
|
|
1639
|
+
if (filter) {
|
|
1640
|
+
filteredFormGroups = filter(formArray.controls);
|
|
1641
|
+
}
|
|
1642
|
+
else {
|
|
1643
|
+
return formArray.controls[index].controls[formControlName];
|
|
1644
|
+
}
|
|
1645
|
+
return filteredFormGroups[index]?.controls[formControlName]; // FT: Don't change this. It's always possible that change detection occurs before something.
|
|
1646
|
+
}
|
|
1647
|
+
getFormArrayControls(formControlName, formArray, filter) {
|
|
1648
|
+
// if(formArray.controlNamesFromHtml.findIndex(x => x === formControlName) === -1)
|
|
1649
|
+
// formArray.controlNamesFromHtml.push(formControlName);
|
|
1650
|
+
let filteredFormGroups;
|
|
1651
|
+
if (filter) {
|
|
1652
|
+
filteredFormGroups = filter(formArray.controls);
|
|
1653
|
+
}
|
|
1654
|
+
else {
|
|
1655
|
+
return formArray.controls.map(x => x.controls[formControlName]);
|
|
1656
|
+
}
|
|
1657
|
+
return filteredFormGroups.map(x => x.controls[formControlName]);
|
|
1658
|
+
}
|
|
1659
|
+
removeFormControlsFromTheFormArray(formArray, indexes) {
|
|
1660
|
+
// Sort indexes in descending order to avoid index shifts when removing controls
|
|
1661
|
+
const sortedIndexes = indexes.sort((a, b) => b - a);
|
|
1662
|
+
sortedIndexes.forEach(index => {
|
|
1663
|
+
if (index >= 0 && index < formArray.length) {
|
|
1664
|
+
formArray.removeAt(index);
|
|
1665
|
+
}
|
|
1666
|
+
});
|
|
1667
|
+
}
|
|
1668
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: BaseFormCopy, deps: [{ token: i0.KeyValueDiffers }, { token: i1$3.HttpClient }, { token: SpiderlyMessageService }, { token: i0.ChangeDetectorRef }, { token: i3$2.Router }, { token: i3$2.ActivatedRoute }, { token: i1.TranslocoService }, { token: BaseFormService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1669
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: BaseFormCopy, isStandalone: false, selector: "base-form", ngImport: i0, template: '', isInline: true }); }
|
|
1670
|
+
}
|
|
1671
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: BaseFormCopy, decorators: [{
|
|
1672
|
+
type: Component,
|
|
1673
|
+
args: [{ selector: 'base-form', template: '', standalone: false }]
|
|
1674
|
+
}], ctorParameters: () => [{ type: i0.KeyValueDiffers }, { type: i1$3.HttpClient }, { type: SpiderlyMessageService }, { type: i0.ChangeDetectorRef }, { type: i3$2.Router }, { type: i3$2.ActivatedRoute }, { type: i1.TranslocoService }, { type: BaseFormService }] });
|
|
1675
|
+
|
|
1676
|
+
class CardSkeletonComponent {
|
|
1677
|
+
constructor() {
|
|
1678
|
+
this.height = 400;
|
|
1679
|
+
this.titleHeight = 23;
|
|
1680
|
+
this.padding = 21;
|
|
1681
|
+
this.titleMarginBottom = 14;
|
|
1682
|
+
this.titleMarginTop = 4;
|
|
1683
|
+
}
|
|
1684
|
+
ngOnInit() {
|
|
1685
|
+
this.dataHeight = this.height - (this.titleHeight + this.padding * 2 + this.titleMarginBottom + this.titleMarginTop);
|
|
1686
|
+
}
|
|
1687
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: CardSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1688
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: CardSkeletonComponent, isStandalone: true, selector: "card-skeleton", inputs: { height: "height" }, ngImport: i0, template: "<div class=\"border-round border-1 surface-border p-4 surface-card\" [style]=\"'height: ' + height + 'px;'\">\n <div [style]=\"'margin-bottom:' + titleMarginBottom + 'px; margin-top:' + titleMarginTop + 'px;'\">\n <p-skeleton width=\"160px\" [height]=\"titleHeight + 'px'\"></p-skeleton>\n </div>\n <div [style]=\"'height: ' + dataHeight + 'px;'\">\n <p-skeleton width=\"100%\" height=\"100%\"/>\n </div>\n</div>", dependencies: [{ kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i1$4.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }] }); }
|
|
1689
|
+
}
|
|
1690
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: CardSkeletonComponent, decorators: [{
|
|
1691
|
+
type: Component,
|
|
1692
|
+
args: [{ selector: 'card-skeleton', imports: [SkeletonModule], template: "<div class=\"border-round border-1 surface-border p-4 surface-card\" [style]=\"'height: ' + height + 'px;'\">\n <div [style]=\"'margin-bottom:' + titleMarginBottom + 'px; margin-top:' + titleMarginTop + 'px;'\">\n <p-skeleton width=\"160px\" [height]=\"titleHeight + 'px'\"></p-skeleton>\n </div>\n <div [style]=\"'height: ' + dataHeight + 'px;'\">\n <p-skeleton width=\"100%\" height=\"100%\"/>\n </div>\n</div>" }]
|
|
1693
|
+
}], propDecorators: { height: [{
|
|
1694
|
+
type: Input
|
|
1695
|
+
}] } });
|
|
1696
|
+
|
|
1697
|
+
class UserBase extends BaseEntity {
|
|
1698
|
+
static { this.typeName = 'UserBase'; }
|
|
1699
|
+
constructor({ id, email, } = {}) {
|
|
1700
|
+
super();
|
|
1701
|
+
this.id = id;
|
|
1702
|
+
this.email = email;
|
|
1703
|
+
}
|
|
1704
|
+
static { this.schema = {
|
|
1705
|
+
id: {
|
|
1706
|
+
type: 'number',
|
|
1707
|
+
},
|
|
1708
|
+
email: {
|
|
1709
|
+
type: 'string',
|
|
1710
|
+
},
|
|
1711
|
+
}; }
|
|
1712
|
+
}
|
|
1713
|
+
class AuthResult extends BaseEntity {
|
|
1714
|
+
static { this.typeName = 'AuthResult'; }
|
|
1715
|
+
constructor({ userId, email, accessToken, refreshToken } = {}) {
|
|
1716
|
+
super();
|
|
1717
|
+
this.userId = userId;
|
|
1718
|
+
this.email = email;
|
|
1719
|
+
this.accessToken = accessToken;
|
|
1720
|
+
this.refreshToken = refreshToken;
|
|
1721
|
+
}
|
|
1722
|
+
static { this.schema = {
|
|
1723
|
+
userId: {
|
|
1724
|
+
type: 'number',
|
|
1556
1725
|
},
|
|
1557
|
-
|
|
1558
|
-
type: '
|
|
1726
|
+
email: {
|
|
1727
|
+
type: 'string',
|
|
1559
1728
|
},
|
|
1560
|
-
|
|
1561
|
-
type: '
|
|
1729
|
+
accessToken: {
|
|
1730
|
+
type: 'string',
|
|
1731
|
+
},
|
|
1732
|
+
refreshToken: {
|
|
1733
|
+
type: 'string',
|
|
1562
1734
|
},
|
|
1563
1735
|
}; }
|
|
1564
1736
|
}
|
|
1565
|
-
class
|
|
1566
|
-
static { this.typeName = '
|
|
1567
|
-
constructor({
|
|
1737
|
+
class VerificationTokenRequest extends BaseEntity {
|
|
1738
|
+
static { this.typeName = 'VerificationTokenRequest'; }
|
|
1739
|
+
constructor({ verificationCode, browserId, email } = {}) {
|
|
1568
1740
|
super();
|
|
1569
|
-
this.
|
|
1570
|
-
this.
|
|
1571
|
-
this.
|
|
1741
|
+
this.verificationCode = verificationCode;
|
|
1742
|
+
this.browserId = browserId;
|
|
1743
|
+
this.email = email;
|
|
1572
1744
|
}
|
|
1573
1745
|
static { this.schema = {
|
|
1574
|
-
|
|
1575
|
-
type: '
|
|
1576
|
-
get nestedConstructor() { return Role; },
|
|
1577
|
-
isMainDTOForMainUIFormDTO: true,
|
|
1746
|
+
verificationCode: {
|
|
1747
|
+
type: 'string',
|
|
1578
1748
|
},
|
|
1579
|
-
|
|
1580
|
-
type: '
|
|
1581
|
-
get nestedConstructor() { return Namebook; },
|
|
1749
|
+
browserId: {
|
|
1750
|
+
type: 'string',
|
|
1582
1751
|
},
|
|
1583
|
-
|
|
1584
|
-
type: '
|
|
1752
|
+
email: {
|
|
1753
|
+
type: 'string',
|
|
1585
1754
|
},
|
|
1586
1755
|
}; }
|
|
1587
1756
|
}
|
|
1588
|
-
class
|
|
1589
|
-
static { this.typeName = '
|
|
1590
|
-
constructor({
|
|
1757
|
+
class ExternalProvider extends BaseEntity {
|
|
1758
|
+
static { this.typeName = 'ExternalProvider'; }
|
|
1759
|
+
constructor({ idToken, browserId } = {}) {
|
|
1591
1760
|
super();
|
|
1592
|
-
this.
|
|
1593
|
-
this.
|
|
1594
|
-
this.selectedUsersIds = selectedUsersIds;
|
|
1761
|
+
this.idToken = idToken;
|
|
1762
|
+
this.browserId = browserId;
|
|
1595
1763
|
}
|
|
1596
1764
|
static { this.schema = {
|
|
1597
|
-
|
|
1598
|
-
type: '
|
|
1599
|
-
get nestedConstructor() { return Role; },
|
|
1600
|
-
isSaveBodyMainDTO: true,
|
|
1765
|
+
idToken: {
|
|
1766
|
+
type: 'string',
|
|
1601
1767
|
},
|
|
1602
|
-
|
|
1603
|
-
type: '
|
|
1768
|
+
browserId: {
|
|
1769
|
+
type: 'string',
|
|
1770
|
+
},
|
|
1771
|
+
}; }
|
|
1772
|
+
}
|
|
1773
|
+
class UserRole extends BaseEntity {
|
|
1774
|
+
static { this.typeName = 'UserRole'; }
|
|
1775
|
+
constructor({ roleId, userId } = {}) {
|
|
1776
|
+
super();
|
|
1777
|
+
this.roleId = roleId;
|
|
1778
|
+
this.userId = userId;
|
|
1779
|
+
}
|
|
1780
|
+
static { this.schema = {
|
|
1781
|
+
roleId: {
|
|
1782
|
+
type: 'number',
|
|
1604
1783
|
},
|
|
1605
|
-
|
|
1606
|
-
type: 'number
|
|
1784
|
+
userId: {
|
|
1785
|
+
type: 'number',
|
|
1607
1786
|
},
|
|
1608
1787
|
}; }
|
|
1609
1788
|
}
|
|
1610
|
-
class
|
|
1611
|
-
static { this.typeName = '
|
|
1612
|
-
constructor({
|
|
1789
|
+
class LoginVerificationToken extends BaseEntity {
|
|
1790
|
+
static { this.typeName = 'LoginVerificationToken'; }
|
|
1791
|
+
constructor({ email, userId, browserId, expireAt } = {}) {
|
|
1613
1792
|
super();
|
|
1614
|
-
this.
|
|
1615
|
-
this.
|
|
1616
|
-
this.
|
|
1617
|
-
this.
|
|
1618
|
-
this.code = code;
|
|
1619
|
-
this.id = id;
|
|
1793
|
+
this.email = email;
|
|
1794
|
+
this.userId = userId;
|
|
1795
|
+
this.browserId = browserId;
|
|
1796
|
+
this.expireAt = expireAt;
|
|
1620
1797
|
}
|
|
1621
1798
|
static { this.schema = {
|
|
1622
|
-
|
|
1799
|
+
email: {
|
|
1623
1800
|
type: 'string',
|
|
1624
1801
|
},
|
|
1625
|
-
|
|
1626
|
-
type: '
|
|
1802
|
+
userId: {
|
|
1803
|
+
type: 'number',
|
|
1627
1804
|
},
|
|
1628
|
-
|
|
1805
|
+
browserId: {
|
|
1629
1806
|
type: 'string',
|
|
1630
1807
|
},
|
|
1631
|
-
|
|
1632
|
-
type: '
|
|
1808
|
+
expireAt: {
|
|
1809
|
+
type: 'Date',
|
|
1633
1810
|
},
|
|
1634
|
-
|
|
1811
|
+
}; }
|
|
1812
|
+
}
|
|
1813
|
+
class Login extends BaseEntity {
|
|
1814
|
+
static { this.typeName = 'Login'; }
|
|
1815
|
+
constructor({ email, browserId } = {}) {
|
|
1816
|
+
super();
|
|
1817
|
+
this.email = email;
|
|
1818
|
+
this.browserId = browserId;
|
|
1819
|
+
}
|
|
1820
|
+
static { this.schema = {
|
|
1821
|
+
email: {
|
|
1635
1822
|
type: 'string',
|
|
1636
1823
|
},
|
|
1637
|
-
|
|
1638
|
-
type: '
|
|
1824
|
+
browserId: {
|
|
1825
|
+
type: 'string',
|
|
1639
1826
|
},
|
|
1640
1827
|
}; }
|
|
1641
1828
|
}
|
|
1642
|
-
class
|
|
1643
|
-
static { this.typeName = '
|
|
1644
|
-
constructor({
|
|
1829
|
+
class RefreshTokenRequest extends BaseEntity {
|
|
1830
|
+
static { this.typeName = 'RefreshTokenRequest'; }
|
|
1831
|
+
constructor({ refreshToken, browserId } = {}) {
|
|
1645
1832
|
super();
|
|
1646
|
-
this.
|
|
1833
|
+
this.refreshToken = refreshToken;
|
|
1834
|
+
this.browserId = browserId;
|
|
1647
1835
|
}
|
|
1648
1836
|
static { this.schema = {
|
|
1649
|
-
|
|
1650
|
-
type: '
|
|
1651
|
-
|
|
1837
|
+
refreshToken: {
|
|
1838
|
+
type: 'string',
|
|
1839
|
+
},
|
|
1840
|
+
browserId: {
|
|
1841
|
+
type: 'string',
|
|
1652
1842
|
},
|
|
1653
1843
|
}; }
|
|
1654
1844
|
}
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
constructor() {
|
|
1658
|
-
|
|
1659
|
-
this.
|
|
1660
|
-
this.padding = 21;
|
|
1661
|
-
this.titleMarginBottom = 14;
|
|
1662
|
-
this.titleMarginTop = 4;
|
|
1663
|
-
}
|
|
1664
|
-
ngOnInit() {
|
|
1665
|
-
this.dataHeight = this.height - (this.titleHeight + this.padding * 2 + this.titleMarginBottom + this.titleMarginTop);
|
|
1845
|
+
class SendLoginVerificationEmailResult extends BaseEntity {
|
|
1846
|
+
static { this.typeName = 'SendLoginVerificationEmailResult'; }
|
|
1847
|
+
constructor({ message } = {}) {
|
|
1848
|
+
super();
|
|
1849
|
+
this.message = message;
|
|
1666
1850
|
}
|
|
1667
|
-
static { this
|
|
1668
|
-
|
|
1851
|
+
static { this.schema = {
|
|
1852
|
+
message: {
|
|
1853
|
+
type: 'string',
|
|
1854
|
+
},
|
|
1855
|
+
}; }
|
|
1669
1856
|
}
|
|
1670
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: CardSkeletonComponent, decorators: [{
|
|
1671
|
-
type: Component,
|
|
1672
|
-
args: [{ selector: 'card-skeleton', imports: [SkeletonModule], template: "<div class=\"border-round border-1 surface-border p-4 surface-card\" [style]=\"'height: ' + height + 'px;'\">\n <div [style]=\"'margin-bottom:' + titleMarginBottom + 'px; margin-top:' + titleMarginTop + 'px;'\">\n <p-skeleton width=\"160px\" [height]=\"titleHeight + 'px'\"></p-skeleton>\n </div>\n <div [style]=\"'height: ' + dataHeight + 'px;'\">\n <p-skeleton width=\"100%\" height=\"100%\"/>\n </div>\n</div>" }]
|
|
1673
|
-
}], propDecorators: { height: [{
|
|
1674
|
-
type: Input
|
|
1675
|
-
}] } });
|
|
1676
1857
|
|
|
1677
1858
|
class PanelBodyComponent {
|
|
1678
1859
|
constructor() {
|
|
@@ -1846,388 +2027,141 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
1846
2027
|
}]
|
|
1847
2028
|
}] });
|
|
1848
2029
|
|
|
1849
|
-
class
|
|
1850
|
-
constructor() {
|
|
1851
|
-
|
|
1852
|
-
this.
|
|
1853
|
-
this.companyName = 'Company Name';
|
|
1854
|
-
this.primaryColor = '#111b2c';
|
|
1855
|
-
this.googleAuth = true;
|
|
1856
|
-
/* URLs */
|
|
1857
|
-
this.loginSlug = 'login';
|
|
1858
|
-
/* Local storage */
|
|
1859
|
-
this.accessTokenKey = 'access_token';
|
|
1860
|
-
this.refreshTokenKey = 'refresh_token';
|
|
1861
|
-
this.browserIdKey = 'browser_id';
|
|
1862
|
-
this.httpOptions = {};
|
|
1863
|
-
this.httpSkipSpinnerOptions = {
|
|
1864
|
-
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
|
1865
|
-
params: new HttpParams().set('X-Skip-Spinner', 'true')
|
|
1866
|
-
};
|
|
1867
|
-
this.logoPath = 'assets/images/logo/logo.svg';
|
|
1868
|
-
}
|
|
1869
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ConfigBaseService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1870
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ConfigBaseService, providedIn: 'root' }); }
|
|
1871
|
-
}
|
|
1872
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ConfigBaseService, decorators: [{
|
|
1873
|
-
type: Injectable,
|
|
1874
|
-
args: [{
|
|
1875
|
-
providedIn: 'root'
|
|
1876
|
-
}]
|
|
1877
|
-
}], ctorParameters: () => [] });
|
|
1878
|
-
|
|
1879
|
-
class ApiSecurityService {
|
|
1880
|
-
constructor(http, config) {
|
|
2030
|
+
class VerificationWrapperComponent extends BaseFormCopy {
|
|
2031
|
+
constructor(differs, http, messageService, changeDetectorRef, router, route, translocoService, baseFormService) {
|
|
2032
|
+
super(differs, http, messageService, changeDetectorRef, router, route, translocoService, baseFormService);
|
|
2033
|
+
this.differs = differs;
|
|
1881
2034
|
this.http = http;
|
|
1882
|
-
this.config = config;
|
|
1883
|
-
//#region Authentication
|
|
1884
|
-
this.login = (request) => {
|
|
1885
|
-
return this.http.post(`${this.config.apiUrl}/Security/Login`, request, this.config.httpOptions);
|
|
1886
|
-
};
|
|
1887
|
-
this.loginExternal = (externalProviderDTO) => {
|
|
1888
|
-
return this.http.post(`${this.config.apiUrl}/Security/LoginExternal`, externalProviderDTO, this.config.httpOptions);
|
|
1889
|
-
};
|
|
1890
|
-
this.sendLoginVerificationEmail = (loginDTO) => {
|
|
1891
|
-
return this.http.post(`${this.config.apiUrl}/Security/SendLoginVerificationEmail`, loginDTO, this.config.httpOptions);
|
|
1892
|
-
};
|
|
1893
|
-
this.logout = (browserId) => {
|
|
1894
|
-
return this.http.get(`${this.config.apiUrl}/Security/Logout?browserId=${browserId}`);
|
|
1895
|
-
};
|
|
1896
|
-
this.refreshToken = (request) => {
|
|
1897
|
-
return this.http.post(`${this.config.apiUrl}/Security/RefreshToken`, request, this.config.httpOptions);
|
|
1898
|
-
};
|
|
1899
|
-
//#endregion
|
|
1900
|
-
//#region User
|
|
1901
|
-
this.getCurrentUserBase = () => {
|
|
1902
|
-
return this.http.get(`${this.config.apiUrl}/Security/GetCurrentUserBase`, this.config.httpSkipSpinnerOptions);
|
|
1903
|
-
};
|
|
1904
|
-
this.getCurrentUserPermissionCodes = () => {
|
|
1905
|
-
return this.http.get(`${this.config.apiUrl}/Security/GetCurrentUserPermissionCodes`, this.config.httpSkipSpinnerOptions);
|
|
1906
|
-
};
|
|
1907
|
-
//#endregion
|
|
1908
|
-
//#region Role
|
|
1909
|
-
this.getPaginatedRoleList = (dto) => {
|
|
1910
|
-
return this.http.post(`${this.config.apiUrl}/Security/GetPaginatedRoleList`, dto, this.config.httpSkipSpinnerOptions);
|
|
1911
|
-
};
|
|
1912
|
-
this.exportRoleListToExcel = (dto) => {
|
|
1913
|
-
return this.http.post(`${this.config.apiUrl}/Security/ExportRoleListToExcel`, dto, this.config.httpOptions);
|
|
1914
|
-
};
|
|
1915
|
-
this.deleteRole = (id) => {
|
|
1916
|
-
return this.http.delete(`${this.config.apiUrl}/Security/DeleteRole?id=${id}`);
|
|
1917
|
-
};
|
|
1918
|
-
this.getRoleMainUIFormDTO = (id) => {
|
|
1919
|
-
return this.http.get(`${this.config.apiUrl}/Security/GetRoleMainUIFormDTO?id=${id}`);
|
|
1920
|
-
};
|
|
1921
|
-
this.getRole = (id) => {
|
|
1922
|
-
return this.http.get(`${this.config.apiUrl}/Security/GetRole?id=${id}`);
|
|
1923
|
-
};
|
|
1924
|
-
this.saveRole = (dto) => {
|
|
1925
|
-
return this.http.put(`${this.config.apiUrl}/Security/SaveRole`, dto, this.config.httpOptions);
|
|
1926
|
-
};
|
|
1927
|
-
this.getUsersNamebookListForRole = (roleId) => {
|
|
1928
|
-
return this.http.get(`${this.config.apiUrl}/Security/GetUsersNamebookListForRole?roleId=${roleId}`, this.config.httpSkipSpinnerOptions);
|
|
1929
|
-
};
|
|
1930
|
-
this.getPermissionsDropdownListForRole = () => {
|
|
1931
|
-
return this.http.get(`${this.config.apiUrl}/Security/GetPermissionsDropdownListForRole`, this.config.httpSkipSpinnerOptions);
|
|
1932
|
-
};
|
|
1933
|
-
this.getPermissionsNamebookListForRole = (roleId) => {
|
|
1934
|
-
return this.http.get(`${this.config.apiUrl}/Security/GetPermissionsNamebookListForRole?roleId=${roleId}`, this.config.httpSkipSpinnerOptions);
|
|
1935
|
-
};
|
|
1936
|
-
this.getUsersAutocompleteListForRole = (limit, query) => {
|
|
1937
|
-
return this.http.get(`${this.config.apiUrl}/Security/GetUsersAutocompleteListForRole?limit=${limit}&query=${query}`, this.config.httpSkipSpinnerOptions);
|
|
1938
|
-
};
|
|
1939
|
-
//#endregion
|
|
1940
|
-
//#region Notification
|
|
1941
|
-
this.getUnreadNotificationsCountForCurrentUser = () => {
|
|
1942
|
-
return this.http.get(`${this.config.apiUrl}/Notification/GetUnreadNotificationsCountForCurrentUser`, this.config.httpSkipSpinnerOptions);
|
|
1943
|
-
};
|
|
1944
|
-
}
|
|
1945
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ApiSecurityService, deps: [{ token: i1$4.HttpClient }, { token: ConfigBaseService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1946
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ApiSecurityService, providedIn: 'root' }); }
|
|
1947
|
-
}
|
|
1948
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ApiSecurityService, decorators: [{
|
|
1949
|
-
type: Injectable,
|
|
1950
|
-
args: [{
|
|
1951
|
-
providedIn: 'root'
|
|
1952
|
-
}]
|
|
1953
|
-
}], ctorParameters: () => [{ type: i1$4.HttpClient }, { type: ConfigBaseService }] });
|
|
1954
|
-
|
|
1955
|
-
// When we call it, inside the console, it will show SpiderlyError: ...
|
|
1956
|
-
class SpiderlyError extends Error {
|
|
1957
|
-
constructor(message) {
|
|
1958
|
-
super(message);
|
|
1959
|
-
}
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
class TranslateLabelsAbstractService {
|
|
1963
|
-
constructor() {
|
|
1964
|
-
}
|
|
1965
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: TranslateLabelsAbstractService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1966
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: TranslateLabelsAbstractService, providedIn: 'root' }); }
|
|
1967
|
-
}
|
|
1968
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: TranslateLabelsAbstractService, decorators: [{
|
|
1969
|
-
type: Injectable,
|
|
1970
|
-
args: [{
|
|
1971
|
-
providedIn: 'root',
|
|
1972
|
-
}]
|
|
1973
|
-
}], ctorParameters: () => [] });
|
|
1974
|
-
|
|
1975
|
-
class SpiderlyMessageService {
|
|
1976
|
-
constructor(messageService, translocoService, ngZone) {
|
|
1977
2035
|
this.messageService = messageService;
|
|
2036
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
2037
|
+
this.router = router;
|
|
2038
|
+
this.route = route;
|
|
1978
2039
|
this.translocoService = translocoService;
|
|
1979
|
-
this.
|
|
2040
|
+
this.baseFormService = baseFormService;
|
|
2041
|
+
this.verificationTokenRequestFormGroup = new SpiderlyFormGroup({});
|
|
2042
|
+
this.onResendVerificationToken = new EventEmitter();
|
|
2043
|
+
this.onCodeSubmit = new EventEmitter();
|
|
1980
2044
|
}
|
|
1981
|
-
|
|
1982
|
-
this.
|
|
1983
|
-
severity: 'success',
|
|
1984
|
-
summary: title,
|
|
1985
|
-
detail: detail,
|
|
1986
|
-
life: 10000,
|
|
1987
|
-
});
|
|
2045
|
+
ngOnInit() {
|
|
2046
|
+
this.initVerificationTokenRequestFormGroup(new VerificationTokenRequest({ email: this.email }));
|
|
1988
2047
|
}
|
|
1989
|
-
|
|
1990
|
-
this.
|
|
1991
|
-
severity: 'warn',
|
|
1992
|
-
summary: title ?? this.translocoService.translate('Warning'),
|
|
1993
|
-
detail: detail,
|
|
1994
|
-
life: 10000,
|
|
1995
|
-
sticky: sticky
|
|
1996
|
-
});
|
|
2048
|
+
initVerificationTokenRequestFormGroup(model) {
|
|
2049
|
+
this.baseFormService.initFormGroup(this.verificationTokenRequestFormGroup, VerificationTokenRequest, model, ['verificationCode']);
|
|
1997
2050
|
}
|
|
1998
|
-
|
|
1999
|
-
this.
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2051
|
+
codeSubmit() {
|
|
2052
|
+
let isValid = this.baseFormService.isControlValid(this.verificationTokenRequestFormGroup);
|
|
2053
|
+
if (isValid) {
|
|
2054
|
+
this.onCodeSubmit.next(this.verificationTokenRequestFormGroup.controls.verificationCode.getRawValue());
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
resendVerificationToken() {
|
|
2058
|
+
this.onResendVerificationToken.next(null);
|
|
2005
2059
|
}
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2060
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: VerificationWrapperComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i1$3.HttpClient }, { token: SpiderlyMessageService }, { token: i0.ChangeDetectorRef }, { token: i3$2.Router }, { token: i3$2.ActivatedRoute }, { token: i1.TranslocoService }, { token: BaseFormService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2061
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.13", type: VerificationWrapperComponent, isStandalone: true, selector: "verification-wrapper", inputs: { email: "email" }, outputs: { onResendVerificationToken: "onResendVerificationToken", onCodeSubmit: "onCodeSubmit" }, usesInheritance: true, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <div class=\"min-h-screen\" style=\"display: flex; justify-content: center; align-items: center;\">\n <div class=\"dialog\" style=\"padding: 0px;\">\n @if (verificationTokenRequestFormGroup != null) {\n <spiderly-panel>\n <panel-header [title]=\"t('AccountVerificationHeader')\" [showBigTitle]=\"true\" icon=\"pi pi-envelope\"></panel-header>\n \n <panel-body>\n <form class=\"grid\">\n <div class=\"col-12\">\n <div style=\"font-size: 17.5px\">{{t('AccountVerificationTitle')}}</div>\n </div>\n <div class=\"col-12\">\n {{t('AccountVerificationDescription', {email: email})}}\n </div>\n <div class=\"col-12\">\n <spiderly-textbox [control]=\"verificationTokenRequestFormGroup.getControl('verificationCode')\"></spiderly-textbox>\n </div>\n <div class=\"col-12\">\n <spiderly-button (onClick)=\"codeSubmit()\" [label]=\"t('Submit')\" icon=\"pi pi-verified\" type=\"submit\"></spiderly-button>\n </div>\n </form>\n </panel-body>\n \n <panel-footer>\n <a pButton class=\"p-button-link\" [label]=\"t('GoToGmail')\" icon=\"pi pi-external-link\" href=\"https://mail.google.com/mail/u/\" target=\"_blank\" rel=\"noopener noreferrer\"></a>\n <a pButton class=\"p-button-link\" [label]=\"t('GoToYahoo')\" icon=\"pi pi-external-link\" href=\"https://mail.yahoo.com/d/folders/1/\" target=\"_blank\" rel=\"noopener noreferrer\"></a>\n </panel-footer>\n <panel-footer>\n <div>{{t('ResendVerificationCodeFirstPart')}} <a class=\"link\" (click)=\"resendVerificationToken()\">{{t('ResendVerificationCodeLinkSecondPart')}}</a></div>\n </panel-footer>\n </spiderly-panel>\n }\n @else {\n <!-- TODO FT: Add skeleton -->\n }\n </div>\n </div>\n</ng-container>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: SpiderlyControlsModule }, { kind: "component", type: SpiderlyTextboxComponent, selector: "spiderly-textbox", inputs: ["showButton", "buttonIcon"], outputs: ["onButtonClick"] }, { kind: "component", type: SpiderlyButtonComponent, selector: "spiderly-button", inputs: ["type"] }, { kind: "ngmodule", type: SpiderlyPanelsModule }, { kind: "component", type: PanelHeaderComponent, selector: "panel-header", inputs: ["title", "showBigTitle", "showIcon", "icon", "index", "tabs"] }, { kind: "component", type: PanelBodyComponent, selector: "panel-body", inputs: ["normalBottomPadding"] }, { kind: "component", type: PanelFooterComponent, selector: "panel-footer" }, { kind: "component", type: SpiderlyPanelComponent, selector: "spiderly-panel", inputs: ["isFirstMultiplePanel", "isMiddleMultiplePanel", "isLastMultiplePanel", "toggleable", "toggler", "collapsed", "crudMenu", "showCrudMenu", "showRemoveIcon", "index", "showPanelHeader"], outputs: ["onMenuIconClick", "onRemoveIconClick"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] }); }
|
|
2062
|
+
}
|
|
2063
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: VerificationWrapperComponent, decorators: [{
|
|
2064
|
+
type: Component,
|
|
2065
|
+
args: [{ selector: 'verification-wrapper', imports: [
|
|
2066
|
+
CommonModule,
|
|
2067
|
+
FormsModule,
|
|
2068
|
+
ReactiveFormsModule,
|
|
2069
|
+
SpiderlyControlsModule,
|
|
2070
|
+
SpiderlyPanelsModule,
|
|
2071
|
+
ButtonModule,
|
|
2072
|
+
TranslocoDirective,
|
|
2073
|
+
], template: "<ng-container *transloco=\"let t\">\n <div class=\"min-h-screen\" style=\"display: flex; justify-content: center; align-items: center;\">\n <div class=\"dialog\" style=\"padding: 0px;\">\n @if (verificationTokenRequestFormGroup != null) {\n <spiderly-panel>\n <panel-header [title]=\"t('AccountVerificationHeader')\" [showBigTitle]=\"true\" icon=\"pi pi-envelope\"></panel-header>\n \n <panel-body>\n <form class=\"grid\">\n <div class=\"col-12\">\n <div style=\"font-size: 17.5px\">{{t('AccountVerificationTitle')}}</div>\n </div>\n <div class=\"col-12\">\n {{t('AccountVerificationDescription', {email: email})}}\n </div>\n <div class=\"col-12\">\n <spiderly-textbox [control]=\"verificationTokenRequestFormGroup.getControl('verificationCode')\"></spiderly-textbox>\n </div>\n <div class=\"col-12\">\n <spiderly-button (onClick)=\"codeSubmit()\" [label]=\"t('Submit')\" icon=\"pi pi-verified\" type=\"submit\"></spiderly-button>\n </div>\n </form>\n </panel-body>\n \n <panel-footer>\n <a pButton class=\"p-button-link\" [label]=\"t('GoToGmail')\" icon=\"pi pi-external-link\" href=\"https://mail.google.com/mail/u/\" target=\"_blank\" rel=\"noopener noreferrer\"></a>\n <a pButton class=\"p-button-link\" [label]=\"t('GoToYahoo')\" icon=\"pi pi-external-link\" href=\"https://mail.yahoo.com/d/folders/1/\" target=\"_blank\" rel=\"noopener noreferrer\"></a>\n </panel-footer>\n <panel-footer>\n <div>{{t('ResendVerificationCodeFirstPart')}} <a class=\"link\" (click)=\"resendVerificationToken()\">{{t('ResendVerificationCodeLinkSecondPart')}}</a></div>\n </panel-footer>\n </spiderly-panel>\n }\n @else {\n <!-- TODO FT: Add skeleton -->\n }\n </div>\n </div>\n</ng-container>" }]
|
|
2074
|
+
}], ctorParameters: () => [{ type: i0.KeyValueDiffers }, { type: i1$3.HttpClient }, { type: SpiderlyMessageService }, { type: i0.ChangeDetectorRef }, { type: i3$2.Router }, { type: i3$2.ActivatedRoute }, { type: i1.TranslocoService }, { type: BaseFormService }], propDecorators: { email: [{
|
|
2075
|
+
type: Input
|
|
2076
|
+
}], onResendVerificationToken: [{
|
|
2077
|
+
type: Output
|
|
2078
|
+
}], onCodeSubmit: [{
|
|
2079
|
+
type: Output
|
|
2080
|
+
}] } });
|
|
2081
|
+
|
|
2082
|
+
class InitCompanyAuthDialogDetails extends BaseEntity {
|
|
2083
|
+
constructor({ image, companyName, } = {}) {
|
|
2084
|
+
super();
|
|
2085
|
+
this.image = image;
|
|
2086
|
+
this.companyName = companyName;
|
|
2014
2087
|
}
|
|
2015
|
-
static { this
|
|
2016
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyMessageService, providedIn: 'root' }); }
|
|
2088
|
+
static { this.typeName = 'InitCompanyAuthDialogDetails'; }
|
|
2017
2089
|
}
|
|
2018
|
-
|
|
2090
|
+
|
|
2091
|
+
class ConfigServiceBase {
|
|
2092
|
+
constructor() {
|
|
2093
|
+
this.production = false;
|
|
2094
|
+
this.frontendUrl = 'http://localhost:4200';
|
|
2095
|
+
this.companyName = 'Company Name';
|
|
2096
|
+
this.primaryColor = '#111b2c';
|
|
2097
|
+
/* URLs */
|
|
2098
|
+
this.loginSlug = 'login';
|
|
2099
|
+
/* Local storage */
|
|
2100
|
+
this.accessTokenKey = 'access_token';
|
|
2101
|
+
this.refreshTokenKey = 'refresh_token';
|
|
2102
|
+
this.browserIdKey = 'browser_id';
|
|
2103
|
+
this.httpOptions = {};
|
|
2104
|
+
this.httpSkipSpinnerOptions = {
|
|
2105
|
+
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
|
2106
|
+
params: new HttpParams().set('X-Skip-Spinner', 'true')
|
|
2107
|
+
};
|
|
2108
|
+
this.logoPath = 'assets/images/logo/logo.svg';
|
|
2109
|
+
}
|
|
2110
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ConfigServiceBase, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2111
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ConfigServiceBase, providedIn: 'root' }); }
|
|
2112
|
+
}
|
|
2113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ConfigServiceBase, decorators: [{
|
|
2019
2114
|
type: Injectable,
|
|
2020
2115
|
args: [{
|
|
2021
|
-
providedIn: 'root'
|
|
2116
|
+
providedIn: 'root'
|
|
2022
2117
|
}]
|
|
2023
|
-
}], ctorParameters: () => [
|
|
2118
|
+
}], ctorParameters: () => [] });
|
|
2024
2119
|
|
|
2025
|
-
class
|
|
2026
|
-
constructor(
|
|
2027
|
-
this.
|
|
2028
|
-
this.
|
|
2029
|
-
|
|
2030
|
-
this.
|
|
2031
|
-
|
|
2032
|
-
if (!formGroup)
|
|
2033
|
-
throw new SpiderlyError('You need to instantiate the form group.');
|
|
2034
|
-
if (!targetClass)
|
|
2035
|
-
throw new SpiderlyError('You need to pass targetClass.');
|
|
2036
|
-
if (!initialValues)
|
|
2037
|
-
initialValues = {};
|
|
2038
|
-
Object.keys(targetClass.schema).forEach((formControlName) => {
|
|
2039
|
-
const propSchema = targetClass.schema[formControlName];
|
|
2040
|
-
let propInitialValue = initialValues[formControlName];
|
|
2041
|
-
const existingControl = formGroup.get(formControlName);
|
|
2042
|
-
if (propSchema.type.endsWith('[]') &&
|
|
2043
|
-
propSchema.nestedConstructor &&
|
|
2044
|
-
propSchema.type !== 'Namebook[]') {
|
|
2045
|
-
if (existingControl instanceof SpiderlyFormArray) {
|
|
2046
|
-
this.initFormArray(existingControl, propSchema.nestedConstructor, propInitialValue);
|
|
2047
|
-
}
|
|
2048
|
-
else {
|
|
2049
|
-
const control = new SpiderlyFormArray([], this.translocoService, this);
|
|
2050
|
-
this.initFormArray(control, propSchema.nestedConstructor, propInitialValue);
|
|
2051
|
-
control.label = formControlName;
|
|
2052
|
-
control.labelForDisplay = this.getTranslatedLabel(formControlName);
|
|
2053
|
-
formGroup.setControl(formControlName, control);
|
|
2054
|
-
}
|
|
2055
|
-
}
|
|
2056
|
-
else if (propSchema.nestedConstructor &&
|
|
2057
|
-
propSchema.type !== 'Namebook[]') {
|
|
2058
|
-
if (existingControl instanceof SpiderlyFormGroup) {
|
|
2059
|
-
this.initFormGroup(existingControl, propSchema.nestedConstructor, propInitialValue);
|
|
2060
|
-
}
|
|
2061
|
-
else {
|
|
2062
|
-
const control = new SpiderlyFormGroup({});
|
|
2063
|
-
this.initFormGroup(control, propSchema.nestedConstructor, propInitialValue);
|
|
2064
|
-
formGroup.setControl(formControlName, control);
|
|
2065
|
-
}
|
|
2066
|
-
}
|
|
2067
|
-
else {
|
|
2068
|
-
// HACK: Because on the backend id type is not nullable on generated DTOs, we need to do this, it's ugly hack and we should make it better.
|
|
2069
|
-
if (formControlName === 'id' && !propInitialValue) {
|
|
2070
|
-
propInitialValue = 0;
|
|
2071
|
-
}
|
|
2072
|
-
if (existingControl instanceof SpiderlyFormControl) {
|
|
2073
|
-
existingControl.setValue(propInitialValue);
|
|
2074
|
-
}
|
|
2075
|
-
else {
|
|
2076
|
-
let control;
|
|
2077
|
-
if (updateOnChangeControls?.includes(formControlName) ||
|
|
2078
|
-
(formControlName.endsWith('Id') && formControlName.length > 2) ||
|
|
2079
|
-
propSchema.type === 'Date' ||
|
|
2080
|
-
propSchema.type === 'Namebook[]') {
|
|
2081
|
-
control = new SpiderlyFormControl(propInitialValue, { updateOn: 'change' });
|
|
2082
|
-
}
|
|
2083
|
-
else {
|
|
2084
|
-
control = new SpiderlyFormControl(propInitialValue, { updateOn: 'blur' });
|
|
2085
|
-
}
|
|
2086
|
-
control.label = formControlName;
|
|
2087
|
-
control.labelForDisplay = this.getTranslatedLabel(formControlName);
|
|
2088
|
-
control.parentClassName = targetClass.typeName;
|
|
2089
|
-
this.validatorService.setValidator(control, targetClass.typeName);
|
|
2090
|
-
formGroup.setControl(formControlName, control);
|
|
2091
|
-
}
|
|
2092
|
-
}
|
|
2093
|
-
});
|
|
2094
|
-
formGroup.targetClass = targetClass;
|
|
2095
|
-
return formGroup;
|
|
2120
|
+
class ApiSecurityService {
|
|
2121
|
+
constructor(http, config) {
|
|
2122
|
+
this.http = http;
|
|
2123
|
+
this.config = config;
|
|
2124
|
+
//#region Authentication
|
|
2125
|
+
this.login = (request) => {
|
|
2126
|
+
return this.http.post(`${this.config.apiUrl}/Security/Login`, request, this.config.httpOptions);
|
|
2096
2127
|
};
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
this.messageService.warningMessage(this.translocoService.translate('YouHaveSomeInvalidFieldsDescription'), this.translocoService.translate('YouHaveSomeInvalidFieldsTitle'));
|
|
2128
|
+
this.loginExternal = (externalProviderDTO) => {
|
|
2129
|
+
return this.http.post(`${this.config.apiUrl}/Security/LoginExternal`, externalProviderDTO, this.config.httpOptions);
|
|
2100
2130
|
};
|
|
2101
|
-
this.
|
|
2102
|
-
|
|
2103
|
-
return Object.keys(schema).find(k => schema[k].isSaveBodyMainDTO === true);
|
|
2131
|
+
this.sendLoginVerificationEmail = (loginDTO) => {
|
|
2132
|
+
return this.http.post(`${this.config.apiUrl}/Security/SendLoginVerificationEmail`, loginDTO, this.config.httpOptions);
|
|
2104
2133
|
};
|
|
2105
|
-
this.
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
saveBody[`selected${capitalizeFirstChar(propName)}`] = value ?? [];
|
|
2124
|
-
}
|
|
2125
|
-
// Handle the main DTO object (e.g., "entityDTO")
|
|
2126
|
-
else {
|
|
2127
|
-
saveBody[propName] = value;
|
|
2128
|
-
}
|
|
2129
|
-
});
|
|
2130
|
-
return saveBody;
|
|
2134
|
+
this.logout = (browserId) => {
|
|
2135
|
+
return this.http.get(`${this.config.apiUrl}/Security/Logout?browserId=${browserId}`);
|
|
2136
|
+
};
|
|
2137
|
+
this.refreshToken = (request) => {
|
|
2138
|
+
return this.http.post(`${this.config.apiUrl}/Security/RefreshToken`, request, this.config.httpOptions);
|
|
2139
|
+
};
|
|
2140
|
+
//#endregion
|
|
2141
|
+
//#region User
|
|
2142
|
+
this.getCurrentUserBase = () => {
|
|
2143
|
+
return this.http.get(`${this.config.apiUrl}/Security/GetCurrentUserBase`, this.config.httpSkipSpinnerOptions);
|
|
2144
|
+
};
|
|
2145
|
+
this.getCurrentUserPermissionCodes = () => {
|
|
2146
|
+
return this.http.get(`${this.config.apiUrl}/Security/GetCurrentUserPermissionCodes`, this.config.httpSkipSpinnerOptions);
|
|
2147
|
+
};
|
|
2148
|
+
//#endregion
|
|
2149
|
+
//#region Notification
|
|
2150
|
+
this.getUnreadNotificationsCountForCurrentUser = () => {
|
|
2151
|
+
return this.http.get(`${this.config.apiUrl}/Notification/GetUnreadNotificationsCountForCurrentUser`, this.config.httpSkipSpinnerOptions);
|
|
2131
2152
|
};
|
|
2132
2153
|
}
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
formControlName = formControlName.substring(0, formControlName.length - 2);
|
|
2136
|
-
}
|
|
2137
|
-
else if (formControlName.endsWith('DisplayName')) {
|
|
2138
|
-
formControlName = formControlName.replace('DisplayName', '');
|
|
2139
|
-
}
|
|
2140
|
-
return this.translateLabelsService.translate(formControlName);
|
|
2141
|
-
}
|
|
2142
|
-
addNewFormGroupToFormArray(formArray, targetClass, initialValues, index) {
|
|
2143
|
-
let helperFormGroup = new SpiderlyFormGroup({});
|
|
2144
|
-
this.initFormGroup(helperFormGroup, targetClass, initialValues);
|
|
2145
|
-
if (index == null) {
|
|
2146
|
-
formArray.push(helperFormGroup);
|
|
2147
|
-
}
|
|
2148
|
-
else {
|
|
2149
|
-
formArray.insert(index, helperFormGroup);
|
|
2150
|
-
}
|
|
2151
|
-
return helperFormGroup;
|
|
2152
|
-
}
|
|
2153
|
-
removeFormControlFromTheFormArray(formArray, index) {
|
|
2154
|
-
if (index == null)
|
|
2155
|
-
throw new SpiderlyError('Can not pass null index.');
|
|
2156
|
-
formArray.removeAt(index);
|
|
2157
|
-
}
|
|
2158
|
-
initFormArray(formArray, targetClass, initialValues = []) {
|
|
2159
|
-
if (!formArray)
|
|
2160
|
-
throw new SpiderlyError('You must pass a FormArray instance to be initialized or updated.');
|
|
2161
|
-
if (!targetClass)
|
|
2162
|
-
throw new SpiderlyError('You did not initialize targetClass');
|
|
2163
|
-
// formArray.required = required;
|
|
2164
|
-
formArray.formGroupInitialValues = {}; // When we need we can pass formGroupInitialValues to this method instead of assigning it to empty object
|
|
2165
|
-
formArray.targetClass = targetClass;
|
|
2166
|
-
initialValues.forEach((model, index) => {
|
|
2167
|
-
const existingControl = formArray.at(index);
|
|
2168
|
-
if (existingControl instanceof SpiderlyFormGroup) {
|
|
2169
|
-
this.initFormGroup(existingControl, targetClass, model);
|
|
2170
|
-
}
|
|
2171
|
-
else {
|
|
2172
|
-
let helperFormGroup = new SpiderlyFormGroup({});
|
|
2173
|
-
this.initFormGroup(helperFormGroup, targetClass, model);
|
|
2174
|
-
formArray.push(helperFormGroup);
|
|
2175
|
-
}
|
|
2176
|
-
});
|
|
2177
|
-
return formArray;
|
|
2178
|
-
}
|
|
2179
|
-
generateNewNegativeId(formArray) {
|
|
2180
|
-
return -formArray.getRawValue().filter(x => x.id < 0).length - 1;
|
|
2181
|
-
}
|
|
2182
|
-
isControlValid(control, controlNamesFromHtml) {
|
|
2183
|
-
let invalid = false;
|
|
2184
|
-
if (control instanceof SpiderlyFormControl) {
|
|
2185
|
-
if (control.invalid &&
|
|
2186
|
-
(controlNamesFromHtml == null || controlNamesFromHtml?.includes(control.label))) {
|
|
2187
|
-
control.markAsDirty();
|
|
2188
|
-
invalid = true;
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
else if (control instanceof SpiderlyFormGroup) {
|
|
2192
|
-
Object.keys(control.controls).forEach(key => {
|
|
2193
|
-
const nestedControl = control.controls[key];
|
|
2194
|
-
if (!this.isControlValid(nestedControl, control.controlNamesFromHtml)) {
|
|
2195
|
-
invalid = true;
|
|
2196
|
-
}
|
|
2197
|
-
});
|
|
2198
|
-
}
|
|
2199
|
-
else if (control instanceof SpiderlyFormArray) {
|
|
2200
|
-
control.controls.forEach((nestedControl) => {
|
|
2201
|
-
if (!this.isControlValid(nestedControl)) {
|
|
2202
|
-
invalid = true;
|
|
2203
|
-
}
|
|
2204
|
-
});
|
|
2205
|
-
}
|
|
2206
|
-
if (invalid) {
|
|
2207
|
-
return false;
|
|
2208
|
-
}
|
|
2209
|
-
return true;
|
|
2210
|
-
}
|
|
2211
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: BaseFormService, deps: [{ token: TranslateLabelsAbstractService }, { token: ValidatorAbstractService }, { token: SpiderlyMessageService }, { token: i1.TranslocoService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2212
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: BaseFormService, providedIn: 'root' }); }
|
|
2154
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ApiSecurityService, deps: [{ token: i1$3.HttpClient }, { token: ConfigServiceBase }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2155
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ApiSecurityService, providedIn: 'root' }); }
|
|
2213
2156
|
}
|
|
2214
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type:
|
|
2157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ApiSecurityService, decorators: [{
|
|
2215
2158
|
type: Injectable,
|
|
2216
2159
|
args: [{
|
|
2217
|
-
providedIn: 'root'
|
|
2160
|
+
providedIn: 'root'
|
|
2218
2161
|
}]
|
|
2219
|
-
}], ctorParameters: () => [{ type:
|
|
2220
|
-
|
|
2221
|
-
class InitCompanyAuthDialogDetails extends BaseEntity {
|
|
2222
|
-
constructor({ image, companyName, } = {}) {
|
|
2223
|
-
super();
|
|
2224
|
-
this.image = image;
|
|
2225
|
-
this.companyName = companyName;
|
|
2226
|
-
}
|
|
2227
|
-
static { this.typeName = 'InitCompanyAuthDialogDetails'; }
|
|
2228
|
-
}
|
|
2162
|
+
}], ctorParameters: () => [{ type: i1$3.HttpClient }, { type: ConfigServiceBase }] });
|
|
2229
2163
|
|
|
2230
|
-
class
|
|
2164
|
+
class AuthServiceBase {
|
|
2231
2165
|
constructor(router, http, externalAuthService, apiService, config, platformId) {
|
|
2232
2166
|
this.router = router;
|
|
2233
2167
|
this.http = http;
|
|
@@ -2423,284 +2357,19 @@ class AuthBaseService {
|
|
|
2423
2357
|
}
|
|
2424
2358
|
this.onAfterNgOnDestroy();
|
|
2425
2359
|
}
|
|
2426
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type:
|
|
2427
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type:
|
|
2360
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: AuthServiceBase, deps: [{ token: i3$2.Router }, { token: i1$3.HttpClient }, { token: i3$4.SocialAuthService }, { token: ApiSecurityService }, { token: ConfigServiceBase }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2361
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: AuthServiceBase, providedIn: 'root' }); }
|
|
2428
2362
|
}
|
|
2429
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type:
|
|
2363
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: AuthServiceBase, decorators: [{
|
|
2430
2364
|
type: Injectable,
|
|
2431
2365
|
args: [{
|
|
2432
2366
|
providedIn: 'root'
|
|
2433
2367
|
}]
|
|
2434
|
-
}], ctorParameters: () => [{ type: i3$2.Router }, { type: i1$
|
|
2368
|
+
}], ctorParameters: () => [{ type: i3$2.Router }, { type: i1$3.HttpClient }, { type: i3$4.SocialAuthService }, { type: ApiSecurityService }, { type: ConfigServiceBase }, { type: Object, decorators: [{
|
|
2435
2369
|
type: Inject,
|
|
2436
2370
|
args: [PLATFORM_ID]
|
|
2437
2371
|
}] }] });
|
|
2438
2372
|
|
|
2439
|
-
class RoleBaseDetailsComponent {
|
|
2440
|
-
constructor(apiService, route, baseFormService, authService) {
|
|
2441
|
-
this.apiService = apiService;
|
|
2442
|
-
this.route = route;
|
|
2443
|
-
this.baseFormService = baseFormService;
|
|
2444
|
-
this.authService = authService;
|
|
2445
|
-
this.onSave = new EventEmitter();
|
|
2446
|
-
this.onAfterFormGroupInit = new EventEmitter();
|
|
2447
|
-
this.additionalButtons = [];
|
|
2448
|
-
this.showBigPanelTitle = true;
|
|
2449
|
-
this.handleAdditionalSaveAuthorization = () => Promise.resolve(true);
|
|
2450
|
-
this.isAuthorizedForSave = false;
|
|
2451
|
-
this.onIsAuthorizedForSaveChange = new EventEmitter();
|
|
2452
|
-
this.loading = true;
|
|
2453
|
-
this.handleAuthorizationForSave = async () => {
|
|
2454
|
-
const currentUserPermissionCodes = await firstValueFrom(this.authService.currentUserPermissionCodes$);
|
|
2455
|
-
const isAdditionallyAuthorizedForSave = await this.handleAdditionalSaveAuthorization();
|
|
2456
|
-
this.isAuthorizedForSave =
|
|
2457
|
-
(currentUserPermissionCodes.includes('InsertRole') && this.modelId <= 0) ||
|
|
2458
|
-
(currentUserPermissionCodes.includes('UpdateRole') && this.modelId > 0) ||
|
|
2459
|
-
isAdditionallyAuthorizedForSave;
|
|
2460
|
-
if (this.isAuthorizedForSave) {
|
|
2461
|
-
this.parentFormGroup.enable();
|
|
2462
|
-
}
|
|
2463
|
-
else {
|
|
2464
|
-
this.parentFormGroup.disable();
|
|
2465
|
-
}
|
|
2466
|
-
this.onIsAuthorizedForSaveChange.next(new IsAuthorizedForSaveEvent({
|
|
2467
|
-
isAuthorizedForSave: this.isAuthorizedForSave,
|
|
2468
|
-
}));
|
|
2469
|
-
};
|
|
2470
|
-
}
|
|
2471
|
-
ngOnInit() {
|
|
2472
|
-
this.parentFormGroup.initSaveBody = () => {
|
|
2473
|
-
let saveBody = new RoleSaveBody();
|
|
2474
|
-
saveBody = this.baseFormService.mapMainUIFormToSaveBody(RoleMainUIForm, this.parentFormGroup.getRawValue());
|
|
2475
|
-
return saveBody;
|
|
2476
|
-
};
|
|
2477
|
-
this.parentFormGroup.saveObservableMethod = this.apiService.saveRole;
|
|
2478
|
-
this.route.params.subscribe(async (params) => {
|
|
2479
|
-
this.modelId = params['id'];
|
|
2480
|
-
this.apiService.getPermissionsDropdownListForRole().subscribe(po => {
|
|
2481
|
-
this.permissionsForRoleOptions = po;
|
|
2482
|
-
});
|
|
2483
|
-
if (this.modelId > 0) {
|
|
2484
|
-
forkJoin({
|
|
2485
|
-
mainUIFormDTO: this.apiService.getRoleMainUIFormDTO(this.modelId)
|
|
2486
|
-
})
|
|
2487
|
-
.subscribe(async ({ mainUIFormDTO }) => {
|
|
2488
|
-
this.baseFormService.initFormGroup(this.parentFormGroup, RoleMainUIForm, mainUIFormDTO);
|
|
2489
|
-
await this.handleAuthorizationForSave();
|
|
2490
|
-
this.loading = false;
|
|
2491
|
-
this.onAfterFormGroupInit.next();
|
|
2492
|
-
});
|
|
2493
|
-
}
|
|
2494
|
-
else {
|
|
2495
|
-
this.baseFormService.initFormGroup(this.parentFormGroup, RoleMainUIForm);
|
|
2496
|
-
await this.handleAuthorizationForSave();
|
|
2497
|
-
this.loading = false;
|
|
2498
|
-
this.onAfterFormGroupInit.next();
|
|
2499
|
-
}
|
|
2500
|
-
});
|
|
2501
|
-
}
|
|
2502
|
-
searchUsersForRole(event) {
|
|
2503
|
-
this.apiService.getUsersAutocompleteListForRole(50, event?.query ?? '').subscribe(no => {
|
|
2504
|
-
this.usersForRoleOptions = no;
|
|
2505
|
-
});
|
|
2506
|
-
}
|
|
2507
|
-
save() {
|
|
2508
|
-
this.onSave.next();
|
|
2509
|
-
}
|
|
2510
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: RoleBaseDetailsComponent, deps: [{ token: ApiSecurityService }, { token: i3$2.ActivatedRoute }, { token: BaseFormService }, { token: AuthBaseService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2511
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.13", type: RoleBaseDetailsComponent, isStandalone: true, selector: "role-base-details", inputs: { getCrudMenuForOrderedData: "getCrudMenuForOrderedData", parentFormGroup: "parentFormGroup", additionalButtons: "additionalButtons", panelTitle: "panelTitle", showBigPanelTitle: "showBigPanelTitle", panelIcon: "panelIcon", handleAdditionalSaveAuthorization: "handleAdditionalSaveAuthorization" }, outputs: { onSave: "onSave", onAfterFormGroupInit: "onAfterFormGroupInit", onIsAuthorizedForSaveChange: "onIsAuthorizedForSaveChange" }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <spiderly-panel>\n <panel-header [title]=\"panelTitle\" [showBigTitle]=\"showBigPanelTitle\" [icon]=\"panelIcon\"></panel-header>\n\n <panel-body>\n <form *ngIf=\"loading === false\" class=\"grid\"> <!-- FT: Don't put @deffer it's not working as expected -->\n <div class=\"col-12\">\n <spiderly-textbox [control]=\"parentFormGroup.controls.roleDTO.getControl('name')\"></spiderly-textbox>\n </div>\n <div class=\"col-12\">\n <spiderly-textarea [control]=\"parentFormGroup.controls.roleDTO.getControl('description')\"></spiderly-textarea>\n </div>\n <div class=\"col-12\">\n <spiderly-multiautocomplete [control]=\"parentFormGroup.controls.usersNamebookDTOList\" [options]=\"usersForRoleOptions\" (onTextInput)=\"searchUsersForRole($event)\" [label]=\"t('Users')\"></spiderly-multiautocomplete>\n </div>\n <div class=\"col-12\">\n <spiderly-multiselect [control]=\"parentFormGroup.controls.permissionsIds\" [options]=\"permissionsForRoleOptions\" [label]=\"t('Permissions')\"></spiderly-multiselect>\n </div>\n </form>\n\n <card-skeleton *ngIf=\"loading === true\" [height]=\"502\"></card-skeleton>\n\n </panel-body>\n\n <panel-footer>\n <spiderly-button [disabled]=\"!isAuthorizedForSave\" (onClick)=\"save()\" [label]=\"t('Save')\" icon=\"pi pi-save\"></spiderly-button>\n @for (button of additionalButtons; track button.label) {\n <spiderly-button (onClick)=\"button.onClick()\" [disabled]=\"button.disabled\" [label]=\"button.label\" [icon]=\"button.icon\"></spiderly-button>\n }\n <return-button></return-button>\n </panel-footer>\n </spiderly-panel>\n</ng-container>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: CardSkeletonComponent, selector: "card-skeleton", inputs: ["height"] }, { kind: "component", type: SpiderlyTextboxComponent, selector: "spiderly-textbox", inputs: ["showButton", "buttonIcon"], outputs: ["onButtonClick"] }, { kind: "component", type: SpiderlyTextareaComponent, selector: "spiderly-textarea" }, { kind: "component", type: SpiderlyMultiAutocompleteComponent, selector: "spiderly-multiautocomplete" }, { kind: "component", type: SpiderlyMultiSelectComponent, selector: "spiderly-multiselect" }, { kind: "ngmodule", type: SpiderlyPanelsModule }, { kind: "component", type: PanelHeaderComponent, selector: "panel-header", inputs: ["title", "showBigTitle", "showIcon", "icon", "index", "tabs"] }, { kind: "component", type: PanelBodyComponent, selector: "panel-body", inputs: ["normalBottomPadding"] }, { kind: "component", type: PanelFooterComponent, selector: "panel-footer" }, { kind: "component", type: SpiderlyPanelComponent, selector: "spiderly-panel", inputs: ["isFirstMultiplePanel", "isMiddleMultiplePanel", "isLastMultiplePanel", "toggleable", "toggler", "collapsed", "crudMenu", "showCrudMenu", "showRemoveIcon", "index", "showPanelHeader"], outputs: ["onMenuIconClick", "onRemoveIconClick"] }, { kind: "component", type: SpiderlyButtonComponent, selector: "spiderly-button", inputs: ["type"] }, { kind: "component", type: SpiderlyReturnButtonComponent, selector: "return-button", inputs: ["navigateUrl"] }] }); }
|
|
2512
|
-
}
|
|
2513
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: RoleBaseDetailsComponent, decorators: [{
|
|
2514
|
-
type: Component,
|
|
2515
|
-
args: [{ selector: 'role-base-details', imports: [
|
|
2516
|
-
CommonModule,
|
|
2517
|
-
FormsModule,
|
|
2518
|
-
ReactiveFormsModule,
|
|
2519
|
-
TranslocoDirective,
|
|
2520
|
-
CardSkeletonComponent,
|
|
2521
|
-
SpiderlyTextboxComponent,
|
|
2522
|
-
SpiderlyTextareaComponent,
|
|
2523
|
-
SpiderlyMultiAutocompleteComponent,
|
|
2524
|
-
SpiderlyMultiSelectComponent,
|
|
2525
|
-
SpiderlyPanelsModule,
|
|
2526
|
-
SpiderlyButtonComponent,
|
|
2527
|
-
SpiderlyReturnButtonComponent
|
|
2528
|
-
], template: "<ng-container *transloco=\"let t\">\n <spiderly-panel>\n <panel-header [title]=\"panelTitle\" [showBigTitle]=\"showBigPanelTitle\" [icon]=\"panelIcon\"></panel-header>\n\n <panel-body>\n <form *ngIf=\"loading === false\" class=\"grid\"> <!-- FT: Don't put @deffer it's not working as expected -->\n <div class=\"col-12\">\n <spiderly-textbox [control]=\"parentFormGroup.controls.roleDTO.getControl('name')\"></spiderly-textbox>\n </div>\n <div class=\"col-12\">\n <spiderly-textarea [control]=\"parentFormGroup.controls.roleDTO.getControl('description')\"></spiderly-textarea>\n </div>\n <div class=\"col-12\">\n <spiderly-multiautocomplete [control]=\"parentFormGroup.controls.usersNamebookDTOList\" [options]=\"usersForRoleOptions\" (onTextInput)=\"searchUsersForRole($event)\" [label]=\"t('Users')\"></spiderly-multiautocomplete>\n </div>\n <div class=\"col-12\">\n <spiderly-multiselect [control]=\"parentFormGroup.controls.permissionsIds\" [options]=\"permissionsForRoleOptions\" [label]=\"t('Permissions')\"></spiderly-multiselect>\n </div>\n </form>\n\n <card-skeleton *ngIf=\"loading === true\" [height]=\"502\"></card-skeleton>\n\n </panel-body>\n\n <panel-footer>\n <spiderly-button [disabled]=\"!isAuthorizedForSave\" (onClick)=\"save()\" [label]=\"t('Save')\" icon=\"pi pi-save\"></spiderly-button>\n @for (button of additionalButtons; track button.label) {\n <spiderly-button (onClick)=\"button.onClick()\" [disabled]=\"button.disabled\" [label]=\"button.label\" [icon]=\"button.icon\"></spiderly-button>\n }\n <return-button></return-button>\n </panel-footer>\n </spiderly-panel>\n</ng-container>" }]
|
|
2529
|
-
}], ctorParameters: () => [{ type: ApiSecurityService }, { type: i3$2.ActivatedRoute }, { type: BaseFormService }, { type: AuthBaseService }], propDecorators: { onSave: [{
|
|
2530
|
-
type: Output
|
|
2531
|
-
}], onAfterFormGroupInit: [{
|
|
2532
|
-
type: Output
|
|
2533
|
-
}], getCrudMenuForOrderedData: [{
|
|
2534
|
-
type: Input
|
|
2535
|
-
}], parentFormGroup: [{
|
|
2536
|
-
type: Input
|
|
2537
|
-
}], additionalButtons: [{
|
|
2538
|
-
type: Input
|
|
2539
|
-
}], panelTitle: [{
|
|
2540
|
-
type: Input
|
|
2541
|
-
}], showBigPanelTitle: [{
|
|
2542
|
-
type: Input
|
|
2543
|
-
}], panelIcon: [{
|
|
2544
|
-
type: Input
|
|
2545
|
-
}], handleAdditionalSaveAuthorization: [{
|
|
2546
|
-
type: Input
|
|
2547
|
-
}], onIsAuthorizedForSaveChange: [{
|
|
2548
|
-
type: Output
|
|
2549
|
-
}] } });
|
|
2550
|
-
|
|
2551
|
-
class BaseFormCopy {
|
|
2552
|
-
constructor(differs, http, messageService, changeDetectorRef, router, route, translocoService, baseFormService) {
|
|
2553
|
-
this.differs = differs;
|
|
2554
|
-
this.http = http;
|
|
2555
|
-
this.messageService = messageService;
|
|
2556
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
2557
|
-
this.router = router;
|
|
2558
|
-
this.route = route;
|
|
2559
|
-
this.translocoService = translocoService;
|
|
2560
|
-
this.baseFormService = baseFormService;
|
|
2561
|
-
this.parentFormGroup = new SpiderlyFormGroup({});
|
|
2562
|
-
this.successfulSaveToastDescription = this.translocoService.translate('SuccessfulSaveToastDescription');
|
|
2563
|
-
//#region Model
|
|
2564
|
-
// onSave method is here only because of the hooks, we should move everything except them to the BaseFromService
|
|
2565
|
-
this.onSave = (reroute = true) => {
|
|
2566
|
-
if (!this.saveBodyClass)
|
|
2567
|
-
throw new SpiderlyError('You did not initialize saveBodyClass');
|
|
2568
|
-
if (!this.mainUIFormClass)
|
|
2569
|
-
throw new SpiderlyError('You did not initialize mainUIFormClass');
|
|
2570
|
-
this.saveBody = this.parentFormGroup.initSaveBody();
|
|
2571
|
-
this.onBeforeSave(this.saveBody);
|
|
2572
|
-
this.saveBody = this.saveBody ?? this.parentFormGroup.getRawValue();
|
|
2573
|
-
const isValid = this.baseFormService.isControlValid(this.parentFormGroup);
|
|
2574
|
-
if (isValid) {
|
|
2575
|
-
this.parentFormGroup.saveObservableMethod(this.saveBody).subscribe(res => {
|
|
2576
|
-
this.messageService.successMessage(this.successfulSaveToastDescription);
|
|
2577
|
-
this.baseFormService.initFormGroup(this.parentFormGroup, this.mainUIFormClass, res);
|
|
2578
|
-
if (reroute) {
|
|
2579
|
-
const saveBodyMainDTOKey = this.baseFormService.getSaveBodyMainDTOKey(this.saveBodyClass);
|
|
2580
|
-
const savedObjectId = res[saveBodyMainDTOKey]?.id;
|
|
2581
|
-
this.rerouteToSavedObject(savedObjectId); // You always need to have id, because of id == 0 and version change
|
|
2582
|
-
}
|
|
2583
|
-
this.onAfterSave();
|
|
2584
|
-
});
|
|
2585
|
-
this.onAfterSaveRequest();
|
|
2586
|
-
}
|
|
2587
|
-
else {
|
|
2588
|
-
this.baseFormService.showInvalidFieldsMessage();
|
|
2589
|
-
}
|
|
2590
|
-
};
|
|
2591
|
-
this.rerouteToSavedObject = (rerouteId) => {
|
|
2592
|
-
if (rerouteId == null) {
|
|
2593
|
-
const currentUrl = this.router.url;
|
|
2594
|
-
const parentUrl = getParentUrl(currentUrl);
|
|
2595
|
-
this.router.navigateByUrl(parentUrl);
|
|
2596
|
-
return;
|
|
2597
|
-
}
|
|
2598
|
-
const segments = this.router.url.split('/');
|
|
2599
|
-
segments[segments.length - 1] = rerouteId.toString();
|
|
2600
|
-
const newUrl = segments.join('/');
|
|
2601
|
-
this.router.navigateByUrl(newUrl);
|
|
2602
|
-
};
|
|
2603
|
-
this.onBeforeSave = (saveBody) => { };
|
|
2604
|
-
this.onAfterSave = () => { };
|
|
2605
|
-
this.onAfterSaveRequest = () => { };
|
|
2606
|
-
}
|
|
2607
|
-
ngOnInit() {
|
|
2608
|
-
}
|
|
2609
|
-
//#endregion
|
|
2610
|
-
//#region Model List
|
|
2611
|
-
getFormArrayControlByIndex(formControlName, formArray, index, filter) {
|
|
2612
|
-
// if(formArray.controlNamesFromHtml.findIndex(x => x === formControlName) === -1)
|
|
2613
|
-
// formArray.controlNamesFromHtml.push(formControlName);
|
|
2614
|
-
let filteredFormGroups;
|
|
2615
|
-
if (filter) {
|
|
2616
|
-
filteredFormGroups = filter(formArray.controls);
|
|
2617
|
-
}
|
|
2618
|
-
else {
|
|
2619
|
-
return formArray.controls[index].controls[formControlName];
|
|
2620
|
-
}
|
|
2621
|
-
return filteredFormGroups[index]?.controls[formControlName]; // FT: Don't change this. It's always possible that change detection occurs before something.
|
|
2622
|
-
}
|
|
2623
|
-
getFormArrayControls(formControlName, formArray, filter) {
|
|
2624
|
-
// if(formArray.controlNamesFromHtml.findIndex(x => x === formControlName) === -1)
|
|
2625
|
-
// formArray.controlNamesFromHtml.push(formControlName);
|
|
2626
|
-
let filteredFormGroups;
|
|
2627
|
-
if (filter) {
|
|
2628
|
-
filteredFormGroups = filter(formArray.controls);
|
|
2629
|
-
}
|
|
2630
|
-
else {
|
|
2631
|
-
return formArray.controls.map(x => x.controls[formControlName]);
|
|
2632
|
-
}
|
|
2633
|
-
return filteredFormGroups.map(x => x.controls[formControlName]);
|
|
2634
|
-
}
|
|
2635
|
-
removeFormControlsFromTheFormArray(formArray, indexes) {
|
|
2636
|
-
// Sort indexes in descending order to avoid index shifts when removing controls
|
|
2637
|
-
const sortedIndexes = indexes.sort((a, b) => b - a);
|
|
2638
|
-
sortedIndexes.forEach(index => {
|
|
2639
|
-
if (index >= 0 && index < formArray.length) {
|
|
2640
|
-
formArray.removeAt(index);
|
|
2641
|
-
}
|
|
2642
|
-
});
|
|
2643
|
-
}
|
|
2644
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: BaseFormCopy, deps: [{ token: i0.KeyValueDiffers }, { token: i1$4.HttpClient }, { token: SpiderlyMessageService }, { token: i0.ChangeDetectorRef }, { token: i3$2.Router }, { token: i3$2.ActivatedRoute }, { token: i1.TranslocoService }, { token: BaseFormService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2645
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: BaseFormCopy, isStandalone: false, selector: "base-form", ngImport: i0, template: '', isInline: true }); }
|
|
2646
|
-
}
|
|
2647
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: BaseFormCopy, decorators: [{
|
|
2648
|
-
type: Component,
|
|
2649
|
-
args: [{ selector: 'base-form', template: '', standalone: false }]
|
|
2650
|
-
}], ctorParameters: () => [{ type: i0.KeyValueDiffers }, { type: i1$4.HttpClient }, { type: SpiderlyMessageService }, { type: i0.ChangeDetectorRef }, { type: i3$2.Router }, { type: i3$2.ActivatedRoute }, { type: i1.TranslocoService }, { type: BaseFormService }] });
|
|
2651
|
-
|
|
2652
|
-
class VerificationWrapperComponent extends BaseFormCopy {
|
|
2653
|
-
constructor(differs, http, messageService, changeDetectorRef, router, route, translocoService, baseFormService) {
|
|
2654
|
-
super(differs, http, messageService, changeDetectorRef, router, route, translocoService, baseFormService);
|
|
2655
|
-
this.differs = differs;
|
|
2656
|
-
this.http = http;
|
|
2657
|
-
this.messageService = messageService;
|
|
2658
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
2659
|
-
this.router = router;
|
|
2660
|
-
this.route = route;
|
|
2661
|
-
this.translocoService = translocoService;
|
|
2662
|
-
this.baseFormService = baseFormService;
|
|
2663
|
-
this.verificationTokenRequestFormGroup = new SpiderlyFormGroup({});
|
|
2664
|
-
this.onResendVerificationToken = new EventEmitter();
|
|
2665
|
-
this.onCodeSubmit = new EventEmitter();
|
|
2666
|
-
}
|
|
2667
|
-
ngOnInit() {
|
|
2668
|
-
this.initVerificationTokenRequestFormGroup(new VerificationTokenRequest({ email: this.email }));
|
|
2669
|
-
}
|
|
2670
|
-
initVerificationTokenRequestFormGroup(model) {
|
|
2671
|
-
this.baseFormService.initFormGroup(this.verificationTokenRequestFormGroup, VerificationTokenRequest, model, ['verificationCode']);
|
|
2672
|
-
}
|
|
2673
|
-
codeSubmit() {
|
|
2674
|
-
let isValid = this.baseFormService.isControlValid(this.verificationTokenRequestFormGroup);
|
|
2675
|
-
if (isValid) {
|
|
2676
|
-
this.onCodeSubmit.next(this.verificationTokenRequestFormGroup.controls.verificationCode.getRawValue());
|
|
2677
|
-
}
|
|
2678
|
-
}
|
|
2679
|
-
resendVerificationToken() {
|
|
2680
|
-
this.onResendVerificationToken.next(null);
|
|
2681
|
-
}
|
|
2682
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: VerificationWrapperComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i1$4.HttpClient }, { token: SpiderlyMessageService }, { token: i0.ChangeDetectorRef }, { token: i3$2.Router }, { token: i3$2.ActivatedRoute }, { token: i1.TranslocoService }, { token: BaseFormService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2683
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.13", type: VerificationWrapperComponent, isStandalone: true, selector: "verification-wrapper", inputs: { email: "email" }, outputs: { onResendVerificationToken: "onResendVerificationToken", onCodeSubmit: "onCodeSubmit" }, usesInheritance: true, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <div class=\"min-h-screen\" style=\"display: flex; justify-content: center; align-items: center;\">\n <div class=\"dialog\" style=\"padding: 0px;\">\n @if (verificationTokenRequestFormGroup != null) {\n <spiderly-panel>\n <panel-header [title]=\"t('AccountVerificationHeader')\" [showBigTitle]=\"true\" icon=\"pi pi-envelope\"></panel-header>\n \n <panel-body>\n <form class=\"grid\">\n <div class=\"col-12\">\n <div style=\"font-size: 17.5px\">{{t('AccountVerificationTitle')}}</div>\n </div>\n <div class=\"col-12\">\n {{t('AccountVerificationDescription', {email: email})}}\n </div>\n <div class=\"col-12\">\n <spiderly-textbox [control]=\"verificationTokenRequestFormGroup.getControl('verificationCode')\"></spiderly-textbox>\n </div>\n <div class=\"col-12\">\n <spiderly-button (onClick)=\"codeSubmit()\" [label]=\"t('Submit')\" icon=\"pi pi-verified\" type=\"submit\"></spiderly-button>\n </div>\n </form>\n </panel-body>\n \n <panel-footer>\n <a pButton class=\"p-button-link\" [label]=\"t('GoToGmail')\" icon=\"pi pi-external-link\" href=\"https://mail.google.com/mail/u/\" target=\"_blank\" rel=\"noopener noreferrer\"></a>\n <a pButton class=\"p-button-link\" [label]=\"t('GoToYahoo')\" icon=\"pi pi-external-link\" href=\"https://mail.yahoo.com/d/folders/1/\" target=\"_blank\" rel=\"noopener noreferrer\"></a>\n </panel-footer>\n <panel-footer>\n <div>{{t('ResendVerificationCodeFirstPart')}} <a class=\"link\" (click)=\"resendVerificationToken()\">{{t('ResendVerificationCodeLinkSecondPart')}}</a></div>\n </panel-footer>\n </spiderly-panel>\n }\n @else {\n <!-- TODO FT: Add skeleton -->\n }\n </div>\n </div>\n</ng-container>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: SpiderlyControlsModule }, { kind: "component", type: SpiderlyTextboxComponent, selector: "spiderly-textbox", inputs: ["showButton", "buttonIcon"], outputs: ["onButtonClick"] }, { kind: "component", type: SpiderlyButtonComponent, selector: "spiderly-button", inputs: ["type"] }, { kind: "ngmodule", type: SpiderlyPanelsModule }, { kind: "component", type: PanelHeaderComponent, selector: "panel-header", inputs: ["title", "showBigTitle", "showIcon", "icon", "index", "tabs"] }, { kind: "component", type: PanelBodyComponent, selector: "panel-body", inputs: ["normalBottomPadding"] }, { kind: "component", type: PanelFooterComponent, selector: "panel-footer" }, { kind: "component", type: SpiderlyPanelComponent, selector: "spiderly-panel", inputs: ["isFirstMultiplePanel", "isMiddleMultiplePanel", "isLastMultiplePanel", "toggleable", "toggler", "collapsed", "crudMenu", "showCrudMenu", "showRemoveIcon", "index", "showPanelHeader"], outputs: ["onMenuIconClick", "onRemoveIconClick"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] }); }
|
|
2684
|
-
}
|
|
2685
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: VerificationWrapperComponent, decorators: [{
|
|
2686
|
-
type: Component,
|
|
2687
|
-
args: [{ selector: 'verification-wrapper', imports: [
|
|
2688
|
-
CommonModule,
|
|
2689
|
-
FormsModule,
|
|
2690
|
-
ReactiveFormsModule,
|
|
2691
|
-
SpiderlyControlsModule,
|
|
2692
|
-
SpiderlyPanelsModule,
|
|
2693
|
-
ButtonModule,
|
|
2694
|
-
TranslocoDirective,
|
|
2695
|
-
], template: "<ng-container *transloco=\"let t\">\n <div class=\"min-h-screen\" style=\"display: flex; justify-content: center; align-items: center;\">\n <div class=\"dialog\" style=\"padding: 0px;\">\n @if (verificationTokenRequestFormGroup != null) {\n <spiderly-panel>\n <panel-header [title]=\"t('AccountVerificationHeader')\" [showBigTitle]=\"true\" icon=\"pi pi-envelope\"></panel-header>\n \n <panel-body>\n <form class=\"grid\">\n <div class=\"col-12\">\n <div style=\"font-size: 17.5px\">{{t('AccountVerificationTitle')}}</div>\n </div>\n <div class=\"col-12\">\n {{t('AccountVerificationDescription', {email: email})}}\n </div>\n <div class=\"col-12\">\n <spiderly-textbox [control]=\"verificationTokenRequestFormGroup.getControl('verificationCode')\"></spiderly-textbox>\n </div>\n <div class=\"col-12\">\n <spiderly-button (onClick)=\"codeSubmit()\" [label]=\"t('Submit')\" icon=\"pi pi-verified\" type=\"submit\"></spiderly-button>\n </div>\n </form>\n </panel-body>\n \n <panel-footer>\n <a pButton class=\"p-button-link\" [label]=\"t('GoToGmail')\" icon=\"pi pi-external-link\" href=\"https://mail.google.com/mail/u/\" target=\"_blank\" rel=\"noopener noreferrer\"></a>\n <a pButton class=\"p-button-link\" [label]=\"t('GoToYahoo')\" icon=\"pi pi-external-link\" href=\"https://mail.yahoo.com/d/folders/1/\" target=\"_blank\" rel=\"noopener noreferrer\"></a>\n </panel-footer>\n <panel-footer>\n <div>{{t('ResendVerificationCodeFirstPart')}} <a class=\"link\" (click)=\"resendVerificationToken()\">{{t('ResendVerificationCodeLinkSecondPart')}}</a></div>\n </panel-footer>\n </spiderly-panel>\n }\n @else {\n <!-- TODO FT: Add skeleton -->\n }\n </div>\n </div>\n</ng-container>" }]
|
|
2696
|
-
}], ctorParameters: () => [{ type: i0.KeyValueDiffers }, { type: i1$4.HttpClient }, { type: SpiderlyMessageService }, { type: i0.ChangeDetectorRef }, { type: i3$2.Router }, { type: i3$2.ActivatedRoute }, { type: i1.TranslocoService }, { type: BaseFormService }], propDecorators: { email: [{
|
|
2697
|
-
type: Input
|
|
2698
|
-
}], onResendVerificationToken: [{
|
|
2699
|
-
type: Output
|
|
2700
|
-
}], onCodeSubmit: [{
|
|
2701
|
-
type: Output
|
|
2702
|
-
}] } });
|
|
2703
|
-
|
|
2704
2373
|
class LoginVerificationComponent {
|
|
2705
2374
|
constructor(authService, messageService, translocoService) {
|
|
2706
2375
|
this.authService = authService;
|
|
@@ -2720,7 +2389,7 @@ class LoginVerificationComponent {
|
|
|
2720
2389
|
this.authService.navigateToDashboard();
|
|
2721
2390
|
});
|
|
2722
2391
|
}
|
|
2723
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: LoginVerificationComponent, deps: [{ token:
|
|
2392
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: LoginVerificationComponent, deps: [{ token: AuthServiceBase }, { token: SpiderlyMessageService }, { token: i1.TranslocoService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2724
2393
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: LoginVerificationComponent, isStandalone: true, selector: "login-verification", inputs: { email: "email", userId: "userId" }, ngImport: i0, template: "<verification-wrapper [email]=\"email\" (onResendVerificationToken)=\"resendVerificationToken()\" (onCodeSubmit)=\"onCodeSubmit($event)\"></verification-wrapper>\n\n", dependencies: [{ kind: "component", type: VerificationWrapperComponent, selector: "verification-wrapper", inputs: ["email"], outputs: ["onResendVerificationToken", "onCodeSubmit"] }] }); }
|
|
2725
2394
|
}
|
|
2726
2395
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: LoginVerificationComponent, decorators: [{
|
|
@@ -2728,7 +2397,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
2728
2397
|
args: [{ selector: 'login-verification', imports: [
|
|
2729
2398
|
VerificationWrapperComponent
|
|
2730
2399
|
], template: "<verification-wrapper [email]=\"email\" (onResendVerificationToken)=\"resendVerificationToken()\" (onCodeSubmit)=\"onCodeSubmit($event)\"></verification-wrapper>\n\n" }]
|
|
2731
|
-
}], ctorParameters: () => [{ type:
|
|
2400
|
+
}], ctorParameters: () => [{ type: AuthServiceBase }, { type: SpiderlyMessageService }, { type: i1.TranslocoService }], propDecorators: { email: [{
|
|
2732
2401
|
type: Input
|
|
2733
2402
|
}], userId: [{
|
|
2734
2403
|
type: Input
|
|
@@ -2762,8 +2431,7 @@ class AuthComponent {
|
|
|
2762
2431
|
this.authService = authService;
|
|
2763
2432
|
this.initCompanyAuthDialogDetailsSubscription = null;
|
|
2764
2433
|
this.onCompanyNameChange = new EventEmitter();
|
|
2765
|
-
this.showGoogleAuth =
|
|
2766
|
-
this.hasGoogleAuth = this.config.googleAuth;
|
|
2434
|
+
this.showGoogleAuth = false;
|
|
2767
2435
|
}
|
|
2768
2436
|
ngOnInit() {
|
|
2769
2437
|
this.initCompanyDetails();
|
|
@@ -2785,8 +2453,8 @@ class AuthComponent {
|
|
|
2785
2453
|
this.initCompanyAuthDialogDetailsSubscription.unsubscribe();
|
|
2786
2454
|
}
|
|
2787
2455
|
}
|
|
2788
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: AuthComponent, deps: [{ token:
|
|
2789
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: AuthComponent, isStandalone: true, selector: "auth", inputs: { showGoogleAuth: "showGoogleAuth" }, outputs: { onCompanyNameChange: "onCompanyNameChange" }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <div class=\"flex min-h-screen overflow-hidden\" style=\"padding: 20px;\">\n <div class=\"flex flex-column w-full\">\n <div class=\"w-full sm:w-30rem\" style=\"margin: auto; border-radius:50px; padding:0.3rem; background: linear-gradient(180deg, var(--p-primary-color) 10%, rgba(33, 150, 243, 0) 30%);\">\n <div class=\"surface-card py-6 px-5 sm:px-6\" style=\"border-radius:45px;\">\n <div class=\"text-center\" style=\"margin-bottom: 38px;\">\n <img *ngIf=\"image != null\" [src]=\"image\" alt=\"{{companyName}} Logo\" title=\"{{companyName}} Logo\" height=\"60\">\n <i *ngIf=\"image == null\" class=\"pi pi-spin pi-spinner primary-color\" style=\"font-size: 2rem\"></i>\n </div>\n\n <ng-content></ng-content>\n \n <div *ngIf=\"
|
|
2456
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: AuthComponent, deps: [{ token: ConfigServiceBase }, { token: AuthServiceBase }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2457
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: AuthComponent, isStandalone: true, selector: "auth", inputs: { showGoogleAuth: "showGoogleAuth" }, outputs: { onCompanyNameChange: "onCompanyNameChange" }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <div class=\"flex min-h-screen overflow-hidden\" style=\"padding: 20px;\">\n <div class=\"flex flex-column w-full\">\n <div class=\"w-full sm:w-30rem\" style=\"margin: auto; border-radius:50px; padding:0.3rem; background: linear-gradient(180deg, var(--p-primary-color) 10%, rgba(33, 150, 243, 0) 30%);\">\n <div class=\"surface-card py-6 px-5 sm:px-6\" style=\"border-radius:45px;\">\n <div class=\"text-center\" style=\"margin-bottom: 38px;\">\n <img *ngIf=\"image != null\" [src]=\"image\" alt=\"{{companyName}} Logo\" title=\"{{companyName}} Logo\" height=\"60\">\n <i *ngIf=\"image == null\" class=\"pi pi-spin pi-spinner primary-color\" style=\"font-size: 2rem\"></i>\n </div>\n\n <ng-content></ng-content>\n \n <div *ngIf=\"showGoogleAuth\">\n <div style=\"display: flex; align-items: center; gap: 7px; justify-content: center; margin-bottom: 16px;\">\n <div class=\"separator\"></div>\n <div>{{t('or')}}</div>\n <div class=\"separator\"></div>\n </div>\n <div>\n <!-- https://code-maze.com/how-to-sign-in-with-google-angular-aspnet-webapi/ -->\n <google-button (loginWithGoogle)=\"onGoogleSignIn($event)\" [label]=\"t('ContinueWithGoogle')\"></google-button> \n </div>\n </div>\n \n </div>\n </div>\n </div>\n </div>\n</ng-container>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: GoogleButtonComponent, selector: "google-button", inputs: ["label"], outputs: ["loginWithGoogle"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] }); }
|
|
2790
2458
|
}
|
|
2791
2459
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: AuthComponent, decorators: [{
|
|
2792
2460
|
type: Component,
|
|
@@ -2794,8 +2462,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
2794
2462
|
CommonModule,
|
|
2795
2463
|
GoogleButtonComponent,
|
|
2796
2464
|
TranslocoDirective,
|
|
2797
|
-
], template: "<ng-container *transloco=\"let t\">\n <div class=\"flex min-h-screen overflow-hidden\" style=\"padding: 20px;\">\n <div class=\"flex flex-column w-full\">\n <div class=\"w-full sm:w-30rem\" style=\"margin: auto; border-radius:50px; padding:0.3rem; background: linear-gradient(180deg, var(--p-primary-color) 10%, rgba(33, 150, 243, 0) 30%);\">\n <div class=\"surface-card py-6 px-5 sm:px-6\" style=\"border-radius:45px;\">\n <div class=\"text-center\" style=\"margin-bottom: 38px;\">\n <img *ngIf=\"image != null\" [src]=\"image\" alt=\"{{companyName}} Logo\" title=\"{{companyName}} Logo\" height=\"60\">\n <i *ngIf=\"image == null\" class=\"pi pi-spin pi-spinner primary-color\" style=\"font-size: 2rem\"></i>\n </div>\n\n <ng-content></ng-content>\n \n <div *ngIf=\"
|
|
2798
|
-
}], ctorParameters: () => [{ type:
|
|
2465
|
+
], template: "<ng-container *transloco=\"let t\">\n <div class=\"flex min-h-screen overflow-hidden\" style=\"padding: 20px;\">\n <div class=\"flex flex-column w-full\">\n <div class=\"w-full sm:w-30rem\" style=\"margin: auto; border-radius:50px; padding:0.3rem; background: linear-gradient(180deg, var(--p-primary-color) 10%, rgba(33, 150, 243, 0) 30%);\">\n <div class=\"surface-card py-6 px-5 sm:px-6\" style=\"border-radius:45px;\">\n <div class=\"text-center\" style=\"margin-bottom: 38px;\">\n <img *ngIf=\"image != null\" [src]=\"image\" alt=\"{{companyName}} Logo\" title=\"{{companyName}} Logo\" height=\"60\">\n <i *ngIf=\"image == null\" class=\"pi pi-spin pi-spinner primary-color\" style=\"font-size: 2rem\"></i>\n </div>\n\n <ng-content></ng-content>\n \n <div *ngIf=\"showGoogleAuth\">\n <div style=\"display: flex; align-items: center; gap: 7px; justify-content: center; margin-bottom: 16px;\">\n <div class=\"separator\"></div>\n <div>{{t('or')}}</div>\n <div class=\"separator\"></div>\n </div>\n <div>\n <!-- https://code-maze.com/how-to-sign-in-with-google-angular-aspnet-webapi/ -->\n <google-button (loginWithGoogle)=\"onGoogleSignIn($event)\" [label]=\"t('ContinueWithGoogle')\"></google-button> \n </div>\n </div>\n \n </div>\n </div>\n </div>\n </div>\n</ng-container>" }]
|
|
2466
|
+
}], ctorParameters: () => [{ type: ConfigServiceBase }, { type: AuthServiceBase }], propDecorators: { onCompanyNameChange: [{
|
|
2799
2467
|
type: Output
|
|
2800
2468
|
}], showGoogleAuth: [{
|
|
2801
2469
|
type: Input
|
|
@@ -2828,14 +2496,19 @@ class LoginComponent extends BaseFormCopy {
|
|
|
2828
2496
|
}
|
|
2829
2497
|
sendLoginVerificationEmail() {
|
|
2830
2498
|
let isFormGroupValid = this.baseFormService.isControlValid(this.loginFormGroup);
|
|
2831
|
-
if (isFormGroupValid == false)
|
|
2499
|
+
if (isFormGroupValid == false) {
|
|
2500
|
+
this.baseFormService.showInvalidFieldsMessage();
|
|
2832
2501
|
return;
|
|
2833
|
-
|
|
2502
|
+
}
|
|
2503
|
+
this.authService.sendLoginVerificationEmail(this.loginFormGroup.getRawValue()).subscribe((result) => {
|
|
2504
|
+
if (result.message) {
|
|
2505
|
+
this.messageService.successMessage(result.message);
|
|
2506
|
+
}
|
|
2834
2507
|
this.showEmailSentDialog = true;
|
|
2835
2508
|
});
|
|
2836
2509
|
}
|
|
2837
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: LoginComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i1$
|
|
2838
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.13", type: LoginComponent, isStandalone: true, selector: "app-login", usesInheritance: true, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n @if (loginFormGroup != null) {\n @if (showEmailSentDialog == false) {\n <auth (onCompanyNameChange)=\"companyNameChange($event)\">\n
|
|
2510
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: LoginComponent, deps: [{ token: i0.KeyValueDiffers }, { token: i1$3.HttpClient }, { token: SpiderlyMessageService }, { token: i0.ChangeDetectorRef }, { token: i3$2.Router }, { token: i3$2.ActivatedRoute }, { token: i1.TranslocoService }, { token: BaseFormService }, { token: AuthServiceBase }, { token: ConfigServiceBase }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2511
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.13", type: LoginComponent, isStandalone: true, selector: "app-login", usesInheritance: true, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n @if (loginFormGroup != null) {\n @if (showEmailSentDialog == false) {\n <auth (onCompanyNameChange)=\"companyNameChange($event)\">\n <!-- We are not loading anything from the server here so we don't need defer block -->\n <form [formGroup]=\"loginFormGroup\" style=\"margin-bottom: 16px;\">\n <div class=\"col-12\" style=\"padding-left: 0; padding-right: 0;\">\n <spiderly-textbox [control]=\"loginFormGroup.getControl('email')\"></spiderly-textbox>\n </div>\n \n <div class=\"mb-4 gap-5\">\n <div class=\"text-center\" style=\"font-size: smaller;\">\n {{t('AgreementsOnRegister')}} <b routerLink=\"/user-agreement\" class=\"primary-color cursor-pointer\">{{t('UserAgreement')}}</b> {{t('and')}} <b routerLink=\"/privacy-policy\" class=\"primary-color cursor-pointer\">{{t('PrivacyPolicy')}}</b>.\n </div>\n </div>\n\n <div style=\"display: flex; flex-direction: column; gap: 16px;\">\n <spiderly-button [label]=\"t('Login')\" (onClick)=\"sendLoginVerificationEmail()\" [outlined]=\"true\" [style]=\"{width: '100%'}\" type=\"submit\"></spiderly-button>\n </div>\n </form>\n </auth>\n }\n @else {\n <login-verification [email]=\"loginFormGroup.controls.email.getRawValue()\"></login-verification>\n }\n }\n @else {\n <!-- TODO: Add skeleton -->\n }\n</ng-container>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: AuthComponent, selector: "auth", inputs: ["showGoogleAuth"], outputs: ["onCompanyNameChange"] }, { kind: "ngmodule", type: SpiderlyControlsModule }, { kind: "component", type: SpiderlyTextboxComponent, selector: "spiderly-textbox", inputs: ["showButton", "buttonIcon"], outputs: ["onButtonClick"] }, { kind: "component", type: SpiderlyButtonComponent, selector: "spiderly-button", inputs: ["type"] }, { kind: "component", type: LoginVerificationComponent, selector: "login-verification", inputs: ["email", "userId"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] }); }
|
|
2839
2512
|
}
|
|
2840
2513
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: LoginComponent, decorators: [{
|
|
2841
2514
|
type: Component,
|
|
@@ -2846,21 +2519,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
2846
2519
|
SpiderlyControlsModule,
|
|
2847
2520
|
LoginVerificationComponent,
|
|
2848
2521
|
TranslocoDirective,
|
|
2849
|
-
], template: "<ng-container *transloco=\"let t\">\n @if (loginFormGroup != null) {\n @if (showEmailSentDialog == false) {\n <auth (onCompanyNameChange)=\"companyNameChange($event)\">\n
|
|
2850
|
-
}], ctorParameters: () => [{ type: i0.KeyValueDiffers }, { type: i1$
|
|
2522
|
+
], template: "<ng-container *transloco=\"let t\">\n @if (loginFormGroup != null) {\n @if (showEmailSentDialog == false) {\n <auth (onCompanyNameChange)=\"companyNameChange($event)\">\n <!-- We are not loading anything from the server here so we don't need defer block -->\n <form [formGroup]=\"loginFormGroup\" style=\"margin-bottom: 16px;\">\n <div class=\"col-12\" style=\"padding-left: 0; padding-right: 0;\">\n <spiderly-textbox [control]=\"loginFormGroup.getControl('email')\"></spiderly-textbox>\n </div>\n \n <div class=\"mb-4 gap-5\">\n <div class=\"text-center\" style=\"font-size: smaller;\">\n {{t('AgreementsOnRegister')}} <b routerLink=\"/user-agreement\" class=\"primary-color cursor-pointer\">{{t('UserAgreement')}}</b> {{t('and')}} <b routerLink=\"/privacy-policy\" class=\"primary-color cursor-pointer\">{{t('PrivacyPolicy')}}</b>.\n </div>\n </div>\n\n <div style=\"display: flex; flex-direction: column; gap: 16px;\">\n <spiderly-button [label]=\"t('Login')\" (onClick)=\"sendLoginVerificationEmail()\" [outlined]=\"true\" [style]=\"{width: '100%'}\" type=\"submit\"></spiderly-button>\n </div>\n </form>\n </auth>\n }\n @else {\n <login-verification [email]=\"loginFormGroup.controls.email.getRawValue()\"></login-verification>\n }\n }\n @else {\n <!-- TODO: Add skeleton -->\n }\n</ng-container>" }]
|
|
2523
|
+
}], ctorParameters: () => [{ type: i0.KeyValueDiffers }, { type: i1$3.HttpClient }, { type: SpiderlyMessageService }, { type: i0.ChangeDetectorRef }, { type: i3$2.Router }, { type: i3$2.ActivatedRoute }, { type: i1.TranslocoService }, { type: BaseFormService }, { type: AuthServiceBase }, { type: ConfigServiceBase }] });
|
|
2851
2524
|
|
|
2852
2525
|
class FooterComponent {
|
|
2853
2526
|
constructor(config) {
|
|
2854
2527
|
this.config = config;
|
|
2855
2528
|
this.companyName = this.config.companyName;
|
|
2856
2529
|
}
|
|
2857
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: FooterComponent, deps: [{ token:
|
|
2530
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: FooterComponent, deps: [{ token: ConfigServiceBase }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2858
2531
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: FooterComponent, isStandalone: true, selector: "footer", ngImport: i0, template: "<div class=\"layout-footer\">\n <span class=\"font-medium ml-2\">{{companyName}}</span>\n</div>\n" }); }
|
|
2859
2532
|
}
|
|
2860
2533
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: FooterComponent, decorators: [{
|
|
2861
2534
|
type: Component,
|
|
2862
2535
|
args: [{ selector: 'footer', standalone: true, template: "<div class=\"layout-footer\">\n <span class=\"font-medium ml-2\">{{companyName}}</span>\n</div>\n" }]
|
|
2863
|
-
}], ctorParameters: () => [{ type:
|
|
2536
|
+
}], ctorParameters: () => [{ type: ConfigServiceBase }] });
|
|
2864
2537
|
|
|
2865
2538
|
class IndexCardComponent {
|
|
2866
2539
|
constructor(formBuilder) {
|
|
@@ -2942,7 +2615,7 @@ class NotFoundComponent {
|
|
|
2942
2615
|
this.companyName = this.config.companyName;
|
|
2943
2616
|
this.logoPath = this.config.logoPath;
|
|
2944
2617
|
}
|
|
2945
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NotFoundComponent, deps: [{ token:
|
|
2618
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NotFoundComponent, deps: [{ token: ConfigServiceBase }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2946
2619
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: NotFoundComponent, isStandalone: true, selector: "not-found", ngImport: i0, template: "<div class=\"flex min-h-screen overflow-hidden\" style=\"padding: 20px;\">\n <div class=\"flex flex-column w-full\">\n <div class=\"w-full sm:w-30rem\" style=\"margin: auto; border-radius:50px; padding:0.3rem; background: linear-gradient(180deg, var(--p-primary-color) 10%, rgba(33, 150, 243, 0) 30%);\">\n <div class=\"surface-card py-6 px-5 sm:px-6\" style=\"border-radius:45px;\">\n <div class=\"text-center\">\n <img \n [src]=\"logoPath\" \n alt=\"{{companyName}} Logo\" \n title=\"{{companyName}} Logo\" \n height=\"60\"\n class=\"mb-4\"\n >\n </div>\n <h1 class=\"mb-4\">\n <div class=\"font-bold text-5xl lg:text-6xl spiderly-gradient-title\">404</div>\n <div class=\"font-bold text-5xl lg:text-6xl\">Page Not Found</div>\n </h1>\n <div class=\"text-600 text-lg mb-5\">\n The page you're looking for doesn't exist or has been moved. Let's get you back on track.\n </div>\n <div>\n <p-button [routerLink]=\"['/']\" label=\"Go to Homepage\"></p-button>\n </div>\n </div>\n </div>\n </div>\n</div>", dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i3$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i1$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }] }); }
|
|
2947
2620
|
}
|
|
2948
2621
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NotFoundComponent, decorators: [{
|
|
@@ -2951,7 +2624,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
2951
2624
|
RouterModule,
|
|
2952
2625
|
ButtonModule,
|
|
2953
2626
|
], template: "<div class=\"flex min-h-screen overflow-hidden\" style=\"padding: 20px;\">\n <div class=\"flex flex-column w-full\">\n <div class=\"w-full sm:w-30rem\" style=\"margin: auto; border-radius:50px; padding:0.3rem; background: linear-gradient(180deg, var(--p-primary-color) 10%, rgba(33, 150, 243, 0) 30%);\">\n <div class=\"surface-card py-6 px-5 sm:px-6\" style=\"border-radius:45px;\">\n <div class=\"text-center\">\n <img \n [src]=\"logoPath\" \n alt=\"{{companyName}} Logo\" \n title=\"{{companyName}} Logo\" \n height=\"60\"\n class=\"mb-4\"\n >\n </div>\n <h1 class=\"mb-4\">\n <div class=\"font-bold text-5xl lg:text-6xl spiderly-gradient-title\">404</div>\n <div class=\"font-bold text-5xl lg:text-6xl\">Page Not Found</div>\n </h1>\n <div class=\"text-600 text-lg mb-5\">\n The page you're looking for doesn't exist or has been moved. Let's get you back on track.\n </div>\n <div>\n <p-button [routerLink]=\"['/']\" label=\"Go to Homepage\"></p-button>\n </div>\n </div>\n </div>\n </div>\n</div>" }]
|
|
2954
|
-
}], ctorParameters: () => [{ type:
|
|
2627
|
+
}], ctorParameters: () => [{ type: ConfigServiceBase }] });
|
|
2955
2628
|
|
|
2956
2629
|
class SpiderlySplitButtonComponent extends SpiderlyButtonBaseComponent {
|
|
2957
2630
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlySplitButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -3732,7 +3405,7 @@ class InitTopBarData extends BaseEntity {
|
|
|
3732
3405
|
static { this.typeName = 'InitTopBarData'; }
|
|
3733
3406
|
}
|
|
3734
3407
|
|
|
3735
|
-
class
|
|
3408
|
+
class LayoutServiceBase {
|
|
3736
3409
|
constructor(apiService, config, authService) {
|
|
3737
3410
|
this.apiService = apiService;
|
|
3738
3411
|
this.config = config;
|
|
@@ -3847,15 +3520,15 @@ class LayoutBaseService {
|
|
|
3847
3520
|
this.userSubscription.unsubscribe();
|
|
3848
3521
|
}
|
|
3849
3522
|
}
|
|
3850
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type:
|
|
3851
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type:
|
|
3523
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: LayoutServiceBase, deps: [{ token: ApiSecurityService }, { token: ConfigServiceBase }, { token: AuthServiceBase }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3524
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: LayoutServiceBase, providedIn: 'root' }); }
|
|
3852
3525
|
}
|
|
3853
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type:
|
|
3526
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: LayoutServiceBase, decorators: [{
|
|
3854
3527
|
type: Injectable,
|
|
3855
3528
|
args: [{
|
|
3856
3529
|
providedIn: 'root',
|
|
3857
3530
|
}]
|
|
3858
|
-
}], ctorParameters: () => [{ type: ApiSecurityService }, { type:
|
|
3531
|
+
}], ctorParameters: () => [{ type: ApiSecurityService }, { type: ConfigServiceBase }, { type: AuthServiceBase }] });
|
|
3859
3532
|
|
|
3860
3533
|
class SidebarMenuService {
|
|
3861
3534
|
constructor() {
|
|
@@ -3976,7 +3649,7 @@ class MenuitemComponent {
|
|
|
3976
3649
|
this.permissionSubscription.unsubscribe();
|
|
3977
3650
|
}
|
|
3978
3651
|
}
|
|
3979
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: MenuitemComponent, deps: [{ token:
|
|
3652
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: MenuitemComponent, deps: [{ token: LayoutServiceBase }, { token: i0.ChangeDetectorRef }, { token: i3$2.Router }, { token: SidebarMenuService }, { token: AuthServiceBase }, { token: ApiSecurityService }, { token: ConfigServiceBase }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3980
3653
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: MenuitemComponent, isStandalone: true, selector: "[menuitem]", inputs: { item: "item", index: "index", root: "root", parentKey: "parentKey" }, host: { properties: { "class.layout-root-menuitem": "this.root", "class.active-menuitem": "this.activeClass" } }, ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <div *ngIf=\"root && item.visible === true\" class=\"layout-menuitem-root-text\">{{item.label}}</div>\n <a *ngIf=\"(!item.routerLink || item.items) && item.visible === true\" [attr.href]=\"item.url\" (click)=\"itemClick($event)\"\n [ngClass]=\"item.styleClass\" [attr.target]=\"item.target\" tabindex=\"0\" pRipple>\n <i [ngClass]=\"item.icon\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{item.label}}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n </a>\n <a *ngIf=\"(item.routerLink && !item.items) && item.visible === true\" (click)=\"itemClick($event)\" [ngClass]=\"item.styleClass\"\n [routerLink]=\"item.routerLink\" routerLinkActive=\"active-route\" [routerLinkActiveOptions]=\"item.routerLinkActiveOptions||{ paths: 'exact', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' }\"\n [fragment]=\"item.fragment\" [queryParamsHandling]=\"item.queryParamsHandling\" [preserveFragment]=\"item.preserveFragment\"\n [skipLocationChange]=\"item.skipLocationChange\" [replaceUrl]=\"item.replaceUrl\" [state]=\"item.state\" [queryParams]=\"item.queryParams\"\n [attr.target]=\"item.target\" tabindex=\"0\" pRipple>\n <i [ngClass]=\"item.icon\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{item.label}}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n </a>\n\n <ul *ngIf=\"item.items && item.visible === true\" [@children]=\"submenuAnimation\">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeStyleClass\"></li>\n </ng-template>\n </ul>\n\n <!-- Delete this in the future iterations, make link to partner in /partners page -->\n <spiderly-autocomplete\n *ngIf=\"item.showPartnerDialog\"\n [control]=\"selectedPartner\"\n [options]=\"partnerOptions\"\n (onTextInput)=\"searchPartners($event)\"\n label=\"\"\n [placeholder]=\"t('SelectThePartner')\"\n [showAddon]=\"true\"\n (onButtonClick)=\"partnersAutocompleteButtonClick()\"\n addonIcon=\"pi pi-check\"\n [emptyMessage]=\"t('LeftCornerPartnersEmptyMessage')\"\n class=\"mobile-stay-open\"\n ></spiderly-autocomplete>\n \n</ng-container>", dependencies: [{ kind: "component", type: MenuitemComponent, selector: "[menuitem]", inputs: ["item", "index", "root", "parentKey"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i3$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3$2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "ngmodule", type: SpiderlyControlsModule }, { kind: "component", type: SpiderlyAutocompleteComponent, selector: "spiderly-autocomplete", inputs: ["appendTo", "showClear", "emptyMessage", "displayName"] }], animations: [
|
|
3981
3654
|
trigger('children', [
|
|
3982
3655
|
state('collapsed', style({
|
|
@@ -4007,7 +3680,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
4007
3680
|
TranslocoDirective,
|
|
4008
3681
|
SpiderlyControlsModule,
|
|
4009
3682
|
], template: "<ng-container *transloco=\"let t\">\n <div *ngIf=\"root && item.visible === true\" class=\"layout-menuitem-root-text\">{{item.label}}</div>\n <a *ngIf=\"(!item.routerLink || item.items) && item.visible === true\" [attr.href]=\"item.url\" (click)=\"itemClick($event)\"\n [ngClass]=\"item.styleClass\" [attr.target]=\"item.target\" tabindex=\"0\" pRipple>\n <i [ngClass]=\"item.icon\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{item.label}}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n </a>\n <a *ngIf=\"(item.routerLink && !item.items) && item.visible === true\" (click)=\"itemClick($event)\" [ngClass]=\"item.styleClass\"\n [routerLink]=\"item.routerLink\" routerLinkActive=\"active-route\" [routerLinkActiveOptions]=\"item.routerLinkActiveOptions||{ paths: 'exact', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' }\"\n [fragment]=\"item.fragment\" [queryParamsHandling]=\"item.queryParamsHandling\" [preserveFragment]=\"item.preserveFragment\"\n [skipLocationChange]=\"item.skipLocationChange\" [replaceUrl]=\"item.replaceUrl\" [state]=\"item.state\" [queryParams]=\"item.queryParams\"\n [attr.target]=\"item.target\" tabindex=\"0\" pRipple>\n <i [ngClass]=\"item.icon\" class=\"layout-menuitem-icon\"></i>\n <span class=\"layout-menuitem-text\">{{item.label}}</span>\n <i class=\"pi pi-fw pi-angle-down layout-submenu-toggler\" *ngIf=\"item.items\"></i>\n </a>\n\n <ul *ngIf=\"item.items && item.visible === true\" [@children]=\"submenuAnimation\">\n <ng-template ngFor let-child let-i=\"index\" [ngForOf]=\"item.items\">\n <li menuitem [item]=\"child\" [index]=\"i\" [parentKey]=\"key\" [class]=\"child.badgeStyleClass\"></li>\n </ng-template>\n </ul>\n\n <!-- Delete this in the future iterations, make link to partner in /partners page -->\n <spiderly-autocomplete\n *ngIf=\"item.showPartnerDialog\"\n [control]=\"selectedPartner\"\n [options]=\"partnerOptions\"\n (onTextInput)=\"searchPartners($event)\"\n label=\"\"\n [placeholder]=\"t('SelectThePartner')\"\n [showAddon]=\"true\"\n (onButtonClick)=\"partnersAutocompleteButtonClick()\"\n addonIcon=\"pi pi-check\"\n [emptyMessage]=\"t('LeftCornerPartnersEmptyMessage')\"\n class=\"mobile-stay-open\"\n ></spiderly-autocomplete>\n \n</ng-container>" }]
|
|
4010
|
-
}], ctorParameters: () => [{ type:
|
|
3683
|
+
}], ctorParameters: () => [{ type: LayoutServiceBase }, { type: i0.ChangeDetectorRef }, { type: i3$2.Router }, { type: SidebarMenuService }, { type: AuthServiceBase }, { type: ApiSecurityService }, { type: ConfigServiceBase }], propDecorators: { item: [{
|
|
4011
3684
|
type: Input
|
|
4012
3685
|
}], index: [{
|
|
4013
3686
|
type: Input
|
|
@@ -4034,7 +3707,7 @@ class SidebarMenuComponent {
|
|
|
4034
3707
|
}
|
|
4035
3708
|
ngOnDestroy() {
|
|
4036
3709
|
}
|
|
4037
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SidebarMenuComponent, deps: [{ token:
|
|
3710
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SidebarMenuComponent, deps: [{ token: LayoutServiceBase }, { token: AuthServiceBase }, { token: i1.TranslocoService }, { token: ConfigServiceBase }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4038
3711
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: SidebarMenuComponent, isStandalone: true, selector: "sidebar-menu", inputs: { menu: "menu" }, ngImport: i0, template: "<ul class=\"layout-menu\">\n <ng-container *ngFor=\"let item of menu; let i = index;\">\n <li menuitem *ngIf=\"!item.separator\" [item]=\"item\" [index]=\"i\" [root]=\"true\"></li>\n <li *ngIf=\"item.separator\" class=\"gray-separator\" style=\"margin-top: 11px;\"></li>\n </ng-container>\n</ul>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MenuitemComponent, selector: "[menuitem]", inputs: ["item", "index", "root", "parentKey"] }] }); }
|
|
4039
3712
|
}
|
|
4040
3713
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SidebarMenuComponent, decorators: [{
|
|
@@ -4043,7 +3716,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
4043
3716
|
CommonModule,
|
|
4044
3717
|
MenuitemComponent
|
|
4045
3718
|
], template: "<ul class=\"layout-menu\">\n <ng-container *ngFor=\"let item of menu; let i = index;\">\n <li menuitem *ngIf=\"!item.separator\" [item]=\"item\" [index]=\"i\" [root]=\"true\"></li>\n <li *ngIf=\"item.separator\" class=\"gray-separator\" style=\"margin-top: 11px;\"></li>\n </ng-container>\n</ul>\n" }]
|
|
4046
|
-
}], ctorParameters: () => [{ type:
|
|
3719
|
+
}], ctorParameters: () => [{ type: LayoutServiceBase }, { type: AuthServiceBase }, { type: i1.TranslocoService }, { type: ConfigServiceBase }], propDecorators: { menu: [{
|
|
4047
3720
|
type: Input
|
|
4048
3721
|
}] } });
|
|
4049
3722
|
|
|
@@ -4153,7 +3826,7 @@ class ProfileAvatarComponent {
|
|
|
4153
3826
|
this.initTopBarSubscription.unsubscribe();
|
|
4154
3827
|
}
|
|
4155
3828
|
}
|
|
4156
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ProfileAvatarComponent, deps: [{ token:
|
|
3829
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ProfileAvatarComponent, deps: [{ token: LayoutServiceBase }, { token: AuthServiceBase }, { token: i3$2.Router }, { token: i1.TranslocoService }, { token: ConfigServiceBase }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4157
3830
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: ProfileAvatarComponent, isStandalone: true, selector: "spiderly-profile-avatar", inputs: { isSideMenuLayout: "isSideMenuLayout", routeOnLargeProfileAvatarClick: "routeOnLargeProfileAvatarClick", showLoginButton: "showLoginButton", routeToLoginPage: "routeToLoginPage", loginButtonOutlined: "loginButtonOutlined", loginButtonSeverity: "loginButtonSeverity", loginButtonSize: "loginButtonSize", menuItems: "menuItems" }, outputs: { onLoginButtonClick: "onLoginButtonClick" }, viewQueries: [{ propertyName: "menu", first: true, predicate: ["topbarmenu"], descendants: true }, { propertyName: "topbarProfileDropdownMenuButton", first: true, predicate: ["topbarprofiledropdownmenubutton"], descendants: true }], ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <div\n *ngIf=\"this.currentUser != null\"\n #topbarmenu\n >\n <div\n #topbarprofiledropdownmenubutton\n (click)=\"layoutService.showProfileDropdownSidebar()\"\n >\n <p-avatar\n *ngIf=\"showProfileIcon\"\n [label]=\"avatarLabel\"\n [style]=\"{ 'background-color': 'var(--p-primary-color)', 'color': '#fff', 'cursor': 'pointer', 'width': '34px', 'height': '34px', 'font-size': '21px' }\"\n pBadge \n [badgeStyleClass]=\"'p-badge-danger'\"\n [badgeDisabled]=\"unreadNotificationsCount == 0 || unreadNotificationsCount == null\"\n [value]=\"unreadNotificationsCount\"\n />\n </div>\n <div\n #topbarprofiledropdownmenu\n (document:click)=\"onDocumentClick($event)\"\n >\n <div \n *ngIf=\"layoutService.state.profileDropdownSidebarVisible\" \n style=\"width: 280px; position: absolute; padding: 15px; background: var(--p-content-background);\" \n class=\"card\"\n [ngClass]=\"{\n 'side-menu-profile-dialog': isSideMenuLayout,\n 'top-menu-profile-dialog': !isSideMenuLayout,\n }\n \"\n >\n <div style=\"display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 10px;\">\n <p-avatar\n [label]=\"avatarLabel\"\n size=\"xlarge\"\n [style]=\"{ 'background-color': 'var(--p-primary-color)', 'color': '#fff', 'margin': 'auto', 'cursor': routeOnLargeProfileAvatarClick ? 'pointer' : '' }\"\n (click)=\"routeToUserPage()\"\n />\n <div style=\"font-size: 15px;\">{{currentUser?.email}}</div>\n </div>\n <div style=\"margin-top: 15px;\">\n <div *ngFor=\"let item of menuItems\" [style]=\"item.showSeparator ? 'margin-top: 5px;' : ''\">\n <div *ngIf=\"item.showSeparator\" class=\"gray-separator\"></div>\n <div (click)=\"item.onClick()\" class=\"hover-card\" style=\"display: flex; align-items: center; gap: 8px; margin-top: 5px;\">\n <i \n class=\"pi pi-fw {{item.icon}}\" \n style=\"font-size: 16px; position: relative;\"\n >\n <span *ngIf=\"item.showNotificationBadge && unreadNotificationsCount != 0\" class=\"badge\"></span>\n </i>\n <div style=\"font-size: 15px;\"> {{item.label}} </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n <div *ngIf=\"this.currentUser == null && this.showLoginButton\">\n <spiderly-button \n [label]=\"t('Login')\" \n (onClick)=\"loginButtonClick()\" \n icon=\"pi pi-sign-in\" \n [outlined]=\"loginButtonOutlined\" \n [severity]=\"loginButtonSeverity\"\n [size]=\"loginButtonSize\"\n ></spiderly-button>\n </div>\n</ng-container>", styles: [".side-menu-profile-dialog{right:26px;top:60px}.top-menu-profile-dialog{right:0;top:40px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: AvatarModule }, { kind: "component", type: i7.Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "style", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }, { kind: "ngmodule", type: BadgeModule }, { kind: "directive", type: i8.BadgeDirective, selector: "[pBadge]", inputs: ["badgeDisabled", "badgeSize", "size", "severity", "value", "badgeStyle", "badgeStyleClass"] }, { kind: "component", type: SpiderlyButtonComponent, selector: "spiderly-button", inputs: ["type"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] }); }
|
|
4158
3831
|
}
|
|
4159
3832
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: ProfileAvatarComponent, decorators: [{
|
|
@@ -4166,7 +3839,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
4166
3839
|
SpiderlyButtonComponent,
|
|
4167
3840
|
TranslocoDirective,
|
|
4168
3841
|
], template: "<ng-container *transloco=\"let t\">\n <div\n *ngIf=\"this.currentUser != null\"\n #topbarmenu\n >\n <div\n #topbarprofiledropdownmenubutton\n (click)=\"layoutService.showProfileDropdownSidebar()\"\n >\n <p-avatar\n *ngIf=\"showProfileIcon\"\n [label]=\"avatarLabel\"\n [style]=\"{ 'background-color': 'var(--p-primary-color)', 'color': '#fff', 'cursor': 'pointer', 'width': '34px', 'height': '34px', 'font-size': '21px' }\"\n pBadge \n [badgeStyleClass]=\"'p-badge-danger'\"\n [badgeDisabled]=\"unreadNotificationsCount == 0 || unreadNotificationsCount == null\"\n [value]=\"unreadNotificationsCount\"\n />\n </div>\n <div\n #topbarprofiledropdownmenu\n (document:click)=\"onDocumentClick($event)\"\n >\n <div \n *ngIf=\"layoutService.state.profileDropdownSidebarVisible\" \n style=\"width: 280px; position: absolute; padding: 15px; background: var(--p-content-background);\" \n class=\"card\"\n [ngClass]=\"{\n 'side-menu-profile-dialog': isSideMenuLayout,\n 'top-menu-profile-dialog': !isSideMenuLayout,\n }\n \"\n >\n <div style=\"display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 10px;\">\n <p-avatar\n [label]=\"avatarLabel\"\n size=\"xlarge\"\n [style]=\"{ 'background-color': 'var(--p-primary-color)', 'color': '#fff', 'margin': 'auto', 'cursor': routeOnLargeProfileAvatarClick ? 'pointer' : '' }\"\n (click)=\"routeToUserPage()\"\n />\n <div style=\"font-size: 15px;\">{{currentUser?.email}}</div>\n </div>\n <div style=\"margin-top: 15px;\">\n <div *ngFor=\"let item of menuItems\" [style]=\"item.showSeparator ? 'margin-top: 5px;' : ''\">\n <div *ngIf=\"item.showSeparator\" class=\"gray-separator\"></div>\n <div (click)=\"item.onClick()\" class=\"hover-card\" style=\"display: flex; align-items: center; gap: 8px; margin-top: 5px;\">\n <i \n class=\"pi pi-fw {{item.icon}}\" \n style=\"font-size: 16px; position: relative;\"\n >\n <span *ngIf=\"item.showNotificationBadge && unreadNotificationsCount != 0\" class=\"badge\"></span>\n </i>\n <div style=\"font-size: 15px;\"> {{item.label}} </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n <div *ngIf=\"this.currentUser == null && this.showLoginButton\">\n <spiderly-button \n [label]=\"t('Login')\" \n (onClick)=\"loginButtonClick()\" \n icon=\"pi pi-sign-in\" \n [outlined]=\"loginButtonOutlined\" \n [severity]=\"loginButtonSeverity\"\n [size]=\"loginButtonSize\"\n ></spiderly-button>\n </div>\n</ng-container>", styles: [".side-menu-profile-dialog{right:26px;top:60px}.top-menu-profile-dialog{right:0;top:40px}\n"] }]
|
|
4169
|
-
}], ctorParameters: () => [{ type:
|
|
3842
|
+
}], ctorParameters: () => [{ type: LayoutServiceBase }, { type: AuthServiceBase }, { type: i3$2.Router }, { type: i1.TranslocoService }, { type: ConfigServiceBase }], propDecorators: { isSideMenuLayout: [{
|
|
4170
3843
|
type: Input
|
|
4171
3844
|
}], routeOnLargeProfileAvatarClick: [{
|
|
4172
3845
|
type: Input
|
|
@@ -4207,7 +3880,7 @@ class SideMenuTopBarComponent {
|
|
|
4207
3880
|
this.layoutService.state.profileDropdownSidebarVisible = false;
|
|
4208
3881
|
});
|
|
4209
3882
|
}
|
|
4210
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SideMenuTopBarComponent, deps: [{ token:
|
|
3883
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SideMenuTopBarComponent, deps: [{ token: LayoutServiceBase }, { token: i3$2.Router }, { token: ConfigServiceBase }, { token: i1.TranslocoService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4211
3884
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: SideMenuTopBarComponent, isStandalone: true, selector: "spiderly-sidemenu-topbar", viewQueries: [{ propertyName: "menuButton", first: true, predicate: ["menubutton"], descendants: true }], ngImport: i0, template: "<div class=\"layout-topbar\">\n <a class=\"layout-topbar-logo\" routerLink=\"/\">\n <span>{{companyName?.toLocaleUpperCase()}}</span>\n </a>\n\n <button\n #menubutton\n class=\"p-link layout-menu-button layout-topbar-button\"\n (click)=\"layoutService.onMenuToggle()\"\n >\n <i class=\"pi pi-bars\"></i>\n </button>\n\n <div class=\"profile-button\">\n <spiderly-profile-avatar\n ></spiderly-profile-avatar>\n </div>\n\n</div>\n ", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i3$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: AvatarModule }, { kind: "ngmodule", type: BadgeModule }, { kind: "component", type: ProfileAvatarComponent, selector: "spiderly-profile-avatar", inputs: ["isSideMenuLayout", "routeOnLargeProfileAvatarClick", "showLoginButton", "routeToLoginPage", "loginButtonOutlined", "loginButtonSeverity", "loginButtonSize", "menuItems"], outputs: ["onLoginButtonClick"] }] }); }
|
|
4212
3885
|
}
|
|
4213
3886
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SideMenuTopBarComponent, decorators: [{
|
|
@@ -4219,7 +3892,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
4219
3892
|
BadgeModule,
|
|
4220
3893
|
ProfileAvatarComponent,
|
|
4221
3894
|
], template: "<div class=\"layout-topbar\">\n <a class=\"layout-topbar-logo\" routerLink=\"/\">\n <span>{{companyName?.toLocaleUpperCase()}}</span>\n </a>\n\n <button\n #menubutton\n class=\"p-link layout-menu-button layout-topbar-button\"\n (click)=\"layoutService.onMenuToggle()\"\n >\n <i class=\"pi pi-bars\"></i>\n </button>\n\n <div class=\"profile-button\">\n <spiderly-profile-avatar\n ></spiderly-profile-avatar>\n </div>\n\n</div>\n " }]
|
|
4222
|
-
}], ctorParameters: () => [{ type:
|
|
3895
|
+
}], ctorParameters: () => [{ type: LayoutServiceBase }, { type: i3$2.Router }, { type: ConfigServiceBase }, { type: i1.TranslocoService }], propDecorators: { menuButton: [{
|
|
4223
3896
|
type: ViewChild,
|
|
4224
3897
|
args: ['menubutton']
|
|
4225
3898
|
}] } });
|
|
@@ -4258,7 +3931,7 @@ class TopBarComponent {
|
|
|
4258
3931
|
this.permissionSubscription.unsubscribe();
|
|
4259
3932
|
}
|
|
4260
3933
|
}
|
|
4261
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: TopBarComponent, deps: [{ token:
|
|
3934
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: TopBarComponent, deps: [{ token: AuthServiceBase }, { token: ConfigServiceBase }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4262
3935
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: TopBarComponent, isStandalone: true, selector: "spiderly-topbar", inputs: { menu: "menu", showHoverBgOnRootItems: "showHoverBgOnRootItems" }, ngImport: i0, template: "<div class=\"topbar-wrapper\">\n <nav class=\"topbar {{showHoverBgOnRootItems ? '' : 'show-hover-bg-on-root-items'}}\">\n <p-menubar [model]=\"menu\" [style]=\"{ border: '0' }\">\n <ng-template #start>\n <img style=\"margin-left: 11px; cursor: pointer;\" width=\"45\" height=\"45\" routerLink=\"/\" [src]=\"logoPath\" alt=\"Logo\">\n </ng-template>\n <ng-template #end>\n <div style=\"margin-right: 11px; display: flex; gap: 10px; align-items: center; position: relative;\">\n <div>\n <ng-content select=\"[ACTIONS]\"></ng-content>\n </div>\n <spiderly-profile-avatar [isSideMenuLayout]=\"false\"></spiderly-profile-avatar>\n </div>\n </ng-template>\n </p-menubar>\n </nav>\n</div>", styles: [".topbar-wrapper{background-color:var(--p-content-background);width:100%;border-bottom:1px solid var(--p-content-border-color);box-shadow:0 4px 6px #0000001a;position:sticky;top:0;left:0;z-index:1000}.topbar{max-width:1100px;margin:auto}::ng-deep .show-hover-bg-on-root-items .p-menubar-root-list>.p-menubar-item>.p-menubar-item-content{background-color:transparent!important}::ng-deep .p-menubar-item-link{background-color:transparent!important;padding:10px!important;font-size:15px!important}::ng-deep .p-menubar-item-link .pi{font-size:15px}::ng-deep .p-menubar-button{width:35px!important;height:35px!important}::ng-deep .p-menubar-button .p-icon{width:16px;height:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i3$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MenubarModule }, { kind: "component", type: i4$a.Menubar, selector: "p-menubar", inputs: ["model", "style", "styleClass", "autoZIndex", "baseZIndex", "autoDisplay", "autoHide", "breakpoint", "autoHideDelay", "id", "ariaLabel", "ariaLabelledBy"], outputs: ["onFocus", "onBlur"] }, { kind: "ngmodule", type: AvatarModule }, { kind: "component", type: ProfileAvatarComponent, selector: "spiderly-profile-avatar", inputs: ["isSideMenuLayout", "routeOnLargeProfileAvatarClick", "showLoginButton", "routeToLoginPage", "loginButtonOutlined", "loginButtonSeverity", "loginButtonSize", "menuItems"], outputs: ["onLoginButtonClick"] }] }); }
|
|
4263
3936
|
}
|
|
4264
3937
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: TopBarComponent, decorators: [{
|
|
@@ -4270,7 +3943,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
4270
3943
|
AvatarModule,
|
|
4271
3944
|
ProfileAvatarComponent,
|
|
4272
3945
|
], template: "<div class=\"topbar-wrapper\">\n <nav class=\"topbar {{showHoverBgOnRootItems ? '' : 'show-hover-bg-on-root-items'}}\">\n <p-menubar [model]=\"menu\" [style]=\"{ border: '0' }\">\n <ng-template #start>\n <img style=\"margin-left: 11px; cursor: pointer;\" width=\"45\" height=\"45\" routerLink=\"/\" [src]=\"logoPath\" alt=\"Logo\">\n </ng-template>\n <ng-template #end>\n <div style=\"margin-right: 11px; display: flex; gap: 10px; align-items: center; position: relative;\">\n <div>\n <ng-content select=\"[ACTIONS]\"></ng-content>\n </div>\n <spiderly-profile-avatar [isSideMenuLayout]=\"false\"></spiderly-profile-avatar>\n </div>\n </ng-template>\n </p-menubar>\n </nav>\n</div>", styles: [".topbar-wrapper{background-color:var(--p-content-background);width:100%;border-bottom:1px solid var(--p-content-border-color);box-shadow:0 4px 6px #0000001a;position:sticky;top:0;left:0;z-index:1000}.topbar{max-width:1100px;margin:auto}::ng-deep .show-hover-bg-on-root-items .p-menubar-root-list>.p-menubar-item>.p-menubar-item-content{background-color:transparent!important}::ng-deep .p-menubar-item-link{background-color:transparent!important;padding:10px!important;font-size:15px!important}::ng-deep .p-menubar-item-link .pi{font-size:15px}::ng-deep .p-menubar-button{width:35px!important;height:35px!important}::ng-deep .p-menubar-button .p-icon{width:16px;height:16px}\n"] }]
|
|
4273
|
-
}], ctorParameters: () => [{ type:
|
|
3946
|
+
}], ctorParameters: () => [{ type: AuthServiceBase }, { type: ConfigServiceBase }], propDecorators: { menu: [{
|
|
4274
3947
|
type: Input
|
|
4275
3948
|
}], showHoverBgOnRootItems: [{
|
|
4276
3949
|
type: Input
|
|
@@ -4392,7 +4065,7 @@ class SpiderlyLayoutComponent {
|
|
|
4392
4065
|
}
|
|
4393
4066
|
this.onAfterNgDestroy();
|
|
4394
4067
|
}
|
|
4395
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyLayoutComponent, deps: [{ token:
|
|
4068
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyLayoutComponent, deps: [{ token: LayoutServiceBase }, { token: i0.Renderer2 }, { token: i3$2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4396
4069
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.13", type: SpiderlyLayoutComponent, isStandalone: true, selector: "spiderly-layout", inputs: { menu: "menu", isSideMenuLayout: "isSideMenuLayout", showHoverBgOnRootTopMenuItems: "showHoverBgOnRootTopMenuItems", maxWidth: "maxWidth" }, viewQueries: [{ propertyName: "appSidebar", first: true, predicate: AppSidebarComponent, descendants: true }, { propertyName: "sidemenuTopbar", first: true, predicate: SideMenuTopBarComponent, descendants: true }, { propertyName: "topbarmenu", first: true, predicate: ["topbarmenu"], descendants: true }], ngImport: i0, template: "<div *ngIf=\"isSideMenuLayout\" class=\"layout-wrapper\" [ngClass]=\"containerClass\">\n <spiderly-sidemenu-topbar></spiderly-sidemenu-topbar>\n <div class=\"layout-sidebar\">\n <sidebar [menu]=\"sideMenu\"></sidebar>\n </div>\n <div class=\"layout-main-container\">\n <div class=\"layout-main\">\n <router-outlet></router-outlet>\n </div>\n <footer></footer>\n </div>\n <div class=\"layout-mask\"></div>\n</div>\n\n<div *ngIf=\"isSideMenuLayout === false\">\n <spiderly-topbar [menu]=\"topMenu\" [showHoverBgOnRootItems]=\"showHoverBgOnRootTopMenuItems\">\n <ng-content ACTIONS select=\"[ACTIONS]\"></ng-content>\n </spiderly-topbar>\n <main [style.max-width]=\"maxWidth\" style=\"margin: auto; padding: 18px;\">\n <router-outlet></router-outlet>\n </main>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i3$2.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: AppSidebarComponent, selector: "sidebar", inputs: ["menu"] }, { kind: "component", type: FooterComponent, selector: "footer" }, { kind: "component", type: SideMenuTopBarComponent, selector: "spiderly-sidemenu-topbar" }, { kind: "component", type: TopBarComponent, selector: "spiderly-topbar", inputs: ["menu", "showHoverBgOnRootItems"] }] }); }
|
|
4397
4070
|
}
|
|
4398
4071
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyLayoutComponent, decorators: [{
|
|
@@ -4405,7 +4078,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
4405
4078
|
SideMenuTopBarComponent,
|
|
4406
4079
|
TopBarComponent,
|
|
4407
4080
|
], template: "<div *ngIf=\"isSideMenuLayout\" class=\"layout-wrapper\" [ngClass]=\"containerClass\">\n <spiderly-sidemenu-topbar></spiderly-sidemenu-topbar>\n <div class=\"layout-sidebar\">\n <sidebar [menu]=\"sideMenu\"></sidebar>\n </div>\n <div class=\"layout-main-container\">\n <div class=\"layout-main\">\n <router-outlet></router-outlet>\n </div>\n <footer></footer>\n </div>\n <div class=\"layout-mask\"></div>\n</div>\n\n<div *ngIf=\"isSideMenuLayout === false\">\n <spiderly-topbar [menu]=\"topMenu\" [showHoverBgOnRootItems]=\"showHoverBgOnRootTopMenuItems\">\n <ng-content ACTIONS select=\"[ACTIONS]\"></ng-content>\n </spiderly-topbar>\n <main [style.max-width]=\"maxWidth\" style=\"margin: auto; padding: 18px;\">\n <router-outlet></router-outlet>\n </main>\n</div>" }]
|
|
4408
|
-
}], ctorParameters: () => [{ type:
|
|
4081
|
+
}], ctorParameters: () => [{ type: LayoutServiceBase }, { type: i0.Renderer2 }, { type: i3$2.Router }], propDecorators: { menu: [{
|
|
4409
4082
|
type: Input
|
|
4410
4083
|
}], isSideMenuLayout: [{
|
|
4411
4084
|
type: Input
|
|
@@ -4471,6 +4144,23 @@ class MimeTypes {
|
|
|
4471
4144
|
}
|
|
4472
4145
|
}
|
|
4473
4146
|
|
|
4147
|
+
class Namebook extends BaseEntity {
|
|
4148
|
+
constructor({ id, displayName, } = {}) {
|
|
4149
|
+
super();
|
|
4150
|
+
this.id = id;
|
|
4151
|
+
this.displayName = displayName;
|
|
4152
|
+
}
|
|
4153
|
+
static { this.schema = {
|
|
4154
|
+
id: {
|
|
4155
|
+
type: 'any',
|
|
4156
|
+
},
|
|
4157
|
+
displayName: {
|
|
4158
|
+
type: 'string',
|
|
4159
|
+
},
|
|
4160
|
+
}; }
|
|
4161
|
+
static { this.typeName = 'Namebook'; }
|
|
4162
|
+
}
|
|
4163
|
+
|
|
4474
4164
|
class PrimengOption extends BaseEntity {
|
|
4475
4165
|
constructor({ label, code, } = {}) {
|
|
4476
4166
|
super();
|
|
@@ -4570,6 +4260,14 @@ class FilterRule {
|
|
|
4570
4260
|
class PaginatedResult {
|
|
4571
4261
|
}
|
|
4572
4262
|
|
|
4263
|
+
class IsAuthorizedForSaveEvent extends BaseEntity {
|
|
4264
|
+
constructor({ isAuthorizedForSave, } = {}) {
|
|
4265
|
+
super();
|
|
4266
|
+
this.isAuthorizedForSave = isAuthorizedForSave;
|
|
4267
|
+
}
|
|
4268
|
+
static { this.typeName = 'IsAuthorizedForSaveEvent'; }
|
|
4269
|
+
}
|
|
4270
|
+
|
|
4573
4271
|
var SecurityPermissionCodes;
|
|
4574
4272
|
(function (SecurityPermissionCodes) {
|
|
4575
4273
|
SecurityPermissionCodes["ReadUser"] = "ReadUser";
|
|
@@ -4616,7 +4314,7 @@ class AuthGuard {
|
|
|
4616
4314
|
}
|
|
4617
4315
|
}));
|
|
4618
4316
|
}
|
|
4619
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: AuthGuard, deps: [{ token:
|
|
4317
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: AuthGuard, deps: [{ token: AuthServiceBase }, { token: i3$2.Router }, { token: ConfigServiceBase }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4620
4318
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: AuthGuard, providedIn: 'root' }); }
|
|
4621
4319
|
}
|
|
4622
4320
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: AuthGuard, decorators: [{
|
|
@@ -4624,7 +4322,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
4624
4322
|
args: [{
|
|
4625
4323
|
providedIn: 'root',
|
|
4626
4324
|
}]
|
|
4627
|
-
}], ctorParameters: () => [{ type:
|
|
4325
|
+
}], ctorParameters: () => [{ type: AuthServiceBase }, { type: i3$2.Router }, { type: ConfigServiceBase }] });
|
|
4628
4326
|
|
|
4629
4327
|
class NotAuthGuard {
|
|
4630
4328
|
constructor(authService) {
|
|
@@ -4644,7 +4342,7 @@ class NotAuthGuard {
|
|
|
4644
4342
|
}
|
|
4645
4343
|
}));
|
|
4646
4344
|
}
|
|
4647
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NotAuthGuard, deps: [{ token:
|
|
4345
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NotAuthGuard, deps: [{ token: AuthServiceBase }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4648
4346
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NotAuthGuard, providedIn: 'root' }); }
|
|
4649
4347
|
}
|
|
4650
4348
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NotAuthGuard, decorators: [{
|
|
@@ -4652,7 +4350,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
4652
4350
|
args: [{
|
|
4653
4351
|
providedIn: 'root',
|
|
4654
4352
|
}]
|
|
4655
|
-
}], ctorParameters: () => [{ type:
|
|
4353
|
+
}], ctorParameters: () => [{ type: AuthServiceBase }] });
|
|
4656
4354
|
|
|
4657
4355
|
class SpiderlyErrorHandler {
|
|
4658
4356
|
constructor(messageService, translocoService, config) {
|
|
@@ -4668,7 +4366,7 @@ class SpiderlyErrorHandler {
|
|
|
4668
4366
|
this.messageService.errorMessage(this.translocoService.translate('UnexpectedErrorDetails'), this.translocoService.translate('UnexpectedErrorTitle'));
|
|
4669
4367
|
}
|
|
4670
4368
|
}
|
|
4671
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyErrorHandler, deps: [{ token: SpiderlyMessageService }, { token: i1.TranslocoService }, { token:
|
|
4369
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyErrorHandler, deps: [{ token: SpiderlyMessageService }, { token: i1.TranslocoService }, { token: ConfigServiceBase }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4672
4370
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyErrorHandler, providedIn: 'root' }); }
|
|
4673
4371
|
}
|
|
4674
4372
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyErrorHandler, decorators: [{
|
|
@@ -4676,7 +4374,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
4676
4374
|
args: [{
|
|
4677
4375
|
providedIn: 'root'
|
|
4678
4376
|
}]
|
|
4679
|
-
}], ctorParameters: () => [{ type: SpiderlyMessageService }, { type: i1.TranslocoService }, { type:
|
|
4377
|
+
}], ctorParameters: () => [{ type: SpiderlyMessageService }, { type: i1.TranslocoService }, { type: ConfigServiceBase }] });
|
|
4680
4378
|
|
|
4681
4379
|
const httpLoadingInterceptor = (req, next) => {
|
|
4682
4380
|
const spinner = inject(NgxSpinnerService);
|
|
@@ -4751,7 +4449,7 @@ const convertToDate = (object, parent, key) => {
|
|
|
4751
4449
|
};
|
|
4752
4450
|
|
|
4753
4451
|
const jwtInterceptor = (req, next) => {
|
|
4754
|
-
const config = inject(
|
|
4452
|
+
const config = inject(ConfigServiceBase);
|
|
4755
4453
|
const platformId = inject(PLATFORM_ID);
|
|
4756
4454
|
let accessToken = null;
|
|
4757
4455
|
if (isPlatformBrowser(platformId)) {
|
|
@@ -4769,7 +4467,8 @@ const jwtInterceptor = (req, next) => {
|
|
|
4769
4467
|
const unauthorizedInterceptor = (req, next) => {
|
|
4770
4468
|
const messageService = inject(SpiderlyMessageService);
|
|
4771
4469
|
const translocoService = inject(TranslocoService);
|
|
4772
|
-
const config = inject(
|
|
4470
|
+
const config = inject(ConfigServiceBase);
|
|
4471
|
+
const authService = inject(AuthServiceBase);
|
|
4773
4472
|
const handleAuthError = (err, request) => {
|
|
4774
4473
|
if (!config.production) {
|
|
4775
4474
|
console.error(err);
|
|
@@ -4800,13 +4499,13 @@ const unauthorizedInterceptor = (req, next) => {
|
|
|
4800
4499
|
return of(err.message);
|
|
4801
4500
|
}
|
|
4802
4501
|
else if (err.status == 419) { // Access token expired
|
|
4502
|
+
authService.clearLocalStorage();
|
|
4803
4503
|
return of(err.message);
|
|
4804
4504
|
}
|
|
4805
4505
|
else {
|
|
4806
4506
|
messageService.errorMessage(translocoService.translate('UnexpectedErrorDetails'), translocoService.translate('UnexpectedErrorTitle'));
|
|
4807
4507
|
return of(err.message);
|
|
4808
4508
|
}
|
|
4809
|
-
return throwError(err);
|
|
4810
4509
|
};
|
|
4811
4510
|
return next(req).pipe(catchError((err) => {
|
|
4812
4511
|
return handleAuthError(err, req);
|
|
@@ -4832,7 +4531,7 @@ class SpiderlyTranslocoLoader {
|
|
|
4832
4531
|
getTranslation(lang) {
|
|
4833
4532
|
return this.http.get(`${this.config.frontendUrl}/assets/i18n/${lang}.json`);
|
|
4834
4533
|
}
|
|
4835
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyTranslocoLoader, deps: [{ token: i1$
|
|
4534
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyTranslocoLoader, deps: [{ token: i1$3.HttpClient }, { token: ConfigServiceBase }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4836
4535
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyTranslocoLoader, providedIn: 'root' }); }
|
|
4837
4536
|
}
|
|
4838
4537
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: SpiderlyTranslocoLoader, decorators: [{
|
|
@@ -4840,7 +4539,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
4840
4539
|
args: [{
|
|
4841
4540
|
providedIn: 'root'
|
|
4842
4541
|
}]
|
|
4843
|
-
}], ctorParameters: () => [{ type: i1$
|
|
4542
|
+
}], ctorParameters: () => [{ type: i1$3.HttpClient }, { type: ConfigServiceBase }] });
|
|
4844
4543
|
|
|
4845
4544
|
class SpiderlyTemplateTypeDirective {
|
|
4846
4545
|
static ngTemplateContextGuard(dir, ctx) {
|
|
@@ -4866,5 +4565,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
4866
4565
|
* Generated bundle index. Do not edit.
|
|
4867
4566
|
*/
|
|
4868
4567
|
|
|
4869
|
-
export { Action, AllClickEvent, ApiSecurityService, AppSidebarComponent,
|
|
4568
|
+
export { Action, AllClickEvent, ApiSecurityService, AppSidebarComponent, AuthGuard, AuthResult, AuthServiceBase, BaseAutocompleteControl, BaseControl, BaseDropdownControl, BaseEntity, BaseFormCopy, BaseFormService, CardSkeletonComponent, Codebook, Column, ConfigServiceBase, ExternalProvider, Filter, FilterRule, FilterSortMeta, FooterComponent, GoogleButtonComponent, IndexCardComponent, InfoCardComponent, InitCompanyAuthDialogDetails, InitTopBarData, IsAuthorizedForSaveEvent, LastMenuIconIndexClicked, LayoutServiceBase, LazyLoadSelectedIdsResult, Login, LoginComponent, LoginVerificationComponent, LoginVerificationToken, MatchModeCodes, MenuChangeEvent, MenuitemComponent, MimeTypes, Namebook, NotAuthGuard, NotFoundComponent, PROPS_KEY, PaginatedResult, PanelBodyComponent, PanelFooterComponent, PanelHeaderComponent, PrimengOption, ProfileAvatarComponent, ReflectProp, RefreshTokenRequest, RequiredComponent, RowClickEvent, SecurityPermissionCodes, SendLoginVerificationEmailResult, SideMenuTopBarComponent, SidebarMenuComponent, SimpleSaveResult, SpiderlyAutocompleteComponent, SpiderlyButtonBaseComponent, SpiderlyButtonComponent, SpiderlyCalendarComponent, SpiderlyCardComponent, SpiderlyCheckboxComponent, SpiderlyColorPickerComponent, SpiderlyControlsModule, SpiderlyDataTableComponent, SpiderlyDataViewComponent, SpiderlyDeleteConfirmationComponent, SpiderlyDropdownComponent, SpiderlyEditorComponent, SpiderlyErrorHandler, SpiderlyFileComponent, SpiderlyFileSelectEvent, SpiderlyFormArray, SpiderlyFormControl, SpiderlyFormGroup, SpiderlyLayoutComponent, SpiderlyMessageService, SpiderlyMultiAutocompleteComponent, SpiderlyMultiSelectComponent, SpiderlyNumberComponent, SpiderlyPanelComponent, SpiderlyPanelsModule, SpiderlyPasswordComponent, SpiderlyReturnButtonComponent, SpiderlySplitButtonComponent, SpiderlyTab, SpiderlyTemplateTypeDirective, SpiderlyTextareaComponent, SpiderlyTextboxComponent, SpiderlyTranslocoLoader, TopBarComponent, TranslateLabelsAbstractService, UserBase, UserRole, ValidatorAbstractService, VerificationTokenRequest, VerificationTypeCodes, VerificationWrapperComponent, adjustColor, authInitializer, capitalizeFirstChar, createFakeGoogleWrapper, deleteAction, exportListToExcel, firstCharToUpper, getFileNameFromContentDisposition, getHtmlImgDisplayString64, getMimeTypeForFileName, getMonth, getParentUrl, getPrimengAutocompleteCodebookOptions, getPrimengAutocompleteNamebookOptions, getPrimengDropdownCodebookOptions, getPrimengDropdownNamebookOptions, httpLoadingInterceptor, isExcelFileType, isImageFileType, isNullOrEmpty, jsonHttpInterceptor, jwtInterceptor, kebabToTitleCase, nameOf, nameof, primitiveArrayTypes, pushAction, selectedTab, singleOrDefault, splitPascalCase, toCommaSeparatedString, unauthorizedInterceptor, validatePrecisionScale };
|
|
4870
4569
|
//# sourceMappingURL=spiderly.mjs.map
|