feat(topic): added topic detail page with publication table
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/head This commit looks good
This commit is contained in:
@@ -1,11 +1,64 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, computed, input } from '@angular/core';
|
||||
import { Topic } from '../../api';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { DecimalPipe } from '@angular/common';
|
||||
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
|
||||
|
||||
@Component({
|
||||
host: {
|
||||
'[style.--topic-color]': 'color()',
|
||||
},
|
||||
selector: 'app-topic',
|
||||
imports: [],
|
||||
imports: [
|
||||
MatTabsModule,
|
||||
RouterModule,
|
||||
MatDividerModule,
|
||||
MatIconModule,
|
||||
DecimalPipe,
|
||||
],
|
||||
templateUrl: './topic.component.html',
|
||||
styleUrl: './topic.component.scss',
|
||||
})
|
||||
export class TopicComponent {
|
||||
topic = input.required<Topic>();
|
||||
|
||||
links = [
|
||||
{
|
||||
label: 'Publikationen',
|
||||
path: 'publications',
|
||||
disabled: false,
|
||||
queryParams: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
title: '',
|
||||
sort_by: 'title',
|
||||
sort_direction: 'asc',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
subtitle = computed(() => {
|
||||
return `${this.topic().subfield?.display_name} - ${this.topic().field?.display_name} - ${this.topic().domain?.display_name}`;
|
||||
});
|
||||
|
||||
description = computed(() => {
|
||||
return this.topic().description || 'Keine Beschreibung verfügbar';
|
||||
});
|
||||
|
||||
color = computed<string>(() => {
|
||||
const topic = this.topic();
|
||||
return topicHierarchyColor({
|
||||
id: topic.id ?? undefined,
|
||||
name: topic.display_name ?? undefined,
|
||||
field_id: topic.field?.id ?? undefined,
|
||||
field_name: topic.field?.display_name ?? undefined,
|
||||
domain_id: topic.domain?.id ?? undefined,
|
||||
domain_name: topic.domain?.display_name ?? undefined,
|
||||
})
|
||||
.replace('hsl(', '')
|
||||
.replace(')', '');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user