Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
feat(2.0): add endpoint to remove all project data #957
Browse files Browse the repository at this point in the history
feat(2.0): add endpoint to remove all project data
  • Loading branch information
obdulia-losantos authored Aug 16, 2021
2 parents 45093cf + a80fc43 commit 955c2d1
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 123 deletions.
26 changes: 11 additions & 15 deletions aether-entity-extraction-module/conf/pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,36 @@ aether.python==1.3.0
attrs==21.2.0
avro-python3==1.10.2
certifi==2021.5.30
cffi==1.14.5
chardet==4.0.0
charset-normalizer==2.0.4
coverage==5.5
cryptography==3.4.7
decorator==5.0.9
eha-jsonpath==0.6.0
fakeredis==1.5.1
fakeredis==1.6.0
flake8==3.9.2
flake8-quotes==3.2.0
gevent==21.1.2
greenlet==1.1.0
idna==2.10
gevent==21.8.0
greenlet==1.1.1
idna==3.2
iniconfig==1.1.1
jsonpath-ng==1.5.2
jsonpath-ng==1.5.3
jsonschema==3.2.0
mccabe==0.6.1
packaging==20.9
packaging==21.0
pluggy==0.13.1
ply==3.11
py==1.10.0
pycodestyle==2.7.0
pycparser==2.20
pyflakes==2.3.1
pyOpenSSL==20.0.1
pyparsing==2.4.7
pyrsistent==0.17.3
pyrsistent==0.18.0
pytest==6.2.4
redis==3.5.3
requests==2.25.1
requests==2.26.0
six==1.16.0
sortedcontainers==2.4.0
spavro==1.1.23
spavro==1.1.24
tblib==1.7.0
toml==0.10.2
urllib3==1.26.5
urllib3==1.26.6
zope.event==4.5.0
zope.interface==5.4.0
17 changes: 17 additions & 0 deletions aether-kernel/aether/kernel/api/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,23 @@ def test_schema_validate_definition__errors(self):
)
self.assertEqual(response.status_code, 400)

def test_project_delete_data(self):
self.assertEqual(reverse('project-erase_data', kwargs={'pk': 1}),
'/projects/1/delete-data/')
url = reverse('project-erase_data', kwargs={'pk': self.project.pk})

submissions = models.Submission.objects.filter(mappingset__project=self.project)
entities = models.Entity.objects.filter(project=self.project)

self.assertGreater(submissions.count(), 0)
self.assertGreater(entities.count(), 0)

response = self.client.patch(url)
self.assertEqual(response.status_code, 204)

self.assertEqual(submissions.count(), 0)
self.assertEqual(entities.count(), 0)

def test_project__schemas_skeleton(self):
self.assertEqual(reverse('project-skeleton', kwargs={'pk': 1}),
'/projects/1/schemas-skeleton/')
Expand Down
13 changes: 13 additions & 0 deletions aether-kernel/aether/kernel/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ class ProjectViewSet(MtViewSetMixin, FilteredMixin, ExtractMixin, viewsets.Model
filter_class = filters.ProjectFilter
search_fields = ('name',)

@action(detail=True, methods=['patch'], url_name='erase_data', url_path='delete-data')
def delete_data(self, request, pk=None, *args, **kwargs):
instance = self.get_object_or_404(pk=pk)
try:
instance.submissions.all().delete()
instance.entities.all().delete()
return Response(status=status.HTTP_204_NO_CONTENT)
except Exception as e: # pragma: no cover
return Response(
str(e),
status=status.HTTP_500_INTERNAL_SERVER_ERROR,
)

@action(detail=True, methods=['get'], url_name='skeleton', url_path='schemas-skeleton')
def schemas_skeleton(self, request, pk=None, *args, **kwargs):
'''
Expand Down
58 changes: 28 additions & 30 deletions aether-kernel/conf/pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,22 @@ aether.sdk==1.3.8
attrs==21.2.0
autopep8==1.5.7
avro-python3==1.10.2
boto3==1.17.86
botocore==1.20.86
boto3==1.18.21
botocore==1.21.21
cachetools==4.2.2
certifi==2021.5.30
cffi==1.14.5
chardet==4.0.0
cffi==1.14.6
charset-normalizer==2.0.4
configparser==5.0.2
coreapi==2.3.3
coreschema==0.0.4
coverage==5.5
cryptography==3.4.7
decorator==5.0.9
Django==2.2.24
django-cacheops==6.0
django-cleanup==5.2.0
django-cors-headers==3.7.0
django-debug-toolbar==3.2.1
django-cors-headers==3.8.0
django-debug-toolbar==3.2.2
django-dynamic-fixture==3.1.1
django-filter==2.4.0
django-minio-storage==0.3.10
Expand All @@ -52,58 +51,57 @@ et-xmlfile==1.1.0
flake8==3.9.2
flake8-quotes==3.2.0
funcy==1.16
google-api-core==1.29.0
google-auth==1.30.1
google-cloud-core==1.6.0
google-cloud-storage==1.38.0
google-api-core==1.31.1
google-auth==1.34.0
google-cloud-core==1.7.2
google-cloud-storage==1.42.0
google-crc32c==1.1.2
google-resumable-media==1.3.0
google-resumable-media==1.3.3
googleapis-common-protos==1.53.0
gprof2dot==2021.2.21
greenlet==1.1.0
idna==2.10
greenlet==1.1.1
idna==3.2
inflection==0.5.1
itypes==1.2.0
Jinja2==3.0.1
jmespath==0.10.0
jsonpath-ng==1.5.2
jsonpath-ng==1.5.3
jsonschema==3.2.0
lxml==4.6.3
Markdown==3.3.4
MarkupSafe==2.0.1
mccabe==0.6.1
minio==6.0.2
openpyxl==3.0.7
packaging==20.9
packaging==21.0
ply==3.11
prometheus-client==0.11.0
protobuf==3.17.2
protobuf==3.17.3
psycopg2-binary==2.8.6
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycodestyle==2.7.0
pycparser==2.20
pyflakes==2.3.1
Pygments==2.9.0
pyOpenSSL==20.0.1
Pygments==2.10.0
pyparsing==2.4.7
pyrsistent==0.17.3
python-dateutil==2.8.1
python-json-logger==2.0.1
pyrsistent==0.18.0
python-dateutil==2.8.2
python-json-logger==2.0.2
pytz==2021.1
redis==3.5.3
requests==2.25.1
requests==2.26.0
rsa==4.7.2
ruamel.yaml==0.17.7
ruamel.yaml.clib==0.2.2
s3transfer==0.4.2
sentry-sdk==1.1.0
ruamel.yaml==0.17.10
ruamel.yaml.clib==0.2.6
s3transfer==0.5.0
sentry-sdk==1.3.1
six==1.16.0
spavro==1.1.23
SQLAlchemy==1.4.17
spavro==1.1.24
SQLAlchemy==1.4.22
sqlparse==0.4.1
tblib==1.7.0
toml==0.10.2
uritemplate==3.0.1
urllib3==1.26.5
urllib3==1.26.6
uWSGI==2.0.19.1
50 changes: 24 additions & 26 deletions aether-odk-module/conf/pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@

aether.sdk==1.3.8
autopep8==1.5.7
boto3==1.17.86
botocore==1.20.86
boto3==1.18.21
botocore==1.21.21
cachetools==4.2.2
certifi==2021.5.30
cffi==1.14.5
chardet==4.0.0
cffi==1.14.6
charset-normalizer==2.0.4
configparser==5.0.2
coverage==5.5
cryptography==3.4.7
Django==2.2.24
django-cacheops==6.0
django-cleanup==5.2.0
django-cors-headers==3.7.0
django-debug-toolbar==3.2.1
django-cors-headers==3.8.0
django-debug-toolbar==3.2.2
django-minio-storage==0.3.10
django-postgrespool2==2.0.1
django-prometheus==2.1.0
Expand All @@ -41,16 +40,16 @@ flake8==3.9.2
flake8-quotes==3.2.0
FormEncode==1.3.1
funcy==1.16
google-api-core==1.29.0
google-auth==1.30.1
google-cloud-core==1.6.0
google-cloud-storage==1.38.0
google-api-core==1.31.1
google-auth==1.34.0
google-cloud-core==1.7.2
google-cloud-storage==1.42.0
google-crc32c==1.1.2
google-resumable-media==1.3.0
google-resumable-media==1.3.3
googleapis-common-protos==1.53.0
gprof2dot==2021.2.21
greenlet==1.1.0
idna==2.10
greenlet==1.1.1
idna==3.2
Jinja2==3.0.1
jmespath==0.10.0
linecache2==1.0.0
Expand All @@ -59,36 +58,35 @@ Markdown==3.3.4
MarkupSafe==2.0.1
mccabe==0.6.1
minio==6.0.2
packaging==20.9
packaging==21.0
prometheus-client==0.11.0
protobuf==3.17.2
protobuf==3.17.3
psycopg2-binary==2.8.6
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycodestyle==2.7.0
pycparser==2.20
pyflakes==2.3.1
Pygments==2.9.0
pyOpenSSL==20.0.1
Pygments==2.10.0
pyparsing==2.4.7
python-dateutil==2.8.1
python-json-logger==2.0.1
python-dateutil==2.8.2
python-json-logger==2.0.2
pytz==2021.1
pyxform==1.5.1
redis==3.5.3
requests==2.25.1
requests==2.26.0
rsa==4.7.2
s3transfer==0.4.2
sentry-sdk==1.1.0
s3transfer==0.5.0
sentry-sdk==1.3.1
six==1.16.0
spavro==1.1.23
SQLAlchemy==1.4.17
spavro==1.1.24
SQLAlchemy==1.4.22
sqlparse==0.4.1
tblib==1.7.0
toml==0.10.2
traceback2==1.4.0
unicodecsv==0.14.1
unittest2==1.1.0
urllib3==1.26.5
urllib3==1.26.6
uWSGI==2.0.19.1
xlrd==1.2.0
22 changes: 9 additions & 13 deletions aether-producer/conf/pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,35 @@

attrs==21.2.0
certifi==2021.5.30
cffi==1.14.5
chardet==4.0.0
charset-normalizer==2.0.4
click==8.0.1
confluent-kafka==1.7.0
cryptography==3.4.7
flake8==3.9.2
flake8-quotes==3.2.0
Flask==2.0.1
gevent==21.1.2
greenlet==1.1.0
idna==2.10
gevent==21.8.0
greenlet==1.1.1
idna==3.2
iniconfig==1.1.1
itsdangerous==2.0.1
Jinja2==3.0.1
MarkupSafe==2.0.1
mccabe==0.6.1
packaging==20.9
packaging==21.0
pluggy==0.13.1
psycogreen==1.0.2
psycopg2-binary==2.8.6
py==1.10.0
pycodestyle==2.7.0
pycparser==2.20
pyflakes==2.3.1
pyOpenSSL==20.0.1
pyparsing==2.4.7
pytest==6.2.4
requests==2.25.1
requests==2.26.0
six==1.16.0
spavro==1.1.23
SQLAlchemy==1.4.17
spavro==1.1.24
SQLAlchemy==1.4.22
toml==0.10.2
urllib3==1.26.5
urllib3==1.26.6
Werkzeug==2.0.1
zope.event==4.5.0
zope.interface==5.4.0
4 changes: 2 additions & 2 deletions aether-ui/aether/ui/assets/css/base/_fonts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
@import url('https://fonts.googleapis.com/css?family=Fira+Mono');

/* Font Awesome 5 https://fontawesome.com/ */
@import url('https://use.fontawesome.com/releases/v5.15.2/css/fontawesome.css');
@import url('https://use.fontawesome.com/releases/v5.15.2/css/solid.css');
@import url('https://use.fontawesome.com/releases/v5.15.4/css/fontawesome.css');
@import url('https://use.fontawesome.com/releases/v5.15.4/css/solid.css');
Loading

0 comments on commit 955c2d1

Please sign in to comment.