mistercrunch closed pull request #5636: [explore] fix the 'altered' tag false
positive
URL: https://github.com/apache/incubator-superset/pull/5636
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/superset/assets/src/explore/components/ExploreViewContainer.jsx
b/superset/assets/src/explore/components/ExploreViewContainer.jsx
index 315cc80ad2..720e72176a 100644
--- a/superset/assets/src/explore/components/ExploreViewContainer.jsx
+++ b/superset/assets/src/explore/components/ExploreViewContainer.jsx
@@ -293,12 +293,6 @@ ExploreViewContainer.propTypes = propTypes;
function mapStateToProps({ explore, charts, impressionId }) {
const form_data = getFormDataFromControls(explore.controls);
- // fill in additional params stored in form_data but not used by control
- Object.keys(explore.rawFormData).forEach((key) => {
- if (form_data[key] === undefined) {
- form_data[key] = explore.rawFormData[key];
- }
- });
const chartKey = Object.keys(charts)[0];
const chart = charts[chartKey];
return {
diff --git a/superset/assets/src/explore/controls.jsx
b/superset/assets/src/explore/controls.jsx
index 241852a33b..f850785139 100644
--- a/superset/assets/src/explore/controls.jsx
+++ b/superset/assets/src/explore/controls.jsx
@@ -1888,6 +1888,13 @@ export const controls = {
description: t('The number of seconds before expiring the cache'),
},
+ url_params: {
+ type: 'HiddenControl',
+ label: t('URL Parameters'),
+ hidden: true,
+ description: t('Captures extra URL params'),
+ },
+
order_by_entity: {
type: 'CheckboxControl',
label: t('Order by entity id'),
diff --git a/superset/assets/src/explore/index.jsx
b/superset/assets/src/explore/index.jsx
index 283b5f5297..c0033ce7f3 100644
--- a/superset/assets/src/explore/index.jsx
+++ b/superset/assets/src/explore/index.jsx
@@ -41,11 +41,8 @@ const bootstrappedState = {
isDatasourceMetaLoading: false,
isStarred: false,
};
-const slice = bootstrappedState.slice;
-const sliceFormData = slice
- ? getFormDataFromControls(getControlsState(bootstrapData, slice.form_data))
- : null;
const chartKey = getChartKey(bootstrappedState);
+const formData = getFormDataFromControls(controls);
const initState = {
charts: {
[chartKey]: {
@@ -54,8 +51,8 @@ const initState = {
chartStatus: 'loading',
chartUpdateEndTime: null,
chartUpdateStartTime: now(),
- latestQueryFormData: getFormDataFromControls(controls),
- sliceFormData,
+ latestQueryFormData: formData,
+ sliceFormData: bootstrappedState.slice ? formData : null,
queryRequest: null,
queryResponse: null,
triggerQuery: true,
diff --git a/superset/assets/src/explore/visTypes.jsx
b/superset/assets/src/explore/visTypes.jsx
index 4c5ae01f76..cb1b71c49d 100644
--- a/superset/assets/src/explore/visTypes.jsx
+++ b/superset/assets/src/explore/visTypes.jsx
@@ -24,6 +24,7 @@ export const sections = {
['datasource'],
['viz_type'],
['slice_id', 'cache_timeout'],
+ ['url_params'],
],
},
colorScheme: {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]