Skip to content

Commit

Permalink
Merge pull request edp963#1048 from scottsut/master
Browse files Browse the repository at this point in the history
Hotfix
  • Loading branch information
scottsut authored Jun 24, 2019
2 parents 69c651d + e1d1aa2 commit c7a868b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
21 changes: 18 additions & 3 deletions webapp/app/containers/Dashboard/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,24 @@ export class Grid extends React.Component<IGridProps, IGridStates> {
}

private initiateDashboardDownloadTask = () => {
const { currentItems, currentDashboard } = this.props
const { currentItems, currentDashboard, widgets } = this.props
const downloadParams = []
currentItems.forEach((item) => {
const { id, widgetId } = item
const widget = widgets.find((w) => w.id === widgetId)
const queryConditions: Partial<IQueryConditions> = {
nativeQuery: false
}
if (widget.type === getTable().id) {
try {
const widgetProps: IWidgetProps = JSON.parse(widget.config)
if (widgetProps.mode === 'chart') {
queryConditions.nativeQuery = widgetProps.chartStyles.table.withNoAggregators
}
} catch (error) {
message.error(error)
}
}
this.getData(
(renderType, itemId, widget, requestParams) => {
downloadParams.push({
Expand All @@ -445,7 +459,8 @@ export class Grid extends React.Component<IGridProps, IGridStates> {
},
'rerender',
id,
widgetId
widgetId,
queryConditions
)
})
this.props.onInitiateDownloadTask(currentDashboard.id, DownloadTypes.Dashboard, downloadParams)
Expand Down Expand Up @@ -492,7 +507,7 @@ export class Grid extends React.Component<IGridProps, IGridStates> {
globalVariables = queryConditions.globalVariables || cachedQueryConditions.globalVariables
drillStatus = queryConditions.drillStatus || void 0
pagination = queryConditions.pagination || cachedQueryConditions.pagination
nativeQuery = queryConditions.nativeQuery || cachedQueryConditions.nativeQuery
nativeQuery = queryConditions.nativeQuery !== void 0 ? queryConditions.nativeQuery : cachedQueryConditions.nativeQuery
} else {
tempFilters = cachedQueryConditions.tempFilters
linkageFilters = cachedQueryConditions.linkageFilters
Expand Down
4 changes: 3 additions & 1 deletion webapp/app/containers/Widget/components/Chart/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ export class Chart extends React.PureComponent<IChartProps> {
onDoInteract(triggerData)
}
setTimeout(() => {
getDataDrillDetail(JSON.stringify({range: null, brushed, sourceData}))
if (getDataDrillDetail) {
getDataDrillDetail(JSON.stringify({range: null, brushed, sourceData}))
}
}, 500)
if (onSelectChartsItems) {
onSelectChartsItems(selectedItems)
Expand Down
3 changes: 3 additions & 0 deletions webapp/share/containers/Dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ export class Share extends React.Component<IDashboardProps, IDashboardStates> {
...this.state.interactingStatus,
[itemId]: false
}
}, () => {
const item = currentItems.find((ci) => ci.id === itemId)
this.getChartData('clear', itemId, item.widgetId)
})
}

Expand Down

0 comments on commit c7a868b

Please sign in to comment.