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
@@ -7148,7 +7148,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
7148
7148
  args: ['chartDataSource']
7149
7149
  }] } });
7150
7150
 
7151
- const TOKEN_KEY$3 = 'x-auth-token';
7151
+ const TOKEN_KEY$4 = 'x-auth-token';
7152
7152
  class AppLocalStorage {
7153
7153
  constructor(environment) {
7154
7154
  this.environment = environment;
@@ -7163,7 +7163,7 @@ class AppLocalStorage {
7163
7163
  return window.localStorage.removeItem[this.getAppVariableName(type)];
7164
7164
  }
7165
7165
  destroy() {
7166
- window.localStorage.removeItem(TOKEN_KEY$3);
7166
+ window.localStorage.removeItem(TOKEN_KEY$4);
7167
7167
  }
7168
7168
  getAppVariableName(attributeName) {
7169
7169
  return this.environment.appName + '__' + attributeName;
@@ -8147,10 +8147,12 @@ class AppAdvanceHeaderComponent {
8147
8147
  };
8148
8148
  this.srvTypeDataSource = [];
8149
8149
  this.srvTypeDisplayValue = [];
8150
+ this.selectedDetesforView = '';
8150
8151
  this.selectedDateRangeOrServtype = new EventEmitter();
8151
8152
  this.getFilterPageConfig = new EventEmitter();
8152
8153
  this.getOperatorName = new EventEmitter();
8153
8154
  this.getContextFilterData = new EventEmitter();
8155
+ this.selectedDatesMap = {};
8154
8156
  }
8155
8157
  set filterItems(value) {
8156
8158
  if (value === undefined || value.length === 0) {
@@ -8230,6 +8232,12 @@ class AppAdvanceHeaderComponent {
8230
8232
  });
8231
8233
  }
8232
8234
  }
8235
+ ngOnChanges(changes) {
8236
+ if (changes['filterObjects'] && this.filterObjects?.widgetId) {
8237
+ const widgetId = this.filterObjects.widgetId;
8238
+ this.selectedDatesMap[widgetId] = this.selectedDetesforView;
8239
+ }
8240
+ }
8233
8241
  getContextMenuChange(event) {
8234
8242
  if (event.event) {
8235
8243
  const foundObject = this.contextFilterItemsForFilter.find(item => item.defaultFilterValue === event.value);
@@ -8315,18 +8323,21 @@ class AppAdvanceHeaderComponent {
8315
8323
  }
8316
8324
  }
8317
8325
  });
8326
+ let selectedText = '';
8318
8327
  if (displayStartDate && displayEndDate) {
8319
- this.selectedDetesforView = `${displayStartDate} - ${displayEndDate}`;
8328
+ selectedText = `${displayStartDate} - ${displayEndDate}`;
8320
8329
  }
8321
8330
  else if (displayStartDate) {
8322
- this.selectedDetesforView = displayStartDate;
8331
+ selectedText = displayStartDate;
8323
8332
  }
8324
8333
  else if (displayEndDate) {
8325
- this.selectedDetesforView = displayEndDate;
8334
+ selectedText = displayEndDate;
8326
8335
  }
8327
- else {
8328
- this.selectedDetesforView = '';
8336
+ const element = document.getElementById(this.filterObjects.widgetId);
8337
+ if (element) {
8338
+ element.innerText = selectedText;
8329
8339
  }
8340
+ filter['filterObjects'] = (this.filterObjects) ? this.filterObjects : null;
8330
8341
  this.getFilterPageConfig.emit(filter);
8331
8342
  }
8332
8343
  getOperatorDataSource(event) {
@@ -8378,10 +8389,10 @@ class AppAdvanceHeaderComponent {
8378
8389
  }
8379
8390
  }
8380
8391
  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 });
8381
- 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"] }] });
8392
+ 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"] }] });
8382
8393
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppAdvanceHeaderComponent, decorators: [{
8383
8394
  type: Component,
8384
- 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>" }]
8395
+ 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>" }]
8385
8396
  }], ctorParameters: function () { return [{ type: i2.ActivatedRoute }, { type: i2.Router }, { type: CommonService }, { type: AppLocalStorage }]; }, propDecorators: { pageTitle: [{
8386
8397
  type: Input
8387
8398
  }], bread_crumbs_container: [{
@@ -8402,6 +8413,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
8402
8413
  type: Output
8403
8414
  }], getContextFilterData: [{
8404
8415
  type: Output
8416
+ }], filterObjects: [{
8417
+ type: Input
8405
8418
  }], filterItems: [{
8406
8419
  type: Input,
8407
8420
  args: ['filterItems']
@@ -12770,6 +12783,7 @@ class PageControlerComponent {
12770
12783
  { "compName": "KpiWithDataSetTestComponent", "item": "Default KPI Layout" },
12771
12784
  { "compName": "KpiWithMultilayoutSetTestComponent", "item": "Multiple Layout KPI" },
12772
12785
  { "compName": "LandingComponentComponent", "item": "Default Page" },
12786
+ { "compName": "MultiLayoutLandingComponentComponent", "item": "Multiple Layout Page" },
12773
12787
  { "compName": "CdrConfigComponent", "item": "CDR Config" },
12774
12788
  { "compName": "CreateKpiTreeComponent", "item": "Create KPI Config" },
12775
12789
  { "compName": "CreateMetricsComponent", "item": "Create Metrics" },
@@ -18199,7 +18213,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
18199
18213
  args: [APP_ENVIRONMENT]
18200
18214
  }] }]; } });
18201
18215
 
18202
- const TOKEN_KEY$2 = 'x-auth-token';
18216
+ const TOKEN_KEY$3 = 'x-auth-token';
18203
18217
  class AppSingleLayoutLocalStorage {
18204
18218
  constructor(environment) {
18205
18219
  this.environment = environment;
@@ -18214,7 +18228,7 @@ class AppSingleLayoutLocalStorage {
18214
18228
  return window.localStorage.removeItem[this.getAppVariableName(type)];
18215
18229
  }
18216
18230
  destroy() {
18217
- window.localStorage.removeItem(TOKEN_KEY$2);
18231
+ window.localStorage.removeItem(TOKEN_KEY$3);
18218
18232
  }
18219
18233
  getAppVariableName(attributeName) {
18220
18234
  return this.environment.appName + '__' + attributeName;
@@ -20378,7 +20392,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
20378
20392
  args: [APP_ENVIRONMENT]
20379
20393
  }] }]; } });
20380
20394
 
20381
- const TOKEN_KEY$1 = 'x-auth-token';
20395
+ const TOKEN_KEY$2 = 'x-auth-token';
20382
20396
  class AppMultiLayoutLocalStorage {
20383
20397
  constructor(environment) {
20384
20398
  this.environment = environment;
@@ -20393,7 +20407,7 @@ class AppMultiLayoutLocalStorage {
20393
20407
  return window.localStorage.removeItem[this.getAppVariableName(type)];
20394
20408
  }
20395
20409
  destroy() {
20396
- window.localStorage.removeItem(TOKEN_KEY$1);
20410
+ window.localStorage.removeItem(TOKEN_KEY$2);
20397
20411
  }
20398
20412
  getAppVariableName(attributeName) {
20399
20413
  return this.environment.appName + '__' + attributeName;
@@ -21990,7 +22004,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
21990
22004
  args: [APP_ENVIRONMENT]
21991
22005
  }] }]; } });
21992
22006
 
21993
- const TOKEN_KEY = 'x-auth-token';
22007
+ const TOKEN_KEY$1 = 'x-auth-token';
21994
22008
  class AppLandingLayoutLocalStorage {
21995
22009
  constructor(environment) {
21996
22010
  this.environment = environment;
@@ -22005,7 +22019,7 @@ class AppLandingLayoutLocalStorage {
22005
22019
  return window.localStorage.removeItem[this.getAppVariableName(type)];
22006
22020
  }
22007
22021
  destroy() {
22008
- window.localStorage.removeItem(TOKEN_KEY);
22022
+ window.localStorage.removeItem(TOKEN_KEY$1);
22009
22023
  }
22010
22024
  getAppVariableName(attributeName) {
22011
22025
  return this.environment.appName + '__' + attributeName;
@@ -23350,6 +23364,1876 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
23350
23364
  }]
23351
23365
  }] });
23352
23366
 
23367
+ class LandingMultiLayoutComponentService {
23368
+ constructor(http, environment) {
23369
+ this.http = http;
23370
+ this.environment = environment;
23371
+ this.headers = new HttpHeaders().set('Content-Type', 'application/json');
23372
+ this.options = { headers: this.headers, withCredentials: true };
23373
+ this._selectedKpiOnClick = new Subject();
23374
+ this._kpilist = new Subject();
23375
+ this._selectKpiFromDropDown = new Subject();
23376
+ this._componentRegistry = new Map();
23377
+ this.kpiFilter = new BehaviorSubject([]);
23378
+ }
23379
+ handleError(error) {
23380
+ return throwError(error);
23381
+ }
23382
+ getlistKpiBrowser() {
23383
+ const apiUrl = this.environment.appUrl + this.environment.apiVersion + '/kpi-config/listKpiBrowser';
23384
+ return this.http
23385
+ .get(apiUrl, { withCredentials: true })
23386
+ .pipe(map((response) => {
23387
+ return response;
23388
+ }), catchError(this.handleError));
23389
+ }
23390
+ getAppPageDetailConfig(pageId) {
23391
+ return this.http
23392
+ .get(this.environment.appUrl + this.environment.apiVersion + '/kpi-config/getAppPageDetailConfig?pageConfigId=' + pageId, this.options)
23393
+ .pipe(map((response) => {
23394
+ return response;
23395
+ }), catchError(this.handleError));
23396
+ }
23397
+ getAppPageConfigs() {
23398
+ const apiUrl = this.environment.appUrl + this.environment.apiVersion + '/kpi-config/getAppPageConfigs';
23399
+ return this.http
23400
+ .get(apiUrl, { withCredentials: true })
23401
+ .pipe(map((response) => {
23402
+ return response;
23403
+ }), catchError(this.handleError));
23404
+ }
23405
+ getAppDatasetConfigs() {
23406
+ const apiUrl = this.environment.appUrl + this.environment.apiVersion + '/kpi-config/getAppDatasetConfigs';
23407
+ return this.http
23408
+ .get(apiUrl, { withCredentials: true })
23409
+ .pipe(map((response) => {
23410
+ return response;
23411
+ }), catchError(this.handleError));
23412
+ }
23413
+ getAppDatasetConfig(datasetId) {
23414
+ const apiUrl = this.environment.appUrl + this.environment.apiVersion + '/kpi-config/getAppDatasetConfig?datasetId=' + datasetId;
23415
+ return this.http
23416
+ .get(apiUrl, { withCredentials: true })
23417
+ .pipe(map((response) => {
23418
+ return response;
23419
+ }), catchError(this.handleError));
23420
+ }
23421
+ getAppFilterConfig(filterId) {
23422
+ return this.http
23423
+ .get(this.environment.appUrl + this.environment.apiVersion + '/kpi-config/getAppFilterConfig?filterId=' + filterId, this.options)
23424
+ .pipe(map((response) => {
23425
+ return response;
23426
+ }), catchError(this.handleError));
23427
+ }
23428
+ getAppViewConfigs() {
23429
+ const apiUrl = this.environment.appUrl + this.environment.apiVersion + '/kpi-config/getAppViewConfigs';
23430
+ return this.http
23431
+ .get(apiUrl, { withCredentials: true })
23432
+ .pipe(map((response) => {
23433
+ return response;
23434
+ }), catchError(this.handleError));
23435
+ }
23436
+ getData(body, requestID) {
23437
+ return this.http
23438
+ .post(this.environment.appUrl + this.environment.apiVersion + requestID, JSON.stringify(body), this.options)
23439
+ .pipe(map((response) => {
23440
+ return response;
23441
+ }), catchError(this.handleError));
23442
+ }
23443
+ getSimpleApiPostRequest(requestApi, body) {
23444
+ return this.http
23445
+ .post(this.environment.appUrl + this.environment.apiVersion + requestApi, JSON.stringify(body), this.options)
23446
+ .pipe(map((response) => {
23447
+ return response;
23448
+ }), catchError(this.handleError));
23449
+ }
23450
+ getSimpleApiGetRequest(requestApi) {
23451
+ return this.http
23452
+ .get(this.environment.appUrl + this.environment.apiVersion + requestApi, { withCredentials: true })
23453
+ .pipe(map((response) => {
23454
+ return response;
23455
+ }), catchError(this.handleError));
23456
+ }
23457
+ getJsonDatasetPayload(requestApi) {
23458
+ return this.http
23459
+ .get(this.environment.appUrl + this.environment.apiVersion + requestApi, { withCredentials: true })
23460
+ .pipe(map((response) => {
23461
+ return response;
23462
+ }), catchError(this.handleError));
23463
+ }
23464
+ genericSqlQueryResponse(requestApi, body) {
23465
+ return this.http
23466
+ .post(this.environment.appUrl + this.environment.apiVersion + requestApi, JSON.stringify(body), this.options)
23467
+ .pipe(map((response) => {
23468
+ return response;
23469
+ }), catchError(this.handleError));
23470
+ }
23471
+ }
23472
+ 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 });
23473
+ LandingMultiLayoutComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LandingMultiLayoutComponentService, providedIn: "root" });
23474
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LandingMultiLayoutComponentService, decorators: [{
23475
+ type: Injectable,
23476
+ args: [{ providedIn: "root" }]
23477
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
23478
+ type: Inject,
23479
+ args: [APP_ENVIRONMENT]
23480
+ }] }]; } });
23481
+
23482
+ class LandingMultiLayoutApplicationDatssetsCall {
23483
+ constructor(service, kpiService, toastr, environment) {
23484
+ this.service = service;
23485
+ this.kpiService = kpiService;
23486
+ this.toastr = toastr;
23487
+ this.environment = environment;
23488
+ this.uniqueDataSetObject = {};
23489
+ }
23490
+ getDataFromDataSet(dataset, datasetId, filters) {
23491
+ if (dataset.datasetType == "mongo") {
23492
+ return this.getDataSetForMongo(dataset, datasetId);
23493
+ }
23494
+ else if (dataset.datasetType == "querybuilder") {
23495
+ return this.getDatasetForImpala(dataset, datasetId, filters);
23496
+ }
23497
+ else if (dataset.datasetType == "simpleApi") {
23498
+ return this.getDatasetForSimpleApiImpala(dataset, datasetId, filters);
23499
+ }
23500
+ else if (dataset.datasetType == "plainjson") {
23501
+ return this.getDatasetForPlainJson(dataset, datasetId, filters);
23502
+ }
23503
+ else if (dataset.datasetType == "sqlQuery") {
23504
+ return this.getDatasetForSqlTemplate(dataset, datasetId, filters);
23505
+ }
23506
+ else {
23507
+ return Promise.resolve();
23508
+ }
23509
+ }
23510
+ getDataSetForMongo(dataset, datasetId) {
23511
+ return new Promise((resolve, reject) => {
23512
+ let apiJsonObject = {
23513
+ requestId: dataset.config.serviceId,
23514
+ };
23515
+ if (dataset.config.fixOperationLevles && dataset.config.fixOperationLevles.length != 0) {
23516
+ for (const item of dataset.config.fixOperationLevles) {
23517
+ Object.assign(apiJsonObject, item);
23518
+ }
23519
+ }
23520
+ const mon_config = this.kpiService.getAllSeviceApiJson(apiJsonObject);
23521
+ this.service.getData(mon_config, dataset.config.api).subscribe({
23522
+ next: (data) => {
23523
+ const payload = data["Payload"] || data;
23524
+ this.uniqueDataSetObject[datasetId] = payload;
23525
+ resolve();
23526
+ },
23527
+ error: (err) => {
23528
+ console.error('Error:', err);
23529
+ reject(err);
23530
+ }
23531
+ });
23532
+ });
23533
+ }
23534
+ getDatasetForImpala(dataset, datasetId, filters) {
23535
+ return new Promise((resolve, reject) => {
23536
+ let request = dataset.config.queryConfig;
23537
+ let transformedObject = {};
23538
+ for (let item of request.reqFields) {
23539
+ const key = Object.keys(item)[0];
23540
+ const value = Object.values(item)[0];
23541
+ if (key === 'startDate') {
23542
+ transformedObject.recordDate = value;
23543
+ }
23544
+ else {
23545
+ transformedObject[key] = value;
23546
+ }
23547
+ }
23548
+ const operator = (filters && filters.length !== 0) ? Object.keys(filters.operationFilter).map(key => ({ [key]: filters.operationFilter[key] })) : [];
23549
+ transformedObject['filters'] = this.transformDataForMFilter(operator, request.mapedFilters);
23550
+ transformedObject['sorters'] = request.sorters;
23551
+ transformedObject["paginationRequired"] = false;
23552
+ if (dataset.config.api == "/kpi/genericAggregatePaginatedKpiServiceResponse") {
23553
+ transformedObject['measures'] = request.measures;
23554
+ transformedObject['dimensions'] = request.dimensions;
23555
+ }
23556
+ else {
23557
+ transformedObject['columns'] = this.getFormatObjectForColumn(request.columns);
23558
+ }
23559
+ if (request.havings && request.havings.length !== 0) {
23560
+ transformedObject['havings'] = request.havings;
23561
+ }
23562
+ this.service.getData(transformedObject, dataset.config.api).subscribe({
23563
+ next: (data) => {
23564
+ const payload = data['dataset'];
23565
+ this.uniqueDataSetObject[datasetId] = payload;
23566
+ resolve();
23567
+ },
23568
+ error: (err) => {
23569
+ console.error('Error:', err);
23570
+ this.toastr.error(err.message);
23571
+ reject(err);
23572
+ }
23573
+ });
23574
+ });
23575
+ }
23576
+ getFormatObjectForColumn(columns) {
23577
+ let columnData = [];
23578
+ columns.forEach(element => {
23579
+ const { advancedColumn, columnName, enrichFunction, dataField } = element;
23580
+ columnData.push({
23581
+ "advancedColumn": advancedColumn,
23582
+ "columnName": columnName,
23583
+ "enrichFunction": enrichFunction,
23584
+ "aliasName": dataField
23585
+ });
23586
+ });
23587
+ return columnData;
23588
+ }
23589
+ transformDataForMFilter(filterdata, mapData) {
23590
+ let result = [];
23591
+ mapData.forEach(mapping => {
23592
+ let resultObj = {
23593
+ columnName: mapping.serverColumn,
23594
+ dataType: mapping.dataType,
23595
+ operator: mapping.operatorName,
23596
+ value: mapping.defaultValue
23597
+ };
23598
+ if (mapping.serverColumn.includes('date') && typeof resultObj.value === 'string') {
23599
+ if (mapping.formatter && mapping.formatter !== "") {
23600
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(mapping.formatter);
23601
+ }
23602
+ else {
23603
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(this.environment.dataFormat);
23604
+ }
23605
+ }
23606
+ const filter = filterdata.find(f => f.hasOwnProperty(mapping.localColumn));
23607
+ if (filter) {
23608
+ if (mapping.defaultValue === "") {
23609
+ const value = filter[mapping.localColumn];
23610
+ if (Array.isArray(value)) {
23611
+ resultObj.operator = "in";
23612
+ resultObj.value = value.join(",");
23613
+ }
23614
+ else {
23615
+ resultObj.value = value;
23616
+ }
23617
+ if (mapping.serverColumn.includes('date') && typeof resultObj.value === 'string') {
23618
+ if (mapping.formatter && mapping.formatter !== "") {
23619
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(mapping.formatter);
23620
+ }
23621
+ else {
23622
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(this.environment.dataFormat);
23623
+ }
23624
+ }
23625
+ }
23626
+ }
23627
+ else if (mapping.defaultValue === "") {
23628
+ return;
23629
+ }
23630
+ result.push(resultObj);
23631
+ });
23632
+ filterdata = filterdata.filter(obj => {
23633
+ const key = Object.keys(obj)[0];
23634
+ return key !== 'startDate' && key !== 'endDate';
23635
+ });
23636
+ filterdata.forEach(filter => {
23637
+ const filterKey = Object.keys(filter)[0];
23638
+ const existingMapping = mapData.find(mapping => mapping.localColumn === filterKey);
23639
+ if (!existingMapping) {
23640
+ let resultObj = {
23641
+ columnName: filterKey,
23642
+ dataType: "string",
23643
+ operator: "eq",
23644
+ value: filter[filterKey]
23645
+ };
23646
+ if (Array.isArray(filter[filterKey])) {
23647
+ resultObj.operator = "in";
23648
+ resultObj.value = filter[filterKey].join(",");
23649
+ }
23650
+ else {
23651
+ resultObj.value = filter[filterKey];
23652
+ }
23653
+ if (filterKey == 'operator_key') {
23654
+ resultObj.operator = "eq";
23655
+ }
23656
+ result.push(resultObj);
23657
+ }
23658
+ });
23659
+ result = result.filter(obj => obj.value !== null && obj.value !== "");
23660
+ return result;
23661
+ }
23662
+ getDatasetForSimpleApiImpala(dataset, datasetId, filters) {
23663
+ return new Promise((resolve, reject) => {
23664
+ dataset.config.queryConfig.mapedFilters.forEach(filter => {
23665
+ if (filters.operationFilter.hasOwnProperty(filter.localColumn)) {
23666
+ filter.defaultValue = filters.operationFilter[filter.localColumn];
23667
+ }
23668
+ });
23669
+ if (dataset.config.apiType === "post") {
23670
+ let serviceJson = {};
23671
+ dataset.config.queryConfig.mapedFilters.forEach((filter) => {
23672
+ let datecolumn = filter.serverColumn.toLowerCase();
23673
+ if (datecolumn.includes('date') && typeof filter.dataType === 'string') {
23674
+ serviceJson[filter.serverColumn] = moment$1(filter.defaultValue, "YYYY-MM-DD").format(this.environment.dataFormat);
23675
+ }
23676
+ else {
23677
+ serviceJson[filter.serverColumn] = filter.defaultValue;
23678
+ }
23679
+ });
23680
+ this.service.getSimpleApiPostRequest(dataset.config.api, serviceJson).subscribe({
23681
+ next: (data) => {
23682
+ const payload = data["Payload"] || data;
23683
+ this.uniqueDataSetObject[datasetId] = payload;
23684
+ resolve();
23685
+ },
23686
+ error: (err) => {
23687
+ console.error('Error:', err);
23688
+ this.toastr.error(err.message);
23689
+ reject(err);
23690
+ }
23691
+ });
23692
+ }
23693
+ else if (dataset.config.apiType === "get") {
23694
+ let requestUrl = dataset.config.api + "?";
23695
+ dataset.config.queryConfig.mapedFilters.forEach((filter, index) => {
23696
+ requestUrl += `${filter.serverColumn}=${filter.defaultValue}`;
23697
+ if (index < dataset.config.queryConfig.mapedFilters.length - 1) {
23698
+ requestUrl += "&";
23699
+ }
23700
+ });
23701
+ this.service.getSimpleApiGetRequest(requestUrl).subscribe({
23702
+ next: (data) => {
23703
+ const payload = data["Payload"] || data;
23704
+ this.uniqueDataSetObject[datasetId] = payload;
23705
+ resolve();
23706
+ },
23707
+ error: (err) => {
23708
+ console.error('Error:', err);
23709
+ this.toastr.error(err.message);
23710
+ reject(err);
23711
+ }
23712
+ });
23713
+ }
23714
+ });
23715
+ }
23716
+ getDatasetForPlainJson(dataset, datasetId, filter) {
23717
+ return new Promise((resolve, reject) => {
23718
+ let requestapi = dataset.config.api + '?datasetId=' + dataset.datasetId;
23719
+ this.service.getJsonDatasetPayload(requestapi).subscribe({
23720
+ next: (data) => {
23721
+ const payload = data["Payload"] || data;
23722
+ this.uniqueDataSetObject[datasetId] = payload;
23723
+ resolve();
23724
+ },
23725
+ error: (err) => {
23726
+ console.error('Error:', err);
23727
+ reject(err);
23728
+ }
23729
+ });
23730
+ });
23731
+ }
23732
+ getDatasetForSqlTemplate(dataset, datasetId, filters) {
23733
+ return new Promise((resolve, reject) => {
23734
+ const operator = (filters && filters.length !== 0) ? Object.keys(filters.operationFilter).map(key => ({ [key]: filters.operationFilter[key] })) : [];
23735
+ let requestAp = dataset.config.api;
23736
+ let request_params = {
23737
+ 'dbConfig': dataset.config.queryConfig.dbConfig,
23738
+ 'databaseName': dataset.config.queryConfig.databaseName,
23739
+ 'filters': this.transformDataForMFilterForSQl(operator, dataset.config.queryConfig.mapedFilters),
23740
+ 'templateQuery': dataset.config.queryConfig.templateQuery,
23741
+ 'enrichments': dataset.config.queryConfig.enrichments,
23742
+ };
23743
+ this.service.genericSqlQueryResponse(requestAp, request_params).subscribe({
23744
+ next: (data) => {
23745
+ const payload = data["Payload"] || data;
23746
+ this.uniqueDataSetObject[datasetId] = payload;
23747
+ resolve();
23748
+ },
23749
+ error: (err) => {
23750
+ console.error('Error:', err);
23751
+ this.toastr.error(err.message);
23752
+ reject(err);
23753
+ }
23754
+ });
23755
+ });
23756
+ }
23757
+ transformDataForMFilterForSQl(filterdata, mapData) {
23758
+ let result = [];
23759
+ mapData.forEach(mapping => {
23760
+ let resultObj = {
23761
+ columnName: mapping.serverColumn,
23762
+ dataType: mapping.dataType,
23763
+ operator: mapping.operatorName,
23764
+ value: mapping.defaultValue,
23765
+ aliasColumnName: mapping.localColumn,
23766
+ };
23767
+ if (mapping.serverColumn.includes('date') && typeof resultObj.value === 'string') {
23768
+ if (mapping.formatter && mapping.formatter !== "") {
23769
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(mapping.formatter);
23770
+ }
23771
+ else {
23772
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(this.environment.dataFormat);
23773
+ }
23774
+ }
23775
+ const filter = filterdata.find(f => f.hasOwnProperty(mapping.localColumn));
23776
+ if (filter) {
23777
+ if (mapping.defaultValue === "") {
23778
+ const value = filter[mapping.localColumn];
23779
+ if (Array.isArray(value)) {
23780
+ resultObj.operator = "in";
23781
+ resultObj.value = value.join(",");
23782
+ }
23783
+ else {
23784
+ resultObj.value = value;
23785
+ }
23786
+ if (mapping.serverColumn.includes('date') && typeof resultObj.value === 'string') {
23787
+ resultObj.value = moment$1(resultObj.value, "YYYY-MM-DD").format(this.environment.dataFormat);
23788
+ }
23789
+ }
23790
+ }
23791
+ else if (mapping.defaultValue === "") {
23792
+ return;
23793
+ }
23794
+ result.push(resultObj);
23795
+ });
23796
+ filterdata = filterdata.filter(obj => {
23797
+ const key = Object.keys(obj)[0];
23798
+ return key !== 'startDate' && key !== 'endDate';
23799
+ });
23800
+ filterdata.forEach(filter => {
23801
+ const filterKey = Object.keys(filter)[0];
23802
+ const existingMapping = mapData.find(mapping => mapping.localColumn === filterKey);
23803
+ if (!existingMapping) {
23804
+ let resultObj = {
23805
+ columnName: filterKey,
23806
+ dataType: "string",
23807
+ operator: "eq",
23808
+ value: filter[filterKey]
23809
+ };
23810
+ if (Array.isArray(filter[filterKey])) {
23811
+ resultObj.operator = "in";
23812
+ resultObj.value = filter[filterKey].join(",");
23813
+ }
23814
+ else {
23815
+ resultObj.value = filter[filterKey];
23816
+ }
23817
+ if (filterKey == 'operator_key') {
23818
+ resultObj.operator = "eq";
23819
+ }
23820
+ result.push(resultObj);
23821
+ }
23822
+ });
23823
+ return result;
23824
+ }
23825
+ getUniqueDataSetObject() {
23826
+ return this.uniqueDataSetObject;
23827
+ }
23828
+ }
23829
+ 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 });
23830
+ LandingMultiLayoutApplicationDatssetsCall.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LandingMultiLayoutApplicationDatssetsCall, providedIn: "root" });
23831
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LandingMultiLayoutApplicationDatssetsCall, decorators: [{
23832
+ type: Injectable,
23833
+ args: [{ providedIn: "root" }]
23834
+ }], ctorParameters: function () { return [{ type: LandingMultiLayoutComponentService }, { type: kpicommonService$2 }, { type: i3$1.ToastrService }, { type: undefined, decorators: [{
23835
+ type: Inject,
23836
+ args: [APP_ENVIRONMENT]
23837
+ }] }]; } });
23838
+
23839
+ const TOKEN_KEY = 'x-auth-token';
23840
+ class AppLandingMultiLayoutLocalStorage {
23841
+ constructor(environment) {
23842
+ this.environment = environment;
23843
+ }
23844
+ save(type, token) {
23845
+ window.localStorage[this.getAppVariableName(type)] = token;
23846
+ }
23847
+ get(type) {
23848
+ return window.localStorage[this.getAppVariableName(type)];
23849
+ }
23850
+ delete(type) {
23851
+ return window.localStorage.removeItem[this.getAppVariableName(type)];
23852
+ }
23853
+ destroy() {
23854
+ window.localStorage.removeItem(TOKEN_KEY);
23855
+ }
23856
+ getAppVariableName(attributeName) {
23857
+ return this.environment.appName + '__' + attributeName;
23858
+ }
23859
+ }
23860
+ AppLandingMultiLayoutLocalStorage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppLandingMultiLayoutLocalStorage, deps: [{ token: APP_ENVIRONMENT }], target: i0.ɵɵFactoryTarget.Injectable });
23861
+ AppLandingMultiLayoutLocalStorage.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppLandingMultiLayoutLocalStorage, providedIn: 'root' });
23862
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AppLandingMultiLayoutLocalStorage, decorators: [{
23863
+ type: Injectable,
23864
+ args: [{
23865
+ providedIn: 'root',
23866
+ }]
23867
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
23868
+ type: Inject,
23869
+ args: [APP_ENVIRONMENT]
23870
+ }] }]; } });
23871
+
23872
+ class MultiLayoutLandingComponentComponent {
23873
+ constructor(commonService, activatedRoute, viewContainerRef, componentFactoryResolver, service, toastr, router, datasetService, storage, cdr) {
23874
+ this.commonService = commonService;
23875
+ this.activatedRoute = activatedRoute;
23876
+ this.viewContainerRef = viewContainerRef;
23877
+ this.componentFactoryResolver = componentFactoryResolver;
23878
+ this.service = service;
23879
+ this.toastr = toastr;
23880
+ this.router = router;
23881
+ this.datasetService = datasetService;
23882
+ this.storage = storage;
23883
+ this.cdr = cdr;
23884
+ this.dashbord_container = [];
23885
+ this.widget_width = ['w-full', 'w-1/2', 'w-1/3', 'w-1/4', 'w-1/5', 'w-1/6'];
23886
+ this.page_title = 'Dashboard';
23887
+ this.dynamicComponentRefs = [];
23888
+ this.componentClassMap = {
23889
+ GammaAdvanceChartComponent,
23890
+ GammaTodayPreviousComponent,
23891
+ AppAdvanceHeaderComponent,
23892
+ GammaTableWithPercentageComponent,
23893
+ GammSingleNumberCardComponent,
23894
+ GammaAdvanceOperatorTableComponent,
23895
+ AdvanceWidgetHeaderFilterComponent,
23896
+ GammaGeoChartComponent,
23897
+ GammaHeatChartComponent
23898
+ };
23899
+ this.dataSourceMataData = [];
23900
+ this.queryType = "mongo";
23901
+ this.dataSetModal = [];
23902
+ this.componentConfigDataSource = [];
23903
+ this.dataSourceModal = {};
23904
+ this.isDashBoardContent = false;
23905
+ this.selectedViewFormComponent = {};
23906
+ this.addedwidGetConfig = {
23907
+ "display": true,
23908
+ "widgetTitle": "",
23909
+ "width": "",
23910
+ "height": ""
23911
+ };
23912
+ this.dashBoardWidgetConfig = [];
23913
+ this.selectedIndexObjForChart = {};
23914
+ this.selectedContainerObjectForChart = {};
23915
+ this.uniqueDataSetObject = {};
23916
+ this.isDashBoardContentTypeView = true;
23917
+ this.allWidgetByDataset = [];
23918
+ this.stateDataSource = new Map();
23919
+ this.contextMenuDataSource = [];
23920
+ this.havingDataObject = {};
23921
+ this.globalDefaultFilter = {};
23922
+ this.defaultViewIds = [];
23923
+ this.defaultViewIdsOnPageRefresh = [];
23924
+ this.defaultMatchedFilters = { operationFilter: { startDate: "", endDate: "" } };
23925
+ this.isDefaultFilterParams = false;
23926
+ }
23927
+ ngOnInit() {
23928
+ this.loadingModal = true;
23929
+ this.pageId = this.activatedRoute.snapshot.queryParams['pageId'];
23930
+ this.getPadeDataSource(false);
23931
+ }
23932
+ async getFiltersForTemplate(filter) {
23933
+ this.filters = filter;
23934
+ filter.operationFilter['startDate'] = filter.startDate;
23935
+ filter.operationFilter['endDate'] = filter.endDate;
23936
+ this.loadingModal = true;
23937
+ if (filter.filterObjects && Object.entries(filter.filterObjects).length !== 0) {
23938
+ if (Array.isArray(this.dashBoardWidgetConfig.widgets)) {
23939
+ const index = this.dashBoardWidgetConfig.widgets.findIndex((widget) => widget.widgetId === filter.filterObjects.widgetId);
23940
+ if (index !== -1) {
23941
+ this.dashBoardWidgetConfig.widgets[index] = filter.filterObjects;
23942
+ }
23943
+ else {
23944
+ }
23945
+ }
23946
+ }
23947
+ else {
23948
+ await this.getPadeDataSource(true);
23949
+ }
23950
+ this.uniqueDataSetObject = {};
23951
+ let apiCalls = [];
23952
+ this.allWidgetByDataset.forEach(view => {
23953
+ view.datasetIds.forEach(id => {
23954
+ if (view.widgetId == filter.filterObjects.widgetId) {
23955
+ let found = this.dataSetModal.find(d => d.datasetId === id);
23956
+ let widgetFilter = this.getWidgetFilterItems(filter.filterObjects.filters.filterItems);
23957
+ view.filters = widgetFilter;
23958
+ if (found) {
23959
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, id, widgetFilter));
23960
+ }
23961
+ }
23962
+ });
23963
+ });
23964
+ Promise.all(apiCalls).then(() => {
23965
+ this.globalDefaultFilter = filter;
23966
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
23967
+ this.createDivElements(this.uniqueDataSetObject, true);
23968
+ this.cdr.detectChanges();
23969
+ this.loadingModal = false;
23970
+ });
23971
+ }
23972
+ getWidgetFilterItems(widgetFilterData) {
23973
+ let apiJsonObject = {};
23974
+ apiJsonObject['operationFilter'] = {};
23975
+ widgetFilterData.forEach(element => {
23976
+ if (element.filterType == 'date' || element.filterType == 'datetime') {
23977
+ apiJsonObject['operationFilter'][element.apiName] = moment$1(element.filterDataSourceValue).format(element.momentFormat);
23978
+ }
23979
+ else {
23980
+ if ((typeof element.filterDataSourceValue === "string" && element.filterDataSourceValue !== "") ||
23981
+ (Array.isArray(element.filterDataSourceValue) && element.filterDataSourceValue.length > 0)) {
23982
+ if (element.operatorName !== "") {
23983
+ if (element.filterType == "content") {
23984
+ apiJsonObject['operationFilter'][element.operatorName] = element.filterDataSourceValue;
23985
+ }
23986
+ if (element.filterType == "single") {
23987
+ apiJsonObject['operationFilter'][element.operatorName] = element.filterDataSourceValue;
23988
+ }
23989
+ else {
23990
+ apiJsonObject['operationFilter'][element.operatorName] = Array.isArray(element.filterDataSourceValue) ? element.filterDataSourceValue : [element.filterDataSourceValue];
23991
+ }
23992
+ }
23993
+ else {
23994
+ apiJsonObject[element.apiName] = element.filterDataSourceValue;
23995
+ }
23996
+ }
23997
+ }
23998
+ });
23999
+ return apiJsonObject;
24000
+ }
24001
+ getPadeDataSource(context) {
24002
+ return new Promise((resolve, reject) => {
24003
+ this.service.getAppPageDetailConfig(this.pageId).subscribe({
24004
+ next: (data) => {
24005
+ this.pageTitle = data.pageName;
24006
+ this.dashBoardWidgetConfig = data;
24007
+ if (!context) {
24008
+ if (Object.keys(this.uniqueDataSetObject).length != 0) {
24009
+ this.createDivElements(this.uniqueDataSetObject, false);
24010
+ }
24011
+ this.getComponentConfigSet();
24012
+ }
24013
+ resolve();
24014
+ },
24015
+ error: (err) => {
24016
+ this.toastr.error('Unexpected Server Exception. Please contact System Admin.', 'Error');
24017
+ reject(err);
24018
+ }
24019
+ });
24020
+ });
24021
+ }
24022
+ getPadeDataSourceByfilet(context, widgetObject) {
24023
+ return new Promise((resolve, reject) => {
24024
+ this.service.getAppPageDetailConfig(this.pageId).subscribe({
24025
+ next: (data) => {
24026
+ this.pageTitle = data.pageName;
24027
+ if (Array.isArray(data.widgets)) {
24028
+ const index = data.widgets.findIndex((widget) => widget.widgetId === widgetObject.widgetId);
24029
+ if (index !== -1) {
24030
+ data.widgets[index] = widgetObject;
24031
+ }
24032
+ else {
24033
+ }
24034
+ }
24035
+ this.dashBoardWidgetConfig = data;
24036
+ if (!context) {
24037
+ if (Object.keys(this.uniqueDataSetObject).length !== 0) {
24038
+ this.createDivElements(this.uniqueDataSetObject, false);
24039
+ }
24040
+ this.getComponentConfigSet();
24041
+ }
24042
+ resolve();
24043
+ },
24044
+ error: (err) => {
24045
+ this.toastr.error('Unexpected Server Exception. Please contact System Admin.', 'Error');
24046
+ reject(err);
24047
+ }
24048
+ });
24049
+ });
24050
+ }
24051
+ getComponentConfigSet() {
24052
+ let dataset = this.service.getAppDatasetConfigs();
24053
+ let viewComponent = this.service.getAppViewConfigs();
24054
+ this.defaultViewIds = [];
24055
+ forkJoin({
24056
+ datasetConfig: dataset,
24057
+ viewConfig: viewComponent
24058
+ }).subscribe({
24059
+ next: (({ datasetConfig, viewConfig }) => {
24060
+ this.componentConfigDataSource = viewConfig;
24061
+ this.dataSetModal = datasetConfig;
24062
+ this.allWidgetByDataset = [];
24063
+ const { pageId, startDate, endDate, ...params } = this.activatedRoute.snapshot.queryParams;
24064
+ let defaultFilters = { operationFilter: { startDate: "", endDate: "", ...params } };
24065
+ this.dashBoardWidgetConfig.widgets.forEach(widget => {
24066
+ widget.filters.filterItems.forEach(element => {
24067
+ if (element.filterType === 'date' || element.filterType === 'datetime') {
24068
+ if (element.defaultFilterType === "dynamic" && element.momentFunction !== "" && element.defaultFilterValue !== "" && element.momentFormat !== "") {
24069
+ if (element.momentFunction == "monthPicker") {
24070
+ let [count, unit] = element.defaultFilterValue.split(',');
24071
+ if (element.apiName === "endDate") {
24072
+ if (element.display) {
24073
+ defaultFilters.operationFilter.endDate = (endDate && endDate !== '') ? endDate : moment$1().subtract(parseInt(count), unit).endOf(unit).format(element.momentFormat);
24074
+ this.defaultEndDate = moment$1().subtract(parseInt(count), unit).endOf(unit).format(element.momentFormat);
24075
+ }
24076
+ }
24077
+ if (element.apiName === "startDate") {
24078
+ defaultFilters.operationFilter.startDate = (startDate && startDate !== '') ? startDate : moment$1().subtract(parseInt(count), unit).startOf(unit).format(element.momentFormat);
24079
+ ;
24080
+ }
24081
+ }
24082
+ else if (element.momentFunction == "weekPicker") {
24083
+ if (element.apiName === "endDate") {
24084
+ if (element.display) {
24085
+ defaultFilters.operationFilter.endDate = (endDate && endDate !== '') ? endDate : moment$1().endOf('week').format(element.momentFormat);
24086
+ this.defaultEndDate = moment$1().endOf('week').format(element.momentFormat);
24087
+ }
24088
+ }
24089
+ if (element.apiName === "startDate") {
24090
+ defaultFilters.operationFilter.startDate = (startDate && startDate !== '') ? startDate : moment$1().startOf('week').format(element.momentFormat);
24091
+ this.defaultStartDate = moment$1().startOf('week').format(element.momentFormat);
24092
+ }
24093
+ }
24094
+ else {
24095
+ let [count, unit] = element.defaultFilterValue.split(',');
24096
+ if (element.apiName === "endDate") {
24097
+ if (element.display) {
24098
+ defaultFilters.operationFilter.endDate = (endDate && endDate !== '') ? endDate : moment$1()[element.momentFunction](parseInt(count), unit).format(element.momentFormat);
24099
+ this.defaultEndDate = moment$1()[element.momentFunction](parseInt(count), unit).format(element.momentFormat);
24100
+ }
24101
+ }
24102
+ if (element.apiName === "startDate") {
24103
+ defaultFilters.operationFilter.startDate = (startDate && startDate !== '') ? startDate : moment$1()[element.momentFunction](parseInt(count), unit).format(element.momentFormat);
24104
+ this.defaultStartDate = moment$1()[element.momentFunction](parseInt(count), unit).format(element.momentFormat);
24105
+ }
24106
+ }
24107
+ }
24108
+ else if (element.defaultFilterType === "static" && element.defaultFilterValue !== "") {
24109
+ if (element.apiName === "endDate") {
24110
+ if (element.display) {
24111
+ defaultFilters.operationFilter.endDate = element.defaultFilterValue;
24112
+ this.defaultEndDate = element.defaultFilterValue;
24113
+ }
24114
+ }
24115
+ if (element.apiName === "startDate") {
24116
+ defaultFilters.operationFilter.startDate = element.defaultFilterValue;
24117
+ this.defaultStartDate = element.defaultFilterValue;
24118
+ }
24119
+ }
24120
+ }
24121
+ else {
24122
+ if ((typeof element.filterDataSourceValue === "string" && element.filterDataSourceValue !== "") ||
24123
+ (Array.isArray(element.filterDataSourceValue) && element.filterDataSourceValue.length > 0)) {
24124
+ if (element.operatorName !== "") {
24125
+ defaultFilters.operationFilter[element.operatorName] = Array.isArray(element.filterDataSourceValue)
24126
+ ? element.filterDataSourceValue
24127
+ : [element.filterDataSourceValue];
24128
+ }
24129
+ else {
24130
+ defaultFilters.operationFilter[element.apiName] = element.filterDataSourceValue.join(",");
24131
+ }
24132
+ }
24133
+ }
24134
+ });
24135
+ let datasetIds = new Set();
24136
+ let viewIds = new Set();
24137
+ let datasetIdsSet = new Set();
24138
+ widget.widgetNode.forEach(node => {
24139
+ if (node.nodeProperties.display) {
24140
+ node.compConfig.viewConfig.forEach(view => {
24141
+ this.defaultViewIds.push(view.viewId);
24142
+ const foundObject = this.defaultViewIdsOnPageRefresh?.find(item => item.viewId === view.viewId);
24143
+ const derivedFilters = foundObject ? this.getDrildownFilter(foundObject, defaultFilters) : defaultFilters;
24144
+ let obj = {
24145
+ "filters": JSON.parse(JSON.stringify(derivedFilters)),
24146
+ "keyToPass": [],
24147
+ "drillDownType": "natural",
24148
+ "drilldownFrom": ""
24149
+ };
24150
+ this.stateDataSource.set(view.viewId, obj);
24151
+ let node = {
24152
+ datasetId: view.datasetId,
24153
+ viewId: view.viewId,
24154
+ filter: derivedFilters
24155
+ };
24156
+ datasetIdsSet.add(view.datasetId);
24157
+ datasetIds.add(node);
24158
+ viewIds.add(view.viewId);
24159
+ });
24160
+ }
24161
+ else {
24162
+ node.compConfig.viewConfig.forEach(view => {
24163
+ this.contextMenuDataSource.push({ viewId: view.viewId, viewName: node.nodeProperties.widgetTitle, displayKey: view.kpiConfig.keyToPass });
24164
+ });
24165
+ }
24166
+ });
24167
+ if (this.defaultViewIdsOnPageRefresh?.length) {
24168
+ const newViews = this.defaultViewIdsOnPageRefresh.map(item => item.viewId);
24169
+ this.defaultViewIds = [...this.defaultViewIds, ...newViews.filter(item => !this.defaultViewIds.includes(item))];
24170
+ }
24171
+ let uniquedatasetIds = Array.from(datasetIdsSet);
24172
+ let obj = {
24173
+ widgetId: widget.widgetId,
24174
+ pageId: widget.pageId,
24175
+ filters: defaultFilters,
24176
+ datasetIds: uniquedatasetIds
24177
+ };
24178
+ this.allWidgetByDataset.push(obj);
24179
+ });
24180
+ this.uniqueDataSetObject = {};
24181
+ let apiCalls = [];
24182
+ this.allWidgetByDataset.forEach(view => {
24183
+ view.datasetIds.forEach(id => {
24184
+ let found = datasetConfig.find(d => d.datasetId === id);
24185
+ if (found) {
24186
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, id, view.filters));
24187
+ }
24188
+ });
24189
+ });
24190
+ Promise.all(apiCalls).then(() => {
24191
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24192
+ this.createDivElements(this.uniqueDataSetObject, false);
24193
+ this.loadingModal = false;
24194
+ let urlParams = defaultFilters.operationFilter;
24195
+ urlParams['pageId'] = this.pageId;
24196
+ });
24197
+ }), error: (err) => {
24198
+ this.loadingModal = false;
24199
+ this.toastr.error('Unexpected Server Exception. Please contact System Admin.', 'Error');
24200
+ }
24201
+ });
24202
+ }
24203
+ getDataSet() {
24204
+ this.service.getAppDatasetConfigs().subscribe({
24205
+ next: (data) => {
24206
+ this.dataSettableDataSource = data;
24207
+ }, error: (err) => {
24208
+ this.toastr.error('Unexpected Server Exception. Please contact System Admin.', 'Dataset Creation');
24209
+ }
24210
+ });
24211
+ }
24212
+ async createDivElements(datasetById, context) {
24213
+ const container = this.dynamicContainer.nativeElement;
24214
+ container.innerHTML = "";
24215
+ const context_filter = this.dashBoardWidgetConfig.filters ? this.dashBoardWidgetConfig.filters.filterItems : null;
24216
+ this.dashBoardWidgetConfig.widgets.forEach(async (div) => {
24217
+ const rowDiv = document.createElement('div');
24218
+ let w_height = (div.widgetProperties.height == "") ? "h-auto" : 'h-[' + div.widgetProperties.height + ']';
24219
+ rowDiv.classList.add(div.widgetProperties.width, w_height);
24220
+ const filterDiv = document.createElement('div');
24221
+ const filterItems = (div.filters) ? div.filters.filterItems : [];
24222
+ this.loadFilterComponent(div, filterDiv, filterItems, context_filter);
24223
+ rowDiv.appendChild(filterDiv);
24224
+ if (div.widgetNode.length != 0) {
24225
+ let mainItemDiv = rowDiv.querySelector('.flex.flex-wrap');
24226
+ if (context && mainItemDiv) {
24227
+ mainItemDiv.innerHTML = "";
24228
+ }
24229
+ else {
24230
+ mainItemDiv = document.createElement('div');
24231
+ mainItemDiv.classList.add("flex", "flex-wrap");
24232
+ rowDiv.appendChild(mainItemDiv);
24233
+ }
24234
+ this.loadWidgetNodes(div, mainItemDiv, datasetById);
24235
+ }
24236
+ container.appendChild(rowDiv);
24237
+ });
24238
+ }
24239
+ loadWidgetNodes(div, mainItemDiv, datasetById) {
24240
+ this.mainPageDivElement = mainItemDiv;
24241
+ div.widgetNode.forEach(item => {
24242
+ this.loadSingleWidgetNode(item, mainItemDiv, datasetById);
24243
+ });
24244
+ }
24245
+ loadSingleWidgetNode(item, containerElement, datasetById) {
24246
+ const elementId = `id-${item.id}`;
24247
+ const existingElement = document.querySelector(`#${elementId}`);
24248
+ if (item.nodeProperties.display && !existingElement) {
24249
+ const w_height = item.nodeProperties.height === "" ? "h-auto" : `h-[${item.nodeProperties.height}]`;
24250
+ const itemDiv = document.createElement('div');
24251
+ itemDiv.id = elementId;
24252
+ itemDiv.classList.add(item.nodeProperties.width, w_height, 'mb-2');
24253
+ if (item.nodeProperties.widgetTitle !== "") {
24254
+ const widgetDiv = this.getWidgetTitleDiv(item);
24255
+ itemDiv.appendChild(widgetDiv);
24256
+ }
24257
+ const innerDiv = document.createElement('div');
24258
+ innerDiv.classList.add('rounded', 'justify-center', 'items-center', 'border', 'p-1', 'm-1', 'flex', 'flex-row');
24259
+ item.compConfig.viewConfig.forEach(element => {
24260
+ element.kpiConfig['dataSource'] = datasetById[element.datasetId];
24261
+ element.kpiConfig['contextMenu'] = this.contextMenuDataSource;
24262
+ element['titleParams'] = item.nodeProperties.widgetParams || "";
24263
+ const comp_object = this.findWidgetById(this.dashBoardWidgetConfig.widgets, item.id);
24264
+ this.loadDynamicComponent(element, comp_object, itemDiv);
24265
+ });
24266
+ containerElement.appendChild(itemDiv);
24267
+ if (!this.isDashBoardContentTypeView) {
24268
+ itemDiv.appendChild(innerDiv);
24269
+ }
24270
+ }
24271
+ else if (existingElement) {
24272
+ const itemDiv = existingElement;
24273
+ itemDiv.innerHTML = '';
24274
+ if (item.nodeProperties.widgetTitle !== "") {
24275
+ const widgetDiv = this.getWidgetTitleDiv(item);
24276
+ itemDiv.appendChild(widgetDiv);
24277
+ }
24278
+ item.compConfig.viewConfig.forEach(element => {
24279
+ element.kpiConfig['dataSource'] = datasetById[element.datasetId];
24280
+ element.kpiConfig['contextMenu'] = this.contextMenuDataSource;
24281
+ element['titleParams'] = item.nodeProperties.widgetParams || "";
24282
+ const comp_object = this.findWidgetById(this.dashBoardWidgetConfig.widgets, item.id);
24283
+ this.loadDynamicComponent(element, comp_object, itemDiv);
24284
+ });
24285
+ if (!this.isDashBoardContentTypeView) {
24286
+ const innerDiv = document.createElement('div');
24287
+ innerDiv.classList.add('rounded', 'justify-center', 'items-center', 'border', 'p-1', 'm-1', 'flex', 'flex-row');
24288
+ itemDiv.appendChild(innerDiv);
24289
+ }
24290
+ }
24291
+ }
24292
+ getWidgetTitleDiv(item) {
24293
+ const widgetDiv = document.createElement('div');
24294
+ 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');
24295
+ const titleDiv = document.createElement('div');
24296
+ titleDiv.classList.add('relative', 'group');
24297
+ let params = "";
24298
+ if (!item.nodeProperties.widgetParams && this.defaultViewIdsOnPageRefresh?.length) {
24299
+ params = this.getTitleParams(item) || "";
24300
+ }
24301
+ else {
24302
+ params = item.nodeProperties.widgetParams || "";
24303
+ }
24304
+ const widgetTitle = item.nodeProperties.widgetTitle;
24305
+ const tooltipMatch = widgetTitle.match(/\$t\{([\s\S]*?)\}/);
24306
+ const displayTitle = widgetTitle.replace(/\$t\{[\s\S]*?\}/g, '').trim();
24307
+ titleDiv.innerText = displayTitle + params;
24308
+ if (tooltipMatch) {
24309
+ const tooltipContent = tooltipMatch[1].trim();
24310
+ const tooltipDiv = document.createElement('div');
24311
+ 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');
24312
+ tooltipDiv.innerHTML = tooltipContent;
24313
+ titleDiv.appendChild(tooltipDiv);
24314
+ }
24315
+ widgetDiv.appendChild(titleDiv);
24316
+ const searchContainerDiv = document.createElement('div');
24317
+ searchContainerDiv.classList.add('flex', 'items-center', 'ml-auto', 'space-x-2', 'justify-end');
24318
+ if (item.nodeProperties.isWidgetFilter) {
24319
+ const searchButton = document.createElement('button');
24320
+ searchButton.innerText = 'Filter';
24321
+ searchButton.classList.add('px-3', 'py-1.5', 'bg-blue-600', 'mr-2', 'text-white', 'rounded', 'hover:bg-blue-700');
24322
+ this.nodeproperticeFilterDataSource = {};
24323
+ this.nodeproperticeFilterDataSource['viewConfig'] = item;
24324
+ this.nodeproperticeFilterDataSource['havingConfig'] = [];
24325
+ searchButton.addEventListener('click', () => {
24326
+ this.isWidgetFilters = true;
24327
+ let filtePropertice = [];
24328
+ item.compConfig.viewConfig.forEach(element => {
24329
+ let key_name = this.uniqueDataSetObject[element.datasetId][0];
24330
+ Object.keys(key_name).forEach(key => {
24331
+ if (!filtePropertice.includes(key)) {
24332
+ filtePropertice.push(key);
24333
+ }
24334
+ });
24335
+ });
24336
+ filtePropertice.forEach(element => {
24337
+ let obj = {
24338
+ columnName: element,
24339
+ dataType: "float",
24340
+ operator: "",
24341
+ value: "",
24342
+ };
24343
+ this.nodeproperticeFilterDataSource.havingConfig.push(obj);
24344
+ });
24345
+ });
24346
+ searchContainerDiv.appendChild(searchButton);
24347
+ }
24348
+ if (item.filterId) {
24349
+ this.nodeproperticeFilterDataSource = {};
24350
+ this.nodeproperticeFilterDataSource['viewConfig'] = item;
24351
+ this.nodeproperticeFilterDataSource['havingConfig'] = [];
24352
+ this.service.getAppFilterConfig(item.filterId).subscribe({
24353
+ next: (data) => {
24354
+ const filterDiv = document.createElement('div');
24355
+ this.loadWidgetFilterComponent(item, widgetDiv, data.filterItems, item);
24356
+ }, error: (err) => {
24357
+ }
24358
+ });
24359
+ }
24360
+ if (item.nodeProperties.nodefilters && item.nodeProperties.nodefilters.length !== 0) {
24361
+ item.nodeProperties.nodefilters.forEach(filter => {
24362
+ const filterDiv = document.createElement('div');
24363
+ filterDiv.classList.add('flex', 'items-center');
24364
+ if (filter.input_type === 'text') {
24365
+ const textBox = document.createElement('input');
24366
+ textBox.type = 'text';
24367
+ textBox.placeholder = `Enter ${filter.local_column}`;
24368
+ 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');
24369
+ const searchButton = document.createElement('button');
24370
+ searchButton.innerText = 'Search';
24371
+ searchButton.classList.add('px-3', 'py-1.5', 'bg-blue-600', 'mr-2', 'text-white', 'rounded', 'hover:bg-blue-700');
24372
+ const separerotButton = document.createElement('div');
24373
+ separerotButton.innerHTML = '|';
24374
+ searchButton.addEventListener('click', () => {
24375
+ const searchTerm = textBox.value;
24376
+ this.getRearchResultFromInputBox(searchTerm, item, filter);
24377
+ });
24378
+ filterDiv.appendChild(textBox);
24379
+ filterDiv.appendChild(searchButton);
24380
+ filterDiv.appendChild(separerotButton);
24381
+ }
24382
+ searchContainerDiv.appendChild(filterDiv);
24383
+ });
24384
+ }
24385
+ widgetDiv.appendChild(searchContainerDiv);
24386
+ return widgetDiv;
24387
+ }
24388
+ loadDynamicComponent(data, indexObj, containerElement) {
24389
+ const componentClass = this.componentClassMap[data.kpiConfig.componentName];
24390
+ this.CompRefs = this.viewContainerRef.createComponent(componentClass);
24391
+ const dynamicComponentInstance = this.CompRefs.instance;
24392
+ dynamicComponentInstance.chartDataSource = data;
24393
+ dynamicComponentInstance.kpi_name = "";
24394
+ if (data.kpiConfig.componentName == "GammaAdvanceOperatorTableComponent" || data.kpiConfig.componentName == "GammaTableWithPercentageComponent") {
24395
+ dynamicComponentInstance.oRowClick.subscribe((value) => {
24396
+ this.getRowClick(value);
24397
+ });
24398
+ dynamicComponentInstance.onrightClickContextSelection.subscribe((value) => {
24399
+ this.getContextClick(value);
24400
+ });
24401
+ }
24402
+ else if (data.kpiConfig.componentName == "GammaAdvanceChartComponent") {
24403
+ dynamicComponentInstance.onChartPointClick.subscribe((value) => {
24404
+ this.getRowClick(value);
24405
+ });
24406
+ }
24407
+ const cssClass = "w-full";
24408
+ this.CompRefs.location.nativeElement.classList.add(cssClass);
24409
+ containerElement.appendChild(this.CompRefs.location.nativeElement);
24410
+ }
24411
+ loadFilterComponent(indexObj, containerElement, filterItems, context_filter) {
24412
+ let userName = this.storage.get('user_name');
24413
+ console.log(this.allWidgetByDataset, "allWidgetByDataset");
24414
+ let selectedDates = {};
24415
+ this.allWidgetByDataset.forEach(view => {
24416
+ if (view.widgetId == indexObj.widgetId) {
24417
+ selectedDates = { startDate: view.filters.operationFilter['startDate'], endDate: view.filters.operationFilter['endDate'] };
24418
+ }
24419
+ });
24420
+ debugger;
24421
+ const componentClass = this.componentClassMap['AppAdvanceHeaderComponent'];
24422
+ this.CompRefs = this.viewContainerRef.createComponent(componentClass);
24423
+ const dynamicComponentInstance = this.CompRefs.instance;
24424
+ dynamicComponentInstance.selectedDates = selectedDates;
24425
+ dynamicComponentInstance.filterItems = filterItems;
24426
+ dynamicComponentInstance.filterObjects = indexObj;
24427
+ dynamicComponentInstance.contextFilterItems = context_filter;
24428
+ dynamicComponentInstance.pageTitle = indexObj.widgetName;
24429
+ dynamicComponentInstance.bread_crumbs_container = this.kpi_breadcrumbs_container;
24430
+ dynamicComponentInstance.isEditButton = (userName && userName == "admin") ? true : false;
24431
+ dynamicComponentInstance.isAdvanceButton = true;
24432
+ dynamicComponentInstance.getFilterPageConfig.subscribe((value) => {
24433
+ this.getFiltersForTemplate(value);
24434
+ });
24435
+ dynamicComponentInstance.getOperatorName.subscribe((value) => {
24436
+ this.loadDataByOperator(value);
24437
+ });
24438
+ dynamicComponentInstance.getContextFilterData.subscribe((value) => {
24439
+ this.getContextFilterData(value);
24440
+ });
24441
+ indexObj.compConfig.dynamicComponentRefs.push(this.CompRefs);
24442
+ const cssClass = "w-full";
24443
+ this.CompRefs.location.nativeElement.classList.add(cssClass);
24444
+ containerElement.appendChild(this.CompRefs.location.nativeElement);
24445
+ }
24446
+ loadWidgetFilterComponent(indexObj, containerElement, filterItems, viewIds) {
24447
+ let selectedDates = { startDate: this.defaultStartDate, endDate: this.defaultEndDate };
24448
+ const componentClass = this.componentClassMap['AdvanceWidgetHeaderFilterComponent'];
24449
+ this.CompRefs = this.viewContainerRef.createComponent(componentClass);
24450
+ const dynamicComponentInstance = this.CompRefs.instance;
24451
+ dynamicComponentInstance.selectedDates = selectedDates;
24452
+ dynamicComponentInstance.filterItems = filterItems;
24453
+ dynamicComponentInstance.viewIds = viewIds;
24454
+ dynamicComponentInstance.getWidgetFilterConfig.subscribe((value) => {
24455
+ this.getWidgetFilterForTemplate(value);
24456
+ });
24457
+ indexObj.compConfig.dynamicComponentRefs.push(this.CompRefs);
24458
+ containerElement.appendChild(this.CompRefs.location.nativeElement);
24459
+ }
24460
+ getContextClick(event) {
24461
+ const stateData = Array.from(this.stateDataSource.keys());
24462
+ const currentViewIndex = stateData.indexOf(event.viewId);
24463
+ const deletedViewIds = [];
24464
+ for (let i = currentViewIndex + 1; i < stateData.length; i++) {
24465
+ deletedViewIds.push(stateData[i]);
24466
+ }
24467
+ this.loadingModal = true;
24468
+ this.dashBoardWidgetConfig.widgets.forEach(element => {
24469
+ element.widgetNode.forEach((node, nodeIndex) => {
24470
+ if (this.getElementOfCurrentView(node, event.drilldownTo)) {
24471
+ let view = element.widgetNode[nodeIndex];
24472
+ let apiCalls = [];
24473
+ let chatApiCall = [];
24474
+ let appliedFilters = this.getSetOperatorFilter(event, this.stateDataSource.get(event.drilldownFrom));
24475
+ view.compConfig.viewConfig.forEach(contentView => {
24476
+ let found = this.dataSetModal.find(d => d.datasetId === contentView.datasetId);
24477
+ if (found) {
24478
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, contentView.datasetId, appliedFilters));
24479
+ }
24480
+ });
24481
+ Promise.all(apiCalls).then(() => {
24482
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24483
+ for (let entry of deletedViewIds) {
24484
+ element.widgetNode.forEach(viewValue => {
24485
+ viewValue.compConfig.viewConfig.forEach(viewId => {
24486
+ if (viewId.viewId == entry) {
24487
+ const exists = this.contextMenuDataSource.some(item => item.viewId === viewId.viewId);
24488
+ if (!exists) {
24489
+ this.contextMenuDataSource.push({
24490
+ viewId: viewId.viewId,
24491
+ viewName: node.nodeProperties.widgetTitle,
24492
+ displayKey: viewId.kpiConfig.keyToPass
24493
+ });
24494
+ }
24495
+ const startData = this.stateDataSource.get(entry);
24496
+ if (startData) {
24497
+ this.stateDataSource.delete(entry);
24498
+ }
24499
+ viewValue.nodeProperties['display'] = false;
24500
+ const prefixedId = `id-${viewValue.id}`;
24501
+ const elementToHide = document.querySelector(`#${prefixedId}`);
24502
+ if (elementToHide) {
24503
+ elementToHide.remove();
24504
+ }
24505
+ }
24506
+ });
24507
+ });
24508
+ }
24509
+ this.contextMenuDataSource = this.contextMenuDataSource.filter(e => e.displayKey !== event.keyToPass);
24510
+ view.compConfig.viewConfig.forEach(val => {
24511
+ let obj = {
24512
+ "filters": appliedFilters,
24513
+ "keyToPass": this.updateOperatorData(event.keyToPass, event.data),
24514
+ "drillDownType": event.drillDownType,
24515
+ "drilldownFrom": event.drilldownFrom
24516
+ };
24517
+ this.stateDataSource.set(val['viewId'], obj);
24518
+ });
24519
+ view.nodeProperties['display'] = true;
24520
+ view.nodeProperties['widgetParams'] = event.tableTitle;
24521
+ const prefixedId = `id-${view.id}`;
24522
+ const containerElement = document.querySelector(`#${prefixedId}`);
24523
+ this.loadSingleWidgetNode(view, this.mainPageDivElement, this.uniqueDataSetObject);
24524
+ setTimeout(() => {
24525
+ this.scrollToBottom(this.mainPageDivElement);
24526
+ }, 200);
24527
+ });
24528
+ }
24529
+ else {
24530
+ }
24531
+ });
24532
+ });
24533
+ }
24534
+ async getRowClick(event) {
24535
+ const stateData = Array.from(this.stateDataSource.keys());
24536
+ const currentViewIndex = stateData.indexOf(event.viewId);
24537
+ const deletedViewIds = [];
24538
+ for (let i = currentViewIndex + 1; i < stateData.length; i++) {
24539
+ deletedViewIds.push(stateData[i]);
24540
+ }
24541
+ const hourlyNode = this.dashBoardWidgetConfig.widgets
24542
+ .map(widget => widget.widgetNode.find(node => this.getHourlyData(node)))
24543
+ .find(node => node);
24544
+ if (hourlyNode && event.keyToPass.includes("recordDate")) {
24545
+ this.getViewByRowCLickForHourlyChart(event, hourlyNode);
24546
+ }
24547
+ const currentViewNode = this.dashBoardWidgetConfig.widgets
24548
+ .map(widget => widget.widgetNode.find(node => this.getElementOfCurrentView(node, event.viewId)))
24549
+ .find(node => node);
24550
+ const queryParams = this.activatedRoute.snapshot.queryParamMap;
24551
+ if (currentViewNode) {
24552
+ const drildownsForCurrentView = [];
24553
+ const drildownsForCurrentPage = [];
24554
+ currentViewNode.compConfig.viewConfig.forEach(async (element) => {
24555
+ if (element.kpiConfig.viewProperties.enableClickEvent) {
24556
+ if (element.kpiConfig.viewProperties.clickEventOptions?.eventType !== undefined &&
24557
+ element.kpiConfig.viewProperties.clickEventOptions.eventType !== "") {
24558
+ let eventType = element.kpiConfig.viewProperties.clickEventOptions.eventType;
24559
+ let associatedViews = element.kpiConfig.viewProperties.clickEventOptions.associatedViews;
24560
+ let associatedPage = (element.kpiConfig.viewProperties.clickEventOptions.associatedPage) ? element.kpiConfig.viewProperties.clickEventOptions.associatedPage : "";
24561
+ let clickEventOptions = element.kpiConfig.viewProperties.clickEventOptions;
24562
+ if (eventType == 'optionalDrillDown') {
24563
+ if (associatedViews && associatedViews.length != 0) {
24564
+ for (let viewForDrillDown of associatedViews) {
24565
+ const filterCondition = new URLSearchParams(viewForDrillDown['filterCondition']);
24566
+ let matchFound = true;
24567
+ filterCondition.forEach((value, key) => {
24568
+ if (queryParams.get(key) !== value) {
24569
+ matchFound = false;
24570
+ }
24571
+ });
24572
+ if (matchFound) {
24573
+ viewForDrillDown['viewId'].forEach(viewForId => {
24574
+ drildownsForCurrentView.push(viewForId);
24575
+ });
24576
+ }
24577
+ }
24578
+ }
24579
+ }
24580
+ else if (eventType == 'drilldown' || eventType == 'popup') {
24581
+ for (let entry of associatedViews) {
24582
+ drildownsForCurrentView.push(entry);
24583
+ }
24584
+ }
24585
+ else if (eventType == 'navigateToPage') {
24586
+ this.service.getAppPageDetailConfig(associatedPage).subscribe({
24587
+ next: (data) => {
24588
+ let { pageId, ...params } = this.activatedRoute.snapshot.queryParams;
24589
+ let associatedParamsTemplate = clickEventOptions.associatedParams;
24590
+ let appliedFilters = this.getSetOperatorFilter(event, this.stateDataSource.get(event.viewId));
24591
+ event.keyToPass.forEach(element => {
24592
+ params[element] = event.data[element];
24593
+ });
24594
+ params['pageId'] = associatedPage;
24595
+ if (associatedParamsTemplate !== "") {
24596
+ let finalAssociatedParams = this.replaceAssociatedParams(associatedParamsTemplate, params, appliedFilters);
24597
+ const queryParams = {};
24598
+ finalAssociatedParams.split("&").forEach(pair => {
24599
+ const [key, value] = pair.split("=");
24600
+ queryParams[key] = value;
24601
+ });
24602
+ queryParams['pageId'] = params['pageId'];
24603
+ const fullUrl = this.router.serializeUrl(this.router.createUrlTree([data.pageUrl], { queryParams }));
24604
+ this.router.navigate([data.pageUrl], { queryParams });
24605
+ }
24606
+ else {
24607
+ const queryString = new URLSearchParams(params).toString();
24608
+ const fullUrl = this.router.serializeUrl(this.router.createUrlTree([data.pageUrl], { queryParams: params }));
24609
+ this.router.navigate([data.pageUrl], { queryParams });
24610
+ console.log(data);
24611
+ }
24612
+ }
24613
+ });
24614
+ }
24615
+ else if (eventType == 'sameViewDrilldown') {
24616
+ debugger;
24617
+ }
24618
+ if (drildownsForCurrentView.length != 0) {
24619
+ for (let viewIdForNext of drildownsForCurrentView) {
24620
+ const nextViewNode = this.dashBoardWidgetConfig.widgets
24621
+ .map(widget => widget.widgetNode.find(node => this.getElementOfCurrentView(node, viewIdForNext)))
24622
+ .find(node => node);
24623
+ if (eventType == 'popup') {
24624
+ this.loadingModal = true;
24625
+ await this.getModalViewByRowCLick(event, nextViewNode);
24626
+ }
24627
+ else {
24628
+ this.loadingModal = true;
24629
+ await this.getViewByRowCLick(event, nextViewNode);
24630
+ }
24631
+ }
24632
+ }
24633
+ }
24634
+ else {
24635
+ this.dashBoardWidgetConfig.widgets.forEach(element => {
24636
+ for (let entry of deletedViewIds) {
24637
+ element.widgetNode.forEach(viewValue => {
24638
+ viewValue.compConfig.viewConfig.forEach(viewId => {
24639
+ if (viewId.viewId == entry) {
24640
+ const exists = this.contextMenuDataSource.some(item => item.viewId === viewId.viewId);
24641
+ if (!exists) {
24642
+ this.contextMenuDataSource.push({
24643
+ viewId: viewId.viewId,
24644
+ viewName: currentViewNode.nodeProperties.widgetTitle,
24645
+ displayKey: viewId.kpiConfig.keyToPass
24646
+ });
24647
+ }
24648
+ const startData = this.stateDataSource.get(entry);
24649
+ if (startData) {
24650
+ this.stateDataSource.delete(entry);
24651
+ }
24652
+ viewValue.nodeProperties['display'] = false;
24653
+ const prefixedId = `id-${viewValue.id}`;
24654
+ const elementToHide = document.querySelector(`#${prefixedId}`);
24655
+ if (elementToHide) {
24656
+ elementToHide.remove();
24657
+ }
24658
+ }
24659
+ });
24660
+ });
24661
+ }
24662
+ });
24663
+ const nextViewIndex = stateData.indexOf(event.viewId) + 1;
24664
+ const nextView = this.dashBoardWidgetConfig.widgets
24665
+ .map(widget => widget.widgetNode[nextViewIndex])
24666
+ .find(node => node);
24667
+ if (nextView) {
24668
+ this.loadingModal = true;
24669
+ await this.getViewByRowCLick(event, nextView);
24670
+ }
24671
+ }
24672
+ }
24673
+ });
24674
+ }
24675
+ }
24676
+ getViewByRowCLickForHourlyChart(event, node) {
24677
+ let apiCalls = [];
24678
+ const deletedViewIds = [];
24679
+ node.compConfig.viewConfig.forEach(item => {
24680
+ let appliedFilters = this.getSetOperatorFilter(event, this.stateDataSource.get(item.viewId));
24681
+ let found = this.dataSetModal.find(d => d.datasetId === item.datasetId);
24682
+ deletedViewIds.push(item.viewId);
24683
+ if (found) {
24684
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, item.datasetId, appliedFilters));
24685
+ }
24686
+ });
24687
+ Promise.all(apiCalls).then(() => {
24688
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24689
+ this.loadSingleWidgetNode(node, this.mainPageDivElement, this.uniqueDataSetObject);
24690
+ setTimeout(() => {
24691
+ this.scrollToBottom(this.mainPageDivElement);
24692
+ }, 200);
24693
+ });
24694
+ }
24695
+ async getModalViewByRowCLick(event, view) {
24696
+ let apiCalls = [];
24697
+ let appliedFilters = this.getSetOperatorFilter(event, this.stateDataSource.get(event.viewId));
24698
+ view.compConfig.viewConfig.forEach(contentView => {
24699
+ let found = this.dataSetModal.find(d => d.datasetId === contentView.datasetId);
24700
+ if (found) {
24701
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, contentView.datasetId, appliedFilters));
24702
+ }
24703
+ });
24704
+ await Promise.all(apiCalls);
24705
+ this.contextMenuDataSource = this.contextMenuDataSource.filter(e => e.displayKey !== event.keyToPass);
24706
+ view.compConfig.viewConfig.forEach(viewforDataSet => {
24707
+ let obj = {
24708
+ "filters": appliedFilters,
24709
+ "keyToPass": this.updateOperatorData(event.keyToPass, event.data),
24710
+ "drillDownType": event.drillDownType,
24711
+ "drilldownFrom": event.drilldownFrom
24712
+ };
24713
+ this.stateDataSource.set(viewforDataSet['viewId'], obj);
24714
+ });
24715
+ view.nodeProperties['display'] = true;
24716
+ view.nodeProperties['widgetParams'] = event.tableTitle;
24717
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24718
+ this.modalConfigs = {
24719
+ view: view,
24720
+ datasource: this.uniqueDataSetObject
24721
+ };
24722
+ setTimeout(() => {
24723
+ this.loadingModal = false;
24724
+ this.isPopupView = true;
24725
+ }, 200);
24726
+ }
24727
+ async getViewByRowCLick(event, view) {
24728
+ let apiCalls = [];
24729
+ let chatApiCall = [];
24730
+ let appliedFilters = this.getSetOperatorFilter(event, this.stateDataSource.get(event.viewId));
24731
+ view.compConfig.viewConfig.forEach(contentView => {
24732
+ let found = this.dataSetModal.find(d => d.datasetId === contentView.datasetId);
24733
+ if (found) {
24734
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, contentView.datasetId, appliedFilters));
24735
+ }
24736
+ });
24737
+ await Promise.all(apiCalls);
24738
+ this.contextMenuDataSource = this.contextMenuDataSource.filter(e => e.displayKey !== event.keyToPass);
24739
+ view.compConfig.viewConfig.forEach(viewforDataSet => {
24740
+ let obj = {
24741
+ "filters": appliedFilters,
24742
+ "keyToPass": this.updateOperatorData(event.keyToPass, event.data),
24743
+ "drillDownType": event.drillDownType,
24744
+ "drilldownFrom": event.drilldownFrom
24745
+ };
24746
+ this.stateDataSource.set(viewforDataSet['viewId'], obj);
24747
+ });
24748
+ view.nodeProperties['display'] = true;
24749
+ view.nodeProperties['widgetParams'] = event.tableTitle;
24750
+ const prefixedId = `id-${view.id}`;
24751
+ const containerElement = document.querySelector(`#${prefixedId}`);
24752
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24753
+ this.loadSingleWidgetNode(view, this.mainPageDivElement, this.uniqueDataSetObject);
24754
+ console.log(this.stateDataSource);
24755
+ setTimeout(() => {
24756
+ this.scrollToBottom(this.mainPageDivElement);
24757
+ }, 200);
24758
+ }
24759
+ replaceAssociatedParams(template, params, appliedFilters) {
24760
+ return template.replace(/\$(F|P)\{([^}]+)\}/g, (match, type, key) => {
24761
+ if (type === "F") {
24762
+ return appliedFilters.operationFilter?.[key] ?? "";
24763
+ }
24764
+ else if (type === "P") {
24765
+ return params?.[key] ?? "";
24766
+ }
24767
+ return match;
24768
+ });
24769
+ }
24770
+ scrollToBottom(container) {
24771
+ setTimeout(() => {
24772
+ container.scrollIntoView({ block: 'end' });
24773
+ this.loadingModal = false;
24774
+ }, 0);
24775
+ }
24776
+ findWidgetById(configs, id) {
24777
+ for (const config of configs) {
24778
+ if (config.id === id) {
24779
+ return config;
24780
+ }
24781
+ if (config.widgetNode && config.widgetNode.length > 0) {
24782
+ const found = this.findWidgetById(config.widgetNode, id);
24783
+ if (found) {
24784
+ return found;
24785
+ }
24786
+ }
24787
+ }
24788
+ return undefined;
24789
+ }
24790
+ updateOperatorData(key_name, value_data) {
24791
+ let operator = [];
24792
+ for (const key of key_name) {
24793
+ let obj = {};
24794
+ obj[key] = value_data[key];
24795
+ operator.push(obj);
24796
+ }
24797
+ return operator;
24798
+ }
24799
+ getElementOfCurrentView(node, viewId) {
24800
+ const matchedObject = node.compConfig.viewConfig.find(object => object.viewId === viewId);
24801
+ return matchedObject ? node : null;
24802
+ }
24803
+ getHourlyData(node) {
24804
+ const matchedObject = node.compConfig.viewConfig.find(object => object.kpiConfig.formate === 'hourly');
24805
+ return matchedObject ? node : null;
24806
+ }
24807
+ getSetOperatorFilter(objectData, previousViewStates) {
24808
+ const { data, keyToPass } = objectData;
24809
+ const appliedFilter = JSON.parse(JSON.stringify(previousViewStates.filters.operationFilter));
24810
+ keyToPass.forEach(key => {
24811
+ if (key in data) {
24812
+ const normalizedKey = key.toLowerCase().replace(/_/g, '');
24813
+ if (normalizedKey === "recorddate" && "startDate" in appliedFilter && "endDate" in appliedFilter) {
24814
+ appliedFilter.startDate = data[key];
24815
+ appliedFilter.endDate = data[key];
24816
+ }
24817
+ else {
24818
+ appliedFilter[key] = data[key];
24819
+ }
24820
+ }
24821
+ });
24822
+ const defaultoperationFilter = this.globalDefaultFilter.operationFilter;
24823
+ if (defaultoperationFilter) {
24824
+ Object.keys(defaultoperationFilter).forEach(key => {
24825
+ if (!appliedFilter.hasOwnProperty(key)) {
24826
+ appliedFilter[key] = defaultoperationFilter[key];
24827
+ }
24828
+ });
24829
+ }
24830
+ const operationFilter = {};
24831
+ operationFilter['operationFilter'] = appliedFilter;
24832
+ return operationFilter;
24833
+ }
24834
+ getRearchResultFromInputBox(inputValue, viewConfig, filterObject) {
24835
+ let view = viewConfig;
24836
+ let eventNode = { data: {}, keyToPass: [] };
24837
+ eventNode.data[filterObject.server_column] = inputValue;
24838
+ eventNode['keyToPass'] = [filterObject.server_column];
24839
+ let apiCalls = [];
24840
+ view.compConfig.viewConfig.forEach(contentView => {
24841
+ let appliedFilters = this.getSetOperatorFilter(eventNode, this.stateDataSource.get(contentView.viewId));
24842
+ let found = this.dataSetModal.find(d => d.datasetId === contentView.datasetId);
24843
+ if (found) {
24844
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, contentView.datasetId, appliedFilters));
24845
+ }
24846
+ });
24847
+ viewConfig.nodeProperties['display'] = false;
24848
+ const prefixedId = `id-${viewConfig.id}`;
24849
+ const elementToHide = document.querySelector(`#${prefixedId}`);
24850
+ if (elementToHide) {
24851
+ elementToHide.remove();
24852
+ }
24853
+ Promise.all(apiCalls).then(() => {
24854
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24855
+ this.loadingModal = true;
24856
+ this.contextMenuDataSource = this.contextMenuDataSource.filter(e => e.displayKey !== viewConfig.keyToPass);
24857
+ view.nodeProperties['display'] = true;
24858
+ const prefixedId = `id-${view.id}`;
24859
+ const containerElement = document.querySelector(`#${prefixedId}`);
24860
+ this.loadSingleWidgetNode(view, this.mainPageDivElement, this.uniqueDataSetObject);
24861
+ setTimeout(() => {
24862
+ this.scrollToBottom(this.mainPageDivElement);
24863
+ }, 200);
24864
+ let params = {};
24865
+ params[filterObject.server_column] = inputValue;
24866
+ });
24867
+ }
24868
+ submitFilter() {
24869
+ let view = this.nodeproperticeFilterDataSource.viewConfig;
24870
+ let apiCalls = [];
24871
+ this.havingDataObject = this.nodeproperticeFilterDataSource.havingConfig.filter(value => value.value !== "");
24872
+ view.compConfig.viewConfig.forEach(contentView => {
24873
+ let appliedFilters = this.stateDataSource.get(contentView.viewId);
24874
+ let found = this.dataSetModal.find(d => d.datasetId === contentView.datasetId);
24875
+ if (found) {
24876
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, contentView.datasetId, appliedFilters.filters));
24877
+ }
24878
+ });
24879
+ Promise.all(apiCalls).then(() => {
24880
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24881
+ this.nodeproperticeFilterDataSource.viewConfig.nodeProperties['display'] = false;
24882
+ const prefixedId = `id-${this.nodeproperticeFilterDataSource.viewConfig.id}`;
24883
+ const elementToHide = document.querySelector(`#${prefixedId}`);
24884
+ if (elementToHide) {
24885
+ elementToHide.remove();
24886
+ }
24887
+ this.loadingModal = true;
24888
+ this.contextMenuDataSource = this.contextMenuDataSource.filter(e => e.displayKey !== this.nodeproperticeFilterDataSource.viewConfig.keyToPass);
24889
+ this.isWidgetFilters = false;
24890
+ view.nodeProperties['display'] = true;
24891
+ this.loadSingleWidgetNode(view, this.mainPageDivElement, this.uniqueDataSetObject);
24892
+ setTimeout(() => {
24893
+ this.scrollToBottom(this.mainPageDivElement);
24894
+ }, 200);
24895
+ });
24896
+ }
24897
+ getWidgetFilterForTemplate(value) {
24898
+ let apiCalls = [];
24899
+ const deletedViewIds = [];
24900
+ value.viewNodes.compConfig.viewConfig.forEach(item => {
24901
+ let widgetFilter = this.stateDataSource.get(item.viewId);
24902
+ let appliedFilters = widgetFilter.filters;
24903
+ let found = this.dataSetModal.find(d => d.datasetId === item.datasetId);
24904
+ deletedViewIds.push(item.viewId);
24905
+ const having = Object.entries(value.operationFilter).map(([key, value]) => ({
24906
+ columnName: key,
24907
+ dataType: "float",
24908
+ operator: "gte",
24909
+ value: value
24910
+ }));
24911
+ if (found) {
24912
+ found.config.queryConfig['havings'] = having;
24913
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, item.datasetId, appliedFilters));
24914
+ }
24915
+ });
24916
+ Promise.all(apiCalls).then(() => {
24917
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24918
+ this.loadSingleWidgetNode(value.viewNodes, this.mainPageDivElement, this.uniqueDataSetObject);
24919
+ setTimeout(() => {
24920
+ this.scrollToBottom(this.mainPageDivElement);
24921
+ }, 200);
24922
+ });
24923
+ }
24924
+ async loadDataByOperator(opName) {
24925
+ let filter = { operationFilter: { startDate: "", endDate: "", operator_key: "" } };
24926
+ filter.operationFilter['startDate'] = this.defaultStartDate;
24927
+ filter.operationFilter['endDate'] = this.defaultEndDate;
24928
+ filter.operationFilter['operator_key'] = opName;
24929
+ this.loadingModal = true;
24930
+ await this.getPadeDataSource(true);
24931
+ this.uniqueDataSetObject = {};
24932
+ let apiCalls = [];
24933
+ this.allWidgetByDataset.forEach(view => {
24934
+ view.datasetIds.forEach(id => {
24935
+ let found = this.dataSetModal.find(d => d.datasetId === id.datasetId);
24936
+ if (found) {
24937
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, id.datasetId, filter));
24938
+ }
24939
+ });
24940
+ });
24941
+ Promise.all(apiCalls).then(() => {
24942
+ this.globalDefaultFilter = filter;
24943
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24944
+ this.createDivElements(this.uniqueDataSetObject, true);
24945
+ this.loadingModal = false;
24946
+ });
24947
+ }
24948
+ async getContextFilterData(value) {
24949
+ let filter = { operationFilter: { startDate: "", endDate: "" } };
24950
+ filter.operationFilter['startDate'] = this.defaultStartDate;
24951
+ filter.operationFilter['endDate'] = this.defaultEndDate;
24952
+ filter.operationFilter[value.operatorName] = this.parseInput(value.defaultFilterValue);
24953
+ this.loadingModal = true;
24954
+ let obj = {};
24955
+ obj[value.operatorName] = value.defaultFilterValue;
24956
+ await this.getPadeDataSource(true);
24957
+ this.uniqueDataSetObject = {};
24958
+ let apiCalls = [];
24959
+ this.allWidgetByDataset.forEach(view => {
24960
+ view.datasetIds.forEach(id => {
24961
+ let found = this.dataSetModal.find(d => d.datasetId === id.datasetId);
24962
+ if (found) {
24963
+ apiCalls.push(this.datasetService.getDataFromDataSet(found, id.datasetId, filter));
24964
+ }
24965
+ });
24966
+ });
24967
+ Promise.all(apiCalls).then(() => {
24968
+ this.globalDefaultFilter = filter;
24969
+ this.uniqueDataSetObject = this.datasetService.getUniqueDataSetObject();
24970
+ this.createDivElements(this.uniqueDataSetObject, true);
24971
+ this.loadingModal = false;
24972
+ });
24973
+ }
24974
+ parseInput(input) {
24975
+ input = input.trim();
24976
+ if (input.includes(',')) {
24977
+ return input.split(',').map(item => item.trim());
24978
+ }
24979
+ else {
24980
+ return input;
24981
+ }
24982
+ }
24983
+ getDrilldownDisplayByUrlParams(all_views) {
24984
+ this.defaultViewIdsOnPageRefresh = [];
24985
+ const params = this.activatedRoute.snapshot.queryParams;
24986
+ this.defaultViewIdsOnPageRefresh = (params['views'] && params['views'] !== "") ? JSON.parse(decodeURIComponent(params['views'])) : [];
24987
+ all_views.forEach(element => {
24988
+ for (let entry of element.widgetNode) {
24989
+ let shouldDisplay = false;
24990
+ entry.compConfig.viewConfig.forEach(view => {
24991
+ if (this.defaultViewIdsOnPageRefresh.length !== 0) {
24992
+ const foundObject = this.defaultViewIdsOnPageRefresh.find(val => val.viewId === view.viewId);
24993
+ if (foundObject) {
24994
+ shouldDisplay = true;
24995
+ }
24996
+ }
24997
+ });
24998
+ if (shouldDisplay) {
24999
+ entry.nodeProperties.display = true;
25000
+ }
25001
+ }
25002
+ });
25003
+ }
25004
+ getFiltersForQueryParams(operators, filters, viewParams) {
25005
+ const operationFilter = operators.operationFilter || {};
25006
+ const currentParams = this.activatedRoute.snapshot.queryParams;
25007
+ let currentViews = [];
25008
+ if (currentParams['views']) {
25009
+ try {
25010
+ currentViews = JSON.parse(decodeURIComponent(currentParams['views']));
25011
+ }
25012
+ catch (e) {
25013
+ console.error("Invalid views param");
25014
+ }
25015
+ }
25016
+ const filterData = { viewId: viewParams.viewId };
25017
+ filters.forEach(filter => {
25018
+ const localKey = filter.localColumn;
25019
+ const serverKey = filter.serverColumn;
25020
+ let value = operationFilter[localKey];
25021
+ if (value !== undefined && value !== "") {
25022
+ filterData[serverKey] = value;
25023
+ }
25024
+ });
25025
+ const existingIndex = currentViews.findIndex(v => v.viewId === viewParams.viewId);
25026
+ if (existingIndex !== -1) {
25027
+ currentViews[existingIndex] = filterData;
25028
+ currentViews = currentViews.slice(0, existingIndex + 1);
25029
+ }
25030
+ else {
25031
+ currentViews.push(filterData);
25032
+ }
25033
+ const encodedViews = encodeURIComponent(JSON.stringify(currentViews));
25034
+ const mergedParams = {
25035
+ ...currentParams,
25036
+ views: encodedViews
25037
+ };
25038
+ }
25039
+ getDrildownFilter(drildownFilter, defaultFilter) {
25040
+ const expectedDateFields = ['recordDate', 'record_date', 'eventDate', 'event_date'];
25041
+ const result = JSON.parse(JSON.stringify(defaultFilter));
25042
+ const { viewId, ...filteredDrilldown } = drildownFilter;
25043
+ let dateValue = null;
25044
+ for (const key of expectedDateFields) {
25045
+ if (filteredDrilldown[key]) {
25046
+ dateValue = filteredDrilldown[key];
25047
+ break;
25048
+ }
25049
+ }
25050
+ if (dateValue) {
25051
+ result.operationFilter.startDate = dateValue;
25052
+ result.operationFilter.endDate = dateValue;
25053
+ }
25054
+ for (const key in filteredDrilldown) {
25055
+ if (!expectedDateFields.includes(key)) {
25056
+ result.operationFilter[key] = filteredDrilldown[key];
25057
+ }
25058
+ }
25059
+ return result;
25060
+ }
25061
+ getTitleParams(items) {
25062
+ const results = [];
25063
+ items.compConfig.viewConfig.forEach(element => {
25064
+ const foundObject = this.defaultViewIdsOnPageRefresh.find(val => val.viewId === element.viewId);
25065
+ if (foundObject) {
25066
+ const result = Object.entries(foundObject)
25067
+ .filter(([key]) => key !== 'viewId')
25068
+ .map(([key, value]) => {
25069
+ const formattedKey = key
25070
+ .replace(/_/g, ' ')
25071
+ .replace(/\b\w/g, char => char.toUpperCase());
25072
+ return `${formattedKey} = ${value}`;
25073
+ })
25074
+ .join(' | ');
25075
+ results.push(`| ${result} `);
25076
+ }
25077
+ });
25078
+ return results.join('\n');
25079
+ }
25080
+ }
25081
+ 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 });
25082
+ 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" }] });
25083
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MultiLayoutLandingComponentComponent, decorators: [{
25084
+ type: Component,
25085
+ 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>" }]
25086
+ }], 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: [{
25087
+ type: ViewChild,
25088
+ args: ['dynamicComponentContainer', { read: ViewContainerRef }]
25089
+ }], containerRef: [{
25090
+ type: ViewChild,
25091
+ args: ['container', { read: ViewContainerRef }]
25092
+ }], dynamicContainer: [{
25093
+ type: ViewChild,
25094
+ args: ['dynamicContainer', { static: true }]
25095
+ }], dynamicContainerForPopup: [{
25096
+ type: ViewChild,
25097
+ args: ['dynamicContainerForPopup', { static: true }]
25098
+ }] } });
25099
+
25100
+ class DefaultLandingMultiLayoutComponenttModule {
25101
+ }
25102
+ DefaultLandingMultiLayoutComponenttModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DefaultLandingMultiLayoutComponenttModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
25103
+ DefaultLandingMultiLayoutComponenttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: DefaultLandingMultiLayoutComponenttModule, declarations: [MultiLayoutLandingComponentComponent], imports: [CommonModule,
25104
+ LoadingModule$1,
25105
+ CommonModule,
25106
+ DevExtremeModule,
25107
+ DxButtonModule,
25108
+ DxCheckBoxModule,
25109
+ DxNumberBoxModule,
25110
+ DxDataGridModule,
25111
+ DxDropDownBoxModule,
25112
+ DxTreeViewModule,
25113
+ DxScrollViewModule,
25114
+ DxFormModule,
25115
+ DxAccordionModule,
25116
+ FormsModule,
25117
+ DxTagBoxModule,
25118
+ ReactiveFormsModule,
25119
+ MatIconModule,
25120
+ DxHtmlEditorModule,
25121
+ DxBulletModule,
25122
+ DxChartModule,
25123
+ DxDateBoxModule,
25124
+ DxLoadPanelModule,
25125
+ DxLookupModule,
25126
+ DxPivotGridModule,
25127
+ DxTemplateModule,
25128
+ DxTextAreaModule,
25129
+ DxValidationSummaryModule,
25130
+ DxValidatorModule,
25131
+ DxCalendarModule,
25132
+ DxTooltipModule,
25133
+ DxContextMenuModule,
25134
+ DxLoadIndicatorModule,
25135
+ DxPieChartModule,
25136
+ MatTooltipModule,
25137
+ DxPopupModule, DxSelectBoxModule, DxTextBoxModule, DxTreeViewModule,
25138
+ MatButtonModule,
25139
+ MatDividerModule,
25140
+ MatMenuModule,
25141
+ MatIconModule,
25142
+ LoadingModule$1], exports: [MultiLayoutLandingComponentComponent] });
25143
+ DefaultLandingMultiLayoutComponenttModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DefaultLandingMultiLayoutComponenttModule, providers: [LandingMultiLayoutApplicationDatssetsCall, LandingMultiLayoutComponentService], imports: [CommonModule,
25144
+ LoadingModule$1,
25145
+ CommonModule,
25146
+ DevExtremeModule,
25147
+ DxButtonModule,
25148
+ DxCheckBoxModule,
25149
+ DxNumberBoxModule,
25150
+ DxDataGridModule,
25151
+ DxDropDownBoxModule,
25152
+ DxTreeViewModule,
25153
+ DxScrollViewModule,
25154
+ DxFormModule,
25155
+ DxAccordionModule,
25156
+ FormsModule,
25157
+ DxTagBoxModule,
25158
+ ReactiveFormsModule,
25159
+ MatIconModule,
25160
+ DxHtmlEditorModule,
25161
+ DxBulletModule,
25162
+ DxChartModule,
25163
+ DxDateBoxModule,
25164
+ DxLoadPanelModule,
25165
+ DxLookupModule,
25166
+ DxPivotGridModule,
25167
+ DxTemplateModule,
25168
+ DxTextAreaModule,
25169
+ DxValidationSummaryModule,
25170
+ DxValidatorModule,
25171
+ DxCalendarModule,
25172
+ DxTooltipModule,
25173
+ DxContextMenuModule,
25174
+ DxLoadIndicatorModule,
25175
+ DxPieChartModule,
25176
+ MatTooltipModule,
25177
+ DxPopupModule, DxSelectBoxModule, DxTextBoxModule, DxTreeViewModule,
25178
+ MatButtonModule,
25179
+ MatDividerModule,
25180
+ MatMenuModule,
25181
+ MatIconModule,
25182
+ LoadingModule$1] });
25183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DefaultLandingMultiLayoutComponenttModule, decorators: [{
25184
+ type: NgModule,
25185
+ args: [{
25186
+ declarations: [
25187
+ MultiLayoutLandingComponentComponent,
25188
+ ],
25189
+ imports: [CommonModule,
25190
+ LoadingModule$1,
25191
+ CommonModule,
25192
+ DevExtremeModule,
25193
+ DxButtonModule,
25194
+ DxCheckBoxModule,
25195
+ DxNumberBoxModule,
25196
+ DxDataGridModule,
25197
+ DxDropDownBoxModule,
25198
+ DxTreeViewModule,
25199
+ DxScrollViewModule,
25200
+ DxFormModule,
25201
+ DxAccordionModule,
25202
+ FormsModule,
25203
+ DxTagBoxModule,
25204
+ ReactiveFormsModule,
25205
+ MatIconModule,
25206
+ DxHtmlEditorModule,
25207
+ DxBulletModule,
25208
+ DxChartModule,
25209
+ DxDateBoxModule,
25210
+ DxLoadPanelModule,
25211
+ DxLookupModule,
25212
+ DxPivotGridModule,
25213
+ DxTemplateModule,
25214
+ DxTextAreaModule,
25215
+ DxValidationSummaryModule,
25216
+ DxValidatorModule,
25217
+ DxCalendarModule,
25218
+ DxTooltipModule,
25219
+ DxContextMenuModule,
25220
+ DxLoadIndicatorModule,
25221
+ DxPieChartModule,
25222
+ MatTooltipModule,
25223
+ DxPopupModule, DxSelectBoxModule, DxTextBoxModule, DxTreeViewModule,
25224
+ MatButtonModule,
25225
+ MatDividerModule,
25226
+ MatMenuModule,
25227
+ MatIconModule,
25228
+ LoadingModule$1,
25229
+ ],
25230
+ exports: [
25231
+ MultiLayoutLandingComponentComponent
25232
+ ],
25233
+ providers: [LandingMultiLayoutApplicationDatssetsCall, LandingMultiLayoutComponentService],
25234
+ }]
25235
+ }] });
25236
+
23353
25237
  class BookmarkedService {
23354
25238
  constructor(http, environment) {
23355
25239
  this.http = http;
@@ -24754,5 +26638,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
24754
26638
  }]
24755
26639
  }] });
24756
26640
 
24757
- 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 };
26641
+ 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 };
24758
26642
  //# sourceMappingURL=gamma-app-controller.mjs.map