1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-19 17:52:45 +02:00
unleash.unleash/frontend/src
Thomas Heartman 31ed96d8f3
1-1320: allow you to update example with no pattern + update state better (#4623)
While having a pattern when you have no example doesn't make a lot of
sense, it's a problem that you can't delete the example after deleting
the pattern: you previously had to remove the example before the
pattern.

This PR fixes that by always allowing you to update the example, even if
there is no pattern. Our server doesn't currently accept submitting an
example with no pattern, but we could allow that if we want to (and
probably just discard it on the back-end).

This PR also updates the validation of the example and the regex. There
were more unhandled edge cases previously where the validation would
disappear or be wrong. This should be fixed now. The new logic is that,
whenever you update the either the pattern or the example, we check:
- if you have an error in your pattern, no pattern, or no example, then
delete the example error if it exists
- have a well-formed pattern and an example then check if the example
matches the pattern and add/delete an error accordingly

This does have some consequences: editing the pattern can render your
example invalid. You'll also get immediate feedback instead of when you
switch focus. I think this is often a bad pattern (giving the user too
much negative feedback), but in terms of working with regexes, I think
it might be a good thing. We also give immediate feedback today, so I
don't think this is a regression.

Any thoughts are welcome.
2023-09-07 08:18:18 +02:00
..
__mocks__
assets feat: change request reject docs and step update (#4493) 2023-08-16 09:46:05 +02:00
component 1-1320: allow you to update example with no pattern + update state better (#4623) 2023-09-07 08:18:18 +02:00
constants feat: add usage info to project role deletion dialog (#4464) 2023-08-17 09:43:43 +02:00
contexts refactor: token permissions, drop admin-like permissions (#4050) 2023-06-22 08:35:54 +01:00
hooks fix: prevent 404 on auth settings hook (#4619) 2023-09-06 13:35:02 +01:00
interfaces 1-1319: add feature naming pattern descriptions (#4612) 2023-09-06 08:13:28 +00:00
openapi Feat/instance health (#4586) 2023-08-30 12:51:46 +00:00
themes feat: update breakpoint from 1260 to 1280 (#4575) 2023-08-27 20:36:02 +03:00
types
utils chore: remove newProjectLayout flag (#4536) 2023-08-21 13:55:04 +03:00
index.tsx feat: implement demo guide steps logic (#3528) 2023-04-18 10:56:15 +01:00
setupTests.ts
vite-env.d.ts