Compliance Center > Edit Framework > Block users from creating more than 50 requirements per framework

What does this MR do and why?

Add limit to creating requirements in UI

We want to block users from creating more than 50 requirements per framework in the UI.

References

Screenshots or screen recordings

Before After
Screen_Recording_2025-03-28_at_5.53.31_PM Screen_Recording_2025-03-28_at_5.52.02_PM

How to set up and validate locally

  1. Enable the feature flag
Feature.enable(:enable_standards_adherence_dashboard_v2)
  1. Head to the Compliance center
  2. Click on New framework and create a new framework
  3. Head to the Compliance center
  4. Edit your new framework Screenshot_2025-03-27_at_10.41.54_PM
  5. In the requirements section, click on New requirement
  6. Add a name and description
  7. In a rails console:
requirement = ComplianceManagement::ComplianceFramework::ComplianceRequirement.last
1.upto(49) do |x|
  new_requirement = requirement.dup
  new_requirement.name = "#{new_requirement.name} #{x}"
  new_requirement.save!
end
  1. Refresh the edit framework page and verify that there are 50 requirements and the New framework button is disabled and has the tooltip.

MR acceptance checklist

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

Merge request reports

Loading