-
Notifications
You must be signed in to change notification settings - Fork 61
Split logic: public admin and dashboard #238
Split logic: public admin and dashboard #238
Conversation
Public Admin app: logic to make Django Adminpublic and loginless Dashboard app: logic for the views of Jarbas Admin
Hey @cuducos could you help me out a little here? I'm hoping for some idea on how to test this functionality-wise. Any ideas? ( I already ran locally and everything seems okay with the usual testing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly 🎉 that isort
pointed out and we may want to change
@@ -5,15 +5,15 @@ | |||
from django.contrib.contenttypes.models import ContentType | |||
from django.test import TestCase | |||
|
|||
from jarbas.dashboard.sites import DashboardSite, DummyUser, dashboard | |||
from jarbas.public_admin.sites import PublicAdminSite, DummyUser, public_admin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 shouldn't this import line be from jarbas.public_admin.sites import DummyUser, PublicAdminSite, public_admin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 94d8f94
jarbas/dashboard/urls.py
Outdated
@@ -1,6 +1,6 @@ | |||
from django.conf.urls import url | |||
from jarbas.dashboard.sites import dashboard | |||
from jarbas.public_admin.sites import public_admin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 shouldn't this and line 1 be separated by one blank line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 94d8f94
Actually this part of Jarbas is not tested in depth within Jarbas (mostly because it's mostly Django configuration). However in terms of the authentication there some tests in the In terms of UI/UX there are actually no tests (this is the part that the code is pretty much declarative, merely Django Admin configuration). Maybe integration tests with someting like PhantomJS could be written in the future. That said this PR adds zero new functionality (it's an architectural change): therefore if running the dashboard still working fine it works. Is there anything else you had in mind when you mentioned functionality-wise? |
@jtemporal after 94d8f94 is there anything left from code review? LMK because I'm afraid this branch will soon end up in conflicts regarding #252… |
As we talked in PVT I'll free you from this code review… I'm passing it to Ana ; )
@jtemporal is free, I can test this PR, let me just understand what is being made:
$ git clone [email protected]:datasciencebr/jarbas.git
$ cd jarbas
$ git checkout -b cuducos-public-admin-architecture-refactor origin/cuducos-public-admin-architecture-refactor
$ git merge master
$ cp contrib/.env.sample env
$ docker-compose up -d
$ docker-compose run --rm django python manage.py migrate
$ docker-compose run --rm django python manage.py searchvector
$ docker-compose run --rm django python manage.py reimbursements /mnt/data/reimbursements_sample.xz
$ docker-compose run --rm django python manage.py companies /mnt/data/companies_sample.xz
$ docker-compose run --rm django python manage.py suspicions /mnt/data/suspicions_sample.xz
$ docker-compose run --rm django python manage.py tweets
|
This PR refactor the architecture underneath the dashboard. Basically what we had so far was two files (
jarbas/dashboard/sites.py
andjarbas/dashboard/admin.py
) that handled two different logics:This PR splits this logic in two apps:
jarbas/public_admin
app: logic to make Django Admin public and login-lessjarbas/dashboard
app: logic for the views of Jarbas DashboardThe intention is to extract as much logic as possible related
public_admin
app in order to have it as a general purpose, external, plugable app (maybe even installable viapip
).