HumanSignal / label-studio-frontend

Data labeling react app that is backend agnostic and can be embedded into your applications — distributed as an NPM package
https://labelstud.io/
Apache License 2.0
413 stars 316 forks source link

fix: LEAP-724: Fix Textarea required + skipDuplicates #1705

Closed hlomzik closed 4 months ago

hlomzik commented 4 months ago

New validation system (#1649) started to invoke validateValue() from control tags, but Textarea had a different meaning for this method, validating only text just entered by user, so the format was different from the whole Textarea result and LSF was crashing. Also semantics is also different, so the method was simply renamed to not clash with new validation.

PR fulfills these requirements

Describe the reason for change

LSF crashes on submit with Textarea tag with both required and skipDuplicates set to true.

What feature flags were used to cover this change?

skipDuplicates work only with fflag_feat_front_lsdv_4659_skipduplicates_060323_short ON

What alternative approaches were there?

To validate duplicated texts on submit as well, but that can block some existing annotations and should be done separately as a feature.

This change affects (describe how if yes)

Does this PR introduce a breaking change?

What level of testing was included in the change?

codecov-commenter commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (1a234f1) 68.79% compared to head (81dcb7c) 21.93%. Report is 4 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1705 +/- ## =========================================== - Coverage 68.79% 21.93% -46.86% =========================================== Files 443 441 -2 Lines 28793 28757 -36 Branches 7655 7527 -128 =========================================== - Hits 19808 6308 -13500 - Misses 7742 22449 +14707 + Partials 1243 0 -1243 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.