From d5e6b623d3d3cc916d68bcf44824a5b2d933e981 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Thu, 22 Aug 2024 13:33:46 +0200 Subject: [PATCH 1/3] Reformat code with ruff --- format_code.sh | 4 +- git-pre-push.sh | 7 +- .../settings/local_cypress_datatrans.py | 1 + server/config/settings/test.py | 1 - server/config/settings/test_cypress.py | 4 +- server/config/urls.py | 10 +- .../ratelimit/test_ratelimit.py | 2 +- server/manage.py | 2 +- server/ruff.toml | 16 + .../assignment/creators/create_assignments.py | 7 +- server/vbv_lernwelt/assignment/export.py | 5 +- server/vbv_lernwelt/assignment/services.py | 8 +- .../assignment/tests/test_graphql.py | 4 +- .../assignment/tests/test_services.py | 6 +- server/vbv_lernwelt/competence/admin.py | 2 - .../competence/graphql/queries.py | 2 +- server/vbv_lernwelt/competence/models.py | 3 +- server/vbv_lernwelt/core/admin.py | 7 +- .../vbv_lernwelt/core/create_default_users.py | 12 +- .../core/management/commands/cypress_reset.py | 2 +- .../commands/reset_iterativ_test_sessions.py | 15 +- server/vbv_lernwelt/core/serializers.py | 4 +- .../course/creators/test_course.py | 9 +- .../vbv_lernwelt/course/creators/uk_course.py | 391 ++++++++++-------- .../vbv_lernwelt/course/graphql/interfaces.py | 1 - server/vbv_lernwelt/course/graphql/types.py | 1 - .../commands/create_default_courses.py | 2 +- .../migrations/0008_auto_20240403_1132.py | 1 - .../vbv_lernwelt/course/serializer_helpers.py | 2 +- .../course/tests/test_completion_api.py | 4 +- .../course/tests/test_course_session_api.py | 6 +- .../course/tests/test_document_uploads.py | 12 +- server/vbv_lernwelt/course_session/admin.py | 4 +- .../vbv_lernwelt/course_session/factories.py | 1 - .../course_session/graphql/queries.py | 2 +- .../course_session_group/admin.py | 3 +- .../course_session_group/tests.py | 2 - .../vbv_lernwelt/dashboard/graphql/queries.py | 8 +- .../dashboard/graphql/types/assignment.py | 4 +- .../dashboard/graphql/types/dashboard.py | 11 +- .../tests/graphql/test_assignment.py | 24 +- .../tests/graphql/test_attendance.py | 44 +- .../tests/graphql/test_competence.py | 40 +- .../dashboard/tests/graphql/test_feedback.py | 40 +- .../tests/graphql/test_selection_metrics.py | 12 +- server/vbv_lernwelt/dashboard/utils.py | 6 +- server/vbv_lernwelt/dashboard/views.py | 8 +- server/vbv_lernwelt/duedate/views.py | 2 - .../result_import/edoniq_sftp_connection.py | 2 +- .../edoniq_test/tests/test_result_import.py | 2 +- server/vbv_lernwelt/edoniq_test/views.py | 14 +- server/vbv_lernwelt/feedback/services.py | 8 +- server/vbv_lernwelt/files/integrations.py | 2 +- server/vbv_lernwelt/files/mixins.py | 2 +- server/vbv_lernwelt/files/models.py | 1 - .../files/tests/test_files_integrations.py | 4 - server/vbv_lernwelt/importer/admin.py | 2 - server/vbv_lernwelt/importer/services.py | 2 +- .../tests/test_import_course_sessions.py | 2 +- .../importer/tests/test_t2l_sync.py | 4 +- server/vbv_lernwelt/importer/utils.py | 4 +- server/vbv_lernwelt/importer/views.py | 2 +- .../learnpath/create_vv_new_learning_path.py | 206 +++++---- .../vbv_lernwelt/learnpath/graphql/types.py | 3 - .../0015_set_feedback_user_mentor_for_vv.py | 1 - server/vbv_lernwelt/learnpath/models.py | 3 - server/vbv_lernwelt/media_files/models.py | 11 +- .../media_files/storage_backends.py | 1 - .../tests/test_content_document_storage.py | 2 +- server/vbv_lernwelt/media_library/admin.py | 2 - .../create_default_media_library.py | 15 +- server/vbv_lernwelt/media_library/models.py | 1 - server/vbv_lernwelt/notify/models.py | 15 +- server/vbv_lernwelt/notify/services.py | 2 +- .../tests/test_assigment_notifications.py | 4 +- .../notify/tests/test_notify_api.py | 4 +- .../vbv_lernwelt/notify/tests/test_service.py | 18 +- .../self_evaluation_feedback/admin.py | 4 +- .../self_evaluation_feedback/serializers.py | 6 +- server/vbv_lernwelt/shop/admin.py | 2 +- .../shop/tests/test_abacus_invoice.py | 10 +- .../shop/tests/test_datatrans_service.py | 4 +- server/vbv_lernwelt/shop/views.py | 2 +- server/vbv_lernwelt/sso/admin.py | 3 +- .../vbv_lernwelt/sso/tests/test_role_sync.py | 2 +- .../vbv_lernwelt/sso/tests/test_sso_flow.py | 2 +- server/vbv_lernwelt/sso/urls.py | 1 - 87 files changed, 588 insertions(+), 551 deletions(-) create mode 100644 server/ruff.toml diff --git a/format_code.sh b/format_code.sh index 7ae11c7a..d80d20b5 100755 --- a/format_code.sh +++ b/format_code.sh @@ -10,4 +10,6 @@ echo 'format client code' npm run prettier echo 'format python code' -ufmt format server +ruff check server --fix +ruff format server + diff --git a/git-pre-push.sh b/git-pre-push.sh index fcf48120..8594c37b 100755 --- a/git-pre-push.sh +++ b/git-pre-push.sh @@ -9,8 +9,11 @@ echo 'prettier:check' echo 'lint and typecheck' (cd client && npm run lint:errors && npm run typecheck) -echo 'python ufmt check' -ufmt check server +echo 'ruff check' +ruff check server + +echo 'ruff format --check' +ruff format server --check echo 'check git-crypt files diff' git-crypt status -e | sort > git-crypt-encrypted-files-check.txt && diff git-crypt-encrypted-files.txt git-crypt-encrypted-files-check.txt diff --git a/server/config/settings/local_cypress_datatrans.py b/server/config/settings/local_cypress_datatrans.py index e56165d2..d8492b52 100644 --- a/server/config/settings/local_cypress_datatrans.py +++ b/server/config/settings/local_cypress_datatrans.py @@ -1,4 +1,5 @@ # pylint: disable=unused-wildcard-import,wildcard-import,wrong-import-position +# ruff: noqa import os from dotenv import dotenv_values diff --git a/server/config/settings/test.py b/server/config/settings/test.py index 5115924b..3f24e144 100644 --- a/server/config/settings/test.py +++ b/server/config/settings/test.py @@ -1,7 +1,6 @@ # pylint: disable=unused-wildcard-import,wildcard-import,wrong-import-position import os - os.environ["IT_APP_ENVIRONMENT"] = "local" os.environ["AWS_S3_SECRET_ACCESS_KEY"] = os.environ.get( "AWS_S3_SECRET_ACCESS_KEY", diff --git a/server/config/settings/test_cypress.py b/server/config/settings/test_cypress.py index 10932526..e12da028 100644 --- a/server/config/settings/test_cypress.py +++ b/server/config/settings/test_cypress.py @@ -12,7 +12,7 @@ from .base import * # noqa # GENERAL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#secret-key -DATABASES["default"]["NAME"] = "vbv_lernwelt_cypress" +DATABASES["default"]["NAME"] = "vbv_lernwelt_cypress" # noqa F405 DATATRANS_API_ENDPOINT = "http://localhost:8001/server/fakeapi/datatrans/api" DATATRANS_PAY_URL = "http://localhost:8001/server/fakeapi/datatrans/pay" @@ -26,7 +26,7 @@ CYPRESS_TEST = True # Your stuff... # ------------------------------------------------------------------------------ -REST_FRAMEWORK["DEFAULT_THROTTLE_RATES"] = { +REST_FRAMEWORK["DEFAULT_THROTTLE_RATES"] = { # noqa F405 "anon": "10000/day", "hour-throttle": "40000/hour", "day-throttle": "2000000/day", diff --git a/server/config/urls.py b/server/config/urls.py index 79f0bcd7..81ad63a1 100644 --- a/server/config/urls.py +++ b/server/config/urls.py @@ -11,6 +11,9 @@ from django.views import defaults as default_views from django.views.decorators.csrf import csrf_exempt from django_ratelimit.exceptions import Ratelimited from graphene_django.views import GraphQLView +from wagtail import urls as wagtail_urls +from wagtail.admin import urls as wagtailadmin_urls +from wagtail.documents import urls as media_library_urls from vbv_lernwelt.api.directory import list_entities from vbv_lernwelt.api.user import get_profile, me_user_view, post_avatar @@ -74,9 +77,6 @@ from vbv_lernwelt.shop.datatrans.datatrans_fake_server import ( fake_datatrans_api_view, fake_datatrans_pay_view, ) -from wagtail import urls as wagtail_urls -from wagtail.admin import urls as wagtailadmin_urls -from wagtail.documents import urls as media_library_urls class SignedIntConverter(IntConverter): @@ -99,7 +99,7 @@ def raise_example_error(request): """ raise Exception("Test Error: I know python!") # pylint: disable=unreachable - return HttpResponse("no error?") + return HttpResponse("no error?") # noqa F821 # fmt: off @@ -241,7 +241,7 @@ urlpatterns = [ # testing and debug path('server/raise_error/', user_passes_test(lambda u: u.is_superuser, login_url='/login/')( - raise_example_error), ), + raise_example_error) ), path("server/checkratelimit/", check_rate_limit), ] diff --git a/server/integration_tests/ratelimit/test_ratelimit.py b/server/integration_tests/ratelimit/test_ratelimit.py index a3723a31..66cffadc 100644 --- a/server/integration_tests/ratelimit/test_ratelimit.py +++ b/server/integration_tests/ratelimit/test_ratelimit.py @@ -1,4 +1,4 @@ -from django.test import override_settings, TestCase +from django.test import TestCase, override_settings class RateLimitTest(TestCase): diff --git a/server/manage.py b/server/manage.py index 16551f11..776a2b19 100755 --- a/server/manage.py +++ b/server/manage.py @@ -15,7 +15,7 @@ if __name__ == "__main__": try: import django # noqa except ImportError: - raise ImportError( + raise ImportError( # noqa "Couldn't import Django. Are you sure it's installed and " "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" diff --git a/server/ruff.toml b/server/ruff.toml new file mode 100644 index 00000000..1c82cda6 --- /dev/null +++ b/server/ruff.toml @@ -0,0 +1,16 @@ +[lint] +select = [ + "E", "F", "B", "I", "COM818", "ISC002" + # "PL", + # "DJ", "RUF", +] + +ignore = [ + "E501", # line too long + "F841", # local variable assigned but never used + "B007", # loop control variable +] +unfixable = ["B"] + +[format] +quote-style = "double" \ No newline at end of file diff --git a/server/vbv_lernwelt/assignment/creators/create_assignments.py b/server/vbv_lernwelt/assignment/creators/create_assignments.py index 07875a7e..50fcbb7d 100644 --- a/server/vbv_lernwelt/assignment/creators/create_assignments.py +++ b/server/vbv_lernwelt/assignment/creators/create_assignments.py @@ -1,3 +1,7 @@ +from wagtail.blocks import StreamValue +from wagtail.blocks.list_block import ListBlock, ListValue +from wagtail.rich_text import RichText + from vbv_lernwelt.assignment.models import ( AssignmentListPage, AssignmentType, @@ -21,9 +25,6 @@ from vbv_lernwelt.course.consts import ( ) from vbv_lernwelt.course.models import CoursePage from vbv_lernwelt.media_files.models import ContentDocument -from wagtail.blocks import StreamValue -from wagtail.blocks.list_block import ListBlock, ListValue -from wagtail.rich_text import RichText def create_uk_fahrzeug_casework( diff --git a/server/vbv_lernwelt/assignment/export.py b/server/vbv_lernwelt/assignment/export.py index b9f8c163..e931445b 100644 --- a/server/vbv_lernwelt/assignment/export.py +++ b/server/vbv_lernwelt/assignment/export.py @@ -25,7 +25,6 @@ from vbv_lernwelt.course_session.services.export_attendance import ( make_export_filename, sanitize_sheet_name, ) -from vbv_lernwelt.duedate.models import DueDate from vbv_lernwelt.learnpath.models import LearningContent logger = structlog.get_logger(__name__) @@ -137,9 +136,7 @@ def _create_sheet( # common user headers, Circle <learningcontenttitle> bestanden, Circle <title> <learningcontenttitle> Resultat, ... col_idx = add_user_headers(sheet) - ordered_assignement_ids = ( - [] - ) # keep track of the order of the columns when adding the rows + ordered_assignement_ids = [] # keep track of the order of the columns when adding the rows for cse in competence_certificate_element: circle = cse.learning_content.get_circle() diff --git a/server/vbv_lernwelt/assignment/services.py b/server/vbv_lernwelt/assignment/services.py index 82cf5110..90d6bb1e 100644 --- a/server/vbv_lernwelt/assignment/services.py +++ b/server/vbv_lernwelt/assignment/services.py @@ -202,8 +202,8 @@ def update_assignment_completion( if copy_task_data: # copy over the question data, so that we don't lose the context sub_tasks = assignment.get_input_tasks() - for key, value in ac.completion_data.items(): - task_data = find_first(sub_tasks, pred=lambda x: x["id"] == key) + for key, _ in ac.completion_data.items(): + task_data = find_first(sub_tasks, pred=lambda x: x["id"] == key) # noqa if task_data: ac.completion_data[key].update(task_data) @@ -235,8 +235,8 @@ def update_assignment_completion( # copy over the question data, so that we don't lose the context subtasks = assignment.get_input_tasks() - for key, value in acl.completion_data.items(): - task_data = find_first(subtasks, pred=lambda x: x["id"] == key) + for key, _ in acl.completion_data.items(): + task_data = find_first(subtasks, pred=lambda x: x["id"] == key) # noqa if task_data: acl.completion_data[key].update(task_data) acl.save() diff --git a/server/vbv_lernwelt/assignment/tests/test_graphql.py b/server/vbv_lernwelt/assignment/tests/test_graphql.py index a6b674b5..8300daaa 100644 --- a/server/vbv_lernwelt/assignment/tests/test_graphql.py +++ b/server/vbv_lernwelt/assignment/tests/test_graphql.py @@ -222,7 +222,7 @@ class AttendanceCourseUserMutationTestCase(GraphQLTestCase): self.course_session, ) self.assertTrue( - f"/course/test-lehrgang/assignment-evaluation" in notification.target_url + "/course/test-lehrgang/assignment-evaluation" in notification.target_url ) # second submit will fail @@ -268,7 +268,7 @@ class AttendanceCourseUserMutationTestCase(GraphQLTestCase): ), ) - ac = AssignmentCompletion.objects.create( + AssignmentCompletion.objects.create( assignment_user=self.student, assignment=self.assignment, learning_content_page=self.assignment.find_attached_learning_content(), diff --git a/server/vbv_lernwelt/assignment/tests/test_services.py b/server/vbv_lernwelt/assignment/tests/test_services.py index 988ee439..14a7d016 100644 --- a/server/vbv_lernwelt/assignment/tests/test_services.py +++ b/server/vbv_lernwelt/assignment/tests/test_services.py @@ -230,7 +230,7 @@ class UpdateAssignmentCompletionTestCase(TestCase): }, ) - with self.assertRaises(serializers.ValidationError) as error: + with self.assertRaises(serializers.ValidationError): update_assignment_completion( assignment_user=self.user, assignment=self.assignment, @@ -403,7 +403,7 @@ class UpdateAssignmentCompletionTestCase(TestCase): ), ) - ac = AssignmentCompletion.objects.create( + AssignmentCompletion.objects.create( assignment_user=self.user, assignment=self.assignment, course_session=self.course_session, @@ -471,7 +471,7 @@ class UpdateAssignmentCompletionTestCase(TestCase): evaluation_user=self.trainer, ) - with self.assertRaises(serializers.ValidationError) as error: + with self.assertRaises(serializers.ValidationError): # not setting grade will raise an error update_assignment_completion( assignment_user=self.user, diff --git a/server/vbv_lernwelt/competence/admin.py b/server/vbv_lernwelt/competence/admin.py index 8c38f3f3..846f6b40 100644 --- a/server/vbv_lernwelt/competence/admin.py +++ b/server/vbv_lernwelt/competence/admin.py @@ -1,3 +1 @@ -from django.contrib import admin - # Register your models here. diff --git a/server/vbv_lernwelt/competence/graphql/queries.py b/server/vbv_lernwelt/competence/graphql/queries.py index df675caa..fe3f2442 100644 --- a/server/vbv_lernwelt/competence/graphql/queries.py +++ b/server/vbv_lernwelt/competence/graphql/queries.py @@ -40,7 +40,7 @@ class CompetenceCertificateQuery(object): if not can_view_profile(info.context.user, course_session_user): return None - setattr(info.context, "assignment_user_ids", user_ids) + setattr(info.context, "assignment_user_ids", user_ids) # noqa: B010 return resolve_course_page( CompetenceCertificateList, diff --git a/server/vbv_lernwelt/competence/models.py b/server/vbv_lernwelt/competence/models.py index 5c6555d8..5bc07a69 100644 --- a/server/vbv_lernwelt/competence/models.py +++ b/server/vbv_lernwelt/competence/models.py @@ -3,7 +3,6 @@ from django.utils.text import slugify from wagtail import blocks from wagtail.admin.panels import FieldPanel from wagtail.fields import StreamField -from wagtail.models import Page from vbv_lernwelt.core.model_utils import find_available_slug from vbv_lernwelt.course.models import CourseBasePage @@ -106,7 +105,7 @@ class ActionCompetence(CourseBasePage): ) def get_frontend_url(self): - return f"" + return "" content_panels = [ FieldPanel("title"), diff --git a/server/vbv_lernwelt/core/admin.py b/server/vbv_lernwelt/core/admin.py index 55e665da..ce6ddb5f 100644 --- a/server/vbv_lernwelt/core/admin.py +++ b/server/vbv_lernwelt/core/admin.py @@ -1,5 +1,6 @@ from django.contrib import admin, messages -from django.contrib.auth import admin as auth_admin, get_user_model +from django.contrib.auth import admin as auth_admin +from django.contrib.auth import get_user_model from django.utils.translation import gettext_lazy as _ from vbv_lernwelt.core.models import ( @@ -44,13 +45,13 @@ def create_or_sync_berufsbildner(modeladmin, request, queryset): messages.add_message( request, messages.SUCCESS, - f"Berufsbildner erfolgreich erstellt oder synchronisiert", + "Berufsbildner erfolgreich erstellt oder synchronisiert", ) else: messages.add_message( request, messages.ERROR, - f"Einige Berufsbildner konnten nicht erstellt oder synchronisiert werden", + "Einige Berufsbildner konnten nicht erstellt oder synchronisiert werden", ) diff --git a/server/vbv_lernwelt/core/create_default_users.py b/server/vbv_lernwelt/core/create_default_users.py index e50e9549..be12dad0 100644 --- a/server/vbv_lernwelt/core/create_default_users.py +++ b/server/vbv_lernwelt/core/create_default_users.py @@ -4,12 +4,6 @@ from django.contrib.auth.models import Group, Permission from django.core.files import File from environs import Env -from vbv_lernwelt.core.model_utils import add_countries -from vbv_lernwelt.media_files.models import UserImage - -env = Env() -env.read_env() - from vbv_lernwelt.core.constants import ( ADMIN_USER_ID, TEST_BERUFSBILDNER1_USER_ID, @@ -25,7 +19,12 @@ from vbv_lernwelt.core.constants import ( TEST_USER_DATATRANS_HANNA_ID, TEST_USER_EMPTY_ID, ) +from vbv_lernwelt.core.model_utils import add_countries from vbv_lernwelt.core.models import User +from vbv_lernwelt.media_files.models import UserImage + +env = Env() +env.read_env() VBV_STAFF_GROUP = "VBV Staff" @@ -432,7 +431,6 @@ def create_default_users(default_password="test", set_avatar=False): def _get_or_create_user(user_model, *args, **kwargs): username = kwargs.get("username", None) - password = kwargs.get("password", None) language = kwargs.get("language", "de") id = kwargs.get("id", None) created = False diff --git a/server/vbv_lernwelt/core/management/commands/cypress_reset.py b/server/vbv_lernwelt/core/management/commands/cypress_reset.py index 1175a50a..37ae54af 100644 --- a/server/vbv_lernwelt/core/management/commands/cypress_reset.py +++ b/server/vbv_lernwelt/core/management/commands/cypress_reset.py @@ -1,7 +1,7 @@ from datetime import datetime import djclick as click -from dateutil.relativedelta import relativedelta, TU +from dateutil.relativedelta import TU, relativedelta from django.contrib.auth.hashers import make_password from django.db import connection from django.utils import timezone diff --git a/server/vbv_lernwelt/core/management/commands/reset_iterativ_test_sessions.py b/server/vbv_lernwelt/core/management/commands/reset_iterativ_test_sessions.py index ce007a79..6dff700a 100644 --- a/server/vbv_lernwelt/core/management/commands/reset_iterativ_test_sessions.py +++ b/server/vbv_lernwelt/core/management/commands/reset_iterativ_test_sessions.py @@ -23,7 +23,12 @@ from vbv_lernwelt.course_session.models import ( CourseSessionEdoniqTest, ) from vbv_lernwelt.course_session_group.models import CourseSessionGroup -from vbv_lernwelt.feedback.models import FeedbackResponse +from vbv_lernwelt.importer.services import ( + LP_DATA, + TRANSLATIONS, + create_or_update_course_session, + get_uk_course, +) from vbv_lernwelt.learning_mentor.models import ( AgentParticipantRelation, AgentParticipantRoleType, @@ -32,12 +37,6 @@ from vbv_lernwelt.learnpath.models import Circle from vbv_lernwelt.notify.models import Notification logger = structlog.get_logger(__name__) -from vbv_lernwelt.importer.services import ( - create_or_update_course_session, - get_uk_course, - LP_DATA, - TRANSLATIONS, -) IT_VV_TEST_COURSE = "Iterativ VV Testkurs" IT_UK_TEST_COURSE = "Iterativ üK Testkurs" @@ -113,7 +112,7 @@ def delete_cs_data(cs: CourseSession): else: logger.info("no_course_session_found", import_id=cs.import_id) - FeedbackResponse.objects.filter(feedback_user__in=users).delete() + # FeedbackResponse.objects.filter(feedback_user__in=users).delete() def add_to_course_session( diff --git a/server/vbv_lernwelt/core/serializers.py b/server/vbv_lernwelt/core/serializers.py index baf8a8a0..7d7eb753 100644 --- a/server/vbv_lernwelt/core/serializers.py +++ b/server/vbv_lernwelt/core/serializers.py @@ -46,8 +46,8 @@ class CountrySerializer(serializers.ModelSerializer): "vbv_country_id": country.vbv_country_id, "name": self.get_name(country), } - except Country.DoesNotExist: - raise serializers.ValidationError({"id": "Invalid country ID"}) + except Country.DoesNotExist as e: + raise serializers.ValidationError({"id": "Invalid country ID"}) from e return super().to_internal_value(data) diff --git a/server/vbv_lernwelt/course/creators/test_course.py b/server/vbv_lernwelt/course/creators/test_course.py index 9a3fdd56..81f28c53 100644 --- a/server/vbv_lernwelt/course/creators/test_course.py +++ b/server/vbv_lernwelt/course/creators/test_course.py @@ -1,7 +1,7 @@ from collections import deque from datetime import datetime -from dateutil.relativedelta import MO, relativedelta, TH, TU, WE +from dateutil.relativedelta import MO, TH, TU, WE, relativedelta from django.utils import timezone from slugify import slugify from wagtail.rich_text import RichText @@ -454,9 +454,9 @@ def create_edoniq_test_result_data( max_points=24, evaluation_points_deducted=0, ): - assignment.assignment.evaluation_tasks.raw_data[0]["value"][ - "max_points" - ] = max_points + assignment.assignment.evaluation_tasks.raw_data[0]["value"]["max_points"] = ( + max_points + ) assignment.assignment.save() if assignment and course_session and assignment_user: ac, _ = update_assignment_completion( @@ -855,7 +855,6 @@ def create_test_competence_navi(): def create_test_media_library(): - course = Course.objects.get(id=COURSE_TEST_ID) course_page = CoursePage.objects.get(course_id=COURSE_TEST_ID) media_lib_page = MediaLibraryPageFactory( diff --git a/server/vbv_lernwelt/course/creators/uk_course.py b/server/vbv_lernwelt/course/creators/uk_course.py index 7e53d3cc..26654eaf 100644 --- a/server/vbv_lernwelt/course/creators/uk_course.py +++ b/server/vbv_lernwelt/course/creators/uk_course.py @@ -30,11 +30,6 @@ from vbv_lernwelt.learnpath.tests.learning_path_factories import ( LearningUnitFactory, TopicFactory, ) -from vbv_lernwelt.media_files.create_default_documents import ( - create_default_collections, - create_default_content_documents, -) -from vbv_lernwelt.media_files.create_default_images import create_default_images from vbv_lernwelt.media_library.tests.media_library_factories import ( LearnMediaBlockFactory, ) @@ -247,7 +242,7 @@ damit du erfolgreich mit deinem Lernpfad (durch-)starten kannst. f"<p>In der Mediathek unter dem Handlungsfeld «{title}» findest du alle relevanten Ressourcen für deine Fachkompetenzen.</p>" f"<p>Wir empfehlen dir vor der Absolvierung der weiteren Lerneinheiten dich in die Thematik einzulesen.</p>" ), - content_url=f"/course/überbetriebliche-kurse/media", + content_url="/course/überbetriebliche-kurse/media", ) LearningContentPlaceholderFactory( @@ -291,22 +286,24 @@ In diesem Circle erfährst du wie die überbetrieblichen Kurse aufgebaut sind. Z ) LearningUnitFactory(title="Vorbereitung", title_hidden=True, parent=circle) LearningContentMediaLibraryFactory( - title=f"Allgemeines zu Versicherungen", + title="Allgemeines zu Versicherungen", parent=circle, description=RichText( - f"<p>In der Mediathek unter «Allgemeines zu Versicherungen» findest du alle relevanten Ressourcen für deine Fachkompetenzen.</p>" - f"<p>Wir empfehlen dir vor der Absolvierung der weiteren Lerneinheiten dich in die Thematik einzulesen.</p>" + "<p>In der Mediathek unter «Allgemeines zu Versicherungen» findest du alle relevanten Ressourcen für deine Fachkompetenzen.</p>" + "<p>Wir empfehlen dir vor der Absolvierung der weiteren Lerneinheiten dich in die Thematik einzulesen.</p>" ), - content_url=f"/course/überbetriebliche-kurse/media", + content_url="/course/überbetriebliche-kurse/media", ) - LearningContentAssignmentFactory( - title="Vorbereitungsauftrag Circle Kickoff", - assignment_type="PREP_ASSIGNMENT", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"überbetriebliche-kurse-assignment-circle-kickoff" + ( + LearningContentAssignmentFactory( + title="Vorbereitungsauftrag Circle Kickoff", + assignment_type="PREP_ASSIGNMENT", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith="überbetriebliche-kurse-assignment-circle-kickoff" + ), ), - ), + ) LearningSequenceFactory(title="Training", parent=circle) LearningUnitFactory(title="Präsenzkurs", title_hidden=True, parent=circle) LearningContentAttendanceCourseFactory( @@ -382,14 +379,16 @@ In diesem Circle erfährst du wie die überbetrieblichen Kurse aufgebaut sind. Z slug__startswith="überbetriebliche-kurse-assignment-redlichkeits" ), ) - LearningContentAssignmentFactory( - title="Reflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"überbetriebliche-kurse-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Reflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith="überbetriebliche-kurse-assignment-reflexion" + ), ), - ), + ) def create_uk_fr_circle_kickoff(lp, title="Lancement"): @@ -404,22 +403,24 @@ Dans ce cercle, tu apprendras comment les cours interentreprises sont structuré LearningSequenceFactory(title="Préparation", parent=circle, icon="it-icon-ls-start") LearningUnitFactory(title="Préparation", title_hidden=True, parent=circle) LearningContentMediaLibraryFactory( - title=f"Allgemeines zu Versicherungen", + title="Allgemeines zu Versicherungen", parent=circle, description=RichText( - f"<p>Trouve toutes les ressources des champs d’action, comme les outils didactiques, les liens et autres informations utiles.</p>" - f"<p>Nous te recommandons de te familiariser avec le sujet avant de suivre les autres unités de cours.</p>" + "<p>Trouve toutes les ressources des champs d’action, comme les outils didactiques, les liens et autres informations utiles.</p>" + "<p>Nous te recommandons de te familiariser avec le sujet avant de suivre les autres unités de cours.</p>" ), content_url=f"/course/{circle.get_course().slug}/media", ) - LearningContentAssignmentFactory( - title="Mission de préparation", - assignment_type="PREP_ASSIGNMENT", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"cours-interentreprises-assignment-circle-lancement", + ( + LearningContentAssignmentFactory( + title="Mission de préparation", + assignment_type="PREP_ASSIGNMENT", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith="cours-interentreprises-assignment-circle-lancement", + ), ), - ), + ) LearningSequenceFactory(title="Training", parent=circle) LearningUnitFactory(title="Cours de présence", title_hidden=True, parent=circle) LearningContentAttendanceCourseFactory( @@ -497,14 +498,16 @@ Dans ce cercle, tu apprendras comment les cours interentreprises sont structuré slug__startswith=f"{circle.get_course().slug}-assignment-redlichkeits" ), ) - LearningContentAssignmentFactory( - title="Réflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Réflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ), ), - ), + ) def create_uk_it_circle_kickoff(lp, title="Introduzione"): @@ -521,22 +524,24 @@ In questo Circle imparerai come sono strutturati i corsi interaziendali. Imparer ) LearningUnitFactory(title="Preparazione", title_hidden=True, parent=circle) LearningContentMediaLibraryFactory( - title=f"Allgemeines zu Versicherungen", + title="Allgemeines zu Versicherungen", parent=circle, description=RichText( - f"<p>Nella mediateca, sotto il campo d'azione «Allgemeines zu Versicherungen», troverai tutte le risorse rilevanti per le tue competenze professionali." - f"<p>Si consiglia di leggere l'argomento prima di completare le altre unità di apprendimento.</p>" + "<p>Nella mediateca, sotto il campo d'azione «Allgemeines zu Versicherungen», troverai tutte le risorse rilevanti per le tue competenze professionali." + "<p>Si consiglia di leggere l'argomento prima di completare le altre unità di apprendimento.</p>" ), content_url=f"/course/{circle.get_course().slug}/media", ) - LearningContentAssignmentFactory( - title="Incarico di preparazione", - assignment_type="PREP_ASSIGNMENT", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{circle.get_course().slug}-assignment-circle-introduzione-incarico-di-preparazione" + ( + LearningContentAssignmentFactory( + title="Incarico di preparazione", + assignment_type="PREP_ASSIGNMENT", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{circle.get_course().slug}-assignment-circle-introduzione-incarico-di-preparazione" + ), ), - ), + ) LearningSequenceFactory(title="Training", parent=circle) LearningUnitFactory(title="Corso di presenza", title_hidden=True, parent=circle) LearningContentAttendanceCourseFactory( @@ -612,14 +617,16 @@ In questo Circle imparerai come sono strutturati i corsi interaziendali. Imparer slug__startswith="überbetriebliche-kurse-assignment-redlichkeits" ), ) - LearningContentAssignmentFactory( - title="Riflessione", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{circle.get_course().slug}-assignment-riflessione" + ( + LearningContentAssignmentFactory( + title="Riflessione", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{circle.get_course().slug}-assignment-riflessione" + ), ), - ), + ) def create_uk_circle_basis(lp, title="Basis"): @@ -636,22 +643,24 @@ In diesem Circle lernst du die wichtigsten Grundlagen bezüglich Versicherungswi ) LearningUnitFactory(title="Vorbereitung", title_hidden=True, parent=circle) LearningContentMediaLibraryFactory( - title=f"Allgemeines zu Versicherungen", + title="Allgemeines zu Versicherungen", parent=circle, description=RichText( - f"<p>In der Mediathek unter «Allgemeines zu Versicherungen» findest du alle relevanten Ressourcen für deine Fachkompetenzen.</p>" - f"<p>Wir empfehlen dir vor der Absolvierung der weiteren Lerneinheiten dich in die Thematik einzulesen.</p>" + "<p>In der Mediathek unter «Allgemeines zu Versicherungen» findest du alle relevanten Ressourcen für deine Fachkompetenzen.</p>" + "<p>Wir empfehlen dir vor der Absolvierung der weiteren Lerneinheiten dich in die Thematik einzulesen.</p>" ), - content_url=f"/course/überbetriebliche-kurse/media", + content_url="/course/überbetriebliche-kurse/media", ) - LearningContentAssignmentFactory( - title="Vorbereitungsauftrag Circle Basis", - assignment_type="PREP_ASSIGNMENT", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"überbetriebliche-kurse-assignment-circle-basis" + ( + LearningContentAssignmentFactory( + title="Vorbereitungsauftrag Circle Basis", + assignment_type="PREP_ASSIGNMENT", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith="überbetriebliche-kurse-assignment-circle-basis" + ), ), - ), + ) LearningSequenceFactory(title="Training", parent=circle) LearningUnitFactory(title="Präsenzkurs", title_hidden=True, parent=circle) LearningContentAttendanceCourseFactory( @@ -724,14 +733,16 @@ In diesem Circle lernst du die wichtigsten Grundlagen bezüglich Versicherungswi ), ) LearningUnitFactory(title="Reflexion", title_hidden=True, parent=circle) - LearningContentAssignmentFactory( - title="Reflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"überbetriebliche-kurse-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Reflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith="überbetriebliche-kurse-assignment-reflexion" + ), ), - ), + ) def create_uk_fr_circle_basis(lp, title="Base"): @@ -746,22 +757,24 @@ Dans ce cercle, tu apprends les bases les plus importantes en matière d'assuran LearningSequenceFactory(title="Préparation", parent=circle, icon="it-icon-ls-start") LearningUnitFactory(title="Préparation", title_hidden=True, parent=circle) LearningContentMediaLibraryFactory( - title=f"Allgemeines zu Versicherungen", + title="Allgemeines zu Versicherungen", parent=circle, description=RichText( - f"<p>Trouve toutes les ressources des champs d’action, comme les outils didactiques, les liens et autres informations utiles.</p>" - f"<p>Nous te recommandons de te familiariser avec le sujet avant de suivre les autres unités de cours.</p>" + "<p>Trouve toutes les ressources des champs d’action, comme les outils didactiques, les liens et autres informations utiles.</p>" + "<p>Nous te recommandons de te familiariser avec le sujet avant de suivre les autres unités de cours.</p>" ), content_url=f"/course/{circle.get_course().slug}/media", ) - LearningContentAssignmentFactory( - title="Mandats préparatoires Circle Base", - assignment_type="PREP_ASSIGNMENT", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{circle.get_course().slug}-assignment-circle-base" + ( + LearningContentAssignmentFactory( + title="Mandats préparatoires Circle Base", + assignment_type="PREP_ASSIGNMENT", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{circle.get_course().slug}-assignment-circle-base" + ), ), - ), + ) LearningSequenceFactory(title="Training", parent=circle) LearningUnitFactory(title="Cours de présence", title_hidden=True, parent=circle) LearningContentAttendanceCourseFactory( @@ -833,14 +846,16 @@ Dans ce cercle, tu apprends les bases les plus importantes en matière d'assuran extended_time_test_url="https://exam.vbv-afa.ch/e-tutor/v4/user/course/pre_course_object?aid=1691157696911,2147478636", ) LearningUnitFactory(title="Réflexion", title_hidden=True, parent=circle) - LearningContentAssignmentFactory( - title="Réflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Réflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ), ), - ), + ) def create_uk_it_circle_basis(lp, title="Base"): @@ -855,22 +870,24 @@ In questo Circle imparerai le basi più importanti del settore assicurativo e de LearningSequenceFactory(title="Préparation", parent=circle, icon="it-icon-ls-start") LearningUnitFactory(title="Préparation", title_hidden=True, parent=circle) LearningContentMediaLibraryFactory( - title=f"Allgemeines zu Versicherungen", + title="Allgemeines zu Versicherungen", parent=circle, description=RichText( - f"<p>Nella mediateca, sotto il campo d'azione «Allgemeines zu Versicherungen», troverai tutte le risorse rilevanti per le tue competenze professionali." - f"<p>Si consiglia di leggere l'argomento prima di completare le altre unità di apprendimento.</p>" + "<p>Nella mediateca, sotto il campo d'azione «Allgemeines zu Versicherungen», troverai tutte le risorse rilevanti per le tue competenze professionali." + "<p>Si consiglia di leggere l'argomento prima di completare le altre unità di apprendimento.</p>" ), content_url=f"/course/{circle.get_course().slug}/media", ) - LearningContentAssignmentFactory( - title="Mandato di preparazione Circle Base", - assignment_type="PREP_ASSIGNMENT", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{circle.get_course().slug}-assignment-cercle-base" + ( + LearningContentAssignmentFactory( + title="Mandato di preparazione Circle Base", + assignment_type="PREP_ASSIGNMENT", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{circle.get_course().slug}-assignment-cercle-base" + ), ), - ), + ) LearningSequenceFactory(title="Training", parent=circle) LearningUnitFactory(title="Corso di presenza", title_hidden=True, parent=circle) LearningContentAttendanceCourseFactory( @@ -942,14 +959,16 @@ In questo Circle imparerai le basi più importanti del settore assicurativo e de extended_time_test_url="https://exam.vbv-afa.ch/e-tutor/v4/user/course/pre_course_object?aid=1691157696911,2147478636", ) LearningUnitFactory(title="Riflessione", title_hidden=True, parent=circle) - LearningContentAssignmentFactory( - title="Riflessione", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{circle.get_course().slug}-assignment-riflessione" + ( + LearningContentAssignmentFactory( + title="Riflessione", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{circle.get_course().slug}-assignment-riflessione" + ), ), - ), + ) def create_uk_circle_fahrzeug(lp, title="Fahrzeug"): @@ -971,16 +990,18 @@ def create_uk_circle_fahrzeug(lp, title="Fahrzeug"): f"<p>In der Mediathek unter dem Handlungsfeld «{title}» findest du alle relevanten Ressourcen für deine Fachkompetenzen.</p>" f"<p>Wir empfehlen dir vor der Absolvierung der weiteren Lerneinheiten dich in die Thematik einzulesen.</p>" ), - content_url=f"/course/überbetriebliche-kurse/media/handlungsfelder/fahrzeug", + content_url="/course/überbetriebliche-kurse/media/handlungsfelder/fahrzeug", ) - LearningContentAssignmentFactory( - title="Fahrzeug - Mein erstes Auto", - assignment_type="PREP_ASSIGNMENT", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{course_slug}-assignment-fahrzeug-mein-erstes-auto" + ( + LearningContentAssignmentFactory( + title="Fahrzeug - Mein erstes Auto", + assignment_type="PREP_ASSIGNMENT", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{course_slug}-assignment-fahrzeug-mein-erstes-auto" + ), ), - ), + ) LearningSequenceFactory(title="Training", parent=circle) LearningUnitFactory(title="Präsenzkurs", title_hidden=True, parent=circle) LearningContentAttendanceCourseFactory( @@ -1070,22 +1091,26 @@ def create_uk_circle_fahrzeug(lp, title="Fahrzeug"): LearningSequenceFactory(title="Transfer", parent=circle, icon="it-icon-ls-end") LearningUnitFactory(title="Kompetenznachweis", title_hidden=True, parent=circle) - LearningContentAssignmentFactory( - title="Überprüfen einer Motorfahrzeug-Versicherungspolice", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{course_slug}-assignment-überprüfen-einer-motorfahrzeugs" + ( + LearningContentAssignmentFactory( + title="Überprüfen einer Motorfahrzeug-Versicherungspolice", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{course_slug}-assignment-überprüfen-einer-motorfahrzeugs" + ), ), - ), + ) LearningUnitFactory(title="Reflexion", title_hidden=True, parent=circle) - LearningContentAssignmentFactory( - title="Reflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{course_slug}-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Reflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{course_slug}-assignment-reflexion" + ), ), - ), + ) def create_uk_fr_circle_fahrzeug(lp, title="Véhicule"): @@ -1099,22 +1124,24 @@ def create_uk_fr_circle_fahrzeug(lp, title="Véhicule"): LearningSequenceFactory(title="Préparation", parent=circle, icon="it-icon-ls-start") LearningUnitFactory(title="Préparation", title_hidden=True, parent=circle) LearningContentMediaLibraryFactory( - title=f"Champs d’action «Véhicule à moteur»", + title="Champs d’action «Véhicule à moteur»", parent=circle, description=RichText( - f"<p>Trouve toutes les ressources des champs d’action, comme les outils didactiques, les liens et autres informations utiles.</p>" - f"<p>Nous te recommandons de te familiariser avec le sujet avant de suivre les autres unités de cours.</p>" + "<p>Trouve toutes les ressources des champs d’action, comme les outils didactiques, les liens et autres informations utiles.</p>" + "<p>Nous te recommandons de te familiariser avec le sujet avant de suivre les autres unités de cours.</p>" ), content_url=f"/course/{course_slug}/media", ) - LearningContentAssignmentFactory( - title="Véhicule à moteur – Ma première voiture", - assignment_type="PREP_ASSIGNMENT", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{course_slug}-assignment-véhicule-à-moteur-ma-première-voiture" + ( + LearningContentAssignmentFactory( + title="Véhicule à moteur – Ma première voiture", + assignment_type="PREP_ASSIGNMENT", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{course_slug}-assignment-véhicule-à-moteur-ma-première-voiture" + ), ), - ), + ) LearningSequenceFactory(title="Training", parent=circle) LearningUnitFactory(title="Cours de présence", title_hidden=True, parent=circle) LearningContentAttendanceCourseFactory( @@ -1206,22 +1233,26 @@ def create_uk_fr_circle_fahrzeug(lp, title="Véhicule"): LearningUnitFactory( title="Contrôle de compétences", title_hidden=True, parent=circle ) - LearningContentAssignmentFactory( - title="Vérification d'une police d’assurance de véhicule à moteur", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{course_slug}-assignment-vérification-d-une-police-d-assurance-de-véhicule-à-moteur" + ( + LearningContentAssignmentFactory( + title="Vérification d'une police d’assurance de véhicule à moteur", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{course_slug}-assignment-vérification-d-une-police-d-assurance-de-véhicule-à-moteur" + ), ), - ), + ) LearningUnitFactory(title="Réflexion", title_hidden=True, parent=circle) - LearningContentAssignmentFactory( - title="Réflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{course_slug}-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Réflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{course_slug}-assignment-reflexion" + ), ), - ), + ) def create_uk_it_circle_fahrzeug(lp, title="Veicolo"): @@ -1237,22 +1268,24 @@ def create_uk_it_circle_fahrzeug(lp, title="Veicolo"): ) LearningUnitFactory(title="Preparazione", title_hidden=True, parent=circle) LearningContentMediaLibraryFactory( - title=f"Campo d’azione «Veicolo»", + title="Campo d’azione «Veicolo»", parent=circle, description=RichText( - f"<p>Nella mediateca, sotto il campo d'azione «Veicolo», troverai tutte le risorse rilevanti per le tue competenze professionali.</p>" - f"<p>Si consiglia di leggere l'argomento prima di completare le altre unità di apprendimento.</p>" + "<p>Nella mediateca, sotto il campo d'azione «Veicolo», troverai tutte le risorse rilevanti per le tue competenze professionali.</p>" + "<p>Si consiglia di leggere l'argomento prima di completare le altre unità di apprendimento.</p>" ), content_url=f"/course/{course_slug}/media", ) - LearningContentAssignmentFactory( - title="Veicolo, la mia prima auto", - assignment_type="PREP_ASSIGNMENT", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{course_slug}-assignment-veicolo-la-mia-prima-auto" + ( + LearningContentAssignmentFactory( + title="Veicolo, la mia prima auto", + assignment_type="PREP_ASSIGNMENT", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{course_slug}-assignment-veicolo-la-mia-prima-auto" + ), ), - ), + ) LearningSequenceFactory(title="Formazione", parent=circle) LearningUnitFactory(title="Corso di presenza", title_hidden=True, parent=circle) LearningContentAttendanceCourseFactory( @@ -1344,19 +1377,23 @@ def create_uk_it_circle_fahrzeug(lp, title="Veicolo"): LearningUnitFactory( title="Controllo delle competenze", title_hidden=True, parent=circle ) - LearningContentAssignmentFactory( - title="Verifica di una polizza di assicurazione veicoli a motore", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{course_slug}-assignment-verifica-di-una-polizza-di-assicurazione-veicoli-a-motore" + ( + LearningContentAssignmentFactory( + title="Verifica di una polizza di assicurazione veicoli a motore", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{course_slug}-assignment-verifica-di-una-polizza-di-assicurazione-veicoli-a-motore" + ), ), - ), + ) LearningUnitFactory(title="Riflessione", title_hidden=True, parent=circle) - LearningContentAssignmentFactory( - title="Riflessione", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{course_slug}-assignment-riflessione" + ( + LearningContentAssignmentFactory( + title="Riflessione", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{course_slug}-assignment-riflessione" + ), ), - ), + ) diff --git a/server/vbv_lernwelt/course/graphql/interfaces.py b/server/vbv_lernwelt/course/graphql/interfaces.py index c1d42a03..ef43142a 100644 --- a/server/vbv_lernwelt/course/graphql/interfaces.py +++ b/server/vbv_lernwelt/course/graphql/interfaces.py @@ -1,7 +1,6 @@ import graphene from vbv_lernwelt.core.utils import get_django_content_type -from vbv_lernwelt.learnpath.models import Circle class CoursePageInterface(graphene.Interface): diff --git a/server/vbv_lernwelt/course/graphql/types.py b/server/vbv_lernwelt/course/graphql/types.py index 934fa119..4da9db9c 100644 --- a/server/vbv_lernwelt/course/graphql/types.py +++ b/server/vbv_lernwelt/course/graphql/types.py @@ -30,7 +30,6 @@ from vbv_lernwelt.course_session.models import ( ) from vbv_lernwelt.course_session_group.models import CourseSessionGroup from vbv_lernwelt.iam.permissions import has_course_access -from vbv_lernwelt.learnpath.consts import COURSE_PROFILE_ALL_ID from vbv_lernwelt.learnpath.graphql.types import LearningPathObjectType from vbv_lernwelt.learnpath.models import Circle, CourseProfile diff --git a/server/vbv_lernwelt/course/management/commands/create_default_courses.py b/server/vbv_lernwelt/course/management/commands/create_default_courses.py index 5388dc35..e9b4d51f 100644 --- a/server/vbv_lernwelt/course/management/commands/create_default_courses.py +++ b/server/vbv_lernwelt/course/management/commands/create_default_courses.py @@ -3,7 +3,7 @@ import random from datetime import datetime, timedelta import djclick as click -from dateutil.relativedelta import MO, relativedelta, TH, TU +from dateutil.relativedelta import MO, TH, TU, relativedelta from django.utils import timezone from vbv_lernwelt.assignment.creators.create_assignments import ( diff --git a/server/vbv_lernwelt/course/migrations/0008_auto_20240403_1132.py b/server/vbv_lernwelt/course/migrations/0008_auto_20240403_1132.py index 7e7c1e21..471d9f23 100644 --- a/server/vbv_lernwelt/course/migrations/0008_auto_20240403_1132.py +++ b/server/vbv_lernwelt/course/migrations/0008_auto_20240403_1132.py @@ -2,7 +2,6 @@ from django.db import migrations, models - TEST_COURSE_ID = -1 UK_COURSE_IDS = [ diff --git a/server/vbv_lernwelt/course/serializer_helpers.py b/server/vbv_lernwelt/course/serializer_helpers.py index f0cf9116..12cfd3db 100644 --- a/server/vbv_lernwelt/course/serializer_helpers.py +++ b/server/vbv_lernwelt/course/serializer_helpers.py @@ -1,8 +1,8 @@ from rest_framework.fields import SerializerMethodField from vbv_lernwelt.core.serializer_helpers import ( - get_it_serializer_class, ItWagtailBaseSerializer, + get_it_serializer_class, ) from vbv_lernwelt.core.utils import StringIDField diff --git a/server/vbv_lernwelt/course/tests/test_completion_api.py b/server/vbv_lernwelt/course/tests/test_completion_api.py index a1a40512..83e6d663 100644 --- a/server/vbv_lernwelt/course/tests/test_completion_api.py +++ b/server/vbv_lernwelt/course/tests/test_completion_api.py @@ -23,7 +23,7 @@ class CourseCompletionApiTestCase(APITestCase): course_id=COURSE_TEST_ID, title="Test Lehrgang Session", ) - csu = CourseSessionUser.objects.create( + CourseSessionUser.objects.create( course_session=self.cs, user=self.user, ) @@ -34,7 +34,7 @@ class CourseCompletionApiTestCase(APITestCase): title="Fachcheck Reisen" ) - mark_url = f"/api/course/completion/mark/" + mark_url = "/api/course/completion/mark/" response = self.client.post( mark_url, diff --git a/server/vbv_lernwelt/course/tests/test_course_session_api.py b/server/vbv_lernwelt/course/tests/test_course_session_api.py index 0737cc32..fb9da67a 100644 --- a/server/vbv_lernwelt/course/tests/test_course_session_api.py +++ b/server/vbv_lernwelt/course/tests/test_course_session_api.py @@ -24,7 +24,7 @@ class CourseCompletionApiTestCase(APITestCase): self.client.login(username="student", password="test") def test_api_noCourseSession_withoutCourseSessionUser(self): - response = self.client.get(f"/api/course/sessions/") + response = self.client.get("/api/course/sessions/") self.assertEqual(response.status_code, 200) self.assertEqual(len(response.json()), 0) @@ -34,7 +34,7 @@ class CourseCompletionApiTestCase(APITestCase): course_session=self.course_session, user=self.user, ) - response = self.client.get(f"/api/course/sessions/") + response = self.client.get("/api/course/sessions/") self.assertEqual(response.status_code, 200) self.assertEqual(len(response.json()), 1) @@ -44,7 +44,7 @@ class CourseCompletionApiTestCase(APITestCase): def test_api_superUser_canAccessEveryCourseSession(self): self.client.login(username="admin", password="test") - response = self.client.get(f"/api/course/sessions/") + response = self.client.get("/api/course/sessions/") self.assertEqual(response.status_code, 200) self.assertEqual(len(response.json()), 1) diff --git a/server/vbv_lernwelt/course/tests/test_document_uploads.py b/server/vbv_lernwelt/course/tests/test_document_uploads.py index 4d08b6cf..2ae0adea 100644 --- a/server/vbv_lernwelt/course/tests/test_document_uploads.py +++ b/server/vbv_lernwelt/course/tests/test_document_uploads.py @@ -56,7 +56,7 @@ class DocumentUploadApiTestCase(APITestCase): ) self.test_data["learning_sequence"] = ls.id - response = self.client.post(f"/api/core/document/start/", self.test_data) + response = self.client.post("/api/core/document/start/", self.test_data) self.assertEqual(response.status_code, 200) self.assertNotEqual(response.data["url"], "") @@ -81,7 +81,7 @@ class DocumentUploadApiTestCase(APITestCase): slug="test-lehrgang-lp-circle-reisen-ls-analyse" ) self.test_data["learning_sequence"] = ls.id - response = self.client.post(f"/api/core/document/start/", self.test_data) + response = self.client.post("/api/core/document/start/", self.test_data) self.assertEqual(response.status_code, 403) @@ -91,7 +91,7 @@ class DocumentUploadApiTestCase(APITestCase): slug="test-lehrgang-lp-circle-fahrzeug-ls-vorbereitung" ) self.test_data["learning_sequence"] = ls.id - response = self.client.post(f"/api/core/document/start/", self.test_data) + response = self.client.post("/api/core/document/start/", self.test_data) self.assertEqual(response.status_code, 403) @@ -100,13 +100,13 @@ class DocumentUploadApiTestCase(APITestCase): slug="test-lehrgang-lp-circle-fahrzeug-ls-vorbereitung" ) self.test_data["learning_sequence"] = ls.id - response = self.client.post(f"/api/core/document/start/", self.test_data) + response = self.client.post("/api/core/document/start/", self.test_data) self.assertEqual(response.status_code, 200) file_id = response.data["file_id"] response = self.client.post( - f"/api/core/file/finish/", + "/api/core/file/finish/", { "file_id": file_id, }, @@ -129,7 +129,7 @@ class DocumentUploadApiTestCase(APITestCase): file.full_clean() file.save() - response = self.client.post(f"/api/core/file/finish/", {"file_id": file.id}) + response = self.client.post("/api/core/file/finish/", {"file_id": file.id}) self.assertEqual(response.status_code, 403) diff --git a/server/vbv_lernwelt/course_session/admin.py b/server/vbv_lernwelt/course_session/admin.py index 744590f6..64f9692d 100644 --- a/server/vbv_lernwelt/course_session/admin.py +++ b/server/vbv_lernwelt/course_session/admin.py @@ -120,9 +120,7 @@ class CourseSessionAssignmentAdmin(admin.ModelAdmin): # Make circle display-only in the form def get_readonly_fields(self, request, obj=None): - readonly_fields = super(CourseSessionAssignmentAdmin, self).get_readonly_fields( - request, obj - ) + super(CourseSessionAssignmentAdmin, self).get_readonly_fields(request, obj) return ["circle_display"] # Override get_form to include circle_display diff --git a/server/vbv_lernwelt/course_session/factories.py b/server/vbv_lernwelt/course_session/factories.py index 25b119ce..5211bb1a 100644 --- a/server/vbv_lernwelt/course_session/factories.py +++ b/server/vbv_lernwelt/course_session/factories.py @@ -1,4 +1,3 @@ -import factory from factory.django import DjangoModelFactory from vbv_lernwelt.course.factories import CourseFactory diff --git a/server/vbv_lernwelt/course_session/graphql/queries.py b/server/vbv_lernwelt/course_session/graphql/queries.py index 33c544e4..e51aee1f 100644 --- a/server/vbv_lernwelt/course_session/graphql/queries.py +++ b/server/vbv_lernwelt/course_session/graphql/queries.py @@ -20,7 +20,7 @@ class CourseSessionQuery(object): root, info, id=None, - user_id=graphene.ID(required=False), + user_id=graphene.ID(required=False), # noqa: B008 ): if user_id is None: user_id = info.context.user.id diff --git a/server/vbv_lernwelt/course_session_group/admin.py b/server/vbv_lernwelt/course_session_group/admin.py index 5bda3780..f880cfa3 100644 --- a/server/vbv_lernwelt/course_session_group/admin.py +++ b/server/vbv_lernwelt/course_session_group/admin.py @@ -4,5 +4,4 @@ from vbv_lernwelt.course_session_group.models import CourseSessionGroup @admin.register(CourseSessionGroup) -class CourseSessionAssignmentAdmin(admin.ModelAdmin): - ... +class CourseSessionAssignmentAdmin(admin.ModelAdmin): ... diff --git a/server/vbv_lernwelt/course_session_group/tests.py b/server/vbv_lernwelt/course_session_group/tests.py index 7ce503c2..a39b155a 100644 --- a/server/vbv_lernwelt/course_session_group/tests.py +++ b/server/vbv_lernwelt/course_session_group/tests.py @@ -1,3 +1 @@ -from django.test import TestCase - # Create your tests here. diff --git a/server/vbv_lernwelt/dashboard/graphql/queries.py b/server/vbv_lernwelt/dashboard/graphql/queries.py index 36f3188f..b0a92e93 100644 --- a/server/vbv_lernwelt/dashboard/graphql/queries.py +++ b/server/vbv_lernwelt/dashboard/graphql/queries.py @@ -107,7 +107,7 @@ class DashboardQuery(graphene.ObjectType): coursesessionuser__user=user, coursesessionuser__role=CourseSessionUser.Role.EXPERT, ).values_list("id", flat=True) - setattr(info.context, "circle_ids", list(circle_ids)) + setattr(info.context, "circle_ids", list(circle_ids)) # noqa: B010 # todo: if course_session_ids and circles are empty return none or 404 or 401 @@ -119,9 +119,7 @@ class DashboardQuery(graphene.ObjectType): course_session_selection_ids=list(course_session_ids), # noqa ) - def resolve_mentor_course_statistics( - root, info, course_id: str, agent_role: str - ): # noqa + def resolve_mentor_course_statistics(root, info, course_id: str, agent_role: str): # noqa user = info.context.user return _agent_course_statistics(user, course_id, role=agent_role) @@ -173,7 +171,7 @@ class DashboardQuery(graphene.ObjectType): user = info.context.user course = Course.objects.get(id=course_id) - setattr(info.context, "course", course) + setattr(info.context, "course", course) # noqa: B010 newest: CourseSession | None = None course_session_for_user: List[str] = [] diff --git a/server/vbv_lernwelt/dashboard/graphql/types/assignment.py b/server/vbv_lernwelt/dashboard/graphql/types/assignment.py index 74f5aa15..e410ba91 100644 --- a/server/vbv_lernwelt/dashboard/graphql/types/assignment.py +++ b/server/vbv_lernwelt/dashboard/graphql/types/assignment.py @@ -120,7 +120,7 @@ def get_assignment_completion_metrics( ) key = f"CourseSessionUsers_{course_session.id}" - if not key in context: + if key not in context: if user_selection_ids: csu_qs = csu_qs.filter(user_id__in=user_selection_ids) @@ -192,7 +192,7 @@ def create_record( key = f"{assignment_type}_{course_session_assignment.learning_content.id}" - if not key in context: + if key not in context: context[key] = course_session_assignment.learning_content.get_circle().id circle_id = context[key] diff --git a/server/vbv_lernwelt/dashboard/graphql/types/dashboard.py b/server/vbv_lernwelt/dashboard/graphql/types/dashboard.py index 1981b156..69a1917a 100644 --- a/server/vbv_lernwelt/dashboard/graphql/types/dashboard.py +++ b/server/vbv_lernwelt/dashboard/graphql/types/dashboard.py @@ -4,21 +4,21 @@ from graphene import Enum from vbv_lernwelt.course.graphql.types import CourseConfigurationObjectType from vbv_lernwelt.course.models import CourseSession, CourseSessionUser from vbv_lernwelt.dashboard.graphql.types.assignment import ( - assignments, AssignmentsStatisticsType, + assignments, ) from vbv_lernwelt.dashboard.graphql.types.attendance import ( - attendance_day_presences, AttendanceDayPresencesStatisticsType, + attendance_day_presences, ) from vbv_lernwelt.dashboard.graphql.types.competence import ( CompetencePerformanceStatisticsSummaryType, - competences, CompetencesStatisticsType, + competences, ) from vbv_lernwelt.dashboard.graphql.types.feedback import ( - feedback_responses, FeedbackStatisticsResponsesType, + feedback_responses, ) from vbv_lernwelt.learnpath.models import Circle @@ -201,7 +201,8 @@ class CourseStatisticsType(BaseStatisticsType): records, success_total, fail_total = competences( course_slug=str(root.course_slug), course_session_selection_ids=[ - str(cs) for cs in root.course_session_selection_ids # noqa + str(cs) + for cs in root.course_session_selection_ids # noqa ], user_selection_ids=user_selection_ids, # noqa circle_ids=root.get_circle_ids(info), # noqa diff --git a/server/vbv_lernwelt/dashboard/tests/graphql/test_assignment.py b/server/vbv_lernwelt/dashboard/tests/graphql/test_assignment.py index a3c53ae2..d63e9467 100644 --- a/server/vbv_lernwelt/dashboard/tests/graphql/test_assignment.py +++ b/server/vbv_lernwelt/dashboard/tests/graphql/test_assignment.py @@ -29,14 +29,14 @@ from vbv_lernwelt.learnpath.models import Circle class AssignmentTestCase(GraphQLTestCase): GRAPHQL_URL = "/server/graphql/" - GRAPHQL_QUERY = f"""query($course_id: ID!) {{ - course_statistics(course_id: $course_id) {{ - assignments{{ - summary{{ + GRAPHQL_QUERY = """query($course_id: ID!) { + course_statistics(course_id: $course_id) { + assignments{ + summary{ completed_count average_passed - }} - records{{ + } + records{ course_session_id course_session_assignment_id circle_id @@ -45,17 +45,17 @@ class AssignmentTestCase(GraphQLTestCase): assignment_type_translation_key details_url deadline - metrics {{ + metrics { passed_count failed_count unranked_count ranking_completed average_passed - }} - }} - }} - }} - }}""" + } + } + } + } + }""" def setUp(self): self.course, self.course_page = create_course("Test Course") diff --git a/server/vbv_lernwelt/dashboard/tests/graphql/test_attendance.py b/server/vbv_lernwelt/dashboard/tests/graphql/test_attendance.py index 20464b41..565454ac 100644 --- a/server/vbv_lernwelt/dashboard/tests/graphql/test_attendance.py +++ b/server/vbv_lernwelt/dashboard/tests/graphql/test_attendance.py @@ -75,15 +75,15 @@ class DashboardAttendanceTestCase(GraphQLTestCase): self.client.force_login(supervisor) - query = f""" - query($course_id: ID!) {{ - course_statistics(course_id: $course_id) {{ - attendance_day_presences{{ - summary{{ + query = """ + query($course_id: ID!) { + course_statistics(course_id: $course_id) { + attendance_day_presences{ + summary{ days_completed participants_present - }} - records{{ + } + records{ course_session_id generation circle_id @@ -91,10 +91,10 @@ class DashboardAttendanceTestCase(GraphQLTestCase): participants_present participants_total details_url - }} - }} - }} - }} + } + } + } + } """ # WHEN @@ -215,15 +215,15 @@ class DashboardExpertAttendanceTestCase(GraphQLTestCase): self.client.force_login(e1) - query = f""" - query($course_id: ID!) {{ - course_statistics(course_id: $course_id) {{ - attendance_day_presences{{ - summary{{ + query = """ + query($course_id: ID!) { + course_statistics(course_id: $course_id) { + attendance_day_presences{ + summary{ days_completed participants_present - }} - records{{ + } + records{ course_session_id generation circle_id @@ -231,10 +231,10 @@ class DashboardExpertAttendanceTestCase(GraphQLTestCase): participants_present participants_total details_url - }} - }} - }} - }} + } + } + } + } """ # WHEN diff --git a/server/vbv_lernwelt/dashboard/tests/graphql/test_competence.py b/server/vbv_lernwelt/dashboard/tests/graphql/test_competence.py index 51d9384f..b7906659 100644 --- a/server/vbv_lernwelt/dashboard/tests/graphql/test_competence.py +++ b/server/vbv_lernwelt/dashboard/tests/graphql/test_competence.py @@ -62,10 +62,10 @@ class DashboardCompetenceTestCase(GraphQLTestCase): self.client.force_login(supervisor) - query = f"""query($course_id: ID!) {{ - course_statistics(course_id: $course_id) {{ - competences {{ - records {{ + query = """query($course_id: ID!) { + course_statistics(course_id: $course_id) { + competences { + records { title course_session_id generation @@ -73,14 +73,14 @@ class DashboardCompetenceTestCase(GraphQLTestCase): success_count fail_count details_url - }} - summary {{ + } + summary { success_total fail_total - }} - }} - }} - }} + } + } + } + } """ variables = {"course_id": str(course.id)} @@ -189,10 +189,10 @@ class DashboardExpertCompetenceTestCase(GraphQLTestCase): self.client.force_login(e1) - query = f"""query($course_id: ID!) {{ - course_statistics(course_id: $course_id) {{ - competences {{ - records {{ + query = """query($course_id: ID!) { + course_statistics(course_id: $course_id) { + competences { + records { title course_session_id generation @@ -200,14 +200,14 @@ class DashboardExpertCompetenceTestCase(GraphQLTestCase): success_count fail_count details_url - }} - summary {{ + } + summary { success_total fail_total - }} - }} - }} - }} + } + } + } + } """ variables = {"course_id": str(course.id)} diff --git a/server/vbv_lernwelt/dashboard/tests/graphql/test_feedback.py b/server/vbv_lernwelt/dashboard/tests/graphql/test_feedback.py index aa03624c..13376904 100644 --- a/server/vbv_lernwelt/dashboard/tests/graphql/test_feedback.py +++ b/server/vbv_lernwelt/dashboard/tests/graphql/test_feedback.py @@ -77,10 +77,10 @@ class DashboardFeedbackTestCase(GraphQLTestCase): self.client.force_login(supervisor) - query = f"""query($course_id: ID!) {{ - course_statistics(course_id: $course_id) {{ - feedback_responses {{ - records {{ + query = """query($course_id: ID!) { + course_statistics(course_id: $course_id) { + feedback_responses { + records { course_session_id generation circle_id @@ -88,15 +88,15 @@ class DashboardFeedbackTestCase(GraphQLTestCase): satisfaction_max details_url experts - }} - summary {{ + } + summary { satisfaction_average satisfaction_max total_responses - }} - }} - }} - }} + } + } + } + } """ variables = {"course_id": str(course.id)} @@ -210,10 +210,10 @@ class DashboardExpertFeedbackTestCase(GraphQLTestCase): self.client.force_login(expert1.user) - query = f"""query($course_id: ID!) {{ - course_statistics(course_id: $course_id) {{ - feedback_responses {{ - records {{ + query = """query($course_id: ID!) { + course_statistics(course_id: $course_id) { + feedback_responses { + records { course_session_id generation circle_id @@ -221,15 +221,15 @@ class DashboardExpertFeedbackTestCase(GraphQLTestCase): satisfaction_max details_url experts - }} - summary {{ + } + summary { satisfaction_average satisfaction_max total_responses - }} - }} - }} - }} + } + } + } + } """ variables = {"course_id": str(course.id)} diff --git a/server/vbv_lernwelt/dashboard/tests/graphql/test_selection_metrics.py b/server/vbv_lernwelt/dashboard/tests/graphql/test_selection_metrics.py index 55213cd9..3a8a89a0 100644 --- a/server/vbv_lernwelt/dashboard/tests/graphql/test_selection_metrics.py +++ b/server/vbv_lernwelt/dashboard/tests/graphql/test_selection_metrics.py @@ -77,15 +77,15 @@ class DashboardTestCase(GraphQLTestCase): self.client.force_login(cs_1_ab_supervisor) # WHEN - query = f"""query($course_id: ID!) {{ - course_statistics(course_id: $course_id) {{ - course_session_selection_metrics {{ + query = """query($course_id: ID!) { + course_statistics(course_id: $course_id) { + course_session_selection_metrics { expert_count participant_count session_count - }} - }} - }}""" + } + } + }""" variables = {"course_id": str(course_1.id)} response = self.query(query, variables=variables) diff --git a/server/vbv_lernwelt/dashboard/utils.py b/server/vbv_lernwelt/dashboard/utils.py index 799b8ee5..57250135 100644 --- a/server/vbv_lernwelt/dashboard/utils.py +++ b/server/vbv_lernwelt/dashboard/utils.py @@ -141,7 +141,7 @@ def create_person_list_with_roles( # add persons where request.user is mentor for cs in course_sessions: - def _add_agent_relation(my_role, user_role): + def _add_agent_relation(cs, relation, my_role, user_role): course_session_entry = create_course_session_dict(cs, my_role, user_role) participant_user = relation.participant.user @@ -161,7 +161,7 @@ def create_person_list_with_roles( participant__course_session_id=cs.id, role="LEARNING_MENTOR", ): - _add_agent_relation("LEARNING_MENTOR", "PARTICIPANT") + _add_agent_relation(cs, relation, "LEARNING_MENTOR", "PARTICIPANT") if "BERUFSBILDNER" in cs.roles: for relation in AgentParticipantRelation.objects.filter( @@ -169,7 +169,7 @@ def create_person_list_with_roles( participant__course_session_id=cs.id, role="BERUFSBILDNER", ): - _add_agent_relation("BERUFSBILDNER", "PARTICIPANT") + _add_agent_relation(cs, relation, "BERUFSBILDNER", "PARTICIPANT") # add persons where request.user is lerning mentee mentor_relation_qs = AgentParticipantRelation.objects.filter( diff --git a/server/vbv_lernwelt/dashboard/views.py b/server/vbv_lernwelt/dashboard/views.py index 31f1cf75..3c605fd6 100644 --- a/server/vbv_lernwelt/dashboard/views.py +++ b/server/vbv_lernwelt/dashboard/views.py @@ -31,7 +31,7 @@ from vbv_lernwelt.course_session.services.export_attendance import ( export_attendance, make_export_filename, ) -from vbv_lernwelt.dashboard.person_export import export_persons, PERSONS_EXPORT_FILENAME +from vbv_lernwelt.dashboard.person_export import PERSONS_EXPORT_FILENAME, export_persons from vbv_lernwelt.dashboard.utils import ( CourseSessionWithRoles, create_course_session_dict, @@ -42,8 +42,8 @@ from vbv_lernwelt.dashboard.utils import ( from vbv_lernwelt.duedate.models import DueDate from vbv_lernwelt.duedate.serializers import DueDateSerializer from vbv_lernwelt.feedback.export import ( - export_feedback_with_circle_restriction, FEEDBACK_EXPORT_FILE_NAME, + export_feedback_with_circle_restriction, ) from vbv_lernwelt.learning_mentor.models import ( AgentParticipantRelation, @@ -346,9 +346,7 @@ def get_mentor_open_tasks_count(request, course_id: str): return Response( status=200, data={ - "open_task_count": _get_mentor_open_tasks_count( - course_id, request.user - ) # noqa + "open_task_count": _get_mentor_open_tasks_count(course_id, request.user) # noqa }, ) except PermissionDenied as e: diff --git a/server/vbv_lernwelt/duedate/views.py b/server/vbv_lernwelt/duedate/views.py index 91ea44a2..60f00ef0 100644 --- a/server/vbv_lernwelt/duedate/views.py +++ b/server/vbv_lernwelt/duedate/views.py @@ -1,3 +1 @@ -from django.shortcuts import render - # Create your views here. diff --git a/server/vbv_lernwelt/edoniq_test/result_import/edoniq_sftp_connection.py b/server/vbv_lernwelt/edoniq_test/result_import/edoniq_sftp_connection.py index 164b75dc..aa21deec 100644 --- a/server/vbv_lernwelt/edoniq_test/result_import/edoniq_sftp_connection.py +++ b/server/vbv_lernwelt/edoniq_test/result_import/edoniq_sftp_connection.py @@ -58,7 +58,7 @@ def load_edoniq_test_results_csv_data(): if __name__ == "__main__": csv_data = load_edoniq_test_results_csv_data() csv_reader = csv.reader(StringIO(csv_data), delimiter=";") - for i, row in enumerate(csv_reader): + for _, row in enumerate(csv_reader): # if len(row) > 4 and row[4] == "AG 2023 A" and row[5] == "de_üK1_KO_Testlauf": # print(row) if len(row) > 4 and row[6] == "1691151920116": diff --git a/server/vbv_lernwelt/edoniq_test/tests/test_result_import.py b/server/vbv_lernwelt/edoniq_test/tests/test_result_import.py index 5dcd6e1f..5926fd54 100644 --- a/server/vbv_lernwelt/edoniq_test/tests/test_result_import.py +++ b/server/vbv_lernwelt/edoniq_test/tests/test_result_import.py @@ -11,8 +11,8 @@ from vbv_lernwelt.core.constants import ( from vbv_lernwelt.core.create_default_users import create_default_users from vbv_lernwelt.course.creators.test_course import create_test_course from vbv_lernwelt.edoniq_test.result_import.services import ( - create_edoniq_csv_test_result, EdoniqCsvTestResult, + create_edoniq_csv_test_result, filter_relevant_rows, get_distinct_course_release_ids, upsert_edoniq_test_result, diff --git a/server/vbv_lernwelt/edoniq_test/views.py b/server/vbv_lernwelt/edoniq_test/views.py index 00d8ff7b..79458426 100644 --- a/server/vbv_lernwelt/edoniq_test/views.py +++ b/server/vbv_lernwelt/edoniq_test/views.py @@ -100,14 +100,6 @@ def export_students_and_trainers(request): return generate_export_response(course_session_users) -def fetch_course_session_users(courses: List[int]): - # if a user is in multiple courses, he should be exported multiple times - # todo: check if this is the case otherwise use .distinct("user") - return CourseSessionUser.objects.filter( - course_session__course__id__in=courses, role=CourseSessionUser.Role.MEMBER - ).order_by("user__email") - - def fetch_course_session_users( courses: List[int], role=CourseSessionUser.Role.MEMBER, excluded_domains=None ): @@ -153,9 +145,9 @@ def fetch_course_session_all_users(courses: List[int], excluded_domains=None): def generate_export_response(cs_users: List[User]) -> HttpResponse: response = HttpResponse(content_type="text/csv; charset=utf-8") - response[ - "Content-Disposition" - ] = f"attachment; filename=edoniq_user_export_{date.today().strftime('%Y%m%d')}.csv" + response["Content-Disposition"] = ( + f"attachment; filename=edoniq_user_export_{date.today().strftime('%Y%m%d')}.csv" + ) response.write("\ufeff".encode("utf8")) # UTF-8 BOM diff --git a/server/vbv_lernwelt/feedback/services.py b/server/vbv_lernwelt/feedback/services.py index d0fefe20..9e561746 100644 --- a/server/vbv_lernwelt/feedback/services.py +++ b/server/vbv_lernwelt/feedback/services.py @@ -77,7 +77,7 @@ def update_feedback_response( def initial_data_for_feedback_page( learning_content_feedback_page: Union[ LearningContentFeedbackUK, LearningContentFeedbackVV - ] + ], ): if hasattr(learning_content_feedback_page, "learningcontentfeedbackuk"): return { @@ -125,9 +125,9 @@ def _handle_feedback_export_action(course_seesions, file_name): response = HttpResponse( content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ) - response[ - "Content-Disposition" - ] = f"attachment; filename={make_export_filename(file_name)}" + response["Content-Disposition"] = ( + f"attachment; filename={make_export_filename(file_name)}" + ) response.write(excel_bytes) return response diff --git a/server/vbv_lernwelt/files/integrations.py b/server/vbv_lernwelt/files/integrations.py index a47899f2..b99801d8 100644 --- a/server/vbv_lernwelt/files/integrations.py +++ b/server/vbv_lernwelt/files/integrations.py @@ -92,7 +92,7 @@ def s3_generate_presigned_post( Fields={ "acl": acl, "Content-Type": file_type, - f"Content-Disposition": f"attachment; filename={file_name}", + "Content-Disposition": f"attachment; filename={file_name}", }, Conditions=[ {"acl": acl}, diff --git a/server/vbv_lernwelt/files/mixins.py b/server/vbv_lernwelt/files/mixins.py index b63ced13..0ea3b034 100644 --- a/server/vbv_lernwelt/files/mixins.py +++ b/server/vbv_lernwelt/files/mixins.py @@ -1,5 +1,5 @@ from importlib import import_module -from typing import Sequence, Type, TYPE_CHECKING +from typing import TYPE_CHECKING, Sequence, Type from django.conf import settings from django.contrib import auth diff --git a/server/vbv_lernwelt/files/models.py b/server/vbv_lernwelt/files/models.py index 32cec66c..9b0e8041 100644 --- a/server/vbv_lernwelt/files/models.py +++ b/server/vbv_lernwelt/files/models.py @@ -8,7 +8,6 @@ from vbv_lernwelt.files.enums import FileUploadStorage from vbv_lernwelt.files.integrations import s3_delete_file, s3_generate_presigned_url from vbv_lernwelt.files.utils import file_generate_upload_path - # Inspired by https://www.hacksoft.io/blog/direct-to-s3-file-upload-with-django # Code https://github.com/HackSoftware/Django-Styleguide-Example/tree/bdadf52b849bb5fa47854a3094f4da6fe9d54d02/styleguide_example/files diff --git a/server/vbv_lernwelt/files/tests/test_files_integrations.py b/server/vbv_lernwelt/files/tests/test_files_integrations.py index dc652e09..e9d133b4 100644 --- a/server/vbv_lernwelt/files/tests/test_files_integrations.py +++ b/server/vbv_lernwelt/files/tests/test_files_integrations.py @@ -1,5 +1,3 @@ -import os - import boto3 import requests from django.conf import settings @@ -48,8 +46,6 @@ class TestIntegrationsIntegrationTest(TestCase): def test_s3_generate_presigned_url(self): # First, manually upload a file to S3 for testing - self.s3_client.upload_fileobj - self.s3_client.upload_fileobj( self.dummy_file, settings.AWS_STORAGE_BUCKET_NAME, "testfile.txt" ) diff --git a/server/vbv_lernwelt/importer/admin.py b/server/vbv_lernwelt/importer/admin.py index 8c38f3f3..846f6b40 100644 --- a/server/vbv_lernwelt/importer/admin.py +++ b/server/vbv_lernwelt/importer/admin.py @@ -1,3 +1 @@ -from django.contrib import admin - # Register your models here. diff --git a/server/vbv_lernwelt/importer/services.py b/server/vbv_lernwelt/importer/services.py index 20de544f..2e5894d5 100644 --- a/server/vbv_lernwelt/importer/services.py +++ b/server/vbv_lernwelt/importer/services.py @@ -994,7 +994,7 @@ def _get_date_of_birth(data: Dict[str, Any]) -> str: return "" elif date_of_birth is date or date_of_birth is datetime: return date_of_birth.strftime("%d.%m.%Y") - elif type(date_of_birth) is str: + elif isinstance(date_of_birth, str): return date_of_birth diff --git a/server/vbv_lernwelt/importer/tests/test_import_course_sessions.py b/server/vbv_lernwelt/importer/tests/test_import_course_sessions.py index 9b6f1fda..e8353751 100644 --- a/server/vbv_lernwelt/importer/tests/test_import_course_sessions.py +++ b/server/vbv_lernwelt/importer/tests/test_import_course_sessions.py @@ -17,9 +17,9 @@ from vbv_lernwelt.course_session.models import ( ) from vbv_lernwelt.duedate.models import DueDate from vbv_lernwelt.importer.services import ( + DataImportError, create_or_update_course_session, create_or_update_course_session_edoniq_test, - DataImportError, validate_row_data, ) from vbv_lernwelt.importer.utils import ( diff --git a/server/vbv_lernwelt/importer/tests/test_t2l_sync.py b/server/vbv_lernwelt/importer/tests/test_t2l_sync.py index 3392e022..3f3a0d60 100644 --- a/server/vbv_lernwelt/importer/tests/test_t2l_sync.py +++ b/server/vbv_lernwelt/importer/tests/test_t2l_sync.py @@ -142,9 +142,7 @@ class SyncT2lTestCase(TestCase): try: sync_students_from_t2l(user_dict) - updated_user = CourseSessionUser.objects.get( - user__email=self.user_dict["Email"] - ) + CourseSessionUser.objects.get(user__email=self.user_dict["Email"]) except Exception as e: self.fail( f"SyncT2lTestCase.test_ignors_wrong_contract_number: An exception was unexpectedly raised: {str(e)}" diff --git a/server/vbv_lernwelt/importer/utils.py b/server/vbv_lernwelt/importer/utils.py index d04209a3..d3a63287 100644 --- a/server/vbv_lernwelt/importer/utils.py +++ b/server/vbv_lernwelt/importer/utils.py @@ -27,7 +27,7 @@ def try_parse_int(x: Any, default: Optional[Any] = None) -> Tuple[bool, Any]: def try_parse_date( - value: Union[str, datetime.date] + value: Union[str, datetime.date], ) -> Tuple[bool, Union[str, datetime.date]]: if isinstance(value, datetime.date): return True, value @@ -59,7 +59,7 @@ def try_parse_date( def try_parse_datetime( - value: Union[str, datetime.datetime] + value: Union[str, datetime.datetime], ) -> Tuple[bool, Union[str, datetime.datetime]]: if isinstance(value, datetime.datetime): return True, value diff --git a/server/vbv_lernwelt/importer/views.py b/server/vbv_lernwelt/importer/views.py index 0aca7c52..9574c83a 100644 --- a/server/vbv_lernwelt/importer/views.py +++ b/server/vbv_lernwelt/importer/views.py @@ -67,7 +67,7 @@ def handle_import(request, success_msg: str, importer: Callable[[str], None]): excel_file = request.FILES["excel_file"] try: importer(excel_file) - except Exception as e: + except Exception: return render( # it is a "power" feature, so we will output the traceback on error request, diff --git a/server/vbv_lernwelt/learnpath/create_vv_new_learning_path.py b/server/vbv_lernwelt/learnpath/create_vv_new_learning_path.py index d011f87c..c4c3a068 100644 --- a/server/vbv_lernwelt/learnpath/create_vv_new_learning_path.py +++ b/server/vbv_lernwelt/learnpath/create_vv_new_learning_path.py @@ -32,7 +32,7 @@ from vbv_lernwelt.learnpath.tests.learning_path_factories import ( LearningUnitFactory, TopicFactory, ) -from vbv_lernwelt.learnpath.vv_circle_goals import GoalsType, VV_CIRCLE_GOALS +from vbv_lernwelt.learnpath.vv_circle_goals import VV_CIRCLE_GOALS, GoalsType # todo: remove when all Handlungsfelder are ready READY_HF = ["Fahrzeug", "Reisen"] @@ -271,14 +271,16 @@ def create_circle_basis(lp, title="Basis", course_page=None): LearningSequenceFactory(title="Transfer", parent=circle, icon="it-icon-ls-end") LearningUnitFactory(title="Reflexion, Feedback", parent=circle) - LearningContentAssignmentFactory( - title="Reflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"versicherungsvermittler-in-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Reflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith="versicherungsvermittler-in-assignment-reflexion" + ), ), - ), + ) LearningContentFeedbackVVFactory( parent=circle, ) @@ -334,13 +336,15 @@ def create_circle_gewinnen(lp, title="Gewinnen"): title="Vom Lead zum Termin/Telefon auf Empfehlung/Neukundengewinnung", parent=circle, ) - LearningContentAssignmentFactory( - title="Mein Kundenstamm", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{course_slug}-assignment-mein-kundenstamm" + ( + LearningContentAssignmentFactory( + title="Mein Kundenstamm", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{course_slug}-assignment-mein-kundenstamm" + ), ), - ), + ) LearningContentPlaceholderFactory( title="Selbsteinschätzung", parent=circle, @@ -348,14 +352,16 @@ def create_circle_gewinnen(lp, title="Gewinnen"): LearningSequenceFactory(title="Transfer", parent=circle, icon="it-icon-ls-end") LearningUnitFactory(title="Reflexion, Feedback", parent=circle) - LearningContentAssignmentFactory( - title="Reflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{course_slug}-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Reflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{course_slug}-assignment-reflexion" + ), ), - ), + ) LearningContentFeedbackVVFactory( parent=circle, ) @@ -653,21 +659,23 @@ def create_circle_reisen(lp, title="Reisen"): LearningSequenceFactory(title="Transfer", parent=circle, icon="it-icon-ls-end") LearningUnitFactory(title="Transfer", title_hidden=True, parent=circle) LearningContentPlaceholderFactory( - title=f"Auswandern", + title="Auswandern", parent=circle, ) LearningContentPlaceholderFactory( - title=f"Fachcheck Reisen", + title="Fachcheck Reisen", parent=circle, ) - LearningContentAssignmentFactory( - title="Reflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Reflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ), ), - ), + ) LearningContentFeedbackVVFactory( parent=circle, ) @@ -738,29 +746,33 @@ def create_circle_einkommenssicherung(lp, title="Einkommenssicherung"): ) LearningSequenceFactory(title="Transfer", parent=circle, icon="it-icon-ls-end") LearningUnitFactory(title="Transfer", title_hidden=True, parent=circle) - LearningContentAssignmentFactory( - title="Heirat: Was ändert sich", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{course_slug}-assignment-heirat-was-ändert-sich" + ( + LearningContentAssignmentFactory( + title="Heirat: Was ändert sich", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{course_slug}-assignment-heirat-was-ändert-sich" + ), ), - ), + ) LearningContentPlaceholderFactory( - title=f"Familienmanagerin", + title="Familienmanagerin", parent=circle, ) LearningContentPlaceholderFactory( title="Fachcheck Einkommenssicherung", parent=circle, ) - LearningContentAssignmentFactory( - title="Reflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Reflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ), ), - ), + ) LearningContentFeedbackVVFactory( parent=circle, ) @@ -806,14 +818,16 @@ def create_circle_wohneigentum(lp, title="Wohneigentum"): title="Fachcheck Wohneigentum", parent=circle, ) - LearningContentAssignmentFactory( - title="Reflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Reflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ), ), - ), + ) LearningContentFeedbackVVFactory( parent=circle, ) @@ -885,17 +899,19 @@ def create_circle_pensionierung(lp, title="Pensionierung"): LearningSequenceFactory(title="Transfer", parent=circle, icon="it-icon-ls-end") LearningUnitFactory(title="Transfer", title_hidden=True, parent=circle) LearningContentPlaceholderFactory( - title=f"Fachcheck Pensionierung", + title="Fachcheck Pensionierung", parent=circle, ) - LearningContentAssignmentFactory( - title="Reflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Reflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ), ), - ), + ) LearningContentFeedbackVVFactory( parent=circle, ) @@ -927,32 +943,34 @@ def create_circle_erben(lp, title="Erben/Vererben"): parent=circle, ) LearningContentPlaceholderFactory( - title=f"Guilia und Davide machen sich Gedanken", + title="Guilia und Davide machen sich Gedanken", parent=circle, ) LearningContentPlaceholderFactory( - title=f"Selbsteinschätzung", + title="Selbsteinschätzung", parent=circle, ) LearningSequenceFactory(title="Transfer", parent=circle, icon="it-icon-ls-end") LearningUnitFactory(title="Transfer", title_hidden=True, parent=circle) LearningContentPlaceholderFactory( - title=f"Hausverkauf mit Erbvorbezug", + title="Hausverkauf mit Erbvorbezug", parent=circle, ) LearningContentPlaceholderFactory( - title=f"Fachcheck Erben/Vererben", + title="Fachcheck Erben/Vererben", parent=circle, ) - LearningContentAssignmentFactory( - title="Reflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Reflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ), ), - ), + ) LearningContentFeedbackVVFactory( parent=circle, ) @@ -1024,25 +1042,29 @@ def create_circle_gesundheit(lp, title="Gesundheit"): ) LearningSequenceFactory(title="Transfer", parent=circle, icon="it-icon-ls-end") LearningUnitFactory(title="Transfer", title_hidden=True, parent=circle) - LearningContentAssignmentFactory( - title="Krankenversicherung: Passt die Lösung noch?", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{course_slug}-assignment-krankenversicherung-passt-die-lösung-noch" + ( + LearningContentAssignmentFactory( + title="Krankenversicherung: Passt die Lösung noch?", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{course_slug}-assignment-krankenversicherung-passt-die-lösung-noch" + ), ), - ), + ) LearningContentPlaceholderFactory( - title=f"Fachcheck Gesundheit", + title="Fachcheck Gesundheit", parent=circle, ) - LearningContentAssignmentFactory( - title="Reflexion", - assignment_type="REFLECTION", - parent=circle, - content_assignment=Assignment.objects.get( - slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Reflexion", + assignment_type="REFLECTION", + parent=circle, + content_assignment=Assignment.objects.get( + slug__startswith=f"{circle.get_course().slug}-assignment-reflexion" + ), ), - ), + ) LearningContentFeedbackVVFactory( parent=circle, ) @@ -1458,14 +1480,16 @@ def create_learning_sequence_transfer(parent, title, lc_praxis_title=None): title=f"Fachcheck {title}", parent=parent, ) - LearningContentAssignmentFactory( - title="Reflexion", - assignment_type="REFLECTION", - parent=parent, - content_assignment=Assignment.objects.get( - slug__startswith=f"versicherungsvermittler-in-assignment-reflexion" + ( + LearningContentAssignmentFactory( + title="Reflexion", + assignment_type="REFLECTION", + parent=parent, + content_assignment=Assignment.objects.get( + slug__startswith="versicherungsvermittler-in-assignment-reflexion" + ), ), - ), + ) LearningContentFeedbackVVFactory( parent=parent, ) diff --git a/server/vbv_lernwelt/learnpath/graphql/types.py b/server/vbv_lernwelt/learnpath/graphql/types.py index 7d29e5fd..ccc79e9f 100644 --- a/server/vbv_lernwelt/learnpath/graphql/types.py +++ b/server/vbv_lernwelt/learnpath/graphql/types.py @@ -1,5 +1,3 @@ -import random - import graphene import structlog from graphene_django import DjangoObjectType @@ -8,7 +6,6 @@ from vbv_lernwelt.core.utils import find_first_index from vbv_lernwelt.course.graphql.interfaces import CoursePageInterface from vbv_lernwelt.learnpath.models import ( Circle, - CourseProfile, LearningContentAssignment, LearningContentAttendanceCourse, LearningContentDocumentList, diff --git a/server/vbv_lernwelt/learnpath/migrations/0015_set_feedback_user_mentor_for_vv.py b/server/vbv_lernwelt/learnpath/migrations/0015_set_feedback_user_mentor_for_vv.py index 58bb55ec..250bb519 100644 --- a/server/vbv_lernwelt/learnpath/migrations/0015_set_feedback_user_mentor_for_vv.py +++ b/server/vbv_lernwelt/learnpath/migrations/0015_set_feedback_user_mentor_for_vv.py @@ -2,7 +2,6 @@ from django.db import migrations - VV_COURSE_IDS_WITH_MENTOR_FEEDBACK = [ -4, # vv-de -10, # vv-fr diff --git a/server/vbv_lernwelt/learnpath/models.py b/server/vbv_lernwelt/learnpath/models.py index a0a76f03..587c4485 100644 --- a/server/vbv_lernwelt/learnpath/models.py +++ b/server/vbv_lernwelt/learnpath/models.py @@ -172,9 +172,6 @@ class LearningSequence(CourseBasePage): def __str__(self): return f"{self.title}" - def get_admin_display_title(self): - return f"{self.icon} {self.draft_title}" - def get_admin_display_title_html(self): return f""" <span style="display: inline-flex; align-items: center; font-size: 1.25rem; font-weight: 700;"> diff --git a/server/vbv_lernwelt/media_files/models.py b/server/vbv_lernwelt/media_files/models.py index 05cc9f65..12f5692a 100644 --- a/server/vbv_lernwelt/media_files/models.py +++ b/server/vbv_lernwelt/media_files/models.py @@ -4,9 +4,9 @@ from wagtail.documents.models import AbstractDocument, Document from wagtail.images.models import ( AbstractImage, AbstractRendition, - get_upload_to, Image, WagtailImageField, + get_upload_to, ) from vbv_lernwelt.core.admin import User @@ -67,9 +67,12 @@ class ContentImage(AbstractImage): height_field="height", storage=ContentImagesStorage, ) - admin_form_fields = Image.admin_form_fields + ( - # Then add the field names here to make them appear in the form: - # 'caption', + admin_form_fields = ( + Image.admin_form_fields + + ( + # Then add the field names here to make them appear in the form: + # 'caption', + ) ) diff --git a/server/vbv_lernwelt/media_files/storage_backends.py b/server/vbv_lernwelt/media_files/storage_backends.py index 9bee1f3a..195f3308 100644 --- a/server/vbv_lernwelt/media_files/storage_backends.py +++ b/server/vbv_lernwelt/media_files/storage_backends.py @@ -1,6 +1,5 @@ from storages.backends.s3boto3 import S3Boto3Storage - # inspired by https://theyashshahs.medium.com/aws-s3-signed-urls-in-django-d9e66853a42f diff --git a/server/vbv_lernwelt/media_files/tests/test_content_document_storage.py b/server/vbv_lernwelt/media_files/tests/test_content_document_storage.py index c1bd849a..6ebb7b7a 100644 --- a/server/vbv_lernwelt/media_files/tests/test_content_document_storage.py +++ b/server/vbv_lernwelt/media_files/tests/test_content_document_storage.py @@ -4,7 +4,7 @@ from unittest import skipIf from django.conf import settings from django.core.files.uploadedfile import SimpleUploadedFile -from django.test import override_settings, TestCase +from django.test import TestCase, override_settings from wagtail.models import Collection from vbv_lernwelt.media_files.models import ContentDocument diff --git a/server/vbv_lernwelt/media_library/admin.py b/server/vbv_lernwelt/media_library/admin.py index 8c38f3f3..846f6b40 100644 --- a/server/vbv_lernwelt/media_library/admin.py +++ b/server/vbv_lernwelt/media_library/admin.py @@ -1,3 +1 @@ -from django.contrib import admin - # Register your models here. diff --git a/server/vbv_lernwelt/media_library/create_default_media_library.py b/server/vbv_lernwelt/media_library/create_default_media_library.py index 9b0f8d7c..421fb305 100644 --- a/server/vbv_lernwelt/media_library/create_default_media_library.py +++ b/server/vbv_lernwelt/media_library/create_default_media_library.py @@ -1,6 +1,6 @@ from wagtail.rich_text import RichText -from vbv_lernwelt.course.models import Course, CoursePage +from vbv_lernwelt.course.models import CoursePage from vbv_lernwelt.media_library.tests.media_library_factories import ( MediaLibraryCategoryPageFactory, MediaLibraryContentPageFactory, @@ -10,7 +10,6 @@ from vbv_lernwelt.media_library.tests.media_library_factories import ( def create_default_media_library(course_id): - course = Course.objects.get(id=course_id) course_page = CoursePage.objects.get(course_id=course_id) media_lib_page = MediaLibraryPageFactory( @@ -59,9 +58,9 @@ def create_default_media_library(course_id): die der Fahrzeugbesitzer und die Fahrzeugbesitzerin in einem grösseren Schadenfall oft nur schwer selbst aufbringen kann. """.strip(), body=RichText( - f"<h2>Lernmedien</h2>" - f"<h3>Allgemeines</h3>" - f"<ul><li>Mit Risiken im Strassenverkehr umgehen</li><li>Versicherungsschutz</li><li>Vertragsarten</li><li>Zusammenfassung</li></ul>" + "<h2>Lernmedien</h2>" + "<h3>Allgemeines</h3>" + "<ul><li>Mit Risiken im Strassenverkehr umgehen</li><li>Versicherungsschutz</li><li>Vertragsarten</li><li>Zusammenfassung</li></ul>" ), ) @@ -80,8 +79,8 @@ def create_default_media_library(course_id): title=cat, parent=media_lib_allgemeines, body=RichText( - f"<h2>Lernmedien</h2>" - f"<h3>Allgemeines</h3>" - f"<ul><li>Mit Risiken im Strassenverkehr umgehen</li><li>Versicherungsschutz</li><li>Vertragsarten</li><li>Zusammenfassung</li></ul>" + "<h2>Lernmedien</h2>" + "<h3>Allgemeines</h3>" + "<ul><li>Mit Risiken im Strassenverkehr umgehen</li><li>Versicherungsschutz</li><li>Vertragsarten</li><li>Zusammenfassung</li></ul>" ), ) diff --git a/server/vbv_lernwelt/media_library/models.py b/server/vbv_lernwelt/media_library/models.py index 79dc057e..d6914dd9 100644 --- a/server/vbv_lernwelt/media_library/models.py +++ b/server/vbv_lernwelt/media_library/models.py @@ -5,7 +5,6 @@ from django.utils.text import slugify from wagtail.admin.panels import FieldPanel from wagtail.documents.models import AbstractDocument, Document from wagtail.fields import RichTextField -from wagtail.models import Page from vbv_lernwelt.core.constants import ( DEFAULT_RICH_TEXT_FEATURES, diff --git a/server/vbv_lernwelt/notify/models.py b/server/vbv_lernwelt/notify/models.py index 70a846de..b7b66a44 100644 --- a/server/vbv_lernwelt/notify/models.py +++ b/server/vbv_lernwelt/notify/models.py @@ -12,8 +12,9 @@ class NotificationCategory(models.TextChoices): class NotificationTrigger(models.TextChoices): - ATTENDANCE_COURSE_REMINDER = "ATTENDANCE_COURSE_REMINDER", _( - "Attendance Course Reminder" + ATTENDANCE_COURSE_REMINDER = ( + "ATTENDANCE_COURSE_REMINDER", + _("Attendance Course Reminder"), ) ASSIGNMENT_REMINDER = "ASSIGNMENT_REMINDER", _("Assignment Reminder") CASEWORK_EXPERT_EVALUATION_REMINDER = ( @@ -24,11 +25,13 @@ class NotificationTrigger(models.TextChoices): CASEWORK_EVALUATED = "CASEWORK_EVALUATED", _("Casework Evaluated") NEW_FEEDBACK = "NEW_FEEDBACK", _("New Feedback") - SELF_EVALUATION_FEEDBACK_REQUESTED = "SELF_EVALUATION_FEEDBACK_REQUESTED", _( - "Self Evaluation Feedback Requested" + SELF_EVALUATION_FEEDBACK_REQUESTED = ( + "SELF_EVALUATION_FEEDBACK_REQUESTED", + _("Self Evaluation Feedback Requested"), ) - SELF_EVALUATION_FEEDBACK_PROVIDED = "SELF_EVALUATION_FEEDBACK_PROVIDED", _( - "Self Evaluation Feedback Provided" + SELF_EVALUATION_FEEDBACK_PROVIDED = ( + "SELF_EVALUATION_FEEDBACK_PROVIDED", + _("Self Evaluation Feedback Provided"), ) diff --git a/server/vbv_lernwelt/notify/services.py b/server/vbv_lernwelt/notify/services.py index 6f515b2b..af3f05ee 100644 --- a/server/vbv_lernwelt/notify/services.py +++ b/server/vbv_lernwelt/notify/services.py @@ -13,8 +13,8 @@ from vbv_lernwelt.core.models import User from vbv_lernwelt.course.models import CourseSession from vbv_lernwelt.course_session.models import CourseSessionAssignment from vbv_lernwelt.notify.email.email_services import ( - create_template_data_from_course_session_attendance_course, EmailTemplate, + create_template_data_from_course_session_attendance_course, format_swiss_datetime, send_email, ) diff --git a/server/vbv_lernwelt/notify/tests/test_assigment_notifications.py b/server/vbv_lernwelt/notify/tests/test_assigment_notifications.py index d83fb977..ebcd0ec6 100644 --- a/server/vbv_lernwelt/notify/tests/test_assigment_notifications.py +++ b/server/vbv_lernwelt/notify/tests/test_assigment_notifications.py @@ -142,7 +142,7 @@ class TestAssignmentCourseRemindersTest(TestCase): email_template = notification.data["email_template"] # make sure we have the correct email template - if type(action_object) == CourseSessionAssignment: + if action_object is CourseSessionAssignment: assignment_type = AssignmentType( action_object.learning_content.assignment_type ) @@ -157,7 +157,7 @@ class TestAssignmentCourseRemindersTest(TestCase): EmailTemplate.ASSIGNMENT_REMINDER_PREP_ASSIGNMENT_MEMBER.name, email_template, ) - elif type(action_object) == CourseSessionEdoniqTest: + elif action_object is CourseSessionEdoniqTest: self.assertEqual( EmailTemplate.ASSIGNMENT_REMINDER_EDONIQ_MEMBER.name, email_template, diff --git a/server/vbv_lernwelt/notify/tests/test_notify_api.py b/server/vbv_lernwelt/notify/tests/test_notify_api.py index 727841ab..67ac049c 100644 --- a/server/vbv_lernwelt/notify/tests/test_notify_api.py +++ b/server/vbv_lernwelt/notify/tests/test_notify_api.py @@ -61,7 +61,7 @@ class TestNotificationApi(APITestCase): def test_get_all_pagination(self): num_notifications = 322 - for i in range(num_notifications): + for _ in range(num_notifications): NotificationFactory( recipient=self.alice, actor=self.john, @@ -77,7 +77,7 @@ class TestNotificationApi(APITestCase): def test_get_unread_pagination(self): unread_notifications = 120 - for i in range(unread_notifications): + for _ in range(unread_notifications): NotificationFactory( recipient=self.alice, actor=self.john, diff --git a/server/vbv_lernwelt/notify/tests/test_service.py b/server/vbv_lernwelt/notify/tests/test_service.py index 6d8af677..1feb4bad 100644 --- a/server/vbv_lernwelt/notify/tests/test_service.py +++ b/server/vbv_lernwelt/notify/tests/test_service.py @@ -65,9 +65,9 @@ class TestNotificationService(TestCase): self.assertFalse(notification.emailed) def test_send_notification_with_email(self): - self.recipient.additional_json_data[ - "email_notification_categories" - ] = json.dumps(["USER_INTERACTION"]) + self.recipient.additional_json_data["email_notification_categories"] = ( + json.dumps(["USER_INTERACTION"]) + ) self.recipient.save() verb = "Anne hat deinen Auftrag bewertet" @@ -146,9 +146,9 @@ class TestNotificationService(TestCase): self.assertFalse(notification.emailed) # when the email was not sent, yet it will still send it afterwards... - self.recipient.additional_json_data[ - "email_notification_categories" - ] = json.dumps(["USER_INTERACTION"]) + self.recipient.additional_json_data["email_notification_categories"] = ( + json.dumps(["USER_INTERACTION"]) + ) self.recipient.save() result = self.notification_service._send_notification( @@ -188,9 +188,9 @@ class TestNotificationService(TestCase): self.assertFalse(self._has_sent_emails()) # Assert mail is sent if corresponding email notification type is enabled - self.recipient.additional_json_data[ - "email_notification_categories" - ] = json.dumps(["USER_INTERACTION"]) + self.recipient.additional_json_data["email_notification_categories"] = ( + json.dumps(["USER_INTERACTION"]) + ) self.recipient.save() self.notification_service._send_notification( sender=self.sender, diff --git a/server/vbv_lernwelt/self_evaluation_feedback/admin.py b/server/vbv_lernwelt/self_evaluation_feedback/admin.py index acabf04e..628290a6 100644 --- a/server/vbv_lernwelt/self_evaluation_feedback/admin.py +++ b/server/vbv_lernwelt/self_evaluation_feedback/admin.py @@ -7,7 +7,7 @@ from vbv_lernwelt.self_evaluation_feedback.models import ( @admin.register(SelfEvaluationFeedback) -class CourseSessionAdmin(admin.ModelAdmin): +class SelfEvaluationFeedbackAdmin(admin.ModelAdmin): list_display = ( "id", "feedback_submitted", @@ -30,7 +30,7 @@ class CourseSessionAdmin(admin.ModelAdmin): @admin.register(CourseCompletionFeedback) -class CourseSessionAdmin(admin.ModelAdmin): +class CourseCompletionFeedbackAdmin(admin.ModelAdmin): list_display = ( "id", "feedback", diff --git a/server/vbv_lernwelt/self_evaluation_feedback/serializers.py b/server/vbv_lernwelt/self_evaluation_feedback/serializers.py index fd24d363..0c73c3dc 100644 --- a/server/vbv_lernwelt/self_evaluation_feedback/serializers.py +++ b/server/vbv_lernwelt/self_evaluation_feedback/serializers.py @@ -39,9 +39,9 @@ class SelfEvaluationFeedbackSerializer(serializers.ModelSerializer): return obj.learning_unit.get_circle().title def get_criteria(self, obj): - performance_criteria: List[ - PerformanceCriteria - ] = obj.learning_unit.performancecriteria_set.all() + performance_criteria: List[PerformanceCriteria] = ( + obj.learning_unit.performancecriteria_set.all() + ) criteria = [] diff --git a/server/vbv_lernwelt/shop/admin.py b/server/vbv_lernwelt/shop/admin.py index 1bac616e..30b64141 100644 --- a/server/vbv_lernwelt/shop/admin.py +++ b/server/vbv_lernwelt/shop/admin.py @@ -28,7 +28,7 @@ class CheckoutInformationAdmin(admin.ModelAdmin): success = False if not success: self.message_user( - request, f"Beim SFTP upload ist ein Fehler aufgetreten", level="error" + request, "Beim SFTP upload ist ein Fehler aufgetreten", level="error" ) @admin.action(description="Buchungsbestätigung: Bestätigung erneut senden") diff --git a/server/vbv_lernwelt/shop/tests/test_abacus_invoice.py b/server/vbv_lernwelt/shop/tests/test_abacus_invoice.py index 025d0239..b9a83148 100644 --- a/server/vbv_lernwelt/shop/tests/test_abacus_invoice.py +++ b/server/vbv_lernwelt/shop/tests/test_abacus_invoice.py @@ -88,15 +88,15 @@ class AbacusInvoiceTestCase(TestCase): <SalesOrderHeader mode="SAVE"> <SalesOrderHeaderFields mode="SAVE"> <CustomerNumber>60000012</CustomerNumber> - <ProcessFlowNumber>30</ProcessFlowNumber> - <PaymentCode>9999</PaymentCode> + <ProcessFlowNumber>30</ProcessFlowNumber> + <PaymentCode>9999</PaymentCode> <PurchaseOrderDate>2024-02-15</PurchaseOrderDate> - <ReferencePurchaseOrder>24021508331287484</ReferencePurchaseOrder> - <GroupingNumberAscii1>6000000001</GroupingNumberAscii1> + <ReferencePurchaseOrder>24021508331287484</ReferencePurchaseOrder> + <GroupingNumberAscii1>6000000001</GroupingNumberAscii1> </SalesOrderHeaderFields> <Item mode="SAVE"> <ItemFields mode="SAVE"> - <DeliveryDate>2024-02-15</DeliveryDate> + <DeliveryDate>2024-02-15</DeliveryDate> <ItemNumber>1</ItemNumber> <ProductNumber>30202</ProductNumber> <QuantityOrdered>1</QuantityOrdered> diff --git a/server/vbv_lernwelt/shop/tests/test_datatrans_service.py b/server/vbv_lernwelt/shop/tests/test_datatrans_service.py index 7f22c8ee..23e15211 100644 --- a/server/vbv_lernwelt/shop/tests/test_datatrans_service.py +++ b/server/vbv_lernwelt/shop/tests/test_datatrans_service.py @@ -1,13 +1,13 @@ import uuid from unittest.mock import patch -from django.test import override_settings, TestCase +from django.test import TestCase, override_settings from vbv_lernwelt.core.models import User from vbv_lernwelt.shop.services import ( + InitTransactionException, get_payment_url, init_datatrans_transaction, - InitTransactionException, ) REDIRECT_URL = "http://testserver/redirect-url" diff --git a/server/vbv_lernwelt/shop/views.py b/server/vbv_lernwelt/shop/views.py index 94b8ff44..43a1755b 100644 --- a/server/vbv_lernwelt/shop/views.py +++ b/server/vbv_lernwelt/shop/views.py @@ -19,12 +19,12 @@ from vbv_lernwelt.shop.const import ( ) from vbv_lernwelt.shop.models import CheckoutInformation, CheckoutState, Product from vbv_lernwelt.shop.services import ( + InitTransactionException, create_context_data_log, datatrans_state_to_checkout_state, get_payment_url, get_vv_payment_email_template, init_datatrans_transaction, - InitTransactionException, is_signature_valid, ) diff --git a/server/vbv_lernwelt/sso/admin.py b/server/vbv_lernwelt/sso/admin.py index 42dabe9c..01d57e66 100644 --- a/server/vbv_lernwelt/sso/admin.py +++ b/server/vbv_lernwelt/sso/admin.py @@ -1,5 +1,6 @@ from django.contrib import admin, messages -from django.contrib.auth import admin as auth_admin, get_user_model +from django.contrib.auth import admin as auth_admin +from django.contrib.auth import get_user_model from django.utils.translation import gettext_lazy as _ from keycloak.exceptions import KeycloakDeleteError, KeycloakPostError diff --git a/server/vbv_lernwelt/sso/tests/test_role_sync.py b/server/vbv_lernwelt/sso/tests/test_role_sync.py index 4d8ade2c..f01f59ae 100644 --- a/server/vbv_lernwelt/sso/tests/test_role_sync.py +++ b/server/vbv_lernwelt/sso/tests/test_role_sync.py @@ -1,6 +1,6 @@ from unittest.mock import patch -from django.test import override_settings, TestCase +from django.test import TestCase, override_settings from keycloak.exceptions import KeycloakDeleteError, KeycloakPostError from vbv_lernwelt.core.models import User diff --git a/server/vbv_lernwelt/sso/tests/test_sso_flow.py b/server/vbv_lernwelt/sso/tests/test_sso_flow.py index 31c2d4e7..a4f5af6d 100644 --- a/server/vbv_lernwelt/sso/tests/test_sso_flow.py +++ b/server/vbv_lernwelt/sso/tests/test_sso_flow.py @@ -5,7 +5,7 @@ from unittest.mock import ANY, MagicMock, patch from authlib.integrations.base_client import OAuthError from django.shortcuts import redirect -from django.test import override_settings, TestCase +from django.test import TestCase, override_settings from django.urls import reverse from vbv_lernwelt.core.models import User diff --git a/server/vbv_lernwelt/sso/urls.py b/server/vbv_lernwelt/sso/urls.py index 18abdbf2..ba607c3f 100644 --- a/server/vbv_lernwelt/sso/urls.py +++ b/server/vbv_lernwelt/sso/urls.py @@ -1,7 +1,6 @@ from django.urls import path from ..core.middleware.auth import django_view_authentication_exempt - from . import views app_name = "sso" From b862cdeb46d605da888af4b2387079bb0569ad55 Mon Sep 17 00:00:00 2001 From: Daniel Egger <daniel.egger@gmail.com> Date: Tue, 27 Aug 2024 15:19:08 +0200 Subject: [PATCH 2/3] Add ruff package, remove unneeded packages --- bitbucket-pipelines.yml | 3 +- server/requirements/requirements-dev.in | 8 +- server/requirements/requirements-dev.txt | 116 +---------------------- server/setup.cfg | 21 +--- 4 files changed, 9 insertions(+), 139 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 0dcb4cc1..2139d43d 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -64,9 +64,10 @@ python-linting: &python-linting script: - source ./env/bitbucket/prepare_for_test.sh - pip install -r server/requirements/requirements-dev.txt + - ruff check server + - ruff format server --check - git-crypt status -e | sort > git-crypt-encrypted-files-check.txt && diff -w git-crypt-encrypted-files.txt git-crypt-encrypted-files-check.txt - trufflehog --exclude_paths trufflehog-exclude-patterns.txt --allow trufflehog-allow.json --entropy=True --max_depth=100 . - - ufmt check server js-tests: &js-tests name: js tests diff --git a/server/requirements/requirements-dev.in b/server/requirements/requirements-dev.in index 66f2cbdf..6c39d536 100644 --- a/server/requirements/requirements-dev.in +++ b/server/requirements/requirements-dev.in @@ -13,16 +13,10 @@ pytest-xdist # pytest-order djangorestframework-stubs # https://github.com/typeddjango/djangorestframework-stubs - # Code quality # ------------------------------------------------------------------------------ -flake8 # https://github.com/PyCQA/flake8 -flake8-isort # https://github.com/gforcada/flake8-isort coverage # https://github.com/nedbat/coveragepy -black>=22.8.0 # https://github.com/psf/black -pylint-django # https://github.com/PyCQA/pylint-django -pre-commit # https://github.com/pre-commit/pre-commit -ufmt +ruff # Django # ------------------------------------------------------------------------------ diff --git a/server/requirements/requirements-dev.txt b/server/requirements/requirements-dev.txt index a39638bc..103f283d 100644 --- a/server/requirements/requirements-dev.txt +++ b/server/requirements/requirements-dev.txt @@ -20,8 +20,6 @@ argon2-cffi-bindings==21.2.0 # via argon2-cffi asgiref==3.7.2 # via django -astroid==2.15.6 - # via pylint asttokens==2.2.1 # via stack-data async-property==0.2.2 @@ -32,7 +30,6 @@ attrs==23.1.0 # via # jsonschema # referencing - # usort authlib==1.2.1 # via -r requirements.in azure-core==1.29.1 @@ -49,10 +46,6 @@ bcrypt==4.0.1 # via paramiko beautifulsoup4==4.11.2 # via wagtail -black==23.7.0 - # via - # -r requirements-dev.in - # ufmt boto3==1.28.23 # via -r requirements.in botocore==1.31.23 @@ -76,19 +69,13 @@ cffi==1.15.1 # argon2-cffi-bindings # cryptography # pynacl -cfgv==3.3.1 - # via pre-commit charset-normalizer==3.2.0 # via requests click==8.1.6 # via # -r requirements.in - # black # django-click - # moreorless # pip-tools - # ufmt - # usort # uvicorn concurrent-log-handler==0.9.24 # via -r requirements.in @@ -113,10 +100,6 @@ defusedxml==0.7.1 # via willow deprecation==2.1.0 # via python-keycloak -dill==0.3.7 - # via pylint -distlib==0.3.7 - # via virtualenv dj-database-url==2.0.0 # via -r requirements.in django==4.2.13 @@ -223,16 +206,8 @@ factory-boy==3.3.0 # wagtail-factories faker==19.3.0 # via factory-boy -filelock==3.12.2 - # via virtualenv filetype==1.2.0 # via willow -flake8==6.1.0 - # via - # -r requirements-dev.in - # flake8-isort -flake8-isort==6.0.0 - # via -r requirements-dev.in freezegun==1.2.2 # via -r requirements-dev.in gitdb==4.0.10 @@ -268,8 +243,6 @@ httptools==0.6.0 # via uvicorn httpx==0.27.0 # via python-keycloak -identify==2.5.26 - # via pre-commit idna==3.4 # via # anyio @@ -285,10 +258,6 @@ ipython==8.14.0 # via ipdb isodate==0.6.1 # via azure-storage-blob -isort==5.12.0 - # via - # flake8-isort - # pylint jedi==0.19.0 # via ipython jmespath==1.0.1 @@ -305,24 +274,10 @@ jwcrypto==1.5.6 # via python-keycloak l18n==2021.3 # via wagtail -lazy-object-proxy==1.9.0 - # via astroid -libcst==1.0.1 - # via - # ufmt - # usort marshmallow==3.20.1 # via environs matplotlib-inline==0.1.6 # via ipython -mccabe==0.7.0 - # via - # flake8 - # pylint -moreorless==0.4.0 - # via - # ufmt - # usort msal==1.23.0 # via # azure-identity @@ -335,21 +290,15 @@ mypy==1.4.1 # django-stubs # djangorestframework-stubs mypy-extensions==1.0.0 - # via - # black - # mypy - # typing-inspect + # via mypy newrelic==8.11.0 # via -r requirements.in -nodeenv==1.8.0 - # via pre-commit openpyxl==3.1.2 # via # -r requirements.in # wagtail packaging==23.1 # via - # black # build # deprecation # gunicorn @@ -362,10 +311,6 @@ paramiko==3.3.1 # sftpserver parso==0.8.3 # via jedi -pathspec==0.11.2 - # via - # black - # trailrunner pexpect==4.8.0 # via ipython pickleshare==0.7.5 @@ -379,11 +324,6 @@ pillow-heif==0.13.0 # via willow pip-tools==7.3.0 # via -r requirements-dev.in -platformdirs==3.10.0 - # via - # black - # pylint - # virtualenv pluggy==1.2.0 # via pytest polib==1.2.0 @@ -392,8 +332,6 @@ portalocker==2.7.0 # via # concurrent-log-handler # msal-extensions -pre-commit==3.3.3 - # via -r requirements-dev.in promise==2.3 # via graphene-django prompt-toolkit==3.0.39 @@ -404,28 +342,14 @@ ptyprocess==0.7.0 # via pexpect pure-eval==0.2.2 # via stack-data -pycodestyle==2.11.0 - # via flake8 pycparser==2.21 # via cffi pycryptodome==3.18.0 # via -r requirements.in -pyflakes==3.1.0 - # via flake8 pygments==2.16.1 # via ipython pyjwt[crypto]==2.8.0 - # via - # msal - # pyjwt -pylint==2.17.5 - # via - # pylint-django - # pylint-plugin-utils -pylint-django==2.5.3 - # via -r requirements-dev.in -pylint-plugin-utils==0.8.2 - # via pylint-django + # via msal pynacl==1.5.0 # via paramiko pyproject-hooks==1.0.0 @@ -474,8 +398,6 @@ pyyaml==6.0.1 # via # caprover-api # drf-spectacular - # libcst - # pre-commit # uvicorn redis==4.6.0 # via @@ -500,6 +422,8 @@ rpds-py==0.9.2 # via # jsonschema # referencing +ruff==0.6.2 + # via -r requirements-dev.in s3transfer==0.6.1 # via boto3 sendgrid==6.10.0 @@ -533,8 +457,6 @@ stack-data==0.6.2 # via ipython starkbank-ecdsa==2.2.0 # via sendgrid -stdlibs==2022.10.9 - # via usort structlog==23.1.0 # via -r requirements.in swapper==1.3.0 @@ -547,27 +469,15 @@ text-unidecode==1.3 # via # graphene-django # python-slugify -toml==0.10.2 - # via usort tomli==2.0.1 # via - # black # build # django-stubs # ipdb # mypy # pip-tools - # pylint # pyproject-hooks # pytest -tomlkit==0.12.1 - # via - # pylint - # ufmt -trailrunner==1.4.0 - # via - # ufmt - # usort traitlets==5.9.0 # via # ipython @@ -589,7 +499,6 @@ types-urllib3==1.26.25.14 typing-extensions==4.7.1 # via # asgiref - # astroid # azure-core # azure-storage-blob # dj-database-url @@ -597,18 +506,11 @@ typing-extensions==4.7.1 # django-stubs-ext # djangorestframework-stubs # jwcrypto - # libcst # mypy - # typing-inspect - # ufmt # uvicorn # wagtail-localize -typing-inspect==0.9.0 - # via libcst ua-parser==0.18.0 # via -r requirements.in -ufmt==2.2.0 - # via -r requirements-dev.in uritemplate==4.1.1 # via drf-spectacular urllib3==1.26.16 @@ -616,14 +518,10 @@ urllib3==1.26.16 # botocore # requests # sentry-sdk -usort==1.0.7 - # via ufmt uvicorn[standard]==0.23.2 # via -r requirements.in uvloop==0.17.0 # via uvicorn -virtualenv==20.24.2 - # via pre-commit wagtail==5.1 # via # -r requirements.in @@ -652,11 +550,7 @@ wheel==0.41.1 whitenoise[brotli]==6.5.0 # via -r requirements.in willow[heif]==1.6.1 - # via - # wagtail - # willow -wrapt==1.15.0 - # via astroid + # via wagtail # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/server/setup.cfg b/server/setup.cfg index 89bb03c8..64efb619 100644 --- a/server/setup.cfg +++ b/server/setup.cfg @@ -1,24 +1,5 @@ -[flake8] -max-line-length = 120 -exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules,venv - -[pycodestyle] -max-line-length = 120 -exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules,venv - -[isort] -line_length = 88 -known_first_party = vbv_lernwelt,config -multi_line_output = 3 -default_section = THIRDPARTY -skip = venv/ -skip_glob = **/migrations/*.py -include_trailing_comma = true -force_grid_wrap = 0 -use_parentheses = true - [mypy] -python_version = 3.9 +python_version = 3.10 check_untyped_defs = True ignore_missing_imports = True warn_unused_ignores = True From a405c70bf9aad6aab721ded6c0763002e65a309a Mon Sep 17 00:00:00 2001 From: Daniel Egger <daniel.egger@gmail.com> Date: Tue, 27 Aug 2024 15:30:51 +0200 Subject: [PATCH 3/3] Add "prettier-plugin-organize-imports" plugin -> imports got sorted --- client/.prettierrc | 6 ++++- client/package-lock.json | 22 +++++++++++++--- client/src/components/AppFooter.vue | 2 +- .../AssignmentSubmissionProgress.vue | 2 +- .../evaluation/EvaluationContainer.vue | 2 +- .../assignment/evaluation/EvaluationIntro.vue | 2 +- .../evaluation/EvaluationSummary.vue | 2 +- .../assignment/evaluation/EvaluationTask.vue | 2 +- .../cockpit/SubmissionsOverview.vue | 18 ++++++------- .../components/cockpit/UserStatusCount.vue | 2 +- .../dashboard/AgentConnectionCount.vue | 4 +-- .../AssignmentProgressSummaryBox.vue | 4 +-- .../dashboard/AssignmentSummary.vue | 6 ++--- .../dashboard/AssignmentSummaryBox.vue | 2 +- .../dashboard/AttendanceSummaryBox.vue | 2 +- .../dashboard/BerufsbildnerStatistics.vue | 14 +++++----- .../dashboard/CompetenceSummary.vue | 6 ++--- .../src/components/dashboard/CoursePanel.vue | 18 ++++++------- .../dashboard/MentorCompetenceSummary.vue | 6 ++--- .../dashboard/MentorOpenTasksCount.vue | 4 +-- .../dashboard/StatisticFilterList.vue | 4 +-- .../src/components/dashboard/UkStatistics.vue | 12 ++++----- .../dueDates/CourseSessionDueDatesList.vue | 8 +++--- .../src/components/dueDates/DueDateSingle.vue | 4 +-- .../components/header/CoursePreviewBar.vue | 4 +-- .../components/header/MainNavigationBar.vue | 16 ++++++------ client/src/components/header/MobileMenu.vue | 6 ++--- .../learningMentor/AssignmentItem.vue | 2 +- .../components/learningMentor/MyMentees.vue | 4 +-- .../components/learningMentor/MyMentors.vue | 4 +-- .../learningPath/LearningPathDiagram.vue | 4 +-- .../learningPath/SelfEvaluation.vue | 6 ++--- .../assignment/CaseWorkSubmit.vue | 16 ++++++------ .../assignment/PraxisAssignmentSubmit.vue | 14 +++++----- .../learningPath/assignment/SimpleSubmit.vue | 10 +++---- .../DatatransCembraDeviceFingerprint.vue | 2 +- .../onboarding/OrganisationAddress.vue | 2 +- .../components/onboarding/PersonalAddress.vue | 4 +-- .../src/components/onboarding/WizardPage.vue | 2 +- .../components/onboarding/WizardSidePanel.vue | 2 +- .../personalProfile/ProfileEdit.vue | 6 ++--- .../personalProfile/ProfileView.vue | 8 +++--- .../FeedbackByLearningUnitSummary.vue | 4 +-- .../FeedbackProvided.vue | 2 +- .../FeedbackProviderReleaseOverview.vue | 2 +- .../FeedbackReceived.vue | 2 +- .../FeedbackSubmissionProgress.vue | 6 ++--- .../SelfEvaluationAndFeedbackList.vue | 8 +++--- .../SelfEvaluationAndFeedbackOverview.vue | 4 +-- client/src/components/ui/ItCheckbox.vue | 2 +- client/src/components/ui/ItDatePicker.vue | 2 +- client/src/components/ui/RatingScale.vue | 4 +-- client/src/components/ui/RichText.vue | 2 +- client/src/pages/StyleGuidePage.vue | 2 +- .../AssignmentEvaluationPage.vue | 6 ++--- .../pages/cockpit/CockpitUserCirclePage.vue | 4 +-- client/src/pages/cockpit/FeedbackPage.vue | 8 +++--- client/src/pages/cockpit/FeedbackPageUK.vue | 2 +- client/src/pages/cockpit/FeedbackPageVV.vue | 2 +- .../assignmentsPage/AssignmentDetails.vue | 10 +++---- .../assignmentsPage/AssignmentsPage.vue | 6 ++--- .../AttendanceCheckPage.vue | 12 ++++----- .../cockpit/cockpitPage/CockpitExpertPage.vue | 10 +++---- .../cockpit/documentPage/DocumentPage.vue | 18 ++++++------- .../documentPage/DocumentUploadForm.vue | 2 +- .../competence/ActionCompetenceDetail.vue | 4 +-- .../competence/ActionCompetenceListPage.vue | 2 +- .../CompetenceCertificateComponent.vue | 10 +++---- .../CompetenceCertificateDetailPage.vue | 8 +++--- .../CompetenceCertificateListPage.vue | 6 ++--- .../pages/competence/CompetenceIndexPage.vue | 8 +++--- .../pages/competence/CompetenceParentPage.vue | 2 +- .../SelfEvaluationAndFeedbackPage.vue | 2 +- client/src/pages/dashboard/CourseListPage.vue | 2 +- .../pages/dashboard/DashboardAsideWidget.vue | 10 +++---- .../pages/dashboard/DashboardDueDatesPage.vue | 14 +++++----- client/src/pages/dashboard/DashboardPage.vue | 10 +++---- .../pages/dashboard/DashboardPersonsPage.vue | 16 ++++++------ client/src/pages/dashboard/MentorPage.vue | 2 +- client/src/pages/dashboard/ProgressPage.vue | 10 +++---- .../src/pages/dashboard/SimpleCoursePage.vue | 2 +- .../agentAssignment/AgentAssignmentDetail.vue | 4 +-- .../AgentAssignmentDetailPage.vue | 4 +-- .../AgentAssignmentStatisticPage.vue | 10 +++---- .../AgentCompetenceGradeDetailPage.vue | 18 ++++++------- .../AgentCompetenceGradePage.vue | 14 +++++----- .../dashboard/statistic/AssignmentList.vue | 12 ++++----- .../dashboard/statistic/AttendanceList.vue | 12 ++++----- .../dashboard/statistic/CompetenceList.vue | 2 +- .../dashboard/statistic/FeedbackList.vue | 8 +++--- .../learningMentor/mentor/MentorIndexPage.vue | 2 +- .../mentor/MentorOverviewPage.vue | 2 +- .../mentor/MentorParticipantsPage.vue | 4 +-- .../mentor/MentorPraxisAssignmentPage.vue | 4 +-- ...orSelfEvaluationFeedbackAssignmentPage.vue | 2 +- .../mentor/SelfEvaluationFeedbackPage.vue | 8 +++--- .../learningPath/circlePage/CircleDiagram.vue | 2 +- .../circlePage/CircleOverview.vue | 2 +- .../learningPath/circlePage/CirclePage.vue | 18 ++++++------- .../circlePage/DocumentSection.vue | 4 +-- .../circlePage/LearningSequence.vue | 2 +- .../LearningContentContainer.vue | 2 +- .../LearningContentPage.vue | 4 +-- .../LearningContentParent.vue | 8 +++--- .../AssignmentSubmissionResponses.vue | 2 +- .../assignment/AssignmentSubmissionView.vue | 12 ++++----- .../assignment/AssignmentTaskView.vue | 4 +-- .../assignment/AssignmentView.vue | 8 +++--- .../assignment/AttachmentSection.vue | 4 +-- .../attendanceCourse/AttendanceCourse.vue | 2 +- .../blocks/AttendanceCourseBlock.vue | 2 +- .../blocks/DocumentListBlock.vue | 6 ++--- .../blocks/EdoniqTestBlock.vue | 16 ++++++------ .../blocks/PlaceholderBlock.vue | 2 +- .../blocks/RichTextBlock.vue | 2 +- .../feedback/FeedbackBase.vue | 6 ++--- .../feedback/FeedbackBlockUK.vue | 8 +++--- .../feedback/FeedbackBlockVV.vue | 2 +- .../layouts/LearningContentFooter.vue | 2 +- .../layouts/LearningContentMultiLayout.vue | 4 +-- .../layouts/LearningContentSimpleLayout.vue | 4 +-- .../LearningPathCircleListTile.vue | 2 +- .../learningPathPage/LearningPathPage.vue | 22 ++++++++-------- .../LearningPathPathTopic.vue | 2 +- .../learningPathPage/LearningPathPathView.vue | 4 +-- .../selfEvaluationPage/SelfEvaluationPage.vue | 2 +- .../SelfEvaluationRequestFeedbackPage.vue | 12 ++++----- .../mediaLibrary/MediaLibraryCategoryPage.vue | 2 +- .../mediaLibrary/MediaLibraryContentPage.vue | 4 +-- .../mediaLibrary/MediaLibraryIndexPage.vue | 2 +- .../src/pages/onboarding/AccountConfirm.vue | 2 +- .../src/pages/onboarding/AccountProfile.vue | 14 +++++----- client/src/pages/onboarding/AccountSetup.vue | 4 +-- client/src/pages/onboarding/WizardBase.vue | 6 ++--- .../src/pages/onboarding/uk/SetupComplete.vue | 2 +- .../pages/onboarding/vv/CheckoutAddress.vue | 26 +++++++++---------- .../personalProfile/PersonalProfilePage.vue | 2 +- client/src/pages/start/VVStartPage.vue | 2 +- .../userProfile/LearningPathProfilePage.vue | 8 +++--- .../src/pages/userProfile/UserProfilePage.vue | 6 ++--- .../userProfile/UserProfileTopicList.vue | 8 +++--- client/src/services/onboarding.ts | 2 +- .../tests/test_attendance_export.py | 1 - 143 files changed, 441 insertions(+), 422 deletions(-) diff --git a/client/.prettierrc b/client/.prettierrc index ee7239ef..49aec493 100644 --- a/client/.prettierrc +++ b/client/.prettierrc @@ -2,7 +2,11 @@ "htmlWhitespaceSensitivity": "ignore", "jsonRecursiveSort": true, "organizeImportsSkipDestructiveCodeActions": true, - "plugins": ["prettier-plugin-sort-json", "prettier-plugin-tailwindcss"], + "plugins": [ + "prettier-plugin-sort-json", + "prettier-plugin-organize-imports", + "prettier-plugin-tailwindcss" + ], "printWidth": 88, "semi": true, "singleQuote": false, diff --git a/client/package-lock.json b/client/package-lock.json index a46c22ae..78e6e22a 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -5723,6 +5723,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -8258,6 +8259,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -9316,6 +9318,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -9332,6 +9335,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -9385,6 +9389,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } @@ -10330,6 +10335,7 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -11067,6 +11073,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -12666,6 +12673,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -18799,6 +18807,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "requires": { "fill-range": "^7.0.1" } @@ -20659,6 +20668,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -21416,7 +21426,8 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true }, "is-fullwidth-code-point": { "version": "3.0.0", @@ -21427,6 +21438,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -21464,7 +21476,8 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true }, "is-number-object": { "version": "1.0.7", @@ -22162,6 +22175,7 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, "requires": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -22714,7 +22728,8 @@ "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true }, "pify": { "version": "2.3.0", @@ -23810,6 +23825,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "requires": { "is-number": "^7.0.0" } diff --git a/client/src/components/AppFooter.vue b/client/src/components/AppFooter.vue index 958469fb..ae8bdca3 100644 --- a/client/src/components/AppFooter.vue +++ b/client/src/components/AppFooter.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> +import { SUPPORT_LOCALES } from "@/i18nextWrapper"; import type { AvailableLanguages } from "@/stores/user"; import { useUserStore } from "@/stores/user"; import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue"; import * as log from "loglevel"; -import { SUPPORT_LOCALES } from "@/i18nextWrapper"; log.debug("AppFooter created"); diff --git a/client/src/components/assignment/AssignmentSubmissionProgress.vue b/client/src/components/assignment/AssignmentSubmissionProgress.vue index 06e8c72e..c89ee106 100644 --- a/client/src/components/assignment/AssignmentSubmissionProgress.vue +++ b/client/src/components/assignment/AssignmentSubmissionProgress.vue @@ -8,9 +8,9 @@ import type { LearningContentAssignment, LearningContentEdoniqTest, } from "@/types"; +import { stringifyParse } from "@/utils/utils"; import log from "loglevel"; import { computed, onMounted, reactive } from "vue"; -import { stringifyParse } from "@/utils/utils"; const props = defineProps<{ courseSession: CourseSession; diff --git a/client/src/components/assignment/evaluation/EvaluationContainer.vue b/client/src/components/assignment/evaluation/EvaluationContainer.vue index d2c33323..32ddcc08 100644 --- a/client/src/components/assignment/evaluation/EvaluationContainer.vue +++ b/client/src/components/assignment/evaluation/EvaluationContainer.vue @@ -2,6 +2,7 @@ import EvaluationIntro from "@/components/assignment/evaluation/EvaluationIntro.vue"; import EvaluationSummary from "@/components/assignment/evaluation/EvaluationSummary.vue"; import EvaluationTask from "@/components/assignment/evaluation/EvaluationTask.vue"; +import { useCourseSessionDetailQuery } from "@/composables"; import type { Assignment, AssignmentCompletion, @@ -13,7 +14,6 @@ import dayjs from "dayjs"; import { findIndex } from "lodash"; import * as log from "loglevel"; import { computed, onMounted } from "vue"; -import { useCourseSessionDetailQuery } from "@/composables"; const props = defineProps<{ assignmentUser: CourseSessionUser; diff --git a/client/src/components/assignment/evaluation/EvaluationIntro.vue b/client/src/components/assignment/evaluation/EvaluationIntro.vue index 445e2245..75b5b945 100644 --- a/client/src/components/assignment/evaluation/EvaluationIntro.vue +++ b/client/src/components/assignment/evaluation/EvaluationIntro.vue @@ -3,9 +3,9 @@ import { useCurrentCourseSession } from "@/composables"; import { UPSERT_ASSIGNMENT_COMPLETION_MUTATION } from "@/graphql/mutations"; import type { Assignment, AssignmentCompletion, CourseSessionUser } from "@/types"; import { useMutation } from "@urql/vue"; -import { computed } from "vue"; import dayjs, { Dayjs } from "dayjs"; import * as log from "loglevel"; +import { computed } from "vue"; const props = defineProps<{ assignmentUser: CourseSessionUser; diff --git a/client/src/components/assignment/evaluation/EvaluationSummary.vue b/client/src/components/assignment/evaluation/EvaluationSummary.vue index b8d9fceb..44cc26c0 100644 --- a/client/src/components/assignment/evaluation/EvaluationSummary.vue +++ b/client/src/components/assignment/evaluation/EvaluationSummary.vue @@ -1,5 +1,6 @@ <script setup lang="ts"> import ItSuccessAlert from "@/components/ui/ItSuccessAlert.vue"; +import RichText from "@/components/ui/RichText.vue"; import { useCurrentCourseSession } from "@/composables"; import { UPSERT_ASSIGNMENT_COMPLETION_MUTATION } from "@/graphql/mutations"; import { @@ -16,7 +17,6 @@ import { useMutation } from "@urql/vue"; import dayjs, { Dayjs } from "dayjs"; import * as log from "loglevel"; import { computed, reactive } from "vue"; -import RichText from "@/components/ui/RichText.vue"; const props = defineProps<{ assignmentUser: CourseSessionUser; diff --git a/client/src/components/assignment/evaluation/EvaluationTask.vue b/client/src/components/assignment/evaluation/EvaluationTask.vue index 300c3506..74a93ed1 100644 --- a/client/src/components/assignment/evaluation/EvaluationTask.vue +++ b/client/src/components/assignment/evaluation/EvaluationTask.vue @@ -1,5 +1,6 @@ <script setup lang="ts"> import ItTextarea from "@/components/ui/ItTextarea.vue"; +import RichText from "@/components/ui/RichText.vue"; import { useCurrentCourseSession } from "@/composables"; import { UPSERT_ASSIGNMENT_COMPLETION_MUTATION } from "@/graphql/mutations"; import type { @@ -13,7 +14,6 @@ import { useMutation } from "@urql/vue"; import { useDebounceFn } from "@vueuse/core"; import * as log from "loglevel"; import { computed } from "vue"; -import RichText from "@/components/ui/RichText.vue"; const props = defineProps<{ assignmentUser: CourseSessionUser; diff --git a/client/src/components/cockpit/SubmissionsOverview.vue b/client/src/components/cockpit/SubmissionsOverview.vue index be151a42..77578d97 100644 --- a/client/src/components/cockpit/SubmissionsOverview.vue +++ b/client/src/components/cockpit/SubmissionsOverview.vue @@ -1,5 +1,11 @@ <script setup lang="ts"> import AssignmentSubmissionProgress from "@/components/assignment/AssignmentSubmissionProgress.vue"; +import FeedbackSubmissionProgress from "@/components/selfEvaluationFeedback/FeedbackSubmissionProgress.vue"; +import { + useCourseDataWithCompletion, + useCourseSessionDetailQuery, +} from "@/composables"; +import { circleFlatLearningContents } from "@/services/circle"; import type { CourseSession, LearningContent, @@ -7,17 +13,11 @@ import type { // eslint-disable-next-line @typescript-eslint/no-unused-vars LearningContentEdoniqTest, } from "@/types"; +import { learningContentTypeData } from "@/utils/typeMaps"; +import { getCockpitUrl } from "@/utils/utils"; +import { useTranslation } from "i18next-vue"; import log from "loglevel"; import { computed } from "vue"; -import { useTranslation } from "i18next-vue"; -import FeedbackSubmissionProgress from "@/components/selfEvaluationFeedback/FeedbackSubmissionProgress.vue"; -import { learningContentTypeData } from "@/utils/typeMaps"; -import { - useCourseDataWithCompletion, - useCourseSessionDetailQuery, -} from "@/composables"; -import { circleFlatLearningContents } from "@/services/circle"; -import { getCockpitUrl } from "@/utils/utils"; interface Submittable { id: string; diff --git a/client/src/components/cockpit/UserStatusCount.vue b/client/src/components/cockpit/UserStatusCount.vue index 692ace89..abae8e2b 100644 --- a/client/src/components/cockpit/UserStatusCount.vue +++ b/client/src/components/cockpit/UserStatusCount.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> import { useCourseDataWithCompletion } from "@/composables"; -import { computed } from "vue"; import { calcPerformanceCriteriaStatusCount } from "@/services/competence"; +import { computed } from "vue"; const props = defineProps<{ courseSlug: string; diff --git a/client/src/components/dashboard/AgentConnectionCount.vue b/client/src/components/dashboard/AgentConnectionCount.vue index 077b8f87..eca05793 100644 --- a/client/src/components/dashboard/AgentConnectionCount.vue +++ b/client/src/components/dashboard/AgentConnectionCount.vue @@ -1,8 +1,8 @@ <script setup lang="ts"> +import BaseBox from "@/components/dashboard/BaseBox.vue"; +import { fetchMenteeCount } from "@/services/dashboard"; import type { Ref } from "vue"; import { onMounted, ref } from "vue"; -import { fetchMenteeCount } from "@/services/dashboard"; -import BaseBox from "@/components/dashboard/BaseBox.vue"; const props = withDefaults( defineProps<{ diff --git a/client/src/components/dashboard/AssignmentProgressSummaryBox.vue b/client/src/components/dashboard/AssignmentProgressSummaryBox.vue index 07dcd27a..6aaba03e 100644 --- a/client/src/components/dashboard/AssignmentProgressSummaryBox.vue +++ b/client/src/components/dashboard/AssignmentProgressSummaryBox.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> -import { computed } from "vue"; -import ItProgress from "@/components/ui/ItProgress.vue"; import BaseBox from "@/components/dashboard/BaseBox.vue"; +import ItProgress from "@/components/ui/ItProgress.vue"; +import { computed } from "vue"; const props = defineProps<{ detailsLink: string; diff --git a/client/src/components/dashboard/AssignmentSummary.vue b/client/src/components/dashboard/AssignmentSummary.vue index 5ea3c887..0f77d478 100644 --- a/client/src/components/dashboard/AssignmentSummary.vue +++ b/client/src/components/dashboard/AssignmentSummary.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> -import type { Ref } from "vue"; -import { computed, onMounted, ref } from "vue"; +import AssignmentProgressSummaryBox from "@/components/dashboard/AssignmentProgressSummaryBox.vue"; import type { ProgressDashboardAssignmentType } from "@/gql/graphql"; import { fetchProgressData } from "@/services/dashboard"; -import AssignmentProgressSummaryBox from "@/components/dashboard/AssignmentProgressSummaryBox.vue"; +import type { Ref } from "vue"; +import { computed, onMounted, ref } from "vue"; const props = defineProps<{ courseId: string; diff --git a/client/src/components/dashboard/AssignmentSummaryBox.vue b/client/src/components/dashboard/AssignmentSummaryBox.vue index 02d5c334..0c4c4059 100644 --- a/client/src/components/dashboard/AssignmentSummaryBox.vue +++ b/client/src/components/dashboard/AssignmentSummaryBox.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> +import BaseBox from "@/components/dashboard/BaseBox.vue"; import ItProgress from "@/components/ui/ItProgress.vue"; import { computed } from "vue"; -import BaseBox from "@/components/dashboard/BaseBox.vue"; const props = defineProps<{ assignmentsCompleted: number; diff --git a/client/src/components/dashboard/AttendanceSummaryBox.vue b/client/src/components/dashboard/AttendanceSummaryBox.vue index cfed811b..a15cb807 100644 --- a/client/src/components/dashboard/AttendanceSummaryBox.vue +++ b/client/src/components/dashboard/AttendanceSummaryBox.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> +import BaseBox from "@/components/dashboard/BaseBox.vue"; import ItProgress from "@/components/ui/ItProgress.vue"; import { computed } from "vue"; -import BaseBox from "@/components/dashboard/BaseBox.vue"; const props = defineProps<{ daysCompleted: number; diff --git a/client/src/components/dashboard/BerufsbildnerStatistics.vue b/client/src/components/dashboard/BerufsbildnerStatistics.vue index 75aad90b..7f16e879 100644 --- a/client/src/components/dashboard/BerufsbildnerStatistics.vue +++ b/client/src/components/dashboard/BerufsbildnerStatistics.vue @@ -1,15 +1,15 @@ <script setup lang="ts"> -import { computed, onMounted, ref } from "vue"; +import AgentConnectionCount from "@/components/dashboard/AgentConnectionCount.vue"; +import AssignmentSummaryBox from "@/components/dashboard/AssignmentSummaryBox.vue"; +import BaseBox from "@/components/dashboard/BaseBox.vue"; +import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; +import type { BaseStatisticsType } from "@/gql/graphql"; +import { percentToRoundedGrade } from "@/services/assignmentService"; import { type DashboardRoleKeyType, fetchMentorCompetenceSummary, } from "@/services/dashboard"; -import type { BaseStatisticsType } from "@/gql/graphql"; -import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; -import AssignmentSummaryBox from "@/components/dashboard/AssignmentSummaryBox.vue"; -import BaseBox from "@/components/dashboard/BaseBox.vue"; -import { percentToRoundedGrade } from "@/services/assignmentService"; -import AgentConnectionCount from "@/components/dashboard/AgentConnectionCount.vue"; +import { computed, onMounted, ref } from "vue"; const props = defineProps<{ courseSlug: string; diff --git a/client/src/components/dashboard/CompetenceSummary.vue b/client/src/components/dashboard/CompetenceSummary.vue index 2c8c287c..f463d5a9 100644 --- a/client/src/components/dashboard/CompetenceSummary.vue +++ b/client/src/components/dashboard/CompetenceSummary.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> +import CompetenceSummaryBox from "@/components/dashboard/CompetenceSummaryBox.vue"; +import type { ProgressDashboardCompetenceType } from "@/gql/graphql"; +import { fetchProgressData } from "@/services/dashboard"; import type { Ref } from "vue"; import { computed, onMounted, ref } from "vue"; -import type { ProgressDashboardCompetenceType } from "@/gql/graphql"; -import CompetenceSummaryBox from "@/components/dashboard/CompetenceSummaryBox.vue"; -import { fetchProgressData } from "@/services/dashboard"; const props = defineProps<{ courseId: string; diff --git a/client/src/components/dashboard/CoursePanel.vue b/client/src/components/dashboard/CoursePanel.vue index 73549811..b73210f3 100644 --- a/client/src/components/dashboard/CoursePanel.vue +++ b/client/src/components/dashboard/CoursePanel.vue @@ -1,15 +1,15 @@ <script setup lang="ts"> -import { computed } from "vue"; -import type { DashboardCourseConfigType, WidgetType } from "@/services/dashboard"; -import LearningPathDiagram from "@/components/learningPath/LearningPathDiagram.vue"; -import CompetenceSummary from "@/components/dashboard/CompetenceSummary.vue"; -import AssignmentSummary from "@/components/dashboard/AssignmentSummary.vue"; -import MentorOpenTasksCount from "@/components/dashboard/MentorOpenTasksCount.vue"; import AgentConnectionCount from "@/components/dashboard/AgentConnectionCount.vue"; -import MentorCompetenceSummary from "@/components/dashboard/MentorCompetenceSummary.vue"; -import { getCockpitUrl, getLearningMentorUrl, getLearningPathUrl } from "@/utils/utils"; -import UkStatistics from "@/components/dashboard/UkStatistics.vue"; +import AssignmentSummary from "@/components/dashboard/AssignmentSummary.vue"; import BerufsbildnerStatistics from "@/components/dashboard/BerufsbildnerStatistics.vue"; +import CompetenceSummary from "@/components/dashboard/CompetenceSummary.vue"; +import MentorCompetenceSummary from "@/components/dashboard/MentorCompetenceSummary.vue"; +import MentorOpenTasksCount from "@/components/dashboard/MentorOpenTasksCount.vue"; +import UkStatistics from "@/components/dashboard/UkStatistics.vue"; +import LearningPathDiagram from "@/components/learningPath/LearningPathDiagram.vue"; +import type { DashboardCourseConfigType, WidgetType } from "@/services/dashboard"; +import { getCockpitUrl, getLearningMentorUrl, getLearningPathUrl } from "@/utils/utils"; +import { computed } from "vue"; const mentorWidgets = [ "MentorTasksWidget", diff --git a/client/src/components/dashboard/MentorCompetenceSummary.vue b/client/src/components/dashboard/MentorCompetenceSummary.vue index c515a27d..d9983090 100644 --- a/client/src/components/dashboard/MentorCompetenceSummary.vue +++ b/client/src/components/dashboard/MentorCompetenceSummary.vue @@ -1,11 +1,11 @@ <script setup lang="ts"> -import { computed, onMounted, ref } from "vue"; +import BaseBox from "@/components/dashboard/BaseBox.vue"; +import type { BaseStatisticsType } from "@/gql/graphql"; import { type DashboardRoleKeyType, fetchMentorCompetenceSummary, } from "@/services/dashboard"; -import type { BaseStatisticsType } from "@/gql/graphql"; -import BaseBox from "@/components/dashboard/BaseBox.vue"; +import { computed, onMounted, ref } from "vue"; const props = defineProps<{ courseId: string; diff --git a/client/src/components/dashboard/MentorOpenTasksCount.vue b/client/src/components/dashboard/MentorOpenTasksCount.vue index 95014ec8..6a3337f9 100644 --- a/client/src/components/dashboard/MentorOpenTasksCount.vue +++ b/client/src/components/dashboard/MentorOpenTasksCount.vue @@ -1,8 +1,8 @@ <script setup lang="ts"> +import BaseBox from "@/components/dashboard/BaseBox.vue"; +import { fetchOpenTasksCount } from "@/services/dashboard"; import type { Ref } from "vue"; import { onMounted, ref } from "vue"; -import { fetchOpenTasksCount } from "@/services/dashboard"; -import BaseBox from "@/components/dashboard/BaseBox.vue"; const props = defineProps<{ courseId: string; diff --git a/client/src/components/dashboard/StatisticFilterList.vue b/client/src/components/dashboard/StatisticFilterList.vue index e6e6247d..c37ab89c 100644 --- a/client/src/components/dashboard/StatisticFilterList.vue +++ b/client/src/components/dashboard/StatisticFilterList.vue @@ -1,10 +1,10 @@ <script setup lang="ts"> -import { computed, ref, watch } from "vue"; import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; -import { useTranslation } from "i18next-vue"; import type { StatisticsCourseSessionPropertiesType } from "@/gql/graphql"; import type { StatisticsFilterItem } from "@/types"; +import { useTranslation } from "i18next-vue"; import _ from "lodash"; +import { computed, ref, watch } from "vue"; const { t } = useTranslation(); diff --git a/client/src/components/dashboard/UkStatistics.vue b/client/src/components/dashboard/UkStatistics.vue index 2afd5e48..7f26191c 100644 --- a/client/src/components/dashboard/UkStatistics.vue +++ b/client/src/components/dashboard/UkStatistics.vue @@ -1,12 +1,12 @@ <script setup lang="ts"> +import AssignmentSummaryBox from "@/components/dashboard/AssignmentSummaryBox.vue"; +import AttendanceSummaryBox from "@/components/dashboard/AttendanceSummaryBox.vue"; +import CompetenceSummaryBox from "@/components/dashboard/CompetenceSummaryBox.vue"; +import FeedbackSummaryBox from "@/components/dashboard/FeedbackSummaryBox.vue"; +import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; +import type { CourseStatisticsType } from "@/gql/graphql"; import { useDashboardStore } from "@/stores/dashboard"; import { computed, onMounted, ref } from "vue"; -import AttendanceSummaryBox from "@/components/dashboard/AttendanceSummaryBox.vue"; -import type { CourseStatisticsType } from "@/gql/graphql"; -import AssignmentSummaryBox from "@/components/dashboard/AssignmentSummaryBox.vue"; -import FeedbackSummaryBox from "@/components/dashboard/FeedbackSummaryBox.vue"; -import CompetenceSummaryBox from "@/components/dashboard/CompetenceSummaryBox.vue"; -import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; const props = defineProps<{ courseId: string; diff --git a/client/src/components/dueDates/CourseSessionDueDatesList.vue b/client/src/components/dueDates/CourseSessionDueDatesList.vue index da5f469a..cb32e64c 100644 --- a/client/src/components/dueDates/CourseSessionDueDatesList.vue +++ b/client/src/components/dueDates/CourseSessionDueDatesList.vue @@ -1,9 +1,9 @@ <script lang="ts" setup> -import { useDashboardPersonsDueDates } from "@/composables"; -import { computed } from "vue"; -import _ from "lodash"; -import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; import DueDateSingle from "@/components/dueDates/DueDateSingle.vue"; +import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; +import { useDashboardPersonsDueDates } from "@/composables"; +import _ from "lodash"; +import { computed } from "vue"; const props = withDefaults( defineProps<{ diff --git a/client/src/components/dueDates/DueDateSingle.vue b/client/src/components/dueDates/DueDateSingle.vue index ce068271..d111319d 100644 --- a/client/src/components/dueDates/DueDateSingle.vue +++ b/client/src/components/dueDates/DueDateSingle.vue @@ -1,8 +1,8 @@ <script lang="ts" setup> -import { useTranslation } from "i18next-vue"; import type { DashboardDueDate } from "@/services/dashboard"; -import { computed } from "vue"; import dayjs from "dayjs"; +import { useTranslation } from "i18next-vue"; +import { computed } from "vue"; const props = defineProps<{ dueDate: DashboardDueDate; diff --git a/client/src/components/header/CoursePreviewBar.vue b/client/src/components/header/CoursePreviewBar.vue index fbdc425f..1e7bc3ba 100644 --- a/client/src/components/header/CoursePreviewBar.vue +++ b/client/src/components/header/CoursePreviewBar.vue @@ -1,8 +1,8 @@ <script setup lang="ts"> -import { useTranslation } from "i18next-vue"; -import { useRouteLookups } from "@/utils/route"; import { useCurrentCourseSession } from "@/composables"; +import { useRouteLookups } from "@/utils/route"; import { getCompetenceNaviUrl, getLearningPathUrl } from "@/utils/utils"; +import { useTranslation } from "i18next-vue"; const { inCompetenceProfile, inLearningPath } = useRouteLookups(); const courseSession = useCurrentCourseSession(); diff --git a/client/src/components/header/MainNavigationBar.vue b/client/src/components/header/MainNavigationBar.vue index 14cb45ca..9a855115 100644 --- a/client/src/components/header/MainNavigationBar.vue +++ b/client/src/components/header/MainNavigationBar.vue @@ -1,20 +1,16 @@ <script setup lang="ts"> -import log from "loglevel"; -import { getLoginURL } from "@/router/utils"; import AccountMenu from "@/components/header/AccountMenu.vue"; +import CoursePreviewBar from "@/components/header/CoursePreviewBar.vue"; import MobileMenu from "@/components/header/MobileMenu.vue"; import NotificationPopover from "@/components/notifications/NotificationPopover.vue"; import NotificationPopoverContent from "@/components/notifications/NotificationPopoverContent.vue"; import ItFullScreenModal from "@/components/ui/ItFullScreenModal.vue"; +import { useVVByLink } from "@/composables"; +import { getLoginURL } from "@/router/utils"; import { useCourseSessionsStore } from "@/stores/courseSessions"; import { useNotificationsStore } from "@/stores/notifications"; import { useUserStore } from "@/stores/user"; import { useRouteLookups } from "@/utils/route"; -import { Popover, PopoverButton, PopoverPanel } from "@headlessui/vue"; -import { breakpointsTailwind, useBreakpoints } from "@vueuse/core"; -import { computed, onMounted, reactive } from "vue"; -import { useTranslation } from "i18next-vue"; -import CoursePreviewBar from "@/components/header/CoursePreviewBar.vue"; import { getCockpitUrl, getCompetenceNaviUrl, @@ -23,7 +19,11 @@ import { getMediaCenterUrl, isVVLearningMentor, } from "@/utils/utils"; -import { useVVByLink } from "@/composables"; +import { Popover, PopoverButton, PopoverPanel } from "@headlessui/vue"; +import { breakpointsTailwind, useBreakpoints } from "@vueuse/core"; +import { useTranslation } from "i18next-vue"; +import log from "loglevel"; +import { computed, onMounted, reactive } from "vue"; log.debug("MainNavigationBar created"); diff --git a/client/src/components/header/MobileMenu.vue b/client/src/components/header/MobileMenu.vue index 24fa9d8c..ccc6bf77 100644 --- a/client/src/components/header/MobileMenu.vue +++ b/client/src/components/header/MobileMenu.vue @@ -1,8 +1,9 @@ <script setup lang="ts"> import ItFullScreenModal from "@/components/ui/ItFullScreenModal.vue"; +import { useVVByLink } from "@/composables"; +import { useCourseSessionsStore } from "@/stores/courseSessions"; import type { User } from "@/stores/user"; import type { CourseSession } from "@/types"; -import { useRouter } from "vue-router"; import { getCockpitUrl, getCompetenceNaviUrl, @@ -12,8 +13,7 @@ import { isVVLearningMentor, } from "@/utils/utils"; import { computed } from "vue"; -import { useCourseSessionsStore } from "@/stores/courseSessions"; -import { useVVByLink } from "@/composables"; +import { useRouter } from "vue-router"; const router = useRouter(); diff --git a/client/src/components/learningMentor/AssignmentItem.vue b/client/src/components/learningMentor/AssignmentItem.vue index c11fa437..d2eb9d6e 100644 --- a/client/src/components/learningMentor/AssignmentItem.vue +++ b/client/src/components/learningMentor/AssignmentItem.vue @@ -1,6 +1,6 @@ <script setup lang="ts"> -import type { RouteLocationRaw } from "vue-router"; import { computed } from "vue"; +import type { RouteLocationRaw } from "vue-router"; const props = defineProps<{ taskTitle: string; diff --git a/client/src/components/learningMentor/MyMentees.vue b/client/src/components/learningMentor/MyMentees.vue index c90a57ce..ee2b229c 100644 --- a/client/src/components/learningMentor/MyMentees.vue +++ b/client/src/components/learningMentor/MyMentees.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> -import { useLearningMentees } from "@/services/learningMentees"; +import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; import { useCurrentCourseSession } from "@/composables"; import { useCSRFFetch } from "@/fetchHelpers"; +import { useLearningMentees } from "@/services/learningMentees"; import { computed } from "vue"; -import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; const courseSession = useCurrentCourseSession(); const { isLoading, summary, fetchData } = useLearningMentees(courseSession.value.id); diff --git a/client/src/components/learningMentor/MyMentors.vue b/client/src/components/learningMentor/MyMentors.vue index 85941cc6..efbf6914 100644 --- a/client/src/components/learningMentor/MyMentors.vue +++ b/client/src/components/learningMentor/MyMentors.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> -import { useCurrentCourseSession } from "@/composables"; import ItModal from "@/components/ui/ItModal.vue"; -import { computed, ref } from "vue"; +import { useCurrentCourseSession } from "@/composables"; import { useCSRFFetch } from "@/fetchHelpers"; import { useUserStore } from "@/stores/user"; +import { computed, ref } from "vue"; const courseSession = useCurrentCourseSession(); diff --git a/client/src/components/learningPath/LearningPathDiagram.vue b/client/src/components/learningPath/LearningPathDiagram.vue index f3129073..94ae34e3 100644 --- a/client/src/components/learningPath/LearningPathDiagram.vue +++ b/client/src/components/learningPath/LearningPathDiagram.vue @@ -1,4 +1,6 @@ <script setup lang="ts"> +import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; +import { useCourseCircleProgress, useCourseDataWithCompletion } from "@/composables"; import LearningPathCircle from "@/pages/learningPath/learningPathPage/LearningPathCircle.vue"; import { calculateCircleSectorData, @@ -6,8 +8,6 @@ import { useCourseFilter, } from "@/pages/learningPath/learningPathPage/utils"; import { computed } from "vue"; -import { useCourseCircleProgress, useCourseDataWithCompletion } from "@/composables"; -import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; export type DiagramType = "horizontal" | "horizontalSmall" | "singleSmall"; diff --git a/client/src/components/learningPath/SelfEvaluation.vue b/client/src/components/learningPath/SelfEvaluation.vue index 5f8f5847..195361ed 100644 --- a/client/src/components/learningPath/SelfEvaluation.vue +++ b/client/src/components/learningPath/SelfEvaluation.vue @@ -11,12 +11,12 @@ import * as log from "loglevel"; import { useCourseDataWithCompletion, useCurrentCourseSession } from "@/composables"; import LearningContentContainer from "@/pages/learningPath/learningContentPage/LearningContentContainer.vue"; import LearningContentMultiLayout from "@/pages/learningPath/learningContentPage/layouts/LearningContentMultiLayout.vue"; +import SelfEvaluationRequestFeedbackPage from "@/pages/learningPath/selfEvaluationPage/SelfEvaluationRequestFeedbackPage.vue"; +import { getPreviousRoute } from "@/router/history"; import eventBus from "@/utils/eventBus"; +import { getCompetenceNaviUrl } from "@/utils/utils"; import { useRouteQuery } from "@vueuse/router"; import { computed, onUnmounted } from "vue"; -import { getPreviousRoute } from "@/router/history"; -import { getCompetenceNaviUrl } from "@/utils/utils"; -import SelfEvaluationRequestFeedbackPage from "@/pages/learningPath/selfEvaluationPage/SelfEvaluationRequestFeedbackPage.vue"; log.debug("LearningContent.vue setup"); diff --git a/client/src/components/learningPath/assignment/CaseWorkSubmit.vue b/client/src/components/learningPath/assignment/CaseWorkSubmit.vue index 6362660f..261568da 100644 --- a/client/src/components/learningPath/assignment/CaseWorkSubmit.vue +++ b/client/src/components/learningPath/assignment/CaseWorkSubmit.vue @@ -1,17 +1,17 @@ <script setup lang="ts"> -import ItCheckbox from "@/components/ui/ItCheckbox.vue"; -import { computed, reactive } from "vue"; -import type { CourseSessionUserObjectsType } from "@/gql/graphql"; -import dayjs from "dayjs"; import DateEmbedding from "@/components/dueDates/DateEmbedding.vue"; import ItButton from "@/components/ui/ItButton.vue"; -import { useMutation } from "@urql/vue"; +import ItCheckbox from "@/components/ui/ItCheckbox.vue"; +import { bustItGetCache } from "@/fetchHelpers"; +import type { CourseSessionUserObjectsType } from "@/gql/graphql"; import { UPSERT_ASSIGNMENT_COMPLETION_MUTATION } from "@/graphql/mutations"; import { useUserStore } from "@/stores/user"; -import { bustItGetCache } from "@/fetchHelpers"; -import eventBus from "@/utils/eventBus"; -import log from "loglevel"; import type { Assignment } from "@/types"; +import eventBus from "@/utils/eventBus"; +import { useMutation } from "@urql/vue"; +import dayjs from "dayjs"; +import log from "loglevel"; +import { computed, reactive } from "vue"; const props = defineProps<{ evaluationDocumentUrl: string; diff --git a/client/src/components/learningPath/assignment/PraxisAssignmentSubmit.vue b/client/src/components/learningPath/assignment/PraxisAssignmentSubmit.vue index 65486a0c..a8f0c559 100644 --- a/client/src/components/learningPath/assignment/PraxisAssignmentSubmit.vue +++ b/client/src/components/learningPath/assignment/PraxisAssignmentSubmit.vue @@ -1,20 +1,20 @@ <script setup lang="ts"> import ItButton from "@/components/ui/ItButton.vue"; import ItCheckbox from "@/components/ui/ItCheckbox.vue"; -import { ref } from "vue"; import { bustItGetCache } from "@/fetchHelpers"; import { useUserStore } from "@/stores/user"; import eventBus from "@/utils/eventBus"; -import log from "loglevel"; import dayjs from "dayjs"; +import log from "loglevel"; +import { ref } from "vue"; -import { useMutation } from "@urql/vue"; +import SampleSolution from "@/components/assignment/SampleSolution.vue"; +import DateEmbedding from "@/components/dueDates/DateEmbedding.vue"; +import NoMentorInformationPanel from "@/components/learningMentor/NoMentorInformationPanel.vue"; +import { useMyLearningMentors } from "@/composables"; import { UPSERT_ASSIGNMENT_COMPLETION_MUTATION } from "@/graphql/mutations"; import type { Assignment } from "@/types"; -import DateEmbedding from "@/components/dueDates/DateEmbedding.vue"; -import { useMyLearningMentors } from "@/composables"; -import NoMentorInformationPanel from "@/components/learningMentor/NoMentorInformationPanel.vue"; -import SampleSolution from "@/components/assignment/SampleSolution.vue"; +import { useMutation } from "@urql/vue"; const props = defineProps<{ submissionDeadlineStart?: string | null; diff --git a/client/src/components/learningPath/assignment/SimpleSubmit.vue b/client/src/components/learningPath/assignment/SimpleSubmit.vue index 3422d712..fbb4955d 100644 --- a/client/src/components/learningPath/assignment/SimpleSubmit.vue +++ b/client/src/components/learningPath/assignment/SimpleSubmit.vue @@ -1,14 +1,14 @@ <script setup lang="ts"> import ItButton from "@/components/ui/ItButton.vue"; import ItCheckbox from "@/components/ui/ItCheckbox.vue"; -import { ref } from "vue"; import { bustItGetCache } from "@/fetchHelpers"; -import { useUserStore } from "@/stores/user"; -import eventBus from "@/utils/eventBus"; -import log from "loglevel"; -import { useMutation } from "@urql/vue"; import { UPSERT_ASSIGNMENT_COMPLETION_MUTATION } from "@/graphql/mutations"; +import { useUserStore } from "@/stores/user"; import type { Assignment } from "@/types"; +import eventBus from "@/utils/eventBus"; +import { useMutation } from "@urql/vue"; +import log from "loglevel"; +import { ref } from "vue"; const props = defineProps<{ courseSessionId: string; diff --git a/client/src/components/onboarding/DatatransCembraDeviceFingerprint.vue b/client/src/components/onboarding/DatatransCembraDeviceFingerprint.vue index 6ccb9de2..f70cd58a 100644 --- a/client/src/components/onboarding/DatatransCembraDeviceFingerprint.vue +++ b/client/src/components/onboarding/DatatransCembraDeviceFingerprint.vue @@ -9,8 +9,8 @@ </template> <script> -import { ref, computed, onMounted } from "vue"; import { getLocalSessionKey } from "@/statistics"; +import { computed, onMounted, ref } from "vue"; export default { // code needed for Datatrans/Cembra device fingerprinting diff --git a/client/src/components/onboarding/OrganisationAddress.vue b/client/src/components/onboarding/OrganisationAddress.vue index e56e33cd..44a995f8 100644 --- a/client/src/components/onboarding/OrganisationAddress.vue +++ b/client/src/components/onboarding/OrganisationAddress.vue @@ -1,6 +1,6 @@ <script setup lang="ts"> -import { computed } from "vue"; import { useEntities } from "@/services/entities"; +import { computed } from "vue"; const props = defineProps<{ modelValue: { diff --git a/client/src/components/onboarding/PersonalAddress.vue b/client/src/components/onboarding/PersonalAddress.vue index 3425afeb..9cbf1d9f 100644 --- a/client/src/components/onboarding/PersonalAddress.vue +++ b/client/src/components/onboarding/PersonalAddress.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> -import { computed } from "vue"; +import ItDatePicker from "@/components/ui/ItDatePicker.vue"; import { useEntities } from "@/services/entities"; import "@vuepic/vue-datepicker/dist/main.css"; import { t } from "i18next"; -import ItDatePicker from "@/components/ui/ItDatePicker.vue"; +import { computed } from "vue"; const props = defineProps<{ modelValue: { diff --git a/client/src/components/onboarding/WizardPage.vue b/client/src/components/onboarding/WizardPage.vue index cbafd525..76cf9774 100644 --- a/client/src/components/onboarding/WizardPage.vue +++ b/client/src/components/onboarding/WizardPage.vue @@ -1,8 +1,8 @@ <script setup lang="ts"> import ItNavigationProgress from "@/components/ui/ItNavigationProgress.vue"; +import { isString, startsWith } from "lodash"; import { computed } from "vue"; import { useRoute } from "vue-router"; -import { isString, startsWith } from "lodash"; const route = useRoute(); const props = defineProps<{ diff --git a/client/src/components/onboarding/WizardSidePanel.vue b/client/src/components/onboarding/WizardSidePanel.vue index 38827e62..ebf591cb 100644 --- a/client/src/components/onboarding/WizardSidePanel.vue +++ b/client/src/components/onboarding/WizardSidePanel.vue @@ -1,8 +1,8 @@ <script setup lang="ts"> import { SUPPORT_LOCALES } from "@/i18nextWrapper"; -import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue"; import type { AvailableLanguages } from "@/stores/user"; import { useUserStore } from "@/stores/user"; +import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue"; const props = defineProps<{ courseName: string; diff --git a/client/src/components/personalProfile/ProfileEdit.vue b/client/src/components/personalProfile/ProfileEdit.vue index 398e363a..0b29e004 100644 --- a/client/src/components/personalProfile/ProfileEdit.vue +++ b/client/src/components/personalProfile/ProfileEdit.vue @@ -1,10 +1,10 @@ <script setup lang="ts"> -import { useEntities } from "@/services/entities"; import AvatarImage from "@/components/ui/AvatarImage.vue"; -import { ref } from "vue"; -import { type User, useUserStore } from "@/stores/user"; import ItDatePicker from "@/components/ui/ItDatePicker.vue"; +import { useEntities } from "@/services/entities"; +import { type User, useUserStore } from "@/stores/user"; import { normalizeSwissPhoneNumber } from "@/utils/phone"; +import { ref } from "vue"; const emit = defineEmits(["cancel", "save"]); diff --git a/client/src/components/personalProfile/ProfileView.vue b/client/src/components/personalProfile/ProfileView.vue index ac2e494c..a5b10fb8 100644 --- a/client/src/components/personalProfile/ProfileView.vue +++ b/client/src/components/personalProfile/ProfileView.vue @@ -1,10 +1,10 @@ <script setup lang="ts"> -import { useUserStore } from "@/stores/user"; -import { computed } from "vue"; import { useEntities } from "@/services/entities"; -import { useTranslation } from "i18next-vue"; -import dayjs from "dayjs"; +import { useUserStore } from "@/stores/user"; import { displaySwissPhoneNumber } from "@/utils/phone"; +import dayjs from "dayjs"; +import { useTranslation } from "i18next-vue"; +import { computed } from "vue"; const { t } = useTranslation(); diff --git a/client/src/components/selfEvaluationFeedback/FeedbackByLearningUnitSummary.vue b/client/src/components/selfEvaluationFeedback/FeedbackByLearningUnitSummary.vue index 893e5be3..5d846ccc 100644 --- a/client/src/components/selfEvaluationFeedback/FeedbackByLearningUnitSummary.vue +++ b/client/src/components/selfEvaluationFeedback/FeedbackByLearningUnitSummary.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> -import { computed } from "vue"; -import type { LearningUnitSummary } from "@/services/selfEvaluationFeedback"; import SmileyCell from "@/components/selfEvaluationFeedback/SmileyCell.vue"; +import type { LearningUnitSummary } from "@/services/selfEvaluationFeedback"; +import { computed } from "vue"; const props = defineProps<{ summary: LearningUnitSummary; diff --git a/client/src/components/selfEvaluationFeedback/FeedbackProvided.vue b/client/src/components/selfEvaluationFeedback/FeedbackProvided.vue index f8346fed..d1eb526a 100644 --- a/client/src/components/selfEvaluationFeedback/FeedbackProvided.vue +++ b/client/src/components/selfEvaluationFeedback/FeedbackProvided.vue @@ -1,11 +1,11 @@ <script setup lang="ts"> -import { computed } from "vue"; import { type FeedbackRequest, getFeedbackEvaluationCaption, getSelfEvaluationCaption, getSmiley, } from "@/services/selfEvaluationFeedback"; +import { computed } from "vue"; const props = defineProps<{ feedback: FeedbackRequest; diff --git a/client/src/components/selfEvaluationFeedback/FeedbackProviderReleaseOverview.vue b/client/src/components/selfEvaluationFeedback/FeedbackProviderReleaseOverview.vue index c92dcd7c..a8bd8abc 100644 --- a/client/src/components/selfEvaluationFeedback/FeedbackProviderReleaseOverview.vue +++ b/client/src/components/selfEvaluationFeedback/FeedbackProviderReleaseOverview.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> -import type { FeedbackRequest } from "@/services/selfEvaluationFeedback"; import FeedbackProvided from "@/components/selfEvaluationFeedback/FeedbackProvided.vue"; import ItButton from "@/components/ui/ItButton.vue"; +import type { FeedbackRequest } from "@/services/selfEvaluationFeedback"; defineProps<{ feedback: FeedbackRequest; diff --git a/client/src/components/selfEvaluationFeedback/FeedbackReceived.vue b/client/src/components/selfEvaluationFeedback/FeedbackReceived.vue index eedffca1..6983c05c 100644 --- a/client/src/components/selfEvaluationFeedback/FeedbackReceived.vue +++ b/client/src/components/selfEvaluationFeedback/FeedbackReceived.vue @@ -1,11 +1,11 @@ <script setup lang="ts"> -import { computed } from "vue"; import { type FeedbackRequest, getFeedbackReceivedCaption, getSelfEvaluationCaption, getSmiley, } from "@/services/selfEvaluationFeedback"; +import { computed } from "vue"; const props = defineProps<{ feedback: FeedbackRequest; diff --git a/client/src/components/selfEvaluationFeedback/FeedbackSubmissionProgress.vue b/client/src/components/selfEvaluationFeedback/FeedbackSubmissionProgress.vue index 259d4b3f..7cd7dd31 100644 --- a/client/src/components/selfEvaluationFeedback/FeedbackSubmissionProgress.vue +++ b/client/src/components/selfEvaluationFeedback/FeedbackSubmissionProgress.vue @@ -1,10 +1,10 @@ <script setup lang="ts"> +import ItProgress from "@/components/ui/ItProgress.vue"; +import { useCourseSessionDetailQuery } from "@/composables"; +import { itGet } from "@/fetchHelpers"; import type { CourseSession } from "@/types"; import log from "loglevel"; import { computed, onMounted, ref } from "vue"; -import ItProgress from "@/components/ui/ItProgress.vue"; -import { itGet } from "@/fetchHelpers"; -import { useCourseSessionDetailQuery } from "@/composables"; const props = defineProps<{ courseSession: CourseSession; diff --git a/client/src/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackList.vue b/client/src/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackList.vue index 0297bb96..3b4f33a6 100644 --- a/client/src/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackList.vue +++ b/client/src/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackList.vue @@ -1,11 +1,11 @@ <script setup lang="ts"> -import { useSelfEvaluationFeedbackSummaries } from "@/services/selfEvaluationFeedback"; -import { useCurrentCourseSession, useEvaluationWithFeedback } from "@/composables"; -import { computed, ref } from "vue"; import FeedbackByLearningUnitSummary from "@/components/selfEvaluationFeedback/FeedbackByLearningUnitSummary.vue"; import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; -import { t } from "i18next"; +import { useCurrentCourseSession, useEvaluationWithFeedback } from "@/composables"; +import { useSelfEvaluationFeedbackSummaries } from "@/services/selfEvaluationFeedback"; import { useUserStore } from "@/stores/user"; +import { t } from "i18next"; +import { computed, ref } from "vue"; const props = defineProps<{ profileUserId: string; diff --git a/client/src/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackOverview.vue b/client/src/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackOverview.vue index 55074c29..72372bdc 100644 --- a/client/src/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackOverview.vue +++ b/client/src/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackOverview.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> -import { computed } from "vue"; -import { useSelfEvaluationFeedbackSummaries } from "@/services/selfEvaluationFeedback"; import { useCurrentCourseSession, useEvaluationWithFeedback } from "@/composables"; +import { useSelfEvaluationFeedbackSummaries } from "@/services/selfEvaluationFeedback"; +import { computed } from "vue"; const emit = defineEmits(["showAll"]); diff --git a/client/src/components/ui/ItCheckbox.vue b/client/src/components/ui/ItCheckbox.vue index db9f9525..b55bd047 100644 --- a/client/src/components/ui/ItCheckbox.vue +++ b/client/src/components/ui/ItCheckbox.vue @@ -1,10 +1,10 @@ <script setup lang="ts"> import type { CheckboxItem } from "@/components/ui/checkbox.types"; -import log from "loglevel"; import { itCheckboxDefaultIconCheckedTailwindClass, itCheckboxDefaultIconUncheckedTailwindClass, } from "@/constants"; +import log from "loglevel"; interface Props { checkboxItem: CheckboxItem<any>; diff --git a/client/src/components/ui/ItDatePicker.vue b/client/src/components/ui/ItDatePicker.vue index 4c44f46d..777cac48 100644 --- a/client/src/components/ui/ItDatePicker.vue +++ b/client/src/components/ui/ItDatePicker.vue @@ -2,7 +2,7 @@ import { useUserStore } from "@/stores/user"; import VueDatePicker from "@vuepic/vue-datepicker"; import "@vuepic/vue-datepicker/dist/main.css"; -import { defineProps, withDefaults, defineModel } from "vue"; +import { defineModel, defineProps, withDefaults } from "vue"; const model = defineModel<string>(); diff --git a/client/src/components/ui/RatingScale.vue b/client/src/components/ui/RatingScale.vue index 07b0d9f3..dc9617e3 100644 --- a/client/src/components/ui/RatingScale.vue +++ b/client/src/components/ui/RatingScale.vue @@ -73,11 +73,11 @@ <script setup lang="ts"> import QuestionSummary from "@/components/ui/QuestionSummary.vue"; +import { getBlendedColorForRating } from "@/utils/ratingToColor"; import { Popover, PopoverButton, PopoverPanel } from "@headlessui/vue"; -import { computed } from "vue"; import { useTranslation } from "i18next-vue"; import log from "loglevel"; -import { getBlendedColorForRating } from "@/utils/ratingToColor"; +import { computed } from "vue"; const { t } = useTranslation(); diff --git a/client/src/components/ui/RichText.vue b/client/src/components/ui/RichText.vue index 5e8378dd..c66da6c3 100644 --- a/client/src/components/ui/RichText.vue +++ b/client/src/components/ui/RichText.vue @@ -1,6 +1,6 @@ <script setup lang="ts"> -import { computed } from "vue"; import { setExternalLinksToOpenInNewTab } from "@/utils/dom"; +import { computed } from "vue"; const props = withDefaults( defineProps<{ diff --git a/client/src/pages/StyleGuidePage.vue b/client/src/pages/StyleGuidePage.vue index 24f03a87..ff15590f 100644 --- a/client/src/pages/StyleGuidePage.vue +++ b/client/src/pages/StyleGuidePage.vue @@ -11,9 +11,9 @@ import ItToggleSwitch from "@/components/ui/ItToggleSwitch.vue"; import RatingScale from "@/components/ui/RatingScale.vue"; import VerticalBarChart from "@/components/ui/VerticalBarChart.vue"; import LearningPathCircle from "@/pages/learningPath/learningPathPage/LearningPathCircle.vue"; +import "@vuepic/vue-datepicker/dist/main.css"; import logger from "loglevel"; import { reactive, ref } from "vue"; -import "@vuepic/vue-datepicker/dist/main.css"; const state = reactive({ checkboxValue: true, diff --git a/client/src/pages/assignmentEvaluation/AssignmentEvaluationPage.vue b/client/src/pages/assignmentEvaluation/AssignmentEvaluationPage.vue index 560e2dd7..aab377cf 100644 --- a/client/src/pages/assignmentEvaluation/AssignmentEvaluationPage.vue +++ b/client/src/pages/assignmentEvaluation/AssignmentEvaluationPage.vue @@ -1,16 +1,16 @@ <script setup lang="ts"> +import EvaluationContainer from "@/components/assignment/evaluation/EvaluationContainer.vue"; import { useCurrentCourseSession } from "@/composables"; import { ASSIGNMENT_COMPLETION_QUERY } from "@/graphql/queries"; -import EvaluationContainer from "@/components/assignment/evaluation/EvaluationContainer.vue"; import AssignmentSubmissionResponses from "@/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionResponses.vue"; +import { getPreviousRoute } from "@/router/history"; import type { Assignment, AssignmentCompletion, CourseSessionUser } from "@/types"; import { useQuery } from "@urql/vue"; +import { useTranslation } from "i18next-vue"; import log from "loglevel"; import { computed, onMounted } from "vue"; import { useRouter } from "vue-router"; -import { getPreviousRoute } from "@/router/history"; import { getAssignmentTypeTitle } from "../../utils/utils"; -import { useTranslation } from "i18next-vue"; const props = defineProps<{ courseSlug: string; diff --git a/client/src/pages/cockpit/CockpitUserCirclePage.vue b/client/src/pages/cockpit/CockpitUserCirclePage.vue index eb892680..118781b6 100644 --- a/client/src/pages/cockpit/CockpitUserCirclePage.vue +++ b/client/src/pages/cockpit/CockpitUserCirclePage.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> +import { useCourseSessionDetailQuery } from "@/composables"; +import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables"; import CirclePage from "@/pages/learningPath/circlePage/CirclePage.vue"; import * as log from "loglevel"; import { computed, onMounted } from "vue"; -import { useCourseSessionDetailQuery } from "@/composables"; -import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables"; const props = defineProps<{ userId: string; diff --git a/client/src/pages/cockpit/FeedbackPage.vue b/client/src/pages/cockpit/FeedbackPage.vue index e48dc6d4..9e88cf7b 100644 --- a/client/src/pages/cockpit/FeedbackPage.vue +++ b/client/src/pages/cockpit/FeedbackPage.vue @@ -42,15 +42,15 @@ <script setup lang="ts"> import { useCurrentCourseSession } from "@/composables"; import { itGet } from "@/fetchHelpers"; -import * as log from "loglevel"; -import { onMounted, ref } from "vue"; -import type { FeedbackData, FeedbackType } from "@/types"; -import FeedbackPageVV from "@/pages/cockpit/FeedbackPageVV.vue"; import FeedbackPageUK from "@/pages/cockpit/FeedbackPageUK.vue"; +import FeedbackPageVV from "@/pages/cockpit/FeedbackPageVV.vue"; import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables"; import { exportFeedback } from "@/services/dashboard"; import { useUserStore } from "@/stores/user"; +import type { FeedbackData, FeedbackType } from "@/types"; import { openDataAsXls } from "@/utils/export"; +import * as log from "loglevel"; +import { onMounted, ref } from "vue"; const props = defineProps<{ courseSlug: string; diff --git a/client/src/pages/cockpit/FeedbackPageUK.vue b/client/src/pages/cockpit/FeedbackPageUK.vue index f9467de9..747aee1d 100644 --- a/client/src/pages/cockpit/FeedbackPageUK.vue +++ b/client/src/pages/cockpit/FeedbackPageUK.vue @@ -12,8 +12,8 @@ <script setup lang="ts"> import FeedbackResults from "@/pages/cockpit/FeedbackResults.vue"; import type { FeedbackData } from "@/types"; -import * as log from "loglevel"; import { useTranslation } from "i18next-vue"; +import * as log from "loglevel"; defineProps<{ feedbackData: FeedbackData; diff --git a/client/src/pages/cockpit/FeedbackPageVV.vue b/client/src/pages/cockpit/FeedbackPageVV.vue index 96ad8e98..b656614d 100644 --- a/client/src/pages/cockpit/FeedbackPageVV.vue +++ b/client/src/pages/cockpit/FeedbackPageVV.vue @@ -12,8 +12,8 @@ <script setup lang="ts"> import FeedbackResults from "@/pages/cockpit/FeedbackResults.vue"; import type { FeedbackData } from "@/types"; -import * as log from "loglevel"; import { useTranslation } from "i18next-vue"; +import * as log from "loglevel"; defineProps<{ feedbackData: FeedbackData; diff --git a/client/src/pages/cockpit/assignmentsPage/AssignmentDetails.vue b/client/src/pages/cockpit/assignmentsPage/AssignmentDetails.vue index a7087392..ddc599b5 100644 --- a/client/src/pages/cockpit/assignmentsPage/AssignmentDetails.vue +++ b/client/src/pages/cockpit/assignmentsPage/AssignmentDetails.vue @@ -1,6 +1,8 @@ <script setup lang="ts"> +import AssignmentSubmissionProgress from "@/components/assignment/AssignmentSubmissionProgress.vue"; import ItPersonRow from "@/components/ui/ItPersonRow.vue"; import type { StatusCount } from "@/components/ui/ItProgress.vue"; +import { useCourseSessionDetailQuery } from "@/composables"; import type { GradedUser } from "@/services/assignmentService"; import { loadAssignmentCompletionStatusData } from "@/services/assignmentService"; import type { @@ -9,13 +11,11 @@ import type { LearningContentAssignment, LearningContentEdoniqTest, } from "@/types"; -import log from "loglevel"; -import { computed, onMounted, reactive } from "vue"; -import AssignmentSubmissionProgress from "@/components/assignment/AssignmentSubmissionProgress.vue"; -import { useCourseSessionDetailQuery } from "@/composables"; -import { formatDueDate } from "../../../components/dueDates/dueDatesUtils"; import { stringifyParse } from "@/utils/utils"; import { useTranslation } from "i18next-vue"; +import log from "loglevel"; +import { computed, onMounted, reactive } from "vue"; +import { formatDueDate } from "../../../components/dueDates/dueDatesUtils"; const { t } = useTranslation(); diff --git a/client/src/pages/cockpit/assignmentsPage/AssignmentsPage.vue b/client/src/pages/cockpit/assignmentsPage/AssignmentsPage.vue index 1e92d1db..0fc43148 100644 --- a/client/src/pages/cockpit/assignmentsPage/AssignmentsPage.vue +++ b/client/src/pages/cockpit/assignmentsPage/AssignmentsPage.vue @@ -1,11 +1,11 @@ <script setup lang="ts"> import { useCourseData, useCurrentCourseSession } from "@/composables"; import AssignmentDetails from "@/pages/cockpit/assignmentsPage/AssignmentDetails.vue"; -import * as log from "loglevel"; -import { computed, onMounted } from "vue"; -import type { LearningContentAssignment, LearningContentEdoniqTest } from "@/types"; import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables"; import { getPreviousRoute } from "@/router/history"; +import type { LearningContentAssignment, LearningContentEdoniqTest } from "@/types"; +import * as log from "loglevel"; +import { computed, onMounted } from "vue"; const props = defineProps<{ courseSlug: string; diff --git a/client/src/pages/cockpit/attendanceCheckPage/AttendanceCheckPage.vue b/client/src/pages/cockpit/attendanceCheckPage/AttendanceCheckPage.vue index 9f6d6e94..184a2fd2 100644 --- a/client/src/pages/cockpit/attendanceCheckPage/AttendanceCheckPage.vue +++ b/client/src/pages/cockpit/attendanceCheckPage/AttendanceCheckPage.vue @@ -4,18 +4,18 @@ import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; import ItPersonRow from "@/components/ui/ItPersonRow.vue"; import { useCourseSessionDetailQuery, useCurrentCourseSession } from "@/composables"; import type { AttendanceUserStatus } from "@/gql/graphql"; +import { graphqlClient } from "@/graphql/client"; import { ATTENDANCE_CHECK_MUTATION } from "@/graphql/mutations"; +import { ATTENDANCE_CHECK_QUERY } from "@/graphql/queries"; +import { exportAttendance } from "@/services/dashboard"; +import { useUserStore } from "@/stores/user"; import type { DropdownSelectable } from "@/types"; +import { openDataAsXls } from "@/utils/export"; import { useMutation } from "@urql/vue"; import dayjs from "dayjs"; +import { useTranslation } from "i18next-vue"; import log from "loglevel"; import { computed, onMounted, reactive, watch } from "vue"; -import { useTranslation } from "i18next-vue"; -import { ATTENDANCE_CHECK_QUERY } from "@/graphql/queries"; -import { graphqlClient } from "@/graphql/client"; -import { exportAttendance } from "@/services/dashboard"; -import { openDataAsXls } from "@/utils/export"; -import { useUserStore } from "@/stores/user"; const { t } = useTranslation(); const attendanceMutation = useMutation(ATTENDANCE_CHECK_MUTATION); diff --git a/client/src/pages/cockpit/cockpitPage/CockpitExpertPage.vue b/client/src/pages/cockpit/cockpitPage/CockpitExpertPage.vue index 864d9af2..da0c0e98 100644 --- a/client/src/pages/cockpit/cockpitPage/CockpitExpertPage.vue +++ b/client/src/pages/cockpit/cockpitPage/CockpitExpertPage.vue @@ -2,14 +2,14 @@ import LearningPathDiagram from "@/components/learningPath/LearningPathDiagram.vue"; import ItPersonRow from "@/components/ui/ItPersonRow.vue"; -import { useCourseSessionDetailQuery, useCurrentCourseSession } from "@/composables"; import SubmissionsOverview from "@/components/cockpit/SubmissionsOverview.vue"; +import UserStatusCount from "@/components/cockpit/UserStatusCount.vue"; +import CourseSessionDueDatesList from "@/components/dueDates/CourseSessionDueDatesList.vue"; +import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; +import { useCourseSessionDetailQuery, useCurrentCourseSession } from "@/composables"; +import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables"; import { useExpertCockpitStore } from "@/stores/expertCockpit"; import log from "loglevel"; -import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; -import UserStatusCount from "@/components/cockpit/UserStatusCount.vue"; -import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables"; -import CourseSessionDueDatesList from "@/components/dueDates/CourseSessionDueDatesList.vue"; const props = defineProps<{ courseSlug: string; diff --git a/client/src/pages/cockpit/documentPage/DocumentPage.vue b/client/src/pages/cockpit/documentPage/DocumentPage.vue index b7f5064d..249d8902 100644 --- a/client/src/pages/cockpit/documentPage/DocumentPage.vue +++ b/client/src/pages/cockpit/documentPage/DocumentPage.vue @@ -1,22 +1,22 @@ <script setup lang="ts"> -import { useCourseData, useCurrentCourseSession } from "@/composables"; +import DocumentListItem from "@/components/circle/DocumentListItem.vue"; import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; -import { useExpertCockpitStore } from "@/stores/expertCockpit"; import ItModal from "@/components/ui/ItModal.vue"; +import { useCourseData, useCurrentCourseSession } from "@/composables"; +import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables"; import DocumentUploadForm from "@/pages/cockpit/documentPage/DocumentUploadForm.vue"; -import { computed, onMounted, ref, watch } from "vue"; -import { useTranslation } from "i18next-vue"; -import type { CircleDocument, DocumentUploadData } from "@/types"; -import dialog from "@/utils/confirm-dialog"; -import log from "loglevel"; import { deleteCircleDocument, fetchCourseSessionDocuments, uploadCircleDocument, } from "@/services/files"; import { useCourseSessionsStore } from "@/stores/courseSessions"; -import DocumentListItem from "@/components/circle/DocumentListItem.vue"; -import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables"; +import { useExpertCockpitStore } from "@/stores/expertCockpit"; +import type { CircleDocument, DocumentUploadData } from "@/types"; +import dialog from "@/utils/confirm-dialog"; +import { useTranslation } from "i18next-vue"; +import log from "loglevel"; +import { computed, onMounted, ref, watch } from "vue"; const cockpitStore = useExpertCockpitStore(); const courseSession = useCurrentCourseSession(); diff --git a/client/src/pages/cockpit/documentPage/DocumentUploadForm.vue b/client/src/pages/cockpit/documentPage/DocumentUploadForm.vue index 1946b2f5..089d6478 100644 --- a/client/src/pages/cockpit/documentPage/DocumentUploadForm.vue +++ b/client/src/pages/cockpit/documentPage/DocumentUploadForm.vue @@ -1,8 +1,8 @@ <script setup lang="ts"> import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; import type { DocumentUploadData, DropdownSelectable } from "@/types"; -import { reactive } from "vue"; import { useTranslation } from "i18next-vue"; +import { reactive } from "vue"; export interface Props { learningSequences?: DropdownSelectable[]; diff --git a/client/src/pages/competence/ActionCompetenceDetail.vue b/client/src/pages/competence/ActionCompetenceDetail.vue index cab017f7..10b4e7b1 100644 --- a/client/src/pages/competence/ActionCompetenceDetail.vue +++ b/client/src/pages/competence/ActionCompetenceDetail.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> import ItToggleArrow from "@/components/ui/ItToggleArrow.vue"; -import log from "loglevel"; -import { ref, watch } from "vue"; import SinglePerformanceCriteriaRow from "@/pages/competence/SinglePerformanceCriteriaRow.vue"; import type { ActionCompetence } from "@/types"; +import log from "loglevel"; +import { ref, watch } from "vue"; interface Props { competence: ActionCompetence; diff --git a/client/src/pages/competence/ActionCompetenceListPage.vue b/client/src/pages/competence/ActionCompetenceListPage.vue index bbea9cf9..9334173e 100644 --- a/client/src/pages/competence/ActionCompetenceListPage.vue +++ b/client/src/pages/competence/ActionCompetenceListPage.vue @@ -1,8 +1,8 @@ <script setup lang="ts"> +import { useCourseDataWithCompletion } from "@/composables"; import CompetenceDetail from "@/pages/competence/ActionCompetenceDetail.vue"; import * as log from "loglevel"; import { ref } from "vue"; -import { useCourseDataWithCompletion } from "@/composables"; log.debug("CompetenceListPage created"); diff --git a/client/src/pages/competence/CompetenceCertificateComponent.vue b/client/src/pages/competence/CompetenceCertificateComponent.vue index ee1728e0..893ad19d 100644 --- a/client/src/pages/competence/CompetenceCertificateComponent.vue +++ b/client/src/pages/competence/CompetenceCertificateComponent.vue @@ -1,15 +1,15 @@ <script setup lang="ts"> -import * as log from "loglevel"; -import type { CompetenceCertificate } from "@/types"; -import CompetenceAssignmentRow from "@/pages/competence/CompetenceAssignmentRow.vue"; -import { computed } from "vue"; import ItProgress from "@/components/ui/ItProgress.vue"; +import { useCurrentCourseSession } from "@/composables"; +import CompetenceAssignmentRow from "@/pages/competence/CompetenceAssignmentRow.vue"; import { assignmentsUserPoints, calcCompetenceCertificateGrade, competenceCertificateProgressStatusCount, } from "@/pages/competence/utils"; -import { useCurrentCourseSession } from "@/composables"; +import type { CompetenceCertificate } from "@/types"; +import * as log from "loglevel"; +import { computed } from "vue"; log.debug("CompetenceCertificateComponent setup"); diff --git a/client/src/pages/competence/CompetenceCertificateDetailPage.vue b/client/src/pages/competence/CompetenceCertificateDetailPage.vue index dc0f00bf..61c0c7f5 100644 --- a/client/src/pages/competence/CompetenceCertificateDetailPage.vue +++ b/client/src/pages/competence/CompetenceCertificateDetailPage.vue @@ -1,10 +1,10 @@ <script setup lang="ts"> +import { useAllCompetenceCertificates } from "@/composables"; +import CompetenceCertificateComponent from "@/pages/competence/CompetenceCertificateComponent.vue"; +import { getPreviousRoute } from "@/router/history"; +import { useUserStore } from "@/stores/user"; import log from "loglevel"; import { computed } from "vue"; -import { useAllCompetenceCertificates } from "@/composables"; -import { getPreviousRoute } from "@/router/history"; -import CompetenceCertificateComponent from "@/pages/competence/CompetenceCertificateComponent.vue"; -import { useUserStore } from "@/stores/user"; const props = defineProps<{ courseSlug: string; diff --git a/client/src/pages/competence/CompetenceCertificateListPage.vue b/client/src/pages/competence/CompetenceCertificateListPage.vue index f6b981b8..bae5a789 100644 --- a/client/src/pages/competence/CompetenceCertificateListPage.vue +++ b/client/src/pages/competence/CompetenceCertificateListPage.vue @@ -1,14 +1,14 @@ <script setup lang="ts"> -import log from "loglevel"; -import { computed, onMounted } from "vue"; import { useAllCompetenceCertificates } from "@/composables"; import CompetenceCertificateComponent from "@/pages/competence/CompetenceCertificateComponent.vue"; import { assignmentsUserPoints, calcCompetencesTotalGrade, } from "@/pages/competence/utils"; -import { useRoute } from "vue-router"; import { useUserStore } from "@/stores/user"; +import log from "loglevel"; +import { computed, onMounted } from "vue"; +import { useRoute } from "vue-router"; const props = defineProps<{ courseSlug: string; diff --git a/client/src/pages/competence/CompetenceIndexPage.vue b/client/src/pages/competence/CompetenceIndexPage.vue index 2707a0d1..3400629d 100644 --- a/client/src/pages/competence/CompetenceIndexPage.vue +++ b/client/src/pages/competence/CompetenceIndexPage.vue @@ -1,6 +1,6 @@ <script setup lang="ts"> -import log from "loglevel"; -import { computed } from "vue"; +import SelfEvaluationAndFeedbackOverview from "@/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackOverview.vue"; +import ItProgress from "@/components/ui/ItProgress.vue"; import { useAllCompetenceCertificates, useCurrentCourseSession } from "@/composables"; import { assignmentsUserPoints, @@ -8,9 +8,9 @@ import { calcCompetencesTotalGrade, competenceCertificateProgressStatusCount, } from "@/pages/competence/utils"; -import ItProgress from "@/components/ui/ItProgress.vue"; -import SelfEvaluationAndFeedbackOverview from "@/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackOverview.vue"; import { useUserStore } from "@/stores/user"; +import log from "loglevel"; +import { computed } from "vue"; import { useRouter } from "vue-router"; const props = defineProps<{ diff --git a/client/src/pages/competence/CompetenceParentPage.vue b/client/src/pages/competence/CompetenceParentPage.vue index 9c0a1037..aeffbddf 100644 --- a/client/src/pages/competence/CompetenceParentPage.vue +++ b/client/src/pages/competence/CompetenceParentPage.vue @@ -1,8 +1,8 @@ <script setup lang="ts"> +import { useCurrentCourseSession, useEvaluationWithFeedback } from "@/composables"; import * as log from "loglevel"; import { onMounted } from "vue"; import { useRoute } from "vue-router"; -import { useCurrentCourseSession, useEvaluationWithFeedback } from "@/composables"; log.debug("CompetenceParentPage created"); diff --git a/client/src/pages/competence/SelfEvaluationAndFeedbackPage.vue b/client/src/pages/competence/SelfEvaluationAndFeedbackPage.vue index 8d7b92d9..3e94ef2a 100644 --- a/client/src/pages/competence/SelfEvaluationAndFeedbackPage.vue +++ b/client/src/pages/competence/SelfEvaluationAndFeedbackPage.vue @@ -1,6 +1,6 @@ <script setup lang="ts"> -import { useUserStore } from "@/stores/user"; import SelfEvaluationAndFeedbackList from "@/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackList.vue"; +import { useUserStore } from "@/stores/user"; const userId = useUserStore().id; </script> diff --git a/client/src/pages/dashboard/CourseListPage.vue b/client/src/pages/dashboard/CourseListPage.vue index fe76aa9e..75851515 100644 --- a/client/src/pages/dashboard/CourseListPage.vue +++ b/client/src/pages/dashboard/CourseListPage.vue @@ -1,6 +1,6 @@ <script setup lang="ts"> -import { getCockpitUrl } from "@/utils/utils"; import { useDashboardStore } from "@/stores/dashboard"; +import { getCockpitUrl } from "@/utils/utils"; const dashboardStore = useDashboardStore(); </script> diff --git a/client/src/pages/dashboard/DashboardAsideWidget.vue b/client/src/pages/dashboard/DashboardAsideWidget.vue index c36e24e7..008d66e4 100644 --- a/client/src/pages/dashboard/DashboardAsideWidget.vue +++ b/client/src/pages/dashboard/DashboardAsideWidget.vue @@ -1,10 +1,10 @@ <script setup lang="ts"> -import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; -import log from "loglevel"; -import { useDashboardPersonsDueDates } from "@/composables"; -import { computed } from "vue"; -import _ from "lodash"; import DueDateSingle from "@/components/dueDates/DueDateSingle.vue"; +import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; +import { useDashboardPersonsDueDates } from "@/composables"; +import _ from "lodash"; +import log from "loglevel"; +import { computed } from "vue"; log.debug("DashboardAsideWidget created"); diff --git a/client/src/pages/dashboard/DashboardDueDatesPage.vue b/client/src/pages/dashboard/DashboardDueDatesPage.vue index c8fdf2e6..81bfb207 100644 --- a/client/src/pages/dashboard/DashboardDueDatesPage.vue +++ b/client/src/pages/dashboard/DashboardDueDatesPage.vue @@ -1,14 +1,14 @@ <script setup lang="ts"> -import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; -import log from "loglevel"; -import { useDashboardPersonsDueDates } from "@/composables"; +import DueDateSingle from "@/components/dueDates/DueDateSingle.vue"; import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; -import { computed, ref, watch } from "vue"; +import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; +import { useDashboardPersonsDueDates } from "@/composables"; +import { getPreviousRoute } from "@/router/history"; +import { useRouteQuery } from "@vueuse/router"; import { useTranslation } from "i18next-vue"; import _ from "lodash"; -import { useRouteQuery } from "@vueuse/router"; -import DueDateSingle from "@/components/dueDates/DueDateSingle.vue"; -import { getPreviousRoute } from "@/router/history"; +import log from "loglevel"; +import { computed, ref, watch } from "vue"; log.debug("DashboardPersonsPage created"); diff --git a/client/src/pages/dashboard/DashboardPage.vue b/client/src/pages/dashboard/DashboardPage.vue index 7b0923b2..d2e9937f 100644 --- a/client/src/pages/dashboard/DashboardPage.vue +++ b/client/src/pages/dashboard/DashboardPage.vue @@ -1,11 +1,11 @@ <script setup lang="ts"> -import { onMounted } from "vue"; -import { useDashboardStore } from "@/stores/dashboard"; -import type { DashboardCourseConfigType } from "@/services/dashboard"; -import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; -import NoCourseSession from "@/components/dashboard/NoCourseSession.vue"; import CoursePanel from "@/components/dashboard/CoursePanel.vue"; +import NoCourseSession from "@/components/dashboard/NoCourseSession.vue"; +import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; import DashboardAsideWidget from "@/pages/dashboard/DashboardAsideWidget.vue"; +import type { DashboardCourseConfigType } from "@/services/dashboard"; +import { useDashboardStore } from "@/stores/dashboard"; +import { onMounted } from "vue"; const dashboardStore = useDashboardStore(); diff --git a/client/src/pages/dashboard/DashboardPersonsPage.vue b/client/src/pages/dashboard/DashboardPersonsPage.vue index 4d182a08..6e89792f 100644 --- a/client/src/pages/dashboard/DashboardPersonsPage.vue +++ b/client/src/pages/dashboard/DashboardPersonsPage.vue @@ -1,19 +1,19 @@ <script setup lang="ts"> -import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; -import log from "loglevel"; -import { useDashboardPersonsDueDates } from "@/composables"; import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; -import { computed, ref, watch } from "vue"; -import { useTranslation } from "i18next-vue"; -import _ from "lodash"; +import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; +import { useDashboardPersonsDueDates } from "@/composables"; import { type DashboardPersonCourseSessionType, exportPersons, } from "@/services/dashboard"; -import { useRouteQuery } from "@vueuse/router"; -import type { DashboardPersonsPageMode, StatisticsFilterItem } from "@/types"; import { useUserStore } from "@/stores/user"; +import type { DashboardPersonsPageMode, StatisticsFilterItem } from "@/types"; import { exportDataAsXls } from "@/utils/export"; +import { useRouteQuery } from "@vueuse/router"; +import { useTranslation } from "i18next-vue"; +import _ from "lodash"; +import log from "loglevel"; +import { computed, ref, watch } from "vue"; log.debug("DashboardPersonsPage created"); diff --git a/client/src/pages/dashboard/MentorPage.vue b/client/src/pages/dashboard/MentorPage.vue index b68420d5..dac60083 100644 --- a/client/src/pages/dashboard/MentorPage.vue +++ b/client/src/pages/dashboard/MentorPage.vue @@ -1,6 +1,6 @@ <script setup lang="ts"> -import { getLearningMentorUrl } from "@/utils/utils"; import { useDashboardStore } from "@/stores/dashboard"; +import { getLearningMentorUrl } from "@/utils/utils"; const dashboardStore = useDashboardStore(); </script> diff --git a/client/src/pages/dashboard/ProgressPage.vue b/client/src/pages/dashboard/ProgressPage.vue index ca65c47a..66b0fb70 100644 --- a/client/src/pages/dashboard/ProgressPage.vue +++ b/client/src/pages/dashboard/ProgressPage.vue @@ -1,15 +1,15 @@ <script setup lang="ts"> -import { useDashboardStore } from "@/stores/dashboard"; -import { computed } from "vue"; +import AssignmentProgressSummaryBox from "@/components/dashboard/AssignmentProgressSummaryBox.vue"; +import CompetenceSummaryBox from "@/components/dashboard/CompetenceSummaryBox.vue"; import LearningPathDiagram from "@/components/learningPath/LearningPathDiagram.vue"; -import { getLearningPathUrl } from "@/utils/utils"; import type { CourseProgressType, ProgressDashboardAssignmentType, ProgressDashboardCompetenceType, } from "@/gql/graphql"; -import CompetenceSummaryBox from "@/components/dashboard/CompetenceSummaryBox.vue"; -import AssignmentProgressSummaryBox from "@/components/dashboard/AssignmentProgressSummaryBox.vue"; +import { useDashboardStore } from "@/stores/dashboard"; +import { getLearningPathUrl } from "@/utils/utils"; +import { computed } from "vue"; const dashboardStore = useDashboardStore(); diff --git a/client/src/pages/dashboard/SimpleCoursePage.vue b/client/src/pages/dashboard/SimpleCoursePage.vue index 737d2fa1..8c8b839b 100644 --- a/client/src/pages/dashboard/SimpleCoursePage.vue +++ b/client/src/pages/dashboard/SimpleCoursePage.vue @@ -1,6 +1,6 @@ <script setup lang="ts"> -import { getCockpitUrl } from "@/utils/utils"; import { useDashboardStore } from "@/stores/dashboard"; +import { getCockpitUrl } from "@/utils/utils"; const dashboardStore = useDashboardStore(); </script> diff --git a/client/src/pages/dashboard/agentAssignment/AgentAssignmentDetail.vue b/client/src/pages/dashboard/agentAssignment/AgentAssignmentDetail.vue index 12170fd9..cb502d44 100644 --- a/client/src/pages/dashboard/agentAssignment/AgentAssignmentDetail.vue +++ b/client/src/pages/dashboard/agentAssignment/AgentAssignmentDetail.vue @@ -1,10 +1,10 @@ <script setup lang="ts"> import { useCourseData, useCurrentCourseSession } from "@/composables"; import AssignmentDetails from "@/pages/cockpit/assignmentsPage/AssignmentDetails.vue"; +import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables"; +import type { LearningContentAssignment, LearningContentEdoniqTest } from "@/types"; import * as log from "loglevel"; import { computed } from "vue"; -import type { LearningContentAssignment, LearningContentEdoniqTest } from "@/types"; -import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables"; const props = defineProps<{ courseSlug: string; diff --git a/client/src/pages/dashboard/agentAssignment/AgentAssignmentDetailPage.vue b/client/src/pages/dashboard/agentAssignment/AgentAssignmentDetailPage.vue index 66500f5d..1859090e 100644 --- a/client/src/pages/dashboard/agentAssignment/AgentAssignmentDetailPage.vue +++ b/client/src/pages/dashboard/agentAssignment/AgentAssignmentDetailPage.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> import { useCurrentCourseSession } from "@/composables"; +import AgentAssignmentDetail from "@/pages/dashboard/agentAssignment/AgentAssignmentDetail.vue"; +import { fetchDashboardPersons } from "@/services/dashboard"; import * as log from "loglevel"; import { onMounted, ref } from "vue"; -import { fetchDashboardPersons } from "@/services/dashboard"; -import AgentAssignmentDetail from "@/pages/dashboard/agentAssignment/AgentAssignmentDetail.vue"; const props = defineProps<{ courseSlug: string; diff --git a/client/src/pages/dashboard/agentAssignment/AgentAssignmentStatisticPage.vue b/client/src/pages/dashboard/agentAssignment/AgentAssignmentStatisticPage.vue index 99921b27..77a71ac6 100644 --- a/client/src/pages/dashboard/agentAssignment/AgentAssignmentStatisticPage.vue +++ b/client/src/pages/dashboard/agentAssignment/AgentAssignmentStatisticPage.vue @@ -1,14 +1,14 @@ <script setup lang="ts"> -import log from "loglevel"; -import { onMounted, ref } from "vue"; +import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; +import type { BaseStatisticsType } from "@/gql/graphql"; +import AssignmentList from "@/pages/dashboard/statistic/AssignmentList.vue"; import { courseIdForCourseSlug, fetchMentorCompetenceSummary, } from "@/services/dashboard"; -import type { BaseStatisticsType } from "@/gql/graphql"; import { useDashboardStore } from "@/stores/dashboard"; -import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; -import AssignmentList from "@/pages/dashboard/statistic/AssignmentList.vue"; +import log from "loglevel"; +import { onMounted, ref } from "vue"; const dashboardStore = useDashboardStore(); diff --git a/client/src/pages/dashboard/agentAssignment/AgentCompetenceGradeDetailPage.vue b/client/src/pages/dashboard/agentAssignment/AgentCompetenceGradeDetailPage.vue index 795de9ee..d403f740 100644 --- a/client/src/pages/dashboard/agentAssignment/AgentCompetenceGradeDetailPage.vue +++ b/client/src/pages/dashboard/agentAssignment/AgentCompetenceGradeDetailPage.vue @@ -1,15 +1,15 @@ <script setup lang="ts"> +import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; +import type { CompetenceCertificateObjectType } from "@/gql/graphql"; +import { graphqlClient } from "@/graphql/client"; +import { COMPETENCE_NAVI_CERTIFICATE_QUERY } from "@/graphql/queries"; +import { calcCompetenceCertificateGrade } from "@/pages/competence/utils"; +import { percentToRoundedGrade } from "@/services/assignmentService"; +import { type DashboardPersonType, fetchDashboardPersons } from "@/services/dashboard"; +import type { CompetenceCertificateAssignment } from "@/types"; +import _ from "lodash"; import log from "loglevel"; import { computed, onMounted, ref } from "vue"; -import { type DashboardPersonType, fetchDashboardPersons } from "@/services/dashboard"; -import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; -import { COMPETENCE_NAVI_CERTIFICATE_QUERY } from "@/graphql/queries"; -import { graphqlClient } from "@/graphql/client"; -import type { CompetenceCertificateObjectType } from "@/gql/graphql"; -import { calcCompetenceCertificateGrade } from "@/pages/competence/utils"; -import _ from "lodash"; -import type { CompetenceCertificateAssignment } from "@/types"; -import { percentToRoundedGrade } from "@/services/assignmentService"; const props = defineProps<{ agentRole: string; diff --git a/client/src/pages/dashboard/agentAssignment/AgentCompetenceGradePage.vue b/client/src/pages/dashboard/agentAssignment/AgentCompetenceGradePage.vue index 0e7bd152..85c78f0f 100644 --- a/client/src/pages/dashboard/agentAssignment/AgentCompetenceGradePage.vue +++ b/client/src/pages/dashboard/agentAssignment/AgentCompetenceGradePage.vue @@ -1,17 +1,17 @@ <script setup lang="ts"> -import log from "loglevel"; -import { computed, onMounted, type Ref, ref } from "vue"; +import StatisticFilterList from "@/components/dashboard/StatisticFilterList.vue"; +import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; +import type { AssignmentStatisticsRecordType, BaseStatisticsType } from "@/gql/graphql"; +import { percentToRoundedGrade } from "@/services/assignmentService"; import { courseIdForCourseSlug, fetchMentorCompetenceSummary, } from "@/services/dashboard"; -import type { AssignmentStatisticsRecordType, BaseStatisticsType } from "@/gql/graphql"; import { useDashboardStore } from "@/stores/dashboard"; -import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; -import _ from "lodash"; -import { percentToRoundedGrade } from "@/services/assignmentService"; -import StatisticFilterList from "@/components/dashboard/StatisticFilterList.vue"; import type { StatisticsFilterItem } from "@/types"; +import _ from "lodash"; +import log from "loglevel"; +import { computed, onMounted, type Ref, ref } from "vue"; const dashboardStore = useDashboardStore(); diff --git a/client/src/pages/dashboard/statistic/AssignmentList.vue b/client/src/pages/dashboard/statistic/AssignmentList.vue index b8cf29eb..0b8ac664 100644 --- a/client/src/pages/dashboard/statistic/AssignmentList.vue +++ b/client/src/pages/dashboard/statistic/AssignmentList.vue @@ -1,18 +1,18 @@ <script setup lang="ts"> +import StatisticFilterList from "@/components/dashboard/StatisticFilterList.vue"; +import { getDateString } from "@/components/dueDates/dueDatesUtils"; +import ItProgress from "@/components/ui/ItProgress.vue"; import type { AssignmentCompletionMetricsType, AssignmentStatisticsRecordType, BaseStatisticsType, StatisticsCircleDataType, } from "@/gql/graphql"; -import StatisticFilterList from "@/components/dashboard/StatisticFilterList.vue"; -import { getDateString } from "@/components/dueDates/dueDatesUtils"; -import dayjs from "dayjs"; -import ItProgress from "@/components/ui/ItProgress.vue"; -import { type Ref, ref } from "vue"; -import { exportDataAsXls } from "@/utils/export"; import { exportCompetenceElements } from "@/services/dashboard"; import { useUserStore } from "@/stores/user"; +import { exportDataAsXls } from "@/utils/export"; +import dayjs from "dayjs"; +import { type Ref, ref } from "vue"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const props = defineProps<{ diff --git a/client/src/pages/dashboard/statistic/AttendanceList.vue b/client/src/pages/dashboard/statistic/AttendanceList.vue index 5e3511f2..693049e5 100644 --- a/client/src/pages/dashboard/statistic/AttendanceList.vue +++ b/client/src/pages/dashboard/statistic/AttendanceList.vue @@ -1,17 +1,17 @@ <script setup lang="ts"> +import StatisticFilterList from "@/components/dashboard/StatisticFilterList.vue"; +import { getDateString } from "@/components/dueDates/dueDatesUtils"; +import ItProgress from "@/components/ui/ItProgress.vue"; import type { CourseStatisticsType, PresenceRecordStatisticsType, StatisticsCircleDataType, } from "@/gql/graphql"; -import StatisticFilterList from "@/components/dashboard/StatisticFilterList.vue"; -import ItProgress from "@/components/ui/ItProgress.vue"; -import { getDateString } from "@/components/dueDates/dueDatesUtils"; -import dayjs from "dayjs"; -import { ref, type Ref } from "vue"; -import { exportDataAsXls } from "@/utils/export"; import { exportAttendance } from "@/services/dashboard"; import { useUserStore } from "@/stores/user"; +import { exportDataAsXls } from "@/utils/export"; +import dayjs from "dayjs"; +import { ref, type Ref } from "vue"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const props = defineProps<{ diff --git a/client/src/pages/dashboard/statistic/CompetenceList.vue b/client/src/pages/dashboard/statistic/CompetenceList.vue index 331cc5e1..9a8e2ceb 100644 --- a/client/src/pages/dashboard/statistic/CompetenceList.vue +++ b/client/src/pages/dashboard/statistic/CompetenceList.vue @@ -1,10 +1,10 @@ <script setup lang="ts"> +import StatisticFilterList from "@/components/dashboard/StatisticFilterList.vue"; import type { CompetenceRecordStatisticsType, CourseStatisticsType, StatisticsCircleDataType, } from "@/gql/graphql"; -import StatisticFilterList from "@/components/dashboard/StatisticFilterList.vue"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const props = defineProps<{ diff --git a/client/src/pages/dashboard/statistic/FeedbackList.vue b/client/src/pages/dashboard/statistic/FeedbackList.vue index 96123886..2988d7c4 100644 --- a/client/src/pages/dashboard/statistic/FeedbackList.vue +++ b/client/src/pages/dashboard/statistic/FeedbackList.vue @@ -1,16 +1,16 @@ <script setup lang="ts"> +import StatisticFilterList from "@/components/dashboard/StatisticFilterList.vue"; import type { CourseStatisticsType, FeedbackStatisticsRecordType, PresenceRecordStatisticsType, StatisticsCircleDataType, } from "@/gql/graphql"; -import StatisticFilterList from "@/components/dashboard/StatisticFilterList.vue"; -import { getBlendedColorForRating } from "@/utils/ratingToColor"; -import { ref, type Ref } from "vue"; -import { exportDataAsXls } from "@/utils/export"; import { exportFeedback } from "@/services/dashboard"; import { useUserStore } from "@/stores/user"; +import { exportDataAsXls } from "@/utils/export"; +import { getBlendedColorForRating } from "@/utils/ratingToColor"; +import { ref, type Ref } from "vue"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const props = defineProps<{ diff --git a/client/src/pages/learningMentor/mentor/MentorIndexPage.vue b/client/src/pages/learningMentor/mentor/MentorIndexPage.vue index 82ed09a2..bef2fd26 100644 --- a/client/src/pages/learningMentor/mentor/MentorIndexPage.vue +++ b/client/src/pages/learningMentor/mentor/MentorIndexPage.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> -import { useRoute, useRouter } from "vue-router"; import { useCurrentCourseSession } from "@/composables"; import { onMounted } from "vue"; +import { useRoute, useRouter } from "vue-router"; const route = useRoute(); const router = useRouter(); diff --git a/client/src/pages/learningMentor/mentor/MentorOverviewPage.vue b/client/src/pages/learningMentor/mentor/MentorOverviewPage.vue index 7a0a9220..a574f96e 100644 --- a/client/src/pages/learningMentor/mentor/MentorOverviewPage.vue +++ b/client/src/pages/learningMentor/mentor/MentorOverviewPage.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> -import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; import PraxisAssignmentItem from "@/components/learningMentor/PraxisAssignmentItem.vue"; import SelfAssignmentFeedbackAssignmentItem from "@/components/learningMentor/SelfAssignmentFeedbackAssignmentItem.vue"; +import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; import { useAssignmentTodoListStore } from "@/stores/learningMentor/assignmentTodoList"; const assignmentTodoListStore = useAssignmentTodoListStore(); diff --git a/client/src/pages/learningMentor/mentor/MentorParticipantsPage.vue b/client/src/pages/learningMentor/mentor/MentorParticipantsPage.vue index 1e5e7507..32aa81f6 100644 --- a/client/src/pages/learningMentor/mentor/MentorParticipantsPage.vue +++ b/client/src/pages/learningMentor/mentor/MentorParticipantsPage.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> -import { useCurrentCourseSession } from "@/composables"; -import MyMentors from "@/components/learningMentor/MyMentors.vue"; import MyMentees from "@/components/learningMentor/MyMentees.vue"; +import MyMentors from "@/components/learningMentor/MyMentors.vue"; +import { useCurrentCourseSession } from "@/composables"; import { computed } from "vue"; const courseSession = useCurrentCourseSession(); diff --git a/client/src/pages/learningMentor/mentor/MentorPraxisAssignmentPage.vue b/client/src/pages/learningMentor/mentor/MentorPraxisAssignmentPage.vue index 306b351c..a374c036 100644 --- a/client/src/pages/learningMentor/mentor/MentorPraxisAssignmentPage.vue +++ b/client/src/pages/learningMentor/mentor/MentorPraxisAssignmentPage.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> +import { useCurrentCourseSession } from "@/composables"; import type { Assignment, UserShort } from "@/services/learningMentees"; import { useLearningMentees } from "@/services/learningMentees"; -import { computed, onMounted, type Ref } from "vue"; -import { useCurrentCourseSession } from "@/composables"; import log from "loglevel"; +import { computed, onMounted, type Ref } from "vue"; const props = defineProps<{ praxisAssignmentId: string; diff --git a/client/src/pages/learningMentor/mentor/MentorSelfEvaluationFeedbackAssignmentPage.vue b/client/src/pages/learningMentor/mentor/MentorSelfEvaluationFeedbackAssignmentPage.vue index 3f9dd9ea..a3e6a7f6 100644 --- a/client/src/pages/learningMentor/mentor/MentorSelfEvaluationFeedbackAssignmentPage.vue +++ b/client/src/pages/learningMentor/mentor/MentorSelfEvaluationFeedbackAssignmentPage.vue @@ -1,8 +1,8 @@ <script setup lang="ts"> +import { useCurrentCourseSession } from "@/composables"; import type { Assignment, UserShort } from "@/services/learningMentees"; import { useLearningMentees } from "@/services/learningMentees"; import { computed, type Ref } from "vue"; -import { useCurrentCourseSession } from "@/composables"; const props = defineProps<{ learningUnitId: string; diff --git a/client/src/pages/learningMentor/mentor/SelfEvaluationFeedbackPage.vue b/client/src/pages/learningMentor/mentor/SelfEvaluationFeedbackPage.vue index 2023c283..00a96216 100644 --- a/client/src/pages/learningMentor/mentor/SelfEvaluationFeedbackPage.vue +++ b/client/src/pages/learningMentor/mentor/SelfEvaluationFeedbackPage.vue @@ -1,16 +1,16 @@ <script setup lang="ts"> +import FeedbackProviderRankCriteria from "@/components/selfEvaluationFeedback/FeedbackProviderRankCriteria.vue"; +import FeedbackProviderReleaseOverview from "@/components/selfEvaluationFeedback/FeedbackProviderReleaseOverview.vue"; import LearningContentMultiLayout from "@/pages/learningPath/learningContentPage/layouts/LearningContentMultiLayout.vue"; import LearningContentContainer from "@/pages/learningPath/learningContentPage/LearningContentContainer.vue"; -import { useRouter } from "vue-router"; -import { computed, ref, watch } from "vue"; import { type Criterion, useSelfEvaluationFeedback, } from "@/services/selfEvaluationFeedback"; import { useRouteQuery } from "@vueuse/router"; -import FeedbackProviderRankCriteria from "@/components/selfEvaluationFeedback/FeedbackProviderRankCriteria.vue"; -import FeedbackProviderReleaseOverview from "@/components/selfEvaluationFeedback/FeedbackProviderReleaseOverview.vue"; import log from "loglevel"; +import { computed, ref, watch } from "vue"; +import { useRouter } from "vue-router"; const router = useRouter(); const props = defineProps<{ diff --git a/client/src/pages/learningPath/circlePage/CircleDiagram.vue b/client/src/pages/learningPath/circlePage/CircleDiagram.vue index baeaae2a..c86153e6 100644 --- a/client/src/pages/learningPath/circlePage/CircleDiagram.vue +++ b/client/src/pages/learningPath/circlePage/CircleDiagram.vue @@ -9,11 +9,11 @@ import { computed, onMounted } from "vue"; // @ts-ignore import colors from "@/colors.json"; -import type { CircleType, LearningSequence } from "@/types"; import { allFinishedInLearningSequence, someFinishedInLearningSequence, } from "@/services/circle"; +import type { CircleType, LearningSequence } from "@/types"; const props = defineProps<{ circle: CircleType; diff --git a/client/src/pages/learningPath/circlePage/CircleOverview.vue b/client/src/pages/learningPath/circlePage/CircleOverview.vue index b822194e..fca2aed4 100644 --- a/client/src/pages/learningPath/circlePage/CircleOverview.vue +++ b/client/src/pages/learningPath/circlePage/CircleOverview.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> import ItFullScreenModal from "@/components/ui/ItFullScreenModal.vue"; -import type { CircleType } from "@/types"; import RichText from "@/components/ui/RichText.vue"; +import type { CircleType } from "@/types"; defineProps<{ circle: CircleType; diff --git a/client/src/pages/learningPath/circlePage/CirclePage.vue b/client/src/pages/learningPath/circlePage/CirclePage.vue index 6824d277..55f53ca6 100644 --- a/client/src/pages/learningPath/circlePage/CirclePage.vue +++ b/client/src/pages/learningPath/circlePage/CirclePage.vue @@ -1,20 +1,20 @@ <script setup lang="ts"> +import { + useCourseDataWithCompletion, + useCourseSessionDetailQuery, + useCurrentCourseSession, +} from "@/composables"; +import { useCSRFFetch } from "@/fetchHelpers"; +import LearningSequence from "@/pages/learningPath/circlePage/LearningSequence.vue"; +import { useCircleStore } from "@/stores/circle"; import type { CourseSessionUser } from "@/types"; +import { stringifyParse } from "@/utils/utils"; import log from "loglevel"; import { computed, watch } from "vue"; import { useRoute } from "vue-router"; import CircleDiagram from "./CircleDiagram.vue"; import CircleOverview from "./CircleOverview.vue"; import DocumentSection from "./DocumentSection.vue"; -import { - useCourseDataWithCompletion, - useCourseSessionDetailQuery, - useCurrentCourseSession, -} from "@/composables"; -import { stringifyParse } from "@/utils/utils"; -import { useCircleStore } from "@/stores/circle"; -import LearningSequence from "@/pages/learningPath/circlePage/LearningSequence.vue"; -import { useCSRFFetch } from "@/fetchHelpers"; export interface Props { courseSlug: string; diff --git a/client/src/pages/learningPath/circlePage/DocumentSection.vue b/client/src/pages/learningPath/circlePage/DocumentSection.vue index a0540334..8f41ec66 100644 --- a/client/src/pages/learningPath/circlePage/DocumentSection.vue +++ b/client/src/pages/learningPath/circlePage/DocumentSection.vue @@ -22,9 +22,9 @@ <script setup lang="ts"> import DocumentListItem from "@/components/circle/DocumentListItem.vue"; import { useCurrentCourseSession } from "@/composables"; -import { computed, onMounted, ref } from "vue"; -import type { CircleDocument, CircleType } from "@/types"; import { fetchCourseSessionDocuments } from "@/services/files"; +import type { CircleDocument, CircleType } from "@/types"; +import { computed, onMounted, ref } from "vue"; const props = defineProps<{ circle: CircleType; diff --git a/client/src/pages/learningPath/circlePage/LearningSequence.vue b/client/src/pages/learningPath/circlePage/LearningSequence.vue index d582018e..a11337c8 100644 --- a/client/src/pages/learningPath/circlePage/LearningSequence.vue +++ b/client/src/pages/learningPath/circlePage/LearningSequence.vue @@ -20,8 +20,8 @@ import { someFinishedInLearningSequence, } from "@/services/circle"; -import { findLastIndex } from "lodash"; import CompletionStatus from "@/components/circle/CompletionStatus.vue"; +import { findLastIndex } from "lodash"; type Props = { courseSlug: string; diff --git a/client/src/pages/learningPath/learningContentPage/LearningContentContainer.vue b/client/src/pages/learningPath/learningContentPage/LearningContentContainer.vue index 4e69037e..f474fc07 100644 --- a/client/src/pages/learningPath/learningContentPage/LearningContentContainer.vue +++ b/client/src/pages/learningPath/learningContentPage/LearningContentContainer.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> -import * as log from "loglevel"; import CoursePreviewBar from "@/components/header/CoursePreviewBar.vue"; import { useCourseSessionsStore } from "@/stores/courseSessions"; +import * as log from "loglevel"; const courseSessionsStore = useCourseSessionsStore(); diff --git a/client/src/pages/learningPath/learningContentPage/LearningContentPage.vue b/client/src/pages/learningPath/learningContentPage/LearningContentPage.vue index 59e58cea..05193d68 100644 --- a/client/src/pages/learningPath/learningContentPage/LearningContentPage.vue +++ b/client/src/pages/learningPath/learningContentPage/LearningContentPage.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> +import { useCourseDataWithCompletion } from "@/composables"; import LearningContentParent from "@/pages/learningPath/learningContentPage/LearningContentParent.vue"; +import { stringifyParse } from "@/utils/utils"; import * as log from "loglevel"; import { computed } from "vue"; -import { useCourseDataWithCompletion } from "@/composables"; -import { stringifyParse } from "@/utils/utils"; const props = defineProps<{ courseSlug: string; diff --git a/client/src/pages/learningPath/learningContentPage/LearningContentParent.vue b/client/src/pages/learningPath/learningContentPage/LearningContentParent.vue index e33113fd..4f0ea8a7 100644 --- a/client/src/pages/learningPath/learningContentPage/LearningContentParent.vue +++ b/client/src/pages/learningPath/learningContentPage/LearningContentParent.vue @@ -1,7 +1,10 @@ <script setup lang="ts"> +import { useCourseDataWithCompletion } from "@/composables"; import LearningContentContainer from "@/pages/learningPath/learningContentPage/LearningContentContainer.vue"; import DocumentListBlock from "@/pages/learningPath/learningContentPage/blocks/DocumentListBlock.vue"; import EdoniqTestBlock from "@/pages/learningPath/learningContentPage/blocks/EdoniqTestBlock.vue"; +import { getPreviousRoute } from "@/router/history"; +import { useCircleStore } from "@/stores/circle"; import type { CircleType, LearningContent, @@ -9,6 +12,7 @@ import type { LearningContentWithCompletion, } from "@/types"; import eventBus from "@/utils/eventBus"; +import { stringifyParse } from "@/utils/utils"; import log from "loglevel"; import type { Component } from "vue"; import { computed, onUnmounted } from "vue"; @@ -21,10 +25,6 @@ import RichTextBlock from "./blocks/RichTextBlock.vue"; import VideoBlock from "./blocks/VideoBlock.vue"; import FeedbackBlockUK from "./feedback/FeedbackBlockUK.vue"; import FeedbackBlockVV from "./feedback/FeedbackBlockVV.vue"; -import { getPreviousRoute } from "@/router/history"; -import { stringifyParse } from "@/utils/utils"; -import { useCourseDataWithCompletion } from "@/composables"; -import { useCircleStore } from "@/stores/circle"; const props = defineProps<{ learningContent: LearningContent; diff --git a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionResponses.vue b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionResponses.vue index 33ba611b..dfdbcdca 100644 --- a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionResponses.vue +++ b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionResponses.vue @@ -1,4 +1,5 @@ <script setup lang="ts"> +import RichText from "@/components/ui/RichText.vue"; import type { Assignment, AssignmentCompletionData, @@ -6,7 +7,6 @@ import type { AssignmentTaskCompletionData, UserDataText, } from "@/types"; -import RichText from "@/components/ui/RichText.vue"; const props = defineProps<{ assignment: Assignment; diff --git a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionView.vue b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionView.vue index ebdd32de..b945e67b 100644 --- a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionView.vue +++ b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionView.vue @@ -1,19 +1,19 @@ <script setup lang="ts"> +import SampleSolution from "@/components/assignment/SampleSolution.vue"; +import CaseWorkSubmit from "@/components/learningPath/assignment/CaseWorkSubmit.vue"; +import PraxisAssignmentSubmit from "@/components/learningPath/assignment/PraxisAssignmentSubmit.vue"; +import SimpleSubmit from "@/components/learningPath/assignment/SimpleSubmit.vue"; import ItSuccessAlert from "@/components/ui/ItSuccessAlert.vue"; import { useCourseData, useCourseSessionDetailQuery, useCurrentCourseSession, } from "@/composables"; +import type { AssignmentAssignmentAssignmentTypeChoices } from "@/gql/graphql"; import AssignmentSubmissionResponses from "@/pages/learningPath/learningContentPage/assignment/AssignmentSubmissionResponses.vue"; import type { Assignment, AssignmentCompletion, AssignmentTask } from "@/types"; -import { computed } from "vue"; import { useTranslation } from "i18next-vue"; -import type { AssignmentAssignmentAssignmentTypeChoices } from "@/gql/graphql"; -import CaseWorkSubmit from "@/components/learningPath/assignment/CaseWorkSubmit.vue"; -import SimpleSubmit from "@/components/learningPath/assignment/SimpleSubmit.vue"; -import PraxisAssignmentSubmit from "@/components/learningPath/assignment/PraxisAssignmentSubmit.vue"; -import SampleSolution from "@/components/assignment/SampleSolution.vue"; +import { computed } from "vue"; const props = defineProps<{ assignment: Assignment; diff --git a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentTaskView.vue b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentTaskView.vue index 6dbf6537..88e990cc 100644 --- a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentTaskView.vue +++ b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentTaskView.vue @@ -1,8 +1,10 @@ <script setup lang="ts"> import ItCheckbox from "@/components/ui/ItCheckbox.vue"; import ItTextarea from "@/components/ui/ItTextarea.vue"; +import RichText from "@/components/ui/RichText.vue"; import { useCurrentCourseSession } from "@/composables"; import { UPSERT_ASSIGNMENT_COMPLETION_MUTATION } from "@/graphql/mutations"; +import AttachmentSection from "@/pages/learningPath/learningContentPage/assignment/AttachmentSection.vue"; import type { AssignmentCompletion, AssignmentCompletionData, @@ -15,8 +17,6 @@ import { useMutation } from "@urql/vue"; import { useDebounceFn } from "@vueuse/core"; import log from "loglevel"; import { computed, reactive } from "vue"; -import AttachmentSection from "@/pages/learningPath/learningContentPage/assignment/AttachmentSection.vue"; -import RichText from "@/components/ui/RichText.vue"; const props = defineProps<{ assignmentId: string; diff --git a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentView.vue b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentView.vue index 48ae62a3..ae802236 100644 --- a/client/src/pages/learningPath/learningContentPage/assignment/AssignmentView.vue +++ b/client/src/pages/learningPath/learningContentPage/assignment/AssignmentView.vue @@ -1,5 +1,7 @@ <script setup lang="ts"> +import EvaluationSummary from "@/components/assignment/evaluation/EvaluationSummary.vue"; import { useCourseSessionDetailQuery, useCurrentCourseSession } from "@/composables"; +import { bustItGetCache } from "@/fetchHelpers"; import { UPSERT_ASSIGNMENT_COMPLETION_MUTATION } from "@/graphql/mutations"; import { ASSIGNMENT_COMPLETION_QUERY } from "@/graphql/queries"; import AssignmentIntroductionView from "@/pages/learningPath/learningContentPage/assignment/AssignmentIntroductionView.vue"; @@ -13,14 +15,12 @@ import type { AssignmentTask, LearningContentAssignment, } from "@/types"; +import { learningContentTypeData } from "@/utils/typeMaps"; import { useMutation, useQuery } from "@urql/vue"; import { useRouteQuery } from "@vueuse/router"; +import { useTranslation } from "i18next-vue"; import * as log from "loglevel"; import { computed, onMounted, ref, watchEffect } from "vue"; -import { useTranslation } from "i18next-vue"; -import { learningContentTypeData } from "@/utils/typeMaps"; -import EvaluationSummary from "@/components/assignment/evaluation/EvaluationSummary.vue"; -import { bustItGetCache } from "@/fetchHelpers"; const { t } = useTranslation(); const courseSession = useCurrentCourseSession(); diff --git a/client/src/pages/learningPath/learningContentPage/assignment/AttachmentSection.vue b/client/src/pages/learningPath/learningContentPage/assignment/AttachmentSection.vue index 62738a83..05c43cb9 100644 --- a/client/src/pages/learningPath/learningContentPage/assignment/AttachmentSection.vue +++ b/client/src/pages/learningPath/learningContentPage/assignment/AttachmentSection.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> -import { ref, watch } from "vue"; -import type { UserDataFileInfo } from "@/types"; import { useFileUpload } from "@/composables"; +import type { UserDataFileInfo } from "@/types"; +import { ref, watch } from "vue"; const props = defineProps<{ fileInfo: UserDataFileInfo | null; diff --git a/client/src/pages/learningPath/learningContentPage/attendanceCourse/AttendanceCourse.vue b/client/src/pages/learningPath/learningContentPage/attendanceCourse/AttendanceCourse.vue index 44d8c31c..d4efd26b 100644 --- a/client/src/pages/learningPath/learningContentPage/attendanceCourse/AttendanceCourse.vue +++ b/client/src/pages/learningPath/learningContentPage/attendanceCourse/AttendanceCourse.vue @@ -28,8 +28,8 @@ <script setup lang="ts"> import { formatDueDate } from "@/components/dueDates/dueDatesUtils"; -import { computed } from "vue"; import type { CourseSessionAttendanceCourseObjectType } from "@/gql/graphql"; +import { computed } from "vue"; export interface Props { attendanceCourse: CourseSessionAttendanceCourseObjectType; diff --git a/client/src/pages/learningPath/learningContentPage/blocks/AttendanceCourseBlock.vue b/client/src/pages/learningPath/learningContentPage/blocks/AttendanceCourseBlock.vue index 1b960955..55be1e38 100644 --- a/client/src/pages/learningPath/learningContentPage/blocks/AttendanceCourseBlock.vue +++ b/client/src/pages/learningPath/learningContentPage/blocks/AttendanceCourseBlock.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> +import { useCourseSessionDetailQuery } from "@/composables"; import AttendanceCourse from "@/pages/learningPath/learningContentPage/attendanceCourse/AttendanceCourse.vue"; import type { LearningContentAttendanceCourse } from "@/types"; import { computed } from "vue"; import LearningContentSimpleLayout from "../layouts/LearningContentSimpleLayout.vue"; -import { useCourseSessionDetailQuery } from "@/composables"; const props = defineProps<{ content: LearningContentAttendanceCourse; diff --git a/client/src/pages/learningPath/learningContentPage/blocks/DocumentListBlock.vue b/client/src/pages/learningPath/learningContentPage/blocks/DocumentListBlock.vue index 9379086b..4b9845c2 100644 --- a/client/src/pages/learningPath/learningContentPage/blocks/DocumentListBlock.vue +++ b/client/src/pages/learningPath/learningContentPage/blocks/DocumentListBlock.vue @@ -1,13 +1,13 @@ <script setup lang="ts"> import MediaLink from "@/components/mediaLibrary/MediaLink.vue"; +import { itGetCached } from "@/fetchHelpers"; import type { LearningContentDocumentList, MediaLibraryContentBlockValue, } from "@/types"; -import LearningContentSimpleLayout from "../layouts/LearningContentSimpleLayout.vue"; -import { onMounted, ref } from "vue"; import log from "loglevel"; -import { itGetCached } from "@/fetchHelpers"; +import { onMounted, ref } from "vue"; +import LearningContentSimpleLayout from "../layouts/LearningContentSimpleLayout.vue"; const props = defineProps<{ content: LearningContentDocumentList; diff --git a/client/src/pages/learningPath/learningContentPage/blocks/EdoniqTestBlock.vue b/client/src/pages/learningPath/learningContentPage/blocks/EdoniqTestBlock.vue index cb5d81b2..5b555b34 100644 --- a/client/src/pages/learningPath/learningContentPage/blocks/EdoniqTestBlock.vue +++ b/client/src/pages/learningPath/learningContentPage/blocks/EdoniqTestBlock.vue @@ -1,17 +1,17 @@ <script setup lang="ts"> -import { useTranslation } from "i18next-vue"; +import { formatDueDate, getDateString } from "@/components/dueDates/dueDatesUtils"; import ItCheckbox from "@/components/ui/ItCheckbox.vue"; +import ItSuccessAlert from "@/components/ui/ItSuccessAlert.vue"; +import { useCourseSessionDetailQuery, useCurrentCourseSession } from "@/composables"; +import { itPost } from "@/fetchHelpers"; +import { ASSIGNMENT_COMPLETION_QUERY } from "@/graphql/queries"; import LearningContentSimpleLayout from "@/pages/learningPath/learningContentPage/layouts/LearningContentSimpleLayout.vue"; import type { AssignmentCompletion, LearningContentEdoniqTest } from "@/types"; -import { computed, ref } from "vue"; -import * as log from "loglevel"; -import { itPost } from "@/fetchHelpers"; import { useQuery } from "@urql/vue"; -import { ASSIGNMENT_COMPLETION_QUERY } from "@/graphql/queries"; -import { useCourseSessionDetailQuery, useCurrentCourseSession } from "@/composables"; import dayjs from "dayjs"; -import ItSuccessAlert from "@/components/ui/ItSuccessAlert.vue"; -import { formatDueDate, getDateString } from "@/components/dueDates/dueDatesUtils"; +import { useTranslation } from "i18next-vue"; +import * as log from "loglevel"; +import { computed, ref } from "vue"; const { t } = useTranslation(); diff --git a/client/src/pages/learningPath/learningContentPage/blocks/PlaceholderBlock.vue b/client/src/pages/learningPath/learningContentPage/blocks/PlaceholderBlock.vue index bf8e7afb..7056f529 100644 --- a/client/src/pages/learningPath/learningContentPage/blocks/PlaceholderBlock.vue +++ b/client/src/pages/learningPath/learningContentPage/blocks/PlaceholderBlock.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> +import RichText from "@/components/ui/RichText.vue"; import LearningContentSimpleLayout from "@/pages/learningPath/learningContentPage/layouts/LearningContentSimpleLayout.vue"; import type { LearningContent } from "@/types"; -import RichText from "@/components/ui/RichText.vue"; const props = defineProps<{ content: LearningContent; diff --git a/client/src/pages/learningPath/learningContentPage/blocks/RichTextBlock.vue b/client/src/pages/learningPath/learningContentPage/blocks/RichTextBlock.vue index a9f71691..ccfd8d9c 100644 --- a/client/src/pages/learningPath/learningContentPage/blocks/RichTextBlock.vue +++ b/client/src/pages/learningPath/learningContentPage/blocks/RichTextBlock.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> +import RichText from "@/components/ui/RichText.vue"; import LearningContentSimpleLayout from "@/pages/learningPath/learningContentPage/layouts/LearningContentSimpleLayout.vue"; import type { LearningContentRichText } from "@/types"; -import RichText from "@/components/ui/RichText.vue"; const props = defineProps<{ content: LearningContentRichText; diff --git a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue index 0da667ea..bd7a1995 100644 --- a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue +++ b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue @@ -1,15 +1,15 @@ <script setup lang="ts"> +import { useCourseSessionDetailQuery, useCurrentCourseSession } from "@/composables"; +import { bustItGetCache } from "@/fetchHelpers"; import { graphql } from "@/gql"; import FeedbackCompletition from "@/pages/learningPath/learningContentPage/feedback/FeedbackCompletition.vue"; import LearningContentMultiLayout from "@/pages/learningPath/learningContentPage/layouts/LearningContentMultiLayout.vue"; +import { useUserStore } from "@/stores/user"; import type { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types"; import { useMutation } from "@urql/vue"; import { useRouteQuery } from "@vueuse/router"; import log from "loglevel"; import { computed, onMounted, reactive, ref } from "vue"; -import { useCourseSessionDetailQuery, useCurrentCourseSession } from "@/composables"; -import { bustItGetCache } from "@/fetchHelpers"; -import { useUserStore } from "@/stores/user"; const props = defineProps<{ content: LearningContentFeedbackVV | LearningContentFeedbackUK; diff --git a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockUK.vue b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockUK.vue index 0c0f00e8..c6314068 100644 --- a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockUK.vue +++ b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockUK.vue @@ -1,16 +1,16 @@ <script setup lang="ts"> import ItRadioGroup from "@/components/ui/ItRadioGroup.vue"; import ItTextarea from "@/components/ui/ItTextarea.vue"; +import { useCourseSessionDetailQuery } from "@/composables"; import { PERCENTAGES, RATINGS, YES_NO, } from "@/pages/learningPath/learningContentPage/feedback/feedback.constants"; -import type { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types"; -import { computed } from "vue"; -import { useTranslation } from "i18next-vue"; -import { useCourseSessionDetailQuery } from "@/composables"; import FeedbackBase from "@/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue"; +import type { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types"; +import { useTranslation } from "i18next-vue"; +import { computed } from "vue"; const props = defineProps<{ content: LearningContentFeedbackVV | LearningContentFeedbackUK; diff --git a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockVV.vue b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockVV.vue index 13279ccc..e5d7712d 100644 --- a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockVV.vue +++ b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockVV.vue @@ -6,8 +6,8 @@ import { RATINGS, YES_NO, } from "@/pages/learningPath/learningContentPage/feedback/feedback.constants"; -import type { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types"; import FeedbackBase from "@/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue"; +import type { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types"; import { useTranslation } from "i18next-vue"; const props = defineProps<{ diff --git a/client/src/pages/learningPath/learningContentPage/layouts/LearningContentFooter.vue b/client/src/pages/learningPath/learningContentPage/layouts/LearningContentFooter.vue index 242c9c9f..d4df8903 100644 --- a/client/src/pages/learningPath/learningContentPage/layouts/LearningContentFooter.vue +++ b/client/src/pages/learningPath/learningContentPage/layouts/LearningContentFooter.vue @@ -1,6 +1,6 @@ <script setup lang="ts"> -import { computed } from "vue"; import { useTranslation } from "i18next-vue"; +import { computed } from "vue"; export type ClosingButtonVariant = "close" | "mark_as_done"; diff --git a/client/src/pages/learningPath/learningContentPage/layouts/LearningContentMultiLayout.vue b/client/src/pages/learningPath/learningContentPage/layouts/LearningContentMultiLayout.vue index 01966d97..c48de150 100644 --- a/client/src/pages/learningPath/learningContentPage/layouts/LearningContentMultiLayout.vue +++ b/client/src/pages/learningPath/learningContentPage/layouts/LearningContentMultiLayout.vue @@ -4,10 +4,10 @@ import ItNavigationProgress from "@/components/ui/ItNavigationProgress.vue"; import type { ClosingButtonVariant } from "@/pages/learningPath/learningContentPage/layouts/LearningContentFooter.vue"; import LearningContentFooter from "@/pages/learningPath/learningContentPage/layouts/LearningContentFooter.vue"; import type { LearningContent } from "@/types"; -import { learningContentTypeData } from "@/utils/typeMaps"; -import { computed } from "vue"; import eventBus from "@/utils/eventBus"; +import { learningContentTypeData } from "@/utils/typeMaps"; import { t } from "i18next"; +import { computed } from "vue"; interface Props { title?: string; diff --git a/client/src/pages/learningPath/learningContentPage/layouts/LearningContentSimpleLayout.vue b/client/src/pages/learningPath/learningContentPage/layouts/LearningContentSimpleLayout.vue index a1bba02c..7ec43621 100644 --- a/client/src/pages/learningPath/learningContentPage/layouts/LearningContentSimpleLayout.vue +++ b/client/src/pages/learningPath/learningContentPage/layouts/LearningContentSimpleLayout.vue @@ -2,10 +2,10 @@ // Basic layout for a learning content that only has a single step import LearningContentFooter from "@/pages/learningPath/learningContentPage/layouts/LearningContentFooter.vue"; import type { LearningContent } from "@/types"; -import { learningContentTypeData } from "@/utils/typeMaps"; -import { computed } from "vue"; import eventBus from "@/utils/eventBus"; +import { learningContentTypeData } from "@/utils/typeMaps"; import { useTranslation } from "i18next-vue"; +import { computed } from "vue"; export interface Props { title?: string; diff --git a/client/src/pages/learningPath/learningPathPage/LearningPathCircleListTile.vue b/client/src/pages/learningPath/learningPathPage/LearningPathCircleListTile.vue index a30f02fa..dbe376dc 100644 --- a/client/src/pages/learningPath/learningPathPage/LearningPathCircleListTile.vue +++ b/client/src/pages/learningPath/learningPathPage/LearningPathCircleListTile.vue @@ -2,8 +2,8 @@ import LearningPathCircle from "@/pages/learningPath/learningPathPage/LearningPathCircle.vue"; import LearningPathContinueButton from "@/pages/learningPath/learningPathPage/LearningPathContinueButton.vue"; import { calculateCircleSectorData } from "@/pages/learningPath/learningPathPage/utils"; -import { computed, ref, watch } from "vue"; import type { CircleType, LearningContentWithCompletion } from "@/types"; +import { computed, ref, watch } from "vue"; const props = defineProps<{ circle: CircleType; diff --git a/client/src/pages/learningPath/learningPathPage/LearningPathPage.vue b/client/src/pages/learningPath/learningPathPage/LearningPathPage.vue index 3d8aecc8..b2620b98 100644 --- a/client/src/pages/learningPath/learningPathPage/LearningPathPage.vue +++ b/client/src/pages/learningPath/learningPathPage/LearningPathPage.vue @@ -1,21 +1,21 @@ <script setup lang="ts"> -import LearningPathListView from "@/pages/learningPath/learningPathPage/LearningPathListView.vue"; -import LearningPathPathView from "@/pages/learningPath/learningPathPage/LearningPathPathView.vue"; -import CircleProgress from "@/pages/learningPath/learningPathPage/LearningPathProgress.vue"; -import LearningPathTopics from "@/pages/learningPath/learningPathPage/LearningPathTopics.vue"; -import LearningPathProfileFilter from "@/pages/learningPath/learningPathPage/LearningPathProfileFilter.vue"; -import type { ViewType } from "@/pages/learningPath/learningPathPage/LearningPathViewSwitch.vue"; -import LearningPathViewSwitch from "@/pages/learningPath/learningPathPage/LearningPathViewSwitch.vue"; -import { breakpointsTailwind, useBreakpoints } from "@vueuse/core"; -import { computed, ref } from "vue"; +import CourseSessionDueDatesList from "@/components/dueDates/CourseSessionDueDatesList.vue"; import { useCourseCircleProgress, useCourseDataWithCompletion, useCurrentCourseSession, } from "@/composables"; -import CourseSessionDueDatesList from "@/components/dueDates/CourseSessionDueDatesList.vue"; -import { useMutation } from "@urql/vue"; import { UPDATE_COURSE_PROFILE_MUTATION } from "@/graphql/mutations"; +import LearningPathListView from "@/pages/learningPath/learningPathPage/LearningPathListView.vue"; +import LearningPathPathView from "@/pages/learningPath/learningPathPage/LearningPathPathView.vue"; +import LearningPathProfileFilter from "@/pages/learningPath/learningPathPage/LearningPathProfileFilter.vue"; +import CircleProgress from "@/pages/learningPath/learningPathPage/LearningPathProgress.vue"; +import LearningPathTopics from "@/pages/learningPath/learningPathPage/LearningPathTopics.vue"; +import type { ViewType } from "@/pages/learningPath/learningPathPage/LearningPathViewSwitch.vue"; +import LearningPathViewSwitch from "@/pages/learningPath/learningPathPage/LearningPathViewSwitch.vue"; +import { useMutation } from "@urql/vue"; +import { breakpointsTailwind, useBreakpoints } from "@vueuse/core"; +import { computed, ref } from "vue"; import { filterCircles, useCourseFilter } from "./utils"; const props = defineProps<{ diff --git a/client/src/pages/learningPath/learningPathPage/LearningPathPathTopic.vue b/client/src/pages/learningPath/learningPathPage/LearningPathPathTopic.vue index dbcbded5..c79130f6 100644 --- a/client/src/pages/learningPath/learningPathPage/LearningPathPathTopic.vue +++ b/client/src/pages/learningPath/learningPathPage/LearningPathPathTopic.vue @@ -1,6 +1,6 @@ <script setup lang="ts"> -import { computed } from "vue"; import type { LearningContentWithCompletion, TopicType } from "@/types"; +import { computed } from "vue"; import LearningPathCircleColumn from "./LearningPathCircleColumn.vue"; import { filterCircles } from "./utils"; diff --git a/client/src/pages/learningPath/learningPathPage/LearningPathPathView.vue b/client/src/pages/learningPath/learningPathPage/LearningPathPathView.vue index 0b6353ab..096ef66c 100644 --- a/client/src/pages/learningPath/learningPathPage/LearningPathPathView.vue +++ b/client/src/pages/learningPath/learningPathPage/LearningPathPathView.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> +import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; import LearningPathScrollButton from "@/pages/learningPath/learningPathPage/LearningPathScrollButton.vue"; +import type { LearningContentWithCompletion, LearningPathType } from "@/types"; import { useScroll } from "@vueuse/core"; import { computed, nextTick, ref, watch } from "vue"; -import type { LearningContentWithCompletion, LearningPathType } from "@/types"; -import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; import LearningPathPathTopic from "./LearningPathPathTopic.vue"; const props = defineProps<{ diff --git a/client/src/pages/learningPath/selfEvaluationPage/SelfEvaluationPage.vue b/client/src/pages/learningPath/selfEvaluationPage/SelfEvaluationPage.vue index 3fabaef7..88b8d7b3 100644 --- a/client/src/pages/learningPath/selfEvaluationPage/SelfEvaluationPage.vue +++ b/client/src/pages/learningPath/selfEvaluationPage/SelfEvaluationPage.vue @@ -2,8 +2,8 @@ import * as log from "loglevel"; import SelfEvaluation from "@/components/learningPath/SelfEvaluation.vue"; -import { computed } from "vue"; import { useCourseDataWithCompletion } from "@/composables"; +import { computed } from "vue"; log.debug("LearningUnitSelfEvaluationView created"); diff --git a/client/src/pages/learningPath/selfEvaluationPage/SelfEvaluationRequestFeedbackPage.vue b/client/src/pages/learningPath/selfEvaluationPage/SelfEvaluationRequestFeedbackPage.vue index 1c05a0df..1fff650f 100644 --- a/client/src/pages/learningPath/selfEvaluationPage/SelfEvaluationRequestFeedbackPage.vue +++ b/client/src/pages/learningPath/selfEvaluationPage/SelfEvaluationRequestFeedbackPage.vue @@ -1,14 +1,14 @@ <script setup lang="ts"> -import type { LearningUnit, LearningUnitPerformanceCriteria } from "@/types"; -import { useMyLearningMentors } from "@/composables"; -import { computed, ref } from "vue"; -import ItButton from "@/components/ui/ItButton.vue"; import NoMentorInformationPanel from "@/components/learningMentor/NoMentorInformationPanel.vue"; -import { useSelfEvaluationFeedback } from "@/services/selfEvaluationFeedback"; -import FeedbackRequestedInformationPanel from "@/components/selfEvaluationFeedback/FeedbackRequestedInformationPanel.vue"; import FeedbackReceived from "@/components/selfEvaluationFeedback/FeedbackReceived.vue"; import FeedbackRequested from "@/components/selfEvaluationFeedback/FeedbackRequested.vue"; +import FeedbackRequestedInformationPanel from "@/components/selfEvaluationFeedback/FeedbackRequestedInformationPanel.vue"; +import ItButton from "@/components/ui/ItButton.vue"; import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; +import { useMyLearningMentors } from "@/composables"; +import { useSelfEvaluationFeedback } from "@/services/selfEvaluationFeedback"; +import type { LearningUnit, LearningUnitPerformanceCriteria } from "@/types"; +import { computed, ref } from "vue"; const props = defineProps<{ learningUnit: LearningUnit; diff --git a/client/src/pages/mediaLibrary/MediaLibraryCategoryPage.vue b/client/src/pages/mediaLibrary/MediaLibraryCategoryPage.vue index 303587da..373f6754 100644 --- a/client/src/pages/mediaLibrary/MediaLibraryCategoryPage.vue +++ b/client/src/pages/mediaLibrary/MediaLibraryCategoryPage.vue @@ -1,8 +1,8 @@ <script setup lang="ts"> import { useMediaLibraryStore } from "@/stores/mediaLibrary"; +import type { MediaLibraryCategoryPage } from "@/types"; import * as log from "loglevel"; import { computed } from "vue"; -import type { MediaLibraryCategoryPage } from "@/types"; const props = defineProps<{ categorySlug: string; diff --git a/client/src/pages/mediaLibrary/MediaLibraryContentPage.vue b/client/src/pages/mediaLibrary/MediaLibraryContentPage.vue index d7d182ee..c33c31b4 100644 --- a/client/src/pages/mediaLibrary/MediaLibraryContentPage.vue +++ b/client/src/pages/mediaLibrary/MediaLibraryContentPage.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> +import RichText from "@/components/ui/RichText.vue"; import { useMediaLibraryStore } from "@/stores/mediaLibrary"; +import type { MediaLibraryCategoryPage, MediaLibraryContentPage } from "@/types"; import * as log from "loglevel"; import { computed } from "vue"; -import type { MediaLibraryCategoryPage, MediaLibraryContentPage } from "@/types"; -import RichText from "@/components/ui/RichText.vue"; const props = defineProps<{ categorySlug: string; diff --git a/client/src/pages/mediaLibrary/MediaLibraryIndexPage.vue b/client/src/pages/mediaLibrary/MediaLibraryIndexPage.vue index 1e7beacb..1ca91914 100644 --- a/client/src/pages/mediaLibrary/MediaLibraryIndexPage.vue +++ b/client/src/pages/mediaLibrary/MediaLibraryIndexPage.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> +import OverviewCard from "@/components/mediaLibrary/OverviewCard.vue"; import { useMediaLibraryStore } from "@/stores/mediaLibrary"; import * as log from "loglevel"; -import OverviewCard from "@/components/mediaLibrary/OverviewCard.vue"; log.debug("MediaLibraryIndexPage created"); const mediaStore = useMediaLibraryStore(); diff --git a/client/src/pages/onboarding/AccountConfirm.vue b/client/src/pages/onboarding/AccountConfirm.vue index 8750119b..03196e13 100644 --- a/client/src/pages/onboarding/AccountConfirm.vue +++ b/client/src/pages/onboarding/AccountConfirm.vue @@ -1,7 +1,7 @@ <script setup lang="ts"> +import InfoBox from "@/components/onboarding/InfoBox.vue"; import WizardPage from "@/components/onboarding/WizardPage.vue"; import { useUserStore } from "@/stores/user"; -import InfoBox from "@/components/onboarding/InfoBox.vue"; const userStore = useUserStore(); </script> diff --git a/client/src/pages/onboarding/AccountProfile.vue b/client/src/pages/onboarding/AccountProfile.vue index 727dd96e..030e89c1 100644 --- a/client/src/pages/onboarding/AccountProfile.vue +++ b/client/src/pages/onboarding/AccountProfile.vue @@ -1,13 +1,13 @@ <script setup lang="ts"> import WizardPage from "@/components/onboarding/WizardPage.vue"; -import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; -import { computed, ref, watch } from "vue"; -import { useUserStore } from "@/stores/user"; -import { useRoute, useRouter } from "vue-router"; -import { useTranslation } from "i18next-vue"; -import { isOtherOrganisation, profileNextRoute } from "@/services/onboarding"; -import { useEntities } from "@/services/entities"; import AvatarImage from "@/components/ui/AvatarImage.vue"; +import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; +import { useEntities } from "@/services/entities"; +import { isOtherOrganisation, profileNextRoute } from "@/services/onboarding"; +import { useUserStore } from "@/stores/user"; +import { useTranslation } from "i18next-vue"; +import { computed, ref, watch } from "vue"; +import { useRoute, useRouter } from "vue-router"; const { t } = useTranslation(); diff --git a/client/src/pages/onboarding/AccountSetup.vue b/client/src/pages/onboarding/AccountSetup.vue index 2f7a69b7..d9324a95 100644 --- a/client/src/pages/onboarding/AccountSetup.vue +++ b/client/src/pages/onboarding/AccountSetup.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> import WizardPage from "@/components/onboarding/WizardPage.vue"; -import { useUserStore } from "@/stores/user"; import { getLoginURL, getSignUpURL } from "@/router/utils"; -import { useRoute } from "vue-router"; +import { useUserStore } from "@/stores/user"; import { computed } from "vue"; +import { useRoute } from "vue-router"; const props = defineProps({ courseType: { diff --git a/client/src/pages/onboarding/WizardBase.vue b/client/src/pages/onboarding/WizardBase.vue index c0d7c9f8..8676399a 100644 --- a/client/src/pages/onboarding/WizardBase.vue +++ b/client/src/pages/onboarding/WizardBase.vue @@ -1,11 +1,11 @@ <script setup lang="ts"> -import WizardSidePanel from "@/components/onboarding/WizardSidePanel.vue"; -import { computed } from "vue"; import mood_uk from "@/assets/images/mood_uk.jpg"; import mood_vv from "@/assets/images/mood_vv.jpg"; +import WizardSidePanel from "@/components/onboarding/WizardSidePanel.vue"; +import { getVVCourseName } from "@/pages/onboarding/vv/composables"; import { useTranslation } from "i18next-vue"; import { startsWith } from "lodash"; -import { getVVCourseName } from "@/pages/onboarding/vv/composables"; +import { computed } from "vue"; const props = defineProps({ courseType: { diff --git a/client/src/pages/onboarding/uk/SetupComplete.vue b/client/src/pages/onboarding/uk/SetupComplete.vue index 7f7276c5..af76fd1b 100644 --- a/client/src/pages/onboarding/uk/SetupComplete.vue +++ b/client/src/pages/onboarding/uk/SetupComplete.vue @@ -1,6 +1,6 @@ <script setup lang="ts"> -import WizardPage from "@/components/onboarding/WizardPage.vue"; import InfoBox from "@/components/onboarding/InfoBox.vue"; +import WizardPage from "@/components/onboarding/WizardPage.vue"; import { ref } from "vue"; // This page will probably not be reached with a course session already assigned. diff --git a/client/src/pages/onboarding/vv/CheckoutAddress.vue b/client/src/pages/onboarding/vv/CheckoutAddress.vue index 918dc3a3..df9e3122 100644 --- a/client/src/pages/onboarding/vv/CheckoutAddress.vue +++ b/client/src/pages/onboarding/vv/CheckoutAddress.vue @@ -1,24 +1,24 @@ <script setup lang="ts"> -import WizardPage from "@/components/onboarding/WizardPage.vue"; -import { computed, ref, watch } from "vue"; -import { type User, useUserStore } from "@/stores/user"; -import PersonalAddress from "@/components/onboarding/PersonalAddress.vue"; -import OrganisationAddress from "@/components/onboarding/OrganisationAddress.vue"; -import { itPost } from "@/fetchHelpers"; -import { useEntities } from "@/services/entities"; -import { useRoute } from "vue-router"; -import { useTranslation } from "i18next-vue"; -import { getVVCourseName } from "./composables"; import DatatransCembraDeviceFingerprint from "@/components/onboarding/DatatransCembraDeviceFingerprint.vue"; -import { getLocalSessionKey } from "@/statistics"; -import log from "loglevel"; -import { normalizeSwissPhoneNumber, validatePhoneNumber } from "@/utils/phone"; +import OrganisationAddress from "@/components/onboarding/OrganisationAddress.vue"; +import PersonalAddress from "@/components/onboarding/PersonalAddress.vue"; +import WizardPage from "@/components/onboarding/WizardPage.vue"; import { ORGANISATION_NO_COMPANY_ID, ORGANISATION_OTHER_BROKER_ID, ORGANISATION_OTHER_HEALTH_INSURANCE_ID, ORGANISATION_OTHER_PRIVATE_INSURANCE_ID, } from "@/consts"; +import { itPost } from "@/fetchHelpers"; +import { useEntities } from "@/services/entities"; +import { getLocalSessionKey } from "@/statistics"; +import { type User, useUserStore } from "@/stores/user"; +import { normalizeSwissPhoneNumber, validatePhoneNumber } from "@/utils/phone"; +import { useTranslation } from "i18next-vue"; +import log from "loglevel"; +import { computed, ref, watch } from "vue"; +import { useRoute } from "vue-router"; +import { getVVCourseName } from "./composables"; const props = defineProps({ courseType: { diff --git a/client/src/pages/personalProfile/PersonalProfilePage.vue b/client/src/pages/personalProfile/PersonalProfilePage.vue index 99312b07..401b53c0 100644 --- a/client/src/pages/personalProfile/PersonalProfilePage.vue +++ b/client/src/pages/personalProfile/PersonalProfilePage.vue @@ -3,8 +3,8 @@ import { useUserStore } from "@/stores/user"; import { ref } from "vue"; -import ProfileView from "@/components/personalProfile/ProfileView.vue"; import ProfileEdit from "@/components/personalProfile/ProfileEdit.vue"; +import ProfileView from "@/components/personalProfile/ProfileView.vue"; const user = useUserStore(); const editMode = ref(false); diff --git a/client/src/pages/start/VVStartPage.vue b/client/src/pages/start/VVStartPage.vue index 1b55cde8..3cc022d3 100644 --- a/client/src/pages/start/VVStartPage.vue +++ b/client/src/pages/start/VVStartPage.vue @@ -1,6 +1,6 @@ <script setup lang="ts"> -import { useTranslation } from "i18next-vue"; import StartPageFooter from "@/components/start/StartPageFooter.vue"; +import { useTranslation } from "i18next-vue"; const { t } = useTranslation(); </script> diff --git a/client/src/pages/userProfile/LearningPathProfilePage.vue b/client/src/pages/userProfile/LearningPathProfilePage.vue index ca7921c9..d6ab1fd2 100644 --- a/client/src/pages/userProfile/LearningPathProfilePage.vue +++ b/client/src/pages/userProfile/LearningPathProfilePage.vue @@ -1,11 +1,11 @@ <script setup lang="ts"> -import { useCourseDataWithCompletion } from "@/composables"; import UserProfileContent from "@/components/userProfile/UserProfileContent.vue"; -import LearningSequence from "@/pages/learningPath/circlePage/LearningSequence.vue"; -import { computed, ref, watch } from "vue"; -import type { CircleType } from "@/types"; +import { useCourseDataWithCompletion } from "@/composables"; import { COURSE_QUERY } from "@/graphql/queries"; +import LearningSequence from "@/pages/learningPath/circlePage/LearningSequence.vue"; +import type { CircleType } from "@/types"; import { useQuery } from "@urql/vue"; +import { computed, ref, watch } from "vue"; import UserProfileTopicList from "./UserProfileTopicList.vue"; const props = defineProps<{ diff --git a/client/src/pages/userProfile/UserProfilePage.vue b/client/src/pages/userProfile/UserProfilePage.vue index b98e8126..30e24429 100644 --- a/client/src/pages/userProfile/UserProfilePage.vue +++ b/client/src/pages/userProfile/UserProfilePage.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> +import { useCurrentCourseSession } from "@/composables"; +import { useFetch } from "@vueuse/core"; +import { useTranslation } from "i18next-vue"; import { onMounted } from "vue"; import { useRoute, useRouter } from "vue-router"; -import { useTranslation } from "i18next-vue"; -import { useFetch } from "@vueuse/core"; -import { useCurrentCourseSession } from "@/composables"; const props = defineProps<{ userId: string; diff --git a/client/src/pages/userProfile/UserProfileTopicList.vue b/client/src/pages/userProfile/UserProfileTopicList.vue index f4bebc55..eab026ff 100644 --- a/client/src/pages/userProfile/UserProfileTopicList.vue +++ b/client/src/pages/userProfile/UserProfileTopicList.vue @@ -1,9 +1,9 @@ <script setup lang="ts"> -import type { CircleType, TopicType } from "@/types"; -import { calculateCircleSectorData } from "@/pages/learningPath/learningPathPage/utils"; -import LearningPathCircle from "../learningPath/learningPathPage/LearningPathCircle.vue"; -import { computed } from "vue"; import { COURSE_PROFILE_ALL_FILTER } from "@/constants"; +import { calculateCircleSectorData } from "@/pages/learningPath/learningPathPage/utils"; +import type { CircleType, TopicType } from "@/types"; +import { computed } from "vue"; +import LearningPathCircle from "../learningPath/learningPathPage/LearningPathCircle.vue"; interface Props { topic: TopicType; diff --git a/client/src/services/onboarding.ts b/client/src/services/onboarding.ts index 1b2e4d5e..7a351477 100644 --- a/client/src/services/onboarding.ts +++ b/client/src/services/onboarding.ts @@ -1,9 +1,9 @@ -import { isString, startsWith } from "lodash"; import { ORGANISATION_OTHER_BROKER_ID, ORGANISATION_OTHER_HEALTH_INSURANCE_ID, ORGANISATION_OTHER_PRIVATE_INSURANCE_ID, } from "@/consts"; +import { isString, startsWith } from "lodash"; export function profileNextRoute(courseType: string | string[]) { if (courseType === "uk") { diff --git a/server/vbv_lernwelt/course_session/tests/test_attendance_export.py b/server/vbv_lernwelt/course_session/tests/test_attendance_export.py index 9b8ebb48..eb217f4b 100644 --- a/server/vbv_lernwelt/course_session/tests/test_attendance_export.py +++ b/server/vbv_lernwelt/course_session/tests/test_attendance_export.py @@ -16,7 +16,6 @@ class ExportBaseTestCase(TestCase): def _check_export(self, wb, expected_data, max_row, max_col): for row in wb.active.iter_rows(max_col=max_col, max_row=max_row): for cell in row: - print(cell.value) self.assertEqual( cell.value, expected_data[row[0].row - 1][row.index(cell)] )