Skip to content
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
9 changes: 9 additions & 0 deletions superset-frontend/src/chart/chartAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { logEvent } from '../logger/actions';
import { Logger, LOG_ACTIONS_LOAD_CHART } from '../logger/LogUtils';
import { getClientErrorObject } from '../utils/getClientErrorObject';
import { allowCrossDomain as domainShardingEnabled } from '../utils/hostNamesConfig';
import { updateExtraFormData } from '../dashboard/actions/nativeFilters';

export const CHART_UPDATE_STARTED = 'CHART_UPDATE_STARTED';
export function chartUpdateStarted(queryController, latestQueryFormData, key) {
Expand Down Expand Up @@ -163,12 +164,14 @@ const v1ChartDataRequest = async (
resultType,
force,
requestParams,
setDataMask,
) => {
const payload = buildV1ChartDataPayload({
formData,
resultType,
resultFormat,
force,
setDataMask,
});

// The dashboard id is added to query params for tracking purposes
Expand Down Expand Up @@ -200,6 +203,7 @@ const v1ChartDataRequest = async (

export async function getChartDataRequest({
formData,
setDataMask = () => {},
resultFormat = 'json',
resultType = 'full',
force = false,
Expand Down Expand Up @@ -234,6 +238,7 @@ export async function getChartDataRequest({
resultType,
force,
querySettings,
setDataMask,
);
}

Expand Down Expand Up @@ -361,7 +366,11 @@ export function exploreJSON(
};
if (dashboardId) requestParams.dashboard_id = dashboardId;

const setDataMask = filtersState => {
dispatch(updateExtraFormData(formData.slice_id, filtersState));
};
const chartDataRequest = getChartDataRequest({
setDataMask,
formData,
resultFormat: 'json',
resultType: 'full',
Expand Down
20 changes: 14 additions & 6 deletions superset-frontend/src/explore/exploreUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ export const buildV1ChartDataPayload = ({
force,
resultFormat,
resultType,
setDataMask,
}) => {
const buildQuery =
getChartBuildQueryRegistry().get(formData.viz_type) ??
Expand All @@ -216,12 +217,19 @@ export const buildV1ChartDataPayload = ({
...baseQueryObject,
},
]));
return buildQuery({
...formData,
force,
result_format: resultFormat,
result_type: resultType,
});
return buildQuery(
{
...formData,
force,
result_format: resultFormat,
result_type: resultType,
},
{
hooks: {
setDataMask,
},
},
);
};

export const getLegacyEndpointType = ({ resultType, resultFormat }) =>
Expand Down