mirror of
https://github.com/apache/superset.git
synced 2024-09-06 13:57:40 -04:00
fix(explore): ignore temporary controls in altered pill (#19843)
This commit is contained in:
parent
ae384111c1
commit
2dafff12ef
@ -69,6 +69,17 @@ describe('AlteredSliceTag', () => {
|
||||
expect(wrapper.instance().render()).toBeNull();
|
||||
});
|
||||
|
||||
it('does not run when temporary controls have changes', () => {
|
||||
props = {
|
||||
origFormData: { ...props.origFormData, url_params: { foo: 'foo' } },
|
||||
currentFormData: { ...props.origFormData, url_params: { bar: 'bar' } },
|
||||
};
|
||||
wrapper = mount(<AlteredSliceTag {...props} />);
|
||||
expect(wrapper.instance().state.rows).toEqual([]);
|
||||
expect(wrapper.instance().state.hasDiffs).toBe(false);
|
||||
expect(wrapper.instance().render()).toBeNull();
|
||||
});
|
||||
|
||||
it('sets new rows when receiving new props', () => {
|
||||
const testRows = ['testValue'];
|
||||
const getRowsFromDiffsStub = jest
|
||||
|
@ -20,6 +20,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { isEqual, isEmpty } from 'lodash';
|
||||
import { t } from '@superset-ui/core';
|
||||
import { sanitizeFormData } from 'src/explore/exploreUtils/formData';
|
||||
import getControlsForVizType from 'src/utils/getControlsForVizType';
|
||||
import { safeStringify } from 'src/utils/safeStringify';
|
||||
import { Tooltip } from 'src/components/Tooltip';
|
||||
@ -82,8 +83,8 @@ export default class AlteredSliceTag extends React.Component {
|
||||
getDiffs(props) {
|
||||
// Returns all properties that differ in the
|
||||
// current form data and the saved form data
|
||||
const ofd = props.origFormData;
|
||||
const cfd = props.currentFormData;
|
||||
const ofd = sanitizeFormData(props.origFormData);
|
||||
const cfd = sanitizeFormData(props.currentFormData);
|
||||
|
||||
const fdKeys = Object.keys(cfd);
|
||||
const diffs = {};
|
||||
|
Loading…
Reference in New Issue
Block a user