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

Feature to handle disabling of views #374

Closed
bennsimon opened this issue Mar 2, 2020 · 0 comments · Fixed by #378
Closed

Feature to handle disabling of views #374

bennsimon opened this issue Mar 2, 2020 · 0 comments · Fixed by #378
Assignees

Comments

@bennsimon
Copy link
Member

Disable a view in native-form.

Disabling a view entails making the view gone and ignoring the logic and validations of the view.

To achieve this the following is suggested:

Add logic to change the view to type hidden so that the view is never rendered, then add an attribute called disabled to ensure the view's logic and validations are never executed since the view will not be created.

  • Here we will leverage the HiddenTextFactory's ability to hide a view.
  • The additional logic for disabling a view will be put only in this Factory.

Handling the dynamic nature of the fields:

  1. Fields we will read from a json file like so..

    [{ "form_name": "formnamesample", "hidden":[] , "disabled":[] }]

  2. It will be passed as arguments to a function in JsonApi interface e.g
    handleDisabledViews(formname, setOfKeysOfHiddenViews, setOfKeysOfDisabledViews) which will update the json form before render.

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 a pull request may close this issue.

1 participant