changes to conflict
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
>
|
||||
<div class="person-main">
|
||||
<div>
|
||||
<h2>{{ person.name }}</h2>
|
||||
<h2>{{ person.display_name }}</h2>
|
||||
<p>{{ institution(person) }}</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import { MatPaginatorModule, PageEvent } from '@angular/material/paginator';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
|
||||
import { Person } from '../../api';
|
||||
import { Author, WorkTopic } from '../../api';
|
||||
import { PaginationService } from '../../shared/services/pagination.service';
|
||||
import { PersonsService } from '../../shared/services/persons.service';
|
||||
import { createLoadError } from '../../shared/utils/errorHandler';
|
||||
@@ -42,7 +42,7 @@ export class PersonListComponent implements OnInit, OnDestroy {
|
||||
|
||||
public paginationService = inject(PaginationService);
|
||||
|
||||
persons: Person[] = [];
|
||||
persons: Author[] = [];
|
||||
loading = false;
|
||||
total = 0;
|
||||
pageIndex = 0;
|
||||
@@ -88,12 +88,19 @@ export class PersonListComponent implements OnInit, OnDestroy {
|
||||
this.load(event.pageIndex, event.pageSize);
|
||||
}
|
||||
|
||||
institution(person: Person): string {
|
||||
return person.affiliations?.[0]?.institution || 'Keine Institution angegeben';
|
||||
institution(person: Author): string {
|
||||
return (
|
||||
person.last_known_institutions?.[0]?.display_name ??
|
||||
person.affiliations?.[0]?.institution?.display_name ??
|
||||
'Keine Institution angegeben'
|
||||
);
|
||||
}
|
||||
|
||||
topics(person: Person): string[] {
|
||||
return (person.topics ?? []).slice(0, 3);
|
||||
topics(person: Author): string[] {
|
||||
return (person.topics ?? [])
|
||||
.map((topic: WorkTopic) => topic.display_name ?? '')
|
||||
.filter((topic): topic is string => Boolean(topic))
|
||||
.slice(0, 3);
|
||||
}
|
||||
|
||||
resultRange(): string {
|
||||
|
||||
@@ -2,11 +2,11 @@ import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Inject, Injectable, Optional } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { Person } from '../../api';
|
||||
import { Author } from '../../api';
|
||||
import { BASE_PATH } from '../../api/variables';
|
||||
|
||||
export interface PersonPage {
|
||||
elements?: Person[];
|
||||
export interface AuthorPage {
|
||||
elements?: Author[];
|
||||
offset?: number;
|
||||
total?: number;
|
||||
size?: number;
|
||||
@@ -29,7 +29,7 @@ export class PersonsService {
|
||||
pageOffset: number = 0,
|
||||
pageSize: number = 24,
|
||||
query?: string,
|
||||
): Observable<PersonPage> {
|
||||
): Observable<AuthorPage> {
|
||||
let params = new HttpParams()
|
||||
.set('pageOffset', pageOffset)
|
||||
.set('pageSize', pageSize);
|
||||
@@ -38,6 +38,6 @@ export class PersonsService {
|
||||
params = params.set('query', query.trim());
|
||||
}
|
||||
|
||||
return this.http.get<PersonPage>(`${this.basePath}/persons`, { params });
|
||||
return this.http.get<AuthorPage>(`${this.basePath}/persons`, { params });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user