Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomWidgets should also get an entry property #1657

Open
thgreasi opened this issue Oct 13, 2022 · 1 comment
Open

CustomWidgets should also get an entry property #1657

thgreasi opened this issue Oct 13, 2022 · 1 comment
Assignees

Comments

@thgreasi
Copy link
Contributor

Atm they get a number of props, including the extraContext, but that is the whole row, which is not that useful in case ref-scheme is used to point to a nested property. We need a new injected property (eg entry) that will hold the immediate parent of the value.
This way the widget will have an easy way to use other properties of the object whose value it renders.
See:

extraFormats={[
...(formats ?? ([] as Format[])),
...defaultFormats,
]}
schema={widgetSchema}
value={calculatedField}
extraContext={entry}

@thgreasi
Copy link
Contributor Author

thgreasi commented Oct 13, 2022

I think we should just need to call _.toPath with the refScheme, then run a _.get w/o the last entry to get the parent object, and finally an extra _.get with the last part of the path to get the value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants