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

Fix a management UI issue with a page refresh after logging out #11226

Merged
merged 3 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion deps/rabbitmq_management/priv/www/js/dispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ dispatcher_add(function(sammy) {
oauth_initiateLogout();
}else {
go_to_home()
// location.reload();
}
});

Expand Down
3 changes: 3 additions & 0 deletions deps/rabbitmq_management/priv/www/js/oidc-oauth/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ function oauth_redirectToHome(oauth) {
function go_to(path) {
location.href = rabbit_path_prefix() + "/" + path
}
function go_to_home() {
location.href = rabbit_path_prefix() + "/"
}
function go_to_authority() {
location.href = oauth.authority
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('When a logged in user', function () {
it('logs out', async function () {
await loginPage.login('guest', 'guest')
await overview.isLoaded()
await overview.selectRefreshOption("Do not refresh")
await overview.logout()
await loginPage.isLoaded()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const MENU_TABS = By.css('div#menu ul#tabs')
const USER = By.css('li#logout')
const LOGOUT_FORM = By.css('li#logout form')
const SELECT_VHOSTS = By.css('select#show-vhost')

const SELECT_REFRESH = By.css('ul#topnav li#interval select#update-every')
const OVERVIEW_TAB = By.css('div#menu ul#tabs li#overview')
const CONNECTIONS_TAB = By.css('div#menu ul#tabs li#connections')
const CHANNELS_TAB = By.css('div#menu ul#tabs li#channels')
Expand Down Expand Up @@ -36,7 +36,9 @@ module.exports = class BasePage {
async getUser () {
return this.getText(USER)
}

async selectRefreshOption(option) {
return this.selectOption(SELECT_REFRESH, option)
}
async waitForOverviewTab() {
return this.waitForDisplayed(OVERVIEW_TAB)
}
Expand Down
Loading