Show writable forks in Web IDE modal
What does this MR do and why?
- Checks to see if a user has write access to any forks (not just a personal fork) when trying to launch the WebIDE from a project they do not have write access to.
- Updates the "create new fork" action to give the user choices when forking (e.g. to fork to a group instead of personal namespace etc)
Before | After |
---|---|
Screen_Recording_2023-06-06_at_09.23.24 | Screen_Recording_2023-06-06_at_09.15.10 |
NOTE: This is an MVC, and we do want to:
- update the behaviour on repository pages
- modify the behaviour to automatically open the fork (when you have access to a single "non personal" fork)
- modify the behaviour to not automatically open the personal fork when you have access to multiple forks
How to set up and validate locally
- Impersonate a non-admin user
- Navigate to a project the user has read-only access to (e.g. public project, or reporter role) for example http://gdk.test:3000/flightjs/Flight
- Click the Web IDE button (from the main project page, not from a specific repository path, this uses a different mechanic under the hood)
- The modal should show you don't have write access and offer you the option to create a new fork
- Click the "create new fork" button (ensure this doesn't automatically create a personal fork, but takes you to the new fork page)
- Create the new fork in a group (not in the user's personal namespace)
- Go back to the canonical project from step 2
- Click the Web IDE button
- The modal should now list the fork you created earlier, but still give you the option to create a new fork
- Create a new fork in another group
- Go back to the canonical project from step 2
- Click the Web IDE button
- The modal should now list both forks, and still give you the option to create a new fork
- Create a personal fork this time
- Go back to the canonical project from step 2
- The Web IDE button should now read
Edit fork in Web IDE
and clicking it should open your personal fork directly in the Web IDE
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.
Edited by Lee Tickett