mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
[dashboard] notify instead of modal onSave (#2941)
* [dashboard] notify instead of modal onSave * Addressing comments
This commit is contained in:
committed by
GitHub
parent
987cb9978d
commit
24e3c7f89a
@@ -7,6 +7,7 @@ import moment from 'moment';
|
|||||||
import GridLayout from './components/GridLayout';
|
import GridLayout from './components/GridLayout';
|
||||||
import Header from './components/Header';
|
import Header from './components/Header';
|
||||||
import { appSetup } from '../common';
|
import { appSetup } from '../common';
|
||||||
|
import AlertsWrapper from '../components/AlertsWrapper';
|
||||||
|
|
||||||
import '../../stylesheets/dashboard.css';
|
import '../../stylesheets/dashboard.css';
|
||||||
|
|
||||||
@@ -60,7 +61,10 @@ function renderAlert() {
|
|||||||
|
|
||||||
function initDashboardView(dashboard) {
|
function initDashboardView(dashboard) {
|
||||||
render(
|
render(
|
||||||
<Header dashboard={dashboard} />,
|
<div>
|
||||||
|
<AlertsWrapper />
|
||||||
|
<Header dashboard={dashboard} />
|
||||||
|
</div>,
|
||||||
document.getElementById('dashboard-header'),
|
document.getElementById('dashboard-header'),
|
||||||
);
|
);
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
@@ -332,7 +336,7 @@ export function dashboardContainer(dashboard, datasources, userid) {
|
|||||||
const errorMsg = getAjaxErrorMsg(error);
|
const errorMsg = getAjaxErrorMsg(error);
|
||||||
utils.showModal({
|
utils.showModal({
|
||||||
title: 'Error',
|
title: 'Error',
|
||||||
body: 'Sorry, there was an error adding slices to this dashboard: </ br>' + errorMsg,
|
body: 'Sorry, there was an error adding slices to this dashboard: ' + errorMsg,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
|
/* global notify */
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Button, FormControl, FormGroup, Radio } from 'react-bootstrap';
|
import { Button, FormControl, FormGroup, Radio } from 'react-bootstrap';
|
||||||
import { getAjaxErrorMsg, showModal } from '../../modules/utils';
|
import { getAjaxErrorMsg } from '../../modules/utils';
|
||||||
import ModalTrigger from '../../components/ModalTrigger';
|
import ModalTrigger from '../../components/ModalTrigger';
|
||||||
|
|
||||||
const $ = window.$ = require('jquery');
|
const $ = window.$ = require('jquery');
|
||||||
@@ -53,19 +54,13 @@ class SaveModal extends React.PureComponent {
|
|||||||
if (saveType === 'newDashboard') {
|
if (saveType === 'newDashboard') {
|
||||||
window.location = '/superset/dashboard/' + resp.id + '/';
|
window.location = '/superset/dashboard/' + resp.id + '/';
|
||||||
} else {
|
} else {
|
||||||
showModal({
|
notify.success('This dashboard was saved successfully.');
|
||||||
title: 'Success',
|
|
||||||
body: 'This dashboard was saved successfully.',
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error(error) {
|
error(error) {
|
||||||
saveModal.close();
|
saveModal.close();
|
||||||
const errorMsg = getAjaxErrorMsg(error);
|
const errorMsg = getAjaxErrorMsg(error);
|
||||||
showModal({
|
notify.error('Sorry, there was an error saving this dashboard: </ br>' + errorMsg);
|
||||||
title: 'Error',
|
|
||||||
body: 'Sorry, there was an error saving this dashboard: </ br>' + errorMsg,
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user