Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Improving component comparison to do side-by-side comparisons #138

Draft
wants to merge 112 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
83c4922
Add initial NLP app, spaCy libraries, nlp entity script
govreadydeploy Oct 17, 2021
eed9f10
Fixing references
govreadydeploy Oct 17, 2021
f494347
Fixing references 2
govreadydeploy Oct 17, 2021
7f98b99
Update CHANGELOG
govreadydeploy Oct 17, 2021
19f1a3d
Merge pull request #24 from GovReady/ge/nlp
gregelin Oct 17, 2021
f9aeb3b
Sync main and devlop 0.9.11.7-dev
Oct 18, 2021
c959766
Fix settings.py for reactNavbar
Oct 18, 2021
659a0ea
Fix tests
Oct 18, 2021
9fb22b7
Merge branch 'main' into develop
Oct 18, 2021
aa005a7
Remove duplicate code block. Update requirements.
Oct 19, 2021
700eca9
Improve appearance of toast messages
Oct 20, 2021
7220696
Improve appearance of toast messages
Oct 20, 2021
684a117
Merge pull request #25 from GovReady/ge/message-fix
gregelin Oct 20, 2021
be4bd0c
Improve appearance of toast messages - fix styles
Oct 20, 2021
1c2ba01
Rename speedy ssp module groups
Oct 20, 2021
d4a42bc
Merge pull request #26 from GovReady/ge/message-fix
gregelin Oct 20, 2021
d7252a8
Merge pull request #27 from GovReady/ge/speedy-name
gregelin Oct 20, 2021
a012f5e
Remove full text search of smts from compt library search
Oct 20, 2021
78c3998
Merge pull request #28 from GovReady/ge/faster-search
gregelin Oct 20, 2021
98cff60
Faster component search; Improve styling project page, template library
gregelin Oct 20, 2021
bf9b179
fixing tests on develop
govreadydeploy Oct 24, 2021
cc59f45
Fix settings.py to fix tests
govreadydeploy Oct 24, 2021
72b1736
Silent compliance app missing README warning
govreadydeploy Oct 24, 2021
e179a6c
Always display start project in app-store.html to fix tests
govreadydeploy Oct 24, 2021
5a75943
Include disabling docker-compose v2 in docs for MacOS
govreadydeploy Oct 24, 2021
d627eac
Merge pull request #30 from GovReady/ge/module-hover
gregelin Oct 25, 2021
7425952
Show module questions single page for better authoring
govreadydeploy Nov 9, 2021
578dfbb
Simpler display question display; jquery target multiple forms.
govreadydeploy Nov 12, 2021
c45e3b3
clean up
govreadydeploy Nov 12, 2021
ed1e0b6
Fix label alignment
govreadydeploy Nov 12, 2021
422771a
Start serializing form data
govreadydeploy Nov 13, 2021
78589c6
Basic saving of prompt changes
govreadydeploy Nov 14, 2021
b97d5e6
Save with AJAX working
govreadydeploy Nov 14, 2021
c012999
Connect new authoring tool to store templates
govreadydeploy Nov 15, 2021
4eb189d
Improve performance displayin appversion modules
govreadydeploy Nov 17, 2021
7eb5dc2
Serializers for Modules, ModuleQueestions
govreadydeploy Nov 17, 2021
ca86337
Work on cloning compliance app
govreadydeploy Nov 17, 2021
e0f96d6
Finish cloning of a compliance app
govreadydeploy Nov 18, 2021
01b55f3
Improve template library styling w bootstrap 3 panels
govreadydeploy Nov 18, 2021
7c05157
Merge better store css; add btns to listings
govreadydeploy Nov 18, 2021
4b7f22c
fix buttons in app store
govreadydeploy Nov 18, 2021
07f02c5
Include category in cloning. Fix cloning.
govreadydeploy Nov 18, 2021
a992b28
Add category to app-story-item
govreadydeploy Nov 18, 2021
efc3175
changed view to a table. old code is in hidden div below for loop
kerryrm Nov 18, 2021
6049f2c
Display modules and questions on same page to edit
govreadydeploy Nov 19, 2021
1340abc
HTML indents for clarity
govreadydeploy Nov 19, 2021
68a21fd
tweaks to display of questions.
kerryrm Nov 19, 2021
9c83841
Merge branch 'ge/better-authoring' of https://github.com/GovReady/gov…
kerryrm Nov 19, 2021
2abd91d
tweaks to display, moved modules to left col
kerryrm Nov 19, 2021
866f2ba
tweaks to display, moved modules to left col
kerryrm Nov 19, 2021
968c668
some tweaks in progress for card display
kerryrm Nov 20, 2021
626e898
Small tweaks. Hide slug field. Add shadow to create temmplate modal.
govreadydeploy Nov 20, 2021
2fbdd26
Adding in working editor to questions page
govreadydeploy Nov 21, 2021
2fa13a6
clean up github templates
govreadydeploy Nov 21, 2021
117b1bf
Question edit working with modal; highlight current module
govreadydeploy Nov 22, 2021
360a314
Display full question in tooltip
govreadydeploy Nov 22, 2021
4109b8d
hide q_id in authoring modal
govreadydeploy Nov 22, 2021
a63cbfa
UI tweaks to question edit.
kerryrm Nov 22, 2021
a038bc9
Add cookie crumbs to questions.html
govreadydeploy Nov 22, 2021
161565a
tweaks
kerryrm Nov 22, 2021
bdd3ed2
Merge branch 'ge/better-authoring' of https://github.com/GovReady/gov…
kerryrm Nov 22, 2021
a654f7d
tweaks
kerryrm Nov 23, 2021
51d2017
tweaked css for modal
kerryrm Nov 23, 2021
ed082c6
tweaked button and padding of rows
kerryrm Nov 23, 2021
ae84fd9
Add question after question
govreadydeploy Nov 23, 2021
dbfbcd3
Add new question after question
govreadydeploy Nov 23, 2021
b40de43
Fix tests
govreadydeploy Nov 23, 2021
479a21d
UI tweaks
kerryrm Nov 23, 2021
82d5b33
added arrow to insert button - temp
kerryrm Nov 23, 2021
a1bc3a7
attempting to fix an issue in clone/edit links occuring in MS Edge
kerryrm Nov 24, 2021
460cd03
Add output artifact simple editor
govreadydeploy Nov 25, 2021
4513427
Properly save upated to module output artificat
govreadydeploy Nov 25, 2021
5460a00
Merge pull request #80 from GovReady/ge/better-authoring-artifact
gregelin Nov 25, 2021
42fc866
Aenable saving new artifact; fix format & filename
govreadydeploy Nov 26, 2021
00af5d1
Fix artifact edit button
govreadydeploy Nov 26, 2021
922b776
Creating and saving new module artifact
govreadydeploy Nov 26, 2021
78e9f51
Questions page UI polishing
govreadydeploy Nov 26, 2021
356e48b
Merge pull request #45 from GovReady/ge/better-authoring
gregelin Nov 29, 2021
dff270e
tweaked the css to take advantage of bootstrap cols for panel tiling.…
kerryrm Nov 30, 2021
760dce0
changed grey line to a lighter shade
kerryrm Nov 30, 2021
e43258c
Merge pull request #85 from GovReady/ge/better-authoring
gregelin Dec 1, 2021
a055768
Add ID to all output artifacts
govreadydeploy Dec 6, 2021
d29a291
Merge pull request #89 from GovReady/ge/better-authoring
gregelin Dec 6, 2021
bee230c
Fix Cloning a project template from a freshly created new template
govreadydeploy Dec 6, 2021
900e96c
Merge pull request #90 from GovReady/ge/fix-clone-new-tmpl
gregelin Dec 6, 2021
89fb1e4
Fix question to module mappings when cloning modules
govreadydeploy Dec 8, 2021
2bc3584
Merge pull request #91 from GovReady/ge/fix-clone-new-tmpl
gregelin Dec 9, 2021
7e5261f
Bump version
gregelin Dec 10, 2021
76518a1
Update CHANGELOG to v0.9.11.8-dev
gregelin Dec 10, 2021
9b3f17a
Refactor project.html to remove legacy column code
govreadydeploy Dec 11, 2021
b1ab811
Display module outputs on project page
govreadydeploy Dec 11, 2021
105ddab
Fix tests
govreadydeploy Dec 11, 2021
7e406aa
Remove placement:action-buttons from project templates
govreadydeploy Dec 11, 2021
6425bb6
Merge pull request #94 from GovReady/ge/refactor-project-html
gregelin Dec 11, 2021
0029b87
Fix perms for non-admin to clone compliance apps
govreadydeploy Dec 12, 2021
c4f3a8e
Bump version
govreadydeploy Dec 12, 2021
d7d5a6d
Merge pull request #96 from GovReady/ge/fix-non-admin-cloning
gregelin Dec 12, 2021
5387ae7
Fix crash when restoring a previous version of a statement.
govreadydeploy Dec 12, 2021
d3091e4
Use update_or_create to fix set_security_impact_level
govreadydeploy Dec 12, 2021
af0f991
Adding back in question editing in question.html
govreadydeploy Dec 12, 2021
3dd2553
Add link from task to module authoring
govreadydeploy Dec 12, 2021
2030588
Remove debug comments
govreadydeploy Dec 12, 2021
31419ad
Merge pull request #98 from GovReady/ge/misc
gregelin Dec 12, 2021
797f776
fix queries for updating sensitivity level
govreadydeploy Dec 13, 2021
572ef3b
Merge pull request #99 from GovReady/ge/fix-sensitivity-level
gregelin Dec 13, 2021
511edaa
Stop scrubching of progress-project-area-wrapper on question page
govreadydeploy Dec 14, 2021
8554f0c
Simplify task progress history.
govreadydeploy Dec 14, 2021
6ab2673
Remove no longer needed spacing in groups
govreadydeploy Dec 14, 2021
481fa4f
Merge pull request #134 from GovReady/ge/fix-histpry-width
gregelin Dec 14, 2021
f687bf8
Add component control statement from System selected component
govreadydeploy Dec 15, 2021
d5b9f6c
redirect adding controls
govreadydeploy Dec 15, 2021
4e487c3
[WIP] Better loop for comparing components
Dec 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,37 @@ assignees: ''

---

**Describe the bug as a Story**
## Bug
A clear and concise description of what the bug is.

**To Reproduce**
## To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
- Virtual Machine?
- Screen size

## Expected behavior
A clear and concise description of what you expected to happen.

## Screenshots
If applicable, add screenshots to help explain your problem.


## Developer hints

Look at this file, template, etc
- hint

## Acceptance criteria

GIVEN this issue ...
WHEN I do this ...
THEN this happens ...

- criteria

**Additional context**
Add any other context about the problem here.

### Links referenced in issue
## Reference
19 changes: 11 additions & 8 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
## Stories

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
As a user, I want this so that I can that.

## Discussion

- item

## Visuals


## Acceptance Criteria

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
48 changes: 0 additions & 48 deletions .github/ISSUE_TEMPLATE/issue-report.md

This file was deleted.

46 changes: 44 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,54 @@
GovReady-Q Release Notes
========================

v0.9.11.7-dev (October xx, 2021)
--------------------------------

v0.9.11.11-dev (December xx, 2021)
---------------------------------

**UI changes**

* Simplify task progress history. Only display questions of current module. Only colorize to glyphicons.
* Enable adding component control statement from System selected component.

**Bug fixes**

* Stop scrubching of progress-project-area-wrapper on question page.


v0.9.11.10-dev (December xx, 2021)
---------------------------------

Introuduce new authoring tool. Remove authoring tool modal from task question page.

**Feature changes**

* Enabling batch viewing of questions for easier questionnaire authoring.
* Enable editing of artifacts.
* Enabling cloning entire templates in template library.

**Developer changes**

* Add Django `nlp` app to system to support Natural Language Processing of SSPs and statements.
* Include spaCy libraries as part of build.
* Include initial, simplified candidate entity recognition script.
* Remove full text search of statements from component library search because it was slow and returned to many results.
* Add serializers for Modules and ModuleQuestions.
* Refactor siteapp.views.project and templates/project.html to remove vestigial column vs row layout code and previous authoring tools.
* Remove authoring tool modal from task question page.

**UI changes**

* Use left side vertical React navigation menu for project.
* Improve toast message appearance by limiting width.
* Improve styling of project page rollovers make module actions clearer
* Improve styling of template library. Use bootstrap panels for each item.
* Remove authoring tool modal from task question page.

**Bug fixes**

* Fix permissions to allow non-administrator to clone project templates in project template.
* Fix crash when restoring a previous version of a statement.
* Fix setting control baseline by proper use of `update_or_create` in `System.set_security_impact_level`.


v0.9.11.6 (October 13, 2021)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.9.11.7-dev
v0.9.11.11-dev
2 changes: 1 addition & 1 deletion api/base/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ def get_swagger_urls():

return [
url(r'^docs/swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
url(r'^docs/swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui')
url(r'^docs/swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
]

3 changes: 3 additions & 0 deletions api/guidedmodules/serializers/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class Meta:


class SimpleAppVersionSourceSerializer(ReadOnlySerializer):
catalog_metadata = serializers.JSONField()
asset_paths = serializers.JSONField()

class Meta:
model = AppVersion
fields = ['appname', 'system_app', 'catalog_metadata', 'version_number', 'version_name', 'input_paths',
Expand Down
39 changes: 34 additions & 5 deletions api/guidedmodules/serializers/modules.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from rest_framework import serializers

from api.base.serializers.types import ReadOnlySerializer
from api.guidedmodules.serializers.app import DetailedAppVersionSerializer, SimpleAppSourceSerializer
from api.base.serializers.types import ReadOnlySerializer, WriteOnlySerializer
from api.guidedmodules.serializers.app import DetailedAppVersionSerializer, SimpleAppSourceSerializer, SimpleAppVersionSourceSerializer
from guidedmodules.models import Module, ModuleAsset, ModuleQuestion
from rest_framework_recursive.fields import RecursiveField

Expand All @@ -16,7 +16,6 @@ class Meta:
model = Module
fields = ['module_name', 'spec']


class DetailedModuleSerializer(SimpleModuleSerializer):
source = SimpleAppSourceSerializer()
app = DetailedAppVersionSerializer()
Expand All @@ -42,15 +41,45 @@ class Meta:


class SimpleModuleQuestionSerializer(ReadOnlySerializer):
spec = serializers.JSONField()

class Meta:
model = ModuleQuestion
fields = ['key', 'definition_order', 'spec']


class DetailedModuleQuestionSerializer(SimpleModuleQuestionSerializer):
module = DetailedModuleSerializer()

class Meta:
model = ModuleQuestion
fields = SimpleModuleQuestionSerializer.Meta.fields


class ModuleQuestionListSerializer(SimpleModuleQuestionSerializer):
answer_type_module = DetailedModuleSerializer()

class Meta:
model = ModuleQuestion
fields = SimpleModuleQuestionSerializer.Meta.fields + ['module', 'answer_type_module']
fields = SimpleModuleQuestionSerializer.Meta.fields

class ModuleReadSerializer(ReadOnlySerializer):
spec = serializers.JSONField()
app = SimpleAppVersionSourceSerializer()
questions = SimpleModuleQuestionSerializer(many=True)

class Meta:
model = Module
fields = ['module_name', 'spec', 'app', 'questions']

class CreateModuleQuestionSerializer(WriteOnlySerializer):
spec = serializers.JSONField()
key = serializers.CharField()
definition_order = serializers.IntegerField()

# module_id = serializers.PrimaryKeyRelatedField(source='module', allow_null=False, queryset=Module.objects)

class Meta:
model = ModuleQuestion
fields = ['key', 'definition_order', 'spec'
]

9 changes: 9 additions & 0 deletions api/guidedmodules/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
from django.conf.urls import url
from django.urls import include
from rest_framework import routers
from rest_framework_nested.routers import NestedSimpleRouter
from api.guidedmodules.views.module import ModuleViewSet
from api.guidedmodules.views.module_questions import ModuleQuestionViewSet


router = routers.DefaultRouter()
router.register('modules', ModuleViewSet)

module_router = NestedSimpleRouter(router, 'modules', lookup='modules')
module_router.register('questions', ModuleQuestionViewSet, basename='module-questions')

urlpatterns = [
url(r'^', include(router.urls)),
url(r'^', include(module_router.urls)),
]
13 changes: 13 additions & 0 deletions api/guidedmodules/views/module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from rest_framework.decorators import action
from rest_framework.response import Response

from api.base.views.base import SerializerClasses
from api.base.views.viewsets import ReadOnlyViewSet
from api.guidedmodules.serializers.modules import ModuleReadSerializer
from guidedmodules.models import Module


class ModuleViewSet(ReadOnlyViewSet):
queryset = Module.objects.all()
serializer_classes = SerializerClasses(retrieve=ModuleReadSerializer,
list=ModuleReadSerializer)
19 changes: 19 additions & 0 deletions api/guidedmodules/views/module_questions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from rest_framework.decorators import action
from rest_framework.response import Response

from api.base.views.base import SerializerClasses
from api.base.views.viewsets import ReadWriteViewSet
from api.guidedmodules.serializers.modules import SimpleModuleQuestionSerializer, CreateModuleQuestionSerializer
from guidedmodules.models import Module, ModuleQuestion


class ModuleQuestionViewSet(ReadWriteViewSet):
NESTED_ROUTER_PKS = [{'pk': 'modules_pk', 'model_field': 'module', 'model': Module}]
queryset = ModuleQuestion.objects.all()
ordering = ('definition_order',)
serializer_classes = SerializerClasses(retrieve=SimpleModuleQuestionSerializer,
list=SimpleModuleQuestionSerializer,
create=CreateModuleQuestionSerializer,
update=CreateModuleQuestionSerializer,
destroy=CreateModuleQuestionSerializer)

21 changes: 15 additions & 6 deletions controls/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,16 +590,25 @@ def remove_control(self, control_id):
@transaction.atomic
def set_security_sensitivity_level(self, security_sensitivity_level):
"""Assign Security Sensitivty level to system"""
# Get or create the security_sensitivity_level smt for system's root_element; should only have 1 statement
smt = Statement.objects.create(statement_type=StatementTypeEnum.SECURITY_SENSITIVITY_LEVEL.name, producer_element=self.root_element, consumer_element=self.root_element, body=security_sensitivity_level)
return security_sensitivity_level, smt
# Update or create the security_sensitivity_level smt for system's root_element; should only have 1 statement

# NOTE: Cannot us update or create because changing security_sensitivity_smt level will fail to find existing security_sensitivity_smt
if Statement.objects.filter(statement_type=StatementTypeEnum.SECURITY_SENSITIVITY_LEVEL.name, producer_element=self.root_element,consumer_element=self.root_element).exists():
security_sensitivity_smt = Statement.objects.get(statement_type=StatementTypeEnum.SECURITY_SENSITIVITY_LEVEL.name, producer_element=self.root_element,consumer_element=self.root_element)
security_sensitivity_smt.body = security_sensitivity_level
security_sensitivity_smt.save()
else:
# Set the security_sensitivity_level smt for element; should only have 1 statement
security_sensitivity_smt = Statement.objects.create(statement_type=StatementTypeEnum.SECURITY_SENSITIVITY_LEVEL.name, producer_element=self.root_element,consumer_element=self.root_element, body=security_sensitivity_level)

return security_sensitivity_level, security_sensitivity_smt

@property
def get_security_sensitivity_level(self):
"""Assign Security Sensitivty level to system"""
"""Get Security Sensitivty level to system"""

# Get or create the security_sensitivity_level smt for system's root_element; should only have 1 statement
smt, created = Statement.objects.get_or_create(statement_type=StatementTypeEnum.SECURITY_SENSITIVITY_LEVEL.name, producer_element=self.root_element, consumer_element=self.root_element)
smt = Statement.objects.get(statement_type=StatementTypeEnum.SECURITY_SENSITIVITY_LEVEL.name, producer_element=self.root_element, consumer_element=self.root_element)
security_sensitivity_level = smt.body
return security_sensitivity_level

Expand All @@ -612,7 +621,7 @@ def set_security_impact_level(self, security_impact_level):
security_objective_smt.update(body=security_impact_level)
else:
# Set the security_impact_level smt for element; should only have 1 statement
security_objective_smt, created = Statement.objects.get_or_create(statement_type=StatementTypeEnum.SECURITY_IMPACT_LEVEL.name, producer_element=self.root_element,consumer_element=self.root_element, body=security_impact_level)
security_objective_smt, created = Statement.objects.create(statement_type=StatementTypeEnum.SECURITY_IMPACT_LEVEL.name, producer_element=self.root_element,consumer_element=self.root_element, body=security_impact_level)
return security_impact_level, security_objective_smt

@property
Expand Down
Loading