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

feat(form-v2): set opacity for fields hidden by logic in builder #4482

Merged
merged 6 commits into from
Aug 10, 2022

Conversation

justynoh
Copy link
Contributor

@justynoh justynoh commented Aug 3, 2022

Problem

Fields hidden by default due to logic hiding are greyed out in the form builder in angular, but we don't show them as hidden in react.

Closes #4442

Solution

  • Reuse getVisibleFieldsId from logic to determine which fields are displayed by default.
  • Set opacity of field row to 30% when the field is not visible by default.
  • Add tooltip for info on fields with lower opacity.

Breaking Changes

  • No - this PR is backwards compatible

Screenshots

image

image

@justynoh justynoh linked an issue Aug 3, 2022 that may be closed by this pull request
@justynoh justynoh changed the title [WIP] feat(form-v2): opacity for builder fields hidden by default [WIP] feat(form-v2): set opacity for fields hidden by logic in builder Aug 4, 2022
@justynoh justynoh changed the title [WIP] feat(form-v2): set opacity for fields hidden by logic in builder feat(form-v2): set opacity for fields hidden by logic in builder Aug 5, 2022
@justynoh justynoh marked this pull request as ready for review August 5, 2022 03:45
@justynoh justynoh requested a review from timotheeg August 8, 2022 06:50
<Tooltip
hidden={!isHiddenByLogic}
placement="top"
label="This field may be hidden by your form logic"
Copy link
Contributor

Choose a reason for hiding this comment

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

may be or is? Asking because the Tooltip's only control on its hidden state is isHiddenByLogic 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hahah. this was the copy that was agreed upon. In actual fact, the field is hidden by logic by default (i.e. on first load of the form). Could change the variable name to isDefaultHiddenByLogic if that feels better?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nah, let's keep it. We can revisit later if needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

may is correct, since a logic match will show the field yea?

@justynoh justynoh requested a review from timotheeg August 10, 2022 02:18
@justynoh justynoh merged commit abb38c5 into form-v2/develop Aug 10, 2022
@justynoh justynoh deleted the form-v2/feat/builder-fields-hidden branch August 10, 2022 07:08
@justynoh justynoh mentioned this pull request Oct 5, 2022
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.

Display hidden fields differently in builder
3 participants