moved dfg classification hierarchy to separated component
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user