feat(renderer): enable condition set as a function - #1331
Conversation
|
A new version (feat) will be released: v3.19.0 [DataDrivenFormsBot] |
Codecov Report
@@ Coverage Diff @@
## master #1331 +/- ##
==========================================
+ Coverage 95.09% 95.11% +0.01%
==========================================
Files 209 209
Lines 3627 3641 +14
Branches 1265 1270 +5
==========================================
+ Hits 3449 3463 +14
Misses 178 178
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
1f993da to
6d7bac3
Compare
rvsia
left a comment
There was a problem hiding this comment.
Thank you, it looks great!
Checked only the code so far, found some nitpicks.
Could you please also update the documentation to introduce this new feature?
| import useFormApi from '../use-form-api'; | ||
| import parseCondition from '../parse-condition'; | ||
|
|
||
| function setterValueCheck(setterValue) { |
There was a problem hiding this comment.
Could you please use arrow function notation here to keep the consistency?
| } | ||
| }, [dirty]); | ||
|
|
||
| const x = useCallback( |
There was a problem hiding this comment.
x is kinda a mysterious name 😵💫
| formOptions.change(name, value); | ||
| }); | ||
| }, | ||
| [formOptions.change] |
There was a problem hiding this comment.
formOptions.change will be always the same, so no need to check it
| await waitFor(() => expect(screen.getByLabelText('field2')).toHaveValue('set with then')); | ||
| }); | ||
|
|
||
| test('should change fileds value by set funciton', async () => { |
There was a problem hiding this comment.
please use it instead of test, also a typo here
6d7bac3 to
843db93
Compare
843db93 to
955459a
Compare
| Object.entries(setter).forEach(([name, value]) => { | ||
| formOptions.change(name, value); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
We still need to keep an empty dependency array here: [] otherwise the function will be always re-created.
See here
955459a to
14de368
Compare
|
🎉 This PR is included in version 3.19.0 🎉 The release is available on |
Fixes #1326
Checklist: (please see documentation page for more information)
Yarn buildpassesYarn lintpassesYarn testpassesfix|feat({scope}): {description}fix(pf3): wizard correctly handles next buttonFix button on documenation example page