Default University filter value
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/head This commit looks good
This commit is contained in:
@@ -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) {}
|
||||
|
||||
Reference in New Issue
Block a user