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

UI: Remove custom tag class and replace with Hds::Badge #29475

Merged
merged 15 commits into from
Feb 7, 2025

Conversation

lane-wetmore
Copy link
Contributor

@lane-wetmore lane-wetmore commented Jan 31, 2025

Description

Replaces instances of the tag class in favor of Hds::Badge and removes associated styles. For most of these, the badge is identical. A few may now have improved spacing.

This also establishes a pattern for code elements within a larger surrounding text. In these cases, we will use Hds::Text:Code with class code-in-text to have a uniform element appearance.
Example:
image

Before:

Screenshot 2025-01-31 at 3 05 19 PM

After:

Screenshot 2025-01-31 at 3 04 17 PM

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.

@lane-wetmore lane-wetmore requested a review from a team as a code owner January 31, 2025 18:19
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Jan 31, 2025
Copy link

hashicorp-cla-app bot commented Jan 31, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented Jan 31, 2025

Build Results:
All builds succeeded! ✅

Copy link

github-actions bot commented Jan 31, 2025

CI Results:
All Go tests succeeded! ✅

@lane-wetmore lane-wetmore added this to the 1.19.0-rc milestone Jan 31, 2025
@lane-wetmore lane-wetmore requested a review from a team as a code owner January 31, 2025 21:16
@lane-wetmore lane-wetmore self-assigned this Jan 31, 2025
changelog/29475.txt Outdated Show resolved Hide resolved
Copy link
Contributor

@hellobontempo hellobontempo left a comment

Choose a reason for hiding this comment

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

Great work on your first PR! 🎉 Excellent attention to detail. There are just a few cleanup items to address. I didn't comment on all of them, but we'll also want to remove any has-text-<color> classes from the added badges.

It might be nice to update the title to mention that we're replacing it with the hds component and removing the tag class all together. Something like UI: Remove custom tag class and replace with Hds::Badge.

There are also some tests failing, so we need to address those. Let me know if you want to pair through running tests locally!

ui/app/styles/helper-classes/spacing.scss Outdated Show resolved Hide resolved
ui/app/styles/helper-classes/spacing.scss Outdated Show resolved Hide resolved
ui/app/styles/helper-classes/spacing.scss Outdated Show resolved Hide resolved
ui/app/templates/components/identity/item-groups.hbs Outdated Show resolved Hide resolved
ui/lib/pki/addon/components/page/pki-issuer-list.hbs Outdated Show resolved Hide resolved
ui/lib/pki/addon/components/pki-generate-csr.hbs Outdated Show resolved Hide resolved
ui/lib/pki/addon/components/pki-generate-root.hbs Outdated Show resolved Hide resolved
ui/lib/pki/addon/components/pki-info-table-rows.hbs Outdated Show resolved Hide resolved
@lane-wetmore lane-wetmore changed the title UI/vault 17013 replace custom tag class UI/vault 17013 Remove custom tag class and replace with Hds::Badge Feb 3, 2025
@lane-wetmore lane-wetmore changed the title UI/vault 17013 Remove custom tag class and replace with Hds::Badge UI: Remove custom tag class and replace with Hds::Badge Feb 3, 2025
Comment on lines 28 to 32
<Hds::Badge @text="admin" />
policy such that a user named "James Thomas" or has the
<code class="tag is-marginless is-paddingless">Team Lead</code>
<Hds::Badge @text="Team Lead" />
role can manage the
<code class="tag is-marginless is-paddingless">admin</code>
<Hds::Badge @text="admin" />
Copy link
Contributor

Choose a reason for hiding this comment

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

These should all be code elements like the one below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you think about adding a heavier weight to these code elements to maintain their contrast to the rest of the content?

Code w/ weight:
image

Code w/o weight:
image

Previous tag class:
image

version
{{or @model.version "1"}}
</span>
<Hds::Badge @text={{concat "version " (or @model.version "1")}} data-test-kv-version-badge />
Copy link
Contributor

@hellobontempo hellobontempo Feb 5, 2025

Choose a reason for hiding this comment

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

This is another one that doesn't need concat if you prefer to write it this way:

Suggested change
<Hds::Badge @text={{concat "version " (or @model.version "1")}} data-test-kv-version-badge />
<Hds::Badge @text="version {{or @model.version '1'}}" data-test-kv-version-badge />

Copy link
Contributor

@hellobontempo hellobontempo left a comment

Choose a reason for hiding this comment

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

Well done! Great work on your first PR 🎉 excellent description and inclusion of screenshots! ✨ Before merging, we want to make sure enterprise tests pass so we don't accidentally break enterprise when this is merged there

@hellobontempo
Copy link
Contributor

I went ahead and added the backport/1.18.x label, if the cherry-pick is successful after merge then a backport PR will open. I think it's worthwhile backporting it to maintain branch parity since this work spans quite a few files and is low risk to backport.

@lane-wetmore lane-wetmore merged commit 4051cb4 into main Feb 7, 2025
32 of 33 checks passed
@lane-wetmore lane-wetmore deleted the ui/VAULT-17013-replace-custom-tag-class branch February 7, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.18.x hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants