intelica-library-project 20.0.8 → 20.0.10

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.
@@ -10,7 +10,7 @@ import * as i1$1 from '@angular/common';
10
10
  import { CommonModule, DatePipe, isPlatformBrowser, NgClass } from '@angular/common';
11
11
  import * as i5 from 'primeng/tooltip';
12
12
  import { TooltipModule, Tooltip } from 'primeng/tooltip';
13
- import { GlobalTermService, TermPipe, FormatDateConstants, ConfigService, GlobalFavoriteService, Color, getColor } from 'intelica-library-base';
13
+ import { GlobalTermService, TermPipe, FormatDateConstants, ConfigService, AlertService, GlobalFavoriteService, Color, getColor } from 'intelica-library-base';
14
14
  import * as i4 from 'primeng/button';
15
15
  import { ButtonModule, Button } from 'primeng/button';
16
16
  import { Subscription, Subject, BehaviorSubject, firstValueFrom, map, distinctUntilChanged, of, tap, shareReplay, throwError } from 'rxjs';
@@ -2180,6 +2180,7 @@ class Shared {
2180
2180
  container,
2181
2181
  ...(options?.height && { height: options.height }),
2182
2182
  ...(options?.width && { width: options.width }),
2183
+ }, {
2183
2184
  ...(options?.onMessage && { onMessage: this.toSdkMessageListener(options.onMessage) }),
2184
2185
  });
2185
2186
  }
@@ -2198,8 +2199,10 @@ class Shared {
2198
2199
  container,
2199
2200
  ...(options?.height && { height: options.height }),
2200
2201
  ...(options?.width && { width: options.width }),
2202
+ }, {
2203
+ ...(sdkParameters ? { parameters: sdkParameters } : {}),
2201
2204
  ...(options?.onMessage && { onMessage: this.toSdkMessageListener(options.onMessage) }),
2202
- }, sdkParameters ? { parameters: sdkParameters } : undefined);
2205
+ });
2203
2206
  }
2204
2207
  toSdkMessageListener(emit) {
2205
2208
  return (changeEvent) => {
@@ -2301,7 +2304,9 @@ function dispatchQuicksightEvent(event, outputs) {
2301
2304
 
2302
2305
  class DashboardQsComponent {
2303
2306
  sharedService = inject(Shared);
2307
+ alertService = inject(AlertService);
2304
2308
  route = inject(ActivatedRoute);
2309
+ sessionExpiredShown = false;
2305
2310
  containers;
2306
2311
  dashboardIdInput = input(undefined, ...(ngDevMode ? [{ debugName: "dashboardIdInput", alias: 'dashboardId' }] : [{ alias: 'dashboardId' }]));
2307
2312
  parametersInput = input(undefined, ...(ngDevMode ? [{ debugName: "parametersInput", alias: 'parameters' }] : [{ alias: 'parameters' }]));
@@ -2344,6 +2349,8 @@ class DashboardQsComponent {
2344
2349
  dispatchQuicksightEvent(event, this);
2345
2350
  if (event.eventName === QuicksightEventName.CONTENT_LOADED || event.eventName === QuicksightEventName.ERROR_OCCURRED)
2346
2351
  this.isLoading.set(false);
2352
+ if (isQuicksightSessionExpiredEvent(event))
2353
+ this.handleSessionExpired();
2347
2354
  },
2348
2355
  });
2349
2356
  }
@@ -2352,6 +2359,16 @@ class DashboardQsComponent {
2352
2359
  this.isLoading.set(false);
2353
2360
  }
2354
2361
  }
2362
+ async handleSessionExpired() {
2363
+ if (this.sessionExpiredShown)
2364
+ return;
2365
+ this.sessionExpiredShown = true;
2366
+ const { isConfirmed } = await this.alertService.confirm('Sesión expirada', 'Tu sesión de QuickSight expiró. Actualiza la página para continuar.', 'Actualizar página', 'Cancelar');
2367
+ if (isConfirmed)
2368
+ window.location.reload();
2369
+ else
2370
+ this.sessionExpiredShown = false;
2371
+ }
2355
2372
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2356
2373
  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-background-white u-px-1 u-pt-1\">\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\n </div>\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\n </div>\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 / 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"] }] });
2357
2374
  }
@@ -2365,7 +2382,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.23", ngImpo
2365
2382
 
2366
2383
  class DashboardQsInteractiveComponent {
2367
2384
  sharedService = inject(Shared);
2385
+ alertService = inject(AlertService);
2368
2386
  route = inject(ActivatedRoute);
2387
+ sessionExpiredShown = false;
2369
2388
  containers;
2370
2389
  dashboardIdInput = input(undefined, ...(ngDevMode ? [{ debugName: "dashboardIdInput", alias: 'dashboardId' }] : [{ alias: 'dashboardId' }]));
2371
2390
  parametersInput = input(undefined, ...(ngDevMode ? [{ debugName: "parametersInput", alias: 'parameters' }] : [{ alias: 'parameters' }]));
@@ -2420,6 +2439,8 @@ class DashboardQsInteractiveComponent {
2420
2439
  dispatchQuicksightEvent(event, this);
2421
2440
  if (event.eventName === QuicksightEventName.CONTENT_LOADED || event.eventName === QuicksightEventName.ERROR_OCCURRED || event.eventName === QuicksightEventName.PARAMETERS_CHANGED)
2422
2441
  this.isLoading.set(false);
2442
+ if (isQuicksightSessionExpiredEvent(event))
2443
+ this.handleSessionExpired();
2423
2444
  },
2424
2445
  });
2425
2446
  }
@@ -2428,6 +2449,16 @@ class DashboardQsInteractiveComponent {
2428
2449
  this.isLoading.set(false);
2429
2450
  }
2430
2451
  }
2452
+ async handleSessionExpired() {
2453
+ if (this.sessionExpiredShown)
2454
+ return;
2455
+ this.sessionExpiredShown = true;
2456
+ const { isConfirmed } = await this.alertService.confirm('Sesión expirada', 'Tu sesión de QuickSight expiró. Actualiza la página para continuar.', 'Actualizar página', 'Cancelar');
2457
+ if (isConfirmed)
2458
+ window.location.reload();
2459
+ else
2460
+ this.sessionExpiredShown = false;
2461
+ }
2431
2462
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.23", ngImport: i0, type: DashboardQsInteractiveComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2432
2463
  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-background-white u-px-1 u-pt-1\">\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\n </div>\n <div class=\"u-display-flex u-flex-column u-px-1\" style=\"height: 33px\">\n <p-skeleton class=\"prSkeleton u-m-auto\" [width]=\"'61px'\" [height]=\"'14px'\" />\n <p-skeleton class=\"prSkeleton\" [width]=\"'100%'\" [height]=\"'2px'\" />\n </div>\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 / 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"] }] });
2433
2464
  }