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

Reset users' startpages if referenced stream/dashboard is deleted. #2702

Merged
merged 7 commits into from Aug 17, 2016

Conversation

@dennisoelkers
Copy link
Member

@dennisoelkers dennisoelkers commented Aug 17, 2016

Description

This change adds a listener and the necessary events, which are posted
when a stream or dashboard is deleted. The listener will then reset any
user's startpage if it references the deleted entity.

Also the StartPage component reloads the current user before redirecting, so the start page reset also affects logged in users, plus the wrapping component (AppFacade) is now waiting for the presence of the currentUser object, which is reset upon logout, before rendering. This prevents stale currentUser objects leading to inaccurate details, as well was preventing components to make use of the currentUser object (which can be undefined now) while it is not available yet.

Motivation and Context

As described in #2400, when a user has set a dashboard/stream as start page and that entity is deleted, the user gets an error every login/click on the Graylog logo on the upper left.

Fixes #2400.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
This change adds a listener and the necessary events, which are posted
when a stream or dashboard is deleted. The listener will then reset any
user's startpage if it references the deleted entity.
@dennisoelkers dennisoelkers added this to the 2.1.0 milestone Aug 17, 2016
@edmundoa edmundoa self-assigned this Aug 17, 2016
@edmundoa
Copy link
Member

@edmundoa edmundoa commented Aug 17, 2016

I am seeing a problem with this, although I didn't check yet if it is related to the changes in here:

When I set a stream or dashboard as start page, doing a full refresh in any other path is taking me back to the start page I set, which is not what I expected. The redirection to the start page should only happen when going to / in my opinion.

@edmundoa
Copy link
Member

@edmundoa edmundoa commented Aug 17, 2016

This seems to be an issue with our development setup. Using the web interface being served from the server, makes the problem go away.

Looks good to me 👍

@edmundoa edmundoa merged commit f167fb0 into master Aug 17, 2016
4 checks passed
4 checks passed
ci-server-integration Jenkins build graylog2-server-integration-pr 1288 has succeeded
Details
ci-web-linter Jenkins build graylog-pr-linter-check 771 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@edmundoa edmundoa deleted the issue-2400 branch Aug 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.