From 652bf18e0e4c8b5b817191430e2005cdf5ccd39f Mon Sep 17 00:00:00 2001 From: fnecas Date: Wed, 3 Jan 2024 16:09:50 +0100 Subject: [PATCH] fix: readd test and update i18n --- .../src/app/home/news-page/news-page.component.html | 6 ++++-- .../app/home/news-page/news-page.component.spec.ts | 11 +++++++++++ conf/default.toml | 2 +- .../downloads-list/downloads-list.component.spec.ts | 3 +++ translations/de.json | 3 +-- translations/en.json | 3 +-- translations/es.json | 3 +-- translations/fr.json | 3 +-- translations/it.json | 3 +++ translations/nl.json | 3 +-- translations/pt.json | 3 +-- translations/sk.json | 3 +-- 12 files changed, 29 insertions(+), 17 deletions(-) diff --git a/apps/datahub/src/app/home/news-page/news-page.component.html b/apps/datahub/src/app/home/news-page/news-page.component.html index 1a59f51821..9913a7e43a 100644 --- a/apps/datahub/src/app/home/news-page/news-page.component.html +++ b/apps/datahub/src/app/home/news-page/news-page.component.html @@ -30,8 +30,10 @@ > datahub.news.contact.title -

datahub.news.contact.desc1

-

datahub.news.contact.desc2

+
({ getGlobalConfig: jest.fn(() => ({ @@ -15,6 +17,15 @@ describe('NewsPageComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [NewsPageComponent], + imports: [ + TranslateTestingModule.withTranslations({ + en: { + 'datahub.news.contact.html': '

line1

line2

', + }, + }) + .withDefaultLanguage('en') + .withCompiler(new TranslateMessageFormatCompiler()), + ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents() diff --git a/conf/default.toml b/conf/default.toml index aa178800b4..4472490088 100644 --- a/conf/default.toml +++ b/conf/default.toml @@ -34,7 +34,7 @@ proxy_path = "" # More information about the translation can be found in the docs (https://geonetwork.github.io/geonetwork-ui/main/docs/reference/i18n.html) # languages = ['en', 'fr', 'de'] -# Allows displaying a contact email on news page for missing data +# Enables displaying a "contact block" wherever relevant in applications # contact_email = "opendata@mycompany.com" ### VISUAL THEME diff --git a/libs/ui/elements/src/lib/downloads-list/downloads-list.component.spec.ts b/libs/ui/elements/src/lib/downloads-list/downloads-list.component.spec.ts index 22f36d431b..1abb05ee73 100644 --- a/libs/ui/elements/src/lib/downloads-list/downloads-list.component.spec.ts +++ b/libs/ui/elements/src/lib/downloads-list/downloads-list.component.spec.ts @@ -132,6 +132,9 @@ describe('DownloadsListComponent', () => { LINK_FIXTURES.geodataShpWithMimeType ) expect(items[0].componentInstance.format).toEqual('shp') + expect(items[0].componentInstance.color).toEqual( + expect.stringMatching(/#[0-9a-b]{2,6}/i) + ) expect(items[0].componentInstance.isFromWfs).toEqual(false) }) }) diff --git a/translations/de.json b/translations/de.json index 30c5bf1a79..20e6e1a395 100644 --- a/translations/de.json +++ b/translations/de.json @@ -111,8 +111,7 @@ "datahub.header.popularRecords": "Die beliebtesten", "datahub.header.title.html": "
Entdecken Sie offene
Daten von meiner Organisation
", "datahub.news.contact.contactus": "", - "datahub.news.contact.desc1": "", - "datahub.news.contact.desc2": "", + "datahub.news.contact.html": "", "datahub.news.contact.title": "", "datahub.news.feed": "Nachrichtenfeed", "datahub.news.figures": "Indikatoren", diff --git a/translations/en.json b/translations/en.json index f1c616da31..de0d52101d 100644 --- a/translations/en.json +++ b/translations/en.json @@ -111,8 +111,7 @@ "datahub.header.popularRecords": "The most popular", "datahub.header.title.html": "
Discover open
data from my Organization
", "datahub.news.contact.contactus": "Contact us", - "datahub.news.contact.desc1": "Do you need data that is not currently present on the platform? ", - "datahub.news.contact.desc2": "Our teams are here to answer you.", + "datahub.news.contact.html": "

Do you need data that is not currently present on the platform?

Our teams are here to answer you.

", "datahub.news.contact.title": "A specific need?", "datahub.news.feed": "News feed", "datahub.news.figures": "Indicators", diff --git a/translations/es.json b/translations/es.json index 7a44132310..f645ff47e9 100644 --- a/translations/es.json +++ b/translations/es.json @@ -111,8 +111,7 @@ "datahub.header.popularRecords": "", "datahub.header.title.html": "", "datahub.news.contact.contactus": "", - "datahub.news.contact.desc1": "", - "datahub.news.contact.desc2": "", + "datahub.news.contact.html": "", "datahub.news.contact.title": "", "datahub.news.feed": "", "datahub.news.figures": "", diff --git a/translations/fr.json b/translations/fr.json index 88063929a7..b4dd3237c9 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -111,8 +111,7 @@ "datahub.header.popularRecords": "Les plus appréciées", "datahub.header.title.html": "
Toutes les données
publiques de mon organisation
", "datahub.news.contact.contactus": "Contactez-nous", - "datahub.news.contact.desc1": "Vous avez besoin de données qui ne sont pas présentes sur la plateforme actuellement ?", - "datahub.news.contact.desc2": "Nos équipes sont la pour vous répondre.", + "datahub.news.contact.html": "

Vous avez besoin de données qui ne sont pas présentes sur la plateforme actuellement ?

Nos équipes sont la pour vous répondre.

", "datahub.news.contact.title": "Un besoin spécifique ?", "datahub.news.feed": "Fil d'activité", "datahub.news.figures": "Quelques chiffres", diff --git a/translations/it.json b/translations/it.json index 0492a59f8c..c9610e5c69 100644 --- a/translations/it.json +++ b/translations/it.json @@ -151,6 +151,9 @@ "facets.block.title.tag.default": "Tag", "facets.block.title.th_regions_tree.default": "Regioni", "favorite.not.authenticated.tooltip": "
Login per accedere a questa funzionalità
", + "datahub.news.contact.contactus": "", + "datahub.news.contact.html": "", + "datahub.news.contact.title": "", "language.ca": "Català", "language.cs": "Čeština", "language.de": "Deutsch", diff --git a/translations/nl.json b/translations/nl.json index ee81c4b9ce..a7a0178cd9 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -111,8 +111,7 @@ "datahub.header.popularRecords": "", "datahub.header.title.html": "", "datahub.news.contact.contactus": "", - "datahub.news.contact.desc1": "", - "datahub.news.contact.desc2": "", + "datahub.news.contact.html": "", "datahub.news.contact.title": "", "datahub.news.feed": "", "datahub.news.figures": "", diff --git a/translations/pt.json b/translations/pt.json index 24220f0954..63b3833b70 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -111,8 +111,7 @@ "datahub.header.popularRecords": "", "datahub.header.title.html": "", "datahub.news.contact.contactus": "", - "datahub.news.contact.desc1": "", - "datahub.news.contact.desc2": "", + "datahub.news.contact.html": "", "datahub.news.contact.title": "", "datahub.news.feed": "", "datahub.news.figures": "", diff --git a/translations/sk.json b/translations/sk.json index 46e64d0188..40e0c45af2 100644 --- a/translations/sk.json +++ b/translations/sk.json @@ -111,8 +111,7 @@ "datahub.header.popularRecords": "Najpopulárnejšie", "datahub.header.title.html": "
Objavte otvorené
dáta z mojej organizácie
", "datahub.news.contact.contactus": "", - "datahub.news.contact.desc1": "", - "datahub.news.contact.desc2": "", + "datahub.news.contact.html": "", "datahub.news.contact.title": "", "datahub.news.feed": "Spravodajský kanál", "datahub.news.figures": "Ukazovatele",