mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
refactor: add set data mask to build query (#13417)
* refactor: add set data mask to build query * refactor: update hooks placement
This commit is contained in:
@@ -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) {
|
||||
@@ -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
|
||||
@@ -200,6 +203,7 @@ const v1ChartDataRequest = async (
|
||||
|
||||
export async function getChartDataRequest({
|
||||
formData,
|
||||
setDataMask = () => {},
|
||||
resultFormat = 'json',
|
||||
resultType = 'full',
|
||||
force = false,
|
||||
@@ -234,6 +238,7 @@ export async function getChartDataRequest({
|
||||
resultType,
|
||||
force,
|
||||
querySettings,
|
||||
setDataMask,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user