mirror of
https://github.com/apache/superset.git
synced 2026-04-17 07:05:04 +00:00
fix: Color consistency (#17089)
* Update label colors on the fly * Clean up * Improve getFormDataWithExtraFilters * Improve code structure * Remove labelColors from formData * Exclude label_colors from URL * Refactor color scheme implementation * Clean up * Refactor and simplify * Fix lint * Remove unnecessary ColorMapControl * Lint * Give json color scheme precedence * Add label_colors prop in metadata * Separate owners and dashboard meta requests * Remove label_colors control * bump superset-ui 0.18.19 * Fix end of file * Update tests * Fix lint * Update Cypress * Update setColorScheme method * Use Antd modal body
This commit is contained in:
@@ -94,10 +94,12 @@ describe('PropertiesModal', () => {
|
||||
describe('without metadata', () => {
|
||||
const wrapper = setup({ colorScheme: 'SUPERSET_DEFAULT' });
|
||||
const modalInstance = wrapper.find('PropertiesModal').instance();
|
||||
it('does not update the color scheme in the metadata', () => {
|
||||
it('updates the color scheme in the metadata', () => {
|
||||
const spy = jest.spyOn(modalInstance, 'onMetadataChange');
|
||||
modalInstance.onColorSchemeChange('SUPERSET_DEFAULT');
|
||||
expect(spy).not.toHaveBeenCalled();
|
||||
expect(spy).toHaveBeenCalledWith(
|
||||
'{"something": "foo", "color_scheme": "SUPERSET_DEFAULT", "label_colors": {}}',
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('with metadata', () => {
|
||||
@@ -125,10 +127,12 @@ describe('PropertiesModal', () => {
|
||||
json_metadata: '{"timed_refresh_immune_slices": []}',
|
||||
},
|
||||
});
|
||||
it('will not update the metadata', () => {
|
||||
it('will update the metadata', () => {
|
||||
const spy = jest.spyOn(modalInstance, 'onMetadataChange');
|
||||
modalInstance.onColorSchemeChange('SUPERSET_DEFAULT');
|
||||
expect(spy).not.toHaveBeenCalled();
|
||||
expect(spy).toHaveBeenCalledWith(
|
||||
'{"something": "foo", "color_scheme": "SUPERSET_DEFAULT", "label_colors": {}}',
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user