From b8f7c72053ad50f7bacabcb95777594347e6b0d2 Mon Sep 17 00:00:00 2001 From: EwoutV Date: Thu, 9 May 2024 12:03:19 +0200 Subject: [PATCH 01/15] feat: treeview (wip) --- backend/api/serializers/checks_serializer.py | 14 +- frontend/package-lock.json | 2 +- frontend/package.json | 2 +- .../src/components/courses/CourseForm.vue | 133 +++++++++ frontend/src/components/forms/Editor.vue | 12 +- frontend/src/components/layout/Body.vue | 2 +- .../components/projects/ProjectDetailCard.vue | 2 +- .../src/components/projects/ProjectForm.vue | 202 +++++++++++++ .../projects/ProjectStructureTree.vue | 83 ++++++ .../projects/{ => groups}/ChooseGroupCard.vue | 0 .../projects/{ => groups}/JoinedGroupCard.vue | 0 .../ProjectMeter.vue | 0 .../SubmissionCard.vue | 0 frontend/src/main.scss | 7 +- frontend/src/types/Course.ts | 46 +-- frontend/src/types/FileExtension.ts | 14 +- frontend/src/types/Project.ts | 29 +- frontend/src/types/StructureCheck.ts | 38 ++- .../src/views/courses/CreateCourseView.vue | 142 +--------- .../src/views/projects/CreateProjectView.vue | 267 +----------------- .../src/views/projects/UpdateProjectView.vue | 265 +---------------- .../projects/roles/StudentProjectView.vue | 6 +- 22 files changed, 548 insertions(+), 718 deletions(-) create mode 100644 frontend/src/components/courses/CourseForm.vue create mode 100644 frontend/src/components/projects/ProjectForm.vue create mode 100644 frontend/src/components/projects/ProjectStructureTree.vue rename frontend/src/components/projects/{ => groups}/ChooseGroupCard.vue (100%) rename frontend/src/components/projects/{ => groups}/JoinedGroupCard.vue (100%) rename frontend/src/components/{projects => submissions}/ProjectMeter.vue (100%) rename frontend/src/components/{projects => submissions}/SubmissionCard.vue (100%) diff --git a/backend/api/serializers/checks_serializer.py b/backend/api/serializers/checks_serializer.py index a6c06922..c7795168 100644 --- a/backend/api/serializers/checks_serializer.py +++ b/backend/api/serializers/checks_serializer.py @@ -25,15 +25,22 @@ def to_internal_value(self, data): # TODO: Support partial updates class StructureCheckSerializer(serializers.ModelSerializer): - project = serializers.HyperlinkedRelatedField( view_name="project-detail", read_only=True ) - obligated_extensions = FileExtensionSerializer(many=True, required=False, default=[]) + obligated_extensions = FileExtensionSerializer( + many=True, + required=False, + default=[] + ) - blocked_extensions = FileExtensionSerializer(many=True, required=False, default=[]) + blocked_extensions = FileExtensionSerializer( + many=True, + required=False, + default=[] + ) class Meta: model = StructureCheck @@ -81,7 +88,6 @@ def to_internal_value(self, data): class ExtraCheckSerializer(serializers.ModelSerializer): - project = serializers.HyperlinkedRelatedField( view_name="project-detail", read_only=True diff --git a/frontend/package-lock.json b/frontend/package-lock.json index d88cf18d..6189c3b4 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -19,7 +19,7 @@ "pinia": "^2.1.7", "primeflex": "^3.3.1", "primeicons": "^7.0.0", - "primevue": "^3.50.0", + "primevue": "^3.52.0", "quill": "^1.3.7", "vue": "^3.4.18", "vue-i18n": "^9.10.2", diff --git a/frontend/package.json b/frontend/package.json index 833a4f53..38241a94 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -26,7 +26,7 @@ "pinia": "^2.1.7", "primeflex": "^3.3.1", "primeicons": "^7.0.0", - "primevue": "^3.50.0", + "primevue": "^3.52.0", "quill": "^1.3.7", "vue": "^3.4.18", "vue-i18n": "^9.10.2", diff --git a/frontend/src/components/courses/CourseForm.vue b/frontend/src/components/courses/CourseForm.vue new file mode 100644 index 00000000..a8a3df3e --- /dev/null +++ b/frontend/src/components/courses/CourseForm.vue @@ -0,0 +1,133 @@ + + +