intelica-library-ui 0.1.231 → 0.1.232
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/intelica-library-ui.mjs +28 -32
- package/fesm2022/intelica-library-ui.mjs.map +1 -1
- package/lib/components/dashboard-qs/dashboard-qs.component.d.ts +1 -5
- package/lib/components/dashboard-qs-interactive/dashboard-qs-interactive.component.d.ts +1 -5
- package/lib/dto/embed-dashboard-response.d.ts +5 -0
- package/lib/services/shared.d.ts +9 -1
- package/package.json +1 -1
|
@@ -6656,7 +6656,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
6656
6656
|
class Shared {
|
|
6657
6657
|
http = inject(HttpClient);
|
|
6658
6658
|
configService = inject(ConfigService);
|
|
6659
|
+
sweetAlertService = inject(SweetAlertService);
|
|
6660
|
+
termPipe = inject(TermPipe);
|
|
6661
|
+
globalTermService = inject(GlobalTermService);
|
|
6659
6662
|
path = `${this.configService.environment?.sharedPath}`;
|
|
6663
|
+
sessionTimer;
|
|
6664
|
+
scheduleSessionExpiry(expiresInMinutes) {
|
|
6665
|
+
this.clearSessionTimer();
|
|
6666
|
+
this.sessionTimer = setTimeout(() => this.handleSessionExpired(), Math.max((expiresInMinutes - 1) * 60_000, 30_000));
|
|
6667
|
+
}
|
|
6668
|
+
clearSessionTimer() {
|
|
6669
|
+
clearTimeout(this.sessionTimer);
|
|
6670
|
+
}
|
|
6671
|
+
async handleSessionExpired() {
|
|
6672
|
+
const result = await this.sweetAlertService.confirmBox(this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_MESSAGE', this.globalTermService.languageCode), this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_CONFIRM', this.globalTermService.languageCode), this.termPipe.transform('CANCEL', this.globalTermService.languageCode), this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_TITLE', this.globalTermService.languageCode));
|
|
6673
|
+
if (result.isConfirmed)
|
|
6674
|
+
window.location.reload();
|
|
6675
|
+
}
|
|
6660
6676
|
getEmbedUrl(command) {
|
|
6661
6677
|
return this.http.post(`${this.path}/quicksight-embed-url`, command);
|
|
6662
6678
|
}
|
|
@@ -6679,16 +6695,18 @@ class Shared {
|
|
|
6679
6695
|
}
|
|
6680
6696
|
async embedDashboard(command, container, options) {
|
|
6681
6697
|
container.replaceChildren();
|
|
6682
|
-
const
|
|
6683
|
-
|
|
6698
|
+
const dashResponse = await firstValueFrom(this.getEmbedUrl(command));
|
|
6699
|
+
this.scheduleSessionExpiry(dashResponse.expiresInMinutes);
|
|
6700
|
+
await this.createEmbedContext(dashResponse.embedUrl, container, options);
|
|
6684
6701
|
}
|
|
6685
6702
|
async embedDashboardInteractive(command, container, options) {
|
|
6686
6703
|
container.replaceChildren();
|
|
6687
|
-
const
|
|
6704
|
+
const dashResponse = await firstValueFrom(this.getEmbedUrl({ ...command, parameters: undefined }));
|
|
6705
|
+
this.scheduleSessionExpiry(dashResponse.expiresInMinutes);
|
|
6688
6706
|
const embeddingContext = await createEmbeddingContext();
|
|
6689
6707
|
const sdkParameters = command.parameters ? Object.entries(command.parameters).map(([Name, Values]) => ({ Name, Values })) : undefined;
|
|
6690
6708
|
return await embeddingContext.embedDashboard({
|
|
6691
|
-
url: embedUrl,
|
|
6709
|
+
url: dashResponse.embedUrl,
|
|
6692
6710
|
container,
|
|
6693
6711
|
...(options?.height && { height: options.height }),
|
|
6694
6712
|
...(options?.width && { width: options.width }),
|
|
@@ -6786,11 +6804,7 @@ function dispatchQuicksightEvent(event, outputs) {
|
|
|
6786
6804
|
|
|
6787
6805
|
class DashboardQsComponent {
|
|
6788
6806
|
sharedService = inject(Shared);
|
|
6789
|
-
sweetAlertService = inject(SweetAlertService);
|
|
6790
|
-
termPipe = inject(TermPipe);
|
|
6791
|
-
GlobalTermService = inject(GlobalTermService);
|
|
6792
6807
|
route = inject(ActivatedRoute);
|
|
6793
|
-
sessionExpiredShown = false;
|
|
6794
6808
|
containers;
|
|
6795
6809
|
dashboardIdInput = input(undefined, { alias: 'dashboardId' });
|
|
6796
6810
|
parametersInput = input(undefined, { alias: 'parameters' });
|
|
@@ -6834,7 +6848,7 @@ class DashboardQsComponent {
|
|
|
6834
6848
|
if (event.eventName === QuicksightEventName.CONTENT_LOADED || event.eventName === QuicksightEventName.ERROR_OCCURRED)
|
|
6835
6849
|
this.isLoading.set(false);
|
|
6836
6850
|
if (isQuicksightSessionExpiredEvent(event))
|
|
6837
|
-
this.handleSessionExpired();
|
|
6851
|
+
this.sharedService.handleSessionExpired();
|
|
6838
6852
|
},
|
|
6839
6853
|
});
|
|
6840
6854
|
}
|
|
@@ -6843,15 +6857,8 @@ class DashboardQsComponent {
|
|
|
6843
6857
|
this.isLoading.set(false);
|
|
6844
6858
|
}
|
|
6845
6859
|
}
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
return;
|
|
6849
|
-
this.sessionExpiredShown = true;
|
|
6850
|
-
const result = await this.sweetAlertService.confirmBox(this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_MESSAGE', this.GlobalTermService.languageCode), this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_CONFIRM', this.GlobalTermService.languageCode), this.termPipe.transform('CANCEL', this.GlobalTermService.languageCode), this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_TITLE', this.GlobalTermService.languageCode));
|
|
6851
|
-
if (result.isConfirmed)
|
|
6852
|
-
window.location.reload();
|
|
6853
|
-
else
|
|
6854
|
-
this.sessionExpiredShown = false;
|
|
6860
|
+
ngOnDestroy() {
|
|
6861
|
+
this.sharedService.clearSessionTimer();
|
|
6855
6862
|
}
|
|
6856
6863
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DashboardQsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6857
6864
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: DashboardQsComponent, isStandalone: true, selector: "intelica-dashboard-qs", inputs: { dashboardIdInput: { classPropertyName: "dashboardIdInput", publicName: "dashboardId", isSignal: true, isRequired: false, transformFunction: null }, parametersInput: { classPropertyName: "parametersInput", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, heightInput: { classPropertyName: "heightInput", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isLoadingChange: "isLoadingChange", sdkEvent: "sdkEvent", contentLoaded: "contentLoaded", errorOccurred: "errorOccurred", sessionExpired: "sessionExpired" }, viewQueries: [{ propertyName: "containers", predicate: ["visualContainer"], descendants: true }], ngImport: i0, template: "@if (isLoading()) {\r\n<div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <div class=\"u-display-flex u-background-white u-px-1 u-pt-1\">\r\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\r\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\r\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\r\n </div>\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '1061.57 / 93.02' }\" />\r\n </p-panel>\r\n </div>\r\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\r\n @for (_ of [].constructor(4); track $index) {\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '244.87 / 123.12' }\" />\r\n </p-panel>\r\n }\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '1061.57 / 303.7' }\" />\r\n </p-panel>\r\n </div>\r\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\r\n @for (_ of [].constructor(2); track $index) {\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '517.1 / 123.12' }\" />\r\n </p-panel>\r\n }\r\n </div>\r\n</div>\r\n}\r\n<div #visualContainer [style.height]=\"height()\" [hidden]=\"isLoading()\"></div>", dependencies: [{ kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: PanelModule }, { kind: "component", type: i2$4.Panel, selector: "p-panel", inputs: ["toggleable", "header", "collapsed", "style", "styleClass", "iconPos", "expandIcon", "collapseIcon", "showHeader", "toggler", "transitionOptions", "toggleButtonProps"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] });
|
|
@@ -6866,11 +6873,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
6866
6873
|
|
|
6867
6874
|
class DashboardQsInteractiveComponent {
|
|
6868
6875
|
sharedService = inject(Shared);
|
|
6869
|
-
sweetAlertService = inject(SweetAlertService);
|
|
6870
|
-
termPipe = inject(TermPipe);
|
|
6871
|
-
GlobalTermService = inject(GlobalTermService);
|
|
6872
6876
|
route = inject(ActivatedRoute);
|
|
6873
|
-
sessionExpiredShown = false;
|
|
6874
6877
|
containers;
|
|
6875
6878
|
dashboardIdInput = input(undefined, { alias: 'dashboardId' });
|
|
6876
6879
|
parametersInput = input(undefined, { alias: 'parameters' });
|
|
@@ -6926,7 +6929,7 @@ class DashboardQsInteractiveComponent {
|
|
|
6926
6929
|
if (event.eventName === QuicksightEventName.CONTENT_LOADED || event.eventName === QuicksightEventName.ERROR_OCCURRED || event.eventName === QuicksightEventName.PARAMETERS_CHANGED)
|
|
6927
6930
|
this.isLoading.set(false);
|
|
6928
6931
|
if (isQuicksightSessionExpiredEvent(event))
|
|
6929
|
-
this.handleSessionExpired();
|
|
6932
|
+
this.sharedService.handleSessionExpired();
|
|
6930
6933
|
},
|
|
6931
6934
|
});
|
|
6932
6935
|
}
|
|
@@ -6935,15 +6938,8 @@ class DashboardQsInteractiveComponent {
|
|
|
6935
6938
|
this.isLoading.set(false);
|
|
6936
6939
|
}
|
|
6937
6940
|
}
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
return;
|
|
6941
|
-
this.sessionExpiredShown = true;
|
|
6942
|
-
const result = await this.sweetAlertService.confirmBox(this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_MESSAGE', this.GlobalTermService.languageCode), this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_CONFIRM', this.GlobalTermService.languageCode), this.termPipe.transform('CANCEL', this.GlobalTermService.languageCode), this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_TITLE', this.GlobalTermService.languageCode));
|
|
6943
|
-
if (result.isConfirmed)
|
|
6944
|
-
window.location.reload();
|
|
6945
|
-
else
|
|
6946
|
-
this.sessionExpiredShown = false;
|
|
6941
|
+
ngOnDestroy() {
|
|
6942
|
+
this.sharedService.clearSessionTimer();
|
|
6947
6943
|
}
|
|
6948
6944
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DashboardQsInteractiveComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6949
6945
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: DashboardQsInteractiveComponent, isStandalone: true, selector: "intelica-dashboard-qs-interactive", inputs: { dashboardIdInput: { classPropertyName: "dashboardIdInput", publicName: "dashboardId", isSignal: true, isRequired: false, transformFunction: null }, parametersInput: { classPropertyName: "parametersInput", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, heightInput: { classPropertyName: "heightInput", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isLoadingChange: "isLoadingChange", sdkEvent: "sdkEvent", contentLoaded: "contentLoaded", errorOccurred: "errorOccurred", sessionExpired: "sessionExpired" }, viewQueries: [{ propertyName: "containers", predicate: ["visualContainer"], descendants: true }], ngImport: i0, template: "@if (isLoading()) {\r\n<div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <div class=\"u-display-flex u-background-white u-px-1 u-pt-1\">\r\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\r\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\r\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\r\n </div>\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '1061.57 / 93.02' }\" />\r\n </p-panel>\r\n </div>\r\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\r\n @for (_ of [].constructor(4); track $index) {\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '244.87 / 123.12' }\" />\r\n </p-panel>\r\n }\r\n </div>\r\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '1061.57 / 303.7' }\" />\r\n </p-panel>\r\n </div>\r\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\r\n @for (_ of [].constructor(2); track $index) {\r\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\r\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" [style]=\"{ 'aspect-ratio': '517.1 / 123.12' }\" />\r\n </p-panel>\r\n }\r\n </div>\r\n</div>\r\n}\r\n<div #visualContainer [style.height]=\"height()\" [hidden]=\"isLoading()\"></div>", dependencies: [{ kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2$3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: PanelModule }, { kind: "component", type: i2$4.Panel, selector: "p-panel", inputs: ["toggleable", "header", "collapsed", "style", "styleClass", "iconPos", "expandIcon", "collapseIcon", "showHeader", "toggler", "transitionOptions", "toggleButtonProps"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] });
|