moved dfg classification hierarchy to separated component

This commit is contained in:
2026-08-15 22:19:42 +02:00
parent 12914208cd
commit ae2230ff0e
6 changed files with 161 additions and 106 deletions
@@ -0,0 +1,29 @@
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);
}
}