This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 5aee09e2 authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Merge branch '460-collections-mehr-hervorheben' into 'development'

Resolve "Collections mehr hervorheben"

See merge request !230
parents a800cccb 672061db
Branches
2 merge requests!231New Deployment into production and update gitlab,!230Resolve "Collections mehr hervorheben"
Showing
with 87 additions and 32 deletions
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
"OEResourceType": "Audience", "OEResourceType": "Audience",
"type": "java.lang.String", "type": "java.lang.String",
"required": "OPTIONAL", "required": "OPTIONAL",
"extraEntries": ["Anfänger", "Fortgeschrittene"] "extraEntries": ["Anfänger"]
}, },
{ {
"property": "educationalLevel", "property": "educationalLevel",
......
import { HttpResponse } from '@angular/common/http'; import { HttpResponse } from '@angular/common/http';
import { AfterViewInit, Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { AfterViewInit, Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { faArrowRight, faFolderOpen } from '@fortawesome/free-solid-svg-icons'; import { faArrowRight } from '@fortawesome/free-solid-svg-icons';
import { ReviewManagementService } from 'app/admin/review-management/review-management.service'; import { ReviewManagementService } from 'app/admin/review-management/review-management.service';
import { ApplicationInfoService } from 'app/core/application/applicationInfo.service'; import { ApplicationInfoService } from 'app/core/application/applicationInfo.service';
import { Account } from 'app/core/auth/account.model'; import { Account } from 'app/core/auth/account.model';
...@@ -84,7 +84,11 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy, AfterViewInit { ...@@ -84,7 +84,11 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy, AfterViewInit {
return this.exercise; return this.exercise;
} }
set referencedExercise(exercise: SearchResultDTO | undefined) { set referencedExercise(exercise: SearchResultDTO | undefined) {
this.exercise = exercise as ExtendedSearchResultDTO; const newExercise = exercise as ExtendedSearchResultDTO;
if (newExercise && newExercise.exerciseId !== this.exercise?.exerciseId) {
this.exercise = exercise as ExtendedSearchResultDTO;
this.updateParent(this.exercise);
}
} }
exercise: ExtendedSearchResultDTO | undefined; exercise: ExtendedSearchResultDTO | undefined;
...@@ -100,7 +104,6 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy, AfterViewInit { ...@@ -100,7 +104,6 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy, AfterViewInit {
likeSubscription?: Subscription; likeSubscription?: Subscription;
authenticated = false; authenticated = false;
treeIcon = faFolderOpen;
faArrowRight = faArrowRight; faArrowRight = faArrowRight;
oerLink?: string; oerLink?: string;
...@@ -206,8 +209,10 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy, AfterViewInit { ...@@ -206,8 +209,10 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy, AfterViewInit {
this.router.navigate(['/search'], { queryParams: { p: parentId } }); this.router.navigate(['/search'], { queryParams: { p: parentId } });
} }
toParent(parentId: string): void { toParent(): void {
this.toExercise(parentId); if (this.referencedExercise) {
this.toExercise(this.referencedExercise.file.parentId);
}
} }
toExercise(exerciseId: string): void { toExercise(exerciseId: string): void {
...@@ -313,6 +318,8 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy, AfterViewInit { ...@@ -313,6 +318,8 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy, AfterViewInit {
alert(`exercise ${exercise.file.parentId} cannot be loaded`); alert(`exercise ${exercise.file.parentId} cannot be loaded`);
}, },
}); });
} else {
this.parent = undefined;
} }
} }
......
:host {
font-size: small;
}
.exerciseTitle {
font-weight: bold;
cursor: hand;
}
.exerciseParent {
font-style: italic;
}
.childTitle {
cursor: hand;
}
<div><span class="info" jhiTranslate="exercise.details.collectionInfo">Collection info</span>:</div>
<div *ngIf="this.exerciseBodyComponent?.parent" class="exerciseParent" [ngbTooltip]="helpToParent">
<fa-icon style="padding: 5px 0px 0px 5px" container="body" [icon]="upIcon"></fa-icon
><span (click)="exerciseBodyComponent!.toParent()">..({{ this.exerciseBodyComponent!.parent!.metadata.title }})</span>
</div>
<ng-template #helpToParent data-container="body"> {{ 'exercise.help.toParent' | translate }} </ng-template>
<ul>
<li>
<span class="exerciseTitle">{{ this.exerciseBodyComponent?.exercise?.metadata?.title }}</span>
<ul>
<li
*ngFor="let childInfo of this.exerciseBodyComponent?.getChildrenInfos()"
class="childTitle"
(click)="this.exerciseBodyComponent!.toExercise(childInfo.childId)"
>
{{ childInfo.title }}
</li>
</ul>
</li>
</ul>
import { Component, Input } from '@angular/core';
import { faArrowUp } from '@fortawesome/free-solid-svg-icons';
import { ExerciseBodyComponent } from '../exercise-details.component';
@Component({
selector: 'exercise-tree',
templateUrl: './exercise-tree.component.html',
styleUrls: ['./exercise-tree.component.css'],
})
export class ExerciseTreeComponent {
/**
* Provide data for tree.
*/
@Input() exerciseBodyComponent: ExerciseBodyComponent | undefined;
upIcon = faArrowUp;
}
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
</div> </div>
<div class="star-container"> <div class="star-container">
<span> <span>
{{ exercise.searchStatistics?.downloads }} {{ exercise.searchStatistics.downloads }}
</span> </span>
</div> </div>
<ng-template #helpForDownloads> {{ 'exercise.details.downloads' | translate }}</ng-template> <ng-template #helpForDownloads> {{ 'exercise.details.downloads' | translate }}</ng-template>
...@@ -147,29 +147,8 @@ ...@@ -147,29 +147,8 @@
<jhi-bookmark-toggle [exercise]="exercise"></jhi-bookmark-toggle> <jhi-bookmark-toggle [exercise]="exercise"></jhi-bookmark-toggle>
<div <div>
*ngIf="exercise.file.parentId" <exercise-tree *ngIf="hasChildren() || exercise.file.parentId" [exerciseBodyComponent]="this"></exercise-tree>
style="float: left; width: 100%; padding-top: 15px; margin-bottom: 25px"
[ngbTooltip]="helpToParent"
(click)="toParent(exercise.file.parentId)"
>
<span jhiTranslate="exercise.containedIn">This exercise is contained in</span>:
<span
>{{ parent!.metadata.title }}
<fa-icon style="padding: 5px 0px 0px 5px" container="body" [icon]="treeIcon"></fa-icon>
</span>
</div>
<ng-template #helpToParent data-container="body"> {{ 'exercise.help.toParent' | translate }} </ng-template>
<div *ngIf="hasChildren()">
<span jhiTranslate="exercise.collectionContains">Collection contains</span>:
<ul style="text-align: left">
<li *ngFor="let childInfo of getChildrenInfos()" (click)="toExercise(childInfo.childId)" style="cursor: zoom-in">
<span>
{{ childInfo.title }}
</span>
</li>
</ul>
</div> </div>
<button <button
......
...@@ -13,6 +13,7 @@ import { ...@@ -13,6 +13,7 @@ import {
} from './exercise-details/exercise-details.component'; } from './exercise-details/exercise-details.component';
import { ExerciseMetadataItemComponent } from './exercise-details/exercise-metadata/exercise-metadata-item/exercise-metadata-item.component'; import { ExerciseMetadataItemComponent } from './exercise-details/exercise-metadata/exercise-metadata-item/exercise-metadata-item.component';
import { ExerciseMetadataComponent } from './exercise-details/exercise-metadata/exercise-metadata.component'; import { ExerciseMetadataComponent } from './exercise-details/exercise-metadata/exercise-metadata.component';
import { ExerciseTreeComponent } from './exercise-details/exercise-tree/exercise-tree.component';
import { ReviewBadgeComponent } from './review-badge/review-badge.component'; import { ReviewBadgeComponent } from './review-badge/review-badge.component';
@NgModule({ @NgModule({
...@@ -39,6 +40,7 @@ import { ReviewBadgeComponent } from './review-badge/review-badge.component'; ...@@ -39,6 +40,7 @@ import { ReviewBadgeComponent } from './review-badge/review-badge.component';
ExerciseMetadataItemComponent, ExerciseMetadataItemComponent,
ExerciseHeaderComponent, ExerciseHeaderComponent,
ExerciseBodyComponent, ExerciseBodyComponent,
ExerciseTreeComponent,
ExerciseDetailsNonModalComponent, ExerciseDetailsNonModalComponent,
MarkDownViewerComponent, MarkDownViewerComponent,
ReviewBadgeComponent, ReviewBadgeComponent,
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"notAccessible": "Fehler: Die Aufgabe mit der Id {{param}} ist nicht zugreifbar. Versuchen Sie sich anzumelden.", "notAccessible": "Fehler: Die Aufgabe mit der Id {{param}} ist nicht zugreifbar. Versuchen Sie sich anzumelden.",
"details": { "details": {
"details": "Details", "details": "Details",
"collectionInfo": "Informationen zur Aufgabensammlung",
"accuracy": "Trefferübereinstimmung", "accuracy": "Trefferübereinstimmung",
"rating": "Diese Metrik zeigt wie gut die Suchanfrage mit den gefundenen Treffern übereinstimmt.", "rating": "Diese Metrik zeigt wie gut die Suchanfrage mit den gefundenen Treffern übereinstimmt.",
"bookmark": "Merken", "bookmark": "Merken",
...@@ -141,7 +142,7 @@ ...@@ -141,7 +142,7 @@
}, },
"open": "Aufgabe öffnen", "open": "Aufgabe öffnen",
"more": "Mehr ...", "more": "Mehr ...",
"collection": "Aufgabensammlung", "collection": "Sammlung",
"collectionContains": "Diese Sammlung enthält", "collectionContains": "Diese Sammlung enthält",
"containedIn": "Diese Aufgabe ist enthalten in", "containedIn": "Diese Aufgabe ist enthalten in",
"close": "Schließen", "close": "Schließen",
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
"details": { "details": {
"details": "Details", "details": "Details",
"accuracy": "Search accuracy", "accuracy": "Search accuracy",
"collectionInfo": "Information about the collection",
"rating": "This metric shows how well the search term overlaps with the found resources!", "rating": "This metric shows how well the search term overlaps with the found resources!",
"bookmark": "Bookmark", "bookmark": "Bookmark",
"withChildren": "with children", "withChildren": "with children",
......
...@@ -39,6 +39,11 @@ class VariousDTOTest { ...@@ -39,6 +39,11 @@ class VariousDTOTest {
propertiesTester.testProperties(MessageDTO.class); propertiesTester.testProperties(MessageDTO.class);
} }
@Test
void testBroadCastMessageDTO() {
propertiesTester.testProperties(BroadCastMessageDTO.class);
}
@Test @Test
void testMetadataUserDTO() { void testMetadataUserDTO() {
MetadataUserDTO user = new MetadataUserDTO("name", "affiliation", "abc@def.de"); MetadataUserDTO user = new MetadataUserDTO("name", "affiliation", "abc@def.de");
......
...@@ -105,11 +105,20 @@ class VocabularyServiceTest { ...@@ -105,11 +105,20 @@ class VocabularyServiceTest {
@Timeout(60000) @Timeout(60000)
void checkAllURIs(String key, URI target) { void checkAllURIs(String key, URI target) {
VocabularyItem[] items = vocabularyRepository.getVocabularyItemsFor(key); VocabularyItem[] items = vocabularyRepository.getVocabularyItemsFor(key);
if (!key.equals("Creators") && !key.equals("Contributors") && !key.equals("Publisher")) { if (
!key.equals("Creators") &&
!key.equals("Contributors") &&
!key.equals("Publisher") &&
!key.equals("Educational Use") &&
!key.equals("Educational Framework") &&
!key.equals("Educational Level")
) {
Assert.assertTrue( Assert.assertTrue(
"vocabulary for " + key + "[" + target.toASCIIString() + "] should contain at least one item", "vocabulary for " + key + "[" + target.toASCIIString() + "] should contain at least one item",
items.length > 0 items.length > 0
); );
} else {
Assert.assertEquals("vocabulary for " + key + "[" + target.toASCIIString() + "] expected no items", 0, items.length);
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment