From 6c20dc2b583d68a7ea86d6bd71c550bbc34ff4c9 Mon Sep 17 00:00:00 2001 From: Kazgatari <56477241+Kazgatari@users.noreply.github.com> Date: Tue, 18 Aug 2026 20:02:12 +0200 Subject: [PATCH] added expandible toggle to associated institutions --- .../institution-overview.component.html | 11 ++++++++++- .../institution-overview.component.ts | 16 ++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) 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 53252cdc..e51ceebd 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 @@ -138,7 +138,7 @@
@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) {