Fix 404 when clicking 'Cancel' from fork project
What does this MR do and why?
Currently clicking 'Cancel' from the 'Fork Project' page results in a 404.
This is because the href
on the 'Cancel' button back to the project page is considered a relative link because it does not begin with /
and so resolves to something like /namespace1/project1/-/forks/namespace1/project1
instead of /namespace1/project1
.
This change resolves this by providing cancelPath
to the cancel button component using the Rails path helper for the project instead of Project#full_path
. The Rails path helper prefixes the path with '/', Project#full_path
doesn't.
Screenshots or screen recordings
Before
After
How to set up and validate locally
- Click 'Fork' on a project
- Click 'Cancel'
- Verify that you are redirected back to the original project page
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #378502 (closed)
Edited by Malcolm Locke