Skip to content

Commit

Permalink
fix Merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
yassinsws committed Nov 3, 2024
1 parent d3fea7d commit 9626b93
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ public interface LectureUnitRepository extends ArtemisJpaRepository<LectureUnit,
@Query("""
SELECT lu
FROM LectureUnit lu
LEFT JOIN FETCH lu.competencies
LEFT JOIN FETCH lu.exercise exercise
LEFT JOIN FETCH exercise.competencies
LEFT JOIN FETCH lu.competencyLinks cl
LEFT JOIN FETCH cl.competency
LEFT JOIN FETCH lu.exercise e
LEFT JOIN FETCH e.competencyLinks ecl
LEFT JOIN FETCH ecl.competency
LEFT JOIN FETCH lu.slides
WHERE lu.id = :lectureUnitId
""")
Expand All @@ -42,21 +44,27 @@ public interface LectureUnitRepository extends ArtemisJpaRepository<LectureUnit,
@Query("""
SELECT lu
FROM LectureUnit lu
LEFT JOIN FETCH lu.competencies c
LEFT JOIN FETCH c.lectureUnits
LEFT JOIN FETCH lu.exercise ex
LEFT JOIN FETCH ex.competencies
LEFT JOIN FETCH lu.competencyLinks cl
LEFT JOIN FETCH cl.competency c
LEFT JOIN FETCH c.lectureUnitLinks lul
LEFT JOIN FETCH lul.lectureUnit
LEFT JOIN FETCH lu.exercise e
LEFT JOIN FETCH e.competencyLinks ecl
LEFT JOIN FETCH ecl.competency
WHERE lu.id = :lectureUnitId
""")
Optional<LectureUnit> findByIdWithCompetenciesBidirectional(@Param("lectureUnitId") long lectureUnitId);

@Query("""
SELECT lu
FROM LectureUnit lu
LEFT JOIN FETCH lu.competencies c
LEFT JOIN FETCH c.lectureUnits
LEFT JOIN FETCH lu.exercise ex
LEFT JOIN FETCH ex.competencies
LEFT JOIN FETCH lu.competencyLinks cl
LEFT JOIN FETCH cl.competency c
LEFT JOIN FETCH c.lectureUnitLinks lul
LEFT JOIN FETCH lul.lectureUnit
LEFT JOIN FETCH lu.exercise e
LEFT JOIN FETCH e.competencyLinks ecl
LEFT JOIN FETCH ecl.competency
WHERE lu.id IN :lectureUnitIds
""")
Set<LectureUnit> findAllByIdWithCompetenciesBidirectional(@Param("lectureUnitIds") Iterable<Long> longs);
Expand All @@ -82,7 +90,8 @@ public interface LectureUnitRepository extends ArtemisJpaRepository<LectureUnit,
@Query("""
SELECT lu
FROM LectureUnit lu
LEFT JOIN FETCH lu.competencies
LEFT JOIN FETCH lu.competencyLinks cl
LEFT JOIN FETCH cl.competency
WHERE lu.name = :name
AND lu.lecture.title = :lectureTitle
AND lu.lecture.course.id = :courseId
Expand All @@ -105,5 +114,4 @@ default LectureUnit findByIdWithCompetenciesAndSlidesElseThrow(long lectureUnitI
default LectureUnit findByIdElseThrow(long lectureUnitId) {
return getValueElseThrow(findById(lectureUnitId), lectureUnitId);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@
<div class="d-flex gap-1">
@if (lecture.course?.id && showCompetencies) {
<jhi-competencies-popover
[style.flex-grow]="1"
[courseId]="lecture.course!.id!"
[competencies]="lectureUnit.competencies || []"
[competencyLinks]="lectureUnit.competencyLinks || []"
[navigateTo]="'competencyManagement'"
/>
}
Expand All @@ -99,60 +98,60 @@
[navigateTo]="'competencyManagement'"
/>
}
@if (viewButtonAvailable[lectureUnit.id!]) {
<a
type="button"
class="btn btn-primary btn-sm flex-grow-1"
[routerLink]="['/course-management', lecture.course?.id, 'lectures', lecture.id, 'unit-management', 'attachment-units', lectureUnit.id, 'view']"
[ngbTooltip]="'entity.action.view' | artemisTranslate"
>
<fa-icon [icon]="faEye" />
</a>
}
<div class="d-flex gap-1 w-100">
@if (this.emitEditEvents) {
@if (editButtonAvailable(lectureUnit)) {
<button
type="button"
class="btn btn-primary btn-sm edit flex-grow-1"
(click)="onEditButtonClicked(lectureUnit)"
[ngbTooltip]="'entity.action.edit' | artemisTranslate"
>
<fa-icon [icon]="faPencilAlt" />
</button>
}
} @else {
@if (editButtonAvailable(lectureUnit)) {
<a
type="button"
class="btn btn-primary btn-sm edit flex-grow-1"
[routerLink]="['./', routerEditLinksBase[lectureUnit.type!], lectureUnit.id, 'edit']"
[ngbTooltip]="'entity.action.edit' | artemisTranslate"
>
<fa-icon [icon]="faPencilAlt" />
</a>
}
}
@if (lecture.isAtLeastInstructor) {
}
@if (viewButtonAvailable[lectureUnit.id!]) {
<a
type="button"
class="btn btn-primary btn-sm flex-grow-1"
[routerLink]="['/course-management', lecture.course?.id, 'lectures', lecture.id, 'unit-management', 'attachment-units', lectureUnit.id, 'view']"
[ngbTooltip]="'entity.action.view' | artemisTranslate"
>
<fa-icon [icon]="faEye" />
</a>
}
<div class="d-flex gap-1 w-100">
@if (this.emitEditEvents) {
@if (editButtonAvailable(lectureUnit)) {
<button
type="button"
class="btn btn-danger btn-sm flex-grow-1"
jhiDeleteButton
[renderButtonStyle]="false"
[renderButtonText]="false"
[ngbTooltip]="'entity.action.' + getActionType(lectureUnit) | artemisTranslate"
[actionType]="getActionType(lectureUnit)"
[entityTitle]="lectureUnitService.getLectureUnitName(lectureUnit) || ''"
[deleteQuestion]="getDeleteQuestionKey(lectureUnit)"
[deleteConfirmationText]="getDeleteConfirmationTextKey(lectureUnit)"
(delete)="deleteLectureUnit(lectureUnit.id!)"
[dialogError]="dialogError$"
class="btn btn-primary btn-sm edit flex-grow-1"
(click)="onEditButtonClicked(lectureUnit)"
[ngbTooltip]="'entity.action.edit' | artemisTranslate"
>
<fa-icon [icon]="faTrash" />
<fa-icon [icon]="faPencilAlt" />
</button>
}
</div>
}
} @else {
@if (editButtonAvailable(lectureUnit)) {
<a
type="button"
class="btn btn-primary btn-sm edit flex-grow-1"
[routerLink]="['./', routerEditLinksBase[lectureUnit.type!], lectureUnit.id, 'edit']"
[ngbTooltip]="'entity.action.edit' | artemisTranslate"
>
<fa-icon [icon]="faPencilAlt" />
</a>
}
}
@if (lecture.isAtLeastInstructor) {
<button
type="button"
class="btn btn-danger btn-sm flex-grow-1"
jhiDeleteButton
[renderButtonStyle]="false"
[renderButtonText]="false"
[ngbTooltip]="'entity.action.' + getActionType(lectureUnit) | artemisTranslate"
[actionType]="getActionType(lectureUnit)"
[entityTitle]="lectureUnitService.getLectureUnitName(lectureUnit) || ''"
[deleteQuestion]="getDeleteQuestionKey(lectureUnit)"
[deleteConfirmationText]="getDeleteConfirmationTextKey(lectureUnit)"
(delete)="deleteLectureUnit(lectureUnit.id!)"
[dialogError]="dialogError$"
>
<fa-icon [icon]="faTrash" />
</button>
}
</div>
</div>
</div>
}
Expand Down

0 comments on commit 9626b93

Please sign in to comment.