Skip to content

Add empty state option for protection component

Paulina Sedlak-Jakubowska requested to merge 388129-empty-states into master

What does this MR do and why?

Adds empty state text and help text option, when there's no data and copy is provided for these three sections:

  • Allowed to push and merge
  • Allowed to merge
  • Status checks

I added a little bit of refactor in unit test.

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-24_at_15.35.32 Screenshot_2024-04-24_at_15.24.05
Screenshot_2024-04-29_at_11.52.51 Screenshot_2024-04-29_at_11.36.49
Screenshot_2024-04-29_at_11.54.01 Screenshot_2024-04-29_at_11.04.02

How to set up and validate locally

  1. Open Rails console. In your terminal: rails c
  2. Enable the feature flag:
Feature.enable(:edit_branch_rules)
  1. In a project, go to Settings / Repository
  2. Expand Branch rules section
  3. Click on Add branch rule and select All branches. You should be redirected to a details page.
  4. As a default, Status Checks section should show with the empty state copy.
  5. Navigate back to Settings / Repository Branch rules.
  6. Click on Add branch rule and select Branch name or pattern
  7. Select a branch that is set in Settings / Repository / Protected branches. Make sure that either Allowed to merge or Allowed to push and merge has nothing selected.

Numbered steps to set up and validate the change are strongly suggested.

Related to #388129 (closed)

Edited by Paulina Sedlak-Jakubowska

Merge request reports