Skip to content

Conversation

beagins
Copy link
Contributor

@beagins beagins commented Mar 27, 2025

Description

ℹ️ NOTE: This branch is merging into a feature sidebranch (not main)
  • Changelog update
  • Replace Picker w/ HDS Super Select

Outstanding items that will be addressed in separate PRs before the feature side branch is merged to main:

  • Implement Refresh Namespaces Button
  • Implement Manage Namespaces Button works
  • Redirect to Namespace on click
  • All/Matching Namespaces Label w/ Count Badge
  • "You are logged in with a root token and will have to re-authenticate when switching namespaces."
  • Expanded namespace picker width to support long namespace paths
  • Tab to auto-complete namespace path
  • Styling to match Figma designs
  • Add test coverage
  • Manual testing

Screenshots

⚠️ NOTE: The current implementation looks ugly, styling will be addressed in a separate PR
Screenshot 2025-03-27 at 4 48 27 PM
Screenshot 2025-03-27 at 4 48 16 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.

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

github-actions bot commented Mar 28, 2025

CI Results:
All Go tests succeeded! ✅

@beagins beagins force-pushed the VAULT-34216/hds-super-select-v2 branch from 23d5ca7 to bc118c9 Compare March 28, 2025 00:17
@beagins beagins added the ui label Mar 28, 2025
@beagins beagins force-pushed the VAULT-34216/hds-super-select-v2 branch 2 times, most recently from 5483048 to c7c5f8a Compare March 28, 2025 00:34
@@ -47,7 +47,7 @@ module('Acceptance | Enterprise | namespaces', function (hooks) {
// check that the single namespace "beep" or "boop" not "beep/boop" shows in the toggle display
assert
.dom(`[data-test-namespace-link="${targetNamespace}"]`)
.hasText(ns, `shows the namespace ${ns} in the toggle component`);
.hasText(targetNamespace, `shows the namespace ${targetNamespace} in the toggle component`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: we are now displaying the full namespace path instead of just the node name inside of the namespace picker dropdown.

After / Before:
Screenshot 2025-03-27 at 5 30 30 PM

// TODO: Revisit. A hardcoded check for "path" & "/path" seems hacky, but it fixes a breaking test:
// "Acceptance | Enterprise | namespaces: it shows nested namespaces if you log in with a namespace starting with a /"
// My assumption is that namespace shouldn't start with a "/", but is this a HVD thing? or is the test outdated?
return option?.path === currentNamespace?.path || `/${option?.path}` === currentNamespace?.path;
Copy link
Contributor Author

@beagins beagins Mar 28, 2025

Choose a reason for hiding this comment

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

Note: added TODO to revisit this in a separate PR. I don't like this solution and want to dig deeper to understand if the referenced test is still relevant.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a good question - I wonder if this is to account for when users input /mynamespace in the login form (which I think peopled do sometimes...) but I agree it's worth looking into. This isn't the PR the test was added, but it does show a forward slash in the namespace input #10588

There have been a lot of change since then and i think we sanitize consistently and namespaces shouldn't be prepended with / but again would be good to investigate!

*/
return [
// TODO: Some users (including HDS Admin User) should never see the root namespace. Address this in a followup PR.
{ id: 'root', path: '', label: 'root' },
Copy link
Contributor Author

@beagins beagins Mar 28, 2025

Choose a reason for hiding this comment

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

Note: added TODO to revisit this,root should not be hardcoded. Will address this in a separate PR.

async loadOptions() {
// TODO: namespace service's findNamespacesForUser will never throw an error.
// Check with design to determine if we should continue to ignore or handle an error situation here.
await this.namespace?.findNamespacesForUser.perform();
Copy link
Contributor Author

@beagins beagins Mar 28, 2025

Choose a reason for hiding this comment

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

Note: added TODO to revisit in a separate PR.

@beagins beagins marked this pull request as ready for review March 28, 2025 00:39
@beagins beagins requested review from a team as code owners March 28, 2025 00:39
@beagins beagins requested review from keeefer and removed request for a team March 28, 2025 00:39
Copy link

github-actions bot commented Mar 28, 2025

Build Results:
All builds succeeded! ✅

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 so far! Just leaving some comments after a quick initial pass, but overall this looks solid to me. I'm wondering about fetching namespaces in the route and passing to the component instead of fetching them in the component itself 🤔 did you have a reason for making the request in the component?

Came back to edit for posterity and clarity - Since the sidebar navigation exists app-wide this data isn't tied to a specific route/resource I think the component making the request makes sense. Disregard my question 😄

// TODO: Revisit. A hardcoded check for "path" & "/path" seems hacky, but it fixes a breaking test:
// "Acceptance | Enterprise | namespaces: it shows nested namespaces if you log in with a namespace starting with a /"
// My assumption is that namespace shouldn't start with a "/", but is this a HVD thing? or is the test outdated?
return option?.path === currentNamespace?.path || `/${option?.path}` === currentNamespace?.path;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a good question - I wonder if this is to account for when users input /mynamespace in the login form (which I think peopled do sometimes...) but I agree it's worth looking into. This isn't the PR the test was added, but it does show a forward slash in the namespace input #10588

There have been a lot of change since then and i think we sanitize consistently and namespaces shouldn't be prepended with / but again would be good to investigate!

@@ -59,8 +59,10 @@ module('Acceptance | Enterprise | namespaces', function (hooks) {
await authPage.tokenInput('root').submit();
await settled();
await click('[data-test-namespace-toggle]');
await waitFor('[data-test-current-namespace]');
assert.dom('[data-test-current-namespace]').hasText('/beep/boop/', 'current namespace begins with a /');
Copy link
Contributor

Choose a reason for hiding this comment

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

seeing this i wonder if the old namespace would send users to /namespace and that's one reason why we had to account for that initial forward slash? 🤔

@beagins beagins force-pushed the VAULT-34216/hds-super-select-v2 branch 2 times, most recently from ea58231 to c2f3448 Compare March 28, 2025 23:00
Copy link
Contributor

@emoncuso emoncuso left a comment

Choose a reason for hiding this comment

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

A couple of super nits, but otherwise looks great!

@beagins beagins force-pushed the VAULT-34216/hds-super-select-v2 branch from 97e64f2 to 699225d Compare April 1, 2025 00:25
@beagins beagins merged commit 37495e4 into VAULT-34216/namespace-picker-feature-branch Apr 1, 2025
25 checks passed
@beagins beagins deleted the VAULT-34216/hds-super-select-v2 branch April 1, 2025 00:59
beagins added a commit that referenced this pull request Apr 1, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request Apr 3, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request Apr 15, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request Apr 15, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request Apr 18, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request Apr 19, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request Apr 22, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request Apr 24, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request Apr 29, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request Apr 29, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request Apr 29, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request Apr 30, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request May 1, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request May 1, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
beagins added a commit that referenced this pull request May 5, 2025
…ponent (#30068)

* [VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component

* changelog updates

* update jsdoc

* update classname

* update test comment

* remove unnecessary label attribute

* move hbs file to components directory alongside js file

* fix replication test

* undo changes to replication test

* test update
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 ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants