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

If else and RJSF rendering issues containing it. #3787

Open
4 tasks done
Abhishek-kumar09 opened this issue Jul 24, 2023 · 2 comments
Open
4 tasks done

If else and RJSF rendering issues containing it. #3787

Abhishek-kumar09 opened this issue Jul 24, 2023 · 2 comments
Labels
feature Is a feature request help wanted

Comments

@Abhishek-kumar09
Copy link

Abhishek-kumar09 commented Jul 24, 2023

Prerequisites

What theme are you using?

material-ui

Version

5.x

Current Behavior

Here is the playground link

I have bunch of nested if else statements, that should show different options when swicthed to different properties.
In short:

  • I have root level applicationType field, that field is decisive of the other fields.
  • Issue: all the fields are shown the time RJSF loads, and it doesnt respect if then else condition. example:
    Screenshot 2023-07-25 at 12 08 10 AM
  • Issue 2: The duplicative fields, some fields are rendered again even fi they are not in the schema. (the other radio button as well, which I forgot to highlight)
    Screenshot 2023-07-25 at 12 11 23 AM
  • Issue 3: We use custom styled components, but the styles are not applied to the fields that appear in case we select "kubernetes Manifest" as import type.
  • Issue 4:
    Steps to reproduce:
    1. Select "Kubernetes Manifest" as application type
    2. Select "File Upload" from the drop down
    3. upload the file
    4. Submit the form.

Although, the URL is required for the else part, the form still throws validation errors with message must have required property 'url'
screenshot:
Screenshot 2023-07-25 at 12 22 09 AM

Expected Behavior

  • The fields should be selectevely loaded on first render, e.g.
    Screenshot 2023-07-25 at 12 16 28 AM
    Where the UI is showing the fields just for selected item on first load, and doesn't populate everything.

  • There should not be duplicate field during render.

  • Correct validation errors on submit

Steps To Reproduce

Described above

Environment

- OS: MacOSX
- Node: 16
- npm: 8.19

Anything else?

No response

@Abhishek-kumar09 Abhishek-kumar09 added bug needs triage Initial label given, to be assigned correct labels and assigned labels Jul 24, 2023
@harkiratsm
Copy link

harkiratsm commented Jul 25, 2023

Related from #3763 #3767

^^ @heath-freenome @nickgros

@heath-freenome heath-freenome added help wanted feature Is a feature request and removed needs triage Initial label given, to be assigned correct labels and assigned labels Jul 28, 2023
@heath-freenome
Copy link
Member

This requires implementing a new feature similar to ui:fieldReplacesAnyOrOneOf except that it would be ui:anyOrOneOfReplacesField. In the SchemaField we render both the field and the anyOf/oneOf. With this flag turned on then I would imagine that the field is not rendered since the anyOfOneOf will do it. This would required some verification of it working properly, including some decent unit tests. We could use some help for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is a feature request help wanted
Projects
None yet
Development

No branches or pull requests

3 participants