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

Admin Generator: fix initiallyExpanded prop not set if false #3402

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

Conversation

manuelblum
Copy link
Collaborator

@manuelblum manuelblum commented Feb 11, 2025

Description

fix Form Generator. If initiallyExpanded is set to false, the initiallyExpanded prop did not get set on the Fieldset Component. This is wrong, because internally the Fieldset Component has a default value assigned to initiallyExpanded of true

Sample Code:

export const ProductForm: FormConfig<GQLProduct> = {
    type: "form",
    gqlType: "Product",
    fragmentName: "ProductFormDetails", // configurable as it must be unique across project
    fields: [
        {
            type: "fieldSet",
            name: "mainData",
            collapsible: true,
            initiallyExpanded: true,
            fields: [
                {
                    type: "text",
                    name: "title",
                },
            ],
        },
        {
            type: "fieldSet",
            name: "additionalData",
            collapsible: true,
            initiallyExpanded: false,
            fields: [
                {
                    type: "boolean",
                    name: "inStock",
                },
            ],
        },
    ],
};

Problem

image

Screenshots

Before After
Screenshot 2025-02-11 at 17 30 25 Screenshot 2025-02-11 at 17 13 37

|


Task: https://vivid-planet.atlassian.net/browse/COM-1630

nsams
nsams previously approved these changes Feb 11, 2025
@johnnyomair johnnyomair changed the title Fix Form Generator initially exapanded not correct if false Admin Generator: fix initiallyExpanded not set for false Feb 12, 2025
@johnnyomair johnnyomair changed the title Admin Generator: fix initiallyExpanded not set for false Admin Generator: fix initiallyExpanded prop not set if false Feb 12, 2025
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided that we don't add changesets for the future Admin Generator since it hasn't been officially released yet. Please remove the changeset.

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.

3 participants