Skip to content

Commit

Permalink
Fix [UI] labels are failing validations upon "Batch Re-Run" (#166)
Browse files Browse the repository at this point in the history
Co-authored-by: Viktor Ilchuk <viktor.ilchuk@amcnetworks.com>
  • Loading branch information
viktor-ilchuk and Viktor Ilchuk authored Sep 4, 2023
1 parent 7d86bc1 commit ec22571
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lib/utils/validation.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ const generateRule = {
pattern: new RegExp('^[' + convertToPattern(chars) + ']+$')
}
},
validCharactersWithPrefix: (chars) => {
return {
name: 'validCharactersWithPrefix',
label: ValidationConstants.VALID_CHARACTERS + ': ' + convertToLabel(chars),
pattern: new RegExp('^([' + convertToPattern(chars) + ']+\/)?[' + convertToPattern(chars) + ']+$')
}
},
noConsecutiveCharacters: (chars) => {
const convertedPattern = chars
.split(' ')
Expand Down Expand Up @@ -331,6 +338,13 @@ const validationRules = {
generateRule.beginNotWith('.'),
generateRule.length({ max: 253 })
]
},
job: {
label: [
generateRule.validCharactersWithPrefix('a-z A-Z 0-9 - _ .'),
generateRule.beginEndWith('a-z A-Z 0-9'),
generateRule.length({ max: 56 })
]
}
}

Expand Down

0 comments on commit ec22571

Please sign in to comment.