chronograf icon indicating copy to clipboard operation
chronograf copied to clipboard

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

Open nhaugo opened this issue 9 years ago • 2 comments

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 avatar Mar 13 '17 18:03 nhaugo

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"

timraymond avatar Mar 16 '17 21:03 timraymond

Option 2 seems like the best path to me

nhaugo avatar Mar 20 '17 22:03 nhaugo