mirror of
https://github.com/Unleash/unleash.git
synced 2024-10-28 19:06:12 +01:00
2bad98a121
This PR fixes how Unleash handles tag values. Specifically, it does these things: 1. Trims leading and trailing whitespace from tag values before inserting them into the database 2. Updates OpenAPI validation to not allow whitespace-only and to ignore leading and trailing whitespace Additionally, it moves the tag length constants into the constants file from the Joi tag schema file. This is because importing the values previously rendered them as undefined (probably due to a circular dependency somewhere in the system). This means that the previous values were also ignored by OpenAPI. UI updates reflecting this wil follow. ## Background When you tag a flag, there's nothing stopping you from using an entirely empty tag or a tag with leading/trailing whitespace. Empty tags make little sense and leading trailing whitespace differences are incredibly subtle: ![image](https://github.com/Unleash/unleash/assets/17786332/ec8fe193-8837-4c6a-b7bf-8766eff34eed) Additionally, leading and trailing whitespace is not shown in the dropdown list, so you'd have to guess at which is the right one. ![image](https://github.com/Unleash/unleash/assets/17786332/a14698ab-2bfd-4ec3-8814-b8e876d0aadb) |
||
---|---|---|
.. | ||
lib | ||
mailtemplates | ||
migrations | ||
test | ||
migrator.ts | ||
server-dev.ts | ||
server.ts |