From 40bb0feaf81fbea0f7208d28abfd8ca9d4efa809 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Mon, 3 Aug 2026 21:38:49 +0200 Subject: [PATCH] Revert "use country-flag component in EU-Cordis organizations table" This reverts commit 876fbb99806dff853caa6a333094ea0a87ab99e6. --- .../organizations-table.component.html | 12 ++++++++---- .../organizations-table.component.ts | 16 ++++++++++++++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table.component.html b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table.component.html index 45101292..5cbd973b 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table.component.html +++ b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table.component.html @@ -33,11 +33,15 @@ {{ org.city }} @if (org.country) { - + [src]=" + 'https://flagcdn.io/' + + getSvgByCountryCode(org.country) + + '.svg' + " + height="10" /> } } @else { diff --git a/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table.component.ts b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table.component.ts index bf190a58..ea6adba6 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table.component.ts +++ b/webapp/src/app/modules/projects/eu-cordis-details/organizations-table/organizations-table.component.ts @@ -19,7 +19,6 @@ import { DataTableComponent, GenericColumn, } from '../../../../shared/ui/data-table/data-table.component'; -import { CountryFlagComponent } from '../../../../shared/ui/country-flag/country-flag.component'; @Component({ selector: 'app-organizations-table', @@ -30,7 +29,6 @@ import { CountryFlagComponent } from '../../../../shared/ui/country-flag/country CurrencyPipe, DataTableComponent, MatPaginatorModule, - CountryFlagComponent, ], templateUrl: './organizations-table.component.html', styleUrl: './organizations-table.component.scss', @@ -130,6 +128,20 @@ export class OrganizationsTableComponent { this.pageSize.set(event.pageSize); } + getSvgByCountryCode(code: string | undefined | null): string { + if (!code) { + return ''; + } + + const codeLower = code.toLowerCase(); + + if (codeLower === 'uk') { + return 'gb'; + } + + return codeLower; + } + getOrgsCount(): number { return this.orgs?.length || 0; }