mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
[security] improving the security scheme (#1587)
* [security] improving the security scheme * Addressing comments * improving docs * Creating security module to organize things * Moving CLI to its own module * perms * Materializung perms * progrss * Addressing comments, linting
This commit is contained in:
committed by
GitHub
parent
aad9744d85
commit
bce02e3f51
@@ -158,7 +158,7 @@ export function setNetworkStatus(networkOn) {
|
||||
export function addAlert(alert) {
|
||||
const o = Object.assign({}, alert);
|
||||
o.id = shortid.generate();
|
||||
return { type: ADD_ALERT, o };
|
||||
return { type: ADD_ALERT, alert: o };
|
||||
}
|
||||
|
||||
export function removeAlert(alert) {
|
||||
|
||||
@@ -2,6 +2,13 @@ const $ = window.$ = require('jquery');
|
||||
import React from 'react';
|
||||
import Select from 'react-select';
|
||||
|
||||
const propTypes = {
|
||||
onChange: React.PropTypes.func,
|
||||
actions: React.PropTypes.object,
|
||||
databaseId: React.PropTypes.number,
|
||||
valueRenderer: React.PropTypes.func,
|
||||
};
|
||||
|
||||
class DatabaseSelect extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
@@ -23,6 +30,12 @@ class DatabaseSelect extends React.PureComponent {
|
||||
const options = data.result.map((db) => ({ value: db.id, label: db.database_name }));
|
||||
this.setState({ databaseOptions: options, databaseLoading: false });
|
||||
this.props.actions.setDatabases(data.result);
|
||||
if (data.result.length === 0) {
|
||||
this.props.actions.addAlert({
|
||||
bsStyle: 'danger',
|
||||
msg: "It seems you don't have access to any database",
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
render() {
|
||||
@@ -43,11 +56,6 @@ class DatabaseSelect extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
DatabaseSelect.propTypes = {
|
||||
onChange: React.PropTypes.func,
|
||||
actions: React.PropTypes.object,
|
||||
databaseId: React.PropTypes.number,
|
||||
valueRenderer: React.PropTypes.func,
|
||||
};
|
||||
DatabaseSelect.propTypes = propTypes;
|
||||
|
||||
export default DatabaseSelect;
|
||||
|
||||
Reference in New Issue
Block a user