diff --git a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.html b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.html index 25d99ee9..a86e7f0f 100644 --- a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.html +++ b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.html @@ -94,18 +94,13 @@ isTopicsExpanded ? projectTopics : projectTopics.slice(0, 3);
@for (topic of visibleTopics; track $index) { - - + [topic]="topic" + [showIcon]="false" + [isSelected]="isTopicActive(topic)" + [isClickable]="topicFilterEnabled()" + (handleChipClick)="filterByTopic(topic)" /> } @empty { - } diff --git a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.ts b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.ts index e04dfdb7..1eab4fc3 100644 --- a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.ts +++ b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.ts @@ -11,6 +11,7 @@ import { CurrencyPipe, DatePipe } from '@angular/common'; import { BundProjectPage, Topic } from '../../../api'; import { BundProjectSummary } from '../../../api/model/bundProjectSummary'; import { TopicChipComponent } from '../topic-chip/topic-chip.component'; +import { AppTopicChipComponent } from '../app-topic-chip/app-topic-chip.component'; import { DataTableComponent, GenericColumn, @@ -38,6 +39,7 @@ import { bundProjectQueryParamKeys } from '../../../resolvers/bund-projects.reso CurrencyPipe, DatePipe, ChipComponent, + AppTopicChipComponent, ], templateUrl: './bund-project-table.component.html', styleUrl: './bund-project-table.component.scss', diff --git a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html index 5d934742..607824ed 100644 --- a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html +++ b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html @@ -130,18 +130,13 @@ isTopicsExpanded ? projectTopics : projectTopics.slice(0, 3);
@for (topic of visibleTopics; track $index) { - - + [topic]="topic" + [showIcon]="false" + [isSelected]="isTopicActive(topic)" + [isClickable]="topicFilterEnabled()" + (handleChipClick)="filterByTopic(topic)" /> } @empty { - } diff --git a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts index e26a685b..2b331607 100644 --- a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts +++ b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts @@ -8,7 +8,7 @@ import { inject, } from '@angular/core'; import { DfgProjectPage, DfgProjectSummary, Topic } from '../../../api'; -import { TopicChipComponent } from '../topic-chip/topic-chip.component'; +import { AppTopicChipComponent } from '../app-topic-chip/app-topic-chip.component'; import { DataTableComponent, GenericColumn, @@ -32,7 +32,7 @@ import { topicHierarchyColor } from '../../../resolvers/utils/topic-colors'; MatButtonModule, QueryParamPaginatorComponent, MatTooltip, - TopicChipComponent, + AppTopicChipComponent, ], templateUrl: './dfg-project-table.component.html', styleUrl: './dfg-project-table.component.scss', diff --git a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html index 6a3c9c5c..68ef7152 100644 --- a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html +++ b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html @@ -48,19 +48,13 @@
@for (author of visibleAuthors; track getAuthorTrackId(author, $index)) { - + } @empty { - } @@ -127,18 +121,13 @@
@for (topic of visibleTopics; track topic.id ?? $index) { - - + [topic]="topic" + [showIcon]="false" + [isSelected]="isTopicActive(topic)" + [isClickable]="topicFilterEnabled()" + (handleChipClick)="filterByTopic(topic)" /> } @empty { - } diff --git a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts index ad0ac7be..0a3fca02 100644 --- a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts +++ b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts @@ -21,7 +21,7 @@ import { } from '../data-table/data-table.component'; import { QueryParamPaginatorComponent } from '../query-param-paginator/query-param-paginator.component'; -import { TopicChipComponent } from '../topic-chip/topic-chip.component'; +import { AppTopicChipComponent } from '../app-topic-chip/app-topic-chip.component'; import { EuCordisProjectSearchPage } from '../../../api/model/euCordisProjectSearchPage'; import { EuCordisProjectSummary } from '../../../api/model/euCordisProjectSummary'; @@ -31,6 +31,7 @@ import { Author, Topic } from '../../../api'; import { euProjectQueryParamKeys } from '../../../resolvers/eu-cordis-projects.resolver'; import { topicHierarchyColor } from '../../../resolvers/utils/topic-colors'; import { ChipComponent } from '../chip/chip.component'; +import { AppAuthorChipComponent } from '../app-author-chip/app-author-chip.component'; @Component({ selector: 'app-eu-project-table', imports: [ @@ -42,8 +43,9 @@ import { ChipComponent } from '../chip/chip.component'; DatePipe, CurrencyPipe, QueryParamPaginatorComponent, - TopicChipComponent, + AppTopicChipComponent, ChipComponent, + AppAuthorChipComponent, ], templateUrl: './eu-project-table.component.html', styleUrl: './eu-project-table.component.scss', @@ -165,7 +167,6 @@ export class EuProjectTableComponent { }, ]); getProjectTypeColor(type: string | null | undefined): string { - //console.log(type); const normalized = (type ?? '').toLowerCase(); if (normalized == 'fp7') return 'success'; if (normalized == 'h2020') return 'help'; @@ -243,14 +244,9 @@ export class EuProjectTableComponent { } getAuthorId(author: any): string | null { - const id = - author?.id ?? - author?.author_id ?? - author?.authorId ?? - author?.openalex_id ?? - author?.openAlexId; + const id = author.id; - return id == null ? null : String(id); + return id === null ? null : String(id); } getAuthorName(author: any): string { @@ -289,7 +285,6 @@ export class EuProjectTableComponent { filterByAuthor(author: any): void { const authorId = this.getAuthorId(author); - if (!authorId || !this.authorFilterEnabled()) return; const selectedAuthorIds = this.selectedAuthorIdsQueryParams();