style: use tabs in dashboard edit pane (#10394)

* style: use tabs in dashboard edit pane

* fix tests

* more hackin'

* getting ready to rip cell measurer

* working

* pogress

* Fix cards

* done

* fix jest

* fix cy
This commit is contained in:
Maxime Beauchemin
2020-08-05 18:53:53 -07:00
committed by GitHub
parent 51a88cb19b
commit ece91928a9
39 changed files with 417 additions and 614 deletions

View File

@@ -32,7 +32,6 @@ import DashboardComponent from 'src/dashboard/containers/DashboardComponent';
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 {
@@ -64,7 +63,6 @@ describe('DashboardBuilder', () => {
deleteTopLevelTabs() {},
editMode: false,
showBuilderPane() {},
builderPaneType: BUILDER_PANE_TYPE.NONE,
setColorSchemeAndUnsavedChanges() {},
colorScheme: undefined,
handleComponentDrop() {},
@@ -155,7 +153,6 @@ describe('DashboardBuilder', () => {
wrapper.setProps({
...props,
editMode: true,
builderPaneType: BUILDER_PANE_TYPE.ADD_COMPONENTS,
});
expect(wrapper.find(BuilderComponentPane)).toExist();
});
@@ -167,7 +164,6 @@ describe('DashboardBuilder', () => {
wrapper.setProps({
...props,
editMode: true,
builderPaneType: BUILDER_PANE_TYPE.COLORS,
});
expect(wrapper.find(BuilderComponentPane)).toExist();
});

View File

@@ -68,7 +68,7 @@ describe('HeaderActionsDropdown', () => {
it('should render two MenuItems', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(MenuItem)).toHaveLength(2);
expect(wrapper.find(MenuItem)).toHaveLength(3);
});
it('should render the RefreshIntervalModal', () => {

View File

@@ -25,7 +25,6 @@ import PublishedStatus from 'src/dashboard/components/PublishedStatus';
import HeaderActionsDropdown from 'src/dashboard/components/HeaderActionsDropdown';
import Button from 'src/components/Button';
import UndoRedoKeylisteners from 'src/dashboard/components/UndoRedoKeylisteners';
import { BUILDER_PANE_TYPE } from 'src/dashboard/util/constants';
describe('Header', () => {
const props = {
@@ -59,7 +58,6 @@ describe('Header', () => {
editMode: false,
setEditMode: () => {},
showBuilderPane: () => {},
builderPaneType: BUILDER_PANE_TYPE.NONE,
updateCss: () => {},
hasUnsavedChanges: false,
maxUndoHistoryExceeded: false,
@@ -111,11 +109,6 @@ describe('Header', () => {
expect(wrapper.find(HeaderActionsDropdown)).toExist();
});
it('should render one Button', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(Button)).toExist();
});
it('should not set up undo/redo', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(UndoRedoKeylisteners)).not.toExist();
@@ -154,11 +147,6 @@ describe('Header', () => {
expect(wrapper.find(HeaderActionsDropdown)).toExist();
});
it('should render one Button', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(Button)).toExist();
});
it('should not set up undo/redo', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(UndoRedoKeylisteners)).not.toExist();
@@ -199,7 +187,7 @@ describe('Header', () => {
it('should render five Buttons', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(Button)).toHaveLength(5);
expect(wrapper.find(Button)).toHaveLength(4);
});
it('should set up undo/redo', () => {
@@ -239,11 +227,6 @@ describe('Header', () => {
expect(wrapper.find(HeaderActionsDropdown)).toExist();
});
it('should render one Button', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(Button)).toExist();
});
it('should not set up undo/redo', () => {
const wrapper = setup(overrideProps);
expect(wrapper.find(UndoRedoKeylisteners)).not.toExist();

View File

@@ -16,14 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
import { BUILDER_PANE_TYPE } from 'src/dashboard/util/constants';
import { sliceId } from './mockChartQueries';
export default {
sliceIds: [sliceId],
expandedSlices: {},
editMode: false,
builderPaneType: BUILDER_PANE_TYPE.NONE,
hasUnsavedChanges: false,
maxUndoHistoryExceeded: false,
isStarred: true,

View File

@@ -30,7 +30,6 @@ import {
} from 'src/dashboard/actions/dashboardState';
import dashboardStateReducer from 'src/dashboard/reducers/dashboardState';
import { BUILDER_PANE_TYPE } from 'src/dashboard/util/constants';
describe('dashboardState reducer', () => {
it('should return initial state', () => {
@@ -72,7 +71,6 @@ describe('dashboardState reducer', () => {
),
).toEqual({
editMode: true,
builderPaneType: BUILDER_PANE_TYPE.ADD_COMPONENTS,
});
});
@@ -128,7 +126,6 @@ describe('dashboardState reducer', () => {
hasUnsavedChanges: false,
maxUndoHistoryExceeded: false,
editMode: false,
builderPaneType: BUILDER_PANE_TYPE.NONE,
updatedColorScheme: false,
});
});