diff --git a/ui/src/dashboards/components/template_variables/Manager.js b/ui/src/dashboards/components/template_variables/Manager.js
index a52aa11a6..d1360cf05 100644
--- a/ui/src/dashboards/components/template_variables/Manager.js
+++ b/ui/src/dashboards/components/template_variables/Manager.js
@@ -42,7 +42,7 @@ const TemplateVariableManager = ({
>
Save Changes
-
+
@@ -175,11 +175,24 @@ class TemplateVariableManagerWrapper extends Component {
)
}
+ handleDismissManager = () => {
+ const {onDismissOverlay} = this.props
+ const {isEdited} = this.state
+
+ if (
+ !isEdited ||
+ (isEdited && confirm('Do you want to close without saving?')) // eslint-disable-line no-alert
+ ) {
+ onDismissOverlay()
+ }
+ }
+
render() {
const {rows, isEdited} = this.state
return (
{
- this.setState({isTemplating: true})
- }
-
- handleCloseTemplateManager = isEdited => () => {
- if (
- !isEdited ||
- (isEdited && confirm('Do you want to close without saving?')) // eslint-disable-line no-alert
- ) {
- this.setState({isTemplating: false})
+ const {handleShowOverlay, dashboard, source} = this.props
+ const options = {
+ dismissOnClickOutside: false,
+ dismissOnEscape: false,
}
+
+ handleShowOverlay(
+ ,
+ options
+ )
}
handleSaveEditedCell = newCell => {
@@ -353,7 +357,7 @@ class DashboardPage extends Component {
templatesIncludingDashTime = []
}
- const {isEditMode, isTemplating} = this.state
+ const {isEditMode} = this.state
const names = dashboards.map(d => ({
name: d.name,
@@ -362,17 +366,6 @@ class DashboardPage extends Component {
return (
- {isTemplating ? (
-
-
-
- ) : null}
{selectedCell ? (
{
@@ -609,6 +603,7 @@ const mapDispatchToProps = dispatch => ({
dismissEditingAnnotation,
dispatch
),
+ handleShowOverlay: bindActionCreators(showOverlay, dispatch),
})
export default connect(mapStateToProps, mapDispatchToProps)(