-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(Redirection on deleting monitor): fixed redirection on deleting monitor #59962
Fix(Redirection on deleting monitor): fixed redirection on deleting monitor #59962
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution, left a comment
browserHistory.push( | ||
normalizeUrl( | ||
`/organizations/${orgId}/crons/${ | ||
router.location.query.prevUrl ? `?project=${router.location.query.prevUrl}` : '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method works, but adds unnecessary query parameters to the URL
It also only functions when coming from the monitor overview page, if you were to add a monitor and then delete it immediately you would be redirected back to a page without a project selection
What I think we could do here is leverage the selection
from usePageFilters
which holds global state around which project(s) were selected and feed those into the query params. Let me know if that makes sense and if it works out, I haven't tried it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @davidenwang correct. Using prevUrl is not needed as we need selected filters - projects and environments which will be present in usePageFilters.
And, yes i only covered just one flow but the creation, edition redirection should also be handled and also the breadcrumbs.
I am pushing a commit in sometime for this.
Thanks
Hi @davidenwang updated the changes. Please check.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apologies on the late review, but this is looking good. Thanks for working on this!
Fixes: #59723
When the filter is applied on crons page (monitor listing page) - then prevUrl gets added to URL. which helps in redirection to the correct URL when the monitor is deleted by user.
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.