30 lines
983 B
TypeScript
30 lines
983 B
TypeScript
import { Component, input } from '@angular/core';
|
|
import { DFGProjectFachgebieteInner } from '../../../api';
|
|
import { MatIconModule } from '@angular/material/icon';
|
|
import { MatCardModule } from '@angular/material/card';
|
|
@Component({
|
|
selector: 'app-dfg-classification',
|
|
imports: [MatIconModule, MatCardModule],
|
|
templateUrl: './dfg-classification.component.html',
|
|
styleUrl: './dfg-classification.component.scss',
|
|
})
|
|
export class DfgClassificationComponent {
|
|
classifications = input.required<Array<DFGProjectFachgebieteInner>>();
|
|
|
|
getClassificationParentSegments(entry: DFGProjectFachgebieteInner): string[] {
|
|
return [
|
|
entry.wissenschaftsbereich,
|
|
entry.fachkollegium,
|
|
entry.fachgebiet,
|
|
].filter((part): part is string => !!part);
|
|
}
|
|
|
|
getClassificationLeafSegments(entry: DFGProjectFachgebieteInner): string[] {
|
|
if (!entry.fach) return [];
|
|
return entry.fach
|
|
.split(',')
|
|
.map((s) => s.trim())
|
|
.filter((s) => !!s);
|
|
}
|
|
}
|