forked from p15670423/monkey
UI: Fix info pane in AdvancedMultiSelect.js
This commit is contained in:
parent
20f091ff4e
commit
d527881770
|
@ -33,12 +33,19 @@ class AdvancedMultiSelect extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
|
let pluginNames = this.props.value.map(v => v.name);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
allPluginNames: this.props.value.map(v => v.name),
|
infoPaneParams: getDefaultPaneParams(
|
||||||
masterCheckboxState: this.getMasterCheckboxState(this.props.value.map(v => v.name)),
|
this.props.schema.items.$ref,
|
||||||
|
this.props.registry,
|
||||||
|
this.isUnsafeOptionSelected(pluginNames)
|
||||||
|
),
|
||||||
|
allPluginNames: pluginNames,
|
||||||
|
masterCheckboxState: this.getMasterCheckboxState(pluginNames),
|
||||||
pluginDefinitions: getObjectFromRegistryByRef(this.props.schema.items.$ref,
|
pluginDefinitions: getObjectFromRegistryByRef(this.props.schema.items.$ref,
|
||||||
this.props.registry).pluginDefs,
|
this.props.registry).pluginDefs,
|
||||||
selectedPluginNames: this.props.value.map(v => v.name)
|
selectedPluginNames: pluginNames
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,12 +180,6 @@ class AdvancedMultiSelect extends React.Component {
|
||||||
schema
|
schema
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
let paneParams = getDefaultPaneParams(
|
|
||||||
this.props.schema.items.$ref,
|
|
||||||
this.props.registry,
|
|
||||||
this.isUnsafeOptionSelected(this.state.selectedPluginNames)
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'advanced-multi-select'}>
|
<div className={'advanced-multi-select'}>
|
||||||
<AdvancedMultiSelectHeader title={schema.title}
|
<AdvancedMultiSelectHeader title={schema.title}
|
||||||
|
@ -196,10 +197,10 @@ class AdvancedMultiSelect extends React.Component {
|
||||||
selectedValues={this.state.selectedPluginNames}
|
selectedValues={this.state.selectedPluginNames}
|
||||||
enumOptions={this.getOptionList()}/>
|
enumOptions={this.getOptionList()}/>
|
||||||
|
|
||||||
<InfoPane title={paneParams.title}
|
<InfoPane title={this.state.infoPaneParams.title}
|
||||||
body={paneParams.content}
|
body={this.state.infoPaneParams.content}
|
||||||
link={paneParams.link}
|
link={this.state.infoPaneParams.link}
|
||||||
warningType={paneParams.warningType}/>
|
warningType={this.state.infoPaneParams.warningType}/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue