Skip to content

Commit

Permalink
Merge pull request #129 from open-zaak/feature/admin-ui
Browse files Browse the repository at this point in the history
Fixes #14: Implemented admin UI
  • Loading branch information
joeribekker committed Oct 18, 2019
2 parents 38e046f + d132e47 commit 79463c9
Show file tree
Hide file tree
Showing 23 changed files with 893 additions and 73 deletions.
10 changes: 7 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Open Zaak

API's voor Zaakgericht werken

Ontwikkeld door `Maykin Media B.V.`_ in opdracht van `Dimpact`_.

Inleiding
=========

Expand All @@ -29,6 +31,7 @@ De gegevens worden ontsloten middels een `set API's`_, te weten:
* Documenten API (`Documenten API-specificatie 1.0 RC`_)
* Catalogi API (`Catalogi API-specificatie 1.0 RC`_)
* Besluiten API (`Besluiten API-specificatie 1.0 RC`_)
* Autorisatie API (`Autorisaties API-specificatie 1.0 RC`_)

.. _`Common Ground`: https://commonground.nl/
.. _`zaakgericht werken`: https://www.vngrealisatie.nl/ondersteuningsmiddelen/zaakgericht-werken
Expand All @@ -37,21 +40,22 @@ De gegevens worden ontsloten middels een `set API's`_, te weten:
.. _`Documenten API-specificatie 1.0 RC`: https://zaakgerichtwerken.vng.cloud/standaard/documenten/index
.. _`Catalogi API-specificatie 1.0 RC`: https://zaakgerichtwerken.vng.cloud/standaard/catalogi/index
.. _`Besluiten API-specificatie 1.0 RC`: https://zaakgerichtwerken.vng.cloud/standaard/besluiten/index
.. _`Autorisaties API-specificatie 1.0 RC`: https://zaakgerichtwerken.vng.cloud/standaard/autorisaties/index

**Open Zaak** gebruikt de code van de
`referentie implementaties van VNG Realisatie`_ als basis om een stabiele set
API's te realiseren die gebruikt kunnen worden bij gemeenten.
API's te realiseren die in productie gebruikt kunnen worden bij gemeenten.

.. _`referentie implementaties van VNG Realisatie`: https://github.com/VNG-Realisatie/gemma-zaken

Licentie
========

Copyright © Maykin Media 2019

Licensed under the EUPL_

.. _EUPL: LICENSE.md
.. _Maykin Media B.V.: https://www.maykinmedia.nl
.. _Dimpact: https://www.dimpact.nl

.. |build-status| image:: https://travis-ci.org/open-zaak/open-zaak.svg?branch=master
:alt: Build status
Expand Down
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ django-privates
django-relativedelta

# Admin and UI libraries
django-admin-index
django-better-admin-arrayfield

# API libraries
Expand Down
2 changes: 2 additions & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ certifi==2018.4.16 # via requests
chardet==3.0.4 # via requests
coreapi==2.3.3 # via drf-yasg
coreschema==0.0.4 # via coreapi, drf-yasg
django-admin-index==1.1.0
django-appconf==1.0.2 # via django-axes
django-axes==4.4.0
django-better-admin-arrayfield==1.0.2
Expand All @@ -18,6 +19,7 @@ django-filter==2.0
django-ipware==2.1.0 # via django-axes
django-loose-fk==0.5.4
django-markup==1.3
django-ordered-model==2.1.0 # via django-admin-index
django-privates==1.0.1.post0
django-redis==4.10.0
django-relativedelta==1.0.5
Expand Down
2 changes: 2 additions & 0 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ chardet==3.0.4
coreapi==2.3.3
coreschema==0.0.4
coverage==4.5.4
django-admin-index==1.1.0
django-appconf==1.0.2
django-axes==4.4.0
django-better-admin-arrayfield==1.0.2
Expand All @@ -19,6 +20,7 @@ django-filter==2.0.0
django-ipware==2.1.0
django-loose-fk==0.5.4
django-markup==1.3
django-ordered-model==2.1.0
django-privates==1.0.1.post0
django-redis==4.10.0
django-relativedelta==1.0.5
Expand Down
2 changes: 2 additions & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ commonmark==0.9.1 # via recommonmark
coreapi==2.3.3
coreschema==0.0.4
coverage==4.5.4
django-admin-index==1.1.0
django-appconf==1.0.2
django-axes==4.4.0
django-better-admin-arrayfield==1.0.2
Expand All @@ -28,6 +29,7 @@ django-filter==2.0.0
django-ipware==2.1.0
django-loose-fk==0.5.4
django-markup==1.3
django-ordered-model==2.1.0
django-privates==1.0.1.post0
django-redis==4.10.0
django-relativedelta==1.0.5
Expand Down
28 changes: 28 additions & 0 deletions src/openzaak/accounts/migrations/0002_initial_admin_index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from django.core.management import call_command
from django.db import migrations


def forward(apps, schema_editor):
from django.apps import apps as django_apps
from django.contrib.contenttypes.management import create_contenttypes

apps = django_apps.get_app_configs()
for app in apps:
create_contenttypes(app)

call_command("loaddata", "default_admin_index.json")


class Migration(migrations.Migration):

dependencies = [
("accounts", "0001_initial"),
("admin_index", "0002_auto_20170802_1754"),
("besluiten", "0010_auto_20191010_1544"),
("catalogi", "0004_merge_20190919_1529"),
("documenten", "0007_auto_20190918_0842"),
("notifications", "0009_auto_20190729_0427"),
("zaken", "0005_auto_20190918_0826"),
]

operations = [migrations.RunPython(forward, migrations.RunPython.noop)]
2 changes: 2 additions & 0 deletions src/openzaak/components/documenten/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ class EnkelvoudigInformatieObject(APIMixin, InformatieObject):

class Meta:
unique_together = ("uuid", "versie")
verbose_name = _("Enkelvoudige informatie object")
verbose_name_plural = _("Enkelvoudige informatie objecten")


class Gebruiksrechten(models.Model):
Expand Down
34 changes: 24 additions & 10 deletions src/openzaak/conf/includes/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datetime
import os

from django.urls import reverse_lazy
Expand Down Expand Up @@ -94,6 +95,8 @@
"django.contrib.messages",
"django.contrib.staticfiles",
# Optional applications.
"ordered_model",
"django_admin_index",
"django.contrib.admin",
"django.contrib.gis",
# 'django.contrib.admindocs',
Expand Down Expand Up @@ -160,6 +163,7 @@
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"openzaak.utils.context_processors.settings",
"django_admin_index.context_processors.dashboard",
],
"loaders": TEMPLATE_LOADERS,
},
Expand Down Expand Up @@ -193,8 +197,6 @@

MEDIA_URL = "/media/"

FIXTURE_DIRS = [os.path.join(DJANGO_PROJECT_DIR, "fixtures")]

#
# Sending EMAIL
#
Expand Down Expand Up @@ -329,11 +331,11 @@
#
# Custom settings
#
PROJECT_NAME = "Open zaak"
SITE_TITLE = "Open zaak"
PROJECT_NAME = "Open Zaak"
SITE_TITLE = "Open Zaak"

ENVIRONMENT = None
SHOW_ALERT = True
ENVIRONMENT_SHOWN_IN_ADMIN = True

# settings for uploading large files
MIN_UPLOAD_SIZE = config("MIN_UPLOAD_SIZE", 4 * 2 ** 30)
Expand Down Expand Up @@ -378,12 +380,14 @@
# #
##############################

# Django-axes
#
# DJANGO-AXES
#
AXES_CACHE = "axes" # refers to CACHES setting
AXES_LOGIN_FAILURE_LIMIT = 30 # Default: 3
AXES_LOGIN_FAILURE_LIMIT = 5 # Default: 3
AXES_LOCK_OUT_AT_FAILURE = True # Default: True
AXES_USE_USER_AGENT = False # Default: False
AXES_COOLOFF_TIME = 1 # One hour
AXES_COOLOFF_TIME = datetime.timedelta(minutes=5) # One hour
AXES_BEHIND_REVERSE_PROXY = IS_HTTPS # We have either Ingress or Nginx
AXES_ONLY_USER_FAILURES = (
False
Expand All @@ -392,15 +396,19 @@
False
) # Default: False (you might want to block on username and IP)

# Django-hijack
#
# DJANGO-HIJACK
#
HIJACK_LOGIN_REDIRECT_URL = reverse_lazy("home")
HIJACK_LOGOUT_REDIRECT_URL = reverse_lazy("admin:accounts_user_changelist")
HIJACK_REGISTER_ADMIN = False
# This is a CSRF-security risk.
# See: http://django-hijack.readthedocs.io/en/latest/configuration/#allowing-get-method-for-hijack-views
HIJACK_ALLOW_GET_REQUESTS = True

# Django-CORS-middleware
#
# DJANGO-CORS-MIDDLEWARE
#
CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_HEADERS = (
"x-requested-with",
Expand Down Expand Up @@ -449,3 +457,9 @@
}
}
)

#
# DJANGO-ADMIN-INDEX
#
ADMIN_INDEX_SHOW_REMAINING_APPS_TO_SUPERUSERS = True
ADMIN_INDEX_AUTO_CREATE_APP_GROUP = False
2 changes: 1 addition & 1 deletion src/openzaak/conf/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
# Custom settings overrides
#
ENVIRONMENT = "production"
SHOW_ALERT = False
ENVIRONMENT_SHOWN_IN_ADMIN = False
102 changes: 102 additions & 0 deletions src/openzaak/fixtures/default_admin_index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
[
{
"model": "admin_index.appgroup",
"fields": {
"order": 0,
"name": "Accounts",
"slug": "accounts",
"models": [
[
"accounts",
"user"
],
[
"auth",
"group"
]
]
}
},
{
"model": "admin_index.appgroup",
"fields": {
"order": 1,
"name": "API Autorisaties",
"slug": "api-authorizations",
"models": [
[
"authorizations",
"applicatie"
],
[
"vng_api_common",
"apicredential"
],
[
"vng_api_common",
"jwtsecret"
]
]
}
},
{
"model": "admin_index.appgroup",
"fields": {
"order": 7,
"name": "Configuratie",
"slug": "configuration",
"models": [
[
"admin_index",
"appgroup"
],
[
"axes",
"accessattempt"
],
[
"axes",
"accesslog"
],
[
"notifications",
"notificationsconfig"
],
[
"notifications",
"subscription"
],
[
"sites",
"site"
]
]
}
},
{
"model": "admin_index.appgroup",
"fields": {
"order": 6,
"name": "Gegevens",
"slug": "gegevens",
"models": [
[
"besluiten",
"besluit"
],
[
"catalogi",
"catalogus"
],
[
"documenten",
"enkelvoudiginformatieobject"
],
[
"zaken",
"zaak"
]
]
}
}
]

0 comments on commit 79463c9

Please sign in to comment.