From 29c954227fd468c9dc520f65172306d6cefcea24 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Fri, 26 Jun 2026 12:05:00 +0200 Subject: [PATCH 01/21] use shared topic chips in person card --- .../main/inse/models/openalex/work_topic.py | 4 +- webapp/src/app/api/model/workTopic.ts | 1 + .../person-card/person-card.component.html | 23 ++++---- .../person-card/person-card.component.scss | 53 ++++--------------- .../person-card/person-card.component.ts | 33 ++++++++---- .../ui/topic-chip/topic-chip.component.scss | 1 + 6 files changed, 51 insertions(+), 64 deletions(-) diff --git a/service/src/main/inse/models/openalex/work_topic.py b/service/src/main/inse/models/openalex/work_topic.py index c4c6fce6..e780d369 100644 --- a/service/src/main/inse/models/openalex/work_topic.py +++ b/service/src/main/inse/models/openalex/work_topic.py @@ -33,11 +33,12 @@ class WorkTopic(BaseModel): """ # noqa: E501 id: Optional[StrictStr] = None display_name: Optional[StrictStr] = None + description: Optional[StrictStr] = None score: Optional[Union[StrictFloat, StrictInt]] = None subfield: Optional[WorkTopicSubfield] = None var_field: Optional[WorkTopicField] = Field(default=None, alias="field") domain: Optional[WorkTopicDomain] = None - __properties: ClassVar[List[str]] = ["id", "display_name", "score", "subfield", "field", "domain"] + __properties: ClassVar[List[str]] = ["id", "display_name", "description", "score", "subfield", "field", "domain"] model_config = ConfigDict( validate_by_name=True, @@ -101,6 +102,7 @@ class WorkTopic(BaseModel): _obj = cls.model_validate({ "id": obj.get("id"), "display_name": obj.get("display_name"), + "description": obj.get("description"), "score": obj.get("score"), "subfield": WorkTopicSubfield.from_dict(obj["subfield"]) if obj.get("subfield") is not None else None, "field": WorkTopicField.from_dict(obj["field"]) if obj.get("field") is not None else None, diff --git a/webapp/src/app/api/model/workTopic.ts b/webapp/src/app/api/model/workTopic.ts index 4b326824..4b365f33 100644 --- a/webapp/src/app/api/model/workTopic.ts +++ b/webapp/src/app/api/model/workTopic.ts @@ -18,6 +18,7 @@ import { WorkTopicField } from './workTopicField'; export interface WorkTopic { id?: string | null; display_name?: string | null; + description?: string | null; score?: Score | null; subfield?: WorkTopicSubfield | null; field?: WorkTopicField | null; 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 e07bb800..3522a567 100644 --- a/webapp/src/app/modules/person-card/person-card.component.html +++ b/webapp/src/app/modules/person-card/person-card.component.html @@ -98,18 +98,19 @@
@for (topic of topics(); track topic.id) { - + class="person-topic-chip" + size="mini" + [label]="topic.display_name || ''" + [description]="topic.description" + [subfieldName]="topic.subfield?.display_name" + [fieldName]="topic.field?.display_name" + [domainName]="topic.domain?.display_name" + [color]="getTopicColor(topic)" + [active]="isTopicSelected(topic)" + (chipClick)="handleTopicClick(topic)"> + }
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 5dd6b14c..bb40d858 100644 --- a/webapp/src/app/modules/person-card/person-card.component.scss +++ b/webapp/src/app/modules/person-card/person-card.component.scss @@ -246,55 +246,22 @@ .topic-row { display: flex; flex-wrap: wrap; - gap: 4px; + gap: 5px; } -.topic-tag { - background: var(--sg-surface-soft); - border: 1px solid var(--sg-border); - color: var(--sg-text-muted); - font-size: 10px; - font-weight: 600; - padding: 2px 6px; - border-radius: 4px; - cursor: pointer; - transition: all 0.2s ease; +app-topic-chip.person-topic-chip { max-width: 100%; +} + +:host ::ng-deep app-topic-chip.person-topic-chip .topic-chip__button { + max-width: 100%; +} + +:host ::ng-deep app-topic-chip.person-topic-chip .topic-chip__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - box-sizing: border-box; - margin: 0; - line-height: normal; - font-family: inherit; - display: inline-flex; - align-items: center; - - &:hover, - &:focus-visible { - background: var(--sg-primary-soft); - border-color: var(--sg-primary); - color: var(--sg-primary); - outline: none; - box-shadow: - 0 0 0 2px var(--sg-background), - 0 0 0 4px var(--sg-primary); - } - - &.active { - background: var(--sg-primary-soft); - border-color: var(--sg-primary); - color: var(--sg-primary); - font-weight: 700; - box-shadow: 0 0 0 1.5px var(--sg-primary); - - &:hover, - &:focus-visible { - box-shadow: - 0 0 0 2px var(--sg-background), - 0 0 0 4px var(--sg-primary); - } - } + overflow-wrap: normal; } .card-footer { 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 02e5a109..a9ad0e50 100644 --- a/webapp/src/app/modules/person-card/person-card.component.ts +++ b/webapp/src/app/modules/person-card/person-card.component.ts @@ -5,6 +5,8 @@ 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 { topicHierarchyColor } from '../../shared/utils/topic-colors'; @Component({ selector: 'app-person-card', @@ -15,6 +17,7 @@ import { SkTextDirective } from '../../custom-directives/sk-text.directive'; MatIconModule, SkTextDirective, MatTooltipModule, + TopicChipComponent, ], templateUrl: './person-card.component.html', styleUrl: './person-card.component.scss', @@ -117,17 +120,29 @@ export class PersonCardComponent { return 'possible'; } - getTopicTooltip(topic: WorkTopic): string { - const parts: string[] = []; - if (topic.domain?.display_name) parts.push(topic.domain.display_name); - if (topic.field?.display_name) parts.push(topic.field.display_name); - if (topic.subfield?.display_name) parts.push(topic.subfield.display_name); + isTopicSelected(topic: WorkTopic): boolean { + return this.selectedTopics().has(topic.display_name || ''); + } - const path = parts.join(' - '); - if (topic.display_name) { - return path ? `${topic.display_name}\n(${path})` : topic.display_name; + getTopicColor(topic: WorkTopic): string { + return topicHierarchyColor({ + id: topic.id, + name: topic.display_name, + field_id: topic.field?.id, + field_name: topic.field?.display_name, + domain_id: topic.domain?.id, + domain_name: topic.domain?.display_name, + }); + } + + handleTopicClick(topic: WorkTopic): void { + const topicName = topic.display_name || ''; + + if (!topicName) { + return; } - return path; + + this.topicClick.emit(topicName); } getCareerStageTooltip(careerStage: string): string { diff --git a/webapp/src/app/shared/ui/topic-chip/topic-chip.component.scss b/webapp/src/app/shared/ui/topic-chip/topic-chip.component.scss index e9d57cd5..fb757f9d 100644 --- a/webapp/src/app/shared/ui/topic-chip/topic-chip.component.scss +++ b/webapp/src/app/shared/ui/topic-chip/topic-chip.component.scss @@ -67,6 +67,7 @@ :host(.topic-chip--active.topic-chip--mini) .topic-chip__button { background: color-mix(in srgb, var(--topic-color) 24%, #ffffff); color: var(--topic-text); + box-shadow: 0 0 0 1.5px var(--topic-color); } .topic-chip__label { From 309fecf0086833c3ef1923ce6923688c266d7860 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Fri, 26 Jun 2026 13:35:06 +0200 Subject: [PATCH 02/21] use topic chips for active topic filters --- .../custom-directives/sk-text.directive.ts | 14 +++++ .../person-list/person-list.component.html | 51 +++++++++++++---- .../person-list/person-list.component.scss | 39 ++++++++++++- .../person-list/person-list.component.ts | 57 ++++++++++++++++++- 4 files changed, 148 insertions(+), 13 deletions(-) diff --git a/webapp/src/app/custom-directives/sk-text.directive.ts b/webapp/src/app/custom-directives/sk-text.directive.ts index ade9c10b..e7173238 100644 --- a/webapp/src/app/custom-directives/sk-text.directive.ts +++ b/webapp/src/app/custom-directives/sk-text.directive.ts @@ -35,6 +35,7 @@ export class SkTextDirective implements OnChanges { // measure natural width before blanking text const width = Math.min(Math.max(this.originalText.length * 7.5, 48), 60); const height = 20; + this.renderer.addClass(el, 'sk-text-loading'); this.renderer.setStyle(el, 'color', 'transparent'); this.renderer.setStyle( el, @@ -47,10 +48,17 @@ export class SkTextDirective implements OnChanges { this.renderer.setStyle(el, 'min-width', `${width}px`); this.renderer.setStyle(el, 'max-height', `${height}px`); this.renderer.setStyle(el, 'display', 'inline-block'); + this.renderer.setStyle(el, 'overflow', 'hidden'); + this.renderer.setStyle(el, 'pointer-events', 'none'); + + Array.from(el.children).forEach((child) => { + this.renderer.setStyle(child, 'visibility', 'hidden'); + }); } private hideSkeleton() { const el: HTMLElement = this.el.nativeElement; + this.renderer.removeClass(el, 'sk-text-loading'); this.renderer.removeStyle(el, 'color'); this.renderer.removeStyle(el, 'background'); this.renderer.removeStyle(el, 'background-size'); @@ -59,5 +67,11 @@ export class SkTextDirective implements OnChanges { this.renderer.removeStyle(el, 'min-width'); this.renderer.removeStyle(el, 'max-height'); this.renderer.removeStyle(el, 'display'); + this.renderer.removeStyle(el, 'overflow'); + this.renderer.removeStyle(el, 'pointer-events'); + + Array.from(el.children).forEach((child) => { + this.renderer.removeStyle(child, 'visibility'); + }); } } diff --git a/webapp/src/app/modules/person-list/person-list.component.html b/webapp/src/app/modules/person-list/person-list.component.html index 3dba668f..e3d4fcc8 100644 --- a/webapp/src/app/modules/person-list/person-list.component.html +++ b/webapp/src/app/modules/person-list/person-list.component.html @@ -32,16 +32,47 @@
Aktive Filter:
- @for (filter of activeFilters; track filter.value) { - - {{ filter.label }} - - + @for ( + filter of activeFilters; + track filter.category + filter.value + ) { + @if (filter.category === 'topic') { + + Thema: + + + + + } @else { + + {{ filter.label }} + + + } } - + matTooltipPosition="above" + (click)="toggleSubfield(group, item)"> {{ item.name }} - +
diff --git a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.scss b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.scss index fa9fca76..666ca903 100644 --- a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.scss +++ b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.scss @@ -110,11 +110,39 @@ background: #fbfdff; } +.topic-legend-group-active { + border-color: var(--legend-color, var(--topic-legend-accent)); + background: color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 10%, + #fbfdff + ); + box-shadow: + inset 0 0 0 1px + color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 55%, + transparent + ), + 0 0 0 2px + color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 22%, + transparent + ); +} + .topic-legend-field { flex: 0 1 auto; min-width: 0; gap: 5px; + padding: 2px 4px; + appearance: none; + border: 0; + border-radius: 999px; + background: transparent; color: #07163d; + font-family: inherit; font-size: 11px; font-weight: 800; line-height: 1.2; @@ -143,13 +171,87 @@ } .topic-legend-item { + display: inline-flex; + align-items: center; + padding: 2px 4px; + appearance: none; + border: 0; + border-radius: 999px; + background: transparent; color: #53617e; + font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1.25; cursor: help; } +.topic-legend-selectable { + .topic-legend-field, + .topic-legend-item { + cursor: pointer; + } + + .topic-legend-field:hover, + .topic-legend-item:hover { + background: color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 8%, + #ffffff + ); + } +} + +.topic-legend-field:focus-visible, +.topic-legend-item:focus-visible { + outline: 2px solid var(--topic-legend-accent); + outline-offset: 2px; +} + +.topic-legend-entry-active { + background: color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 24%, + #ffffff + ); + box-shadow: + inset 0 0 0 1px + color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 75%, + transparent + ), + 0 1px 3px rgba(15, 23, 42, 0.12); +} + +.topic-legend-field.topic-legend-entry-active { + color: color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 34%, + #07163d + ); +} + +.topic-legend-field.topic-legend-entry-active .topic-legend-dot { + box-shadow: + 0 0 0 2px #ffffff, + 0 0 0 4px + color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 82%, + transparent + ); +} + +.topic-legend-item.topic-legend-entry-active { + color: color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 34%, + #07163d + ); + font-weight: 800; +} + .topic-legend-more-toggle { flex: 0 0 auto; padding: 0; diff --git a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.ts b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.ts index 171ac204..e28a0311 100644 --- a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.ts +++ b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.ts @@ -2,7 +2,11 @@ import { CommonModule } from '@angular/common'; import { Component, EventEmitter, Input, Output } from '@angular/core'; import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { TopicLegendGroup, TopicLegendItem } from '../../utils/topic-legend'; +import { + TopicLegendGroup, + TopicLegendItem, + TopicLegendSubfieldSelection, +} from '../../utils/topic-legend'; export type TopicLegendVariant = 'default' | 'compact'; @@ -24,9 +28,14 @@ export class TopicLegendComponent { @Input() showVisibilityToggle = true; @Input() collapsedGroupLimit = 3; @Input() variant: TopicLegendVariant = 'default'; + @Input() selectable = false; + @Input() activeFieldIds: ReadonlySet | readonly string[] = []; + @Input() activeSubfieldIds: ReadonlySet | readonly string[] = []; @Output() visibleChange = new EventEmitter(); @Output() expandedChange = new EventEmitter(); + @Output() fieldToggle = new EventEmitter(); + @Output() subfieldToggle = new EventEmitter(); get hasGroups(): boolean { return this.groups.length > 0; @@ -66,6 +75,37 @@ export class TopicLegendComponent { this.expandedChange.emit(!this.expanded); } + toggleField(group: TopicLegendGroup): void { + if (!this.selectable) { + return; + } + + this.fieldToggle.emit(group); + } + + toggleSubfield(group: TopicLegendGroup, item: TopicLegendItem): void { + if (!this.selectable) { + return; + } + + this.subfieldToggle.emit({ group, item }); + } + + isFieldActive(group: TopicLegendGroup): boolean { + return this.isActiveLegendId(this.activeFieldIds, group.id); + } + + isSubfieldActive(item: TopicLegendItem): boolean { + return this.isActiveLegendId(this.activeSubfieldIds, item.id); + } + + isGroupActive(group: TopicLegendGroup): boolean { + return ( + this.isFieldActive(group) || + group.items.some((item) => this.isSubfieldActive(item)) + ); + } + trackByGroup(_: number, group: TopicLegendGroup): string { return group.id; } @@ -73,4 +113,15 @@ export class TopicLegendComponent { trackByItem(_: number, item: TopicLegendItem): string { return item.id; } + + private isActiveLegendId( + activeIds: ReadonlySet | readonly string[], + id: string, + ): boolean { + if ('has' in activeIds) { + return activeIds.has(id); + } + + return activeIds.includes(id); + } } diff --git a/webapp/src/app/shared/utils/topic-legend.ts b/webapp/src/app/shared/utils/topic-legend.ts index a54779c3..d297cba3 100644 --- a/webapp/src/app/shared/utils/topic-legend.ts +++ b/webapp/src/app/shared/utils/topic-legend.ts @@ -26,6 +26,40 @@ export interface TopicLegendGroup { items: TopicLegendItem[]; } +export interface TopicLegendSubfieldSelection { + group: TopicLegendGroup; + item: TopicLegendItem; +} + +export function getTopicLegendFieldId(topic: TopicLegendTopic): string { + const fieldName = normalizeLegendValue(topic.field_name) ?? 'Ohne Fachgebiet'; + + return topic.field_id ?? normalizeLegendKey(fieldName); +} + +export function getTopicLegendSubfieldId(topic: TopicLegendTopic): string { + const subfieldName = normalizeLegendValue(topic.subfield_name); + + return ( + topic.subfield_id ?? (subfieldName ? normalizeLegendKey(subfieldName) : '') + ); +} + +export function toggleTopicLegendSelection( + currentSelection: ReadonlySet, + id: string, +): Set { + const nextSelection = new Set(currentSelection); + + if (nextSelection.has(id)) { + nextSelection.delete(id); + return nextSelection; + } + + nextSelection.add(id); + return nextSelection; +} + export function buildTopicLegendGroups( topics: readonly TopicLegendTopic[], ): TopicLegendGroup[] { @@ -47,8 +81,8 @@ export function buildTopicLegendGroups( normalizeLegendValue(topic.domain_description) ?? ''; const subfieldDescription = normalizeLegendValue(topic.subfield_description) ?? ''; - const fieldKey = topic.field_id ?? normalizeLegendKey(fieldName); - const subfieldKey = topic.subfield_id ?? normalizeLegendKey(subfieldName); + const fieldKey = getTopicLegendFieldId(topic); + const subfieldKey = getTopicLegendSubfieldId(topic); if (!groups.has(fieldKey)) { groups.set(fieldKey, { From f2cf83f63b34ebee7d63d75968d257bbb831d871 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Fri, 26 Jun 2026 14:16:56 +0200 Subject: [PATCH 04/21] topic-legend: select fields and subfields separately --- .../person-interesting.component.ts | 24 +++++++---- .../research-timeline.component.ts | 19 ++++++--- .../topic-legend/topic-legend.component.html | 2 +- .../ui/topic-legend/topic-legend.component.ts | 9 +---- webapp/src/app/shared/utils/topic-legend.ts | 40 +++++++++++++++++++ 5 files changed, 72 insertions(+), 22 deletions(-) diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.ts b/webapp/src/app/modules/person-interesting/person-interesting.component.ts index ced9f9d0..a5f690c2 100644 --- a/webapp/src/app/modules/person-interesting/person-interesting.component.ts +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.ts @@ -23,7 +23,8 @@ import { getTopicLegendSubfieldId, TopicLegendGroup, TopicLegendSubfieldSelection, - toggleTopicLegendSelection, + toggleTopicLegendFieldSelection, + toggleTopicLegendSubfieldSelection, } from '../../shared/utils/topic-legend'; interface InterestTag { @@ -154,18 +155,25 @@ export class PersonInterestingComponent implements OnInit { } onLegendFieldToggle(group: TopicLegendGroup): void { - this.activeLegendFieldIds.set( - toggleTopicLegendSelection(this.activeLegendFieldIds(), group.id), + const selection = toggleTopicLegendFieldSelection( + this.activeLegendFieldIds(), + this.activeLegendSubfieldIds(), + group, ); + + this.activeLegendFieldIds.set(selection.fieldIds); + this.activeLegendSubfieldIds.set(selection.subfieldIds); } onLegendSubfieldToggle(selection: TopicLegendSubfieldSelection): void { - this.activeLegendSubfieldIds.set( - toggleTopicLegendSelection( - this.activeLegendSubfieldIds(), - selection.item.id, - ), + const nextSelection = toggleTopicLegendSubfieldSelection( + this.activeLegendFieldIds(), + this.activeLegendSubfieldIds(), + selection, ); + + this.activeLegendFieldIds.set(nextSelection.fieldIds); + this.activeLegendSubfieldIds.set(nextSelection.subfieldIds); } isTagActive(tag: InterestTag): boolean { diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts index 09392acc..cd0f382f 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts @@ -21,7 +21,8 @@ import { getTopicLegendSubfieldId, TopicLegendGroup, TopicLegendSubfieldSelection, - toggleTopicLegendSelection, + toggleTopicLegendFieldSelection, + toggleTopicLegendSubfieldSelection, } from '../../../../shared/utils/topic-legend'; import { buildTopicHierarchyTooltip } from '../../../../shared/utils/topic-tooltip'; @@ -430,17 +431,25 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { } onLegendFieldToggle(group: TopicLegendGroup): void { - this.activeLegendFieldIds = toggleTopicLegendSelection( + const selection = toggleTopicLegendFieldSelection( this.activeLegendFieldIds, - group.id, + this.activeLegendSubfieldIds, + group, ); + + this.activeLegendFieldIds = selection.fieldIds; + this.activeLegendSubfieldIds = selection.subfieldIds; } onLegendSubfieldToggle(selection: TopicLegendSubfieldSelection): void { - this.activeLegendSubfieldIds = toggleTopicLegendSelection( + const nextSelection = toggleTopicLegendSubfieldSelection( + this.activeLegendFieldIds, this.activeLegendSubfieldIds, - selection.item.id, + selection, ); + + this.activeLegendFieldIds = nextSelection.fieldIds; + this.activeLegendSubfieldIds = nextSelection.subfieldIds; } isTopicActiveByLegend(topic: TopicTimelineTopic): boolean { diff --git a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.html b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.html index 115a8e3a..330ccc2b 100644 --- a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.html +++ b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.html @@ -47,7 +47,7 @@
@for (topic of publication.topics ?? []; track topic.id) { - - {{ topic.display_name }} - + + } @for (keyword of publication.keywords ?? []; track keyword.id) { {{ keyword.display_name }} diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.scss b/webapp/src/app/modules/publication-detail/publication-detail.component.scss index ae20315b..a5238714 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.scss +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.scss @@ -268,12 +268,6 @@ aside { font-size: 11px; } -.tags .topic-tag { - border-color: #cbd8f1; - background: #f5f8ff; - color: var(--sg-text); -} - .source-list, .compact-list, .link-list { diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.ts b/webapp/src/app/modules/publication-detail/publication-detail.component.ts index c2850656..4c2e0ce9 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.ts +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.ts @@ -13,7 +13,10 @@ import { Location as ApiLocation, Work, WorksService, + WorkTopic, } from '../../api'; +import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component'; +import { topicHierarchyColor } from '../../shared/utils/topic-colors'; interface DetailLink { label: string; @@ -36,6 +39,7 @@ interface InstitutionDetail { MatIconModule, MatProgressSpinnerModule, RouterLink, + TopicChipComponent, UpperCasePipe, ], templateUrl: './publication-detail.component.html', @@ -71,6 +75,17 @@ export class PublicationDetailComponent implements OnInit { this.location.back(); } + getTopicColor(topic: WorkTopic): string { + return topicHierarchyColor({ + id: topic.id, + name: topic.display_name, + field_id: topic.field?.id, + field_name: topic.field?.display_name, + domain_id: topic.domain?.id, + domain_name: topic.domain?.display_name, + }); + } + abstractText(): string | null { const index = this.publication?.abstract_inverted_index; if (!index || typeof index !== 'object') return null; From 495c7d34e5c4d0b2498c26d039b6ead0f1f5cf85 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Mon, 29 Jun 2026 23:40:05 +0200 Subject: [PATCH 09/21] timeline legend across full width --- .../research-timeline.component.html | 10 ++++----- .../research-timeline.component.scss | 21 +++++++++---------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html index a478142c..2d2a289e 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html @@ -63,6 +63,10 @@
Zeitraum + + {{ selectedStartYear }} bis {{ selectedEndYear }} + +
-
- {{ selectedStartYear }} - bis - {{ selectedEndYear }} -
-
Date: Mon, 29 Jun 2026 23:52:26 +0200 Subject: [PATCH 10/21] Publication overview filter design updated --- .../research-timeline.component.scss | 3 - .../person-publications.component.html | 68 +++++----- .../person-publications.component.scss | 117 ++++++++++++------ .../person-publications.component.ts | 4 - 4 files changed, 122 insertions(+), 70 deletions(-) diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss index 67d79f6a..98072adf 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss @@ -73,9 +73,6 @@ grid-row: 2; min-width: 0; - // Standard-Cap (760px) aufheben, damit die Fachgebiete die volle - // Breite nutzen und weniger Zeilen umbrechen; eigener Abstand der - // Legende entfällt, da der Grid-Row-Gap bereits Platz schafft ::ng-deep .topic-legend { width: 100%; margin-top: 0; diff --git a/webapp/src/app/modules/person-publications/person-publications.component.html b/webapp/src/app/modules/person-publications/person-publications.component.html index 52dacc28..274b4eb3 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.html +++ b/webapp/src/app/modules/person-publications/person-publications.component.html @@ -113,34 +113,46 @@ @if (selectedInstitutions.length || selectedTopics.length) { -
- @for (institution of selectedInstitutions; track institution.id) { - - {{ institution.display_name }} - - - } - @for (topic of selectedTopics; track topic.id) { - - - - - - } +
+ Aktive Filter: +
+ @for (topic of selectedTopics; track topic.id) { + + Thema: + + + + + } + @for (institution of selectedInstitutions; track institution.id) { + + Institution: {{ institution.display_name }} + + + } +
}
diff --git a/webapp/src/app/modules/person-publications/person-publications.component.scss b/webapp/src/app/modules/person-publications/person-publications.component.scss index ead85589..67adb843 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.scss +++ b/webapp/src/app/modules/person-publications/person-publications.component.scss @@ -48,7 +48,10 @@ h2 { .publication-filters .institution-filter, .publication-filters .topic-filter { - width: 320px; + flex: 1 1 200px; + width: auto; + min-width: 180px; + max-width: 320px; } .publication-filters .reset-filter-btn { @@ -115,52 +118,97 @@ h2 { line-height: 1.2; } -.selected-filter-chips { +.active-filters-row { display: flex; + align-items: center; flex-wrap: wrap; - justify-content: flex-end; - gap: 6px; - max-width: 900px; - margin: 0; + gap: 10px; + padding: 8px 16px; + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + background: var(--sg-surface); + font-size: 13px; } -.selected-filter-chip { +.active-filters-label { + font-weight: 600; + color: var(--sg-text-muted); +} + +.chips-container { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 6px; +} + +.filter-chip, +.active-topic-filter { display: inline-flex; align-items: center; - max-width: 320px; - min-height: 26px; - padding: 3px 4px 3px 9px; - border: 1px solid #d9e2f0; - border-radius: var(--sg-radius-sm); - background: #fff; +} + +.filter-chip { + gap: 4px; + padding: 2px 8px; + border: 1px solid var(--sg-border-strong); + border-radius: 12px; + background: var(--sg-surface-soft); color: var(--sg-text); font-size: 11px; - line-height: 1.2; + font-weight: 600; } -.selected-filter-chip--topic { - padding: 0; - border: 0; - background: transparent; +.active-topic-filter { + gap: 5px; + max-width: 100%; + padding: 2px 6px 2px 8px; + border: 1px solid var(--sg-border-strong); + border-radius: 12px; + background: var(--sg-surface-soft); } -.selected-filter-chip button { - display: inline-grid; - place-items: center; - width: 20px; - height: 20px; - margin-left: 3px; - padding: 0; - border: 0; - background: transparent; +.active-topic-filter__prefix { + flex: 0 0 auto; color: var(--sg-text-muted); - cursor: pointer; + font-size: 11px; + font-weight: 700; } -.selected-filter-chip mat-icon { - width: 14px; - height: 14px; - font-size: 14px; +app-topic-chip.active-filter-topic-chip { + max-width: min(320px, 48vw); +} + +::ng-deep app-topic-chip.active-filter-topic-chip .topic-chip__button { + min-height: 22px; + padding: 2px 6px; +} + +::ng-deep app-topic-chip.active-filter-topic-chip .topic-chip__label { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.filter-chip button, +.active-topic-filter button { + display: flex; + padding: 0; + border: 0; + background: transparent; + color: var(--sg-text-soft); + cursor: pointer; + + &:hover { + color: var(--sg-text); + } +} + +.filter-chip button mat-icon, +.active-topic-filter button mat-icon { + width: 12px; + height: 12px; + font-size: 12px; } .table-wrap { @@ -335,8 +383,7 @@ mat-paginator { width: 100%; } - .selected-filter-chips { - justify-content: flex-start; - max-width: none; + .active-filters-row { + align-self: stretch; } } diff --git a/webapp/src/app/modules/person-publications/person-publications.component.ts b/webapp/src/app/modules/person-publications/person-publications.component.ts index e55918ff..32f3f250 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.ts +++ b/webapp/src/app/modules/person-publications/person-publications.component.ts @@ -324,8 +324,6 @@ export class PersonPublicationsComponent implements OnInit { const topic = event.option.value as TopicAutocompleteOption; if (!topic.id) return; if (!this.selectedTopics.some((item) => item.id === topic.id)) { - // Das Autocomplete liefert die Hierarchie nur im hint ("Feld · Subfeld - // · Domain"); für die Chip-Farbe das Fachgebiet daraus ableiten. const enrichedTopic: TopicAutocompleteOption = { ...topic, field_name: topic.field_name ?? this.fieldNameFromHint(topic.hint), @@ -555,8 +553,6 @@ export class PersonPublicationsComponent implements OnInit { const topicNames = this.selectedTopics .map((topic) => topic.display_name) .filter((name): name is string => !!name); - // Index-aligned mit topicIds, damit die Hierarchie-Farbe nach einem - // Reload erhalten bleibt (leerer String = keine Angabe). const topicFields = this.selectedTopics.map( (topic) => topic.field_name ?? '', ); From 5d13b07c73fa13cf4c4fa0b020a347c2a2ecf1f6 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Tue, 30 Jun 2026 00:09:37 +0200 Subject: [PATCH 11/21] Add field-based color indicators to person search cards filtering --- .../topic-hierarchy/topic-hierarchy.component.html | 9 ++++++++- .../topic-hierarchy/topic-hierarchy.component.scss | 12 ++++++++++++ .../topic-hierarchy/topic-hierarchy.component.ts | 8 ++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html index 330b076f..3df414de 100644 --- a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html @@ -67,6 +67,10 @@ matTooltipPosition="above" (focusin)="tooltip.show()" (focusout)="tooltip.hide()"> + {{ topic.name }} {{ @@ -112,7 +116,10 @@ : 'chevron_right' }} - folder + {{ field.name }} diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss index abfa99bc..c42fbac7 100644 --- a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss @@ -93,6 +93,18 @@ flex-direction: column; } +.field-dot { + flex: 0 0 auto; + display: inline-block; + vertical-align: middle; + width: 9px; + height: 9px; + margin-right: 7px; + border-radius: 50%; + border: 1px solid rgba(255, 255, 255, 0.85); + box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2); +} + .node-header { display: flex; align-items: center; diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts index eb7af86a..1877b3c0 100644 --- a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts @@ -6,6 +6,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatRadioModule } from '@angular/material/radio'; import { MatTooltipModule } from '@angular/material/tooltip'; import { TopicsService } from '../../api/api/topics.service'; +import { topicHierarchyColor } from '../../shared/utils/topic-colors'; import { combineLatest, of } from 'rxjs'; import { toObservable } from '@angular/core/rxjs-interop'; import { @@ -39,6 +40,7 @@ interface FlatTopic { id: string; name: string; path: string; + fieldName: string; } @Component({ @@ -120,6 +122,7 @@ export class TopicHierarchyComponent implements OnInit { name: topic.display_name || '', path: parts.length > 0 ? parts.join(' > ') : topic.description || '', + fieldName: topic.field?.display_name || '', }; }); } @@ -151,6 +154,7 @@ export class TopicHierarchyComponent implements OnInit { id: topic.id, name: topic.name, path: `${domain.name} > ${field.name} > ${subfield.name}`, + fieldName: field.name, }); } }); @@ -164,6 +168,10 @@ export class TopicHierarchyComponent implements OnInit { this.searchType.set(type); } + getFieldColor(fieldName: string | null | undefined): string { + return topicHierarchyColor({ field_name: fieldName }); + } + toggleTopic(name: string): void { const nextSelection = new Set(this.selectedTopics()); if (nextSelection.has(name)) { From 95ce3a47fc06624e066261457169140c7dfb0cd1 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Fri, 3 Jul 2026 12:21:39 +0200 Subject: [PATCH 12/21] publications overview: make table cells clickable filters with active state --- .../person-publications.component.html | 72 +++++++-- .../person-publications.component.scss | 138 ++++++++++++++++-- .../person-publications.component.ts | 73 ++++++++- 3 files changed, 259 insertions(+), 24 deletions(-) diff --git a/webapp/src/app/modules/person-publications/person-publications.component.html b/webapp/src/app/modules/person-publications/person-publications.component.html index 274b4eb3..20b9481c 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.html +++ b/webapp/src/app/modules/person-publications/person-publications.component.html @@ -179,7 +179,19 @@ Jahr - {{ publication.publication_year || '-' }} + @if (publication.publication_year) { + + } @else { + - + } @@ -187,9 +199,17 @@ Typ @if (publication.type) { - - {{ publication.type }} - + } @else { - } @@ -199,7 +219,19 @@ Sprache / Quelle - {{ publication.language || '-' }} + @if (publication.language) { + + } @else { + - + } @@ -212,11 +244,33 @@ institution of publicationInstitutions.slice(0, 3); track institution.id ) { - - {{ institution.name }} - + [class.active]="isInstitutionActive(institution.id)" + [matTooltip]="institution.name" + matTooltipPosition="above" + [attr.aria-label]=" + 'Nach Institution ' + institution.name + ' filtern' + " + (click)="filterByInstitution(institution)"> + apartment + {{ institution.name }} + @if (institution.country) { + + {{ + institution.country.toUpperCase() + }} + } + } @empty { - } diff --git a/webapp/src/app/modules/person-publications/person-publications.component.scss b/webapp/src/app/modules/person-publications/person-publications.component.scss index 67adb843..3874f75f 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.scss +++ b/webapp/src/app/modules/person-publications/person-publications.component.scss @@ -267,6 +267,61 @@ a.title:hover { color: rgba(0, 0, 0, 0.54); } +.cell-filter-pill { + display: inline-flex; + align-items: center; + margin: 0; + padding: 3px 10px; + border: 1px solid var(--sg-border); + border-radius: 999px; + background: #fff; + color: var(--sg-text); + font-family: inherit; + font-size: 12px; + line-height: 1.2; + cursor: pointer; + transition: all 0.2s ease; + + &:hover, + &:focus-visible { + border-color: var(--sg-primary); + background: var(--sg-surface-soft); + outline: none; + } + + &.active { + border-color: var(--sg-primary); + color: var(--sg-primary); + font-weight: 600; + box-shadow: + 0 0 0 1px #ffffff, + 0 0 0 3px var(--sg-primary); + } +} + +.type-filter-btn { + display: inline-flex; + margin: 0; + padding: 0; + border: 0; + border-radius: 7px; + background: transparent; + cursor: pointer; + transition: box-shadow 0.2s ease; + + &:hover, + &:focus-visible { + outline: none; + box-shadow: 0 0 0 1px var(--sg-primary); + } + + &.active { + box-shadow: + 0 0 0 1px #ffffff, + 0 0 0 3px var(--sg-primary); + } +} + .topic-chips { display: flex; flex-wrap: wrap; @@ -295,31 +350,88 @@ a.title:hover { max-width: 280px; } -.publication-institution-tag, +.publication-institution-tag { + display: inline-flex; + align-items: center; + max-width: 200px; + margin: 0; + padding: 2px 6px; + border: 1px solid var(--sg-primary-border, var(--sg-border)); + border-radius: 4px; + background: var(--sg-primary-soft); + color: var(--sg-primary); + font-family: inherit; + font-size: 10px; + font-weight: 600; + line-height: normal; + cursor: pointer; + transition: all 0.2s ease; + + &:hover, + &:focus-visible { + background: var(--sg-primary); + color: #fff; + 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 #ffffff, + 0 0 0 3px var(--sg-primary); + } + + &.active:hover, + &.active:focus-visible { + background: var(--sg-primary); + color: #fff; + } +} + +.publication-institution-tag .institution-icon { + flex-shrink: 0; + width: 12px; + height: 12px; + margin-right: 4px; + font-size: 12px; +} + +.publication-institution-tag .institution-name { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + min-width: 0; +} + +.publication-institution-tag .flag-img { + flex-shrink: 0; + margin-left: 6px; + border: 1px solid; +} + +.publication-institution-tag .country-code { + flex-shrink: 0; + margin-left: 2px; + font-size: 9px; +} + .publication-institution-more { display: inline-flex; align-items: center; - max-width: 180px; min-height: 24px; padding: 3px 8px; border: 1px solid var(--sg-border); border-radius: var(--sg-radius-sm); background: #fff; - color: var(--sg-text); + color: var(--sg-text-muted); font-size: 11px; line-height: 1.2; } -.publication-institution-tag { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.publication-institution-more { - color: var(--sg-text-muted); -} - ::ng-deep .mat-mdc-header-cell { color: var(--sg-text-muted); font-size: 12px; diff --git a/webapp/src/app/modules/person-publications/person-publications.component.ts b/webapp/src/app/modules/person-publications/person-publications.component.ts index 32f3f250..4d9f1fb0 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.ts +++ b/webapp/src/app/modules/person-publications/person-publications.component.ts @@ -25,6 +25,7 @@ import { MatButtonModule } from '@angular/material/button'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { catchError, @@ -100,6 +101,7 @@ interface PublicationFilterQueryState { MatSelectModule, MatSnackBarModule, MatTableModule, + MatTooltipModule, ReactiveFormsModule, RouterLink, TopicChipComponent, @@ -316,6 +318,67 @@ export class PersonPublicationsComponent implements OnInit { this.applyFilters(); } + filterByInstitution(institution: { id: string; name: string }): void { + if (!institution.id) return; + if (this.selectedInstitutions.some((item) => item.id === institution.id)) { + return; + } + this.selectedInstitutions = [ + ...this.selectedInstitutions, + { id: institution.id, display_name: institution.name }, + ]; + this.applyFilters(); + } + + isInstitutionActive(id: string): boolean { + return !!id && this.selectedInstitutions.some((item) => item.id === id); + } + + toggleYearFilter(year: number): void { + const control = this.filterForm.controls.publicationYears; + const current = control.value; + control.setValue( + current.includes(year) + ? current.filter((value) => value !== year) + : [...current, year], + ); + this.applyFilters(); + } + + toggleTypeFilter(type: string): void { + const control = this.filterForm.controls.types; + const current = control.value; + control.setValue( + current.includes(type) + ? current.filter((value) => value !== type) + : [...current, type], + ); + this.applyFilters(); + } + + toggleLanguageFilter(language: string): void { + const control = this.filterForm.controls.languages; + const current = control.value; + control.setValue( + current.includes(language) + ? current.filter((value) => value !== language) + : [...current, language], + ); + this.applyFilters(); + } + + isYearActive(year: number): boolean { + return this.filterForm.controls.publicationYears.value.includes(year); + } + + isTypeActive(type: string): boolean { + return this.filterForm.controls.types.value.includes(type); + } + + isLanguageActive(language: string): boolean { + return this.filterForm.controls.languages.value.includes(language); + } + displayTopic(option: string | TopicAutocompleteOption): string { return typeof option === 'string' ? option : (option.display_name ?? ''); } @@ -420,8 +483,13 @@ export class PersonPublicationsComponent implements OnInit { return 'info'; } - institutions(publication: Work): Array<{ id: string; name: string }> { - const institutionsById = new Map(); + institutions( + publication: Work, + ): Array<{ id: string; name: string; country: string | null }> { + const institutionsById = new Map< + string, + { id: string; name: string; country: string | null } + >(); for (const authorship of publication.authorships ?? []) { for (const institution of authorship.institutions ?? []) { @@ -430,6 +498,7 @@ export class PersonPublicationsComponent implements OnInit { institutionsById.set(institution.id, { id: institution.id, name: institution.display_name, + country: institution.country_code ?? null, }); } } From 116492baca6e8c22251a6a5133c365367d7953bb Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Fri, 3 Jul 2026 13:02:09 +0200 Subject: [PATCH 13/21] person list: style active institution filter as person-card chip --- .../person-list/person-list.component.html | 32 +++++++++++ .../person-list/person-list.component.scss | 55 ++++++++++++++++++- .../person-list/person-list.component.ts | 42 +++++++++++++- 3 files changed, 125 insertions(+), 4 deletions(-) diff --git a/webapp/src/app/modules/person-list/person-list.component.html b/webapp/src/app/modules/person-list/person-list.component.html index e3d4fcc8..b0ccca88 100644 --- a/webapp/src/app/modules/person-list/person-list.component.html +++ b/webapp/src/app/modules/person-list/person-list.component.html @@ -61,6 +61,38 @@ close + } @else if (filter.category === 'institutionName') { + + + apartment + {{ + institutionFilterLabel(filter) + }} + @if (filter.countryCode) { + + {{ + filter.countryCode.toUpperCase() + }} + } + + + } @else { {{ filter.label }} diff --git a/webapp/src/app/modules/person-list/person-list.component.scss b/webapp/src/app/modules/person-list/person-list.component.scss index 92e7225d..7aa6e880 100644 --- a/webapp/src/app/modules/person-list/person-list.component.scss +++ b/webapp/src/app/modules/person-list/person-list.component.scss @@ -165,9 +165,58 @@ app-topic-chip.active-filter-topic-chip { white-space: nowrap; } -// Shared button resets +.active-institution-filter { + display: inline-flex; + align-items: center; + gap: 4px; + max-width: 100%; +} + +.filter-institution-chip { + display: inline-flex; + align-items: center; + max-width: min(280px, 46vw); + padding: 2px 6px; + border: 1px solid var(--sg-primary-border, var(--sg-border)); + border-radius: 4px; + background: var(--sg-primary-soft); + color: var(--sg-primary); + font-size: 11px; + font-weight: 600; +} + +.filter-institution-chip__icon { + flex-shrink: 0; + width: 12px; + height: 12px; + margin-right: 4px; + font-size: 12px; +} + +.filter-institution-chip__name { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + min-width: 0; +} + +.filter-institution-chip__flag { + flex-shrink: 0; + margin-left: 6px; + border: 1px solid var(--sg-primary-border, var(--sg-border)); + vertical-align: middle; +} + +.filter-institution-chip__country { + flex-shrink: 0; + margin-left: 2px; + font-size: 9px; + white-space: nowrap; +} + .filter-chip button, .active-topic-filter button, +.active-institution-filter button, .clear-topic-search, .clear-all-btn { border: none; @@ -177,6 +226,7 @@ app-topic-chip.active-filter-topic-chip { .filter-chip button, .active-topic-filter button, +.active-institution-filter button, .clear-topic-search { padding: 0; display: flex; @@ -188,7 +238,8 @@ app-topic-chip.active-filter-topic-chip { } .filter-chip button mat-icon, -.active-topic-filter button mat-icon { +.active-topic-filter button mat-icon, +.active-institution-filter button mat-icon { font-size: 12px; width: 12px; height: 12px; diff --git a/webapp/src/app/modules/person-list/person-list.component.ts b/webapp/src/app/modules/person-list/person-list.component.ts index c20c0207..d1ad59a8 100644 --- a/webapp/src/app/modules/person-list/person-list.component.ts +++ b/webapp/src/app/modules/person-list/person-list.component.ts @@ -15,6 +15,7 @@ import { ResolverStateService } from '../../shared/services/resolver-state.servi import { CustomAuthor, + DehydratedInstitution, PersonsService, InstitutionsService, WorkTopic, @@ -289,13 +290,18 @@ export class PersonListComponent { this.applySidebarFilters(); } - // Active filters tags row get activeFilters(): Array<{ category: string; value: string; label: string; + countryCode?: string | null; }> { - const list: Array<{ category: string; value: string; label: string }> = []; + const list: Array<{ + category: string; + value: string; + label: string; + countryCode?: string | null; + }> = []; this.selectedTopics().forEach((t) => { list.push({ category: 'topic', value: t, label: `Thema: ${t}` }); }); @@ -309,11 +315,43 @@ export class PersonListComponent { category: 'institutionName', value: this.appliedInstitutionName, label: label, + countryCode: this.findInstitutionCountryCode( + this.appliedInstitutionName, + ), }); } return list; } + institutionFilterLabel(filter: { label: string }): string { + return filter.label.replace(/^Institution:\s*/, ''); + } + + private findInstitutionCountryCode(institutionName: string): string | null { + const normalized = institutionName.trim().toLowerCase(); + if (!normalized) { + return null; + } + + for (const person of this.persons) { + const candidates: Array = [ + ...(person.last_known_institutions ?? []), + ...(person.affiliations ?? []).map((a) => a.institution ?? undefined), + ]; + + for (const inst of candidates) { + if ( + inst?.country_code && + (inst.display_name ?? '').trim().toLowerCase() === normalized + ) { + return inst.country_code; + } + } + } + + return null; + } + removeFilter(filter: { category: string; value: string }): void { if (filter.category === 'topic') { this.selectedTopics.update((set) => { From 6fa5792e5eb5c0b74fd91dcf4ffc9b899356051e Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Fri, 3 Jul 2026 13:10:13 +0200 Subject: [PATCH 14/21] publication overview: show institution filter as person-card chip with flag --- .../person-publications.component.html | 22 +++++++- .../person-publications.component.scss | 54 ++++++++++++++++++- .../person-publications.component.ts | 16 ++++++ 3 files changed, 88 insertions(+), 4 deletions(-) diff --git a/webapp/src/app/modules/person-publications/person-publications.component.html b/webapp/src/app/modules/person-publications/person-publications.component.html index 20b9481c..375842a1 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.html +++ b/webapp/src/app/modules/person-publications/person-publications.component.html @@ -141,8 +141,26 @@ } @for (institution of selectedInstitutions; track institution.id) { - - Institution: {{ institution.display_name }} + @let instCountry = selectedInstitutionCountry(institution); + + + apartment + {{ + institution.display_name + }} + @if (instCountry) { + + {{ + instCountry.toUpperCase() + }} + } + - @if (selectedInstitutions.length || selectedTopics.length) { + @let selectedYears = filterForm.controls.publicationYears.value; + @let selectedTypes = filterForm.controls.types.value; + @let selectedLanguages = filterForm.controls.languages.value; + @if ( + selectedInstitutions.length || + selectedTopics.length || + selectedYears.length || + selectedTypes.length || + selectedLanguages.length + ) {
Aktive Filter:
+ @for (year of selectedYears; track year) { + + + calendar_today + {{ year }} + + + + } + @for (type of selectedTypes; track type) { + + + category + {{ type }} + + + + } + @for (language of selectedLanguages; track language) { + + + translate + {{ + languageLabel(language) + }} + + + + } @for (topic of selectedTopics; track topic.id) { Thema: diff --git a/webapp/src/app/modules/person-publications/person-publications.component.scss b/webapp/src/app/modules/person-publications/person-publications.component.scss index 1f30a182..bf67b546 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.scss +++ b/webapp/src/app/modules/person-publications/person-publications.component.scss @@ -43,7 +43,7 @@ h2 { } .publication-filters mat-form-field { - width: 150px; + width: 175px; } .publication-filters .institution-filter, @@ -77,8 +77,17 @@ h2 { ::ng-deep .publication-filters .mat-mdc-text-field-wrapper { height: 42px; - background: #fff; + background: var(--sg-surface-soft); + border: 1px solid var(--sg-border); border-radius: var(--sg-radius-sm); + transition: + border-color 0.15s, + box-shadow 0.15s; +} + +::ng-deep .publication-filters .mat-focused .mat-mdc-text-field-wrapper { + border-color: var(--sg-primary); + box-shadow: 0 0 0 2px var(--sg-primary-soft); } ::ng-deep .publication-filters .mat-mdc-form-field-infix { @@ -90,7 +99,19 @@ h2 { ::ng-deep .publication-filters .mdc-notched-outline__leading, ::ng-deep .publication-filters .mdc-notched-outline__notch, ::ng-deep .publication-filters .mdc-notched-outline__trailing { - border-color: #d9e2f0; + border: none; +} + +.filter-prefix-icon { + width: 18px; + height: 18px; + font-size: 18px; + color: var(--sg-text-soft); +} + +::ng-deep .publication-filters .mat-mdc-form-field-icon-prefix { + padding: 0 4px 0 10px; + color: var(--sg-text-soft); } ::ng-deep .publication-filters .mat-mdc-select-value, @@ -118,6 +139,44 @@ h2 { line-height: 1.2; } +::ng-deep .select-search { + position: sticky; + top: 0; + z-index: 1; + display: flex; + align-items: center; + gap: 6px; + min-width: 200px; + padding: 8px 12px; + background: var(--sg-surface, #fff); + border-bottom: 1px solid var(--sg-border); +} + +::ng-deep .select-search__icon { + flex-shrink: 0; + width: 16px; + height: 16px; + font-size: 16px; + color: var(--sg-text-soft); +} + +::ng-deep .select-search__input { + flex: 1; + min-width: 0; + border: none; + outline: none; + background: transparent; + color: var(--sg-text); + font-family: inherit; + font-size: 13px; +} + +::ng-deep .select-search__empty { + padding: 10px 14px; + color: var(--sg-text-muted); + font-size: 13px; +} + .active-filters-row { display: flex; align-items: center; @@ -185,7 +244,7 @@ h2 { .filter-institution-chip { display: inline-flex; align-items: center; - max-width: 220px; + max-width: 340px; padding: 2px 6px; border: 1px solid var(--sg-primary-border, var(--sg-border)); border-radius: 4px; @@ -204,10 +263,13 @@ h2 { } .institution-name { + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; min-width: 0; + white-space: normal; + overflow-wrap: anywhere; } .flag-img { @@ -223,6 +285,41 @@ h2 { } } +.active-meta-filter { + display: inline-flex; + align-items: center; + gap: 4px; + max-width: 100%; +} + +.filter-meta-chip { + display: inline-flex; + align-items: center; + padding: 2px 8px; + border: 1px solid var(--sg-border-strong); + border-radius: 4px; + background: var(--sg-surface-soft); + color: var(--sg-text); + font-size: 11px; + font-weight: 600; +} + +.filter-meta-chip__icon { + flex-shrink: 0; + width: 12px; + height: 12px; + margin-right: 4px; + font-size: 12px; + color: var(--sg-text-soft); +} + +.filter-meta-chip__label { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + min-width: 0; +} + app-topic-chip.active-filter-topic-chip { max-width: min(320px, 48vw); } @@ -240,7 +337,8 @@ app-topic-chip.active-filter-topic-chip { .filter-chip button, .active-topic-filter button, -.active-institution-filter button { +.active-institution-filter button, +.active-meta-filter button { display: flex; padding: 0; border: 0; @@ -255,7 +353,8 @@ app-topic-chip.active-filter-topic-chip { .filter-chip button mat-icon, .active-topic-filter button mat-icon, -.active-institution-filter button mat-icon { +.active-institution-filter button mat-icon, +.active-meta-filter button mat-icon { width: 12px; height: 12px; font-size: 12px; @@ -397,6 +496,7 @@ table.is-hidden { .institution-tags { display: flex; flex-wrap: wrap; + align-items: flex-start; gap: 6px; max-width: 280px; } @@ -404,7 +504,7 @@ table.is-hidden { .publication-institution-tag { display: inline-flex; align-items: center; - max-width: 200px; + max-width: 100%; margin: 0; padding: 2px 6px; border: 1px solid var(--sg-primary-border, var(--sg-border)); @@ -452,10 +552,13 @@ table.is-hidden { } .publication-institution-tag .institution-name { + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; min-width: 0; + white-space: normal; + overflow-wrap: anywhere; } .publication-institution-tag .flag-img { @@ -521,6 +624,17 @@ table.is-hidden { .mat-column-citations { text-align: center; } + + .mat-mdc-header-cell.mat-column-title, + .mat-mdc-header-cell.mat-column-institutions, + .mat-mdc-header-cell.mat-column-topics { + text-align: center; + } + + .mat-mdc-cell:not(:last-child), + .mat-mdc-header-cell:not(:last-child) { + border-right: 1px solid var(--sg-border); + } } mat-paginator { diff --git a/webapp/src/app/modules/person-publications/person-publications.component.ts b/webapp/src/app/modules/person-publications/person-publications.component.ts index d689e672..e0efcbf2 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.ts +++ b/webapp/src/app/modules/person-publications/person-publications.component.ts @@ -139,6 +139,9 @@ export class PersonPublicationsComponent implements OnInit { >('', { nonNullable: true, }); + readonly yearSearchControl = new FormControl('', { nonNullable: true }); + readonly typeSearchControl = new FormControl('', { nonNullable: true }); + readonly languageSearchControl = new FormControl('', { nonNullable: true }); readonly filterForm = new FormGroup({ publicationYears: new FormControl([], { nonNullable: true }), @@ -547,6 +550,68 @@ export class PersonPublicationsComponent implements OnInit { return Array.from(institutionsById.values()); } + yearSelectionSummary(): string { + return this.summarizeSelection( + this.filterForm.controls.publicationYears.value.map((year) => + String(year), + ), + ); + } + + typeSelectionSummary(): string { + return this.summarizeSelection(this.filterForm.controls.types.value); + } + + languageSelectionSummary(): string { + const labels = this.filterForm.controls.languages.value.map( + (value) => + this.languageOptions.find((option) => option.value === value)?.label ?? + value, + ); + return this.summarizeSelection(labels); + } + + private summarizeSelection(labels: string[]): string { + if (labels.length === 0) return ''; + if (labels.length === 1) return labels[0]; + return `+${labels.length}`; + } + + languageLabel(value: string): string { + return ( + this.languageOptions.find((option) => option.value === value)?.label ?? + value + ); + } + + filteredYearOptions(): number[] { + const term = this.yearSearchControl.value.trim(); + if (!term) return this.publicationYearOptions; + return this.publicationYearOptions.filter((year) => + String(year).includes(term), + ); + } + + filteredTypeOptions(): { value: string; label: string }[] { + const term = this.typeSearchControl.value.trim().toLowerCase(); + if (!term) return this.typeOptions; + return this.typeOptions.filter((type) => + type.label.toLowerCase().includes(term), + ); + } + + filteredLanguageOptions(): { value: string; label: string }[] { + const term = this.languageSearchControl.value.trim().toLowerCase(); + if (!term) return this.languageOptions; + return this.languageOptions.filter((language) => + language.label.toLowerCase().includes(term), + ); + } + + focusSelectSearch(input: HTMLInputElement): void { + setTimeout(() => input.focus()); + } + private filters() { return { publicationYears: this.filterForm.controls.publicationYears.value, From c1cba4bd4cace89e96a4baaafd60d59f0c494454 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Fri, 3 Jul 2026 15:54:24 +0200 Subject: [PATCH 20/21] person cards: limit topic display if too large --- webapp/src/app/modules/person-card/person-card.component.scss | 3 +++ 1 file changed, 3 insertions(+) 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 582fca20..c8b2db5a 100644 --- a/webapp/src/app/modules/person-card/person-card.component.scss +++ b/webapp/src/app/modules/person-card/person-card.component.scss @@ -263,6 +263,7 @@ } app-topic-chip.person-topic-chip { + min-width: 0; max-width: 100%; } @@ -271,6 +272,8 @@ app-topic-chip.person-topic-chip { } :host ::ng-deep app-topic-chip.person-topic-chip .topic-chip__label { + justify-self: stretch; + min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; From 3867540a4cdb1cc2c28a05269032ead9291648c9 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Sun, 5 Jul 2026 19:46:24 +0200 Subject: [PATCH 21/21] refactor(publications, people): unify active topic chip, add loading states --- .../person-card/person-card.component.html | 2 + .../person-card/person-card.component.scss | 8 + .../person-list/person-list.component.html | 23 +- .../person-list/person-list.component.scss | 43 +- .../person-publications.component.html | 23 +- .../person-publications.component.scss | 370 ++++++------------ webapp/src/styles.scss | 45 +++ 7 files changed, 230 insertions(+), 284 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 49edc9ae..946430ae 100644 --- a/webapp/src/app/modules/person-card/person-card.component.html +++ b/webapp/src/app/modules/person-card/person-card.component.html @@ -58,7 +58,9 @@ type="button" class="institution-tag" [class.active]="isInstitutionActive()" + [class.is-loading]="loading()" [matTooltip]="inst.display_name || ''" + [matTooltipDisabled]="loading()" matTooltipPosition="above" (click)=" institutionClick.emit(inst.display_name || ''); 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 c8b2db5a..75f0ed69 100644 --- a/webapp/src/app/modules/person-card/person-card.component.scss +++ b/webapp/src/app/modules/person-card/person-card.component.scss @@ -185,6 +185,14 @@ background: var(--sg-primary); color: #fff; } + + &.is-loading { + pointer-events: none; + background: var(--sg-surface-soft); + border-color: var(--sg-border); + color: var(--sg-text-soft); + box-shadow: none; + } } .flag-img { diff --git a/webapp/src/app/modules/person-list/person-list.component.html b/webapp/src/app/modules/person-list/person-list.component.html index fd360b6e..8f3b0f37 100644 --- a/webapp/src/app/modules/person-list/person-list.component.html +++ b/webapp/src/app/modules/person-list/person-list.component.html @@ -38,19 +38,14 @@ ) { @if (filter.category === 'topic') { - Thema: - - + + label + {{ + filter.value + }} +