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

Vendure 2.0.0 - Custom field UI regarding facet-value-form-input #2216

Closed
BHO010 opened this issue Jun 9, 2023 · 2 comments
Closed

Vendure 2.0.0 - Custom field UI regarding facet-value-form-input #2216

BHO010 opened this issue Jun 9, 2023 · 2 comments
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@BHO010
Copy link

BHO010 commented Jun 9, 2023

Describe the bug
Adding a custom field facet form input UI to seller entity, values of the facet not being captured on creation. Values are of incorrect type when updating.

To Reproduce
Steps to reproduce the behavior:

  1. Go to vendure.config.ts and add a custom field on the seller entity.
  2. In the admin panel, create a seller. You should be able to see the facet form input UI in the custom field and search for the facet and add them.
  3. Click on the create button to create a seller. However, the custom field values are not captured but the seller is being created
  4. Next go to the sellet list and edit the newly created seller. Try to add the custom field again and this time the error appear.
  5. The custom field facets value seems to be an array of objects but it requires an array of strings.

Expected behavior
Being able to create a seller with the custom field values being captured correctly.
Being able to update seller custom field correctly.

Environment (please complete the following information):

  • @vendure/core version: v2.0.0
  • Nodejs version: v16.14.0
  • Database (mysql/postgres etc): mysql

Additional context
Image for step 1
ss3

Image for step 2/3
ss1

Image for step 4/5
ss2

@BHO010 BHO010 added the type: bug 🐛 Something isn't working label Jun 9, 2023
@michaelbromley
Copy link
Member

Hi, thanks for the report!

The correct custom field config for setting up a relation to the FacetValue entity would look like this:

customFields: {
        Seller: [
            {
                name: 'category',
                type: 'relation',
                entity: FacetValue,
                list: true,
                ui: {
                    component: 'facet-value-form-input',
                },
            },
        ],
    },

However, in investigating this issue I did find some actual issues where custom field relation logic had not been implemented in the Seller service, so this will be fixed in the upcoming 2.0.1 patch.

@BHO010
Copy link
Author

BHO010 commented Jun 13, 2023

ah, I see. Should have tried using relation instead of text. Thanks for the help.

Looking forward to patch 2.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants