From fade7177548fe76c777f474d56c5b1452ebb79ff Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Mon, 27 Jul 2020 17:00:29 +0300 Subject: [PATCH] Linting fixes in ValidationErrorMessages.js and ValidationFormats.js --- .../ValidationErrorMessages.js | 14 +++++++------- .../configuration-components/ValidationFormats.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) 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 3d20998ab..a5782948a 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,13 +1,13 @@ -import {IP, IP_RANGE} from "./ValidationFormats"; +import {IP, IP_RANGE} from './ValidationFormats'; export default function transformErrors(errors) { return errors.map(error => { - if (error.name === "type") { - error.message = "Field can't be empty." - } else if (error.name === "format" && error.params.format === IP_RANGE) { - error.message = "Invalid IP range, refer to description for valid examples." - } else if (error.name === "format" && error.params.format === IP) { - error.message = "Invalid IP." + if (error.name === 'type') { + error.message = 'Field can\'t be empty.' + } else if (error.name === 'format' && error.params.format === IP_RANGE) { + error.message = 'Invalid IP range, refer to description for valid examples.' + } else if (error.name === 'format' && error.params.format === IP) { + error.message = 'Invalid IP.' } return error; }); diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js index 93aeef2be..ff0b4706b 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js @@ -15,7 +15,7 @@ function buildIpRangeRegex(){ '^'+ipRegex+'$|', // Single: IP '^'+ipRegex+'-'+ipRegex+'$|', // IP range: IP-IP '^'+ipRegex+'/'+cidrNotationRegex+'$|', // IP range with cidr notation: IP/cidr - hostnameRegex, // Hostname: target.tg + hostnameRegex // Hostname: target.tg ].join('')) }