mirror of
https://github.com/maputnik/editor.git
synced 2026-02-12 23:50:03 +00:00
Merge remote-tracking branch 'upstream/master' into feature/make-layer-visibility-always-shown
Conflicts: src/components/layers/LayerListItem.jsx
This commit is contained in:
@@ -29,10 +29,10 @@ class JSONEditor extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
this.setState({
|
||||
code: JSON.stringify(nextProps.layer, null, 2)
|
||||
})
|
||||
static getDerivedStateFromProps(props, state) {
|
||||
return {
|
||||
code: JSON.stringify(props.layer, null, 2)
|
||||
};
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
|
||||
@@ -76,18 +76,18 @@ export default class LayerEditor extends React.Component {
|
||||
this.state = { editorGroups }
|
||||
}
|
||||
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
const additionalGroups = { ...this.state.editorGroups }
|
||||
static getDerivedStateFromProps(props, state) {
|
||||
const additionalGroups = { ...state.editorGroups }
|
||||
|
||||
layout[nextProps.layer.type].groups.forEach(group => {
|
||||
layout[props.layer.type].groups.forEach(group => {
|
||||
if(!(group.title in additionalGroups)) {
|
||||
additionalGroups[group.title] = true
|
||||
}
|
||||
})
|
||||
|
||||
this.setState({
|
||||
return {
|
||||
editorGroups: additionalGroups
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
getChildContext () {
|
||||
|
||||
@@ -122,7 +122,7 @@ class LayerListItem extends React.Component {
|
||||
/>
|
||||
<IconAction
|
||||
wdKey={"layer-list-item:"+this.props.layerId+":toggle-visibility"}
|
||||
action={this.props.visibility === 'visible' ? 'hide' : 'show'}
|
||||
action={this.props.visibility === 'visible' ? 'show' : 'hide'}
|
||||
classBlockName="visibility"
|
||||
onClick={e => this.props.onLayerVisibilityToggle(this.props.layerId)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user