use career-stage-chip component in person card
This commit is contained in:
@@ -40,19 +40,10 @@
|
||||
{{ hIndexString() }}
|
||||
</p>
|
||||
@if (!loading()) {
|
||||
@if (careerStage(); as careerStage) {
|
||||
<div [skText]="loading()" class="career-stage-line">
|
||||
<span class="career-stage-label">Career Stage:</span>
|
||||
<span
|
||||
class="career-stage-chip"
|
||||
[matTooltip]="getCareerStageTooltip(careerStage)"
|
||||
matTooltipPosition="right"
|
||||
matTooltipClass="career-stage-tooltip"
|
||||
[matTooltipShowDelay]="250">
|
||||
{{ careerStage }}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
<app-career-stage-chip
|
||||
[careerStage]="person().career_metrics?.career_stage"
|
||||
[activeYears]="person().career_metrics?.active_years"
|
||||
size="sm" />
|
||||
}
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -264,39 +264,6 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.career-stage-line {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-top: 6px;
|
||||
color: var(--sg-text-muted);
|
||||
font-size: 10px;
|
||||
min-height: 18px;
|
||||
}
|
||||
|
||||
.career-stage-label {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.career-stage-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
padding: 2px 8px;
|
||||
border: 1px solid var(--sg-border);
|
||||
border-radius: 999px;
|
||||
background: var(--sg-surface-muted);
|
||||
color: var(--sg-primary);
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
padding: 16px;
|
||||
flex-grow: 1;
|
||||
|
||||
@@ -7,6 +7,7 @@ import { CustomAuthor, DehydratedInstitution, WorkTopic } from '../../api';
|
||||
import { SkTextDirective } from '../../custom-directives/sk-text.directive';
|
||||
import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component';
|
||||
import { CountryFlagComponent } from '../../shared/ui/country-flag/country-flag.component';
|
||||
import { CareerStageChipComponent } from '../../shared/ui/career-stage-chip/career-stage-chip.component';
|
||||
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
|
||||
|
||||
@Component({
|
||||
@@ -20,6 +21,7 @@ import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
|
||||
MatTooltipModule,
|
||||
TopicChipComponent,
|
||||
CountryFlagComponent,
|
||||
CareerStageChipComponent,
|
||||
],
|
||||
templateUrl: './person-card.component.html',
|
||||
styleUrl: './person-card.component.scss',
|
||||
@@ -128,16 +130,6 @@ export class PersonCardComponent {
|
||||
return '';
|
||||
});
|
||||
|
||||
careerStage = computed<string | null>(() => {
|
||||
const stage = this.person().career_metrics?.career_stage;
|
||||
|
||||
if (!stage || stage === 'unknown') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return stage;
|
||||
});
|
||||
|
||||
getRatingClass(rating: string | null | undefined): string {
|
||||
const r = (rating || '').toLowerCase();
|
||||
if (r === 'sehr geeignet') return 'very-suitable';
|
||||
@@ -174,23 +166,6 @@ export class PersonCardComponent {
|
||||
return id.replace('https://openalex.org/', '').trim().toUpperCase();
|
||||
}
|
||||
|
||||
getCareerStageTooltip(careerStage: string): string {
|
||||
const activeYears = this.person().career_metrics?.active_years ?? '-';
|
||||
|
||||
return [
|
||||
`Aktuell: ${careerStage.replace(' Researcher', '')}`,
|
||||
`Aktive Publikationsjahre: ${activeYears}`,
|
||||
'',
|
||||
'Einteilung:',
|
||||
'Early: 1-4 aktive Publikationsjahre',
|
||||
'Emerging: 5-9 aktive Publikationsjahre',
|
||||
'Established: 10-14 aktive Publikationsjahre',
|
||||
'Senior: ab 15 aktiven Publikationsjahren',
|
||||
'',
|
||||
'Diese Einschätzung basiert ausschließlich auf OpenAlex-Publikationsdaten und ist kein offizieller akademischer Status.',
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
toggleBookmark(): void {
|
||||
this.bookmarkToggle.emit(this.person());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user