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
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 @@
"OEResourceType": "Audience",
"type": "java.lang.String",
"required": "OPTIONAL",
"extraEntries": ["Anfänger", "Fortgeschrittene"]
"extraEntries": ["Anfänger"]
},
{
"property": "educationalLevel",
......
import { HttpResponse } from '@angular/common/http';
import { AfterViewInit, Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
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 { ApplicationInfoService } from 'app/core/application/applicationInfo.service';
import { Account } from 'app/core/auth/account.model';
......@@ -84,7 +84,11 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy, AfterViewInit {
return this.exercise;
}
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;
......@@ -100,7 +104,6 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy, AfterViewInit {
likeSubscription?: Subscription;
authenticated = false;
treeIcon = faFolderOpen;
faArrowRight = faArrowRight;
oerLink?: string;
......@@ -206,8 +209,10 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy, AfterViewInit {
this.router.navigate(['/search'], { queryParams: { p: parentId } });
}
toParent(parentId: string): void {
this.toExercise(parentId);
toParent(): void {
if (this.referencedExercise) {
this.toExercise(this.referencedExercise.file.parentId);
}
}
toExercise(exerciseId: string): void {
......@@ -313,6 +318,8 @@ export class ExerciseBodyComponent implements OnInit, OnDestroy, AfterViewInit {
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 @@
</div>
<div class="star-container">
<span>
{{ exercise.searchStatistics?.downloads }}
{{ exercise.searchStatistics.downloads }}
</span>
</div>
<ng-template #helpForDownloads> {{ 'exercise.details.downloads' | translate }}</ng-template>
......@@ -147,29 +147,8 @@
<jhi-bookmark-toggle [exercise]="exercise"></jhi-bookmark-toggle>
<div
*ngIf="exercise.file.parentId"
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>
<exercise-tree *ngIf="hasChildren() || exercise.file.parentId" [exerciseBodyComponent]="this"></exercise-tree>
</div>
<button
......
......@@ -13,6 +13,7 @@ import {
} from './exercise-details/exercise-details.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 { ExerciseTreeComponent } from './exercise-details/exercise-tree/exercise-tree.component';
import { ReviewBadgeComponent } from './review-badge/review-badge.component';
@NgModule({
......@@ -39,6 +40,7 @@ import { ReviewBadgeComponent } from './review-badge/review-badge.component';
ExerciseMetadataItemComponent,
ExerciseHeaderComponent,
ExerciseBodyComponent,
ExerciseTreeComponent,
ExerciseDetailsNonModalComponent,
MarkDownViewerComponent,
ReviewBadgeComponent,
......
......@@ -5,6 +5,7 @@
"notAccessible": "Fehler: Die Aufgabe mit der Id {{param}} ist nicht zugreifbar. Versuchen Sie sich anzumelden.",
"details": {
"details": "Details",
"collectionInfo": "Informationen zur Aufgabensammlung",
"accuracy": "Trefferübereinstimmung",
"rating": "Diese Metrik zeigt wie gut die Suchanfrage mit den gefundenen Treffern übereinstimmt.",
"bookmark": "Merken",
......@@ -141,7 +142,7 @@
},
"open": "Aufgabe öffnen",
"more": "Mehr ...",
"collection": "Aufgabensammlung",
"collection": "Sammlung",
"collectionContains": "Diese Sammlung enthält",
"containedIn": "Diese Aufgabe ist enthalten in",
"close": "Schließen",
......
......@@ -6,6 +6,7 @@
"details": {
"details": "Details",
"accuracy": "Search accuracy",
"collectionInfo": "Information about the collection",
"rating": "This metric shows how well the search term overlaps with the found resources!",
"bookmark": "Bookmark",
"withChildren": "with children",
......
......@@ -39,6 +39,11 @@ class VariousDTOTest {
propertiesTester.testProperties(MessageDTO.class);
}
@Test
void testBroadCastMessageDTO() {
propertiesTester.testProperties(BroadCastMessageDTO.class);
}
@Test
void testMetadataUserDTO() {
MetadataUserDTO user = new MetadataUserDTO("name", "affiliation", "abc@def.de");
......
......@@ -105,11 +105,20 @@ class VocabularyServiceTest {
@Timeout(60000)
void checkAllURIs(String key, URI target) {
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(
"vocabulary for " + key + "[" + target.toASCIIString() + "] should contain at least one item",
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