gamma-app-controller 1.2.18 → 1.2.20

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