-
Notifications
You must be signed in to change notification settings - Fork 106
3111 - Redirects don't happen after workflow deletion #3159
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
base: master
Are you sure you want to change the base?
Conversation
@kresimir-coko, could you review this PR? I am not sure why CI build check fails. I ran all Client Development tasks. |
@karlocehulic19 with your changes we get a duplicate request to the project workflows endpoint, the deletion doesn't trigger the bad request anymore which is good, but we don't want the duplicate request either. Here's an example of the duplicated request: ![]() |
@kresimir-coko, I belive I fixed the issue now, here is the video of network requests... |
}); | ||
|
||
navigate(`/automation/projects/${projectId}/project-workflows/${firstRemainingWorkflowId}?${searchParams}`); | ||
// exact here prevents double fetchs of project |
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.
remove comment
const baseUrl = '/automation/projects'; | ||
const firstRemainingWorkflowUrlSuffix = firstRemainingWorkflowId | ||
? `/${projectId}/project-workflows/${firstRemainingWorkflowId}?${searchParams}` | ||
: ''; | ||
navigate(baseUrl + firstRemainingWorkflowUrlSuffix); |
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.
we want an empty line between variable declaration and its usage.
i would also like it if you rewrote the firstRemainingWorkflowUrlSuffix so that it's an empty string by default, and if firstRemainingWorkflowId exists, change its value to the complicated string...
the pattern is something like this:
let firstRemainingWorkflowUrlSuffix = '';
if (foo) {
firstRemainingWorkflowUrlSuffix = ...
}
otherwise, great job!
Description
Fixes unnecessary refetch of workflow after deletion in the settings menu by removing the second useProject hook call. It also handles deleting the last workflow project edge case.
Fixes #3111
Fixes #2762
Type of change
How Has This Been Tested?
Manually test with React Query devtools
Checklist:
I am sending the master because development has been deleted