Skip to content

Commit

Permalink
Feature flag for client cache
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Apr 22, 2019
1 parent 8fd7d4b commit 892e744
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion superset/assets/src/chart/chartAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
/* eslint no-param-reassign: ["error", { "props": false }] */
import { t } from '@superset-ui/translation';
import { SupersetClient } from '@superset-ui/connection';
import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
import { getExploreUrlAndPayload, getAnnotationJsonUrl } from '../explore/exploreUtils';
import { requiresQuery, ANNOTATION_SOURCE_TYPES } from '../modules/AnnotationTypes';
import { addDangerToast } from '../messageToasts/actions';
Expand Down Expand Up @@ -194,7 +195,9 @@ export function exploreJSON(formData, force = false, timeout = 60, key, method)
};
}

const clientMethod = method === 'GET' ? SupersetClient.get : SupersetClient.post;
const clientMethod = method === 'GET' && isFeatureEnabled(FeatureFlag.CLIENT_CACHE)
? SupersetClient.get
: SupersetClient.post;
const queryPromise = clientMethod(querySettings)
.then(({ json }) => {
dispatch(logEvent(LOG_ACTIONS_LOAD_CHART, {
Expand Down
1 change: 1 addition & 0 deletions superset/assets/src/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
export enum FeatureFlag {
SCOPED_FILTER = 'SCOPED_FILTER',
OMNIBAR = 'OMNIBAR',
CLIENT_CACHE = 'CLIENT_CACHE',
}

export type FeatureFlagMap = {
Expand Down

0 comments on commit 892e744

Please sign in to comment.