From ac6b5aa72b3ee666dab329af6ffa66293d73cf81 Mon Sep 17 00:00:00 2001 From: Kazgatari <56477241+Kazgatari@users.noreply.github.com> Date: Tue, 18 Aug 2026 17:54:32 +0200 Subject: [PATCH 1/7] started with icon duplicate merge --- webapp/src/app/shared/ui/icons.ts | 44 +++++++++++++++++-------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/webapp/src/app/shared/ui/icons.ts b/webapp/src/app/shared/ui/icons.ts index c4932161..c76cd754 100644 --- a/webapp/src/app/shared/ui/icons.ts +++ b/webapp/src/app/shared/ui/icons.ts @@ -1,31 +1,35 @@ // ============================================================================ // 1. Core Domain & Entity Icons // ============================================================================ -export const ACCOUNT_BALANCE_ICON = 'account_balance' as const; -export const ACCOUNT_CIRCLE_ICON = 'account_circle' as const; + export const BOOKMARK_ICON = 'bookmark' as const; export const BOOKMARKS_ICON = 'bookmarks' as const; -export const COMPANY_CONNECTION_ICON = 'business' as const; export const DASHBOARD_ICON = 'dashboard' as const; export const FUNDING_ICON = 'account_balance' as const; -export const GROUPS_ICON = 'groups' as const; -export const INSTITUTION_ICON = 'school' as const; +export const INSTITUTION_ICON = 'apartment' as const; //was 'school' export const JOBS_ICON = 'sync' as const; export const KEYWORDS_ICON = 'join_left' as const; export const NEWS_ICON = 'newspaper' as const; -export const NO_ACCOUNTS_ICON = 'no_accounts' as const; export const ORGANIZATIONS_ICON = 'domain' as const; -export const OVERVIEW_ICON = 'visibility' as const; export const PATENT_ICON = 'workspace_premium' as const; -export const PERSON_CHECK_ICON = 'person_check' as const; +export const PERSON_CHECK_ICON = 'person_check' as const; // person check and person look the same to me export const PERSON_ICON = 'person' as const; -export const PERSON_OFF_ICON = 'person_off' as const; export const PERSONS_ICON = 'groups' as const; +export const GROUPS_ICON = PERSONS_ICON; // TODO export const PROJECT_ICON = 'work' as const; export const PUBLICATION_ICON = 'menu_book' as const; -export const MENU_BOOK_ICON = 'menu_book' as const; +export const MENU_BOOK_ICON = PUBLICATION_ICON; // TODO export const TOPIC_ICON = 'topic' as const; +export const OVERVIEW_ICON = 'visibility' as const; + +export const NO_ACCOUNTS_ICON = 'no_accounts' as const; +export const PERSON_OFF_ICON = 'person_off' as const; // person off and no accounts look similar + +export const ACCOUNT_BALANCE_ICON = FUNDING_ICON; // TODO +export const ACCOUNT_CIRCLE_ICON = 'account_circle' as const; //Person Icon in company-connections +export const COMPANY_CONNECTION_ICON = 'business' as const; + // ============================================================================ // 2. Navigation, Layout & Hierarchy Icons // ============================================================================ @@ -44,7 +48,7 @@ export const MENU_ICON = 'menu' as const; export const NETWORK_ICON = 'share' as const; export const NORTH_EAST_ICON = 'north_east' as const; export const OPEN_IN_NEW_ICON = 'open_in_new' as const; -export const SUBFIELD_ICON = 'folder_open' as const; + export const UNFOLD_LESS_ICON = 'unfold_less' as const; export const UNFOLD_MORE_ICON = 'unfold_more' as const; @@ -94,15 +98,15 @@ export const TUNE_ICON = 'tune' as const; // ============================================================================ export const BOOKMARK_BORDER_ICON = 'bookmark_border' as const; export const CHECK_ICON = 'check' as const; -export const CHECK_CIRCLE_ICON = 'check_circle' as const; +export const CHECK_CIRCLE_ICON = 'check_circle' as const; // similar to check but with circle export const CIRCLE_ICON = 'circle' as const; export const CLOUD_OFF_ICON = 'cloud_off' as const; export const ERROR_ICON = 'error' as const; export const ERROR_OUTLINE_ICON = 'error_outline' as const; export const FACT_CHECK_ICON = 'fact_check' as const; -export const HELP_ICON = 'help' as const; +export const HELP_ICON = 'help' as const; // same as info but with question mark export const INFO_ICON = 'info' as const; -export const INFO_OUTLINE_ICON = 'info_outline' as const; +export const INFO_OUTLINE_ICON = 'info_outline' as const; // same as info but inverted export const RULE_ICON = 'rule' as const; export const STAR_ICON = 'star' as const; export const VERIFIED_ICON = 'verified' as const; @@ -135,7 +139,7 @@ export const TRENDING_UP_ICON = 'trending_up' as const; // 7. Other // ============================================================================ export const APARTMENT_ICON = 'apartment' as const; -export const ARTICLE_ICON = 'article' as const; +export const ARTICLE_ICON = PUBLICATION_ICON; // was 'article' (TODO change in some components like dashboard) export const ASSIGNMENT_ICON = 'assignment' as const; export const ATTACH_MONEY_ICON = 'attach_money' as const; export const BIOTECH_ICON = 'biotech' as const; @@ -154,17 +158,17 @@ export const EURO_ICON = 'euro_symbol' as const; export const FILE_PRESENT_ICON = 'file_present' as const; export const FLAG_ICON = 'flag' as const; export const GAVEL_ICON = 'gavel' as const; -export const GROUP_ICON = 'group' as const; +export const GROUP_ICON = PERSONS_ICON; //TODO (was 'group') export const IMAGE_ICON = 'image' as const; export const INSERT_DRIVE_FILE_ICON = 'insert_drive_file' as const; -export const INTERESTS_ICON = 'interests' as const; -export const LABEL_ICON = 'label' as const; +export const INTERESTS_ICON = KEYWORDS_ICON; // was 'interests' +export const LABEL_ICON = TOPIC_ICON; //TODO export const LANGUAGE_ICON = 'language' as const; export const LIBRARY_BOOKS_ICON = 'library_books' as const; export const LOCATION_ICON = 'location_on' as const; export const MORE_INFO_ICON = 'more_info' as const; export const PAID_ICON = 'paid' as const; -export const PEOPLE_ICON = 'people' as const; +export const PEOPLE_ICON = PERSONS_ICON; //TODO (was 'people') export const PICTURE_AS_PDF_ICON = 'picture_as_pdf' as const; export const PUBLIC_ICON = 'public' as const; export const SCIENCE_ICON = 'science' as const; @@ -173,5 +177,5 @@ export const TAG_ICON = 'tag' as const; export const TEXT_FIELDS_ICON = 'text_fields' as const; export const TRANSLATE_ICON = 'translate' as const; export const VOLUNTEER_ACTIVISM_ICON = 'volunteer_activism' as const; -export const WORK_ICON = 'work' as const; +export const WORK_ICON = PROJECT_ICON; // TODO export const WORK_OUTLINE_ICON = 'work_outline' as const; -- 2.56.1 From 435c4ae3db49bc87ba4a99b80116f04106d3869f Mon Sep 17 00:00:00 2001 From: Kazgatari <56477241+Kazgatari@users.noreply.github.com> Date: Tue, 18 Aug 2026 17:56:14 +0200 Subject: [PATCH 2/7] added tooltip disable to undefined values for authors and institutions to avoid empty tooltips and links to undefined entities --- .../app-author-card.component.html | 50 ++++++++++--------- .../app-author-chip.component.html | 1 + .../app-author-chip.component.ts | 14 ++++++ .../app-author-tooltip.component.html | 2 +- .../app-author-tooltip.component.ts | 18 ++++++- .../app-institution-chip.component.html | 1 + .../app-institution-chip.component.ts | 14 ++++++ .../app-institution-tooltip.component.html | 2 +- .../app-institution-tooltip.component.ts | 18 ++++++- .../app-publication-tooltip.component.ts | 37 ++++++++++---- 10 files changed, 117 insertions(+), 40 deletions(-) diff --git a/webapp/src/app/shared/ui/app-author-card/app-author-card.component.html b/webapp/src/app/shared/ui/app-author-card/app-author-card.component.html index 304e3160..6887dd62 100644 --- a/webapp/src/app/shared/ui/app-author-card/app-author-card.component.html +++ b/webapp/src/app/shared/ui/app-author-card/app-author-card.component.html @@ -33,33 +33,35 @@ } - + @if (this.rawOaAuthorId()) { + - - - - {{ INFO_ICON }} - Übersicht - - - {{ PUBLICATION_ICON }} - Publikationen - - @if (this.showProjects()) { + + - {{ PROJECT_ICON }} - Projekte + {{ INFO_ICON }} + Übersicht - } - - + + {{ PUBLICATION_ICON }} + Publikationen + + @if (this.showProjects()) { + + {{ PROJECT_ICON }} + Projekte + + } + + + } diff --git a/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.html b/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.html index 72c12e13..4162342a 100644 --- a/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.html +++ b/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.html @@ -2,6 +2,7 @@ class="author-chip" [appComponentTooltip]="AuthorTooltipComponent" [tooltipInputs]="{ author: _author(), authorId: rawOaAuthorId() }" + [tooltipDisabled]="isTooltipDisabled()" [tooltipMaxWidth]="'500px'" (keydown)="_onChipClick($event)" (click)="_onChipClick($event)"> diff --git a/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.ts b/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.ts index 65c3b66a..276bfb24 100644 --- a/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.ts +++ b/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.ts @@ -54,6 +54,20 @@ export class AppAuthorChipComponent { size = input<'normal' | 'mini'>('normal'); isMiniSize = computed(() => this.size() === 'mini'); + tooltipDisabled = input(false); + hasValidAuthor = computed(() => { + const rawId = this.rawOaAuthorId(); + return Boolean( + rawId && + rawId.trim().length > 0 && + rawId !== 'undefined' && + rawId !== 'null', + ); + }); + isTooltipDisabled = computed(() => { + return this.tooltipDisabled() || !this.hasValidAuthor(); + }); + constructor() { effect(() => { const author = this.author(); diff --git a/webapp/src/app/shared/ui/app-author-tooltip/app-author-tooltip.component.html b/webapp/src/app/shared/ui/app-author-tooltip/app-author-tooltip.component.html index fa4b4cd8..74feb388 100644 --- a/webapp/src/app/shared/ui/app-author-tooltip/app-author-tooltip.component.html +++ b/webapp/src/app/shared/ui/app-author-tooltip/app-author-tooltip.component.html @@ -1,5 +1,5 @@ @let author = this._author(); -@if (author) { +@if (author && hasValidId()) { } diff --git a/webapp/src/app/shared/ui/app-author-tooltip/app-author-tooltip.component.ts b/webapp/src/app/shared/ui/app-author-tooltip/app-author-tooltip.component.ts index 2afd0614..797f66f0 100644 --- a/webapp/src/app/shared/ui/app-author-tooltip/app-author-tooltip.component.ts +++ b/webapp/src/app/shared/ui/app-author-tooltip/app-author-tooltip.component.ts @@ -1,4 +1,11 @@ -import { Component, effect, inject, input, signal } from '@angular/core'; +import { + Component, + computed, + effect, + inject, + input, + signal, +} from '@angular/core'; import { Author, AuthorsV2Service } from '../../../api'; import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; @@ -27,9 +34,16 @@ export class AppAuthorTooltipComponent { author = input(undefined); _author = signal(undefined); - _isLoading = signal(false); + hasValidId = computed(() => { + const a = this._author(); + const id = this.authorId() ?? a?.id; + return Boolean( + id && id.trim().length > 0 && id !== 'undefined' && id !== 'null', + ); + }); + constructor() { effect(() => { const authorObj = this.author(); diff --git a/webapp/src/app/shared/ui/app-institution-chip/app-institution-chip.component.html b/webapp/src/app/shared/ui/app-institution-chip/app-institution-chip.component.html index d1526086..8ca0a991 100644 --- a/webapp/src/app/shared/ui/app-institution-chip/app-institution-chip.component.html +++ b/webapp/src/app/shared/ui/app-institution-chip/app-institution-chip.component.html @@ -5,6 +5,7 @@ institution: _institution(), institutionId: rawOaInstitutionId(), }" + [tooltipDisabled]="isTooltipDisabled()" [tooltipMaxWidth]="'500px'" (keydown)="_onChipClick($event)" (click)="_onChipClick($event)"> diff --git a/webapp/src/app/shared/ui/app-institution-chip/app-institution-chip.component.ts b/webapp/src/app/shared/ui/app-institution-chip/app-institution-chip.component.ts index 5a2a333b..a98ab3cb 100644 --- a/webapp/src/app/shared/ui/app-institution-chip/app-institution-chip.component.ts +++ b/webapp/src/app/shared/ui/app-institution-chip/app-institution-chip.component.ts @@ -49,6 +49,20 @@ export class AppInstitutionChipComponent { size = input<'normal' | 'mini'>('normal'); isMiniSize = computed(() => this.size() === 'mini'); + tooltipDisabled = input(false); + hasValidInstitution = computed(() => { + const rawId = this.rawOaInstitutionId() ?? this.institutionId(); + return Boolean( + rawId && + rawId.trim().length > 0 && + rawId !== 'undefined' && + rawId !== 'null', + ); + }); + isTooltipDisabled = computed(() => { + return this.tooltipDisabled() || !this.hasValidInstitution(); + }); + constructor() { effect(() => { const institution = this.institution(); diff --git a/webapp/src/app/shared/ui/app-institution-tooltip/app-institution-tooltip.component.html b/webapp/src/app/shared/ui/app-institution-tooltip/app-institution-tooltip.component.html index 71932af2..4f1d56b2 100644 --- a/webapp/src/app/shared/ui/app-institution-tooltip/app-institution-tooltip.component.html +++ b/webapp/src/app/shared/ui/app-institution-tooltip/app-institution-tooltip.component.html @@ -1,5 +1,5 @@ @let institution = this._institution(); -@if (institution) { +@if (institution && hasValidId()) { } diff --git a/webapp/src/app/shared/ui/app-institution-tooltip/app-institution-tooltip.component.ts b/webapp/src/app/shared/ui/app-institution-tooltip/app-institution-tooltip.component.ts index 0f4e5deb..5e535fe6 100644 --- a/webapp/src/app/shared/ui/app-institution-tooltip/app-institution-tooltip.component.ts +++ b/webapp/src/app/shared/ui/app-institution-tooltip/app-institution-tooltip.component.ts @@ -1,4 +1,11 @@ -import { Component, effect, inject, input, signal } from '@angular/core'; +import { + Component, + computed, + effect, + inject, + input, + signal, +} from '@angular/core'; import { Institution, InstitutionsV2Service } from '../../../api'; import { AppInstitutionCardComponent } from '../app-institution-card/app-institution-card.component'; @@ -15,9 +22,16 @@ export class AppInstitutionTooltipComponent { institution = input(undefined); _institution = signal(undefined); - _isLoading = signal(false); + hasValidId = computed(() => { + const inst = this._institution(); + const id = this.institutionId() ?? inst?.id; + return Boolean( + id && id.trim().length > 0 && id !== 'undefined' && id !== 'null', + ); + }); + constructor() { effect(() => { const institutionObj = this.institution(); diff --git a/webapp/src/app/shared/ui/app-publication-tooltip/app-publication-tooltip.component.ts b/webapp/src/app/shared/ui/app-publication-tooltip/app-publication-tooltip.component.ts index 43cbd28b..17eef37a 100644 --- a/webapp/src/app/shared/ui/app-publication-tooltip/app-publication-tooltip.component.ts +++ b/webapp/src/app/shared/ui/app-publication-tooltip/app-publication-tooltip.component.ts @@ -11,23 +11,40 @@ import { AppPublicationCardComponent } from '../app-publication-card/app-publica export class AppPublicationTooltipComponent { private readonly worksService = inject(WorksV2Service); - workId = input.required(); + workId = input(undefined); + work = input(undefined); _work = signal(undefined); - _isLoading = signal(false); constructor() { effect(() => { - const workId = this.workId(); - if (!workId) { - this._work.set(undefined); - } - this._isLoading.set(true); - this.worksService.getWorkById(workId).subscribe((work) => { - this._work.set(work); + const workObj = this.work(); + const workId = this.workId() ?? workObj?.id; + + if (workObj) { + this._work.set(workObj); this._isLoading.set(false); - }); + } + + if (workId) { + this._isLoading.set(true); + this.worksService.getWorkById(workId).subscribe({ + next: (fetchedWork) => { + this._work.set({ + ...workObj, + ...fetchedWork, + }); + this._isLoading.set(false); + }, + error: () => { + this._isLoading.set(false); + }, + }); + } else if (!workObj) { + this._work.set(undefined); + this._isLoading.set(false); + } }); } } -- 2.56.1 From b2f55bd05ab51aa120a7ca63d31cc52fd8c6dca7 Mon Sep 17 00:00:00 2001 From: Kazgatari <56477241+Kazgatari@users.noreply.github.com> Date: Tue, 18 Aug 2026 19:55:48 +0200 Subject: [PATCH 3/7] changed institutions to hold associated institution array --- .../src/main/inse/institutions/v2/router.py | 5 ++ .../main/inse/models/openalex/institution.py | 5 +- webapp/src/app/api/model/institution.ts | 48 +++++++++---------- 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/service/src/main/inse/institutions/v2/router.py b/service/src/main/inse/institutions/v2/router.py index 6cd9ad36..26928f27 100644 --- a/service/src/main/inse/institutions/v2/router.py +++ b/service/src/main/inse/institutions/v2/router.py @@ -29,12 +29,17 @@ async def get_institution_by_id( raw_oa_institution_id=institution_id, source=[ "id", + "ror", "display_name", + "country_code", + "type", + "homepage_url", "display_name_alternatives", "works_count", "cited_by_count", "geo", "summary_stats", + "associated_institutions", ], ) diff --git a/service/src/main/inse/models/openalex/institution.py b/service/src/main/inse/models/openalex/institution.py index 089013ba..1be99706 100644 --- a/service/src/main/inse/models/openalex/institution.py +++ b/service/src/main/inse/models/openalex/institution.py @@ -25,6 +25,7 @@ from pydantic_core import to_jsonable_python from inse.models.openalex.author_counts_by_year_inner import AuthorCountsByYearInner from inse.models.openalex.author_summary_stats import AuthorSummaryStats +from inse.models.openalex.dehydrated_institution import DehydratedInstitution from inse.models.openalex.institution_geo import InstitutionGeo from inse.models.openalex.institution_ids import InstitutionIds @@ -51,9 +52,10 @@ class Institution(BaseModel): ids: InstitutionIds | None = None counts_by_year: list[AuthorCountsByYearInner] | None = Field(default=None, description="`works_count` and `cited_by_count` for each of the last ten years.") works_api_url: StrictStr | None = Field(default=None, description="A URL that will get you a list of all works affiliated with this institution.") + associated_institutions: list[DehydratedInstitution] | None = Field(default=None, description="Associated institutions list.") created_date: date | None = Field(default=None, description="When this institution was added to OpenAlex (ISO 8601 date).") updated_date: datetime | None = Field(default=None, description="When this institution was last updated (ISO 8601 datetime).") - __properties: ClassVar[list[str]] = ["id", "ror", "display_name", "country_code", "type", "homepage_url", "image_url", "image_thumbnail_url", "display_name_acronyms", "display_name_alternatives", "works_count", "cited_by_count", "summary_stats", "geo", "lineage", "ids", "counts_by_year", "works_api_url", "created_date", "updated_date"] + __properties: ClassVar[list[str]] = ["id", "ror", "display_name", "country_code", "type", "homepage_url", "image_url", "image_thumbnail_url", "display_name_acronyms", "display_name_alternatives", "works_count", "cited_by_count", "summary_stats", "geo", "lineage", "ids", "counts_by_year", "works_api_url", "associated_institutions", "created_date", "updated_date"] @field_validator('type') def type_validate_enum(cls, value): @@ -151,6 +153,7 @@ class Institution(BaseModel): "ids": InstitutionIds.from_dict(obj["ids"]) if obj.get("ids") is not None else None, "counts_by_year": [AuthorCountsByYearInner.from_dict(_item) for _item in obj["counts_by_year"]] if obj.get("counts_by_year") is not None else None, "works_api_url": obj.get("works_api_url"), + "associated_institutions": [DehydratedInstitution.from_dict(_item) for _item in obj["associated_institutions"]] if obj.get("associated_institutions") is not None else None, "created_date": obj.get("created_date"), "updated_date": obj.get("updated_date") }) diff --git a/webapp/src/app/api/model/institution.ts b/webapp/src/app/api/model/institution.ts index 6b1a5778..a60acdaa 100644 --- a/webapp/src/app/api/model/institution.ts +++ b/webapp/src/app/api/model/institution.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,31 +11,31 @@ import { InstitutionIds } from './institutionIds'; import { AuthorCountsByYearInner } from './authorCountsByYearInner'; import { AuthorSummaryStats } from './authorSummaryStats'; import { InstitutionGeo } from './institutionGeo'; - +import { DehydratedInstitution } from './dehydratedInstitution'; /** * A university, research organization, or other affiliation */ -export interface Institution { - id?: string | null; - ror?: string | null; - display_name?: string | null; - country_code?: string | null; - type?: string | null; - homepage_url?: string | null; - image_url?: string | null; - image_thumbnail_url?: string | null; - display_name_acronyms?: Array | null; - display_name_alternatives?: Array | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - geo?: InstitutionGeo | null; - lineage?: Array | null; - ids?: InstitutionIds | null; - counts_by_year?: Array | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Institution { + id?: string | null; + ror?: string | null; + display_name?: string | null; + country_code?: string | null; + type?: string | null; + homepage_url?: string | null; + image_url?: string | null; + image_thumbnail_url?: string | null; + display_name_acronyms?: Array | null; + display_name_alternatives?: Array | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + geo?: InstitutionGeo | null; + lineage?: Array | null; + ids?: InstitutionIds | null; + counts_by_year?: Array | null; + works_api_url?: string | null; + associated_institutions?: Array | null; + created_date?: string | null; + updated_date?: string | null; } - -- 2.56.1 From 24cc476dbe826025c5f752bea9b00248413d9740 Mon Sep 17 00:00:00 2001 From: Kazgatari <56477241+Kazgatari@users.noreply.github.com> Date: Tue, 18 Aug 2026 19:56:56 +0200 Subject: [PATCH 4/7] implemented overview in institution and added guardrails for card to fetch new information if existing is incomplete --- .../institution-overview.component.html | 157 ++++++++ .../institution-overview.component.scss | 346 ++++++++++++++++++ .../institution-overview.component.ts | 190 ++++++++++ .../institution/institution.component.html | 13 +- .../institution/institution.component.scss | 10 +- .../institution/institution.component.ts | 9 +- .../app-institution-card.component.html | 88 +++-- .../app-institution-card.component.ts | 19 + .../app-institution-chip.component.ts | 19 +- .../app-institution-tooltip.component.ts | 34 +- webapp/src/app/shared/ui/icons.ts | 2 + 11 files changed, 824 insertions(+), 63 deletions(-) create mode 100644 webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.html create mode 100644 webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.scss create mode 100644 webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.ts diff --git a/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.html b/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.html new file mode 100644 index 00000000..53252cdc --- /dev/null +++ b/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.html @@ -0,0 +1,157 @@ +
+ + +
+
+
+ {{ typeInfo().icon }} +
+
+ +
+
+

{{ displayName() }}

+ + {{ typeInfo().icon }} + {{ typeInfo().label }} + +
+ +
+ @if (locationText()) { +
+ @if (countryCode()) { + + } + {{ locationText() }} +
+ } + + @if (homepageUrl()) { + + {{ LANGUAGE_ICON }} + Webseite + {{ OPEN_IN_NEW_ICON }} + + } + + @if (rorUrl()) { + + ROR + {{ OPEN_IN_NEW_ICON }} + + } +
+
+
+ + +
+ @if (worksCount() !== null && worksCount() !== undefined) { +
+
+ {{ PUBLICATION_ICON }} +
+
+ {{ + worksCount() | number: undefined : 'de' + }} + Publikationen +
+
+ } + + @if (citedByCount() !== null && citedByCount() !== undefined) { +
+
+ {{ CITATION_ICON }} +
+
+ {{ + citedByCount() | number: undefined : 'de' + }} + Zitationen +
+
+ } + + @if (hIndex() !== null && hIndex() !== undefined) { +
+
+ {{ TRENDING_UP_ICON }} +
+
+ {{ hIndex() }} + h-Index +
+
+ } +
+ + + @if (alternatives().length > 0) { + +
+

Alternative Bezeichnungen

+
+ @for (alt of visibleAlternatives(); track alt) { + {{ alt }} + } + @if (hasMoreAlternatives()) { + + } +
+
+ } + + + @if (associatedInstitutions().length > 0) { + +
+

+ Assoziierte Institutionen + ({{ associatedInstitutions().length }}) +

+
+ @for ( + assoc of associatedInstitutions(); + track assoc.id ?? assoc.display_name + ) { +
+ +
+ } +
+
+ } +
+
diff --git a/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.scss b/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.scss new file mode 100644 index 00000000..746957bd --- /dev/null +++ b/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.scss @@ -0,0 +1,346 @@ +.institution-overview { + width: 100%; + margin-bottom: 1.5rem; +} + +.institution-overview-card { + padding: 1.5rem; + background: var(--sg-surface); + border: 1px solid var(--sg-border); + border-radius: 12px; + display: flex; + flex-direction: column; + gap: 1.25rem; + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04); +} + +/* --- Header & Avatar --- */ +.overview-header { + display: flex; + align-items: flex-start; + gap: 1.25rem; + + @media (max-width: 768px) { + flex-direction: column; + align-items: center; + text-align: center; + } +} + +.avatar-col { + flex-shrink: 0; +} + +.institution-avatar { + width: 64px; + height: 64px; + border-radius: 14px; + display: flex; + align-items: center; + justify-content: center; + background: var(--sg-surface-container-high, rgba(0, 0, 0, 0.04)); + border: 1px solid var(--sg-border); + color: var(--sg-primary); + + mat-icon { + font-size: 34px; + width: 34px; + height: 34px; + } + + &.type-education { + background: rgba(33, 150, 243, 0.1); + color: #1976d2; + border-color: rgba(33, 150, 243, 0.25); + } + + &.type-healthcare { + background: rgba(233, 30, 99, 0.1); + color: #c2185b; + border-color: rgba(233, 30, 99, 0.25); + } + + &.type-facility { + background: rgba(156, 39, 176, 0.1); + color: #7b1fa2; + border-color: rgba(156, 39, 176, 0.25); + } + + &.type-company { + background: rgba(255, 152, 0, 0.1); + color: #f57c00; + border-color: rgba(255, 152, 0, 0.25); + } + + &.type-government { + background: rgba(0, 150, 136, 0.1); + color: #00796b; + border-color: rgba(0, 150, 136, 0.25); + } +} + +.identity-col { + flex: 1; + display: flex; + flex-direction: column; + gap: 0.5rem; + min-width: 0; +} + +.title-row { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 0.75rem; + + @media (max-width: 768px) { + justify-content: center; + } +} + +.institution-name { + font-size: 1.6rem; + font-weight: 700; + color: var(--sg-text-primary); + margin: 0; + line-height: 1.25; +} + +.type-badge { + display: inline-flex; + align-items: center; + gap: 0.35rem; + font-size: 0.75rem; + font-weight: 600; + padding: 0.25rem 0.65rem; + border-radius: 9999px; + background: var(--sg-surface-container-high, rgba(0, 0, 0, 0.05)); + color: var(--sg-text-secondary); + border: 1px solid var(--sg-border); + + .badge-icon { + font-size: 14px; + width: 14px; + height: 14px; + } + + &.type-education { + background: rgba(33, 150, 243, 0.1); + color: #1565c0; + border-color: rgba(33, 150, 243, 0.3); + } + + &.type-healthcare { + background: rgba(233, 30, 99, 0.1); + color: #ad1457; + border-color: rgba(233, 30, 99, 0.3); + } + + &.type-facility { + background: rgba(156, 39, 176, 0.1); + color: #6a1b9a; + border-color: rgba(156, 39, 176, 0.3); + } + + &.type-company { + background: rgba(255, 152, 0, 0.1); + color: #e65100; + border-color: rgba(255, 152, 0, 0.3); + } + + &.type-government { + background: rgba(0, 150, 136, 0.1); + color: #004d40; + border-color: rgba(0, 150, 136, 0.3); + } +} + +.meta-row { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 1rem; + font-size: 0.875rem; + color: var(--sg-text-secondary); + + @media (max-width: 768px) { + justify-content: center; + } +} + +.meta-item { + display: inline-flex; + align-items: center; + gap: 0.4rem; +} + +.meta-link { + display: inline-flex; + align-items: center; + gap: 0.35rem; + color: var(--sg-primary); + text-decoration: none; + font-weight: 500; + transition: opacity 0.2s; + + mat-icon { + font-size: 16px; + width: 16px; + height: 16px; + } + + .external-icon { + font-size: 13px; + width: 13px; + height: 13px; + opacity: 0.7; + } + + &:hover { + text-decoration: underline; + opacity: 0.85; + } +} + +.ror-tag { + background: var(--sg-primary); + color: #ffffff; + font-size: 0.65rem; + font-weight: 700; + padding: 1px 4px; + border-radius: 4px; + letter-spacing: 0.5px; +} + +/* --- Metrics Grid --- */ +.metrics-row { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); + gap: 0.85rem; + width: 100%; +} + +.stat-card { + display: flex; + align-items: center; + gap: 0.85rem; + padding: 0.85rem 1rem; + background: var(--sg-surface-container-low, rgba(0, 0, 0, 0.02)); + border: 1px solid var(--sg-border); + border-radius: 10px; +} + +.stat-icon-wrapper { + width: 40px; + height: 40px; + border-radius: 10px; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + + mat-icon { + font-size: 20px; + width: 20px; + height: 20px; + } + + &.pub-icon { + background: rgba(33, 150, 243, 0.12); + color: #1976d2; + } + + &.cite-icon { + background: rgba(156, 39, 176, 0.12); + color: #7b1fa2; + } + + &.hindex-icon { + background: rgba(76, 175, 80, 0.12); + color: #2e7d32; + } +} + +.stat-content { + display: flex; + flex-direction: column; +} + +.stat-value { + font-size: 1.15rem; + font-weight: 700; + color: var(--sg-text-primary); + line-height: 1.2; +} + +.stat-label { + font-size: 0.75rem; + color: var(--sg-text-secondary); +} + +/* --- Section Lists --- */ +.details-section { + display: flex; + flex-direction: column; + gap: 0.65rem; +} + +.section-title { + display: inline-flex; + align-items: center; + gap: 0.45rem; + font-size: 0.85rem; + font-weight: 600; + color: var(--sg-text-secondary); + text-transform: uppercase; + letter-spacing: 0.5px; + margin: 0; + + mat-icon { + font-size: 16px; + width: 16px; + height: 16px; + color: var(--sg-primary); + } + + .section-count { + font-weight: normal; + opacity: 0.8; + } +} + +.alternatives-list { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + align-items: center; +} + +.alternative-chip { + font-size: 0.8rem; + padding: 0.3rem 0.7rem; + background: var(--sg-surface-container-high, rgba(0, 0, 0, 0.04)); + border: 1px solid var(--sg-border); + border-radius: 6px; + color: var(--sg-text-primary); +} + +.expand-btn { + font-size: 0.75rem; + height: 28px; + line-height: 28px; + padding: 0 0.5rem; + color: var(--sg-primary); +} + +.associated-chips-container { + display: flex; + flex-wrap: wrap; + gap: 0.65rem; + align-items: center; +} + +.associated-chip-wrapper { + display: inline-flex; + align-items: center; +} diff --git a/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.ts b/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.ts new file mode 100644 index 00000000..f30fb631 --- /dev/null +++ b/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.ts @@ -0,0 +1,190 @@ +import { Component, computed, inject, input, signal } from '@angular/core'; +import { Router, RouterModule } from '@angular/router'; +import { DecimalPipe } from '@angular/common'; +import { MatCardModule } from '@angular/material/card'; +import { MatIconModule } from '@angular/material/icon'; +import { MatButtonModule } from '@angular/material/button'; +import { MatChipsModule } from '@angular/material/chips'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { DehydratedInstitution, Institution } from '../../../../api'; +import { CountryFlagComponent } from '../../../../shared/ui/country-flag/country-flag.component'; +import { AppInstitutionChipComponent } from '../../../../shared/ui/app-institution-chip/app-institution-chip.component'; +import { + APARTMENT_ICON, + BUSINESS_ICON, + CITATION_ICON, + FUNDING_ICON, + INSTITUTION_ICON, + LANGUAGE_ICON, + LIBRARY_BOOKS_ICON, + LOCAL_HOSPITAL_ICON, + OPEN_IN_NEW_ICON, + PAID_ICON, + PUBLICATION_ICON, + SCHOOL_ICON, + SCIENCE_ICON, + TRENDING_UP_ICON, + VOLUNTEER_ACTIVISM_ICON, +} from '../../../../shared/ui/icons'; + +interface InstitutionTypeInfo { + label: string; + icon: string; + badgeClass: string; +} + +const INSTITUTION_TYPE_MAP: Record = { + education: { + label: 'Bildung / Hochschule', + icon: SCHOOL_ICON, + badgeClass: 'type-education', + }, + healthcare: { + label: 'Klinik / Gesundheit', + icon: LOCAL_HOSPITAL_ICON, + badgeClass: 'type-healthcare', + }, + company: { + label: 'Unternehmen', + icon: BUSINESS_ICON, + badgeClass: 'type-company', + }, + facility: { + label: 'Forschungseinrichtung', + icon: SCIENCE_ICON, + badgeClass: 'type-facility', + }, + government: { + label: 'Staatliche Einrichtung', + icon: FUNDING_ICON, + badgeClass: 'type-government', + }, + nonprofit: { + label: 'Gemeinnützige Organisation', + icon: VOLUNTEER_ACTIVISM_ICON, + badgeClass: 'type-nonprofit', + }, + archive: { + label: 'Archiv / Bibliothek', + icon: LIBRARY_BOOKS_ICON, + badgeClass: 'type-archive', + }, + funder: { + label: 'Förderorganisation', + icon: PAID_ICON, + badgeClass: 'type-funder', + }, + other: { + label: 'Sonstige Institution', + icon: INSTITUTION_ICON, + badgeClass: 'type-other', + }, +}; + +@Component({ + selector: 'app-institution-overview', + imports: [ + RouterModule, + DecimalPipe, + MatCardModule, + MatIconModule, + MatButtonModule, + MatChipsModule, + MatDividerModule, + MatTooltipModule, + CountryFlagComponent, + AppInstitutionChipComponent, + ], + templateUrl: './institution-overview.component.html', + styleUrl: './institution-overview.component.scss', +}) +export class InstitutionOverviewComponent { + private readonly router = inject(Router); + + readonly PUBLICATION_ICON = PUBLICATION_ICON; + readonly CITATION_ICON = CITATION_ICON; + readonly TRENDING_UP_ICON = TRENDING_UP_ICON; + readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON; + readonly LANGUAGE_ICON = LANGUAGE_ICON; + + institution = input.required(); + + showAllAlternatives = signal(false); + + displayName = computed(() => { + const inst = this.institution(); + return ( + inst.display_name?.trim() || + inst.display_name_alternatives?.[0]?.trim() || + 'Unbekannte Institution' + ); + }); + + typeInfo = computed(() => { + const typeKey = this.institution().type?.toLowerCase() ?? 'other'; + return ( + INSTITUTION_TYPE_MAP[typeKey] ?? { + label: 'Institution', + icon: APARTMENT_ICON, + badgeClass: 'type-other', + } + ); + }); + + locationText = computed(() => { + const geo = this.institution().geo; + if (!geo) return null; + const parts = [geo.city, geo.country].filter(Boolean); + return parts.length > 0 ? parts.join(', ') : null; + }); + + countryCode = computed(() => { + return ( + this.institution().geo?.country_code ?? + this.institution().country_code ?? + null + ); + }); + + alternatives = computed(() => { + return this.institution().display_name_alternatives ?? []; + }); + + visibleAlternatives = computed(() => { + const alts = this.alternatives(); + if (this.showAllAlternatives()) return alts; + return alts.slice(0, 4); + }); + + hasMoreAlternatives = computed(() => { + return this.alternatives().length > 4; + }); + + worksCount = computed(() => this.institution().works_count); + citedByCount = computed(() => this.institution().cited_by_count); + hIndex = computed(() => this.institution().summary_stats?.h_index); + + associatedInstitutions = computed(() => { + return this.institution().associated_institutions ?? []; + }); + + homepageUrl = computed(() => this.institution().homepage_url); + rorUrl = computed(() => this.institution().ror); + + toggleAlternatives(): void { + this.showAllAlternatives.update((v) => !v); + } + + navigateToInstitution(assoc: DehydratedInstitution): void { + const cleanId = this.stripOpenAlexId(assoc.id); + if (cleanId) { + this.router.navigate(['/institution', cleanId]); + } + } + + stripOpenAlexId(id: string | null | undefined): string | undefined { + if (!id) return undefined; + return id.replace('https://openalex.org/', ''); + } +} diff --git a/webapp/src/app/modules/institution/institution.component.html b/webapp/src/app/modules/institution/institution.component.html index 4b53e760..f258e8f5 100644 --- a/webapp/src/app/modules/institution/institution.component.html +++ b/webapp/src/app/modules/institution/institution.component.html @@ -1,14 +1,5 @@ -
-
-

{{ institution().display_name }}

- - -

{{ institution().homepage_url }}

-

{{ institution().display_name_alternatives }}

-

And many more useful details...

-
-
-
+
+
diff --git a/webapp/src/app/modules/institution/institution.component.scss b/webapp/src/app/modules/institution/institution.component.scss index 0aae5047..4d1beda5 100644 --- a/webapp/src/app/modules/institution/institution.component.scss +++ b/webapp/src/app/modules/institution/institution.component.scss @@ -1,12 +1,6 @@ -.container { +.institution-container { display: flex; flex-direction: column; gap: 1rem; -} - -.content { - display: flex; - flex-direction: column; - gap: 1rem; - margin: 0 1rem; + margin: 1rem; } diff --git a/webapp/src/app/modules/institution/institution.component.ts b/webapp/src/app/modules/institution/institution.component.ts index 0edce91b..6891599f 100644 --- a/webapp/src/app/modules/institution/institution.component.ts +++ b/webapp/src/app/modules/institution/institution.component.ts @@ -1,8 +1,8 @@ import { Component, computed, input } from '@angular/core'; import { RouterModule } from '@angular/router'; import { Institution } from '../../api'; -import { MatCardModule } from '@angular/material/card'; import { MatTabsModule } from '@angular/material/tabs'; +import { InstitutionOverviewComponent } from './components/institution-overview/institution-overview.component'; import { LinkTabNavBarComponent, LinkTabNavBarItem, @@ -15,7 +15,12 @@ import { @Component({ selector: 'app-institution', - imports: [MatCardModule, MatTabsModule, RouterModule, LinkTabNavBarComponent], + imports: [ + InstitutionOverviewComponent, + LinkTabNavBarComponent, + MatTabsModule, + RouterModule, + ], templateUrl: './institution.component.html', styleUrl: './institution.component.scss', }) diff --git a/webapp/src/app/shared/ui/app-institution-card/app-institution-card.component.html b/webapp/src/app/shared/ui/app-institution-card/app-institution-card.component.html index 8b303d3c..fdd4c0d2 100644 --- a/webapp/src/app/shared/ui/app-institution-card/app-institution-card.component.html +++ b/webapp/src/app/shared/ui/app-institution-card/app-institution-card.component.html @@ -8,46 +8,76 @@ "> {{ displayName() }} - - {{ institution().geo?.city }}, - {{ institution().geo?.country }} - @if (institution().geo?.country_code) { - - } - + @if (locationText()) { + + {{ locationText() }} + @if (countryCode()) { + + } + + } -
- {{ PUBLICATION_ICON }} - {{ - institution().works_count | number: undefined : 'de' - }} - Publikationen -
-
- {{ CITATION_ICON }} - {{ - institution().cited_by_count | number: undefined : 'de' - }} - Zitationen -
+ @if ( + institution().works_count !== null && + institution().works_count !== undefined + ) { +
+ {{ PUBLICATION_ICON }} + {{ + institution().works_count | number: undefined : 'de' + }} + Publikationen +
+ } + @if ( + institution().cited_by_count !== null && + institution().cited_by_count !== undefined + ) { +
+ {{ CITATION_ICON }} + {{ + institution().cited_by_count | number: undefined : 'de' + }} + Zitationen +
+ } + @if ( + institution().summary_stats?.h_index !== null && + institution().summary_stats?.h_index !== undefined + ) { +
+ {{ TRENDING_UP_ICON }} + h-Index: {{ institution().summary_stats?.h_index }} +
+ }
+ @if (institution().id) { + + {{ INFO_ICON }} + Übersicht + + } @for ( - assoc of associatedInstitutions(); + assoc of visibleAssociatedInstitutions(); track assoc.id ?? assoc.display_name ) {
@@ -150,6 +150,15 @@ (handleChipClick)="navigateToInstitution(assoc)" />
} + @if (hasMoreAssociated()) { + + }
} diff --git a/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.ts b/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.ts index f30fb631..93dfdcc4 100644 --- a/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.ts +++ b/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.ts @@ -169,6 +169,18 @@ export class InstitutionOverviewComponent { return this.institution().associated_institutions ?? []; }); + showAllAssociated = signal(false); + + visibleAssociatedInstitutions = computed(() => { + const list = this.associatedInstitutions(); + if (this.showAllAssociated()) return list; + return list.slice(0, 10); + }); + + hasMoreAssociated = computed(() => { + return this.associatedInstitutions().length > 10; + }); + homepageUrl = computed(() => this.institution().homepage_url); rorUrl = computed(() => this.institution().ror); @@ -176,6 +188,10 @@ export class InstitutionOverviewComponent { this.showAllAlternatives.update((v) => !v); } + toggleAssociated(): void { + this.showAllAssociated.update((v) => !v); + } + navigateToInstitution(assoc: DehydratedInstitution): void { const cleanId = this.stripOpenAlexId(assoc.id); if (cleanId) { -- 2.56.1 From ffc02a4e597290f3d503d0d0f363f615e33acb2d Mon Sep 17 00:00:00 2001 From: Kazgatari <56477241+Kazgatari@users.noreply.github.com> Date: Tue, 18 Aug 2026 20:06:55 +0200 Subject: [PATCH 6/7] fix: used set to deduplicate entries --- .../institution-overview.component.html | 2 +- .../institution-overview.component.ts | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.html b/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.html index e51ceebd..ec015966 100644 --- a/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.html +++ b/webapp/src/app/modules/institution/components/institution-overview/institution-overview.component.html @@ -139,7 +139,7 @@
@for ( assoc of visibleAssociatedInstitutions(); - track assoc.id ?? assoc.display_name + track assoc.id ?? assoc.display_name ?? $index ) {
this.institution().summary_stats?.h_index); associatedInstitutions = computed(() => { - return this.institution().associated_institutions ?? []; + const list = this.institution().associated_institutions ?? []; + const seen = new Set(); + const unique: DehydratedInstitution[] = []; + for (const item of list) { + const key = item.id || item.display_name || JSON.stringify(item); + if (!seen.has(key)) { + seen.add(key); + unique.push(item); + } + } + return unique; }); showAllAssociated = signal(false); -- 2.56.1 From c85d3fa03fa05c2af81e948ace894ef3e99dc532 Mon Sep 17 00:00:00 2001 From: Kazgatari <56477241+Kazgatari@users.noreply.github.com> Date: Tue, 18 Aug 2026 20:07:57 +0200 Subject: [PATCH 7/7] fix: bound routing link to signal to remove console error --- .../ui/link-tab-nav-bar/link-tab-nav-bar.component.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/webapp/src/app/shared/ui/link-tab-nav-bar/link-tab-nav-bar.component.html b/webapp/src/app/shared/ui/link-tab-nav-bar/link-tab-nav-bar.component.html index 88075208..2c64d961 100644 --- a/webapp/src/app/shared/ui/link-tab-nav-bar/link-tab-nav-bar.component.html +++ b/webapp/src/app/shared/ui/link-tab-nav-bar/link-tab-nav-bar.component.html @@ -5,9 +5,7 @@ [routerLink]="link.path" [queryParams]="link.queryParams" [queryParamsHandling]="link.queryParamsHandling" - routerLinkActive - #rla="routerLinkActive" - [active]="rla.isActive" + [active]="activeLink() === link" [disabled]="link.disabled">