diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationErrorMessages.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationErrorMessages.js index a5782948a..803e4e7e7 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationErrorMessages.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationErrorMessages.js @@ -1,4 +1,6 @@ -import {IP, IP_RANGE} from './ValidationFormats'; +import {IP, IP_RANGE, VALID_DIR_LINUX, VALID_DIR_WINDOWS} from './ValidationFormats'; + +let invalidDirMessage = 'Invalid directory. Path should be absolute or begin with an environment variable.'; export default function transformErrors(errors) { return errors.map(error => { @@ -8,6 +10,10 @@ export default function transformErrors(errors) { error.message = 'Invalid IP range, refer to description for valid examples.' } else if (error.name === 'format' && error.params.format === IP) { error.message = 'Invalid IP.' + } else if (error.name === 'format' && error.params.format === VALID_DIR_LINUX) { + error.message = invalidDirMessage + } else if (error.name === 'format' && error.params.format === VALID_DIR_WINDOWS) { + error.message = invalidDirMessage } return error; });