Skip to content

UI: Add assertion to FormField for @attr.name and @model args #30788

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

Merged
merged 13 commits into from
Jun 10, 2025

Conversation

hellobontempo
Copy link
Contributor

@hellobontempo hellobontempo commented May 29, 2025

Description

✅ enterprise tests pass

VAULT-36640

  • Add assertion to force presence of @attr.name key and @model arg
  • Remove the hideLabel guard and the this.labelString guard from the migrated HDS components (per decision documented here)

TODO only if you're a HashiCorp employee

  • Backport Labels: If this fix needs to be backported, use the appropriate backport/ label that matches the desired release branch. Note that in the CE repo, the latest release branch will look like backport/x.x.x, but older release branches will be backport/ent/x.x.x+ent.
    • LTS: If this fixes a critical security vulnerability or severity 1 bug, it will also need to be backported to the current LTS versions of Vault. To ensure this, use all available enterprise labels.
  • ENT Breakage: If this PR either 1) removes a public function OR 2) changes the signature
    of a public function, even if that change is in a CE file, double check that
    applying the patch for this PR to the ENT repo and running tests doesn't
    break any tests. Sometimes ENT only tests rely on public functions in CE
    files.
  • Jira: If this change has an associated Jira, it's referenced either
    in the PR description, commit message, or branch name.
  • RFC: If this change has an associated RFC, please link it in the description.
  • ENT PR: If this change has an associated ENT PR, please link it in the
    description. Also, make sure the changelog is in this PR, not in your ENT PR.

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label May 29, 2025
Copy link

github-actions bot commented May 29, 2025

CI Results:
All Go tests succeeded! ✅

@hellobontempo
Copy link
Contributor Author

Screenshot 2025-05-29 at 4 30 16 PM

@hellobontempo hellobontempo changed the title test assertion for form fields UI: Add assertion to FormField for @attr.name and @model args May 29, 2025
@didoo
Copy link
Collaborator

didoo commented May 30, 2025

@hellobontempo I think we've reached a consensus that this is the way to go. Do you mind doing also the second part in this PR, which is to remove the guards too? In this way there is a single ticket and it's easier to track the changes and why. Thanks

@hellobontempo
Copy link
Contributor Author

@hellobontempo I think we've reached a consensus that this is the way to go. Do you mind doing also the second part in this PR, which is to remove the guards too? In this way there is a single ticket and it's easier to track the changes and why. Thanks

Yes! Absolutely. I'm a little busy feature testing until code freeze next Friday but I can update afterward. Feel free to takeover the PR/branch if this is blocking you until then 😄

@didoo didoo force-pushed the ui/add-form-field-assertion branch from 3486983 to e5bbee0 Compare June 2, 2025 10:20
@hellobontempo hellobontempo marked this pull request as ready for review June 4, 2025 19:45
@hellobontempo hellobontempo requested a review from a team as a code owner June 4, 2025 19:45
Copy link

github-actions bot commented Jun 4, 2025

Build Results:
All builds succeeded! ✅

Copy link
Collaborator

@didoo didoo left a comment

Choose a reason for hiding this comment

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

Nice! 👍

@hellobontempo hellobontempo merged commit aa32c4e into main Jun 10, 2025
34 checks passed
@hellobontempo hellobontempo deleted the ui/add-form-field-assertion branch June 10, 2025 17:20
didoo added a commit that referenced this pull request Jun 11, 2025
drivera258 pushed a commit that referenced this pull request Jun 11, 2025
* test assertion for form fields

* resuse const cars

* add tests

* remove conditionals for attr.name

* link jira VAULT-36640

* test assertion for form fields

* resuse const cars

* add tests

* remove conditionals for attr.name

* [UI] removed guard for `this.hideLabel` and `this.labelString` for migrated HDS components

* reverty copy pasta

---------

Co-authored-by: Cristiano Rastelli <[email protected]>
didoo added a commit that referenced this pull request Jun 26, 2025
didoo added a commit that referenced this pull request Jun 27, 2025
didoo added a commit that referenced this pull request Jun 27, 2025
didoo added a commit that referenced this pull request Jun 27, 2025
didoo added a commit that referenced this pull request Jun 30, 2025
didoo added a commit that referenced this pull request Jun 30, 2025
…DS block (#30771)

* [UI] Updated `FormField` to use `Hds::Form::Checkbox` for `type/editType=boolean` (#34798)

* [UI] Updated `FormField` tests for `type/editType=boolean` (#34798)

* [UI] Fixed failing test cases from `FormField` `boolean` updates (#34798)

* [UI] fixes raised in PR review (#34798)

* removed `this.labelString` guard per agreement

see #30788

* [UI] replaced `assert.ok` with `assert.true` per code review suggestion

* updated `isHdsFormField` logic to reflect more accurately inital “logic” flow in the `form-field.hbs` template file

for context: https://hashicorp.slack.com/archives/C05DGFEBCP2/p1751023770911809

* fixed test that was erroneously changed in previous PR due to an undetected bug

the previous code was generating a `checkbox` instead of a `toggleButton`
it’s now been fixed (see previous commit)

* Update ui/lib/core/addon/components/form-field.hbs

Co-authored-by: claire bontempo <[email protected]>

---------

Co-authored-by: claire bontempo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog pr/no-milestone ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants