Render Not applicable status in compliance dashboard UI
What does this MR do and why?
The backend now reports NOT_APPLICABLE compliance control statuses, plus N/A counts for requirements and controls. The compliance dashboard UI only knew pass, fail and pending. Because of that, requirements where every control is N/A showed as Passed, N/A controls showed How to fix in the details drawer, and the Requirements and Controls charts left them out.
This MR shows Not applicable in a neutral grey (gl-text-status-neutral / gl-fill-status-neutral). The status should signal neither urgency nor confidence. The order of precedence matches the backend's coverage_statistics: Failed > Pending > Not applicable (N/A only) > Passed. Passed plus N/A still counts as Passed.
Changes:
- GraphQL queries: request
notApplicableCount(requirement statuses) andnotApplicable(requirement coverage) with@gl_introduced(version: "19.6.0"). requirement_status.vue: new optionalnotApplicableCountprop (default0) and an N/A state with a neutral icon. The "x/y failed" total still leaves out N/A controls.requirement_status_with_tooltip.vue: passes the count through and adds a "Not applicable controls" section to the tooltip.details_drawer.vue: shows "Not applicable controls: N" when the count is above 0.statuses_list.vue: N/A controls sort last and get a neutral "Not applicable" header. They show neither "How to fix" nor the "passed successfully" message, but the control description is still shown.- Dashboard charts (
status_chart.vue,chart.js): a fourth "Not applicable" bar colored withGL_STATUS_NEUTRAL_ICON_COLOR(light and dark variants). - Dashboard panels: when every count is N/A, the panels show the chart instead of the empty state. A
null/missingnotApplicableis treated as0.
Implementation notes:
status_neutral(an icon name suggested in the plan) does not exist in@gitlab/svgs. I usedstatus_skippedinstead. It belongs to the samestatus_*family asstatus_failedandstatus_success, and it means "did not run / not applicable".- The chart color is
GL_STATUS_NEUTRAL_ICON_COLOR. It exists in bothtokens.jsandtokens.dark.js, and it is the same neutral status color the utility classes use.
References
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
How to set up and validate locally
- In a group with compliance frameworks, requirements and controls, set some control statuses to N/A in the Rails console, for example
ComplianceManagement::ComplianceFramework::ProjectControlComplianceStatus.last.update!(status: :not_applicable). Then refresh the requirement status counts (not_applicable_count) the way the backend does. - Go to Secure > Compliance center.
- On Overview, the Requirements and Controls charts show a grey Not applicable bar.
- On the Status tab, a requirement whose controls are all N/A shows a grey Not applicable status. Hovering lists "Not applicable controls".
- In the details drawer, the "Not applicable controls: N" count is shown, and N/A controls are listed last without "How to fix".
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.
