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

support subFields showIf #2586

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

youleapnir
Copy link

@youleapnir youleapnir commented Sep 28, 2023

Description

This PR tries to support showIf in builder subFields.

Notice

This has not been checked yet, because I don't know how to run builder.

Motivation

I want subFields will be able to be shown conditionally like regular fields with showIf.
Here is an example of showIf:
https://github.com/BuilderIO/builder/assets/104710778/1037361d-b6d7-4862-94dc-7629d5eb72c3

@vercel
Copy link

vercel bot commented Sep 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
nextjs-sdk-example ⬜️ Ignored (Inspect) Visit Preview Sep 28, 2023 8:27am
qwik-city-sdk-example ⬜️ Ignored (Inspect) Visit Preview Sep 28, 2023 8:27am
svelte-vite-example ⬜️ Ignored (Inspect) Visit Preview Sep 28, 2023 8:27am

Copy link
Collaborator

@teleaziz teleaziz left a comment

Choose a reason for hiding this comment

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

Thanks for contributing! left one comment, otherwise looks good

input = {
...input,
[key]: `return (${fn.toString()}).apply(this, arguments)`,
...(input.subFields == null
Copy link
Collaborator

Choose a reason for hiding this comment

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

there might be a lint rule type coercion with double equeals, maybe we do this instead?

  ...(Array.isArray(input.subFields)
    ? {
        subFields: input.subFields.map((input) => {
          return this.convertFnToString({ keysToConvert, input });
        }),
      }
    : {}),

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

3 participants