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

Add new property hidden to formControl fields #1682

Merged
merged 5 commits into from
Nov 19, 2020
Merged

Conversation

akash-codemonk
Copy link
Contributor

Fixes #1659

@akash-codemonk akash-codemonk marked this pull request as draft November 11, 2020 05:18
@akash-codemonk akash-codemonk marked this pull request as ready for review November 11, 2020 06:15
Copy link
Member

@hetunandu hetunandu left a comment

Choose a reason for hiding this comment

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

The hidden logic should be handled in the BaseControl and not in each and every control. This is leading to lots of code duplication

Copy link
Contributor

@riodeuno riodeuno left a comment

Choose a reason for hiding this comment

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

@akash-codemonk when the value is READ_ONLY, we do not render the Field this leads me to believe, that the value may not available when the form is submitted. Could you confirm if the READ_ONLY fields have their original values sent to the servers?

app/client/src/components/formControls/utils.ts Outdated Show resolved Hide resolved
@mohanarpit mohanarpit added the Enhancement New feature or request label Nov 16, 2020
@akash-codemonk
Copy link
Contributor Author

@hetunandu Will create a separate component which will create the control. Similar to https://github.com/appsmithorg/appsmith/blob/release/app/client/src/pages/Editor/PropertyPane/PropertyControl.tsx, this will handle the hidden logic and avoid duplication.

@akash-codemonk
Copy link
Contributor Author

@riodeuno The form values are initialised with the action or datasource values with for e.g changeQuerySaga. So yes the original value still remains in the form state when it is submitted even if the field is hidden.

Copy link
Contributor

@riodeuno riodeuno left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@mohanarpit mohanarpit dismissed stale reviews from riodeuno and hetunandu November 19, 2020 03:31

This has been addressed

@mohanarpit mohanarpit merged commit c3c7b9b into release Nov 19, 2020
@mohanarpit mohanarpit deleted the feat/hidden-field branch November 19, 2020 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Hidden (dynamic and static) fields in query forms
4 participants