common-header-lib 0.0.18 → 0.0.20
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/README.md +24 -24
- package/assets/images/APP033.svg +12 -0
- package/assets/images/toast-alert.svg +3 -3
- package/assets/images/toast-error.svg +3 -3
- package/assets/images/toast-info.svg +3 -3
- package/assets/images/toast-success.svg +10 -10
- package/assets/scss/styles.scss +577 -577
- package/esm2020/lib/common-header-lib.component.mjs +37 -3
- package/esm2020/lib/common-header-lib.service.mjs +1 -1
- package/esm2020/lib/components/confirm-dialog/confirm-dialog.component.mjs +3 -3
- package/esm2020/lib/services/http/http-common.service.mjs +18 -1
- package/esm2020/public-api.mjs +1 -1
- package/fesm2015/common-header-lib.mjs +56 -4
- package/fesm2015/common-header-lib.mjs.map +1 -1
- package/fesm2020/common-header-lib.mjs +55 -4
- package/fesm2020/common-header-lib.mjs.map +1 -1
- package/lib/common-header-lib.component.d.ts +1 -0
- package/lib/services/http/http-common.service.d.ts +9 -0
- package/package.json +1 -1
- package/src/assets/images/APP033.svg +12 -0
- package/src/assets/images/toast-alert.svg +3 -3
- package/src/assets/images/toast-error.svg +3 -3
- package/src/assets/images/toast-info.svg +3 -3
- package/src/assets/images/toast-success.svg +10 -10
- package/src/assets/scss/styles.scss +577 -577
|
@@ -495,10 +495,10 @@ class ConfirmDialogComponent {
|
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
ConfirmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ConfirmDialogComponent, deps: [{ token: i9.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
498
|
-
ConfirmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ConfirmDialogComponent, selector: "confirm-dialog", inputs: { header: "header", message: "message" }, outputs: { result: "result" }, providers: [ConfirmationService], ngImport: i0, template: "<div class=\"card flex justify-center gap-2 view-pass-details confirmtion-modal\">\
|
|
498
|
+
ConfirmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ConfirmDialogComponent, selector: "confirm-dialog", inputs: { header: "header", message: "message" }, outputs: { result: "result" }, providers: [ConfirmationService], ngImport: i0, template: "<div class=\"card flex justify-center gap-2 view-pass-details confirmtion-modal\">\n <p-confirmDialog icon=\"none\" acceptIcon=\"\" rejectIcon=\"\"></p-confirmDialog>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: i2.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }] });
|
|
499
499
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
|
|
500
500
|
type: Component,
|
|
501
|
-
args: [{ selector: 'confirm-dialog', providers: [ConfirmationService], template: "<div class=\"card flex justify-center gap-2 view-pass-details confirmtion-modal\">\
|
|
501
|
+
args: [{ selector: 'confirm-dialog', providers: [ConfirmationService], template: "<div class=\"card flex justify-center gap-2 view-pass-details confirmtion-modal\">\n <p-confirmDialog icon=\"none\" acceptIcon=\"\" rejectIcon=\"\"></p-confirmDialog>\n</div>\n" }]
|
|
502
502
|
}], ctorParameters: function () { return [{ type: i9.ConfirmationService }]; }, propDecorators: { header: [{
|
|
503
503
|
type: Input,
|
|
504
504
|
args: ['header']
|
|
@@ -1026,6 +1026,23 @@ class HttpCommonService {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
}), catchError$1((e) => throwError(this.errorHandler(e))));
|
|
1028
1028
|
}
|
|
1029
|
+
//Method: Open the OAuth connection window for the given application
|
|
1030
|
+
openAppConnection(appCode) {
|
|
1031
|
+
const url = GlobalConstants.baseURL + '/xauth/api/Token/AppOAuth?appcode=' + appCode;
|
|
1032
|
+
window.open(url, '_blank');
|
|
1033
|
+
}
|
|
1034
|
+
//Method: Validate MFA / SAML configuration before establishing the APP032 connection
|
|
1035
|
+
checkMFAConfiguration() {
|
|
1036
|
+
return this.http
|
|
1037
|
+
.get(`${GlobalConstants.baseURL}/xaccess/api/Token/getMfaSamlConfig`)
|
|
1038
|
+
.pipe(catchError$1((e) => throwError(this.errorHandler(e))));
|
|
1039
|
+
}
|
|
1040
|
+
//Method: Validate internal SAML app configuration before establishing the connection (e.g. APP033)
|
|
1041
|
+
getInternalAppConfig(appCode) {
|
|
1042
|
+
return this.http
|
|
1043
|
+
.get(`${GlobalConstants.baseURL}/xaccess/api/Token/getInternalAppConfig?appCode=${appCode}`)
|
|
1044
|
+
.pipe(catchError$1((e) => throwError(this.errorHandler(e))));
|
|
1045
|
+
}
|
|
1029
1046
|
}
|
|
1030
1047
|
HttpCommonService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpCommonService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1031
1048
|
HttpCommonService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpCommonService, providedIn: 'root' });
|
|
@@ -3446,6 +3463,17 @@ class CommonHeaderLibComponent {
|
|
|
3446
3463
|
this.isErrorOccured = false;
|
|
3447
3464
|
// @Output() public refreshNotification = new EventEmitter<boolean>();
|
|
3448
3465
|
this.repeatLoader1 = new Array(9).fill(0);
|
|
3466
|
+
// Mapping of app codes to their pre-connection validation checks.
|
|
3467
|
+
// Apps not listed here open the connection directly without a config check.
|
|
3468
|
+
this.APP_CONNECTION_CHECKS = {
|
|
3469
|
+
APP032: {
|
|
3470
|
+
check: () => this.httpCommonService.checkMFAConfiguration(),
|
|
3471
|
+
},
|
|
3472
|
+
APP033: {
|
|
3473
|
+
// Backend expects the lowercase app code (mirrors Workflow_UI MR !287)
|
|
3474
|
+
check: () => this.httpCommonService.getInternalAppConfig('app033'),
|
|
3475
|
+
},
|
|
3476
|
+
};
|
|
3449
3477
|
this.setWebAPIURL();
|
|
3450
3478
|
}
|
|
3451
3479
|
ngOnChanges(changes) {
|
|
@@ -3503,8 +3531,31 @@ class CommonHeaderLibComponent {
|
|
|
3503
3531
|
}
|
|
3504
3532
|
//Method: Take Connection of Application
|
|
3505
3533
|
getConnectionofApplication(appCode) {
|
|
3506
|
-
|
|
3507
|
-
|
|
3534
|
+
// Close the apps (9-dots) overlay panel immediately on selection.
|
|
3535
|
+
this.appPanel?.hide();
|
|
3536
|
+
const appCheck = this.APP_CONNECTION_CHECKS[appCode];
|
|
3537
|
+
const commonError = 'Unable to verify the application configuration.';
|
|
3538
|
+
// Apps without a configured check connect directly.
|
|
3539
|
+
if (!appCheck) {
|
|
3540
|
+
this.httpCommonService.openAppConnection(appCode);
|
|
3541
|
+
return;
|
|
3542
|
+
}
|
|
3543
|
+
appCheck
|
|
3544
|
+
.check()
|
|
3545
|
+
.pipe(takeUntil(this.unsubscribeAPIEventListenerData))
|
|
3546
|
+
.subscribe({
|
|
3547
|
+
next: (response) => {
|
|
3548
|
+
if (response?.isValid) {
|
|
3549
|
+
this.httpCommonService.openAppConnection(appCode);
|
|
3550
|
+
}
|
|
3551
|
+
else {
|
|
3552
|
+
this.msgService.error(response?.errorMessage || commonError);
|
|
3553
|
+
}
|
|
3554
|
+
},
|
|
3555
|
+
error: () => {
|
|
3556
|
+
this.msgService.error(commonError);
|
|
3557
|
+
},
|
|
3558
|
+
});
|
|
3508
3559
|
}
|
|
3509
3560
|
async getConnectToSingalRhub() {
|
|
3510
3561
|
try {
|