fix: prevent undefined hierarchy and missing metrics in topic tooltip #274
@@ -35,18 +35,20 @@
|
||||
</div>
|
||||
</mat-card-content>
|
||||
|
||||
<mat-divider />
|
||||
@if (topic.id) {
|
||||
<mat-divider />
|
||||
|
||||
<mat-card-footer>
|
||||
<mat-card-actions class="card-actions">
|
||||
<a
|
||||
class="card-action"
|
||||
[routerLink]="['/topic', stripOpenAlexId(topic.id), 'publications']"
|
||||
matButton="outlined"
|
||||
(click)="$event.stopPropagation()">
|
||||
<mat-icon>menu_book</mat-icon>
|
||||
Publikationen
|
||||
</a>
|
||||
</mat-card-actions>
|
||||
</mat-card-footer>
|
||||
<mat-card-footer>
|
||||
<mat-card-actions class="card-actions">
|
||||
<a
|
||||
class="card-action"
|
||||
[routerLink]="['/topic', stripOpenAlexId(topic.id), 'publications']"
|
||||
matButton="outlined"
|
||||
(click)="$event.stopPropagation()">
|
||||
<mat-icon>menu_book</mat-icon>
|
||||
Publikationen
|
||||
</a>
|
||||
</mat-card-actions>
|
||||
</mat-card-footer>
|
||||
}
|
||||
</mat-card>
|
||||
|
||||
@@ -35,7 +35,13 @@ export class AppTopicCardComponent {
|
||||
}
|
||||
|
||||
subtitle = computed(() => {
|
||||
return `${this.topic().subfield?.display_name} - ${this.topic().field?.display_name} - ${this.topic().domain?.display_name}`;
|
||||
return [
|
||||
this.topic().subfield?.display_name,
|
||||
this.topic().field?.display_name,
|
||||
this.topic().domain?.display_name,
|
||||
]
|
||||
.filter((part) => Boolean(part))
|
||||
.join(' - ');
|
||||
});
|
||||
|
||||
description = computed(() => {
|
||||
|
||||
@@ -24,9 +24,12 @@ export class AppTopicTooltipComponent {
|
||||
|
||||
const hasCompleteMetrics = Boolean(
|
||||
topicObj &&
|
||||
(topicObj.description ||
|
||||
topicObj.works_count !== undefined ||
|
||||
topicObj.cited_by_count !== undefined),
|
||||
topicObj.description &&
|
||||
topicObj.works_count !== undefined &&
|
||||
topicObj.cited_by_count !== undefined &&
|
||||
topicObj.subfield &&
|
||||
topicObj.field &&
|
||||
topicObj.domain,
|
||||
);
|
||||
|
||||
if (hasCompleteMetrics && topicObj) {
|
||||
|
||||
Reference in New Issue
Block a user