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

Added 2 props to RemoteSelect to support full doc fetching #63

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Fen747
Copy link
Collaborator

@Fen747 Fen747 commented Oct 11, 2021

No description provided.

@netlify
Copy link

netlify bot commented Oct 11, 2021

✔️ Deploy Preview for bluelibs canceled.

🔨 Explore the source changes: 53b004e

🔍 Inspect the deploy log: https://app.netlify.com/sites/bluelibs/deploys/616584bea5f3a70008f3e731

} else {
onChange &&
Copy link
Contributor

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

Copy link
Collaborator Author

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 {
Copy link
Contributor

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.

Copy link
Collaborator Author

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 ?

Copy link
Contributor

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.

Copy link
Contributor

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.

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

Successfully merging this pull request may close these issues.

None yet

2 participants