diff --git a/.bumpversion.toml b/.bumpversion.toml index fa7edda..670ff62 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "0.2.0" +current_version = "0.4.0" parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" serialize = ["{major}.{minor}.{patch}"] search = "{current_version}" diff --git a/.devcontainer/bashrc.override.sh b/.devcontainer/bashrc.override.sh deleted file mode 100644 index bedddf6..0000000 --- a/.devcontainer/bashrc.override.sh +++ /dev/null @@ -1,20 +0,0 @@ - -# -# .bashrc.override.sh -# - -# persistent bash history -HISTFILE=~/.bash_history -PROMPT_COMMAND="history -a; $PROMPT_COMMAND" - -# set some django env vars -source /entrypoint - -# restore default shell options -set +o errexit -set +o pipefail -set +o nounset - -# start ssh-agent -# https://code.visualstudio.com/docs/remote/troubleshooting -eval "$(ssh-agent -s)" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index a2f350c..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,41 +0,0 @@ -// For format details, see https://containers.dev/implementors/json_reference/ -{ - "name": "sedos_dashboard_dev", - "dockerComposeFile": [ - "../local.yml" - ], - "init": true, - "mounts": [ - { - "source": "./.devcontainer/bash_history", - "target": "/home/dev-user/.bash_history", - "type": "bind" - }, - { - "source": "/tmp", - "target": "/tmp", - "type": "bind" - }, - { - "source": "~/.ssh", - "target": "/home/dev-user/.ssh", - "type": "bind" - } - ], - // Tells devcontainer.json supporting services / tools whether they should run - // /bin/sh -c "while sleep 1000; do :; done" when starting the container instead of the container’s default command - "overrideCommand": false, - "service": "django", - // "remoteEnv": {"PATH": "/home/dev-user/.local/bin:${containerEnv:PATH}"}, - "remoteUser": "dev-user", - "workspaceFolder": "/app", - // Set *default* container specific settings.json values on container create. - "customizations": { - }, - // Uncomment the next line if you want start specific services in your Docker Compose config. - // "runServices": [], - // Uncomment the next line if you want to keep your containers running after VS Code shuts down. - // "shutdownAction": "none", - // Uncomment the next line to run commands after the container is created. - "postCreateCommand": "cat .devcontainer/bashrc.override.sh >> ~/.bashrc" -} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1b0d5a..5d22fa1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,21 +34,21 @@ jobs: uses: pre-commit/action@v3.0.0 # With no caching at all the entire ci process takes 4m 30s to complete! - pytest: - runs-on: ubuntu-latest - - steps: - - name: Checkout Code Repository - uses: actions/checkout@v3 - - - name: Build the Stack - run: docker compose -f local.yml build - - - name: Run DB Migrations - run: docker compose -f local.yml run --rm django python manage.py migrate - - - name: Run Django Tests - run: docker compose -f local.yml run django pytest - - - name: Tear down the Stack - run: docker compose -f local.yml down +# pytest: +# runs-on: ubuntu-latest +# +# steps: +# - name: Checkout Code Repository +# uses: actions/checkout@v3 +# +# - name: Build the Stack +# run: docker compose -f local.yml build +# +# - name: Run DB Migrations +# run: docker compose -f local.yml run --rm django python manage.py migrate +# +# - name: Run Django Tests +# run: docker compose -f local.yml run django pytest +# +# - name: Tear down the Stack +# run: docker compose -f local.yml down diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e4d2bc2..c814be5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,7 +45,7 @@ repos: - id: flake8 - repo: https://github.com/Riverside-Healthcare/djLint - rev: v1.32.1 + rev: v1.34.1 hooks: - id: djlint-reformat-django - id: djlint-django diff --git a/CHANGELOG.md b/CHANGELOG.md index c50083c..b26ad76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,27 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project tries to adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.4.0] - 2024-03-22 +### Changed +- integrate structure and collection selection from django_energysystem_viewer in version v0.5.0 + +## [0.3.3] - 2024-03-06 +### Changed +- update django_energysystem_viewer to v0.4.2 + +## [0.3.2] - 2024-03-06 +### Changed +- update django_energysystem_viewer to v0.4.1 + +## [0.3.1] - 2024-03-06 +### Changed +- remove pytest from CI + +## [0.3.0] - 2024-03-06 +### Changed +- remove crispy-forms dependencies +- update django_energysystem_viewer to v0.3.1 + ## [0.2.0] - 2024-03-05 ### Added - version bumping tool diff --git a/config/settings/base.py b/config/settings/base.py index dbc1f34..2c3b714 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -70,8 +70,6 @@ "django.forms", ] THIRD_PARTY_APPS = [ - "crispy_forms", - "crispy_bootstrap5", "allauth", "allauth.account", "allauth.socialaccount", diff --git a/requirements/base.txt b/requirements/base.txt index b3704ac..00bb1f1 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -15,8 +15,6 @@ django==4.2.4 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.10.0 # https://github.com/joke2k/django-environ django-model-utils==4.3.1 # https://github.com/jazzband/django-model-utils django-allauth==0.54.0 # https://github.com/pennersr/django-allauth -django-crispy-forms==2.0 # https://github.com/django-crispy-forms/django-crispy-forms -crispy-bootstrap5==0.7 # https://github.com/django-crispy-forms/crispy-bootstrap5 django-compressor==4.4 # https://github.com/django-compressor/django-compressor django-libsass==0.9 # https://github.com/torchbox/django-libsass django-redis==5.3.0 # https://github.com/jazzband/django-redis @@ -27,4 +25,4 @@ django-cors-headers==4.2.0 # https://github.com/adamchainz/django-cors-headers drf-spectacular==0.26.4 # https://github.com/tfranzel/drf-spectacular git+https://github.com/OpenEnergyPlatform/django-comparison-dashboard.git@v0.4.1 -git+https://github.com/sedos-project/django_energysystem_viewer.git@v0.3.1 +git+https://github.com/sedos-project/django_energysystem_viewer.git@v0.5.0 diff --git a/sedos_dashboard/__init__.py b/sedos_dashboard/__init__.py index febda21..f63c43e 100644 --- a/sedos_dashboard/__init__.py +++ b/sedos_dashboard/__init__.py @@ -1,2 +1,2 @@ -__version__ = "0.2.0" +__version__ = "0.4.0" __version_info__ = tuple(int(num) if num.isdigit() else num for num in __version__.replace("-", ".", 1).split(".")) diff --git a/sedos_dashboard/templates/403.html b/sedos_dashboard/templates/403.html index 5795603..40954bb 100644 --- a/sedos_dashboard/templates/403.html +++ b/sedos_dashboard/templates/403.html @@ -1,6 +1,8 @@ {% extends "base.html" %} -{% block title %}Forbidden (403){% endblock title %} +{% block title %} + Forbidden (403) +{% endblock title %} {% block content %}

Forbidden (403)

diff --git a/sedos_dashboard/templates/403_csrf.html b/sedos_dashboard/templates/403_csrf.html index 5795603..40954bb 100644 --- a/sedos_dashboard/templates/403_csrf.html +++ b/sedos_dashboard/templates/403_csrf.html @@ -1,6 +1,8 @@ {% extends "base.html" %} -{% block title %}Forbidden (403){% endblock title %} +{% block title %} + Forbidden (403) +{% endblock title %} {% block content %}

Forbidden (403)

diff --git a/sedos_dashboard/templates/404.html b/sedos_dashboard/templates/404.html index 5111d3a..2399b79 100644 --- a/sedos_dashboard/templates/404.html +++ b/sedos_dashboard/templates/404.html @@ -1,6 +1,8 @@ {% extends "base.html" %} -{% block title %}Page not found{% endblock title %} +{% block title %} + Page not found +{% endblock title %} {% block content %}

Page not found

diff --git a/sedos_dashboard/templates/500.html b/sedos_dashboard/templates/500.html index 1add004..c4e2fa3 100644 --- a/sedos_dashboard/templates/500.html +++ b/sedos_dashboard/templates/500.html @@ -1,6 +1,8 @@ {% extends "base.html" %} -{% block title %}Server Error{% endblock title %} +{% block title %} + Server Error +{% endblock title %} {% block content %}

Ooops!!! 500

Looks like something went wrong!

diff --git a/sedos_dashboard/templates/account/base.html b/sedos_dashboard/templates/account/base.html index c336c1c..9e20d0d 100644 --- a/sedos_dashboard/templates/account/base.html +++ b/sedos_dashboard/templates/account/base.html @@ -7,7 +7,8 @@ {% block content %}
- {% block inner %}{% endblock inner %} + {% block inner %} + {% endblock inner %}
{% endblock content %} diff --git a/sedos_dashboard/templates/account/email.html b/sedos_dashboard/templates/account/email.html index 440f80c..1d2637e 100644 --- a/sedos_dashboard/templates/account/email.html +++ b/sedos_dashboard/templates/account/email.html @@ -1,4 +1,3 @@ - {% extends "account/base.html" %} {% load i18n %} diff --git a/sedos_dashboard/templates/index.html b/sedos_dashboard/templates/index.html index 97686dc..e339d55 100644 --- a/sedos_dashboard/templates/index.html +++ b/sedos_dashboard/templates/index.html @@ -14,7 +14,7 @@

Comparison Dashboard

Energysystem Viewer

{% endblock content %} diff --git a/sedos_dashboard/templates/pages/about.html b/sedos_dashboard/templates/pages/about.html index 3070348..94d9808 100644 --- a/sedos_dashboard/templates/pages/about.html +++ b/sedos_dashboard/templates/pages/about.html @@ -1,3 +1 @@ {% extends "base.html" %} - - diff --git a/sedos_dashboard/templates/pages/home.html b/sedos_dashboard/templates/pages/home.html index 3070348..94d9808 100644 --- a/sedos_dashboard/templates/pages/home.html +++ b/sedos_dashboard/templates/pages/home.html @@ -1,3 +1 @@ {% extends "base.html" %} - - diff --git a/sedos_dashboard/templates/users/user_detail.html b/sedos_dashboard/templates/users/user_detail.html index 3131f73..8cc00d6 100644 --- a/sedos_dashboard/templates/users/user_detail.html +++ b/sedos_dashboard/templates/users/user_detail.html @@ -3,39 +3,29 @@ {% load static %} {% block title %} - User: - - {{ object.username }} - - + User: + {{ object.username }} {% endblock title %} {% block content %}
-

- - - {{ object.username }} - -

- {% if object.name %} -

{{ object.name }}

- {% endif %} -
-
- {% if object == request.user %} - -
-
- My Info - E-Mail - +

{{ object.username }}

+ {% if object.name %}

{{ object.name }}

{% endif %}
- - {% endif %} -
+ {% if object == request.user %} + +
+
+ My Info + E-Mail + +
+
+ + {% endif %} + {% endblock content %} diff --git a/sedos_dashboard/templates/users/user_form.html b/sedos_dashboard/templates/users/user_form.html index 95bc2d9..491b79e 100644 --- a/sedos_dashboard/templates/users/user_form.html +++ b/sedos_dashboard/templates/users/user_form.html @@ -3,29 +3,19 @@ {% load crispy_forms_tags %} {% block title %} - - {{ user.username }} - - {% endblock title %} {% block content %} -

- - - {{ user.username }} - - -

-
- {% csrf_token %} - {{ form|crispy }} -
-
- +

{{ user.username }}

+ + {% csrf_token %} + {{ form|crispy }} +
+
+ +
-
- + {% endblock content %} diff --git a/sedos_dashboard/users/adapters.py b/sedos_dashboard/users/adapters.py index 7043514..c1622fc 100644 --- a/sedos_dashboard/users/adapters.py +++ b/sedos_dashboard/users/adapters.py @@ -9,6 +9,7 @@ if typing.TYPE_CHECKING: from allauth.socialaccount.models import SocialLogin + from sedos_dashboard.users.models import User diff --git a/sedos_dashboard/users/admin.py b/sedos_dashboard/users/admin.py index fa4d0fc..846018b 100644 --- a/sedos_dashboard/users/admin.py +++ b/sedos_dashboard/users/admin.py @@ -1,7 +1,7 @@ from django.conf import settings from django.contrib import admin from django.contrib.auth import admin as auth_admin -from django.contrib.auth import get_user_model, decorators +from django.contrib.auth import decorators, get_user_model from django.utils.translation import gettext_lazy as _ from sedos_dashboard.users.forms import UserAdminChangeForm, UserAdminCreationForm diff --git a/sedos_dashboard/users/api/serializers.py b/sedos_dashboard/users/api/serializers.py index 741ef18..7295203 100644 --- a/sedos_dashboard/users/api/serializers.py +++ b/sedos_dashboard/users/api/serializers.py @@ -3,7 +3,6 @@ from sedos_dashboard.users.models import User as UserType - User = get_user_model() diff --git a/sedos_dashboard/users/tests/test_views.py b/sedos_dashboard/users/tests/test_views.py index dc3e8d9..383efbd 100644 --- a/sedos_dashboard/users/tests/test_views.py +++ b/sedos_dashboard/users/tests/test_views.py @@ -12,11 +12,7 @@ from sedos_dashboard.users.forms import UserAdminChangeForm from sedos_dashboard.users.models import User from sedos_dashboard.users.tests.factories import UserFactory -from sedos_dashboard.users.views import ( - UserRedirectView, - UserUpdateView, - user_detail_view, -) +from sedos_dashboard.users.views import UserRedirectView, UserUpdateView, user_detail_view pytestmark = pytest.mark.django_db diff --git a/sedos_dashboard/users/urls.py b/sedos_dashboard/users/urls.py index b314363..64c8207 100644 --- a/sedos_dashboard/users/urls.py +++ b/sedos_dashboard/users/urls.py @@ -1,10 +1,6 @@ from django.urls import path -from sedos_dashboard.users.views import ( - user_detail_view, - user_redirect_view, - user_update_view, -) +from sedos_dashboard.users.views import user_detail_view, user_redirect_view, user_update_view app_name = "users" urlpatterns = [ diff --git a/sedos_dashboard/utils/storages.py b/sedos_dashboard/utils/storages.py index 8b13789..e69de29 100644 --- a/sedos_dashboard/utils/storages.py +++ b/sedos_dashboard/utils/storages.py @@ -1 +0,0 @@ -