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

When deleting a source I should be taken back to the manage sources page if any sources still existing #1008

Closed
nhaugo opened this issue Mar 13, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@nhaugo
Copy link
Contributor

nhaugo commented Mar 13, 2017

If there is a default source I should be connected to that source and taken to the manage page.
If there is no default source, the first available source should be made default and the user should be taken to that page.
If there is no sources at all the user should be take to the welcome page (current behavior)

@nhaugo nhaugo added this to the 1.2.0-beta6 milestone Mar 13, 2017
@nhaugo nhaugo added the ready label Mar 13, 2017
@nhaugo nhaugo changed the title When deleting a source I should be taken back to the manage sources page if any sources still existin When deleting a source I should be taken back to the manage sources page if any sources still existing Mar 14, 2017
@timraymond timraymond self-assigned this Mar 15, 2017
@timraymond
Copy link
Contributor

timraymond commented Mar 16, 2017

The root of this issue is that the manage-sources endpoint is scoped under a particular source. The route looks like /sources/:id/manage-sources. Thus, to reproduce this issue, you must delete the source that you're currently connected to. What happens is that deleting a source triggers a re-render, and the CheckSources middleware component realizes that the source that you would like to connect to (appearing as :id in /sources/:id/manage-sources) no longer exists and thinks you're trying to connect to an invalid source (which you are).

We can solve this a few ways:

  1. Prevent users from deleting the source that they're connected to. Users must first connect to another source to delete the source they're connected to.
  2. Automagically connect users to the next default source.
  3. Lift /manage-sources off of the nested source route. I started with this approach, but an issue is that we still need a valid source to write into URLs on the page. We could make that the "defaultSource"

@nhaugo
Copy link
Contributor Author

nhaugo commented Mar 20, 2017

Option 2 seems like the best path to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants