Skip to content

Commit

Permalink
Merge branch 'develop' into feature/general/animate-sidebar-on-toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
PaRangger authored Oct 5, 2024
2 parents fc1d2ae + 73e94ec commit a2d9b4e
Show file tree
Hide file tree
Showing 307 changed files with 4,985 additions and 1,907 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/check-translation-keys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,4 @@ jobs:
with:
python-version: "3.12"
- name: Check if translation keys match
run: >
python .ci/translation-file-checker/translation_file_checker.py
--german-files src/main/webapp/i18n/de/
--english-files src/main/webapp/i18n/en/
run: python .ci/translation-file-checker/translation_file_checker.py --german-files src/main/webapp/i18n/de/ --english-files src/main/webapp/i18n/en/
2 changes: 1 addition & 1 deletion .idea/runConfigurations/_template__of_Gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package de.tum.cit.aet.artemis.atlas.dto;

import java.time.ZonedDateTime;
import java.util.Optional;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
public record CompetencyImportOptionsDTO(Set<Long> competencyIds, Optional<Long> sourceCourseId, boolean importRelations, boolean importExercises, boolean importLectures,
Optional<ZonedDateTime> referenceDate, boolean isReleaseDate) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ public interface CompetencyRepository extends ArtemisJpaRepository<Competency, L
@Query("""
SELECT c
FROM Competency c
LEFT JOIN FETCH c.exercises
LEFT JOIN FETCH c.lectureUnits lu
LEFT JOIN FETCH lu.lecture l
LEFT JOIN FETCH l.attachments
WHERE c.course.id = :courseId
""")
Set<Competency> findAllForCourse(@Param("courseId") long courseId);
Set<Competency> findAllForCourseWithExercisesAndLectureUnitsAndLecturesAndAttachments(@Param("courseId") long courseId);

@Query("""
SELECT c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,44 @@ public interface CourseCompetencyRepository extends ArtemisJpaRepository<CourseC
""")
Set<CourseCompetency> findAllForCourse(@Param("courseId") long courseId);

@Query("""
SELECT c
FROM CourseCompetency c
LEFT JOIN FETCH c.exercises ex
LEFT JOIN FETCH c.lectureUnits lu
LEFT JOIN FETCH lu.lecture l
LEFT JOIN FETCH l.attachments
WHERE c.course.id = :courseId
""")
Set<CourseCompetency> findAllForCourseWithExercisesAndLectureUnitsAndLecturesAndAttachments(@Param("courseId") long courseId);

@Query("""
SELECT c
FROM CourseCompetency c
LEFT JOIN FETCH c.exercises ex
LEFT JOIN FETCH c.lectureUnits lu
LEFT JOIN FETCH lu.lecture l
LEFT JOIN FETCH l.lectureUnits
LEFT JOIN FETCH l.attachments
WHERE c.id = :id
""")
Optional<CourseCompetency> findByIdWithExercisesAndLectureUnitsAndLectures(@Param("id") long id);

default CourseCompetency findByIdWithExercisesAndLectureUnitsAndLecturesElseThrow(long id) {
return getValueElseThrow(findByIdWithExercisesAndLectureUnitsAndLectures(id), id);
}

@Query("""
SELECT c
FROM CourseCompetency c
LEFT JOIN FETCH c.exercises ex
LEFT JOIN FETCH c.lectureUnits lu
LEFT JOIN FETCH lu.lecture l
LEFT JOIN FETCH l.attachments
WHERE c.id IN :ids
""")
Set<CourseCompetency> findAllByIdWithExercisesAndLectureUnitsAndLecturesAndAttachments(@Param("ids") Set<Long> ids);

/**
* Fetches all information related to the calculation of the mastery for exercises in a competency.
* The complex grouping by is necessary for postgres
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,30 @@ public interface PrerequisiteRepository extends ArtemisJpaRepository<Prerequisit
List<Prerequisite> findAllByCourseIdOrderById(long courseId);

@Query("""
SELECT c
FROM Prerequisite c
WHERE c.course.id = :courseId
SELECT p
FROM Prerequisite p
LEFT JOIN FETCH p.exercises
LEFT JOIN FETCH p.lectureUnits lu
LEFT JOIN FETCH lu.lecture l
LEFT JOIN FETCH l.attachments
WHERE p.course.id = :courseId
""")
Set<Prerequisite> findAllForCourse(@Param("courseId") long courseId);
Set<Prerequisite> findAllForCourseWithExercisesAndLectureUnitsAndLecturesAndAttachments(@Param("courseId") long courseId);

@Query("""
SELECT c
FROM Prerequisite c
LEFT JOIN FETCH c.lectureUnits lu
LEFT JOIN FETCH c.exercises
WHERE c.id = :competencyId
SELECT p
FROM Prerequisite p
LEFT JOIN FETCH p.lectureUnits lu
LEFT JOIN FETCH p.exercises
WHERE p.id = :competencyId
""")
Optional<Prerequisite> findByIdWithLectureUnitsAndExercises(@Param("competencyId") long competencyId);

@Query("""
SELECT c
FROM Prerequisite c
LEFT JOIN FETCH c.lectureUnits lu
WHERE c.id = :competencyId
SELECT p
FROM Prerequisite p
LEFT JOIN FETCH p.lectureUnits lu
WHERE p.id = :competencyId
""")
Optional<Prerequisite> findByIdWithLectureUnits(@Param("competencyId") long competencyId);

Expand Down
Loading

0 comments on commit a2d9b4e

Please sign in to comment.