mirror of
https://github.com/apache/superset.git
synced 2026-06-07 00:29:17 +00:00
get rid of global notify (#5355)
* [toasts] get rid of notify globals, refactor messageToasts for use by entire app * [remove notify] use arrow func in ajax call * fix lint + tests * actually fix tests from messageToast refactor * add 'test:one' npm script * debugger * [toasts] convert bootstrap flash messages to toasts in explore + sqllab * [toasts][tests] import from right file
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
/* eslint no-undef: 2 */
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Button } from 'react-bootstrap';
|
||||
@@ -14,7 +15,7 @@ import { STATUS_OPTIONS, TIME_OPTIONS } from '../constants';
|
||||
import AsyncSelect from '../../components/AsyncSelect';
|
||||
import { t } from '../../locales';
|
||||
|
||||
const $ = (window.$ = require('jquery'));
|
||||
const $ = require('jquery');
|
||||
|
||||
const propTypes = {
|
||||
actions: PropTypes.object.isRequired,
|
||||
@@ -127,10 +128,7 @@ class QuerySearch extends React.PureComponent {
|
||||
const options = data.result.map(db => ({ value: db.id, label: db.database_name }));
|
||||
this.props.actions.setDatabases(data.result);
|
||||
if (data.result.length === 0) {
|
||||
this.props.actions.addAlert({
|
||||
bsStyle: 'danger',
|
||||
msg: t("It seems you don't have access to any database"),
|
||||
});
|
||||
this.props.actions.addDangerToast(t("It seems you don't have access to any database"));
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user