diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js b/monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js index 9c1468d8d..38e52271e 100644 --- a/monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js +++ b/monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js @@ -1,5 +1,4 @@ -import React, {useState} from 'react'; - +import React from "react"; import {Card, Button, Form} from 'react-bootstrap'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; import {faCheckSquare} from '@fortawesome/free-solid-svg-icons'; @@ -22,14 +21,6 @@ function getSelectValuesAfterClick(valueArray, clickedValue) { } } -function onMasterCheckboxClick(checkboxValue, defaultArray, onChangeFnc) { - if (checkboxValue) { - onChangeFnc([]); - } else { - onChangeFnc(defaultArray); - } -} - // Definitions passed to components only contains value and label, // custom fields like "info" or "links" must be pulled from registry object using this function function getFullDefinitionsFromRegistry(refString, registry) { @@ -46,76 +37,97 @@ function getFullDefinitionByKey(refString, registry, itemKey) { return fullArray.filter(e => (e.enum[0] === itemKey))[0]; } -function setPaneInfo(refString, registry, itemKey, setPaneInfoFnc) { - let definitionObj = getFullDefinitionByKey(refString, registry, itemKey); - setPaneInfoFnc({title: definitionObj.title, content: definitionObj.info, link: definitionObj.link}); -} - function getDefaultPaneParams(refString, registry) { let configSection = getObjectFromRegistryByRef(refString, registry); return ({title: configSection.title, content: configSection.description}); } -function AdvancedMultiSelect(props) { - const [masterCheckbox, setMasterCheckbox] = useState(true); - const { - schema, - id, - options, - value, - required, - disabled, - readonly, - multiple, - autofocus, - onChange, - registry - } = props; - const {enumOptions} = options; - const [infoPaneParams, setInfoPaneParams] = useState(getDefaultPaneParams(schema.items.$ref, registry)); - getDefaultPaneParams(schema.items.$ref, registry); - const selectValue = cloneDeep(value); - return ( -