diff --git a/superset/assets/javascripts/explorev2/components/SelectField.jsx b/superset/assets/javascripts/explorev2/components/SelectField.jsx index f9686e06bd687..dacff881b15b4 100644 --- a/superset/assets/javascripts/explorev2/components/SelectField.jsx +++ b/superset/assets/javascripts/explorev2/components/SelectField.jsx @@ -1,11 +1,11 @@ import React, { PropTypes } from 'react'; import Select, { Creatable } from 'react-select'; - const propTypes = { choices: PropTypes.array, clearable: PropTypes.bool, description: PropTypes.string, + editUrl: PropTypes.string, freeForm: PropTypes.bool, label: PropTypes.string, multi: PropTypes.bool, @@ -18,6 +18,7 @@ const defaultProps = { choices: [], clearable: true, description: null, + editUrl: null, freeForm: false, label: null, multi: false, @@ -89,6 +90,9 @@ export default class SelectField extends React.Component { return (
{selectWrap} + {this.props.editUrl && + edit + }
); } diff --git a/superset/assets/javascripts/explorev2/stores/fields.js b/superset/assets/javascripts/explorev2/stores/fields.js index 0866f090d625b..f8c7fcb36cb43 100644 --- a/superset/assets/javascripts/explorev2/stores/fields.js +++ b/superset/assets/javascripts/explorev2/stores/fields.js @@ -31,6 +31,7 @@ export const fields = { label: 'Datasource', clearable: false, default: null, + editUrl: '/tablemodelview/edit', mapStateToProps: (state) => ({ choices: state.datasources || [], }),