UIOR-1569: Correct refresh of prefix and suffix fields - #1875
Conversation
Jest Unit Test Results 1 files ±0 307 suites ±0 6m 50s ⏱️ -1s Results for commit a7a39ae. ± Comparison against base commit 820d529. This pull request removes 2 and adds 6 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
65ef658 to
026f5f2
Compare
|
Please add ticket to |
026f5f2 to
23cfc16
Compare
23cfc16 to
a149e79
Compare
|
@elsenhans Do you like the changes? |
Looking good. Thanks for the additional test case.
|
NikitaSedyx
left a comment
There was a problem hiding this comment.
please address linter issues
additionally I didn't get how validation exclusion when po number is present solves your issue, I believe you just need to make component rerender and do not touch validation
|
@elsenhans Thanks for finding this, I'll address the issue. Screencast_20260723_123408.webm |
a149e79 to
f8b8b82
Compare
|
@elsenhans I adressed your comments. @NikitaSedyx I fixed all the linter issues including two unrelated ones. I added an extra commit for it to indicate the fix doesn't belong to the ticket itself. |
| ); | ||
|
|
||
| useEffect(refreshList, [lineId]); | ||
| useEffect(refreshList, [lineId, refreshList]); |
There was a problem hiding this comment.
@NikitaSedyx out of scope linter fix in extra commit. If that's considered bad practice, we can remove it.
| })); | ||
| } | ||
| }, []); | ||
| }, [initialValues.template, parentResources?.orderTemplates?.records]); |
There was a problem hiding this comment.
@NikitaSedyx out of scope linter fix in extra commit. If that's considered bad practice, we can remove it.
There was a problem hiding this comment.
I would suggest to not fix issues not connected to your changes
hm, in some extent it makes sense, but I would like to play a bit - it's pretty old code so I do not remember all details |
|
@NikitaSedyx did you take a look and could reproduce the bug and verify the fix? |
We add a 'shouldValidate' property to 'FieldPrefix' and 'FieldSuffix', which is used to determine whether validating the input should be done or not. This way we do not validate if the 'poNumber' is not editable and hence accessible to the validators.
459996c to
a7a39ae
Compare
|



Purpose
https://folio-org.atlassian.net/browse/UIOR-1569
This is a bugfix for the following problem: Prefix and suffix do not correctly refresh on selection in the create and edit of a Purchase Order.
Approach
How did we solve this? Well,
FieldPrefixandFieldSuffixcontained broken validation logic, s.t. we could run into cases where we need to validate fields that aren't present. To fix that, we put the conditionshouldRevalidatePoNumberin place, taking care of that cases. That makes sure we only run the validation whenpoNumberwas mounted and is actually present, s.t. it can really be used for validation.