-
Notifications
You must be signed in to change notification settings - Fork 23
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
Added 2 props to RemoteSelect to support full doc fetching #63
base: main
Are you sure you want to change the base?
Added 2 props to RemoteSelect to support full doc fetching #63
Conversation
✔️ Deploy Preview for bluelibs canceled. 🔨 Explore the source changes: 53b004e 🔍 Inspect the deploy log: https://app.netlify.com/sites/bluelibs/deploys/616584bea5f3a70008f3e731 |
} else { | ||
onChange && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to add documentation to x-ui-admin/DOCUMENTATION.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you precise where exactly ? There is currently no paragraph about the RemoteSelect
or RemoteSelectLazy
in the doc seemingly
import { Alert, Select, SelectProps, Spin } from "antd"; | ||
import { ObjectId } from "@bluelibs/ejson"; | ||
|
||
export interface OnSelectDataChangeOptions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember we also discussed about having a value
resolver based on the data fetched. I think we need to explore the following route:
<RemoteSelect
body={{ name: 1, email: 1, }}
documentToLabel={(doc) => doc.name}}
onSelect={(value) => { ... }}
/>
And we should do this for LazySelect as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall I fully remove the field
prop then ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the solution is this, we either specify field
as a string, and it gets into the body request, and if there's no documentToLabel={}
we render the label document[field].
We have to do a check. If there isn't a field, documentToLabel is required so we know how to render the thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fen747 any input? I think it's almost done.
No description provided.