Fix project setting approval input in non-sequential order
Issue: #37951 (closed)
What does this MR do?
In the Merge request approvals under the project settings page, when increasing/decreasing the no. of required approvals input, it has a strange behavior. It seems like the FE is overriding and then slowly changing the number.
This is because the changes are saved immediately when the input is changed. So this MR adds a debounce to delay immediate save of every change.
Testing
- Go to Settings > General > Expand Merge request approvals
- Try to increase the number by clicking the up caret as quickly as you can from ex. 6 - 20 (or to any number)
-
The number should increase in sequential order
-
When you refresh the page, the new approval amount is saved. -
This effect should also work when decrementing
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Closes #37951I