Skip to content

Fix incorrect `locked` state for missing group settings

What does this MR do and why?

Contributes to #441089 (closed)

Problem

When user visits approval settings the first time, it seems that all settings are available for the change. However, after saving them the user start seeing restrictions from the instance level.

It happens because the missing GroupMergeRequestApprovalSetting is treated like the group is missing.

Solution

Correctly set locked state for missing settings case.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-04-10_at_17.42.19 Screenshot_2024-04-10_at_17.42.00 Screenshot_2024-04-10_at_17.42.33 Screenshot_2024-04-10_at_17.41.55

How to set up and validate locally

  1. Configure Merge Request Approval Settings at instance level
  2. Visit a group without Merge Request Approval Settings
  3. You should see that instance level values are visually locked
  4. Without the fix, they will appear active before you save the form.
Edited by Vasilii Iakliushin

Merge request reports