forked from p15670423/monkey
UI: Fix incorrect allPluginNames in AdvancedMultiSelect.js
All plugin names were in fact only the initially selected values
This commit is contained in:
parent
3bbbca783d
commit
d0612f06d8
|
@ -33,19 +33,20 @@ class AdvancedMultiSelect extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
let pluginNames = this.props.value.map(v => v.name);
|
let selectedPluginNames = this.props.value.map(v => v.name);
|
||||||
|
let allPluginNames = this.props.options.enumOptions.map(v => v.value);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
infoPaneParams: getDefaultPaneParams(
|
infoPaneParams: getDefaultPaneParams(
|
||||||
this.props.schema.items.$ref,
|
this.props.schema.items.$ref,
|
||||||
this.props.registry,
|
this.props.registry,
|
||||||
this.isUnsafeOptionSelected(pluginNames)
|
this.isUnsafeOptionSelected(selectedPluginNames)
|
||||||
),
|
),
|
||||||
allPluginNames: pluginNames,
|
allPluginNames: allPluginNames,
|
||||||
masterCheckboxState: this.getMasterCheckboxState(pluginNames),
|
masterCheckboxState: this.getMasterCheckboxState(selectedPluginNames),
|
||||||
pluginDefinitions: getObjectFromRegistryByRef(this.props.schema.items.$ref,
|
pluginDefinitions: getObjectFromRegistryByRef(this.props.schema.items.$ref,
|
||||||
this.props.registry).pluginDefs,
|
this.props.registry).pluginDefs,
|
||||||
selectedPluginNames: pluginNames
|
selectedPluginNames: selectedPluginNames
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,8 +58,8 @@ class AdvancedMultiSelect extends React.Component {
|
||||||
let newValues = [];
|
let newValues = [];
|
||||||
for (let j = 0; j < strValues.length; j++) {
|
for (let j = 0; j < strValues.length; j++) {
|
||||||
let found = false;
|
let found = false;
|
||||||
for (let i = 0; i < this.props.value.length; i++) {
|
for (let i = 0; i < this.state.allPluginNames.length; i++) {
|
||||||
if (strValues[j] === this.props.value[i]['name']) {
|
if (strValues[j] === this.state.allPluginNames[i]['name']) {
|
||||||
newValues.push(JSON.parse(JSON.stringify(this.props.value[i])))
|
newValues.push(JSON.parse(JSON.stringify(this.props.value[i])))
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue