Fix incorrect confirmation modal prompt when updating project settings
What does this MR do and why?
Fixes the broken behaviour in #350347 (closed) by ensuring we only prompt the user's to confirm reducing a projects visibility settings if the visibility field is changed.
- Moves the submit button from haml to vue
- Adds a condition to check if the project visibility has been lowered
- Updates related tests
This was first introduced in !76417 (merged) and seems to only affect projects that have existing forks.
Screenshots or screen recordings
No confirmation needed | Confirmation needed |
---|---|
![]() |
![]() |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Testing the modal
- Create a project with
public
visibility - Login as another user and fork the project
- Return to your initial user
- Navigate to project settings
<gdk>/<project-path>/edit
- Expand "Visibility, project features, permissions"
- Change the project visibility to
private
- Click save
- You will be prompted to confirm the change to visibility
Testing the bug fix
- Create a project with
public
visibility - Login as another user and fork the project
- Return to your initial user
- Navigate to project settings
<gdk>/<project-path>/edit
- Expand "Visibility, project features, permissions"
- Change any other field in this section
- Click save
- No prompt
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 #350347 (closed)
Edited by Ezekiel Kigbo