1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00

feature naming patterns: allow empty values in examples and patterns (#4611)

Allow empty patterns and examples for feature naming. 

This fixes an issue where the form would break, not allowing you to
create new projects at all.
This commit is contained in:
Thomas Heartman 2023-09-05 13:40:03 +02:00 committed by GitHub
parent c19bd615b9
commit a1e98056ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -12,7 +12,6 @@ export const createFeatureNamingPatternSchema = {
description:
'A JavaScript regular expression pattern, without the start and end delimiters. Optional flags are not allowed.',
example: '[a-z]{2,5}.team-[a-z]+.[a-z-]+',
pattern: '.*',
},
example: {
type: 'string',

View File

@ -11,8 +11,8 @@ export const projectSchema = joi
defaultStickiness: joi.string().default('default'),
featureLimit: joi.number().allow(null).optional(),
featureNaming: joi.object().keys({
pattern: joi.string().allow(null).optional(),
example: joi.string().allow(null).optional(),
pattern: joi.string().allow(null).allow('').optional(),
example: joi.string().allow(null).allow('').optional(),
}),
})
.options({ allowUnknown: false, stripUnknown: true });