diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/UISchemaManipulators.tsx b/monkey/monkey_island/cc/ui/src/components/configuration-components/UISchemaManipulators.tsx index 637a128f3..34ceb4ab4 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/UISchemaManipulators.tsx +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/UISchemaManipulators.tsx @@ -12,7 +12,7 @@ function applyUiSchemaManipulators(selectedSection, function ransomwareDirManipulator(selectedSection, formData, uiSchema) { - if (selectedSection === 'ransomware'){ + if (selectedSection === 'payloads'){ uiSchema.encryption.directories = {'ui:disabled': !formData['encryption']['enabled']}; } diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js index 43423263f..d70a6f32c 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js @@ -74,9 +74,18 @@ export default function UiSchema(props) { info_box : { 'ui:field': InfoBox }, + directories: { + // Directory inputs are dynamically hidden + }, text_box: { 'ui:field': TextBox + }, + enabled: { + 'ui:widget': 'hidden' } + }, + other_behaviors : { + 'ui:widget': 'hidden' } }, custom_pbas: { diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js index f12e95a1c..23e21bf1a 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js @@ -74,6 +74,9 @@ class ConfigurePageComponent extends AuthComponent { .then(data => { let sections = []; let monkeyConfig = data[0]; + // TODO: Fix when we add plugins + monkeyConfig['payloads'] = monkeyConfig['payloads'][0]['options']; + this.setInitialConfig(monkeyConfig); for (let sectionKey of this.getSectionsOrder()) { sections.push({ @@ -269,10 +272,6 @@ class ConfigurePageComponent extends AuthComponent { this.currentSection = key; let selectedSectionData = this.state.configuration[key]; - if(key == 'payloads') { - selectedSectionData = this.state.configuration[key][0]['options']; - } - this.setState({ selectedSection: key, currentFormData: selectedSectionData