-
Notifications
You must be signed in to change notification settings - Fork 4.4k
[VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component #30068
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
[VAULT-34482] UI: Update Namespace Picker to use HDS Super Select component #30068
Conversation
CI Results: |
23d5ca7
to
bc118c9
Compare
5483048
to
c7c5f8a
Compare
@@ -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`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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' }, |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
Build Results: |
There was a problem hiding this 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; |
There was a problem hiding this comment.
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 /'); |
There was a problem hiding this comment.
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? 🤔
ea58231
to
c2f3448
Compare
There was a problem hiding this 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!
97e64f2
to
699225d
Compare
37495e4
into
VAULT-34216/namespace-picker-feature-branch
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
…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
Description
main
)Outstanding items that will be addressed in separate PRs before the feature side branch is merged to main:
Screenshots
TODO only if you're a HashiCorp employee
backport/
label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x
, but older release branches will bebackport/ent/x.x.x+ent
.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.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.