gamma-app-controller 1.2.18 → 1.2.19

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.
Files changed (20) hide show
  1. package/esm2020/lib/application-controller/page-controller/page-controller/page-controller.component.mjs +2 -1
  2. package/esm2020/lib/shared/advanced-component/app-advance-header/app-header.component.mjs +21 -8
  3. package/esm2020/lib/template-module/defaulLandingMultiLayoutComponent/defaulLandingMultiLayout.component.mjs +1249 -0
  4. package/esm2020/lib/template-module/defaulLandingMultiLayoutComponent/defaulLandingMultiLayout.module.mjs +151 -0
  5. package/esm2020/lib/template-module/defaulLandingMultiLayoutComponent/defaulLandingMultiLayout.service.mjs +121 -0
  6. package/esm2020/lib/template-module/defaulLandingMultiLayoutComponent/multi-landing-dataset-call.service.mjs +364 -0
  7. package/esm2020/lib/template-module/defaulLandingMultiLayoutComponent/multi-landing.tokenStorage.servce.mjs +36 -0
  8. package/esm2020/public-api.mjs +6 -1
  9. package/fesm2015/gamma-app-controller.mjs +1923 -16
  10. package/fesm2015/gamma-app-controller.mjs.map +1 -1
  11. package/fesm2020/gamma-app-controller.mjs +1900 -16
  12. package/fesm2020/gamma-app-controller.mjs.map +1 -1
  13. package/lib/shared/advanced-component/app-advance-header/app-header.component.d.ts +8 -3
  14. package/lib/template-module/defaulLandingMultiLayoutComponent/defaulLandingMultiLayout.component.d.ts +141 -0
  15. package/lib/template-module/defaulLandingMultiLayoutComponent/defaulLandingMultiLayout.module.d.ts +16 -0
  16. package/lib/template-module/defaulLandingMultiLayoutComponent/defaulLandingMultiLayout.service.d.ts +33 -0
  17. package/lib/template-module/defaulLandingMultiLayoutComponent/multi-landing-dataset-call.service.d.ts +24 -0
  18. package/lib/template-module/defaulLandingMultiLayoutComponent/multi-landing.tokenStorage.servce.d.ts +12 -0
  19. package/package.json +1 -1
  20. package/public-api.d.ts +5 -0
@@ -7158,7 +7158,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
7158
7158
  args: ['chartDataSource']
7159
7159
  }] } });
7160
7160
 
7161
- const TOKEN_KEY$3 = 'x-auth-token';
7161
+ const TOKEN_KEY$4 = 'x-auth-token';
7162
7162
  class AppLocalStorage {
7163
7163
  constructor(environment) {
7164
7164
  this.environment = environment;
@@ -7173,7 +7173,7 @@ class AppLocalStorage {
7173
7173
  return window.localStorage.removeItem[this.getAppVariableName(type)];
7174
7174
  }
7175
7175
  destroy() {
7176
- window.localStorage.removeItem(TOKEN_KEY$3);
7176
+ window.localStorage.removeItem(TOKEN_KEY$4);
7177
7177
  }
7178
7178
  getAppVariableName(attributeName) {
7179
7179
  return this.environment.appName + '__' + attributeName;
@@ -8161,10 +8161,12 @@ class AppAdvanceHeaderComponent {
8161
8161
  };
8162
8162
  this.srvTypeDataSource = [];
8163
8163
  this.srvTypeDisplayValue = [];
8164
+ this.selectedDetesforView = '';
8164
8165
  this.selectedDateRangeOrServtype = new EventEmitter();
8165
8166
  this.getFilterPageConfig = new EventEmitter();
8166
8167
  this.getOperatorName = new EventEmitter();
8167
8168
  this.getContextFilterData = new EventEmitter();
8169
+ this.selectedDatesMap = {};
8168
8170
  }
8169
8171
  set filterItems(value) {
8170
8172
  if (value === undefined || value.length === 0) {
@@ -8244,6 +8246,13 @@ class AppAdvanceHeaderComponent {
8244
8246
  });
8245
8247
  }
8246
8248
  }
8249
+ ngOnChanges(changes) {
8250
+ var _a;
8251
+ if (changes['filterObjects'] && ((_a = this.filterObjects) === null || _a === void 0 ? void 0 : _a.widgetId)) {
8252
+ const widgetId = this.filterObjects.widgetId;
8253
+ this.selectedDatesMap[widgetId] = this.selectedDetesforView;
8254
+ }
8255
+ }
8247
8256
  getContextMenuChange(event) {
8248
8257
  if (event.event) {
8249
8258
  const foundObject = this.contextFilterItemsForFilter.find(item => item.defaultFilterValue === event.value);
@@ -8329,18 +8338,21 @@ class AppAdvanceHeaderComponent {
8329
8338
  }
8330
8339
  }
8331
8340
  });
8341
+ let selectedText = '';
8332
8342
  if (displayStartDate && displayEndDate) {
8333
- this.selectedDetesforView = `${displayStartDate} - ${displayEndDate}`;
8343
+ selectedText = `${displayStartDate} - ${displayEndDate}`;
8334
8344
  }
8335
8345
  else if (displayStartDate) {
8336
- this.selectedDetesforView = displayStartDate;
8346
+ selectedText = displayStartDate;
8337
8347
  }
8338
8348
  else if (displayEndDate) {
8339
- this.selectedDetesforView = displayEndDate;
8349
+ selectedText = displayEndDate;
8340
8350
  }
8341
- else {
8342
- this.selectedDetesforView = '';
8351
+ const element = document.getElementById(this.filterObjects.widgetId);
8352
+ if (element) {
8353
+ element.innerText = selectedText;
8343
8354
  }
8355
+ filter['filterObjects'] = (this.filterObjects) ? this.filterObjects : null;
8344
8356
  this.getFilterPageConfig.emit(filter);
8345
8357
  }
8346
8358
  getOperatorDataSource(event) {
@@ -8392,10 +8404,10 @@ class AppAdvanceHeaderComponent {
8392
8404
  }
8393
8405
  }
8394
8406
  AppAdvanceHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppAdvanceHeaderComponent, deps: [{ token: i2.ActivatedRoute }, { token: i2.Router }, { token: CommonService }, { token: AppLocalStorage }], target: i0.ɵɵFactoryTarget.Component });
8395
- AppAdvanceHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: AppAdvanceHeaderComponent, selector: "app-advance-header", inputs: { pageTitle: "pageTitle", bread_crumbs_container: "bread_crumbs_container", isEditButton: "isEditButton", isAdvanceButton: "isAdvanceButton", selectedDates: "selectedDates", filterItems: "filterItems", contextFilterItems: "contextFilterItems" }, outputs: { toggleEvent: "toggleEvent", selectedDateRangeOrServtype: "selectedDateRangeOrServtype", getFilterPageConfig: "getFilterPageConfig", getOperatorName: "getOperatorName", getContextFilterData: "getContextFilterData" }, ngImport: i0, template: "<div class=\"flex flex-col mb-2\">\n <div class=\"flex justify-between border-b dark:bg-transparent\">\n <div class=\"flex flex-col ml-1\">\n <div class=\"flex items-center float-start\">\n <div class=\"flex items-center overflow-hidden\">\n <mat-icon class=\"icon-size-2\" [svgIcon]=\"'heroicons_solid:template'\"></mat-icon>\n </div>\n <h2\n class=\"text-2xl md:text-2xl py-3 font-extrabold items-center ml-2 tracking-tight leading-5 truncate capitalize\">\n {{ getPageTitle(pageTitle) }}\n </h2>\n </div>\n <div class=\"\">\n <!-- INCOMING -->\n <gamma-bread-crumbs [kpi_data_container]=\"bread_crumbs_container\"></gamma-bread-crumbs>\n </div>\n </div>\n <div class=\"flex justify-between items-center border-l-2 p-0 m-0\">\n\n <div class=\"mx-2\" *ngIf=\"isEditButton\">\n <div (click)=\"editKpi()\"\n class=\"bg-blue-700 cursor-pointer dark:bg-blue-600 dark:focus:ring-blue-800 dark:hover:bg-blue-700 focus:outline-none focus:ring-4 focus:ring-blue-300 font-medium hover:bg-blue-800 mr-2 px-2.5 py-2 rounded text-sm text-white ng-star-inserted\">\n Edit\n </div>\n </div>\n <ng-container *ngIf=\"contextFilterItemsForFilter && contextFilterItemsForFilter.length !== 0 \">\n <div class=\"w-1 h-full border-l-2\"></div>\n <div class=\"mx-2\" >\n <dx-select-box [items]=\"contextFilterItemsForFilter\" (onValueChanged)=\"getContextMenuChange($event)\" displayExpr=\"label\" valueExpr=\"defaultFilterValue\"\n [(ngModel)]=\"defaultFilterValue\"></dx-select-box>\n </div>\n </ng-container>\n \n <div class=\"w-1 h-full border-l-2\" *ngIf=\"isEditButton\"></div>\n\n <div class=\"mx-2\">\n <div class=\"cursor-pointer\" (click)=\"advanceFilterKpi()\"> {{selectedDetesforView}}</div>\n </div>\n <div class=\"w-1 h-full border-l-2\"></div>\n <div class=\"mx-2\" *ngIf=\"isAdvanceButton\">\n <button class=\"mat-focus-indicator mat-menu-trigger mat-icon-button mat-button-base\"\n aria-haspopup=\"menu\" (click)=\"advanceFilterKpi()\">\n <span class=\"mat-button-wrapper\">\n <span class=\"relative\">\n <mat-icon title=\"Filters\" [svgIcon]=\"'heroicons_outline:adjustments'\">\n </mat-icon>\n </span>\n </span>\n </button>\n </div>\n\n\n <div class=\"w-1 h-full border-l-2\"></div>\n <!-- <div class=\"mx-2\">\n <button class=\"mat-focus-indicator mat-menu-trigger mat-icon-button mat-button-base\"\n aria-haspopup=\"menu\">\n <span class=\"mat-button-wrapper\">\n <span class=\"relative\">\n <mat-icon (click)=\"callPageDocumentation()\" title=\"Add Filters\" [svgIcon]=\"\n 'heroicons_outline:question-mark-circle'\n \">\n </mat-icon>\n </span>\n </span>\n <span class=\"mat-button-focus-overlay\"></span>\n </button>\n </div> -->\n\n </div>\n </div>\n</div>\n\n<dx-popup [(visible)]=\"isAdvanceFilter\" [closeOnOutsideClick]=\"false\" [dragEnabled]=\"false\" [width]=\"600\"\n [height]=\"'auto'\" [showTitle]=\"true\" class=\"popup\" title=\"Filter\">\n <div *dxTemplate=\"let data of 'content'\">\n <app-gamma-advance-filter [kpiId]=\"'231212'\" [filterOperatorData]=\"filterItemsForFilter\"\n [isButtonDesiable]=\"isAdvanceFilter\" [filterStartDate]=\"filterStartDate\" [filterEndDate]=\"filterEndDate\"\n (filterDataObject)=\"getSerchFilter($event)\"></app-gamma-advance-filter>\n </div>\n</dx-popup>", dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i9$1.DxPopupComponent, selector: "dx-popup", inputs: ["accessKey", "animation", "closeOnOutsideClick", "container", "contentTemplate", "copyRootClassesToWrapper", "deferRendering", "disabled", "dragAndResizeArea", "dragEnabled", "dragOutsideBoundary", "elementAttr", "focusStateEnabled", "fullScreen", "height", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "resizeEnabled", "restorePosition", "rtlEnabled", "shading", "shadingColor", "showCloseButton", "showTitle", "tabIndex", "title", "titleTemplate", "toolbarItems", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onResize", "onResizeEnd", "onResizeStart", "onShowing", "onShown", "onTitleRendered", "accessKeyChange", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "disabledChange", "dragAndResizeAreaChange", "dragEnabledChange", "dragOutsideBoundaryChange", "elementAttrChange", "focusStateEnabledChange", "fullScreenChange", "heightChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "resizeEnabledChange", "restorePositionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showCloseButtonChange", "showTitleChange", "tabIndexChange", "titleChange", "titleTemplateChange", "toolbarItemsChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "component", type: i6$1.DxSelectBoxComponent, selector: "dx-select-box", inputs: ["acceptCustomValue", "accessKey", "activeStateEnabled", "buttons", "dataSource", "deferRendering", "disabled", "displayExpr", "displayValue", "dropDownButtonTemplate", "dropDownOptions", "elementAttr", "fieldTemplate", "focusStateEnabled", "grouped", "groupTemplate", "height", "hint", "hoverStateEnabled", "inputAttr", "isValid", "items", "itemTemplate", "label", "labelMode", "maxLength", "minSearchLength", "name", "noDataText", "opened", "openOnFieldClick", "placeholder", "readOnly", "rtlEnabled", "searchEnabled", "searchExpr", "searchMode", "searchTimeout", "selectedItem", "showClearButton", "showDataBeforeSearch", "showDropDownButton", "showSelectionControls", "spellcheck", "stylingMode", "tabIndex", "text", "useItemTextAsTitle", "validationError", "validationErrors", "validationMessageMode", "validationStatus", "value", "valueChangeEvent", "valueExpr", "visible", "width", "wrapItemText"], outputs: ["onChange", "onClosed", "onContentReady", "onCopy", "onCustomItemCreating", "onCut", "onDisposing", "onEnterKey", "onFocusIn", "onFocusOut", "onInitialized", "onInput", "onItemClick", "onKeyDown", "onKeyUp", "onOpened", "onOptionChanged", "onPaste", "onSelectionChanged", "onValueChanged", "acceptCustomValueChange", "accessKeyChange", "activeStateEnabledChange", "buttonsChange", "dataSourceChange", "deferRenderingChange", "disabledChange", "displayExprChange", "displayValueChange", "dropDownButtonTemplateChange", "dropDownOptionsChange", "elementAttrChange", "fieldTemplateChange", "focusStateEnabledChange", "groupedChange", "groupTemplateChange", "heightChange", "hintChange", "hoverStateEnabledChange", "inputAttrChange", "isValidChange", "itemsChange", "itemTemplateChange", "labelChange", "labelModeChange", "maxLengthChange", "minSearchLengthChange", "nameChange", "noDataTextChange", "openedChange", "openOnFieldClickChange", "placeholderChange", "readOnlyChange", "rtlEnabledChange", "searchEnabledChange", "searchExprChange", "searchModeChange", "searchTimeoutChange", "selectedItemChange", "showClearButtonChange", "showDataBeforeSearchChange", "showDropDownButtonChange", "showSelectionControlsChange", "spellcheckChange", "stylingModeChange", "tabIndexChange", "textChange", "useItemTextAsTitleChange", "validationErrorChange", "validationErrorsChange", "validationMessageModeChange", "validationStatusChange", "valueChange", "valueChangeEventChange", "valueExprChange", "visibleChange", "widthChange", "wrapItemTextChange", "onBlur"] }, { kind: "directive", type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: GammaAdvanceFilterComponent, selector: "app-gamma-advance-filter", inputs: ["kpiId", "filterStartDate", "filterEndDate", "browser_api_config", "isButtonDesiable", "filterOperatorData"], outputs: ["filterDataObject"] }, { kind: "component", type: BreadCrumbsComponent, selector: "gamma-bread-crumbs", inputs: ["kpi_data_container"] }] });
8407
+ AppAdvanceHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: AppAdvanceHeaderComponent, selector: "app-advance-header", inputs: { pageTitle: "pageTitle", bread_crumbs_container: "bread_crumbs_container", isEditButton: "isEditButton", isAdvanceButton: "isAdvanceButton", selectedDates: "selectedDates", filterObjects: "filterObjects", filterItems: "filterItems", contextFilterItems: "contextFilterItems" }, outputs: { toggleEvent: "toggleEvent", selectedDateRangeOrServtype: "selectedDateRangeOrServtype", getFilterPageConfig: "getFilterPageConfig", getOperatorName: "getOperatorName", getContextFilterData: "getContextFilterData" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-col mb-2\">\n <div class=\"flex justify-between border-b dark:bg-transparent\">\n <div class=\"flex flex-col ml-1\">\n <div class=\"flex items-center float-start\">\n <div class=\"flex items-center overflow-hidden\">\n <mat-icon class=\"icon-size-2\" [svgIcon]=\"'heroicons_solid:template'\"></mat-icon>\n </div>\n <h2\n class=\"text-2xl md:text-2xl py-3 font-extrabold items-center ml-2 tracking-tight leading-5 truncate capitalize\">\n {{ getPageTitle(pageTitle) }}\n </h2>\n </div>\n <div class=\"\">\n <!-- INCOMING -->\n <gamma-bread-crumbs [kpi_data_container]=\"bread_crumbs_container\"></gamma-bread-crumbs>\n </div>\n </div>\n <div class=\"flex justify-between items-center border-l-2 p-0 m-0\">\n\n <div class=\"mx-2\" *ngIf=\"isEditButton\">\n <div (click)=\"editKpi()\"\n class=\"bg-blue-700 cursor-pointer dark:bg-blue-600 dark:focus:ring-blue-800 dark:hover:bg-blue-700 focus:outline-none focus:ring-4 focus:ring-blue-300 font-medium hover:bg-blue-800 mr-2 px-2.5 py-2 rounded text-sm text-white ng-star-inserted\">\n Edit\n </div>\n </div>\n <ng-container *ngIf=\"contextFilterItemsForFilter && contextFilterItemsForFilter.length !== 0 \">\n <div class=\"w-1 h-full border-l-2\"></div>\n <div class=\"mx-2\">\n <dx-select-box [items]=\"contextFilterItemsForFilter\" (onValueChanged)=\"getContextMenuChange($event)\"\n displayExpr=\"label\" valueExpr=\"defaultFilterValue\"\n [(ngModel)]=\"defaultFilterValue\"></dx-select-box>\n </div>\n </ng-container>\n\n <div class=\"w-1 h-full border-l-2\" *ngIf=\"isEditButton\"></div>\n\n <div class=\"mx-2\">\n <!-- <div class=\"cursor-pointer\" (click)=\"advanceFilterKpi()\" id=\"{{filterObjects.widgetId}}\"> {{selectedDetesforView}}</div> -->\n<!-- [id]=\"filterObjects.widgetId\" -->\n <div class=\"mx-2\">\n <div class=\"cursor-pointer\" (click)=\"advanceFilterKpi()\" >\n {{selectedDetesforView}}\n </div>\n </div>\n\n </div>\n <div class=\"w-1 h-full border-l-2\"></div>\n <div class=\"mx-2\" *ngIf=\"isAdvanceButton\">\n <button class=\"mat-focus-indicator mat-menu-trigger mat-icon-button mat-button-base\"\n aria-haspopup=\"menu\" (click)=\"advanceFilterKpi()\">\n <span class=\"mat-button-wrapper\">\n <span class=\"relative\">\n <mat-icon title=\"Filters\" [svgIcon]=\"'heroicons_outline:adjustments'\">\n </mat-icon>\n </span>\n </span>\n </button>\n </div>\n\n\n <div class=\"w-1 h-full border-l-2\"></div>\n <!-- <div class=\"mx-2\">\n <button class=\"mat-focus-indicator mat-menu-trigger mat-icon-button mat-button-base\"\n aria-haspopup=\"menu\">\n <span class=\"mat-button-wrapper\">\n <span class=\"relative\">\n <mat-icon (click)=\"callPageDocumentation()\" title=\"Add Filters\" [svgIcon]=\"\n 'heroicons_outline:question-mark-circle'\n \">\n </mat-icon>\n </span>\n </span>\n <span class=\"mat-button-focus-overlay\"></span>\n </button>\n </div> -->\n\n </div>\n </div>\n</div>\n\n<dx-popup [(visible)]=\"isAdvanceFilter\" [closeOnOutsideClick]=\"false\" [dragEnabled]=\"false\" [width]=\"600\"\n [height]=\"'auto'\" [showTitle]=\"true\" class=\"popup\" title=\"Filter\">\n <div *dxTemplate=\"let data of 'content'\">\n <app-gamma-advance-filter [kpiId]=\"'231212'\" [filterOperatorData]=\"filterItemsForFilter\"\n [isButtonDesiable]=\"isAdvanceFilter\" [filterStartDate]=\"filterStartDate\" [filterEndDate]=\"filterEndDate\"\n (filterDataObject)=\"getSerchFilter($event)\"></app-gamma-advance-filter>\n </div>\n</dx-popup>", dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i9$1.DxPopupComponent, selector: "dx-popup", inputs: ["accessKey", "animation", "closeOnOutsideClick", "container", "contentTemplate", "copyRootClassesToWrapper", "deferRendering", "disabled", "dragAndResizeArea", "dragEnabled", "dragOutsideBoundary", "elementAttr", "focusStateEnabled", "fullScreen", "height", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "resizeEnabled", "restorePosition", "rtlEnabled", "shading", "shadingColor", "showCloseButton", "showTitle", "tabIndex", "title", "titleTemplate", "toolbarItems", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onResize", "onResizeEnd", "onResizeStart", "onShowing", "onShown", "onTitleRendered", "accessKeyChange", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "disabledChange", "dragAndResizeAreaChange", "dragEnabledChange", "dragOutsideBoundaryChange", "elementAttrChange", "focusStateEnabledChange", "fullScreenChange", "heightChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "resizeEnabledChange", "restorePositionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showCloseButtonChange", "showTitleChange", "tabIndexChange", "titleChange", "titleTemplateChange", "toolbarItemsChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "component", type: i6$1.DxSelectBoxComponent, selector: "dx-select-box", inputs: ["acceptCustomValue", "accessKey", "activeStateEnabled", "buttons", "dataSource", "deferRendering", "disabled", "displayExpr", "displayValue", "dropDownButtonTemplate", "dropDownOptions", "elementAttr", "fieldTemplate", "focusStateEnabled", "grouped", "groupTemplate", "height", "hint", "hoverStateEnabled", "inputAttr", "isValid", "items", "itemTemplate", "label", "labelMode", "maxLength", "minSearchLength", "name", "noDataText", "opened", "openOnFieldClick", "placeholder", "readOnly", "rtlEnabled", "searchEnabled", "searchExpr", "searchMode", "searchTimeout", "selectedItem", "showClearButton", "showDataBeforeSearch", "showDropDownButton", "showSelectionControls", "spellcheck", "stylingMode", "tabIndex", "text", "useItemTextAsTitle", "validationError", "validationErrors", "validationMessageMode", "validationStatus", "value", "valueChangeEvent", "valueExpr", "visible", "width", "wrapItemText"], outputs: ["onChange", "onClosed", "onContentReady", "onCopy", "onCustomItemCreating", "onCut", "onDisposing", "onEnterKey", "onFocusIn", "onFocusOut", "onInitialized", "onInput", "onItemClick", "onKeyDown", "onKeyUp", "onOpened", "onOptionChanged", "onPaste", "onSelectionChanged", "onValueChanged", "acceptCustomValueChange", "accessKeyChange", "activeStateEnabledChange", "buttonsChange", "dataSourceChange", "deferRenderingChange", "disabledChange", "displayExprChange", "displayValueChange", "dropDownButtonTemplateChange", "dropDownOptionsChange", "elementAttrChange", "fieldTemplateChange", "focusStateEnabledChange", "groupedChange", "groupTemplateChange", "heightChange", "hintChange", "hoverStateEnabledChange", "inputAttrChange", "isValidChange", "itemsChange", "itemTemplateChange", "labelChange", "labelModeChange", "maxLengthChange", "minSearchLengthChange", "nameChange", "noDataTextChange", "openedChange", "openOnFieldClickChange", "placeholderChange", "readOnlyChange", "rtlEnabledChange", "searchEnabledChange", "searchExprChange", "searchModeChange", "searchTimeoutChange", "selectedItemChange", "showClearButtonChange", "showDataBeforeSearchChange", "showDropDownButtonChange", "showSelectionControlsChange", "spellcheckChange", "stylingModeChange", "tabIndexChange", "textChange", "useItemTextAsTitleChange", "validationErrorChange", "validationErrorsChange", "validationMessageModeChange", "validationStatusChange", "valueChange", "valueChangeEventChange", "valueExprChange", "visibleChange", "widthChange", "wrapItemTextChange", "onBlur"] }, { kind: "directive", type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: GammaAdvanceFilterComponent, selector: "app-gamma-advance-filter", inputs: ["kpiId", "filterStartDate", "filterEndDate", "browser_api_config", "isButtonDesiable", "filterOperatorData"], outputs: ["filterDataObject"] }, { kind: "component", type: BreadCrumbsComponent, selector: "gamma-bread-crumbs", inputs: ["kpi_data_container"] }] });
8396
8408
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppAdvanceHeaderComponent, decorators: [{
8397
8409
  type: Component,
8398
- args: [{ selector: 'app-advance-header', template: "<div class=\"flex flex-col mb-2\">\n <div class=\"flex justify-between border-b dark:bg-transparent\">\n <div class=\"flex flex-col ml-1\">\n <div class=\"flex items-center float-start\">\n <div class=\"flex items-center overflow-hidden\">\n <mat-icon class=\"icon-size-2\" [svgIcon]=\"'heroicons_solid:template'\"></mat-icon>\n </div>\n <h2\n class=\"text-2xl md:text-2xl py-3 font-extrabold items-center ml-2 tracking-tight leading-5 truncate capitalize\">\n {{ getPageTitle(pageTitle) }}\n </h2>\n </div>\n <div class=\"\">\n <!-- INCOMING -->\n <gamma-bread-crumbs [kpi_data_container]=\"bread_crumbs_container\"></gamma-bread-crumbs>\n </div>\n </div>\n <div class=\"flex justify-between items-center border-l-2 p-0 m-0\">\n\n <div class=\"mx-2\" *ngIf=\"isEditButton\">\n <div (click)=\"editKpi()\"\n class=\"bg-blue-700 cursor-pointer dark:bg-blue-600 dark:focus:ring-blue-800 dark:hover:bg-blue-700 focus:outline-none focus:ring-4 focus:ring-blue-300 font-medium hover:bg-blue-800 mr-2 px-2.5 py-2 rounded text-sm text-white ng-star-inserted\">\n Edit\n </div>\n </div>\n <ng-container *ngIf=\"contextFilterItemsForFilter && contextFilterItemsForFilter.length !== 0 \">\n <div class=\"w-1 h-full border-l-2\"></div>\n <div class=\"mx-2\" >\n <dx-select-box [items]=\"contextFilterItemsForFilter\" (onValueChanged)=\"getContextMenuChange($event)\" displayExpr=\"label\" valueExpr=\"defaultFilterValue\"\n [(ngModel)]=\"defaultFilterValue\"></dx-select-box>\n </div>\n </ng-container>\n \n <div class=\"w-1 h-full border-l-2\" *ngIf=\"isEditButton\"></div>\n\n <div class=\"mx-2\">\n <div class=\"cursor-pointer\" (click)=\"advanceFilterKpi()\"> {{selectedDetesforView}}</div>\n </div>\n <div class=\"w-1 h-full border-l-2\"></div>\n <div class=\"mx-2\" *ngIf=\"isAdvanceButton\">\n <button class=\"mat-focus-indicator mat-menu-trigger mat-icon-button mat-button-base\"\n aria-haspopup=\"menu\" (click)=\"advanceFilterKpi()\">\n <span class=\"mat-button-wrapper\">\n <span class=\"relative\">\n <mat-icon title=\"Filters\" [svgIcon]=\"'heroicons_outline:adjustments'\">\n </mat-icon>\n </span>\n </span>\n </button>\n </div>\n\n\n <div class=\"w-1 h-full border-l-2\"></div>\n <!-- <div class=\"mx-2\">\n <button class=\"mat-focus-indicator mat-menu-trigger mat-icon-button mat-button-base\"\n aria-haspopup=\"menu\">\n <span class=\"mat-button-wrapper\">\n <span class=\"relative\">\n <mat-icon (click)=\"callPageDocumentation()\" title=\"Add Filters\" [svgIcon]=\"\n 'heroicons_outline:question-mark-circle'\n \">\n </mat-icon>\n </span>\n </span>\n <span class=\"mat-button-focus-overlay\"></span>\n </button>\n </div> -->\n\n </div>\n </div>\n</div>\n\n<dx-popup [(visible)]=\"isAdvanceFilter\" [closeOnOutsideClick]=\"false\" [dragEnabled]=\"false\" [width]=\"600\"\n [height]=\"'auto'\" [showTitle]=\"true\" class=\"popup\" title=\"Filter\">\n <div *dxTemplate=\"let data of 'content'\">\n <app-gamma-advance-filter [kpiId]=\"'231212'\" [filterOperatorData]=\"filterItemsForFilter\"\n [isButtonDesiable]=\"isAdvanceFilter\" [filterStartDate]=\"filterStartDate\" [filterEndDate]=\"filterEndDate\"\n (filterDataObject)=\"getSerchFilter($event)\"></app-gamma-advance-filter>\n </div>\n</dx-popup>" }]
8410
+ args: [{ selector: 'app-advance-header', template: "<div class=\"flex flex-col mb-2\">\n <div class=\"flex justify-between border-b dark:bg-transparent\">\n <div class=\"flex flex-col ml-1\">\n <div class=\"flex items-center float-start\">\n <div class=\"flex items-center overflow-hidden\">\n <mat-icon class=\"icon-size-2\" [svgIcon]=\"'heroicons_solid:template'\"></mat-icon>\n </div>\n <h2\n class=\"text-2xl md:text-2xl py-3 font-extrabold items-center ml-2 tracking-tight leading-5 truncate capitalize\">\n {{ getPageTitle(pageTitle) }}\n </h2>\n </div>\n <div class=\"\">\n <!-- INCOMING -->\n <gamma-bread-crumbs [kpi_data_container]=\"bread_crumbs_container\"></gamma-bread-crumbs>\n </div>\n </div>\n <div class=\"flex justify-between items-center border-l-2 p-0 m-0\">\n\n <div class=\"mx-2\" *ngIf=\"isEditButton\">\n <div (click)=\"editKpi()\"\n class=\"bg-blue-700 cursor-pointer dark:bg-blue-600 dark:focus:ring-blue-800 dark:hover:bg-blue-700 focus:outline-none focus:ring-4 focus:ring-blue-300 font-medium hover:bg-blue-800 mr-2 px-2.5 py-2 rounded text-sm text-white ng-star-inserted\">\n Edit\n </div>\n </div>\n <ng-container *ngIf=\"contextFilterItemsForFilter && contextFilterItemsForFilter.length !== 0 \">\n <div class=\"w-1 h-full border-l-2\"></div>\n <div class=\"mx-2\">\n <dx-select-box [items]=\"contextFilterItemsForFilter\" (onValueChanged)=\"getContextMenuChange($event)\"\n displayExpr=\"label\" valueExpr=\"defaultFilterValue\"\n [(ngModel)]=\"defaultFilterValue\"></dx-select-box>\n </div>\n </ng-container>\n\n <div class=\"w-1 h-full border-l-2\" *ngIf=\"isEditButton\"></div>\n\n <div class=\"mx-2\">\n <!-- <div class=\"cursor-pointer\" (click)=\"advanceFilterKpi()\" id=\"{{filterObjects.widgetId}}\"> {{selectedDetesforView}}</div> -->\n<!-- [id]=\"filterObjects.widgetId\" -->\n <div class=\"mx-2\">\n <div class=\"cursor-pointer\" (click)=\"advanceFilterKpi()\" >\n {{selectedDetesforView}}\n </div>\n </div>\n\n </div>\n <div class=\"w-1 h-full border-l-2\"></div>\n <div class=\"mx-2\" *ngIf=\"isAdvanceButton\">\n <button class=\"mat-focus-indicator mat-menu-trigger mat-icon-button mat-button-base\"\n aria-haspopup=\"menu\" (click)=\"advanceFilterKpi()\">\n <span class=\"mat-button-wrapper\">\n <span class=\"relative\">\n <mat-icon title=\"Filters\" [svgIcon]=\"'heroicons_outline:adjustments'\">\n </mat-icon>\n </span>\n </span>\n </button>\n </div>\n\n\n <div class=\"w-1 h-full border-l-2\"></div>\n <!-- <div class=\"mx-2\">\n <button class=\"mat-focus-indicator mat-menu-trigger mat-icon-button mat-button-base\"\n aria-haspopup=\"menu\">\n <span class=\"mat-button-wrapper\">\n <span class=\"relative\">\n <mat-icon (click)=\"callPageDocumentation()\" title=\"Add Filters\" [svgIcon]=\"\n 'heroicons_outline:question-mark-circle'\n \">\n </mat-icon>\n </span>\n </span>\n <span class=\"mat-button-focus-overlay\"></span>\n </button>\n </div> -->\n\n </div>\n </div>\n</div>\n\n<dx-popup [(visible)]=\"isAdvanceFilter\" [closeOnOutsideClick]=\"false\" [dragEnabled]=\"false\" [width]=\"600\"\n [height]=\"'auto'\" [showTitle]=\"true\" class=\"popup\" title=\"Filter\">\n <div *dxTemplate=\"let data of 'content'\">\n <app-gamma-advance-filter [kpiId]=\"'231212'\" [filterOperatorData]=\"filterItemsForFilter\"\n [isButtonDesiable]=\"isAdvanceFilter\" [filterStartDate]=\"filterStartDate\" [filterEndDate]=\"filterEndDate\"\n (filterDataObject)=\"getSerchFilter($event)\"></app-gamma-advance-filter>\n </div>\n</dx-popup>" }]
8399
8411
  }], ctorParameters: function () { return [{ type: i2.ActivatedRoute }, { type: i2.Router }, { type: CommonService }, { type: AppLocalStorage }]; }, propDecorators: { pageTitle: [{
8400
8412
  type: Input
8401
8413
  }], bread_crumbs_container: [{
@@ -8416,6 +8428,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
8416
8428
  type: Output
8417
8429
  }], getContextFilterData: [{
8418
8430
  type: Output
8431
+ }], filterObjects: [{
8432
+ type: Input
8419
8433
  }], filterItems: [{
8420
8434
  type: Input,
8421
8435
  args: ['filterItems']
@@ -12786,6 +12800,7 @@ class PageControlerComponent {
12786
12800
  { "compName": "KpiWithDataSetTestComponent", "item": "Default KPI Layout" },
12787
12801
  { "compName": "KpiWithMultilayoutSetTestComponent", "item": "Multiple Layout KPI" },
12788
12802
  { "compName": "LandingComponentComponent", "item": "Default Page" },
12803
+ { "compName": "MultiLayoutLandingComponentComponent", "item": "Multiple Layout Page" },
12789
12804
  { "compName": "CdrConfigComponent", "item": "CDR Config" },
12790
12805
  { "compName": "CreateKpiTreeComponent", "item": "Create KPI Config" },
12791
12806
  { "compName": "CreateMetricsComponent", "item": "Create Metrics" },
@@ -18215,7 +18230,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
18215
18230
  }] }];
18216
18231
  } });
18217
18232
 
18218
- const TOKEN_KEY$2 = 'x-auth-token';
18233
+ const TOKEN_KEY$3 = 'x-auth-token';
18219
18234
  class AppSingleLayoutLocalStorage {
18220
18235
  constructor(environment) {
18221
18236
  this.environment = environment;
@@ -18230,7 +18245,7 @@ class AppSingleLayoutLocalStorage {
18230
18245
  return window.localStorage.removeItem[this.getAppVariableName(type)];
18231
18246
  }
18232
18247
  destroy() {
18233
- window.localStorage.removeItem(TOKEN_KEY$2);
18248
+ window.localStorage.removeItem(TOKEN_KEY$3);
18234
18249
  }
18235
18250
  getAppVariableName(attributeName) {
18236
18251
  return this.environment.appName + '__' + attributeName;
@@ -20416,7 +20431,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
20416
20431
  }] }];
20417
20432
  } });
20418
20433
 
20419
- const TOKEN_KEY$1 = 'x-auth-token';
20434
+ const TOKEN_KEY$2 = 'x-auth-token';
20420
20435
  class AppMultiLayoutLocalStorage {
20421
20436
  constructor(environment) {
20422
20437
  this.environment = environment;
@@ -20431,7 +20446,7 @@ class AppMultiLayoutLocalStorage {
20431
20446
  return window.localStorage.removeItem[this.getAppVariableName(type)];
20432
20447
  }
20433
20448
  destroy() {
20434
- window.localStorage.removeItem(TOKEN_KEY$1);
20449
+ window.localStorage.removeItem(TOKEN_KEY$2);
20435
20450
  }
20436
20451
  getAppVariableName(attributeName) {
20437
20452
  return this.environment.appName + '__' + attributeName;
@@ -22047,7 +22062,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
22047
22062
  }] }];
22048
22063
  } });
22049
22064
 
22050
- const TOKEN_KEY = 'x-auth-token';
22065
+ const TOKEN_KEY$1 = 'x-auth-token';
22051
22066
  class AppLandingLayoutLocalStorage {
22052
22067
  constructor(environment) {
22053
22068
  this.environment = environment;
@@ -22062,7 +22077,7 @@ class AppLandingLayoutLocalStorage {
22062
22077
  return window.localStorage.removeItem[this.getAppVariableName(type)];
22063
22078
  }
22064
22079
  destroy() {
22065
- window.localStorage.removeItem(TOKEN_KEY);
22080
+ window.localStorage.removeItem(TOKEN_KEY$1);
22066
22081
  }
22067
22082
  getAppVariableName(attributeName) {
22068
22083
  return this.environment.appName + '__' + attributeName;
@@ -23425,6 +23440,1898 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
23425
23440
  }]
23426
23441
  }] });
23427
23442
 
23443
+ class LandingMultiLayoutComponentService {
23444
+ constructor(http, environment) {
23445
+ this.http = http;
23446
+ this.environment = environment;
23447
+ this.headers = new HttpHeaders().set('Content-Type', 'application/json');
23448
+ this.options = { headers: this.headers, withCredentials: true };
23449
+ this._selectedKpiOnClick = new Subject();
23450
+ this._kpilist = new Subject();
23451
+ this._selectKpiFromDropDown = new Subject();
23452
+ this._componentRegistry = new Map();
23453
+ this.kpiFilter = new BehaviorSubject([]);
23454
+ }
23455
+ handleError(error) {
23456
+ return throwError(error);
23457
+ }
23458
+ getlistKpiBrowser() {
23459
+ const apiUrl = this.environment.appUrl + this.environment.apiVersion + '/kpi-config/listKpiBrowser';
23460
+ return this.http
23461
+ .get(apiUrl, { withCredentials: true })
23462
+ .pipe(map((response) => {
23463
+ return response;
23464
+ }), catchError(this.handleError));
23465
+ }
23466
+ getAppPageDetailConfig(pageId) {
23467
+ return this.http
23468
+ .get(this.environment.appUrl + this.environment.apiVersion + '/kpi-config/getAppPageDetailConfig?pageConfigId=' + pageId, this.options)
23469
+ .pipe(map((response) => {
23470
+ return response;
23471
+ }), catchError(this.handleError));
23472
+ }
23473
+ getAppPageConfigs() {
23474
+ const apiUrl = this.environment.appUrl + this.environment.apiVersion + '/kpi-config/getAppPageConfigs';
23475
+ return this.http
23476
+ .get(apiUrl, { withCredentials: true })
23477
+ .pipe(map((response) => {
23478
+ return response;
23479
+ }), catchError(this.handleError));
23480
+ }
23481
+ getAppDatasetConfigs() {
23482
+ const apiUrl = this.environment.appUrl + this.environment.apiVersion + '/kpi-config/getAppDatasetConfigs';
23483
+ return this.http
23484
+ .get(apiUrl, { withCredentials: true })
23485
+ .pipe(map((response) => {
23486
+ return response;
23487
+ }), catchError(this.handleError));
23488
+ }
23489
+ getAppDatasetConfig(datasetId) {
23490
+ const apiUrl = this.environment.appUrl + this.environment.apiVersion + '/kpi-config/getAppDatasetConfig?datasetId=' + datasetId;
23491
+ return this.http
23492
+ .get(apiUrl, { withCredentials: true })
23493
+ .pipe(map((response) => {
23494
+ return response;
23495
+ }), catchError(this.handleError));
23496
+ }
23497
+ getAppFilterConfig(filterId) {
23498
+ return this.http
23499
+ .get(this.environment.appUrl + this.environment.apiVersion + '/kpi-config/getAppFilterConfig?filterId=' + filterId, this.options)
23500
+ .pipe(map((response) => {
23501
+ return response;
23502
+ }), catchError(this.handleError));
23503
+ }
23504
+ getAppViewConfigs() {
23505
+ const apiUrl = this.environment.appUrl + this.environment.apiVersion + '/kpi-config/getAppViewConfigs';
23506
+ return this.http
23507
+ .get(apiUrl, { withCredentials: true })
23508
+ .pipe(map((response) => {
23509
+ return response;
23510
+ }), catchError(this.handleError));
23511
+ }
23512
+ getData(body, requestID) {
23513
+ return this.http
23514
+ .post(this.environment.appUrl + this.environment.apiVersion + requestID, JSON.stringify(body), this.options)
23515
+ .pipe(map((response) => {
23516
+ return response;
23517
+ }), catchError(this.handleError));
23518
+ }
23519
+ getSimpleApiPostRequest(requestApi, body) {
23520
+ return this.http
23521
+ .post(this.environment.appUrl + this.environment.apiVersion + requestApi, JSON.stringify(body), this.options)
23522
+ .pipe(map((response) => {
23523
+ return response;
23524
+ }), catchError(this.handleError));
23525
+ }
23526
+ getSimpleApiGetRequest(requestApi) {
23527
+ return this.http
23528
+ .get(this.environment.appUrl + this.environment.apiVersion + requestApi, { withCredentials: true })
23529
+ .pipe(map((response) => {
23530
+ return response;
23531
+ }), catchError(this.handleError));
23532
+ }
23533
+ getJsonDatasetPayload(requestApi) {
23534
+ return this.http
23535
+ .get(this.environment.appUrl + this.environment.apiVersion + requestApi, { withCredentials: true })
23536
+ .pipe(map((response) => {
23537
+ return response;
23538
+ }), catchError(this.handleError));
23539
+ }
23540
+ genericSqlQueryResponse(requestApi, body) {
23541
+ return this.http
23542
+ .post(this.environment.appUrl + this.environment.apiVersion + requestApi, JSON.stringify(body), this.options)
23543
+ .pipe(map((response) => {
23544
+ return response;
23545
+ }), catchError(this.handleError));
23546
+ }
23547
+ }
23548
+ LandingMultiLayoutComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LandingMultiLayoutComponentService, deps: [{ token: i1.HttpClient }, { token: APP_ENVIRONMENT }], target: i0.ɵɵFactoryTarget.Injectable });
23549
+ LandingMultiLayoutComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LandingMultiLayoutComponentService, providedIn: "root" });
23550
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LandingMultiLayoutComponentService, decorators: [{
23551
+ type: Injectable,
23552
+ args: [{ providedIn: "root" }]
23553
+ }], ctorParameters: function () {
23554
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
23555
+ type: Inject,
23556
+ args: [APP_ENVIRONMENT]
23557
+ }] }];
23558
+ } });
23559
+
23560
+ class LandingMultiLayoutApplicationDatssetsCall {
23561
+ constructor(service, kpiService, toastr, environment) {
23562
+ this.service = service;
23563
+ this.kpiService = kpiService;
23564
+ this.toastr = toastr;
23565
+ this.environment = environment;
23566
+ this.uniqueDataSetObject = {};
23567
+ }
23568
+ getDataFromDataSet(dataset, datasetId, filters) {
23569
+ if (dataset.datasetType == "mongo") {
23570
+ return this.getDataSetForMongo(dataset, datasetId);
23571
+ }
23572
+ else if (dataset.datasetType == "querybuilder") {
23573
+ return this.getDatasetForImpala(dataset, datasetId, filters);
23574
+ }
23575
+ else if (dataset.datasetType == "simpleApi") {
23576
+ return this.getDatasetForSimpleApiImpala(dataset, datasetId, filters);
23577
+ }
23578
+ else if (dataset.datasetType == "plainjson") {
23579
+ return this.getDatasetForPlainJson(dataset, datasetId, filters);
23580
+ }
23581
+ else if (dataset.datasetType == "sqlQuery") {
23582
+ return this.getDatasetForSqlTemplate(dataset, datasetId, filters);
23583
+ }
23584
+ else {
23585
+ return Promise.resolve();
23586
+ }
23587
+ }
23588
+ getDataSetForMongo(dataset, datasetId) {
23589
+ return new Promise((resolve, reject) => {
23590
+ let apiJsonObject = {
23591
+ requestId: dataset.config.serviceId,
23592
+ };
23593
+ if (dataset.config.fixOperationLevles && dataset.config.fixOperationLevles.length != 0) {
23594
+ for (const item of dataset.config.fixOperationLevles) {
23595
+ Object.assign(apiJsonObject, item);
23596
+ }
23597
+ }
23598
+ const mon_config = this.kpiService.getAllSeviceApiJson(apiJsonObject);
23599
+ this.service.getData(mon_config, dataset.config.api).subscribe({
23600
+ next: (data) => {
23601
+ const payload = data["Payload"] || data;
23602
+ this.uniqueDataSetObject[datasetId] = payload;
23603
+ resolve();
23604
+ },
23605
+ error: (err) => {
23606
+ console.error('Error:', err);
23607
+ reject(err);
23608
+ }
23609
+ });
23610
+ });
23611
+ }
23612
+ getDatasetForImpala(dataset, datasetId, filters) {
23613
+ return new Promise((resolve, reject) => {
23614
+ let request = dataset.config.queryConfig;
23615
+ let transformedObject = {};
23616
+ for (let item of request.reqFields) {
23617
+ const key = Object.keys(item)[0];
23618
+ const value = Object.values(item)[0];
23619
+ if (key === 'startDate') {
23620
+ transformedObject.recordDate = value;
23621
+ }
23622
+ else {
23623
+ transformedObject[key] = value;
23624
+ }
23625
+ }
23626
+ const operator = (filters && filters.length !== 0) ? Object.keys(filters.operationFilter).map(key => ({ [key]: filters.operationFilter[key] })) : [];
23627
+ transformedObject['filters'] = this.transformDataForMFilter(operator, request.mapedFilters);
23628
+ transformedObject['sorters'] = request.sorters;
23629
+ transformedObject["paginationRequired"] = false;
23630
+ if (dataset.config.api == "/kpi/genericAggregatePaginatedKpiServiceResponse") {
23631
+ transformedObject['measures'] = request.measures;
23632
+ transformedObject['dimensions'] = request.dimensions;
23633
+ }
23634
+ else {
23635
+ transformedObject['columns'] = this.getFormatObjectForColumn(request.columns);
23636
+ }
23637
+ if (request.havings && request.havings.length !== 0) {
23638
+ transformedObject['havings'] = request.havings;
23639
+ }
23640
+ this.service.getData(transformedObject, dataset.config.api).subscribe({
23641
+ next: (data) => {
23642
+ const payload = data['dataset'];
23643
+ this.uniqueDataSetObject[datasetId] = payload;
23644
+ resolve();
23645
+ },
23646
+ error: (err) => {
23647
+ console.error('Error:', err);
23648
+ this.toastr.error(err.message);
23649
+ reject(err);
23650
+ }
23651
+ });
23652
+ });
23653
+ }
23654
+ getFormatObjectForColumn(columns) {
23655
+ let columnData = [];
23656
+ columns.forEach(element => {
23657
+ const { advancedColumn, columnName, enrichFunction, dataField } = element;
23658
+ columnData.push({
23659
+ "advancedColumn": advancedColumn,
23660
+ "columnName": columnName,
23661
+ "enrichFunction": enrichFunction,
23662
+ "aliasName": dataField
23663
+ });
23664
+ });
23665
+ return columnData;
23666
+ }
23667
+ transformDataForMFilter(filterdata, mapData) {
23668
+ let result = [];
23669
+ mapData.forEach(mapping => {
23670
+ let resultObj = {
23671
+ columnName: mapping.serverColumn,
23672
+ dataType: mapping.dataType,
23673
+ operator: mapping.operatorName,
23674
+ value: mapping.defaultValue
23675
+ };
23676
+ if (mapping.serverColumn.includes('date') && typeof resultObj.value === 'string') {
23677
+ if (mapping.formatter && mapping.formatter !== "") {
23678
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(mapping.formatter);
23679
+ }
23680
+ else {
23681
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(this.environment.dataFormat);
23682
+ }
23683
+ }
23684
+ const filter = filterdata.find(f => f.hasOwnProperty(mapping.localColumn));
23685
+ if (filter) {
23686
+ if (mapping.defaultValue === "") {
23687
+ const value = filter[mapping.localColumn];
23688
+ if (Array.isArray(value)) {
23689
+ resultObj.operator = "in";
23690
+ resultObj.value = value.join(",");
23691
+ }
23692
+ else {
23693
+ resultObj.value = value;
23694
+ }
23695
+ if (mapping.serverColumn.includes('date') && typeof resultObj.value === 'string') {
23696
+ if (mapping.formatter && mapping.formatter !== "") {
23697
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(mapping.formatter);
23698
+ }
23699
+ else {
23700
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(this.environment.dataFormat);
23701
+ }
23702
+ }
23703
+ }
23704
+ }
23705
+ else if (mapping.defaultValue === "") {
23706
+ return;
23707
+ }
23708
+ result.push(resultObj);
23709
+ });
23710
+ filterdata = filterdata.filter(obj => {
23711
+ const key = Object.keys(obj)[0];
23712
+ return key !== 'startDate' && key !== 'endDate';
23713
+ });
23714
+ filterdata.forEach(filter => {
23715
+ const filterKey = Object.keys(filter)[0];
23716
+ const existingMapping = mapData.find(mapping => mapping.localColumn === filterKey);
23717
+ if (!existingMapping) {
23718
+ let resultObj = {
23719
+ columnName: filterKey,
23720
+ dataType: "string",
23721
+ operator: "eq",
23722
+ value: filter[filterKey]
23723
+ };
23724
+ if (Array.isArray(filter[filterKey])) {
23725
+ resultObj.operator = "in";
23726
+ resultObj.value = filter[filterKey].join(",");
23727
+ }
23728
+ else {
23729
+ resultObj.value = filter[filterKey];
23730
+ }
23731
+ if (filterKey == 'operator_key') {
23732
+ resultObj.operator = "eq";
23733
+ }
23734
+ result.push(resultObj);
23735
+ }
23736
+ });
23737
+ result = result.filter(obj => obj.value !== null && obj.value !== "");
23738
+ return result;
23739
+ }
23740
+ getDatasetForSimpleApiImpala(dataset, datasetId, filters) {
23741
+ return new Promise((resolve, reject) => {
23742
+ dataset.config.queryConfig.mapedFilters.forEach(filter => {
23743
+ if (filters.operationFilter.hasOwnProperty(filter.localColumn)) {
23744
+ filter.defaultValue = filters.operationFilter[filter.localColumn];
23745
+ }
23746
+ });
23747
+ if (dataset.config.apiType === "post") {
23748
+ let serviceJson = {};
23749
+ dataset.config.queryConfig.mapedFilters.forEach((filter) => {
23750
+ let datecolumn = filter.serverColumn.toLowerCase();
23751
+ if (datecolumn.includes('date') && typeof filter.dataType === 'string') {
23752
+ serviceJson[filter.serverColumn] = moment$1(filter.defaultValue, "YYYY-MM-DD").format(this.environment.dataFormat);
23753
+ }
23754
+ else {
23755
+ serviceJson[filter.serverColumn] = filter.defaultValue;
23756
+ }
23757
+ });
23758
+ this.service.getSimpleApiPostRequest(dataset.config.api, serviceJson).subscribe({
23759
+ next: (data) => {
23760
+ const payload = data["Payload"] || data;
23761
+ this.uniqueDataSetObject[datasetId] = payload;
23762
+ resolve();
23763
+ },
23764
+ error: (err) => {
23765
+ console.error('Error:', err);
23766
+ this.toastr.error(err.message);
23767
+ reject(err);
23768
+ }
23769
+ });
23770
+ }
23771
+ else if (dataset.config.apiType === "get") {
23772
+ let requestUrl = dataset.config.api + "?";
23773
+ dataset.config.queryConfig.mapedFilters.forEach((filter, index) => {
23774
+ requestUrl += `${filter.serverColumn}=${filter.defaultValue}`;
23775
+ if (index < dataset.config.queryConfig.mapedFilters.length - 1) {
23776
+ requestUrl += "&";
23777
+ }
23778
+ });
23779
+ this.service.getSimpleApiGetRequest(requestUrl).subscribe({
23780
+ next: (data) => {
23781
+ const payload = data["Payload"] || data;
23782
+ this.uniqueDataSetObject[datasetId] = payload;
23783
+ resolve();
23784
+ },
23785
+ error: (err) => {
23786
+ console.error('Error:', err);
23787
+ this.toastr.error(err.message);
23788
+ reject(err);
23789
+ }
23790
+ });
23791
+ }
23792
+ });
23793
+ }
23794
+ getDatasetForPlainJson(dataset, datasetId, filter) {
23795
+ return new Promise((resolve, reject) => {
23796
+ let requestapi = dataset.config.api + '?datasetId=' + dataset.datasetId;
23797
+ this.service.getJsonDatasetPayload(requestapi).subscribe({
23798
+ next: (data) => {
23799
+ const payload = data["Payload"] || data;
23800
+ this.uniqueDataSetObject[datasetId] = payload;
23801
+ resolve();
23802
+ },
23803
+ error: (err) => {
23804
+ console.error('Error:', err);
23805
+ reject(err);
23806
+ }
23807
+ });
23808
+ });
23809
+ }
23810
+ getDatasetForSqlTemplate(dataset, datasetId, filters) {
23811
+ return new Promise((resolve, reject) => {
23812
+ const operator = (filters && filters.length !== 0) ? Object.keys(filters.operationFilter).map(key => ({ [key]: filters.operationFilter[key] })) : [];
23813
+ let requestAp = dataset.config.api;
23814
+ let request_params = {
23815
+ 'dbConfig': dataset.config.queryConfig.dbConfig,
23816
+ 'databaseName': dataset.config.queryConfig.databaseName,
23817
+ 'filters': this.transformDataForMFilterForSQl(operator, dataset.config.queryConfig.mapedFilters),
23818
+ 'templateQuery': dataset.config.queryConfig.templateQuery,
23819
+ 'enrichments': dataset.config.queryConfig.enrichments,
23820
+ };
23821
+ this.service.genericSqlQueryResponse(requestAp, request_params).subscribe({
23822
+ next: (data) => {
23823
+ const payload = data["Payload"] || data;
23824
+ this.uniqueDataSetObject[datasetId] = payload;
23825
+ resolve();
23826
+ },
23827
+ error: (err) => {
23828
+ console.error('Error:', err);
23829
+ this.toastr.error(err.message);
23830
+ reject(err);
23831
+ }
23832
+ });
23833
+ });
23834
+ }
23835
+ transformDataForMFilterForSQl(filterdata, mapData) {
23836
+ let result = [];
23837
+ mapData.forEach(mapping => {
23838
+ let resultObj = {
23839
+ columnName: mapping.serverColumn,
23840
+ dataType: mapping.dataType,
23841
+ operator: mapping.operatorName,
23842
+ value: mapping.defaultValue,
23843
+ aliasColumnName: mapping.localColumn,
23844
+ };
23845
+ if (mapping.serverColumn.includes('date') && typeof resultObj.value === 'string') {
23846
+ if (mapping.formatter && mapping.formatter !== "") {
23847
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(mapping.formatter);
23848
+ }
23849
+ else {
23850
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(this.environment.dataFormat);
23851
+ }
23852
+ }
23853
+ const filter = filterdata.find(f => f.hasOwnProperty(mapping.localColumn));
23854
+ if (filter) {
23855
+ if (mapping.defaultValue === "") {
23856
+ const value = filter[mapping.localColumn];
23857
+ if (Array.isArray(value)) {
23858
+ resultObj.operator = "in";
23859
+ resultObj.value = value.join(",");
23860
+ }
23861
+ else {
23862
+ resultObj.value = value;
23863
+ }
23864
+ if (mapping.serverColumn.includes('date') && typeof resultObj.value === 'string') {
23865
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(this.environment.dataFormat);
23866
+ }
23867
+ }
23868
+ }
23869
+ else if (mapping.defaultValue === "") {
23870
+ return;
23871
+ }
23872
+ result.push(resultObj);
23873
+ });
23874
+ filterdata = filterdata.filter(obj => {
23875
+ const key = Object.keys(obj)[0];
23876
+ return key !== 'startDate' && key !== 'endDate';
23877
+ });
23878
+ filterdata.forEach(filter => {
23879
+ const filterKey = Object.keys(filter)[0];
23880
+ const existingMapping = mapData.find(mapping => mapping.localColumn === filterKey);
23881
+ if (!existingMapping) {
23882
+ let resultObj = {
23883
+ columnName: filterKey,
23884
+ dataType: "string",
23885
+ operator: "eq",
23886
+ value: filter[filterKey]
23887
+ };
23888
+ if (Array.isArray(filter[filterKey])) {
23889
+ resultObj.operator = "in";
23890
+ resultObj.value = filter[filterKey].join(",");
23891
+ }
23892
+ else {
23893
+ resultObj.value = filter[filterKey];
23894
+ }
23895
+ if (filterKey == 'operator_key') {
23896
+ resultObj.operator = "eq";
23897
+ }
23898
+ result.push(resultObj);
23899
+ }
23900
+ });
23901
+ return result;
23902
+ }
23903
+ getUniqueDataSetObject() {
23904
+ return this.uniqueDataSetObject;
23905
+ }
23906
+ }
23907
+ LandingMultiLayoutApplicationDatssetsCall.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LandingMultiLayoutApplicationDatssetsCall, deps: [{ token: LandingMultiLayoutComponentService }, { token: kpicommonService$2 }, { token: i3$1.ToastrService }, { token: APP_ENVIRONMENT }], target: i0.ɵɵFactoryTarget.Injectable });
23908
+ LandingMultiLayoutApplicationDatssetsCall.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LandingMultiLayoutApplicationDatssetsCall, providedIn: "root" });
23909
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LandingMultiLayoutApplicationDatssetsCall, decorators: [{
23910
+ type: Injectable,
23911
+ args: [{ providedIn: "root" }]
23912
+ }], ctorParameters: function () {
23913
+ return [{ type: LandingMultiLayoutComponentService }, { type: kpicommonService$2 }, { type: i3$1.ToastrService }, { type: undefined, decorators: [{
23914
+ type: Inject,
23915
+ args: [APP_ENVIRONMENT]
23916
+ }] }];
23917
+ } });
23918
+
23919
+ const TOKEN_KEY = 'x-auth-token';
23920
+ class AppLandingMultiLayoutLocalStorage {
23921
+ constructor(environment) {
23922
+ this.environment = environment;
23923
+ }
23924
+ save(type, token) {
23925
+ window.localStorage[this.getAppVariableName(type)] = token;
23926
+ }
23927
+ get(type) {
23928
+ return window.localStorage[this.getAppVariableName(type)];
23929
+ }
23930
+ delete(type) {
23931
+ return window.localStorage.removeItem[this.getAppVariableName(type)];
23932
+ }
23933
+ destroy() {
23934
+ window.localStorage.removeItem(TOKEN_KEY);
23935
+ }
23936
+ getAppVariableName(attributeName) {
23937
+ return this.environment.appName + '__' + attributeName;
23938
+ }
23939
+ }
23940
+ AppLandingMultiLayoutLocalStorage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppLandingMultiLayoutLocalStorage, deps: [{ token: APP_ENVIRONMENT }], target: i0.ɵɵFactoryTarget.Injectable });
23941
+ AppLandingMultiLayoutLocalStorage.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppLandingMultiLayoutLocalStorage, providedIn: 'root' });
23942
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppLandingMultiLayoutLocalStorage, decorators: [{
23943
+ type: Injectable,
23944
+ args: [{
23945
+ providedIn: 'root',
23946
+ }]
23947
+ }], ctorParameters: function () {
23948
+ return [{ type: undefined, decorators: [{
23949
+ type: Inject,
23950
+ args: [APP_ENVIRONMENT]
23951
+ }] }];
23952
+ } });
23953
+
23954
+ class MultiLayoutLandingComponentComponent {
23955
+ constructor(commonService, activatedRoute, viewContainerRef, componentFactoryResolver, service, toastr, router, datasetService, storage, cdr) {
23956
+ this.commonService = commonService;
23957
+ this.activatedRoute = activatedRoute;
23958
+ this.viewContainerRef = viewContainerRef;
23959
+ this.componentFactoryResolver = componentFactoryResolver;
23960
+ this.service = service;
23961
+ this.toastr = toastr;
23962
+ this.router = router;
23963
+ this.datasetService = datasetService;
23964
+ this.storage = storage;
23965
+ this.cdr = cdr;
23966
+ this.dashbord_container = [];
23967
+ this.widget_width = ['w-full', 'w-1/2', 'w-1/3', 'w-1/4', 'w-1/5', 'w-1/6'];
23968
+ this.page_title = 'Dashboard';
23969
+ this.dynamicComponentRefs = [];
23970
+ this.componentClassMap = {
23971
+ GammaAdvanceChartComponent,
23972
+ GammaTodayPreviousComponent,
23973
+ AppAdvanceHeaderComponent,
23974
+ GammaTableWithPercentageComponent,
23975
+ GammSingleNumberCardComponent,
23976
+ GammaAdvanceOperatorTableComponent,
23977
+ AdvanceWidgetHeaderFilterComponent,
23978
+ GammaGeoChartComponent,
23979
+ GammaHeatChartComponent
23980
+ };
23981
+ this.dataSourceMataData = [];
23982
+ this.queryType = "mongo";
23983
+ this.dataSetModal = [];
23984
+ this.componentConfigDataSource = [];
23985
+ this.dataSourceModal = {};
23986
+ this.isDashBoardContent = false;
23987
+ this.selectedViewFormComponent = {};
23988
+ this.addedwidGetConfig = {
23989
+ "display": true,
23990
+ "widgetTitle": "",
23991
+ "width": "",
23992
+ "height": ""
23993
+ };
23994
+ this.dashBoardWidgetConfig = [];
23995
+ this.selectedIndexObjForChart = {};
23996
+ this.selectedContainerObjectForChart = {};
23997
+ this.uniqueDataSetObject = {};
23998
+ this.isDashBoardContentTypeView = true;
23999
+ this.allWidgetByDataset = [];
24000
+ this.stateDataSource = new Map();
24001
+ this.contextMenuDataSource = [];
24002
+ this.havingDataObject = {};
24003
+ this.globalDefaultFilter = {};
24004
+ this.defaultViewIds = [];
24005
+ this.defaultViewIdsOnPageRefresh = [];
24006
+ this.defaultMatchedFilters = { operationFilter: { startDate: "", endDate: "" } };
24007
+ this.isDefaultFilterParams = false;
24008
+ }
24009
+ ngOnInit() {
24010
+ this.loadingModal = true;
24011
+ this.pageId = this.activatedRoute.snapshot.queryParams['pageId'];
24012
+ this.getPadeDataSource(false);
24013
+ }
24014
+ getFiltersForTemplate(filter) {
24015
+ return __awaiter(this, void 0, void 0, function* () {
24016
+ this.filters = filter;
24017
+ filter.operationFilter['startDate'] = filter.startDate;
24018
+ filter.operationFilter['endDate'] = filter.endDate;
24019
+ this.loadingModal = true;
24020
+ if (filter.filterObjects && Object.entries(filter.filterObjects).length !== 0) {
24021
+ if (Array.isArray(this.dashBoardWidgetConfig.widgets)) {
24022
+ const index = this.dashBoardWidgetConfig.widgets.findIndex((widget) => widget.widgetId === filter.filterObjects.widgetId);
24023
+ if (index !== -1) {
24024
+ this.dashBoardWidgetConfig.widgets[index] = filter.filterObjects;
24025
+ }
24026
+ else {
24027
+ }
24028
+ }
24029
+ }
24030
+ else {
24031
+ yield this.getPadeDataSource(true);
24032
+ }
24033
+ this.uniqueDataSetObject = {};
24034
+ let apiCalls = [];
24035
+ this.allWidgetByDataset.forEach(view => {
24036
+ view.datasetIds.forEach(id => {
24037
+ if (view.widgetId == filter.filterObjects.widgetId) {
24038
+ let found = this.dataSetModal.find(d => d.datasetId === id);
24039
+ let widgetFilter = this.getWidgetFilterItems(filter.filterObjects.filters.filterItems);
24040
+ view.filters = widgetFilter;
24041
+ if (found) {
24042
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, id, widgetFilter));
24043
+ }
24044
+ }
24045
+ });
24046
+ });
24047
+ Promise.all(apiCalls).then(() => {
24048
+ this.globalDefaultFilter = filter;
24049
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24050
+ this.createDivElements(this.uniqueDataSetObject, true);
24051
+ this.cdr.detectChanges();
24052
+ this.loadingModal = false;
24053
+ });
24054
+ });
24055
+ }
24056
+ getWidgetFilterItems(widgetFilterData) {
24057
+ let apiJsonObject = {};
24058
+ apiJsonObject['operationFilter'] = {};
24059
+ widgetFilterData.forEach(element => {
24060
+ if (element.filterType == 'date' || element.filterType == 'datetime') {
24061
+ apiJsonObject['operationFilter'][element.apiName] = moment$1(element.filterDataSourceValue).format(element.momentFormat);
24062
+ }
24063
+ else {
24064
+ if ((typeof element.filterDataSourceValue === "string" && element.filterDataSourceValue !== "") ||
24065
+ (Array.isArray(element.filterDataSourceValue) && element.filterDataSourceValue.length > 0)) {
24066
+ if (element.operatorName !== "") {
24067
+ if (element.filterType == "content") {
24068
+ apiJsonObject['operationFilter'][element.operatorName] = element.filterDataSourceValue;
24069
+ }
24070
+ if (element.filterType == "single") {
24071
+ apiJsonObject['operationFilter'][element.operatorName] = element.filterDataSourceValue;
24072
+ }
24073
+ else {
24074
+ apiJsonObject['operationFilter'][element.operatorName] = Array.isArray(element.filterDataSourceValue) ? element.filterDataSourceValue : [element.filterDataSourceValue];
24075
+ }
24076
+ }
24077
+ else {
24078
+ apiJsonObject[element.apiName] = element.filterDataSourceValue;
24079
+ }
24080
+ }
24081
+ }
24082
+ });
24083
+ return apiJsonObject;
24084
+ }
24085
+ getPadeDataSource(context) {
24086
+ return new Promise((resolve, reject) => {
24087
+ this.service.getAppPageDetailConfig(this.pageId).subscribe({
24088
+ next: (data) => {
24089
+ this.pageTitle = data.pageName;
24090
+ this.dashBoardWidgetConfig = data;
24091
+ if (!context) {
24092
+ if (Object.keys(this.uniqueDataSetObject).length != 0) {
24093
+ this.createDivElements(this.uniqueDataSetObject, false);
24094
+ }
24095
+ this.getComponentConfigSet();
24096
+ }
24097
+ resolve();
24098
+ },
24099
+ error: (err) => {
24100
+ this.toastr.error('Unexpected Server Exception. Please contact System Admin.', 'Error');
24101
+ reject(err);
24102
+ }
24103
+ });
24104
+ });
24105
+ }
24106
+ getPadeDataSourceByfilet(context, widgetObject) {
24107
+ return new Promise((resolve, reject) => {
24108
+ this.service.getAppPageDetailConfig(this.pageId).subscribe({
24109
+ next: (data) => {
24110
+ this.pageTitle = data.pageName;
24111
+ if (Array.isArray(data.widgets)) {
24112
+ const index = data.widgets.findIndex((widget) => widget.widgetId === widgetObject.widgetId);
24113
+ if (index !== -1) {
24114
+ data.widgets[index] = widgetObject;
24115
+ }
24116
+ else {
24117
+ }
24118
+ }
24119
+ this.dashBoardWidgetConfig = data;
24120
+ if (!context) {
24121
+ if (Object.keys(this.uniqueDataSetObject).length !== 0) {
24122
+ this.createDivElements(this.uniqueDataSetObject, false);
24123
+ }
24124
+ this.getComponentConfigSet();
24125
+ }
24126
+ resolve();
24127
+ },
24128
+ error: (err) => {
24129
+ this.toastr.error('Unexpected Server Exception. Please contact System Admin.', 'Error');
24130
+ reject(err);
24131
+ }
24132
+ });
24133
+ });
24134
+ }
24135
+ getComponentConfigSet() {
24136
+ let dataset = this.service.getAppDatasetConfigs();
24137
+ let viewComponent = this.service.getAppViewConfigs();
24138
+ this.defaultViewIds = [];
24139
+ forkJoin({
24140
+ datasetConfig: dataset,
24141
+ viewConfig: viewComponent
24142
+ }).subscribe({
24143
+ next: (({ datasetConfig, viewConfig }) => {
24144
+ this.componentConfigDataSource = viewConfig;
24145
+ this.dataSetModal = datasetConfig;
24146
+ this.allWidgetByDataset = [];
24147
+ const _a = this.activatedRoute.snapshot.queryParams, { pageId, startDate, endDate } = _a, params = __rest(_a, ["pageId", "startDate", "endDate"]);
24148
+ let defaultFilters = { operationFilter: Object.assign({ startDate: "", endDate: "" }, params) };
24149
+ this.dashBoardWidgetConfig.widgets.forEach(widget => {
24150
+ var _a;
24151
+ widget.filters.filterItems.forEach(element => {
24152
+ if (element.filterType === 'date' || element.filterType === 'datetime') {
24153
+ if (element.defaultFilterType === "dynamic" && element.momentFunction !== "" && element.defaultFilterValue !== "" && element.momentFormat !== "") {
24154
+ if (element.momentFunction == "monthPicker") {
24155
+ let [count, unit] = element.defaultFilterValue.split(',');
24156
+ if (element.apiName === "endDate") {
24157
+ if (element.display) {
24158
+ defaultFilters.operationFilter.endDate = (endDate && endDate !== '') ? endDate : moment$1().subtract(parseInt(count), unit).endOf(unit).format(element.momentFormat);
24159
+ this.defaultEndDate = moment$1().subtract(parseInt(count), unit).endOf(unit).format(element.momentFormat);
24160
+ }
24161
+ }
24162
+ if (element.apiName === "startDate") {
24163
+ defaultFilters.operationFilter.startDate = (startDate && startDate !== '') ? startDate : moment$1().subtract(parseInt(count), unit).startOf(unit).format(element.momentFormat);
24164
+ ;
24165
+ }
24166
+ }
24167
+ else if (element.momentFunction == "weekPicker") {
24168
+ if (element.apiName === "endDate") {
24169
+ if (element.display) {
24170
+ defaultFilters.operationFilter.endDate = (endDate && endDate !== '') ? endDate : moment$1().endOf('week').format(element.momentFormat);
24171
+ this.defaultEndDate = moment$1().endOf('week').format(element.momentFormat);
24172
+ }
24173
+ }
24174
+ if (element.apiName === "startDate") {
24175
+ defaultFilters.operationFilter.startDate = (startDate && startDate !== '') ? startDate : moment$1().startOf('week').format(element.momentFormat);
24176
+ this.defaultStartDate = moment$1().startOf('week').format(element.momentFormat);
24177
+ }
24178
+ }
24179
+ else {
24180
+ let [count, unit] = element.defaultFilterValue.split(',');
24181
+ if (element.apiName === "endDate") {
24182
+ if (element.display) {
24183
+ defaultFilters.operationFilter.endDate = (endDate && endDate !== '') ? endDate : moment$1()[element.momentFunction](parseInt(count), unit).format(element.momentFormat);
24184
+ this.defaultEndDate = moment$1()[element.momentFunction](parseInt(count), unit).format(element.momentFormat);
24185
+ }
24186
+ }
24187
+ if (element.apiName === "startDate") {
24188
+ defaultFilters.operationFilter.startDate = (startDate && startDate !== '') ? startDate : moment$1()[element.momentFunction](parseInt(count), unit).format(element.momentFormat);
24189
+ this.defaultStartDate = moment$1()[element.momentFunction](parseInt(count), unit).format(element.momentFormat);
24190
+ }
24191
+ }
24192
+ }
24193
+ else if (element.defaultFilterType === "static" && element.defaultFilterValue !== "") {
24194
+ if (element.apiName === "endDate") {
24195
+ if (element.display) {
24196
+ defaultFilters.operationFilter.endDate = element.defaultFilterValue;
24197
+ this.defaultEndDate = element.defaultFilterValue;
24198
+ }
24199
+ }
24200
+ if (element.apiName === "startDate") {
24201
+ defaultFilters.operationFilter.startDate = element.defaultFilterValue;
24202
+ this.defaultStartDate = element.defaultFilterValue;
24203
+ }
24204
+ }
24205
+ }
24206
+ else {
24207
+ if ((typeof element.filterDataSourceValue === "string" && element.filterDataSourceValue !== "") ||
24208
+ (Array.isArray(element.filterDataSourceValue) && element.filterDataSourceValue.length > 0)) {
24209
+ if (element.operatorName !== "") {
24210
+ defaultFilters.operationFilter[element.operatorName] = Array.isArray(element.filterDataSourceValue)
24211
+ ? element.filterDataSourceValue
24212
+ : [element.filterDataSourceValue];
24213
+ }
24214
+ else {
24215
+ defaultFilters.operationFilter[element.apiName] = element.filterDataSourceValue.join(",");
24216
+ }
24217
+ }
24218
+ }
24219
+ });
24220
+ let datasetIds = new Set();
24221
+ let viewIds = new Set();
24222
+ let datasetIdsSet = new Set();
24223
+ widget.widgetNode.forEach(node => {
24224
+ if (node.nodeProperties.display) {
24225
+ node.compConfig.viewConfig.forEach(view => {
24226
+ var _a;
24227
+ this.defaultViewIds.push(view.viewId);
24228
+ const foundObject = (_a = this.defaultViewIdsOnPageRefresh) === null || _a === void 0 ? void 0 : _a.find(item => item.viewId === view.viewId);
24229
+ const derivedFilters = foundObject ? this.getDrildownFilter(foundObject, defaultFilters) : defaultFilters;
24230
+ let obj = {
24231
+ "filters": JSON.parse(JSON.stringify(derivedFilters)),
24232
+ "keyToPass": [],
24233
+ "drillDownType": "natural",
24234
+ "drilldownFrom": ""
24235
+ };
24236
+ this.stateDataSource.set(view.viewId, obj);
24237
+ let node = {
24238
+ datasetId: view.datasetId,
24239
+ viewId: view.viewId,
24240
+ filter: derivedFilters
24241
+ };
24242
+ datasetIdsSet.add(view.datasetId);
24243
+ datasetIds.add(node);
24244
+ viewIds.add(view.viewId);
24245
+ });
24246
+ }
24247
+ else {
24248
+ node.compConfig.viewConfig.forEach(view => {
24249
+ this.contextMenuDataSource.push({ viewId: view.viewId, viewName: node.nodeProperties.widgetTitle, displayKey: view.kpiConfig.keyToPass });
24250
+ });
24251
+ }
24252
+ });
24253
+ if ((_a = this.defaultViewIdsOnPageRefresh) === null || _a === void 0 ? void 0 : _a.length) {
24254
+ const newViews = this.defaultViewIdsOnPageRefresh.map(item => item.viewId);
24255
+ this.defaultViewIds = [...this.defaultViewIds, ...newViews.filter(item => !this.defaultViewIds.includes(item))];
24256
+ }
24257
+ let uniquedatasetIds = Array.from(datasetIdsSet);
24258
+ let obj = {
24259
+ widgetId: widget.widgetId,
24260
+ pageId: widget.pageId,
24261
+ filters: defaultFilters,
24262
+ datasetIds: uniquedatasetIds
24263
+ };
24264
+ this.allWidgetByDataset.push(obj);
24265
+ });
24266
+ this.uniqueDataSetObject = {};
24267
+ let apiCalls = [];
24268
+ this.allWidgetByDataset.forEach(view => {
24269
+ view.datasetIds.forEach(id => {
24270
+ let found = datasetConfig.find(d => d.datasetId === id);
24271
+ if (found) {
24272
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, id, view.filters));
24273
+ }
24274
+ });
24275
+ });
24276
+ Promise.all(apiCalls).then(() => {
24277
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24278
+ this.createDivElements(this.uniqueDataSetObject, false);
24279
+ this.loadingModal = false;
24280
+ let urlParams = defaultFilters.operationFilter;
24281
+ urlParams['pageId'] = this.pageId;
24282
+ });
24283
+ }), error: (err) => {
24284
+ this.loadingModal = false;
24285
+ this.toastr.error('Unexpected Server Exception. Please contact System Admin.', 'Error');
24286
+ }
24287
+ });
24288
+ }
24289
+ getDataSet() {
24290
+ this.service.getAppDatasetConfigs().subscribe({
24291
+ next: (data) => {
24292
+ this.dataSettableDataSource = data;
24293
+ }, error: (err) => {
24294
+ this.toastr.error('Unexpected Server Exception. Please contact System Admin.', 'Dataset Creation');
24295
+ }
24296
+ });
24297
+ }
24298
+ createDivElements(datasetById, context) {
24299
+ return __awaiter(this, void 0, void 0, function* () {
24300
+ const container = this.dynamicContainer.nativeElement;
24301
+ container.innerHTML = "";
24302
+ const context_filter = this.dashBoardWidgetConfig.filters ? this.dashBoardWidgetConfig.filters.filterItems : null;
24303
+ this.dashBoardWidgetConfig.widgets.forEach((div) => __awaiter(this, void 0, void 0, function* () {
24304
+ const rowDiv = document.createElement('div');
24305
+ let w_height = (div.widgetProperties.height == "") ? "h-auto" : 'h-[' + div.widgetProperties.height + ']';
24306
+ rowDiv.classList.add(div.widgetProperties.width, w_height);
24307
+ const filterDiv = document.createElement('div');
24308
+ const filterItems = (div.filters) ? div.filters.filterItems : [];
24309
+ this.loadFilterComponent(div, filterDiv, filterItems, context_filter);
24310
+ rowDiv.appendChild(filterDiv);
24311
+ if (div.widgetNode.length != 0) {
24312
+ let mainItemDiv = rowDiv.querySelector('.flex.flex-wrap');
24313
+ if (context && mainItemDiv) {
24314
+ mainItemDiv.innerHTML = "";
24315
+ }
24316
+ else {
24317
+ mainItemDiv = document.createElement('div');
24318
+ mainItemDiv.classList.add("flex", "flex-wrap");
24319
+ rowDiv.appendChild(mainItemDiv);
24320
+ }
24321
+ this.loadWidgetNodes(div, mainItemDiv, datasetById);
24322
+ }
24323
+ container.appendChild(rowDiv);
24324
+ }));
24325
+ });
24326
+ }
24327
+ loadWidgetNodes(div, mainItemDiv, datasetById) {
24328
+ this.mainPageDivElement = mainItemDiv;
24329
+ div.widgetNode.forEach(item => {
24330
+ this.loadSingleWidgetNode(item, mainItemDiv, datasetById);
24331
+ });
24332
+ }
24333
+ loadSingleWidgetNode(item, containerElement, datasetById) {
24334
+ const elementId = `id-${item.id}`;
24335
+ const existingElement = document.querySelector(`#${elementId}`);
24336
+ if (item.nodeProperties.display && !existingElement) {
24337
+ const w_height = item.nodeProperties.height === "" ? "h-auto" : `h-[${item.nodeProperties.height}]`;
24338
+ const itemDiv = document.createElement('div');
24339
+ itemDiv.id = elementId;
24340
+ itemDiv.classList.add(item.nodeProperties.width, w_height, 'mb-2');
24341
+ if (item.nodeProperties.widgetTitle !== "") {
24342
+ const widgetDiv = this.getWidgetTitleDiv(item);
24343
+ itemDiv.appendChild(widgetDiv);
24344
+ }
24345
+ const innerDiv = document.createElement('div');
24346
+ innerDiv.classList.add('rounded', 'justify-center', 'items-center', 'border', 'p-1', 'm-1', 'flex', 'flex-row');
24347
+ item.compConfig.viewConfig.forEach(element => {
24348
+ element.kpiConfig['dataSource'] = datasetById[element.datasetId];
24349
+ element.kpiConfig['contextMenu'] = this.contextMenuDataSource;
24350
+ element['titleParams'] = item.nodeProperties.widgetParams || "";
24351
+ const comp_object = this.findWidgetById(this.dashBoardWidgetConfig.widgets, item.id);
24352
+ this.loadDynamicComponent(element, comp_object, itemDiv);
24353
+ });
24354
+ containerElement.appendChild(itemDiv);
24355
+ if (!this.isDashBoardContentTypeView) {
24356
+ itemDiv.appendChild(innerDiv);
24357
+ }
24358
+ }
24359
+ else if (existingElement) {
24360
+ const itemDiv = existingElement;
24361
+ itemDiv.innerHTML = '';
24362
+ if (item.nodeProperties.widgetTitle !== "") {
24363
+ const widgetDiv = this.getWidgetTitleDiv(item);
24364
+ itemDiv.appendChild(widgetDiv);
24365
+ }
24366
+ item.compConfig.viewConfig.forEach(element => {
24367
+ element.kpiConfig['dataSource'] = datasetById[element.datasetId];
24368
+ element.kpiConfig['contextMenu'] = this.contextMenuDataSource;
24369
+ element['titleParams'] = item.nodeProperties.widgetParams || "";
24370
+ const comp_object = this.findWidgetById(this.dashBoardWidgetConfig.widgets, item.id);
24371
+ this.loadDynamicComponent(element, comp_object, itemDiv);
24372
+ });
24373
+ if (!this.isDashBoardContentTypeView) {
24374
+ const innerDiv = document.createElement('div');
24375
+ innerDiv.classList.add('rounded', 'justify-center', 'items-center', 'border', 'p-1', 'm-1', 'flex', 'flex-row');
24376
+ itemDiv.appendChild(innerDiv);
24377
+ }
24378
+ }
24379
+ }
24380
+ getWidgetTitleDiv(item) {
24381
+ var _a;
24382
+ const widgetDiv = document.createElement('div');
24383
+ widgetDiv.classList.add('flex', 'items-center', 'justify-between', 'font-bold', 'text-md', 'text-gray-900', 'dark:text-white', 'border-b', 'p-3', 'dark:bg-gray-800', 'bg-gray-200', 'mx-2', 'rounded-t-lg', 'relative');
24384
+ const titleDiv = document.createElement('div');
24385
+ titleDiv.classList.add('relative', 'group');
24386
+ let params = "";
24387
+ if (!item.nodeProperties.widgetParams && ((_a = this.defaultViewIdsOnPageRefresh) === null || _a === void 0 ? void 0 : _a.length)) {
24388
+ params = this.getTitleParams(item) || "";
24389
+ }
24390
+ else {
24391
+ params = item.nodeProperties.widgetParams || "";
24392
+ }
24393
+ const widgetTitle = item.nodeProperties.widgetTitle;
24394
+ const tooltipMatch = widgetTitle.match(/\$t\{([\s\S]*?)\}/);
24395
+ const displayTitle = widgetTitle.replace(/\$t\{[\s\S]*?\}/g, '').trim();
24396
+ titleDiv.innerText = displayTitle + params;
24397
+ if (tooltipMatch) {
24398
+ const tooltipContent = tooltipMatch[1].trim();
24399
+ const tooltipDiv = document.createElement('div');
24400
+ tooltipDiv.classList.add('absolute', 'left-0', 'bottom-full', 'mb-2', 'w-max', 'max-w-xs', 'bg-black', 'text-white', 'text-sm', 'p-2', 'rounded-lg', 'shadow-lg', 'opacity-0', 'group-hover:opacity-100', 'transition-opacity', 'duration-300', 'z-50');
24401
+ tooltipDiv.innerHTML = tooltipContent;
24402
+ titleDiv.appendChild(tooltipDiv);
24403
+ }
24404
+ widgetDiv.appendChild(titleDiv);
24405
+ const searchContainerDiv = document.createElement('div');
24406
+ searchContainerDiv.classList.add('flex', 'items-center', 'ml-auto', 'space-x-2', 'justify-end');
24407
+ if (item.nodeProperties.isWidgetFilter) {
24408
+ const searchButton = document.createElement('button');
24409
+ searchButton.innerText = 'Filter';
24410
+ searchButton.classList.add('px-3', 'py-1.5', 'bg-blue-600', 'mr-2', 'text-white', 'rounded', 'hover:bg-blue-700');
24411
+ this.nodeproperticeFilterDataSource = {};
24412
+ this.nodeproperticeFilterDataSource['viewConfig'] = item;
24413
+ this.nodeproperticeFilterDataSource['havingConfig'] = [];
24414
+ searchButton.addEventListener('click', () => {
24415
+ this.isWidgetFilters = true;
24416
+ let filtePropertice = [];
24417
+ item.compConfig.viewConfig.forEach(element => {
24418
+ let key_name = this.uniqueDataSetObject[element.datasetId][0];
24419
+ Object.keys(key_name).forEach(key => {
24420
+ if (!filtePropertice.includes(key)) {
24421
+ filtePropertice.push(key);
24422
+ }
24423
+ });
24424
+ });
24425
+ filtePropertice.forEach(element => {
24426
+ let obj = {
24427
+ columnName: element,
24428
+ dataType: "float",
24429
+ operator: "",
24430
+ value: "",
24431
+ };
24432
+ this.nodeproperticeFilterDataSource.havingConfig.push(obj);
24433
+ });
24434
+ });
24435
+ searchContainerDiv.appendChild(searchButton);
24436
+ }
24437
+ if (item.filterId) {
24438
+ this.nodeproperticeFilterDataSource = {};
24439
+ this.nodeproperticeFilterDataSource['viewConfig'] = item;
24440
+ this.nodeproperticeFilterDataSource['havingConfig'] = [];
24441
+ this.service.getAppFilterConfig(item.filterId).subscribe({
24442
+ next: (data) => {
24443
+ const filterDiv = document.createElement('div');
24444
+ this.loadWidgetFilterComponent(item, widgetDiv, data.filterItems, item);
24445
+ }, error: (err) => {
24446
+ }
24447
+ });
24448
+ }
24449
+ if (item.nodeProperties.nodefilters && item.nodeProperties.nodefilters.length !== 0) {
24450
+ item.nodeProperties.nodefilters.forEach(filter => {
24451
+ const filterDiv = document.createElement('div');
24452
+ filterDiv.classList.add('flex', 'items-center');
24453
+ if (filter.input_type === 'text') {
24454
+ const textBox = document.createElement('input');
24455
+ textBox.type = 'text';
24456
+ textBox.placeholder = `Enter ${filter.local_column}`;
24457
+ textBox.classList.add('px-2', 'py-1.5', 'rounded', 'border', 'mr-1', 'border-gray-500', 'text-gray-900', 'bg-gray-200', 'dark:bg-gray-700', 'dark:text-white');
24458
+ const searchButton = document.createElement('button');
24459
+ searchButton.innerText = 'Search';
24460
+ searchButton.classList.add('px-3', 'py-1.5', 'bg-blue-600', 'mr-2', 'text-white', 'rounded', 'hover:bg-blue-700');
24461
+ const separerotButton = document.createElement('div');
24462
+ separerotButton.innerHTML = '|';
24463
+ searchButton.addEventListener('click', () => {
24464
+ const searchTerm = textBox.value;
24465
+ this.getRearchResultFromInputBox(searchTerm, item, filter);
24466
+ });
24467
+ filterDiv.appendChild(textBox);
24468
+ filterDiv.appendChild(searchButton);
24469
+ filterDiv.appendChild(separerotButton);
24470
+ }
24471
+ searchContainerDiv.appendChild(filterDiv);
24472
+ });
24473
+ }
24474
+ widgetDiv.appendChild(searchContainerDiv);
24475
+ return widgetDiv;
24476
+ }
24477
+ loadDynamicComponent(data, indexObj, containerElement) {
24478
+ const componentClass = this.componentClassMap[data.kpiConfig.componentName];
24479
+ this.CompRefs = this.viewContainerRef.createComponent(componentClass);
24480
+ const dynamicComponentInstance = this.CompRefs.instance;
24481
+ dynamicComponentInstance.chartDataSource = data;
24482
+ dynamicComponentInstance.kpi_name = "";
24483
+ if (data.kpiConfig.componentName == "GammaAdvanceOperatorTableComponent" || data.kpiConfig.componentName == "GammaTableWithPercentageComponent") {
24484
+ dynamicComponentInstance.oRowClick.subscribe((value) => {
24485
+ this.getRowClick(value);
24486
+ });
24487
+ dynamicComponentInstance.onrightClickContextSelection.subscribe((value) => {
24488
+ this.getContextClick(value);
24489
+ });
24490
+ }
24491
+ else if (data.kpiConfig.componentName == "GammaAdvanceChartComponent") {
24492
+ dynamicComponentInstance.onChartPointClick.subscribe((value) => {
24493
+ this.getRowClick(value);
24494
+ });
24495
+ }
24496
+ const cssClass = "w-full";
24497
+ this.CompRefs.location.nativeElement.classList.add(cssClass);
24498
+ containerElement.appendChild(this.CompRefs.location.nativeElement);
24499
+ }
24500
+ loadFilterComponent(indexObj, containerElement, filterItems, context_filter) {
24501
+ let userName = this.storage.get('user_name');
24502
+ console.log(this.allWidgetByDataset, "allWidgetByDataset");
24503
+ let selectedDates = {};
24504
+ this.allWidgetByDataset.forEach(view => {
24505
+ if (view.widgetId == indexObj.widgetId) {
24506
+ selectedDates = { startDate: view.filters.operationFilter['startDate'], endDate: view.filters.operationFilter['endDate'] };
24507
+ }
24508
+ });
24509
+ debugger;
24510
+ const componentClass = this.componentClassMap['AppAdvanceHeaderComponent'];
24511
+ this.CompRefs = this.viewContainerRef.createComponent(componentClass);
24512
+ const dynamicComponentInstance = this.CompRefs.instance;
24513
+ dynamicComponentInstance.selectedDates = selectedDates;
24514
+ dynamicComponentInstance.filterItems = filterItems;
24515
+ dynamicComponentInstance.filterObjects = indexObj;
24516
+ dynamicComponentInstance.contextFilterItems = context_filter;
24517
+ dynamicComponentInstance.pageTitle = indexObj.widgetName;
24518
+ dynamicComponentInstance.bread_crumbs_container = this.kpi_breadcrumbs_container;
24519
+ dynamicComponentInstance.isEditButton = (userName && userName == "admin") ? true : false;
24520
+ dynamicComponentInstance.isAdvanceButton = true;
24521
+ dynamicComponentInstance.getFilterPageConfig.subscribe((value) => {
24522
+ this.getFiltersForTemplate(value);
24523
+ });
24524
+ dynamicComponentInstance.getOperatorName.subscribe((value) => {
24525
+ this.loadDataByOperator(value);
24526
+ });
24527
+ dynamicComponentInstance.getContextFilterData.subscribe((value) => {
24528
+ this.getContextFilterData(value);
24529
+ });
24530
+ indexObj.compConfig.dynamicComponentRefs.push(this.CompRefs);
24531
+ const cssClass = "w-full";
24532
+ this.CompRefs.location.nativeElement.classList.add(cssClass);
24533
+ containerElement.appendChild(this.CompRefs.location.nativeElement);
24534
+ }
24535
+ loadWidgetFilterComponent(indexObj, containerElement, filterItems, viewIds) {
24536
+ let selectedDates = { startDate: this.defaultStartDate, endDate: this.defaultEndDate };
24537
+ const componentClass = this.componentClassMap['AdvanceWidgetHeaderFilterComponent'];
24538
+ this.CompRefs = this.viewContainerRef.createComponent(componentClass);
24539
+ const dynamicComponentInstance = this.CompRefs.instance;
24540
+ dynamicComponentInstance.selectedDates = selectedDates;
24541
+ dynamicComponentInstance.filterItems = filterItems;
24542
+ dynamicComponentInstance.viewIds = viewIds;
24543
+ dynamicComponentInstance.getWidgetFilterConfig.subscribe((value) => {
24544
+ this.getWidgetFilterForTemplate(value);
24545
+ });
24546
+ indexObj.compConfig.dynamicComponentRefs.push(this.CompRefs);
24547
+ containerElement.appendChild(this.CompRefs.location.nativeElement);
24548
+ }
24549
+ getContextClick(event) {
24550
+ const stateData = Array.from(this.stateDataSource.keys());
24551
+ const currentViewIndex = stateData.indexOf(event.viewId);
24552
+ const deletedViewIds = [];
24553
+ for (let i = currentViewIndex + 1; i < stateData.length; i++) {
24554
+ deletedViewIds.push(stateData[i]);
24555
+ }
24556
+ this.loadingModal = true;
24557
+ this.dashBoardWidgetConfig.widgets.forEach(element => {
24558
+ element.widgetNode.forEach((node, nodeIndex) => {
24559
+ if (this.getElementOfCurrentView(node, event.drilldownTo)) {
24560
+ let view = element.widgetNode[nodeIndex];
24561
+ let apiCalls = [];
24562
+ let chatApiCall = [];
24563
+ let appliedFilters = this.getSetOperatorFilter(event, this.stateDataSource.get(event.drilldownFrom));
24564
+ view.compConfig.viewConfig.forEach(contentView => {
24565
+ let found = this.dataSetModal.find(d => d.datasetId === contentView.datasetId);
24566
+ if (found) {
24567
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, contentView.datasetId, appliedFilters));
24568
+ }
24569
+ });
24570
+ Promise.all(apiCalls).then(() => {
24571
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24572
+ for (let entry of deletedViewIds) {
24573
+ element.widgetNode.forEach(viewValue => {
24574
+ viewValue.compConfig.viewConfig.forEach(viewId => {
24575
+ if (viewId.viewId == entry) {
24576
+ const exists = this.contextMenuDataSource.some(item => item.viewId === viewId.viewId);
24577
+ if (!exists) {
24578
+ this.contextMenuDataSource.push({
24579
+ viewId: viewId.viewId,
24580
+ viewName: node.nodeProperties.widgetTitle,
24581
+ displayKey: viewId.kpiConfig.keyToPass
24582
+ });
24583
+ }
24584
+ const startData = this.stateDataSource.get(entry);
24585
+ if (startData) {
24586
+ this.stateDataSource.delete(entry);
24587
+ }
24588
+ viewValue.nodeProperties['display'] = false;
24589
+ const prefixedId = `id-${viewValue.id}`;
24590
+ const elementToHide = document.querySelector(`#${prefixedId}`);
24591
+ if (elementToHide) {
24592
+ elementToHide.remove();
24593
+ }
24594
+ }
24595
+ });
24596
+ });
24597
+ }
24598
+ this.contextMenuDataSource = this.contextMenuDataSource.filter(e => e.displayKey !== event.keyToPass);
24599
+ view.compConfig.viewConfig.forEach(val => {
24600
+ let obj = {
24601
+ "filters": appliedFilters,
24602
+ "keyToPass": this.updateOperatorData(event.keyToPass, event.data),
24603
+ "drillDownType": event.drillDownType,
24604
+ "drilldownFrom": event.drilldownFrom
24605
+ };
24606
+ this.stateDataSource.set(val['viewId'], obj);
24607
+ });
24608
+ view.nodeProperties['display'] = true;
24609
+ view.nodeProperties['widgetParams'] = event.tableTitle;
24610
+ const prefixedId = `id-${view.id}`;
24611
+ const containerElement = document.querySelector(`#${prefixedId}`);
24612
+ this.loadSingleWidgetNode(view, this.mainPageDivElement, this.uniqueDataSetObject);
24613
+ setTimeout(() => {
24614
+ this.scrollToBottom(this.mainPageDivElement);
24615
+ }, 200);
24616
+ });
24617
+ }
24618
+ else {
24619
+ }
24620
+ });
24621
+ });
24622
+ }
24623
+ getRowClick(event) {
24624
+ return __awaiter(this, void 0, void 0, function* () {
24625
+ const stateData = Array.from(this.stateDataSource.keys());
24626
+ const currentViewIndex = stateData.indexOf(event.viewId);
24627
+ const deletedViewIds = [];
24628
+ for (let i = currentViewIndex + 1; i < stateData.length; i++) {
24629
+ deletedViewIds.push(stateData[i]);
24630
+ }
24631
+ const hourlyNode = this.dashBoardWidgetConfig.widgets
24632
+ .map(widget => widget.widgetNode.find(node => this.getHourlyData(node)))
24633
+ .find(node => node);
24634
+ if (hourlyNode && event.keyToPass.includes("recordDate")) {
24635
+ this.getViewByRowCLickForHourlyChart(event, hourlyNode);
24636
+ }
24637
+ const currentViewNode = this.dashBoardWidgetConfig.widgets
24638
+ .map(widget => widget.widgetNode.find(node => this.getElementOfCurrentView(node, event.viewId)))
24639
+ .find(node => node);
24640
+ const queryParams = this.activatedRoute.snapshot.queryParamMap;
24641
+ if (currentViewNode) {
24642
+ const drildownsForCurrentView = [];
24643
+ const drildownsForCurrentPage = [];
24644
+ currentViewNode.compConfig.viewConfig.forEach((element) => __awaiter(this, void 0, void 0, function* () {
24645
+ var _a;
24646
+ if (element.kpiConfig.viewProperties.enableClickEvent) {
24647
+ if (((_a = element.kpiConfig.viewProperties.clickEventOptions) === null || _a === void 0 ? void 0 : _a.eventType) !== undefined &&
24648
+ element.kpiConfig.viewProperties.clickEventOptions.eventType !== "") {
24649
+ let eventType = element.kpiConfig.viewProperties.clickEventOptions.eventType;
24650
+ let associatedViews = element.kpiConfig.viewProperties.clickEventOptions.associatedViews;
24651
+ let associatedPage = (element.kpiConfig.viewProperties.clickEventOptions.associatedPage) ? element.kpiConfig.viewProperties.clickEventOptions.associatedPage : "";
24652
+ let clickEventOptions = element.kpiConfig.viewProperties.clickEventOptions;
24653
+ if (eventType == 'optionalDrillDown') {
24654
+ if (associatedViews && associatedViews.length != 0) {
24655
+ for (let viewForDrillDown of associatedViews) {
24656
+ const filterCondition = new URLSearchParams(viewForDrillDown['filterCondition']);
24657
+ let matchFound = true;
24658
+ filterCondition.forEach((value, key) => {
24659
+ if (queryParams.get(key) !== value) {
24660
+ matchFound = false;
24661
+ }
24662
+ });
24663
+ if (matchFound) {
24664
+ viewForDrillDown['viewId'].forEach(viewForId => {
24665
+ drildownsForCurrentView.push(viewForId);
24666
+ });
24667
+ }
24668
+ }
24669
+ }
24670
+ }
24671
+ else if (eventType == 'drilldown' || eventType == 'popup') {
24672
+ for (let entry of associatedViews) {
24673
+ drildownsForCurrentView.push(entry);
24674
+ }
24675
+ }
24676
+ else if (eventType == 'navigateToPage') {
24677
+ this.service.getAppPageDetailConfig(associatedPage).subscribe({
24678
+ next: (data) => {
24679
+ let _a = this.activatedRoute.snapshot.queryParams, { pageId } = _a, params = __rest(_a, ["pageId"]);
24680
+ let associatedParamsTemplate = clickEventOptions.associatedParams;
24681
+ let appliedFilters = this.getSetOperatorFilter(event, this.stateDataSource.get(event.viewId));
24682
+ event.keyToPass.forEach(element => {
24683
+ params[element] = event.data[element];
24684
+ });
24685
+ params['pageId'] = associatedPage;
24686
+ if (associatedParamsTemplate !== "") {
24687
+ let finalAssociatedParams = this.replaceAssociatedParams(associatedParamsTemplate, params, appliedFilters);
24688
+ const queryParams = {};
24689
+ finalAssociatedParams.split("&").forEach(pair => {
24690
+ const [key, value] = pair.split("=");
24691
+ queryParams[key] = value;
24692
+ });
24693
+ queryParams['pageId'] = params['pageId'];
24694
+ const fullUrl = this.router.serializeUrl(this.router.createUrlTree([data.pageUrl], { queryParams }));
24695
+ this.router.navigate([data.pageUrl], { queryParams });
24696
+ }
24697
+ else {
24698
+ const queryString = new URLSearchParams(params).toString();
24699
+ const fullUrl = this.router.serializeUrl(this.router.createUrlTree([data.pageUrl], { queryParams: params }));
24700
+ this.router.navigate([data.pageUrl], { queryParams });
24701
+ console.log(data);
24702
+ }
24703
+ }
24704
+ });
24705
+ }
24706
+ else if (eventType == 'sameViewDrilldown') {
24707
+ debugger;
24708
+ }
24709
+ if (drildownsForCurrentView.length != 0) {
24710
+ for (let viewIdForNext of drildownsForCurrentView) {
24711
+ const nextViewNode = this.dashBoardWidgetConfig.widgets
24712
+ .map(widget => widget.widgetNode.find(node => this.getElementOfCurrentView(node, viewIdForNext)))
24713
+ .find(node => node);
24714
+ if (eventType == 'popup') {
24715
+ this.loadingModal = true;
24716
+ yield this.getModalViewByRowCLick(event, nextViewNode);
24717
+ }
24718
+ else {
24719
+ this.loadingModal = true;
24720
+ yield this.getViewByRowCLick(event, nextViewNode);
24721
+ }
24722
+ }
24723
+ }
24724
+ }
24725
+ else {
24726
+ this.dashBoardWidgetConfig.widgets.forEach(element => {
24727
+ for (let entry of deletedViewIds) {
24728
+ element.widgetNode.forEach(viewValue => {
24729
+ viewValue.compConfig.viewConfig.forEach(viewId => {
24730
+ if (viewId.viewId == entry) {
24731
+ const exists = this.contextMenuDataSource.some(item => item.viewId === viewId.viewId);
24732
+ if (!exists) {
24733
+ this.contextMenuDataSource.push({
24734
+ viewId: viewId.viewId,
24735
+ viewName: currentViewNode.nodeProperties.widgetTitle,
24736
+ displayKey: viewId.kpiConfig.keyToPass
24737
+ });
24738
+ }
24739
+ const startData = this.stateDataSource.get(entry);
24740
+ if (startData) {
24741
+ this.stateDataSource.delete(entry);
24742
+ }
24743
+ viewValue.nodeProperties['display'] = false;
24744
+ const prefixedId = `id-${viewValue.id}`;
24745
+ const elementToHide = document.querySelector(`#${prefixedId}`);
24746
+ if (elementToHide) {
24747
+ elementToHide.remove();
24748
+ }
24749
+ }
24750
+ });
24751
+ });
24752
+ }
24753
+ });
24754
+ const nextViewIndex = stateData.indexOf(event.viewId) + 1;
24755
+ const nextView = this.dashBoardWidgetConfig.widgets
24756
+ .map(widget => widget.widgetNode[nextViewIndex])
24757
+ .find(node => node);
24758
+ if (nextView) {
24759
+ this.loadingModal = true;
24760
+ yield this.getViewByRowCLick(event, nextView);
24761
+ }
24762
+ }
24763
+ }
24764
+ }));
24765
+ }
24766
+ });
24767
+ }
24768
+ getViewByRowCLickForHourlyChart(event, node) {
24769
+ let apiCalls = [];
24770
+ const deletedViewIds = [];
24771
+ node.compConfig.viewConfig.forEach(item => {
24772
+ let appliedFilters = this.getSetOperatorFilter(event, this.stateDataSource.get(item.viewId));
24773
+ let found = this.dataSetModal.find(d => d.datasetId === item.datasetId);
24774
+ deletedViewIds.push(item.viewId);
24775
+ if (found) {
24776
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, item.datasetId, appliedFilters));
24777
+ }
24778
+ });
24779
+ Promise.all(apiCalls).then(() => {
24780
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24781
+ this.loadSingleWidgetNode(node, this.mainPageDivElement, this.uniqueDataSetObject);
24782
+ setTimeout(() => {
24783
+ this.scrollToBottom(this.mainPageDivElement);
24784
+ }, 200);
24785
+ });
24786
+ }
24787
+ getModalViewByRowCLick(event, view) {
24788
+ return __awaiter(this, void 0, void 0, function* () {
24789
+ let apiCalls = [];
24790
+ let appliedFilters = this.getSetOperatorFilter(event, this.stateDataSource.get(event.viewId));
24791
+ view.compConfig.viewConfig.forEach(contentView => {
24792
+ let found = this.dataSetModal.find(d => d.datasetId === contentView.datasetId);
24793
+ if (found) {
24794
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, contentView.datasetId, appliedFilters));
24795
+ }
24796
+ });
24797
+ yield Promise.all(apiCalls);
24798
+ this.contextMenuDataSource = this.contextMenuDataSource.filter(e => e.displayKey !== event.keyToPass);
24799
+ view.compConfig.viewConfig.forEach(viewforDataSet => {
24800
+ let obj = {
24801
+ "filters": appliedFilters,
24802
+ "keyToPass": this.updateOperatorData(event.keyToPass, event.data),
24803
+ "drillDownType": event.drillDownType,
24804
+ "drilldownFrom": event.drilldownFrom
24805
+ };
24806
+ this.stateDataSource.set(viewforDataSet['viewId'], obj);
24807
+ });
24808
+ view.nodeProperties['display'] = true;
24809
+ view.nodeProperties['widgetParams'] = event.tableTitle;
24810
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24811
+ this.modalConfigs = {
24812
+ view: view,
24813
+ datasource: this.uniqueDataSetObject
24814
+ };
24815
+ setTimeout(() => {
24816
+ this.loadingModal = false;
24817
+ this.isPopupView = true;
24818
+ }, 200);
24819
+ });
24820
+ }
24821
+ getViewByRowCLick(event, view) {
24822
+ return __awaiter(this, void 0, void 0, function* () {
24823
+ let apiCalls = [];
24824
+ let chatApiCall = [];
24825
+ let appliedFilters = this.getSetOperatorFilter(event, this.stateDataSource.get(event.viewId));
24826
+ view.compConfig.viewConfig.forEach(contentView => {
24827
+ let found = this.dataSetModal.find(d => d.datasetId === contentView.datasetId);
24828
+ if (found) {
24829
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, contentView.datasetId, appliedFilters));
24830
+ }
24831
+ });
24832
+ yield Promise.all(apiCalls);
24833
+ this.contextMenuDataSource = this.contextMenuDataSource.filter(e => e.displayKey !== event.keyToPass);
24834
+ view.compConfig.viewConfig.forEach(viewforDataSet => {
24835
+ let obj = {
24836
+ "filters": appliedFilters,
24837
+ "keyToPass": this.updateOperatorData(event.keyToPass, event.data),
24838
+ "drillDownType": event.drillDownType,
24839
+ "drilldownFrom": event.drilldownFrom
24840
+ };
24841
+ this.stateDataSource.set(viewforDataSet['viewId'], obj);
24842
+ });
24843
+ view.nodeProperties['display'] = true;
24844
+ view.nodeProperties['widgetParams'] = event.tableTitle;
24845
+ const prefixedId = `id-${view.id}`;
24846
+ const containerElement = document.querySelector(`#${prefixedId}`);
24847
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24848
+ this.loadSingleWidgetNode(view, this.mainPageDivElement, this.uniqueDataSetObject);
24849
+ console.log(this.stateDataSource);
24850
+ setTimeout(() => {
24851
+ this.scrollToBottom(this.mainPageDivElement);
24852
+ }, 200);
24853
+ });
24854
+ }
24855
+ replaceAssociatedParams(template, params, appliedFilters) {
24856
+ return template.replace(/\$(F|P)\{([^}]+)\}/g, (match, type, key) => {
24857
+ var _a, _b, _c;
24858
+ if (type === "F") {
24859
+ return (_b = (_a = appliedFilters.operationFilter) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : "";
24860
+ }
24861
+ else if (type === "P") {
24862
+ return (_c = params === null || params === void 0 ? void 0 : params[key]) !== null && _c !== void 0 ? _c : "";
24863
+ }
24864
+ return match;
24865
+ });
24866
+ }
24867
+ scrollToBottom(container) {
24868
+ setTimeout(() => {
24869
+ container.scrollIntoView({ block: 'end' });
24870
+ this.loadingModal = false;
24871
+ }, 0);
24872
+ }
24873
+ findWidgetById(configs, id) {
24874
+ for (const config of configs) {
24875
+ if (config.id === id) {
24876
+ return config;
24877
+ }
24878
+ if (config.widgetNode && config.widgetNode.length > 0) {
24879
+ const found = this.findWidgetById(config.widgetNode, id);
24880
+ if (found) {
24881
+ return found;
24882
+ }
24883
+ }
24884
+ }
24885
+ return undefined;
24886
+ }
24887
+ updateOperatorData(key_name, value_data) {
24888
+ let operator = [];
24889
+ for (const key of key_name) {
24890
+ let obj = {};
24891
+ obj[key] = value_data[key];
24892
+ operator.push(obj);
24893
+ }
24894
+ return operator;
24895
+ }
24896
+ getElementOfCurrentView(node, viewId) {
24897
+ const matchedObject = node.compConfig.viewConfig.find(object => object.viewId === viewId);
24898
+ return matchedObject ? node : null;
24899
+ }
24900
+ getHourlyData(node) {
24901
+ const matchedObject = node.compConfig.viewConfig.find(object => object.kpiConfig.formate === 'hourly');
24902
+ return matchedObject ? node : null;
24903
+ }
24904
+ getSetOperatorFilter(objectData, previousViewStates) {
24905
+ const { data, keyToPass } = objectData;
24906
+ const appliedFilter = JSON.parse(JSON.stringify(previousViewStates.filters.operationFilter));
24907
+ keyToPass.forEach(key => {
24908
+ if (key in data) {
24909
+ const normalizedKey = key.toLowerCase().replace(/_/g, '');
24910
+ if (normalizedKey === "recorddate" && "startDate" in appliedFilter && "endDate" in appliedFilter) {
24911
+ appliedFilter.startDate = data[key];
24912
+ appliedFilter.endDate = data[key];
24913
+ }
24914
+ else {
24915
+ appliedFilter[key] = data[key];
24916
+ }
24917
+ }
24918
+ });
24919
+ const defaultoperationFilter = this.globalDefaultFilter.operationFilter;
24920
+ if (defaultoperationFilter) {
24921
+ Object.keys(defaultoperationFilter).forEach(key => {
24922
+ if (!appliedFilter.hasOwnProperty(key)) {
24923
+ appliedFilter[key] = defaultoperationFilter[key];
24924
+ }
24925
+ });
24926
+ }
24927
+ const operationFilter = {};
24928
+ operationFilter['operationFilter'] = appliedFilter;
24929
+ return operationFilter;
24930
+ }
24931
+ getRearchResultFromInputBox(inputValue, viewConfig, filterObject) {
24932
+ let view = viewConfig;
24933
+ let eventNode = { data: {}, keyToPass: [] };
24934
+ eventNode.data[filterObject.server_column] = inputValue;
24935
+ eventNode['keyToPass'] = [filterObject.server_column];
24936
+ let apiCalls = [];
24937
+ view.compConfig.viewConfig.forEach(contentView => {
24938
+ let appliedFilters = this.getSetOperatorFilter(eventNode, this.stateDataSource.get(contentView.viewId));
24939
+ let found = this.dataSetModal.find(d => d.datasetId === contentView.datasetId);
24940
+ if (found) {
24941
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, contentView.datasetId, appliedFilters));
24942
+ }
24943
+ });
24944
+ viewConfig.nodeProperties['display'] = false;
24945
+ const prefixedId = `id-${viewConfig.id}`;
24946
+ const elementToHide = document.querySelector(`#${prefixedId}`);
24947
+ if (elementToHide) {
24948
+ elementToHide.remove();
24949
+ }
24950
+ Promise.all(apiCalls).then(() => {
24951
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24952
+ this.loadingModal = true;
24953
+ this.contextMenuDataSource = this.contextMenuDataSource.filter(e => e.displayKey !== viewConfig.keyToPass);
24954
+ view.nodeProperties['display'] = true;
24955
+ const prefixedId = `id-${view.id}`;
24956
+ const containerElement = document.querySelector(`#${prefixedId}`);
24957
+ this.loadSingleWidgetNode(view, this.mainPageDivElement, this.uniqueDataSetObject);
24958
+ setTimeout(() => {
24959
+ this.scrollToBottom(this.mainPageDivElement);
24960
+ }, 200);
24961
+ let params = {};
24962
+ params[filterObject.server_column] = inputValue;
24963
+ });
24964
+ }
24965
+ submitFilter() {
24966
+ let view = this.nodeproperticeFilterDataSource.viewConfig;
24967
+ let apiCalls = [];
24968
+ this.havingDataObject = this.nodeproperticeFilterDataSource.havingConfig.filter(value => value.value !== "");
24969
+ view.compConfig.viewConfig.forEach(contentView => {
24970
+ let appliedFilters = this.stateDataSource.get(contentView.viewId);
24971
+ let found = this.dataSetModal.find(d => d.datasetId === contentView.datasetId);
24972
+ if (found) {
24973
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, contentView.datasetId, appliedFilters.filters));
24974
+ }
24975
+ });
24976
+ Promise.all(apiCalls).then(() => {
24977
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24978
+ this.nodeproperticeFilterDataSource.viewConfig.nodeProperties['display'] = false;
24979
+ const prefixedId = `id-${this.nodeproperticeFilterDataSource.viewConfig.id}`;
24980
+ const elementToHide = document.querySelector(`#${prefixedId}`);
24981
+ if (elementToHide) {
24982
+ elementToHide.remove();
24983
+ }
24984
+ this.loadingModal = true;
24985
+ this.contextMenuDataSource = this.contextMenuDataSource.filter(e => e.displayKey !== this.nodeproperticeFilterDataSource.viewConfig.keyToPass);
24986
+ this.isWidgetFilters = false;
24987
+ view.nodeProperties['display'] = true;
24988
+ this.loadSingleWidgetNode(view, this.mainPageDivElement, this.uniqueDataSetObject);
24989
+ setTimeout(() => {
24990
+ this.scrollToBottom(this.mainPageDivElement);
24991
+ }, 200);
24992
+ });
24993
+ }
24994
+ getWidgetFilterForTemplate(value) {
24995
+ let apiCalls = [];
24996
+ const deletedViewIds = [];
24997
+ value.viewNodes.compConfig.viewConfig.forEach(item => {
24998
+ let widgetFilter = this.stateDataSource.get(item.viewId);
24999
+ let appliedFilters = widgetFilter.filters;
25000
+ let found = this.dataSetModal.find(d => d.datasetId === item.datasetId);
25001
+ deletedViewIds.push(item.viewId);
25002
+ const having = Object.entries(value.operationFilter).map(([key, value]) => ({
25003
+ columnName: key,
25004
+ dataType: "float",
25005
+ operator: "gte",
25006
+ value: value
25007
+ }));
25008
+ if (found) {
25009
+ found.config.queryConfig['havings'] = having;
25010
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, item.datasetId, appliedFilters));
25011
+ }
25012
+ });
25013
+ Promise.all(apiCalls).then(() => {
25014
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
25015
+ this.loadSingleWidgetNode(value.viewNodes, this.mainPageDivElement, this.uniqueDataSetObject);
25016
+ setTimeout(() => {
25017
+ this.scrollToBottom(this.mainPageDivElement);
25018
+ }, 200);
25019
+ });
25020
+ }
25021
+ loadDataByOperator(opName) {
25022
+ return __awaiter(this, void 0, void 0, function* () {
25023
+ let filter = { operationFilter: { startDate: "", endDate: "", operator_key: "" } };
25024
+ filter.operationFilter['startDate'] = this.defaultStartDate;
25025
+ filter.operationFilter['endDate'] = this.defaultEndDate;
25026
+ filter.operationFilter['operator_key'] = opName;
25027
+ this.loadingModal = true;
25028
+ yield this.getPadeDataSource(true);
25029
+ this.uniqueDataSetObject = {};
25030
+ let apiCalls = [];
25031
+ this.allWidgetByDataset.forEach(view => {
25032
+ view.datasetIds.forEach(id => {
25033
+ let found = this.dataSetModal.find(d => d.datasetId === id.datasetId);
25034
+ if (found) {
25035
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, id.datasetId, filter));
25036
+ }
25037
+ });
25038
+ });
25039
+ Promise.all(apiCalls).then(() => {
25040
+ this.globalDefaultFilter = filter;
25041
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
25042
+ this.createDivElements(this.uniqueDataSetObject, true);
25043
+ this.loadingModal = false;
25044
+ });
25045
+ });
25046
+ }
25047
+ getContextFilterData(value) {
25048
+ return __awaiter(this, void 0, void 0, function* () {
25049
+ let filter = { operationFilter: { startDate: "", endDate: "" } };
25050
+ filter.operationFilter['startDate'] = this.defaultStartDate;
25051
+ filter.operationFilter['endDate'] = this.defaultEndDate;
25052
+ filter.operationFilter[value.operatorName] = this.parseInput(value.defaultFilterValue);
25053
+ this.loadingModal = true;
25054
+ let obj = {};
25055
+ obj[value.operatorName] = value.defaultFilterValue;
25056
+ yield this.getPadeDataSource(true);
25057
+ this.uniqueDataSetObject = {};
25058
+ let apiCalls = [];
25059
+ this.allWidgetByDataset.forEach(view => {
25060
+ view.datasetIds.forEach(id => {
25061
+ let found = this.dataSetModal.find(d => d.datasetId === id.datasetId);
25062
+ if (found) {
25063
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, id.datasetId, filter));
25064
+ }
25065
+ });
25066
+ });
25067
+ Promise.all(apiCalls).then(() => {
25068
+ this.globalDefaultFilter = filter;
25069
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
25070
+ this.createDivElements(this.uniqueDataSetObject, true);
25071
+ this.loadingModal = false;
25072
+ });
25073
+ });
25074
+ }
25075
+ parseInput(input) {
25076
+ input = input.trim();
25077
+ if (input.includes(',')) {
25078
+ return input.split(',').map(item => item.trim());
25079
+ }
25080
+ else {
25081
+ return input;
25082
+ }
25083
+ }
25084
+ getDrilldownDisplayByUrlParams(all_views) {
25085
+ this.defaultViewIdsOnPageRefresh = [];
25086
+ const params = this.activatedRoute.snapshot.queryParams;
25087
+ this.defaultViewIdsOnPageRefresh = (params['views'] && params['views'] !== "") ? JSON.parse(decodeURIComponent(params['views'])) : [];
25088
+ all_views.forEach(element => {
25089
+ for (let entry of element.widgetNode) {
25090
+ let shouldDisplay = false;
25091
+ entry.compConfig.viewConfig.forEach(view => {
25092
+ if (this.defaultViewIdsOnPageRefresh.length !== 0) {
25093
+ const foundObject = this.defaultViewIdsOnPageRefresh.find(val => val.viewId === view.viewId);
25094
+ if (foundObject) {
25095
+ shouldDisplay = true;
25096
+ }
25097
+ }
25098
+ });
25099
+ if (shouldDisplay) {
25100
+ entry.nodeProperties.display = true;
25101
+ }
25102
+ }
25103
+ });
25104
+ }
25105
+ getFiltersForQueryParams(operators, filters, viewParams) {
25106
+ const operationFilter = operators.operationFilter || {};
25107
+ const currentParams = this.activatedRoute.snapshot.queryParams;
25108
+ let currentViews = [];
25109
+ if (currentParams['views']) {
25110
+ try {
25111
+ currentViews = JSON.parse(decodeURIComponent(currentParams['views']));
25112
+ }
25113
+ catch (e) {
25114
+ console.error("Invalid views param");
25115
+ }
25116
+ }
25117
+ const filterData = { viewId: viewParams.viewId };
25118
+ filters.forEach(filter => {
25119
+ const localKey = filter.localColumn;
25120
+ const serverKey = filter.serverColumn;
25121
+ let value = operationFilter[localKey];
25122
+ if (value !== undefined && value !== "") {
25123
+ filterData[serverKey] = value;
25124
+ }
25125
+ });
25126
+ const existingIndex = currentViews.findIndex(v => v.viewId === viewParams.viewId);
25127
+ if (existingIndex !== -1) {
25128
+ currentViews[existingIndex] = filterData;
25129
+ currentViews = currentViews.slice(0, existingIndex + 1);
25130
+ }
25131
+ else {
25132
+ currentViews.push(filterData);
25133
+ }
25134
+ const encodedViews = encodeURIComponent(JSON.stringify(currentViews));
25135
+ const mergedParams = Object.assign(Object.assign({}, currentParams), { views: encodedViews });
25136
+ }
25137
+ getDrildownFilter(drildownFilter, defaultFilter) {
25138
+ const expectedDateFields = ['recordDate', 'record_date', 'eventDate', 'event_date'];
25139
+ const result = JSON.parse(JSON.stringify(defaultFilter));
25140
+ const { viewId } = drildownFilter, filteredDrilldown = __rest(drildownFilter, ["viewId"]);
25141
+ let dateValue = null;
25142
+ for (const key of expectedDateFields) {
25143
+ if (filteredDrilldown[key]) {
25144
+ dateValue = filteredDrilldown[key];
25145
+ break;
25146
+ }
25147
+ }
25148
+ if (dateValue) {
25149
+ result.operationFilter.startDate = dateValue;
25150
+ result.operationFilter.endDate = dateValue;
25151
+ }
25152
+ for (const key in filteredDrilldown) {
25153
+ if (!expectedDateFields.includes(key)) {
25154
+ result.operationFilter[key] = filteredDrilldown[key];
25155
+ }
25156
+ }
25157
+ return result;
25158
+ }
25159
+ getTitleParams(items) {
25160
+ const results = [];
25161
+ items.compConfig.viewConfig.forEach(element => {
25162
+ const foundObject = this.defaultViewIdsOnPageRefresh.find(val => val.viewId === element.viewId);
25163
+ if (foundObject) {
25164
+ const result = Object.entries(foundObject)
25165
+ .filter(([key]) => key !== 'viewId')
25166
+ .map(([key, value]) => {
25167
+ const formattedKey = key
25168
+ .replace(/_/g, ' ')
25169
+ .replace(/\b\w/g, char => char.toUpperCase());
25170
+ return `${formattedKey} = ${value}`;
25171
+ })
25172
+ .join(' | ');
25173
+ results.push(`| ${result} `);
25174
+ }
25175
+ });
25176
+ return results.join('\n');
25177
+ }
25178
+ }
25179
+ MultiLayoutLandingComponentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MultiLayoutLandingComponentComponent, deps: [{ token: CommonService }, { token: i2.ActivatedRoute }, { token: i0.ViewContainerRef }, { token: i0.ComponentFactoryResolver }, { token: LandingMultiLayoutComponentService }, { token: i3$1.ToastrService }, { token: i2.Router }, { token: LandingMultiLayoutApplicationDatssetsCall }, { token: AppLandingMultiLayoutLocalStorage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
25180
+ MultiLayoutLandingComponentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MultiLayoutLandingComponentComponent, selector: "app-multi-layout-landing-component", viewQueries: [{ propertyName: "dynamicComponentContainer", first: true, predicate: ["dynamicComponentContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "containerRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef }, { propertyName: "dynamicContainer", first: true, predicate: ["dynamicContainer"], descendants: true, static: true }, { propertyName: "dynamicContainerForPopup", first: true, predicate: ["dynamicContainerForPopup"], descendants: true, static: true }], ngImport: i0, template: "<app-loading *ngIf=\"loadingModal\"></app-loading>\n\n<div class=\"w-full\">\n <div class=\"flex flex-wrap \" #dynamicContainer></div>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: LoadingComponent$1, selector: "app-loading" }] });
25181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MultiLayoutLandingComponentComponent, decorators: [{
25182
+ type: Component,
25183
+ args: [{ selector: 'app-multi-layout-landing-component', template: "<app-loading *ngIf=\"loadingModal\"></app-loading>\n\n<div class=\"w-full\">\n <div class=\"flex flex-wrap \" #dynamicContainer></div>\n</div>" }]
25184
+ }], ctorParameters: function () { return [{ type: CommonService }, { type: i2.ActivatedRoute }, { type: i0.ViewContainerRef }, { type: i0.ComponentFactoryResolver }, { type: LandingMultiLayoutComponentService }, { type: i3$1.ToastrService }, { type: i2.Router }, { type: LandingMultiLayoutApplicationDatssetsCall }, { type: AppLandingMultiLayoutLocalStorage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { dynamicComponentContainer: [{
25185
+ type: ViewChild,
25186
+ args: ['dynamicComponentContainer', { read: ViewContainerRef }]
25187
+ }], containerRef: [{
25188
+ type: ViewChild,
25189
+ args: ['container', { read: ViewContainerRef }]
25190
+ }], dynamicContainer: [{
25191
+ type: ViewChild,
25192
+ args: ['dynamicContainer', { static: true }]
25193
+ }], dynamicContainerForPopup: [{
25194
+ type: ViewChild,
25195
+ args: ['dynamicContainerForPopup', { static: true }]
25196
+ }] } });
25197
+
25198
+ class DefaultLandingMultiLayoutComponenttModule {
25199
+ }
25200
+ DefaultLandingMultiLayoutComponenttModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DefaultLandingMultiLayoutComponenttModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
25201
+ DefaultLandingMultiLayoutComponenttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: DefaultLandingMultiLayoutComponenttModule, declarations: [MultiLayoutLandingComponentComponent], imports: [CommonModule,
25202
+ LoadingModule$1,
25203
+ CommonModule,
25204
+ DevExtremeModule,
25205
+ DxButtonModule,
25206
+ DxCheckBoxModule,
25207
+ DxNumberBoxModule,
25208
+ DxDataGridModule,
25209
+ DxDropDownBoxModule,
25210
+ DxTreeViewModule,
25211
+ DxScrollViewModule,
25212
+ DxFormModule,
25213
+ DxAccordionModule,
25214
+ FormsModule,
25215
+ DxTagBoxModule,
25216
+ ReactiveFormsModule,
25217
+ MatIconModule,
25218
+ DxHtmlEditorModule,
25219
+ DxBulletModule,
25220
+ DxChartModule,
25221
+ DxDateBoxModule,
25222
+ DxLoadPanelModule,
25223
+ DxLookupModule,
25224
+ DxPivotGridModule,
25225
+ DxTemplateModule,
25226
+ DxTextAreaModule,
25227
+ DxValidationSummaryModule,
25228
+ DxValidatorModule,
25229
+ DxCalendarModule,
25230
+ DxTooltipModule,
25231
+ DxContextMenuModule,
25232
+ DxLoadIndicatorModule,
25233
+ DxPieChartModule,
25234
+ MatTooltipModule,
25235
+ DxPopupModule, DxSelectBoxModule, DxTextBoxModule, DxTreeViewModule,
25236
+ MatButtonModule,
25237
+ MatDividerModule,
25238
+ MatMenuModule,
25239
+ MatIconModule,
25240
+ LoadingModule$1], exports: [MultiLayoutLandingComponentComponent] });
25241
+ DefaultLandingMultiLayoutComponenttModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DefaultLandingMultiLayoutComponenttModule, providers: [LandingMultiLayoutApplicationDatssetsCall, LandingMultiLayoutComponentService], imports: [CommonModule,
25242
+ LoadingModule$1,
25243
+ CommonModule,
25244
+ DevExtremeModule,
25245
+ DxButtonModule,
25246
+ DxCheckBoxModule,
25247
+ DxNumberBoxModule,
25248
+ DxDataGridModule,
25249
+ DxDropDownBoxModule,
25250
+ DxTreeViewModule,
25251
+ DxScrollViewModule,
25252
+ DxFormModule,
25253
+ DxAccordionModule,
25254
+ FormsModule,
25255
+ DxTagBoxModule,
25256
+ ReactiveFormsModule,
25257
+ MatIconModule,
25258
+ DxHtmlEditorModule,
25259
+ DxBulletModule,
25260
+ DxChartModule,
25261
+ DxDateBoxModule,
25262
+ DxLoadPanelModule,
25263
+ DxLookupModule,
25264
+ DxPivotGridModule,
25265
+ DxTemplateModule,
25266
+ DxTextAreaModule,
25267
+ DxValidationSummaryModule,
25268
+ DxValidatorModule,
25269
+ DxCalendarModule,
25270
+ DxTooltipModule,
25271
+ DxContextMenuModule,
25272
+ DxLoadIndicatorModule,
25273
+ DxPieChartModule,
25274
+ MatTooltipModule,
25275
+ DxPopupModule, DxSelectBoxModule, DxTextBoxModule, DxTreeViewModule,
25276
+ MatButtonModule,
25277
+ MatDividerModule,
25278
+ MatMenuModule,
25279
+ MatIconModule,
25280
+ LoadingModule$1] });
25281
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DefaultLandingMultiLayoutComponenttModule, decorators: [{
25282
+ type: NgModule,
25283
+ args: [{
25284
+ declarations: [
25285
+ MultiLayoutLandingComponentComponent,
25286
+ ],
25287
+ imports: [CommonModule,
25288
+ LoadingModule$1,
25289
+ CommonModule,
25290
+ DevExtremeModule,
25291
+ DxButtonModule,
25292
+ DxCheckBoxModule,
25293
+ DxNumberBoxModule,
25294
+ DxDataGridModule,
25295
+ DxDropDownBoxModule,
25296
+ DxTreeViewModule,
25297
+ DxScrollViewModule,
25298
+ DxFormModule,
25299
+ DxAccordionModule,
25300
+ FormsModule,
25301
+ DxTagBoxModule,
25302
+ ReactiveFormsModule,
25303
+ MatIconModule,
25304
+ DxHtmlEditorModule,
25305
+ DxBulletModule,
25306
+ DxChartModule,
25307
+ DxDateBoxModule,
25308
+ DxLoadPanelModule,
25309
+ DxLookupModule,
25310
+ DxPivotGridModule,
25311
+ DxTemplateModule,
25312
+ DxTextAreaModule,
25313
+ DxValidationSummaryModule,
25314
+ DxValidatorModule,
25315
+ DxCalendarModule,
25316
+ DxTooltipModule,
25317
+ DxContextMenuModule,
25318
+ DxLoadIndicatorModule,
25319
+ DxPieChartModule,
25320
+ MatTooltipModule,
25321
+ DxPopupModule, DxSelectBoxModule, DxTextBoxModule, DxTreeViewModule,
25322
+ MatButtonModule,
25323
+ MatDividerModule,
25324
+ MatMenuModule,
25325
+ MatIconModule,
25326
+ LoadingModule$1,
25327
+ ],
25328
+ exports: [
25329
+ MultiLayoutLandingComponentComponent
25330
+ ],
25331
+ providers: [LandingMultiLayoutApplicationDatssetsCall, LandingMultiLayoutComponentService],
25332
+ }]
25333
+ }] });
25334
+
23428
25335
  class BookmarkedService {
23429
25336
  constructor(http, environment) {
23430
25337
  this.http = http;
@@ -24837,5 +26744,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
24837
26744
  }]
24838
26745
  }] });
24839
26746
 
24840
- export { APP_ENVIRONMENT, AdvanceWidgetHeaderFilterComponent, AllMetricsConfigComponent, AppAdvanceHeaderComponent, AppHttpService, AppLandingLayoutLocalStorage, AppLocalStorage, AppMultiLayoutLocalStorage, AppSingleLayoutLocalStorage, AppTitleComponent, ApplicationChatApiCallService, ApplicationContentService, ApplicationDatssetsCall, ApplicationFilterComponent, ApplicationViewsComponent, BookMarkedTemplatemodule, BookmarkedApplicationDatssetsCall, BookmarkedService, BookmarkedTemplateComponent, BreadCrumbsComponent, CdrConfigComponent, CdrConfigMoudule, CommonHeaderComponent, CommonService, CreateCompViewComponent, CreateDatasetComponent, CreateDatasetJsonComponent, CreateDatasetSqlComponent, CreateKpiTreeComponent, CreateMetricsComponent, DashChartComponent, DashTableComponent, DashTodayPreviousComponent, DefaultLandingComponenttModule, DynamicWidgetComponent, DynamicWidgetForMultilayoutComponent, ExceptionOperationComponent, ExceptionOperationModule, GamamWidgetComponent, GammSingleNumberCardComponent, GammaAdvanceChartComponent, GammaAdvanceFilterComponent, GammaAdvanceOperatorTableComponent, GammaAppControllerComponent, GammaAppControllerModule, GammaAppControllerService, GammaGeoChartComponent, GammaHeatChartComponent, GammaTableClumnBarChartComponent, GammaTableWithPercentageComponent, GammaTodayPreviousComponent, GeoMapComponent, GoogleGeoMapComponent, HeatMapSupportComponent, IconsModule, KpiCreationModule, KpiWithDataSetTestComponent, KpiWithMultiLayoutModule, KpiWithMultiLayoutService, KpiWithMultilayoutSetTestComponent, KpiWithSingleLayoutModule, KpiWithSingleLayoutService, LandingApplicationDatssetsCall, LandingComponentComponent, LandingComponentService, LoaderComponent, LoadingComponent, LoadingModule, MultilayoutApplicationDatssetsCall, OflineMetricsComponent, OnlineMetricsComponent, PackageApplicationControllerModule, PageConfigComponent, PageConfigMultilayoutComponent, PageControlerComponent, SafeHtmlPipe, SingleLayoutApplicationDatssetsCall, SqlPipe, TableWithBarComponent, TreeViewAsideItemComponent, TreeViewBasicItemComponent, TreeViewCollapsableItemComponent, TreeViewDividerItemComponent, TreeViewGroupItemComponent, TreeViewSpacerItemComponent, TreeviewComponent, contentSafeHtml, kpicommonService$2 as kpicommonService };
26747
+ export { APP_ENVIRONMENT, AdvanceWidgetHeaderFilterComponent, AllMetricsConfigComponent, AppAdvanceHeaderComponent, AppHttpService, AppLandingLayoutLocalStorage, AppLandingMultiLayoutLocalStorage, AppLocalStorage, AppMultiLayoutLocalStorage, AppSingleLayoutLocalStorage, AppTitleComponent, ApplicationChatApiCallService, ApplicationContentService, ApplicationDatssetsCall, ApplicationFilterComponent, ApplicationViewsComponent, BookMarkedTemplatemodule, BookmarkedApplicationDatssetsCall, BookmarkedService, BookmarkedTemplateComponent, BreadCrumbsComponent, CdrConfigComponent, CdrConfigMoudule, CommonHeaderComponent, CommonService, CreateCompViewComponent, CreateDatasetComponent, CreateDatasetJsonComponent, CreateDatasetSqlComponent, CreateKpiTreeComponent, CreateMetricsComponent, DashChartComponent, DashTableComponent, DashTodayPreviousComponent, DefaultLandingComponenttModule, DefaultLandingMultiLayoutComponenttModule, DynamicWidgetComponent, DynamicWidgetForMultilayoutComponent, ExceptionOperationComponent, ExceptionOperationModule, GamamWidgetComponent, GammSingleNumberCardComponent, GammaAdvanceChartComponent, GammaAdvanceFilterComponent, GammaAdvanceOperatorTableComponent, GammaAppControllerComponent, GammaAppControllerModule, GammaAppControllerService, GammaGeoChartComponent, GammaHeatChartComponent, GammaTableClumnBarChartComponent, GammaTableWithPercentageComponent, GammaTodayPreviousComponent, GeoMapComponent, GoogleGeoMapComponent, HeatMapSupportComponent, IconsModule, KpiCreationModule, KpiWithDataSetTestComponent, KpiWithMultiLayoutModule, KpiWithMultiLayoutService, KpiWithMultilayoutSetTestComponent, KpiWithSingleLayoutModule, KpiWithSingleLayoutService, LandingApplicationDatssetsCall, LandingComponentComponent, LandingComponentService, LandingMultiLayoutApplicationDatssetsCall, LandingMultiLayoutComponentService, LoaderComponent, LoadingComponent, LoadingModule, MultiLayoutLandingComponentComponent, MultilayoutApplicationDatssetsCall, OflineMetricsComponent, OnlineMetricsComponent, PackageApplicationControllerModule, PageConfigComponent, PageConfigMultilayoutComponent, PageControlerComponent, SafeHtmlPipe, SingleLayoutApplicationDatssetsCall, SqlPipe, TableWithBarComponent, TreeViewAsideItemComponent, TreeViewBasicItemComponent, TreeViewCollapsableItemComponent, TreeViewDividerItemComponent, TreeViewGroupItemComponent, TreeViewSpacerItemComponent, TreeviewComponent, contentSafeHtml, kpicommonService$2 as kpicommonService };
24841
26748
  //# sourceMappingURL=gamma-app-controller.mjs.map