Skip to content

Dashboard: The StructFieldInput component in the UI does **not respect** the options or ui.component properties defined on nested fields within a struct custom field. #4083

@dvjeshka

Description

@dvjeshka

This contradicts the documentation, which explicitly shows usage of options and implies support for ui customization inside struct fields (see: https://docs.vendure.io/guides/developer-guide/custom-fields/#properties-for-struct-fields).

To Reproduce
Steps to reproduce the behavior:

  1. Add a struct-type custom field to vendure-config.ts, with nested fields using options or ui.component, e.g.:
import { LanguageCode } from '@vendure/core';

const config = {
    // ...
    customFields: {
        OrderLine: [
            {
                name: 'customizationOptions',
                type: 'struct',
                fields: [
                    {
                        name: 'color',
                        type: 'string',
                        options: [
                            { value: 'red', label: [{ languageCode: LanguageCode.en, value: 'Red' }] },
                            { value: 'blue', label: [{ languageCode: LanguageCode.en, value: 'Blue' }] },
                        ],
                    },
                      {
                        name: 'productId',
                        type: 'string',
                        ui: { component: 'product-selector-form-input' },
                    },
                ],
            },
        ],
    },
};

Actual behavior

Image

Error logs
No errors in console

Environment

  • @vendure/core version: 3.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions