mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[explore-v2] add edit link below datasource select (#1919)
* add edit link below datasource select * add default prop
This commit is contained in:
@@ -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 (
|
||||
<div>
|
||||
{selectWrap}
|
||||
{this.props.editUrl &&
|
||||
<a href={`${this.props.editUrl}/${this.props.value}`}>edit</a>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ export const fields = {
|
||||
label: 'Datasource',
|
||||
clearable: false,
|
||||
default: null,
|
||||
editUrl: '/tablemodelview/edit',
|
||||
mapStateToProps: (state) => ({
|
||||
choices: state.datasources || [],
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user