This is an automated email from the ASF dual-hosted git repository.
graceguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 5962005 fix: disable domain sharding on explore view (#10787)
5962005 is described below
commit 596200528dcef9764bfa45aa01f27fb79005a42c
Author: Grace Guo <[email protected]>
AuthorDate: Thu Sep 3 15:42:39 2020 -0700
fix: disable domain sharding on explore view (#10787)
---
superset-frontend/src/chart/chartAction.js | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/superset-frontend/src/chart/chartAction.js
b/superset-frontend/src/chart/chartAction.js
index 1be2626..e5363e4 100644
--- a/superset-frontend/src/chart/chartAction.js
+++ b/superset-frontend/src/chart/chartAction.js
@@ -40,7 +40,7 @@ import { addDangerToast } from '../messageToasts/actions';
import { logEvent } from '../logger/actions';
import { Logger, LOG_ACTIONS_LOAD_CHART } from '../logger/LogUtils';
import getClientErrorObject from '../utils/getClientErrorObject';
-import { allowCrossDomain as allowDomainSharding } from
'../utils/hostNamesConfig';
+import { allowCrossDomain as domainShardingEnabled } from
'../utils/hostNamesConfig';
export const CHART_UPDATE_STARTED = 'CHART_UPDATE_STARTED';
export function chartUpdateStarted(queryController, latestQueryFormData, key) {
@@ -106,6 +106,9 @@ const legacyChartDataRequest = async (
requestParams = {},
) => {
const endpointType = getLegacyEndpointType({ resultFormat, resultType });
+ const allowDomainSharding =
+ // eslint-disable-next-line camelcase
+ domainShardingEnabled && requestParams?.dashboard_id;
const url = getExploreUrl({
formData,
endpointType,
@@ -153,6 +156,9 @@ const v1ChartDataRequest = async (
const qs = requestParams.dashboard_id
? { dashboard_id: requestParams.dashboard_id }
: {};
+ const allowDomainSharding =
+ // eslint-disable-next-line camelcase
+ domainShardingEnabled && requestParams?.dashboard_id;
const url = getChartDataUri({
path: '/api/v1/chart/data',
qs,
@@ -182,7 +188,7 @@ export async function getChartDataRequest({
...requestParams,
};
- if (allowDomainSharding) {
+ if (domainShardingEnabled) {
querySettings = {
...querySettings,
mode: 'cors',