-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 [#4608] Finetune ObjectsAPIGroup refactor
After moving the ObjectsAPIGroup component to a shared field layer where the form data structure is unknown at the component level, the code to reset dependent fields was no longer properly 'generic' and the approach with a prefix was not the most elegant: * it assumes the other (dependent) field names are the same in registration and prefill (they are, but deliberately, though there's no guarantee they will be in the future) * it assumes a certain structure, but dependent fields may live in another namespace or the reset behaviour could require additional changes in the form state to be made Instead, the reset behaviour can now be passed in as a prop, so that the caller/user of the ObjectsAPIGroup component is in control of which state exactly gets reset. This already reflects nicely since the variableMapping reset in the Legacy Objects API registration configuration didn't make any sense, it's a V2 option, so now we have tailored reset functions to the expected data structure.
- Loading branch information
1 parent
b170fee
commit 5acf3ee
Showing
6 changed files
with
90 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters