Skip to content

Commit

Permalink
Modify CSS to match Kibana norms
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdavies committed May 8, 2019
1 parent 961eaea commit 4ae26ab
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions x-pack/plugins/lens/public/drag_drop/drag_drop.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.drag-drop_is-drop-target {
.lnsDragDrop-isDropTarget {
background-color: transparentize($euiColorSecondary, .9);
}

.drag-drop_is-active-drop-target {
.lnsDragDrop-isActiveDropTarget {
background-color: transparentize($euiColorSecondary, .75);
}
8 changes: 4 additions & 4 deletions x-pack/plugins/lens/public/drag_drop/drag_drop.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('DragDrop', () => {
const preventDefault = jest.fn(() => {});
const component = shallow(<DragDrop droppable>Hello!</DragDrop>);

component.find('[data-test-subj="drag-drop"]').simulate('dragover', { preventDefault });
component.find('[data-test-subj="lnsDragDrop"]').simulate('dragover', { preventDefault });

expect(preventDefault).toBeCalled();
});
Expand All @@ -35,7 +35,7 @@ describe('DragDrop', () => {
const preventDefault = jest.fn(() => {});
const component = shallow(<DragDrop>Hello!</DragDrop>);

component.find('[data-test-subj="drag-drop"]').simulate('dragover', { preventDefault });
component.find('[data-test-subj="lnsDragDrop"]').simulate('dragover', { preventDefault });

expect(preventDefault).not.toBeCalled();
});
Expand All @@ -54,7 +54,7 @@ describe('DragDrop', () => {
</ChildDragDropProvider>
);

component.find('[data-test-subj="drag-drop"]').simulate('dragstart', { dataTransfer });
component.find('[data-test-subj="lnsDragDrop"]').simulate('dragstart', { dataTransfer });

jest.runAllTimers();

Expand All @@ -78,7 +78,7 @@ describe('DragDrop', () => {
);

component
.find('[data-test-subj="drag-drop"]')
.find('[data-test-subj="lnsDragDrop"]')
.simulate('drop', { preventDefault, stopPropagation });

expect(preventDefault).toBeCalled();
Expand Down
10 changes: 5 additions & 5 deletions x-pack/plugins/lens/public/drag_drop/drag_drop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ export function DragDrop(props: Props) {
const isDragging = draggable && value === dragging;

const classSuffix =
' drag-drop' +
(droppable ? ' drag-drop_is-drop-target' : '') +
(droppable && state.isActive ? ' drag-drop_is-active-drop-target' : '') +
(isDragging ? ' drag-drop_is-dragging' : '');
' lnsDragDrop' +
(droppable ? ' lnsDragDrop-isDropTarget' : '') +
(droppable && state.isActive ? ' lnsDragDrop_isActiveDropTarget' : '') +

This comment has been minimized.

Copy link
@cchaos

cchaos May 8, 2019

Contributor

Looks like you've got a mismatch for this classname. It should be lnsDragDrop-isActiveDropTarget

This comment has been minimized.

Copy link
@chrisdavies

chrisdavies May 8, 2019

Author Contributor

You're right!

(isDragging ? ' lnsDragDrop_isDragging' : '');

This comment has been minimized.

Copy link
@cchaos

cchaos May 8, 2019

Contributor

This one should also use a dash instead of underscore


const dragStart = (e: DroppableEvent) => {
// Setting stopPropgagation causes Chrome failures, so
Expand Down Expand Up @@ -122,7 +122,7 @@ export function DragDrop(props: Props) {

return (
<div
data-test-subj="drag-drop"
data-test-subj="lnsDragDrop"
className={`${className || ''}${classSuffix}`}
onDragOver={dragOver}
onDragLeave={dragLeave}
Expand Down

0 comments on commit 4ae26ab

Please sign in to comment.