Skip to content

Commit

Permalink
[Infra UI] Alerts link in overview: required to click back 2 times to…
Browse files Browse the repository at this point in the history
… go back (elastic#162312)

Closes elastic#162240 
Closes elastic#162220 
Closes elastic#162221 

## Summary

This PR fixes the navigation to the alerts page issue when the back
button is used - in this case, the user stays on the same page instead
of going back to the previous page. This issue was found on the hosts
view page after adding the 'show all' link inside the overview tab but
it exists also when you navigate from the observability overview page.

I tested also navigating using the menu, from observability overview and
hosts view, outside of observability and the navigation works fine with
the change. If there are any concerns or if I miss something I will be
happy to discuss this.

Before:


https://github.com/elastic/kibana/assets/14139027/dc9590c9-ef7e-469c-aad4-6c6f377d9bef


After:


https://github.com/elastic/kibana/assets/14139027/be3d1f9a-bd27-426d-bd6e-61f5a0a206f3
  • Loading branch information
jennypavlova authored and Devon Thomson committed Aug 1, 2023
1 parent 4f36218 commit 29eae1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,17 @@ function syncUrlStateWithInitialContainerState(
};

stateContainer.set(newState);
urlStateStorage.set(urlStorageKey, stateContainer.get(), {
replace: true,
});
return;
} else if (timefilterService.isTimeTouched()) {
const { from, to } = timefilterService.getTime();
const newState = {
...defaultState,
rangeFrom: from,
rangeTo: to,
};

stateContainer.set(newState);
} else {
// Reset the state container when no URL state or timefilter range is set to avoid accidentally
Expand Down
4 changes: 1 addition & 3 deletions x-pack/test/functional/apps/infra/hosts_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
return !!currentUrl.match(path);
});

// Failing: See https://github.com/elastic/kibana/issues/162221
// Failing: See https://github.com/elastic/kibana/issues/162220
describe.skip('Hosts View', function () {
describe('Hosts View', function () {
before(async () => {
await Promise.all([
esArchiver.load('x-pack/test/functional/es_archives/infra/alerts'),
Expand Down

0 comments on commit 29eae1e

Please sign in to comment.