mirror of
https://github.com/apache/superset.git
synced 2026-04-21 09:04:38 +00:00
Add an "Edit Mode" to Dashboard view (#3940)
* Add a togglable edit mode to dashboard * Submenu for controls * Allowing 'Save as' outside of editMode * Set editMode to false as default
This commit is contained in:
committed by
Grace Guo
parent
6cbe0e6096
commit
d9fda346cb
@@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Modal } from 'react-bootstrap';
|
||||
import { Modal, MenuItem } from 'react-bootstrap';
|
||||
import cx from 'classnames';
|
||||
|
||||
import Button from './Button';
|
||||
|
||||
const propTypes = {
|
||||
@@ -13,6 +14,7 @@ const propTypes = {
|
||||
beforeOpen: PropTypes.func,
|
||||
onExit: PropTypes.func,
|
||||
isButton: PropTypes.bool,
|
||||
isMenuItem: PropTypes.bool,
|
||||
bsSize: PropTypes.string,
|
||||
className: PropTypes.string,
|
||||
tooltip: PropTypes.string,
|
||||
@@ -23,6 +25,7 @@ const defaultProps = {
|
||||
beforeOpen: () => {},
|
||||
onExit: () => {},
|
||||
isButton: false,
|
||||
isMenuItem: false,
|
||||
bsSize: null,
|
||||
className: '',
|
||||
};
|
||||
@@ -86,6 +89,13 @@ export default class ModalTrigger extends React.Component {
|
||||
{this.renderModal()}
|
||||
</Button>
|
||||
);
|
||||
} else if (this.props.isMenuItem) {
|
||||
return (
|
||||
<MenuItem onClick={this.open}>
|
||||
{this.props.triggerNode}
|
||||
{this.renderModal()}
|
||||
</MenuItem>
|
||||
);
|
||||
}
|
||||
/* eslint-disable jsx-a11y/interactive-supports-focus */
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user