summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/nfvo-utils/Validator.js
diff options
context:
space:
mode:
authortalig <talig@amdocs.com>2017-12-20 14:30:43 +0200
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2017-12-21 11:12:33 +0000
commit8e9c0653dd6c6862123c9609ae34e1206d86456e (patch)
tree5eeef00ec0677133baa439ca8d7ffd7aca4804b6 /openecomp-ui/src/nfvo-utils/Validator.js
parent785ebcc95de3e064e843bec04ba7a209d854fc7c (diff)
Add collaboration feature
Issue-ID: SDC-767 Change-Id: I14fb4c1f54086ed03a56a7ff7fab9ecd40381795 Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/nfvo-utils/Validator.js')
-rw-r--r--openecomp-ui/src/nfvo-utils/Validator.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/openecomp-ui/src/nfvo-utils/Validator.js b/openecomp-ui/src/nfvo-utils/Validator.js
index 3f6a00e289..0cb1943d66 100644
--- a/openecomp-ui/src/nfvo-utils/Validator.js
+++ b/openecomp-ui/src/nfvo-utils/Validator.js
@@ -20,8 +20,8 @@ import i18n from 'nfvo-utils/i18n/i18n.js';
class Validator {
static get globalValidationFunctions() {
return {
- required: value => {
- return typeof value === 'string' ? value.replace(/\s+/g, '') !== '' : value !== '';
+ required: value => {
+ return typeof value === 'string' ? value.replace(/\s+/g, '') !== '' : value !== '';
},
requiredChooseOption: value => value !== '',
maxLength: (value, length) => ValidatorJS.isLength(value, {max: length}),
@@ -77,13 +77,13 @@ class Validator {
length: value.length,
maxLength
}),
- minLength: (value, minLength) => i18n(`Field value should contain at least ${minLength} characters.`),
- pattern: (value, pattern) => i18n(`Field value should match the pattern: ${pattern}.`),
+ minLength: (value, minLength) => i18n('Field value should contain at least {minLength} characters.', {minLength: minLength}),
+ pattern: (value, pattern) => i18n('Field value should match the pattern: {pattern}.', {pattern: pattern}),
numeric: () => i18n('Field value should contain numbers only.'),
- maximum: (value, maxValue) => i18n(`Field value should be less or equal to: ${maxValue}.`),
- minimum: (value, minValue) => i18n(`Field value should be at least: ${minValue.toString()}.`),
- maximumExclusive: (value, maxValue) => i18n(`Field value should be less than: ${maxValue}.`),
- minimumExclusive: (value, minValue) => i18n(`Field value should be more than: ${minValue.toString()}.`),
+ maximum: (value, maxValue) => i18n('Field value should be less or equal to: {maxValue}.', {maxValue: maxValue}),
+ minimum: (value, minValue) => i18n('Field value should be at least: {minValue}.', {minValue: minValue.toString()}),
+ maximumExclusive: (value, maxValue) => i18n('Field value should be less than: {maxValue}.', {maxValue: maxValue}),
+ minimumExclusive: (value, minValue) => i18n('Field value should be more than: {minValue}.', {minValue: minValue.toString()}),
alphanumeric: () => i18n('Field value should contain letters or digits only.'),
alphanumericWithSpaces: () => i18n('Field value should contain letters, digits or spaces only.'),
validateName: ()=> i18n('Field value should contain English letters, digits , spaces, underscores, dashes and dots only.'),