= [];
+ for (const authorship of work.authorships ?? []) {
+ for (const institution of authorship.institutions ?? []) {
+ if (!institution.id || !institution.display_name) continue;
+ if (!institutions.some((inst) => inst.id === institution.id)) {
+ institutions.push(institution);
+ }
+ }
+ }
+ return institutions;
+ }
+
institutions(
publication: Work,
): Array<{ id: string; name: string; country: string | null }> {
diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.html b/webapp/src/app/modules/publication-detail/publication-detail.component.html
index c672c74c..7bd7299f 100644
--- a/webapp/src/app/modules/publication-detail/publication-detail.component.html
+++ b/webapp/src/app/modules/publication-detail/publication-detail.component.html
@@ -25,13 +25,13 @@
@if (publication.type) {
- {{ publication.type }}
+ {{ publication.type | workType }}
}
@if (publication.publication_year) {
{{ publication.publication_year }}
}
@if (publication.language) {
- {{ publication.language | uppercase }}
+ {{ publication.language | languageCode }}
}
@@ -269,11 +269,11 @@
Typ
- {{ publication.type || '-' }}
+ {{ publication.type | workType }}
Sprache
- {{ publication.language || '-' }}
+ {{ publication.language | languageCode }}
Open Access
diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.ts b/webapp/src/app/modules/publication-detail/publication-detail.component.ts
index b377543b..57094961 100644
--- a/webapp/src/app/modules/publication-detail/publication-detail.component.ts
+++ b/webapp/src/app/modules/publication-detail/publication-detail.component.ts
@@ -17,6 +17,8 @@ import {
} from '../../api';
import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component';
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
+import { WorkTypePipe } from '../../shared/pipes/work-type.pipe';
+import { LanguageCodePipe } from '../../shared/pipes/language-code.pipe';
interface DetailLink {
label: string;
@@ -41,6 +43,8 @@ interface InstitutionDetail {
RouterLink,
TopicChipComponent,
UpperCasePipe,
+ WorkTypePipe,
+ LanguageCodePipe
],
templateUrl: './publication-detail.component.html',
styleUrl: './publication-detail.component.scss',
diff --git a/webapp/src/app/resolvers/work-page.resolver.ts b/webapp/src/app/resolvers/work-page.resolver.ts
new file mode 100644
index 00000000..5c69230a
--- /dev/null
+++ b/webapp/src/app/resolvers/work-page.resolver.ts
@@ -0,0 +1,27 @@
+import { ResolveFn } from '@angular/router';
+import { WorkPage, WorksService } from '../api';
+import { inject } from '@angular/core';
+
+export const workPageResolver: ResolveFn = (route, state) => {
+ const authorId = route.paramMap.get('authorId');
+ const page = Number(route.queryParamMap.get('page') || 0);
+ const pageSize = Number(route.queryParamMap.get('pageSize') || 10);
+ const publicationYears = route.queryParamMap
+ .getAll('publicationYears')
+ .map(Number);
+ const type = route.queryParamMap.getAll('types');
+ const languages = route.queryParamMap.getAll('languages');
+ const institutionIds = route.queryParamMap.getAll('institutionIds');
+ const topicsIds = route.queryParamMap.getAll('topicsIds');
+
+ return inject(WorksService).getAuthorWorks(
+ authorId!,
+ page,
+ pageSize,
+ publicationYears,
+ type,
+ languages,
+ institutionIds,
+ topicsIds,
+ );
+};
diff --git a/webapp/src/app/shared/pipes/language-code.pipe.ts b/webapp/src/app/shared/pipes/language-code.pipe.ts
new file mode 100644
index 00000000..ea985af7
--- /dev/null
+++ b/webapp/src/app/shared/pipes/language-code.pipe.ts
@@ -0,0 +1,66 @@
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+ name: 'languageCode',
+})
+export class LanguageCodePipe implements PipeTransform {
+ transform(
+ languageCode: string | null | undefined,
+ ...args: unknown[]
+ ): string {
+ switch (languageCode) {
+ case 'en':
+ return 'Englisch';
+ case 'de':
+ return 'Deutsch';
+ case 'fr':
+ return 'Französisch';
+ case 'es':
+ return 'Spanisch';
+ case 'it':
+ return 'Italienisch';
+ case 'pt':
+ return 'Portugiesisch';
+ case 'ru':
+ return 'Russisch';
+ case 'zh':
+ return 'Chinesisch';
+ case 'ja':
+ return 'Japanisch';
+ case 'ar':
+ return 'Arabisch';
+ case 'ko':
+ return 'Koreanisch';
+ case 'nl':
+ return 'Niederländisch';
+ case 'sv':
+ return 'Schwedisch';
+ case 'no':
+ return 'Norwegisch';
+ case 'da':
+ return 'Dänisch';
+ case 'fi':
+ return 'Finnisch';
+ case 'pl':
+ return 'Polnisch';
+ case 'cs':
+ return 'Tschechisch';
+ case 'hu':
+ return 'Ungarisch';
+ case 'tr':
+ return 'Türkisch';
+ case 'el':
+ return 'Griechisch';
+ case 'he':
+ return 'Hebräisch';
+ case 'hi':
+ return 'Hindi';
+ case 'th':
+ return 'Thailändisch';
+ case 'vi':
+ return 'Vietnamesisch';
+ default:
+ return languageCode ?? 'Unbekannte Sprache';
+ }
+ }
+}
diff --git a/webapp/src/app/shared/pipes/work-type.pipe.ts b/webapp/src/app/shared/pipes/work-type.pipe.ts
new file mode 100644
index 00000000..eebedae6
--- /dev/null
+++ b/webapp/src/app/shared/pipes/work-type.pipe.ts
@@ -0,0 +1,27 @@
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+ name: 'workType',
+})
+export class WorkTypePipe implements PipeTransform {
+ transform(value: string | null | undefined, ...args: unknown[]): string {
+ switch (value) {
+ case 'article':
+ return 'Artikel';
+ case 'book':
+ return 'Buch';
+ case 'book-chapter':
+ return 'Buchkapitel';
+ case 'dataset':
+ return 'Datensatz';
+ case 'dissertation':
+ return 'Dissertation';
+ case 'report':
+ return 'Bericht';
+ case 'preprint':
+ return 'Preprint';
+ default:
+ return value ?? 'Unbekannter Typ';
+ }
+ }
+}