|
|
|
@ -3,28 +3,13 @@ import PropTypes from 'prop-types'
@@ -3,28 +3,13 @@ import PropTypes from 'prop-types'
|
|
|
|
|
import { Select } from 'antd'; |
|
|
|
|
import SubType from './components/SubType'; |
|
|
|
|
import Actions from './components/Actions'; |
|
|
|
|
import { connect } from 'react-redux' |
|
|
|
|
|
|
|
|
|
class Item extends Component { |
|
|
|
|
constructor(props) { |
|
|
|
|
super(props) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
componentWillMount() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
componentDidMount() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
componentWillReceiveProps(nextProps) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
componentWillUnmount() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onChange = (name, value_item) => { |
|
|
|
|
let {index, values, value, onChange} = this.props; |
|
|
|
|
if(index == 'new'){ |
|
|
|
@ -45,7 +30,7 @@ class Item extends Component {
@@ -45,7 +30,7 @@ class Item extends Component {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
|
let {value, users, factories} = this.props; |
|
|
|
|
let {value, users, factories, profile} = this.props; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className='field-group-permission item'> |
|
|
|
@ -64,7 +49,7 @@ class Item extends Component {
@@ -64,7 +49,7 @@ class Item extends Component {
|
|
|
|
|
> |
|
|
|
|
<Select.Option value={'factory'}>Підприємство</Select.Option> |
|
|
|
|
<Select.Option value={'user'}>Користувачі</Select.Option> |
|
|
|
|
<Select.Option value={'tabs'}>Сторінки</Select.Option> |
|
|
|
|
{profile.role == 'admin' && <Select.Option value={'tabs'}>Сторінки</Select.Option>} |
|
|
|
|
</Select> |
|
|
|
|
</div> |
|
|
|
|
<SubType {...this.props} onChange={this.onChange}/> |
|
|
|
@ -90,4 +75,13 @@ Item.propTypes = {
@@ -90,4 +75,13 @@ Item.propTypes = {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default Item |
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state, ownProps) => ({ |
|
|
|
|
profile: state.auth.profile, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const mapDispatchToProps = { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Item) |