This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from graceguo-supercat/gg-CherryPickDashboard…
…ImprovementPRs [cherry-picks] a few dashboard improvement PRs
- Loading branch information
Showing
9 changed files
with
145 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
superset/assets/src/dashboard/components/DeleteComponentModal.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Button } from 'react-bootstrap'; | ||
|
||
import ModalTrigger from '../../components/ModalTrigger'; | ||
import { t } from '../../locales'; | ||
|
||
const propTypes = { | ||
triggerNode: PropTypes.node.isRequired, | ||
onDelete: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default class DeleteComponentModal extends React.PureComponent { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.modal = null; | ||
this.close = this.close.bind(this); | ||
this.deleteTab = this.deleteTab.bind(this); | ||
this.setModalRef = this.setModalRef.bind(this); | ||
} | ||
|
||
setModalRef(ref) { | ||
this.modal = ref; | ||
} | ||
|
||
close() { | ||
this.modal.close(); | ||
} | ||
|
||
deleteTab() { | ||
this.modal.close(); | ||
this.props.onDelete(); | ||
} | ||
|
||
render() { | ||
return ( | ||
<ModalTrigger | ||
ref={this.setModalRef} | ||
triggerNode={this.props.triggerNode} | ||
modalBody={ | ||
<div className="delete-component-modal"> | ||
<h1>{t('Delete dashboard tab?')}</h1> | ||
<div> | ||
Deleting a tab will remove all content within it. You may still | ||
reverse this action with the <b>undo</b> button (cmd + z) until | ||
you save your changes. | ||
</div> | ||
<div className="delete-modal-actions-container"> | ||
<Button onClick={this.close}>{t('Cancel')}</Button> | ||
<Button bsStyle="primary" onClick={this.deleteTab}> | ||
{t('Delete')} | ||
</Button> | ||
</div> | ||
</div> | ||
} | ||
/> | ||
); | ||
} | ||
} | ||
|
||
DeleteComponentModal.propTypes = propTypes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
superset/assets/src/dashboard/stylesheets/components/markdown.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters