-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UI for legacy statement display. Also fix StatementTypeEnum. (#1644)
* [WIP] UI to display legacy control impl smts Create a conditional display of legacy control implementation statements in control editor page. Also widen width of display of editor control statements to 1250px. * Improve display of legacy statement * StatementTypeEnum fixes. Closes #1643 Set all `StatementTypeEnum.<LABEL>.value` to `StatementTypeEnum.<LABEL>.name` in order for relevant label/term to show up in Django database admin interface. Set component library detail page Systems tab to not be inactive thereby removing the content from the System tab showing up on the Control Implementation Statements tab. Update controls.tests. Co-authored-by: Greg Elin <greg.elin@govready.com>
- Loading branch information
1 parent
c98f4a1
commit 57688c2
Showing
11 changed files
with
188 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Generated by Django 3.1.8 on 2021-06-29 23:28 | ||
|
||
from django.db import migrations | ||
from controls.enums.statements import StatementTypeEnum | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('controls', '0051_auto_20210520_1213'), | ||
] | ||
|
||
def update_statement_type_to_enum_name(apps, schema_editor): | ||
"""Update the statement_type values to use enum 'name' instead of enum 'value'""" | ||
|
||
apps.get_model("controls", "Statement")\ | ||
.objects\ | ||
.filter(statement_type=StatementTypeEnum.CONTROL_IMPLEMENTATION.value)\ | ||
.update(statement_type=StatementTypeEnum.CONTROL_IMPLEMENTATION.name) | ||
|
||
apps.get_model("controls", "Statement")\ | ||
.objects\ | ||
.filter(statement_type=StatementTypeEnum.CONTROL_IMPLEMENTATION_LEGACY.value)\ | ||
.update(statement_type=StatementTypeEnum.CONTROL_IMPLEMENTATION_LEGACY.name) | ||
|
||
apps.get_model("controls", "Statement")\ | ||
.objects\ | ||
.filter(statement_type=StatementTypeEnum.CONTROL_IMPLEMENTATION_PROTOTYPE.value)\ | ||
.update(statement_type=StatementTypeEnum.CONTROL_IMPLEMENTATION_PROTOTYPE.name) | ||
|
||
apps.get_model("controls", "Statement")\ | ||
.objects\ | ||
.filter(statement_type=StatementTypeEnum.ASSESSMENT_RESULT.value)\ | ||
.update(statement_type=StatementTypeEnum.ASSESSMENT_RESULT.name) | ||
|
||
apps.get_model("controls", "Statement")\ | ||
.objects\ | ||
.filter(statement_type=StatementTypeEnum.POAM.value)\ | ||
.update(statement_type=StatementTypeEnum.POAM.name) | ||
|
||
apps.get_model("controls", "Statement")\ | ||
.objects\ | ||
.filter(statement_type=StatementTypeEnum.FISMA_IMPACT_LEVEL.value)\ | ||
.update(statement_type=StatementTypeEnum.FISMA_IMPACT_LEVEL.name) | ||
|
||
apps.get_model("controls", "Statement")\ | ||
.objects\ | ||
.filter(statement_type=StatementTypeEnum.SECURITY_IMPACT_LEVEL.value)\ | ||
.update(statement_type=StatementTypeEnum.SECURITY_IMPACT_LEVEL.name) | ||
|
||
operations = [ | ||
migrations.RunPython(update_statement_type_to_enum_name), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.