Default University filter value
LocationBasedServices/smartguide/pipeline/head This commit looks good

This commit is contained in:
Kazgatari
2026-06-04 20:20:54 +02:00
parent 5ef7204a07
commit c8ad000f7e
3 changed files with 28 additions and 21 deletions
@@ -83,13 +83,13 @@ export class PersonListComponent {
const page = params['page'] ? Number.parseInt(params['page'], 10) : 1;
const pageSize = params['pageSize'] ? Number.parseInt(params['pageSize'], 10) : 10;
const institutionName = params['institutionName'] || '';
const topics = this.parseQueryParamArray(params['topic']);
this.selectedTopics = new Set(topics);
this.currentPage = page;
this.paginationService.selection = pageSize;
// Sync search box & institution input
if (this.state.searchValue() !== query) {
this.state.searchValue.set(query || null);
@@ -97,7 +97,7 @@ export class PersonListComponent {
if (this.institutionControl.value !== institutionName) {
this.institutionControl.setValue(institutionName);
}
this.load(query, page, pageSize, topics, institutionName);
});
}
@@ -110,7 +110,7 @@ export class PersonListComponent {
institutionName?: string
): void {
this.loadingState.set(true);
this.personsSearchService.searchPersonsList(
query || undefined,
institutionName || undefined,
@@ -119,19 +119,19 @@ export class PersonListComponent {
pageSize,
this.defaultIncludes
)
.pipe(
finalize(() => this.loadingState.set(false)),
takeUntilDestroyed(this.destroyRef)
)
.subscribe({
next: (response) => {
this.persons = (response.results ?? []) as CustomAuthor[];
this.total = response.meta?.count ?? 0;
},
error: (err) => {
console.error('Error loading persons:', err);
}
});
.pipe(
finalize(() => this.loadingState.set(false)),
takeUntilDestroyed(this.destroyRef)
)
.subscribe({
next: (response) => {
this.persons = (response.results ?? []) as CustomAuthor[];
this.total = response.meta?.count ?? 0;
},
error: (err) => {
console.error('Error loading persons:', err);
}
});
}
// Getters for filtered results
@@ -240,11 +240,11 @@ export class PersonListComponent {
const maxPagesToShow = 5;
let start = Math.max(1, this.currentPage - 2);
let end = Math.min(this.totalPages, start + maxPagesToShow - 1);
if (end - start + 1 < maxPagesToShow) {
start = Math.max(1, end - maxPagesToShow + 1);
}
for (let i = start; i <= end; i++) {
list.push(i);
}
@@ -19,6 +19,7 @@
<a
mat-list-item
[routerLink]="item.disabled ? null : item.route"
[queryParams]="item.queryParams || null"
routerLinkActive="active"
[class.disabled]="item.disabled"
>
@@ -21,7 +21,13 @@ import { CredentialService } from '../../services/credential.service';
export class AppMenuComponent {
navItems = [
{ label: 'Dashboard', icon: 'dashboard', route: '/items', disabled: false },
{ label: 'Personen', icon: 'groups', route: '/persons', disabled: false },
{
label: 'Personen',
icon: 'groups',
route: '/persons',
queryParams: { institutionName: 'University of Duisburg-Essen' },
disabled: false,
},
];
constructor(public credentialService: CredentialService) {}