intelica-library-project 20.0.19 → 20.0.21
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.
|
@@ -2163,16 +2163,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImpo
|
|
|
2163
2163
|
class Shared {
|
|
2164
2164
|
http = inject(HttpClient);
|
|
2165
2165
|
configService = inject(ConfigService);
|
|
2166
|
+
alertService = inject(AlertService);
|
|
2167
|
+
termPipe = inject(TermPipe);
|
|
2168
|
+
globalTermService = inject(GlobalTermService);
|
|
2166
2169
|
path = `${this.configService.environment?.sharedPath}`;
|
|
2170
|
+
sessionTimer;
|
|
2171
|
+
scheduleSessionExpiry(expiresInMinutes) {
|
|
2172
|
+
this.clearSessionTimer();
|
|
2173
|
+
this.sessionTimer = setTimeout(() => this.handleSessionExpired(), Math.max((expiresInMinutes - 1) * 60_000, 30_000));
|
|
2174
|
+
}
|
|
2175
|
+
clearSessionTimer() {
|
|
2176
|
+
clearTimeout(this.sessionTimer);
|
|
2177
|
+
}
|
|
2178
|
+
async handleSessionExpired() {
|
|
2179
|
+
const { isConfirmed } = await this.alertService.confirm(this.termPipe.transform("QUICKSIGHT_SESSION_EXPIRED_TITLE", this.globalTermService.languageCode), 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));
|
|
2180
|
+
if (isConfirmed)
|
|
2181
|
+
window.location.reload();
|
|
2182
|
+
}
|
|
2167
2183
|
getEmbedUrl(command) {
|
|
2168
2184
|
return this.http.post(`${this.path}/quicksight-embed-url`, command);
|
|
2169
2185
|
}
|
|
2170
2186
|
getEmbedVisualUrl(command) {
|
|
2171
2187
|
return this.http.post(`${this.path}/quicksight-embed-visual-url`, command);
|
|
2172
2188
|
}
|
|
2173
|
-
getEmbedVisualUrlsAnonymous(command) {
|
|
2174
|
-
return this.http.post(`${this.path}/quicksight-embed-visual-anonymous`, command);
|
|
2175
|
-
}
|
|
2176
2189
|
async createEmbedContext(embedUrl, container, options) {
|
|
2177
2190
|
const embeddingContext = await createEmbeddingContext();
|
|
2178
2191
|
await embeddingContext.embedDashboard({
|
|
@@ -2186,16 +2199,18 @@ class Shared {
|
|
|
2186
2199
|
}
|
|
2187
2200
|
async embedDashboard(command, container, options) {
|
|
2188
2201
|
container.replaceChildren();
|
|
2189
|
-
const
|
|
2190
|
-
|
|
2202
|
+
const dashResponse = await firstValueFrom(this.getEmbedUrl(command));
|
|
2203
|
+
this.scheduleSessionExpiry(dashResponse.expiresInMinutes);
|
|
2204
|
+
await this.createEmbedContext(dashResponse.embedUrl, container, options);
|
|
2191
2205
|
}
|
|
2192
2206
|
async embedDashboardInteractive(command, container, options) {
|
|
2193
2207
|
container.replaceChildren();
|
|
2194
|
-
const
|
|
2208
|
+
const dashResponse = await firstValueFrom(this.getEmbedUrl({ ...command, parameters: undefined }));
|
|
2209
|
+
this.scheduleSessionExpiry(dashResponse.expiresInMinutes);
|
|
2195
2210
|
const embeddingContext = await createEmbeddingContext();
|
|
2196
2211
|
const sdkParameters = command.parameters ? Object.entries(command.parameters).map(([Name, Values]) => ({ Name, Values })) : undefined;
|
|
2197
2212
|
return await embeddingContext.embedDashboard({
|
|
2198
|
-
url: embedUrl,
|
|
2213
|
+
url: dashResponse.embedUrl,
|
|
2199
2214
|
container,
|
|
2200
2215
|
...(options?.height && { height: options.height }),
|
|
2201
2216
|
...(options?.width && { width: options.width }),
|
|
@@ -2285,30 +2300,18 @@ const QuicksightEventName = {
|
|
|
2285
2300
|
};
|
|
2286
2301
|
const QUICKSIGHT_AUTH_ERROR_CODES = ["Forbidden", "Unauthorized", "EmbeddingNotAuthorized", "TokenExpired"];
|
|
2287
2302
|
|
|
2288
|
-
function isQuicksightSessionExpiredEvent(event) {
|
|
2289
|
-
if (event.eventName !== QuicksightEventName.ERROR_OCCURRED)
|
|
2290
|
-
return false;
|
|
2291
|
-
const code = event.data?.errorCode ?? event.data?.code ?? "";
|
|
2292
|
-
return typeof code === "string" && QUICKSIGHT_AUTH_ERROR_CODES.some(c => code.includes(c));
|
|
2293
|
-
}
|
|
2294
2303
|
function dispatchQuicksightEvent(event, outputs) {
|
|
2295
2304
|
outputs.sdkEvent.emit(event);
|
|
2296
2305
|
if (event.eventName === QuicksightEventName.CONTENT_LOADED)
|
|
2297
2306
|
outputs.contentLoaded?.emit(event);
|
|
2298
2307
|
if (event.eventName === QuicksightEventName.ERROR_OCCURRED) {
|
|
2299
2308
|
outputs.errorOccurred?.emit(event);
|
|
2300
|
-
if (isQuicksightSessionExpiredEvent(event))
|
|
2301
|
-
outputs.sessionExpired?.emit(event);
|
|
2302
2309
|
}
|
|
2303
2310
|
}
|
|
2304
2311
|
|
|
2305
2312
|
class DashboardQsComponent {
|
|
2306
2313
|
sharedService = inject(Shared);
|
|
2307
|
-
alertService = inject(AlertService);
|
|
2308
|
-
termPipe = inject(TermPipe);
|
|
2309
|
-
GlobalTermService = inject(GlobalTermService);
|
|
2310
2314
|
route = inject(ActivatedRoute);
|
|
2311
|
-
sessionExpiredShown = false;
|
|
2312
2315
|
containers;
|
|
2313
2316
|
dashboardIdInput = input(undefined, ...(ngDevMode ? [{ debugName: "dashboardIdInput", alias: 'dashboardId' }] : [{ alias: 'dashboardId' }]));
|
|
2314
2317
|
parametersInput = input(undefined, ...(ngDevMode ? [{ debugName: "parametersInput", alias: 'parameters' }] : [{ alias: 'parameters' }]));
|
|
@@ -2351,8 +2354,6 @@ class DashboardQsComponent {
|
|
|
2351
2354
|
dispatchQuicksightEvent(event, this);
|
|
2352
2355
|
if (event.eventName === QuicksightEventName.CONTENT_LOADED || event.eventName === QuicksightEventName.ERROR_OCCURRED)
|
|
2353
2356
|
this.isLoading.set(false);
|
|
2354
|
-
if (isQuicksightSessionExpiredEvent(event))
|
|
2355
|
-
this.handleSessionExpired();
|
|
2356
2357
|
},
|
|
2357
2358
|
});
|
|
2358
2359
|
}
|
|
@@ -2361,15 +2362,8 @@ class DashboardQsComponent {
|
|
|
2361
2362
|
this.isLoading.set(false);
|
|
2362
2363
|
}
|
|
2363
2364
|
}
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
return;
|
|
2367
|
-
this.sessionExpiredShown = true;
|
|
2368
|
-
const { isConfirmed } = await this.alertService.confirm(this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_TITLE', this.GlobalTermService.languageCode), 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));
|
|
2369
|
-
if (isConfirmed)
|
|
2370
|
-
window.location.reload();
|
|
2371
|
-
else
|
|
2372
|
-
this.sessionExpiredShown = false;
|
|
2365
|
+
ngOnDestroy() {
|
|
2366
|
+
this.sharedService.clearSessionTimer();
|
|
2373
2367
|
}
|
|
2374
2368
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2375
2369
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.23", 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()) {\n<div class=\"u-display-flex u-flex-column u-gap-sm\">\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 1061.57 / 93.02\" />\n </p-panel>\n </div>\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\n @for (_ of [].constructor(4); track $index) {\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 244.87 / 123.12\" />\n </p-panel>\n }\n </div>\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 1061.57 / 303.7\" />\n </p-panel>\n </div>\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\n @for (_ of [].constructor(2); track $index) {\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 517.1 / 123.12\" />\n </p-panel>\n }\n </div>\n</div>\n}\n<div #visualContainer [style.height]=\"height()\" [hidden]=\"isLoading()\"></div>", dependencies: [{ kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: Panel, selector: "p-panel", inputs: ["id", "toggleable", "header", "collapsed", "styleClass", "iconPos", "showHeader", "toggler", "transitionOptions", "toggleButtonProps"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] });
|
|
@@ -2384,11 +2378,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImpo
|
|
|
2384
2378
|
|
|
2385
2379
|
class DashboardQsInteractiveComponent {
|
|
2386
2380
|
sharedService = inject(Shared);
|
|
2387
|
-
alertService = inject(AlertService);
|
|
2388
|
-
termPipe = inject(TermPipe);
|
|
2389
|
-
GlobalTermService = inject(GlobalTermService);
|
|
2390
2381
|
route = inject(ActivatedRoute);
|
|
2391
|
-
sessionExpiredShown = false;
|
|
2392
2382
|
containers;
|
|
2393
2383
|
dashboardIdInput = input(undefined, ...(ngDevMode ? [{ debugName: "dashboardIdInput", alias: 'dashboardId' }] : [{ alias: 'dashboardId' }]));
|
|
2394
2384
|
parametersInput = input(undefined, ...(ngDevMode ? [{ debugName: "parametersInput", alias: 'parameters' }] : [{ alias: 'parameters' }]));
|
|
@@ -2438,12 +2428,9 @@ class DashboardQsInteractiveComponent {
|
|
|
2438
2428
|
this.dashboardRef = await this.sharedService.embedDashboardInteractive({ dashboardId, parameters: this.parameters() }, container, {
|
|
2439
2429
|
height: this.height() ?? `${window.innerHeight - 50}px`,
|
|
2440
2430
|
onMessage: event => {
|
|
2441
|
-
console.log('[QS event]', event.eventName, JSON.stringify(event.data));
|
|
2442
2431
|
dispatchQuicksightEvent(event, this);
|
|
2443
2432
|
if (event.eventName === QuicksightEventName.CONTENT_LOADED || event.eventName === QuicksightEventName.ERROR_OCCURRED || event.eventName === QuicksightEventName.PARAMETERS_CHANGED)
|
|
2444
2433
|
this.isLoading.set(false);
|
|
2445
|
-
if (isQuicksightSessionExpiredEvent(event))
|
|
2446
|
-
this.handleSessionExpired();
|
|
2447
2434
|
},
|
|
2448
2435
|
});
|
|
2449
2436
|
}
|
|
@@ -2452,15 +2439,8 @@ class DashboardQsInteractiveComponent {
|
|
|
2452
2439
|
this.isLoading.set(false);
|
|
2453
2440
|
}
|
|
2454
2441
|
}
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
return;
|
|
2458
|
-
this.sessionExpiredShown = true;
|
|
2459
|
-
const { isConfirmed } = await this.alertService.confirm(this.termPipe.transform('QUICKSIGHT_SESSION_EXPIRED_TITLE', this.GlobalTermService.languageCode), 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));
|
|
2460
|
-
if (isConfirmed)
|
|
2461
|
-
window.location.reload();
|
|
2462
|
-
else
|
|
2463
|
-
this.sessionExpiredShown = false;
|
|
2442
|
+
ngOnDestroy() {
|
|
2443
|
+
this.sharedService.clearSessionTimer();
|
|
2464
2444
|
}
|
|
2465
2445
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsInteractiveComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2466
2446
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.23", 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()) {\n<div class=\"u-display-flex u-flex-column u-gap-sm\">\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 1061.57 / 93.02\" />\n </p-panel>\n </div>\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\n @for (_ of [].constructor(4); track $index) {\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 244.87 / 123.12\" />\n </p-panel>\n }\n </div>\n <div class=\"u-display-flex u-flex-column u-gap-sm\">\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 1061.57 / 303.7\" />\n </p-panel>\n </div>\n <div class=\"u-display-flex u-flex-row u-gap-sm\">\n @for (_ of [].constructor(2); track $index) {\n <p-panel class=\"prPanel u-flex-grow-1 u-flex-basis-0 u-shadow-none\" showHeader=\"false\">\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'100%'\" style=\"aspect-ratio: 517.1 / 123.12\" />\n </p-panel>\n }\n </div>\n</div>\n}\n<div #visualContainer [style.height]=\"height()\" [hidden]=\"isLoading()\"></div>", dependencies: [{ kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: Panel, selector: "p-panel", inputs: ["id", "toggleable", "header", "collapsed", "styleClass", "iconPos", "showHeader", "toggler", "transitionOptions", "toggleButtonProps"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] });
|
|
@@ -3392,5 +3372,5 @@ class PageInformation {
|
|
|
3392
3372
|
* Generated bundle index. Do not edit.
|
|
3393
3373
|
*/
|
|
3394
3374
|
|
|
3395
|
-
export { AddFavoritesComponent, AddFavoritesService, BreadCrumbComponent, ColumnComponent, ColumnGroupComponent, DashboardQsComponent, DashboardQsInteractiveComponent, EchartComponent, EchartService, ElementHTTPService, ElementService, FormatAmountPipe, FormatCellPipe, OrderConstants, PageInformation, QUICKSIGHT_AUTH_ERROR_CODES, QuicksightEventName, RequestCacheService, RowResumenComponent, SearchComponent, SearchInputEnum, Shared, SharedService, SkeletonTableComponent, SortingComponent, TableComponent, TableFetchComponent, TitleComponent, TruncatePipe, darkenColor, dispatchQuicksightEvent
|
|
3375
|
+
export { AddFavoritesComponent, AddFavoritesService, BreadCrumbComponent, ColumnComponent, ColumnGroupComponent, DashboardQsComponent, DashboardQsInteractiveComponent, EchartComponent, EchartService, ElementHTTPService, ElementService, FormatAmountPipe, FormatCellPipe, OrderConstants, PageInformation, QUICKSIGHT_AUTH_ERROR_CODES, QuicksightEventName, RequestCacheService, RowResumenComponent, SearchComponent, SearchInputEnum, Shared, SharedService, SkeletonTableComponent, SortingComponent, TableComponent, TableFetchComponent, TitleComponent, TruncatePipe, darkenColor, dispatchQuicksightEvent };
|
|
3396
3376
|
//# sourceMappingURL=intelica-library-project.mjs.map
|