feat(frontend/search): added card search template, moved institutions and projects to it
LocationBasedServices/smartguide/pipeline/head This commit looks good

This commit is contained in:
Mats Paul Tončik
2026-07-05 19:47:16 +02:00
parent b2d965d604
commit 16c0b399c8
9 changed files with 306 additions and 268 deletions
@@ -1,4 +1,4 @@
import { Component, input, signal } from '@angular/core';
import { Component, computed, input, signal } from '@angular/core';
import { FundingProject, FundingProjectPage, ProjectType } from '../../api';
import { MatDividerModule } from '@angular/material/divider';
import { MatIconModule } from '@angular/material/icon';
@@ -8,12 +8,12 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { MatButtonModule } from '@angular/material/button';
import { DatePipe, UpperCasePipe } from '@angular/common';
import { MatChipListboxChange, MatChipsModule } from '@angular/material/chips';
import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component';
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
import { SelectorOption } from '../../shared/ui/query-param-selector/query-param-selector.component';
import {
QueryParamSelectorComponent,
SelectorOption,
} from '../../shared/ui/query-param-selector/query-param-selector.component';
CardSearchComponent,
Page,
} from '../../shared/ui/card-search/card-search.component';
@Component({
selector: 'app-projects',
@@ -26,9 +26,7 @@ import {
UpperCasePipe,
DatePipe,
MatChipsModule,
QueryParamInputComponent,
QueryParamPaginatorComponent,
QueryParamSelectorComponent,
CardSearchComponent,
],
templateUrl: './projects.component.html',
styleUrl: './projects.component.scss',
@@ -36,6 +34,13 @@ import {
export class ProjectsComponent {
fundingProjectPage = input.required<FundingProjectPage>();
page = computed<Page>(() => ({
page: this.fundingProjectPage().page || 0,
size: this.fundingProjectPage().size || 10,
total: this.fundingProjectPage().total || 0,
elements: this.fundingProjectPage().elements || [],
}));
urlChips = signal<ProjectType[]>(['eu', 'bund', 'dfg']);
sortingOptions: SelectorOption[] = [{ value: 'title', display_name: 'Name' }];
@@ -72,13 +77,14 @@ export class ProjectsComponent {
getDetaiLink(fundingProject: FundingProject): string | null {
if (fundingProject.type === 'bund') {
const encodedId = encodeURIComponent(fundingProject.id)
const encodedId = encodeURIComponent(fundingProject.id);
return '/projects/bund/' + encodedId;
} else if (fundingProject.type === 'dfg') {
return '/projects/dfg/' + fundingProject.id;
} else if (fundingProject.type === 'eu') {
return '/projects/eu/' + fundingProject.id;
} else
} else {
return null;
}
}
}