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] Signing in with a token explicitly sets the region dropdown activeRegion #24347

Conversation

philrenaud
Copy link
Contributor

@philrenaud philrenaud commented Nov 1, 2024

Relates to @shoenig's work in #24320 so branching off of that

As it stands, when you sign in with a token in a multi-region cluster, the system.regions array exists, but the system.activeRegion doesn't re-compute.

This makes that value recompute automatically during token verification, and refreshes the regions list to trigger that.

(Note: I don't think this is an issue for SSO-based authentication, since there is an explicit page refresh, which would handle region-setting by virtue of initial page load)

Resolves #24337

Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @philrenaud!

I think it's also worthy of a changelog and backport.

Copy link

github-actions bot commented Nov 1, 2024

Ember Test Audit comparison

ui-static-region e9d148b change
passes 1582 1578 -4
failures 0 5 +5
flaky 0 0 0
duration 12m 24s 166ms 000ms -12m 24s 166ms

@philrenaud philrenaud force-pushed the 24337-ui-blank-region-identifier-when-logging-into-federated-cluster branch from 0de52bc to d80d17c Compare November 1, 2024 17:50
@philrenaud philrenaud merged commit e9ee2ae into ui-static-region Nov 1, 2024
14 checks passed
@philrenaud philrenaud deleted the 24337-ui-blank-region-identifier-when-logging-into-federated-cluster branch November 1, 2024 20:49
philrenaud added a commit that referenced this pull request Nov 2, 2024
* ui: show region in header gutter when only one region exists

This PR adds a plain text label of the region to the header when there is
only one region present. Before, nothing was showin in this case, and a
dropdown was shown on federated clusters.

The use case here is for operators of multiple non-federated Nomad clusters,
when all the UI's involved otherwise look identical.

* [ui] Signing in with a token explicitly sets the region dropdown activeRegion (#24347)

* Signing in with a token explicitly sets the region dropdown activeREgion

* Test and Select a Region default text

* Account for 403 on mocked agent members req

* Dont show the region if it isnt set in agent config

* Small padding css change

* unit test condition moved to stubbable acceptance test

---------

Co-authored-by: Phil Renaud <[email protected]>
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.

3 participants