From d8de0c2156d6c7939fe8a81ef6c69a0c4471ae76 Mon Sep 17 00:00:00 2001 From: Kazgatari <56477241+Kazgatari@users.noreply.github.com> Date: Sun, 23 Aug 2026 16:46:37 +0200 Subject: [PATCH] changed person-card to use global institution chip --- .../person-card/person-card.component.html | 53 ++------- .../person-card/person-card.component.scss | 105 ------------------ .../person-card/person-card.component.ts | 28 +---- 3 files changed, 11 insertions(+), 175 deletions(-) diff --git a/webapp/src/app/modules/person-card/person-card.component.html b/webapp/src/app/modules/person-card/person-card.component.html index 21633c95..1f8906ee 100644 --- a/webapp/src/app/modules/person-card/person-card.component.html +++ b/webapp/src/app/modules/person-card/person-card.component.html @@ -51,52 +51,13 @@
@if (institution(); as inst) {
- +
} diff --git a/webapp/src/app/modules/person-card/person-card.component.scss b/webapp/src/app/modules/person-card/person-card.component.scss index fb46ab44..da6232db 100644 --- a/webapp/src/app/modules/person-card/person-card.component.scss +++ b/webapp/src/app/modules/person-card/person-card.component.scss @@ -136,111 +136,6 @@ overflow: hidden; text-overflow: ellipsis; } -.institution { - display: flex; - align-items: center; - gap: 6px; - margin: 0; - font-size: 12px; - color: var(--sg-text-muted); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.institution-tag { - background: var(--sg-primary-soft); - border: 1px solid var(--sg-primary-border, var(--sg-border)); - color: var(--sg-primary); - font-size: 10px; - font-weight: 600; - padding: 2px 6px; - border-radius: 4px; - cursor: pointer; - display: inline-flex; - align-items: center; - transition: all 0.2s ease; - max-width: 100%; - box-sizing: border-box; - margin: 0; - line-height: normal; - font-family: inherit; - - .institution-name { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - min-width: 0; - flex: 1; - } - - app-country-flag { - flex-shrink: 0; - } - - .country-code { - display: inline-block; - flex-shrink: 0; - white-space: nowrap; - } - - .institution-open-icon { - flex-shrink: 0; - width: 12px; - height: 12px; - margin-left: 5px; - font-size: 12px; - line-height: 1; - vertical-align: middle; - cursor: pointer; - opacity: 0; - transition: opacity 0.15s ease; - - &:hover { - opacity: 1; - } - } - - &:hover .institution-open-icon { - opacity: 0.7; - - &:hover { - opacity: 1; - } - } - - &:hover, - &:focus-visible { - background: var(--sg-primary); - color: var(--sg-background); - border-color: var(--sg-primary); - outline: none; - box-shadow: - 0 0 0 2px var(--sg-background), - 0 0 0 4px var(--sg-primary); - } - - &.active { - border-color: var(--sg-primary); - box-shadow: - 0 0 0 1px var(--sg-background), - 0 0 0 3px var(--sg-primary); - } - - &.active:hover, - &.active:focus-visible { - background: var(--sg-primary); - color: var(--sg-background); - } - - &.is-loading { - pointer-events: none; - background: var(--sg-surface-soft); - border-color: var(--sg-border); - color: var(--sg-text-soft); - box-shadow: none; - } -} .person-id { margin: 2px 0 0; diff --git a/webapp/src/app/modules/person-card/person-card.component.ts b/webapp/src/app/modules/person-card/person-card.component.ts index 0dacd32e..14a3cfe2 100644 --- a/webapp/src/app/modules/person-card/person-card.component.ts +++ b/webapp/src/app/modules/person-card/person-card.component.ts @@ -1,20 +1,18 @@ -import { Component, inject, input, computed, output } from '@angular/core'; +import { Component, input, computed, output } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { Router, RouterLink } from '@angular/router'; +import { RouterLink } from '@angular/router'; import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; 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 { AppInstitutionChipComponent } from '../../shared/ui/app-institution-chip/app-institution-chip.component'; import { CareerStageChipComponent } from '../../shared/ui/career-stage-chip/career-stage-chip.component'; import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; import { - APARTMENT_ICON, BOOKMARK_BORDER_ICON, BOOKMARK_ICON, NETWORK_ICON, - OPEN_IN_NEW_ICON, OVERVIEW_ICON, PUBLICATION_ICON, } from '../../shared/ui/icons'; @@ -29,7 +27,7 @@ import { SkTextDirective, MatTooltipModule, TopicChipComponent, - CountryFlagComponent, + AppInstitutionChipComponent, CareerStageChipComponent, ], templateUrl: './person-card.component.html', @@ -38,14 +36,10 @@ import { export class PersonCardComponent { readonly BOOKMARK_ICON = BOOKMARK_ICON; readonly BOOKMARK_BORDER_ICON = BOOKMARK_BORDER_ICON; - readonly APARTMENT_ICON = APARTMENT_ICON; - readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON; readonly OVERVIEW_ICON = OVERVIEW_ICON; readonly PUBLICATION_ICON = PUBLICATION_ICON; readonly NETWORK_ICON = NETWORK_ICON; - private readonly router = inject(Router); - person = input.required(); isBookmarked = input(false); loading = input(false); @@ -89,20 +83,6 @@ export class PersonCardComponent { return newestInstitution; }); - institutionPageId = computed( - () => this.institution()?.id?.split('/').pop() ?? null, - ); - - openInstitutionPage(event: Event): void { - event.stopPropagation(); - event.preventDefault(); - - const id = this.institutionPageId(); - if (!id) return; - - void this.router.navigate(['/institution', id]); - } - isInstitutionActive = computed(() => { const active = this.normalizeInstitutionId(this.activeInstitutionId()); if (!active) return false;