- {columnItems.map((componentId, itemIndex) => (
-
- ))}
+ {columnItems.length === 0 ? (
+
{t('Empty column')}
+ ) : (
+ columnItems.map((componentId, itemIndex) => (
+
+ ))
+ )}
{dropIndicatorProps &&
}
-
+
)}
diff --git a/superset-frontend/src/dashboard/components/gridComponents/Divider.jsx b/superset-frontend/src/dashboard/components/gridComponents/Divider.jsx
index 8be4fe892485..078405be3e4a 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/Divider.jsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/Divider.jsx
@@ -18,6 +18,7 @@
*/
import React from 'react';
import PropTypes from 'prop-types';
+import { css, styled } from '@superset-ui/core';
import DragDroppable from '../dnd/DragDroppable';
import HoverMenu from '../menu/HoverMenu';
@@ -36,6 +37,31 @@ const propTypes = {
deleteComponent: PropTypes.func.isRequired,
};
+const DividerLine = styled.div`
+ ${({ theme }) => css`
+ width: 100%;
+ padding: ${theme.gridUnit * 2}px 0; /* this is padding not margin to enable a larger mouse target */
+ background-color: transparent;
+
+ &:after {
+ content: '';
+ height: 1px;
+ width: 100%;
+ background-color: ${theme.colors.grayscale.light2};
+ display: block;
+ }
+
+ div[draggable='true'] & {
+ cursor: move;
+ }
+
+ .dashboard-component-tabs & {
+ padding-left: ${theme.gridUnit * 4}px;
+ padding-right: ${theme.gridUnit * 4}px;
+ }
+ `}
+`;
+
class Divider extends React.PureComponent {
constructor(props) {
super(props);
@@ -75,7 +101,7 @@ class Divider extends React.PureComponent {
)}
-
- {rowItems.map((componentId, itemIndex) => (
-
- ))}
+ {rowItems.length === 0 ? (
+
{t('Empty row')}
+ ) : (
+ rowItems.map((componentId, itemIndex) => (
+
+ ))
+ )}
{dropIndicatorProps &&
}
-
+
)}
diff --git a/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.jsx b/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.jsx
index f4f33c9333df..c261fd2da25e 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.jsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.jsx
@@ -19,10 +19,11 @@
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
+import { css, styled } from '@superset-ui/core';
-import DragDroppable from '../../dnd/DragDroppable';
-import { NEW_COMPONENTS_SOURCE_ID } from '../../../util/constants';
-import { NEW_COMPONENT_SOURCE_TYPE } from '../../../util/componentTypes';
+import DragDroppable from 'src/dashboard/components/dnd/DragDroppable';
+import { NEW_COMPONENTS_SOURCE_ID } from 'src/dashboard/util/constants';
+import { NEW_COMPONENT_SOURCE_TYPE } from 'src/dashboard/util/componentTypes';
const propTypes = {
id: PropTypes.string.isRequired,
@@ -35,6 +36,53 @@ const defaultProps = {
className: null,
};
+const NewComponent = styled.div`
+ ${({ theme }) => css`
+ display: flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+ align-items: center;
+ padding: ${theme.gridUnit * 4}px;
+ background: ${theme.colors.grayscale.light5};
+ cursor: move;
+
+ &:not(.static):hover {
+ background: ${theme.colors.grayscale.light4};
+ }
+ `}
+`;
+
+const NewComponentPlaceholder = styled.div`
+ ${({ theme }) => css`
+ position: relative;
+ background: ${theme.colors.grayscale.light4};
+ width: ${theme.gridUnit * 10}px;
+ height: ${theme.gridUnit * 10}px;
+ margin-right: ${theme.gridUnit * 4}px;
+ border: 1px solid ${theme.colors.grayscale.light5};
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: ${theme.colors.text.label};
+ font-size: ${theme.typography.sizes.xxl}px;
+
+ &.fa-window-restore {
+ font-size: ${theme.typography.sizes.l}px;
+ }
+
+ &.fa-area-chart {
+ font-size: ${theme.typography.sizes.xl}px;
+ }
+
+ &.divider-placeholder:after {
+ content: '';
+ height: 2px;
+ width: 100%;
+ background-color: ${theme.colors.grayscale.light2};
+ }
+ `}
+`;
+
export default class DraggableNewComponent extends React.PureComponent {
render() {
const { label, id, type, className, meta } = this.props;
@@ -50,14 +98,12 @@ export default class DraggableNewComponent extends React.PureComponent {
editMode
>
{({ dragSourceRef }) => (
-