Skip to content

Commit

Permalink
Closes #1547 Display impact level on project page.
Browse files Browse the repository at this point in the history
Implement impact level as a statement about a system of type "fisma_impact_level"
with imoact level in body. This continues idea that statements are
factual observations about a system.  Statement must be associated
with system.root_element and be consumed by root_element.
  • Loading branch information
govreadydeploy committed Apr 19, 2021
1 parent ecb703e commit 52b9590
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ GovReady-Q Release Notes
v999 (April XX, 2021)
-------------------------

**UI changes**

* Display system impact level on project page.

[Add changes here]
**Data changes**

* Use statement type `fisma_impact_level` to track impact level of a system.

v0.9.3.3 (April 13, 2021)
-------------------------
Expand Down
8 changes: 8 additions & 0 deletions siteapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,10 +946,18 @@ def project(request, project):
if approx_compliance_degrees > 358:
approx_compliance_degrees = 358

# Fetch statement defining FISMA impact level if set
impact_level_smts = project.system.root_element.statements_consumed.filter(statement_type="fisma_impact_level")
if len(impact_level_smts) > 0:
impact_level = impact_level_smts[0].body
else:
impact_level = None

# Render.
return render(request, "project.html", {
"is_project_page": True,
"project": project,
"impact_level": impact_level,

"controls_status_count": project.system.controls_status_count,
"poam_status_count": project.system.poam_status_count,
Expand Down
10 changes: 9 additions & 1 deletion templates/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,15 @@ <h2 class="status">{{ poam_status_count.Open }}</h2> <span class="status-small">
<div class="status-box-invisible">
<h2 class="piechart" style="background-image: conic-gradient(#E1F8E2 {{ approx_compliance_degrees }}deg,
#B2E0B2 0 235deg);"> </h2>
<span class="status-small">{{ percent_compliant_100|floatformat:2 }}% compliance (unassessed)<span>
<span class="status-small">{{ percent_compliant_100|floatformat:2 }}% compliance (unassessed)</span>
<br/>
<span class="status-small">
{% if impact_level %}
mission impact: <b>{{ impact_level|lower }}</b>
{% else %}
mission impact: <b>not categorized</b>
{% endif %}
</span>
</div>
</div>
</div>
Expand Down

0 comments on commit 52b9590

Please sign in to comment.