old chips replaced for oa_topics and oa_authors
This commit is contained in:
@@ -94,18 +94,13 @@
|
||||
isTopicsExpanded ? projectTopics : projectTopics.slice(0, 3);
|
||||
<div class="topic-chips" aria-label="Themen" style="padding: 0.5rem 0">
|
||||
@for (topic of visibleTopics; track $index) {
|
||||
<app-topic-chip
|
||||
<app-topic-chip-2
|
||||
size="mini"
|
||||
[label]="topic.display_name || ''"
|
||||
[description]="topic.description"
|
||||
[subfieldName]="topic.subfield?.display_name"
|
||||
[fieldName]="topic.field?.display_name"
|
||||
[domainName]="topic.domain?.display_name"
|
||||
[color]="getWorkTopicColor(topic)"
|
||||
[disabled]="!topic.id"
|
||||
[active]="isTopicActive(topic)"
|
||||
(chipClick)="filterByTopic(topic)">
|
||||
</app-topic-chip>
|
||||
[topic]="topic"
|
||||
[showIcon]="false"
|
||||
[isSelected]="isTopicActive(topic)"
|
||||
[isClickable]="topicFilterEnabled()"
|
||||
(handleChipClick)="filterByTopic(topic)" />
|
||||
} @empty {
|
||||
<span class="empty-text">-</span>
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -130,18 +130,13 @@
|
||||
isTopicsExpanded ? projectTopics : projectTopics.slice(0, 3);
|
||||
<div class="topic-chips" aria-label="Themen" style="padding: 0.5rem 0">
|
||||
@for (topic of visibleTopics; track $index) {
|
||||
<app-topic-chip
|
||||
<app-topic-chip-2
|
||||
size="mini"
|
||||
[label]="topic.display_name || ''"
|
||||
[description]="topic.description"
|
||||
[subfieldName]="topic.subfield?.display_name"
|
||||
[fieldName]="topic.field?.display_name"
|
||||
[domainName]="topic.domain?.display_name"
|
||||
[color]="getWorkTopicColor(topic)"
|
||||
[disabled]="!topic.id"
|
||||
[active]="isTopicActive(topic)"
|
||||
(chipClick)="filterByTopic(topic)">
|
||||
</app-topic-chip>
|
||||
[topic]="topic"
|
||||
[showIcon]="false"
|
||||
[isSelected]="isTopicActive(topic)"
|
||||
[isClickable]="topicFilterEnabled()"
|
||||
(handleChipClick)="filterByTopic(topic)" />
|
||||
} @empty {
|
||||
<span class="empty-text">-</span>
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -48,19 +48,13 @@
|
||||
|
||||
<div class="author-tags" aria-label="Autoren" style="padding: 0.5rem 0">
|
||||
@for (author of visibleAuthors; track getAuthorTrackId(author, $index)) {
|
||||
<button
|
||||
type="button"
|
||||
class="publication-institution-tag"
|
||||
[class.active]="isAuthorActive(getAuthorId(author))"
|
||||
[class.disabled]="!getAuthorId(author)"
|
||||
[matTooltip]="getAuthorTooltipText(author)"
|
||||
matTooltipPosition="above"
|
||||
[attr.aria-label]="getAuthorTooltipText(author)"
|
||||
[disabled]="!getAuthorId(author) || !authorFilterEnabled()"
|
||||
(click)="filterByAuthor(author)">
|
||||
<mat-icon class="institution-icon">person</mat-icon>
|
||||
<span class="institution-name">{{ getAuthorName(author) }}</span>
|
||||
</button>
|
||||
<app-author-chip
|
||||
size="mini"
|
||||
[author]="author"
|
||||
[showIcon]="true"
|
||||
[isSelected]="isAuthorActive(author.id!)"
|
||||
[isClickable]="authorFilterEnabled()"
|
||||
(handleChipClick)="filterByAuthor($event!)" />
|
||||
} @empty {
|
||||
<span class="empty-text">-</span>
|
||||
}
|
||||
@@ -127,18 +121,13 @@
|
||||
|
||||
<div class="topic-chips" aria-label="Themen" style="padding: 0.5rem 0">
|
||||
@for (topic of visibleTopics; track topic.id ?? $index) {
|
||||
<app-topic-chip
|
||||
<app-topic-chip-2
|
||||
size="mini"
|
||||
[label]="topic.display_name || ''"
|
||||
[description]="topic.description"
|
||||
[subfieldName]="topic.subfield?.display_name"
|
||||
[fieldName]="topic.field?.display_name"
|
||||
[domainName]="topic.domain?.display_name"
|
||||
[color]="getWorkTopicColor(topic)"
|
||||
[disabled]="!topic.id"
|
||||
[active]="isTopicActive(topic)"
|
||||
(chipClick)="filterByTopic(topic)">
|
||||
</app-topic-chip>
|
||||
[topic]="topic"
|
||||
[showIcon]="false"
|
||||
[isSelected]="isTopicActive(topic)"
|
||||
[isClickable]="topicFilterEnabled()"
|
||||
(handleChipClick)="filterByTopic(topic)" />
|
||||
} @empty {
|
||||
<span class="empty-text">-</span>
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user