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:
Chris Williams
2018-07-12 11:50:25 -07:00
committed by GitHub
parent f9352af80e
commit 19ac6e1231
72 changed files with 657 additions and 524 deletions

View File

@@ -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;
}