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

Feat/dashboard #86

Open
wants to merge 39 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a667fb7
Add added_by field in OrganisationMembership
twinkarma Jan 23, 2025
5596cc0
Add added_by field in OrganisationMembership
twinkarma Jan 23, 2025
9bda3b0
Config UI
twinkarma Jan 27, 2025
6ee274b
Merge remote-tracking branch 'origin/feat/survey-ui' into feat/survey-ui
twinkarma Jan 28, 2025
24d69dd
fix: survey count
f-allian Jan 29, 2025
a605120
fix: survey questions
f-allian Jan 29, 2025
9b04547
Merge remote-tracking branch 'origin/feat/survey-ui' into feat/dashboard
f-allian Jan 29, 2025
7272b68
remove: old JSON files replaced by `survey_config`
f-allian Jan 29, 2025
d6884d6
setup django-plotly-dash
f-allian Jan 30, 2025
db09199
setup dashboard on html using plotly_dash tags
f-allian Jan 30, 2025
b897e8d
add django_plotly_dash to SORT urls
f-allian Jan 30, 2025
9088dc4
update SurveyView to render metrics
f-allian Jan 30, 2025
7fbe67e
add: survey dashboards
f-allian Jan 30, 2025
32c60d0
fix: dashboard bar charts
f-allian Feb 4, 2025
9c0e0bb
add: middleware for plotly in base.html and survey.html
f-allian Feb 10, 2025
e43733a
basic dashboard fixes
f-allian Feb 10, 2025
ab4aa83
Merge remote-tracking branch 'origin/dev' into feat/dashboard
f-allian Feb 11, 2025
0f43fe2
include scipy
f-allian Feb 12, 2025
1b80c23
update SurveyView with metrics
f-allian Feb 12, 2025
1a6bfdb
fix urls
f-allian Feb 12, 2025
1d4b4e6
update survey html page
f-allian Feb 12, 2025
d1ff9ce
include plotly tag
f-allian Feb 12, 2025
557da86
dashboard upgrades
f-allian Feb 12, 2025
a91204d
Merge branch 'dev' into feat/dashboard
f-allian Feb 12, 2025
f0ae045
fixes: Maturity score between 0-4, theme colour, pie-chart legend.
f-allian Feb 13, 2025
3f2f9c2
Merge remote-tracking branch 'origin/feat/dashboard' into feat/dashboard
f-allian Feb 13, 2025
a23aeeb
Merge branch 'dev' into feat/dashboard
f-allian Feb 13, 2025
e65cff3
feat: add report page
twinkarma Feb 13, 2025
a0c3d51
Merge pull request #133 from RSE-Sheffield/feat/report-page
twinkarma Feb 13, 2025
40ee509
Merge branch 'dev' into feat/dashboard
f-allian Feb 13, 2025
4a27e83
Temporary fix for merge error
twinkarma Feb 13, 2025
e6060d3
fixes to base and base_manager
f-allian Feb 18, 2025
bcf7d3d
delete old dashboards.py script
f-allian Feb 24, 2025
ab75388
turn dashboard into an app
f-allian Feb 24, 2025
d6f693f
update settings.py with dashboard config
f-allian Feb 24, 2025
8e30164
add loading spinners to dashboard components
f-allian Feb 24, 2025
b73a891
added age group filter and fixed ranking matrix
f-allian Feb 25, 2025
01bee7e
dashboard app now gets data from SurveyResponse data model
f-allian Feb 25, 2025
728418b
Merge branch 'dev' into feat/dashboard
f-allian Feb 27, 2025
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
6 changes: 6 additions & 0 deletions SORT/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ def cast_to_boolean(obj: Any) -> bool:
"django_bootstrap5",
"django_extensions",
"debug_toolbar",
"django_plotly_dash.apps.DjangoPlotlyDashConfig",
"qr_code",
# apps created by FA:
"home",
"survey",
"survey.dashboards.apps.DashboardsConfig"
]

MIDDLEWARE = [
Expand All @@ -81,6 +83,8 @@ def cast_to_boolean(obj: Any) -> bool:
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"debug_toolbar.middleware.DebugToolbarMiddleware",
"django_plotly_dash.middleware.BaseMiddleware",

]

ROOT_URLCONF = "SORT.urls"
Expand Down Expand Up @@ -196,6 +200,8 @@ def cast_to_boolean(obj: Any) -> bool:
)
CSRF_COOKIE_SECURE = cast_to_boolean(os.getenv("DJANGO_CSRF_COOKIE_SECURE", not DEBUG))

X_FRAME_OPTIONS = 'SAMEORIGIN'

# Logging
# https://docs.djangoproject.com/en/5.1/topics/logging/
LOGGING = {
Expand Down
1 change: 1 addition & 0 deletions SORT/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
path("admin/", admin.site.urls),
path("", include("home.urls")),
path("", include("survey.urls"), name="survey"),
path('django_plotly_dash/', include('django_plotly_dash.urls')),
]

if settings.DEBUG:
Expand Down
58 changes: 0 additions & 58 deletions data/questions/questionnaires.json

This file was deleted.

118 changes: 118 additions & 0 deletions data/survey_config/test_all.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"sections": [
{
"title": "Welcome",
"type": "consent",
"fields": [
{
"type": "radio",
"name": "consent",
"label": "Your agreement to complete the survey",
"required": true,
"options": [
[
"Yes",
"I agree to complete the survey"
],
[
"No",
"I do not agree"
]
]
}
]
},
{
"title": "Section 1",
"description": "",
"fields": [
{
"type": "char",
"name": "char_field",
"label": "Char field"
},
{
"type": "text",
"name": "text_field",
"label": "Text field"
},
{
"type": "checkbox",
"name": "checkbox_field",
"label": "Checkbox field",
"options": [
[
"Value 1",
"Label 1"
],
[
"Value 2",
"Label 2"
]
]
},
{
"type": "radio",
"name": "radio_field",
"label": "Radio field",
"options": [
[
"Value 1",
"Label 1"
],
[
"Value 2",
"Label 2"
]
]
}
]
},
{
"title": "Section 2",
"description": "",
"fields": [
{
"type": "char",
"name": "char_field",
"label": "Char field"
},
{
"type": "text",
"name": "text_field",
"label": "Text field"
},
{
"type": "checkbox",
"name": "checkbox_field",
"label": "Checkbox field",
"options": [
[
"Value 1",
"Label 1"
],
[
"Value 2",
"Label 2"
]
]
},
{
"type": "radio",
"name": "radio_field",
"label": "Radio field",
"options": [
[
"Value 1",
"Label 1"
],
[
"Value 2",
"Label 2"
]
]
}
]
}
]
}
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ wcwidth==0.2.13
django_debug_toolbar==4.4.6
gunicorn==23.*
strenum==0.4.15
django-plotly-dash===2.4.3
numpy==2.1.3
pandas==2.2.3
pytest==8.3.4
pytest-django==4.9.0
django-qr-code==4.1.0
scipy==1.15.1
7 changes: 5 additions & 2 deletions static/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<link href="{% static 'css/base.css' %}" rel="stylesheet">
<link href="{% static 'css/utilities.css' %}" rel="stylesheet">
{% block extra_css %}{% endblock %}
{% load plotly_dash %}
{% plotly_header %}
</head>
<body>
{% include 'header.html' %}
Expand All @@ -36,6 +38,8 @@
{% endfor %}
{% endif %}
{% block content %}<!-- Content here -->{% endblock %}
{% plotly_footer %}

</div>
</main>

Expand All @@ -44,5 +48,4 @@
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</body>
</html>

</html>
Empty file added survey/dashboards/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions survey/dashboards/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class DashboardsConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "survey.dashboards"
Loading