mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
[Lyft-GA] Enable color consistency in a dashboard (#7135)
* Enable color consistency in a dashboard Moved actions, minor UI, allowed dashboard copy Fix linting errors Undo unintentional change Updated and added unit tests Fail quietly if package has not been updated Fail quietly on dashboard copy if package is old * Update packages * Remove unnecessary code * Addressed Grace's comments * Small fix for item key * Reset chart's color during exploration * Do not reset chart form data when exploring chart
This commit is contained in:
committed by
Christine Chambers
parent
f66b598d37
commit
e974a23f90
@@ -31,6 +31,7 @@ import DashboardComponent from '../../../../src/dashboard/containers/DashboardCo
|
||||
import DashboardHeader from '../../../../src/dashboard/containers/DashboardHeader';
|
||||
import DashboardGrid from '../../../../src/dashboard/containers/DashboardGrid';
|
||||
import * as dashboardStateActions from '../../../../src/dashboard/actions/dashboardState';
|
||||
import { BUILDER_PANE_TYPE } from '../../../../src/dashboard/util/constants';
|
||||
|
||||
import WithDragDropContext from '../helpers/WithDragDropContext';
|
||||
import {
|
||||
@@ -61,7 +62,10 @@ describe('DashboardBuilder', () => {
|
||||
dashboardLayout,
|
||||
deleteTopLevelTabs() {},
|
||||
editMode: false,
|
||||
showBuilderPane: false,
|
||||
showBuilderPane() {},
|
||||
builderPaneType: BUILDER_PANE_TYPE.NONE,
|
||||
setColorSchemeAndUnsavedChanges() {},
|
||||
colorScheme: undefined,
|
||||
handleComponentDrop() {},
|
||||
toggleBuilderPane() {},
|
||||
};
|
||||
@@ -143,11 +147,27 @@ describe('DashboardBuilder', () => {
|
||||
expect(parentSize.find(DashboardGrid)).toHaveLength(expectedCount);
|
||||
});
|
||||
|
||||
it('should render a BuilderComponentPane if editMode=showBuilderPane=true', () => {
|
||||
it('should render a BuilderComponentPane if editMode=true and user selects "Insert Components" pane', () => {
|
||||
const wrapper = setup();
|
||||
expect(wrapper.find(BuilderComponentPane)).toHaveLength(0);
|
||||
|
||||
wrapper.setProps({ ...props, editMode: true, showBuilderPane: true });
|
||||
wrapper.setProps({
|
||||
...props,
|
||||
editMode: true,
|
||||
builderPaneType: BUILDER_PANE_TYPE.ADD_COMPONENTS,
|
||||
});
|
||||
expect(wrapper.find(BuilderComponentPane)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('should render a BuilderComponentPane if editMode=true and user selects "Colors" pane', () => {
|
||||
const wrapper = setup();
|
||||
expect(wrapper.find(BuilderComponentPane)).toHaveLength(0);
|
||||
|
||||
wrapper.setProps({
|
||||
...props,
|
||||
editMode: true,
|
||||
builderPaneType: BUILDER_PANE_TYPE.COLORS,
|
||||
});
|
||||
expect(wrapper.find(BuilderComponentPane)).toHaveLength(1);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user