Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KNOWAGE-8165 #68

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/modules/documentExecution/dashboard/DataProxyHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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':
Expand Down Expand Up @@ -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]

Expand All @@ -534,6 +534,8 @@ 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)

postData.likeSelections = formattedSelections
let tempResponse = null as any

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Loading