Skip to content

Commit 6d7d15f

Browse files
committed
do not show disabled rules in main UI
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent 9e4be35 commit 6d7d15f

5 files changed

Lines changed: 7 additions & 9 deletions

File tree

docs/howto-6-policy-rules-configuration.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ and detection date.
104104
.. image:: images/howto-6-policy-rules-configuration/compliance-tab-policy-violations.jpg
105105

106106
.. tip::
107-
To see the status of all configured rules, including those that are not triggered,
108-
click the info icon next to the panel title. A modal opens showing every rule with
109-
its current status: **Triggered**, **OK**, or **Disabled**.
107+
To see the status of all active rules, including those that are not triggered,
108+
click the info icon next to the panel title. A modal opens showing every enabled
109+
rule with its current status: **Triggered** or **OK**.
110110

111111
To drill into the affected packages for a specific rule:
112112

-12.3 KB
Loading

docs/reference-policy-rules.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ The badge count in the panel header reflects the total number of triggered rules
232232
color is red if at least one error-severity rule is triggered, yellow if only
233233
warning-severity rules are triggered.
234234

235-
Clicking the **info icon** next to the panel title opens a modal listing all configured
236-
rules with their current status (Triggered, OK, or Disabled).
235+
Clicking the **info icon** next to the panel title opens a modal listing all active
236+
rules with their current status: **Triggered** or **OK**.
237237

238238
.. image:: images/reference-policy-rules/compliance-tab-policy-rules.jpg
239239
:width: 500

product_portfolio/templates/product_portfolio/compliance/compliance_panels.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ <h5 class="modal-title fs-6 fw-medium" id="policy-rules-modal-label">{% trans "P
6262
<div class="text-body-secondary small">{{ rule.description }}</div>
6363
</div>
6464
<div class="flex-shrink-0">
65-
{% if not rule.is_active %}
66-
<span class="badge text-bg-secondary">{% trans "Disabled" %}</span>
67-
{% elif rule.is_violated %}
65+
{% if rule.is_violated %}
6866
{% if rule.severity == "error" %}
6967
<span class="badge bg-danger-subtle text-danger-emphasis">{% trans "Triggered" %}</span>
7068
{% else %}

product_portfolio/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2887,10 +2887,10 @@ def rule_registry_position(violation):
28872887
"description": handler.description,
28882888
"rule_type": rule_type,
28892889
"severity": handler.severity,
2890-
"is_active": rules_config.get(rule_type, {}).get("is_active", False),
28912890
"is_violated": rule_type in violated_rule_types,
28922891
}
28932892
for rule_type, handler in RULE_REGISTRY.items()
2893+
if rules_config.get(rule_type, {}).get("is_active", False)
28942894
]
28952895
has_error_violation = any(
28962896
violation.rule_severity == "error" for violation in policy_violations

0 commit comments

Comments
 (0)