From b483087bf12e1ce8b39b37ec8624a4f39f2b1921 Mon Sep 17 00:00:00 2001 From: dbulatovicx32 Date: Thu, 12 Oct 2023 13:18:04 +0200 Subject: [PATCH 1/2] KNOWAGE-8165 Added missing parameters to the drilldown method. --- src/modules/documentExecution/dashboard/DataProxyHelper.ts | 7 +++++-- .../widget/ChartWidget/Highcharts/HighchartsContainer.vue | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/documentExecution/dashboard/DataProxyHelper.ts b/src/modules/documentExecution/dashboard/DataProxyHelper.ts index 20a4dafc2..5f6304d59 100644 --- a/src/modules/documentExecution/dashboard/DataProxyHelper.ts +++ b/src/modules/documentExecution/dashboard/DataProxyHelper.ts @@ -13,6 +13,7 @@ import { AxiosResponse } from 'axios' import { setDatasetInterval, clearDatasetInterval } from './helpers/datasetRefresh/DatasetRefreshHelpers' import { aggregationRegex, aggregationsRegex, limitRegex, rowsRegex } from './helpers/common/DashboardRegexHelper' import { IDataset, ISelection, IVariable, IWidget, IDashboardDataset, IDashboardDatasetDriver } from './Dashboard' +import { addParametersToData } from '@/modules/documentExecution/dashboard/DashboardDataProxy' const { t } = i18n.global const mainStore = store() @@ -466,7 +467,6 @@ export const getHighchartsWidgetData = async (widget: IWidget, datasets: IDashbo const chartType = widget.settings.chartModel?.model?.chart.type switch (chartType) { case 'pie': - return await getPieChartData(widget, datasets, $http, initialCall, selections, associativeResponseSelections) case 'area': case 'bar': @@ -519,7 +519,7 @@ export const getPieChartData = async (widget: IWidget, datasets: IDashboardDatas } } -export const getChartDrilldownData = async (widget: IWidget, datasets: IDashboardDataset[], $http: any, initialCall: boolean, selections: ISelection[], likeSelections: any, drillDownLevel: number) => { +export const getChartDrilldownData = async (dashboardId: any, widget: IWidget, datasets: IDashboardDataset[], $http: any, initialCall: boolean, selections: ISelection[], likeSelections: any, drillDownLevel: number) => { const datasetIndex = datasets.findIndex((dataset: IDashboardDataset) => widget.dataset === dataset.id) const selectedDataset = datasets[datasetIndex] @@ -534,6 +534,9 @@ export const getChartDrilldownData = async (widget: IWidget, datasets: IDashboar if (selectedDataset) { const url = `/restful-services/2.0/datasets/${selectedDataset.dsLabel}/data?offset=-1&size=-1&nearRealtime=true` const postData = formatChartWidgetForGet(widget, selectedDataset, initialCall, selections, {}, drillDownLevel) + addParametersToData(selectedDataset, dashboardId, postData) + + console.log('POST DATA', postData) postData.likeSelections = formattedSelections let tempResponse = null as any diff --git a/src/modules/documentExecution/dashboard/widget/ChartWidget/Highcharts/HighchartsContainer.vue b/src/modules/documentExecution/dashboard/widget/ChartWidget/Highcharts/HighchartsContainer.vue index acfcbd829..23eaa368d 100644 --- a/src/modules/documentExecution/dashboard/widget/ChartWidget/Highcharts/HighchartsContainer.vue +++ b/src/modules/documentExecution/dashboard/widget/ChartWidget/Highcharts/HighchartsContainer.vue @@ -196,7 +196,7 @@ export default defineComponent({ const category = this.widgetModel.columns[this.drillLevel - 1] this.likeSelections.push({ [category.columnName]: event.point.name }) this.highchartsInstance.showLoading(this.$t('common.info.dataLoading')) - const tempData = await getChartDrilldownData(this.widgetModel, dashboardDatasets, this.$http, false, this.propActiveSelections, this.likeSelections, this.drillLevel) + const tempData = await getChartDrilldownData(this.dashboardId, this.widgetModel, dashboardDatasets, this.$http, false, this.propActiveSelections, this.likeSelections, this.drillLevel) const newSeries = this.widgetModel.settings.chartModel.setData(tempData, this.widgetModel) this.highchartsInstance.hideLoading() newSeries.forEach((serie: any) => { From 1e8c7b92db65fed8ba8bc910b86068fe12783f3f Mon Sep 17 00:00:00 2001 From: dbulatovicx32 Date: Thu, 12 Oct 2023 13:19:31 +0200 Subject: [PATCH 2/2] Remove Log --- src/modules/documentExecution/dashboard/DataProxyHelper.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/documentExecution/dashboard/DataProxyHelper.ts b/src/modules/documentExecution/dashboard/DataProxyHelper.ts index 5f6304d59..641ce2af8 100644 --- a/src/modules/documentExecution/dashboard/DataProxyHelper.ts +++ b/src/modules/documentExecution/dashboard/DataProxyHelper.ts @@ -536,7 +536,6 @@ export const getChartDrilldownData = async (dashboardId: any, widget: IWidget, d const postData = formatChartWidgetForGet(widget, selectedDataset, initialCall, selections, {}, drillDownLevel) addParametersToData(selectedDataset, dashboardId, postData) - console.log('POST DATA', postData) postData.likeSelections = formattedSelections let tempResponse = null as any