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

fix: named tab being required in generated types without any required fields #6324

Merged
merged 2 commits into from May 13, 2024

Conversation

paulpopus
Copy link
Contributor

For this given config

{
  type: 'tabs',
  tabs: [
    {
      label: 'unnamedTab',
      fields: [
        {
          type: 'text',
          name: 'fieldInUnnamedTab',
        },
      ],
    },
    {
      label: 'namedTab',
      name: 'namedTab',
      fields: [
        {
          type: 'text',
          name: 'fieldInNamedTab',
        },
      ],
    },
    {
      label: 'namedTabWithRequired',
      name: 'namedTabWithRequired',
      fields: [
        {
          type: 'text',
          name: 'fieldInNamedTab',
          required: true,
        },
      ],
    },
  ],
},

The generated types should be

fieldInUnnamedTab?: string | null;
namedTab?: {
  fieldInNamedTab?: string | null;
};
namedTabWithRequired: {
  fieldInNamedTab: string;
};

Currently namedTab will be required as well without having any required fields, this fixes that.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@jmikrut jmikrut merged commit aa5ad47 into beta May 13, 2024
34 checks passed
@jmikrut jmikrut deleted the fix/named-tab-being-required branch May 13, 2024 17:55
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