diff --git a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts index 26d431145b..3fcb5d5295 100644 --- a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts +++ b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts @@ -73,6 +73,15 @@ describe('dataset pages', () => { .children('header') .find('gn-ui-navigation-button') }) + it('should display the data type, last update and status', () => { + cy.visit('/dataset/01491630-78ce-49f3-b479-4b30dabc4c69') + cy.get('datahub-header-record') + .children('header') + .find('.font-title') + .next() + .as('infoBar') + cy.get('@infoBar').children('div').should('have.length', 3) + }) it('should return to the dataset list', () => { cy.get('datahub-header-record') .children('header') @@ -81,22 +90,6 @@ describe('dataset pages', () => { cy.url().should('include', '/search') }) }) - describe('navigation bar', () => { - it('should display the navigation bar with 4 sections', () => { - cy.get('datahub-navigation-bar') - .find('button') - .filter(':visible') - .should('have.length', 4) - }) - it('should scroll down/up to the clicked section', () => { - cy.get('datahub-navigation-bar') - .find('button') - .filter(':visible') - .as('navBtns') - cy.get('@navBtns').eq(3).click() - cy.get('datahub-record-otherlinks').should('be.visible') - }) - }) }) describe('ABOUT SECTION : display & functions', () => { diff --git a/apps/datahub/src/app/record/header-record/header-record.component.html b/apps/datahub/src/app/record/header-record/header-record.component.html index f20951d6de..7cf866be08 100644 --- a/apps/datahub/src/app/record/header-record/header-record.component.html +++ b/apps/datahub/src/app/record/header-record/header-record.component.html @@ -1,36 +1,62 @@ -
+
- +
+
+ + +
+
+ + +
+
{{ metadata.title }}
- -
- +
- + + my_location + +

record.metadata.type

+
+
+

record.metadata.lastUpdate

+

+ {{ lastUpdate }} +

+
+
+

+

+
- -
- -
diff --git a/apps/datahub/src/app/record/header-record/header-record.component.spec.ts b/apps/datahub/src/app/record/header-record/header-record.component.spec.ts index 6428cfa72e..69c0334ddb 100644 --- a/apps/datahub/src/app/record/header-record/header-record.component.spec.ts +++ b/apps/datahub/src/app/record/header-record/header-record.component.spec.ts @@ -1,7 +1,10 @@ import { NO_ERRORS_SCHEMA } from '@angular/core' import { ComponentFixture, TestBed } from '@angular/core/testing' +import { DATASET_RECORDS } from '@geonetwork-ui/common/fixtures' +import { MdViewFacade } from '@geonetwork-ui/feature/record' import { SearchService } from '@geonetwork-ui/feature/search' import { TranslateModule } from '@ngx-translate/core' +import { BehaviorSubject } from 'rxjs' import { HeaderRecordComponent } from './header-record.component' @@ -10,11 +13,22 @@ jest.mock('@geonetwork-ui/util/app-config', () => ({ HEADER_BACKGROUND: 'red', HEADER_FOREGROUND_COLOR: 'white', }), + getGlobalConfig() { + return { + LANGUAGES: ['en', 'es'], + } + }, })) const searchServiceMock = { updateFilters: jest.fn(), } + +class MdViewFacadeMock { + mapApiLinks$ = new BehaviorSubject([]) + geoDataLinks$ = new BehaviorSubject([]) +} + describe('HeaderRecordComponent', () => { let component: HeaderRecordComponent let fixture: ComponentFixture @@ -24,13 +38,22 @@ describe('HeaderRecordComponent', () => { declarations: [HeaderRecordComponent], imports: [TranslateModule.forRoot()], schemas: [NO_ERRORS_SCHEMA], - providers: [{ provide: SearchService, useValue: searchServiceMock }], + providers: [ + { provide: SearchService, useValue: searchServiceMock }, + { + provide: MdViewFacade, + useClass: MdViewFacadeMock, + }, + ], }).compileComponents() }) beforeEach(() => { fixture = TestBed.createComponent(HeaderRecordComponent) component = fixture.componentInstance + component.metadata = { + ...DATASET_RECORDS[0], + } fixture.detectChanges() }) diff --git a/apps/datahub/src/app/record/header-record/header-record.component.ts b/apps/datahub/src/app/record/header-record/header-record.component.ts index 248db72c3d..9d92672674 100644 --- a/apps/datahub/src/app/record/header-record/header-record.component.ts +++ b/apps/datahub/src/app/record/header-record/header-record.component.ts @@ -1,7 +1,10 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core' import { SearchService } from '@geonetwork-ui/feature/search' -import { getThemeConfig } from '@geonetwork-ui/util/app-config' -import { CatalogRecord } from '@geonetwork-ui/common/domain/model/record' +import { getGlobalConfig, getThemeConfig } from '@geonetwork-ui/util/app-config' +import { DatasetRecord } from '@geonetwork-ui/common/domain/model/record' +import { MdViewFacade } from '@geonetwork-ui/feature/record' +import { combineLatest, map } from 'rxjs' +import { TranslateService } from '@ngx-translate/core' @Component({ selector: 'datahub-header-record', @@ -10,13 +13,34 @@ import { CatalogRecord } from '@geonetwork-ui/common/domain/model/record' changeDetection: ChangeDetectionStrategy.OnPush, }) export class HeaderRecordComponent { - @Input() metadata: CatalogRecord + @Input() metadata: DatasetRecord backgroundCss = getThemeConfig().HEADER_BACKGROUND || `center /cover url('assets/img/header_bg.webp')` foregroundColor = getThemeConfig().HEADER_FOREGROUND_COLOR || '#ffffff' + showLanguageSwitcher = getGlobalConfig().LANGUAGES?.length > 0 - constructor(private searchService: SearchService) {} + constructor( + private searchService: SearchService, + public facade: MdViewFacade, + private translateService: TranslateService + ) {} + + isGeodata$ = combineLatest([ + this.facade.mapApiLinks$, + this.facade.geoDataLinks$, + ]).pipe( + map( + ([mapLinks, geoDataLinks]) => + mapLinks?.length > 0 || geoDataLinks?.length > 0 + ) + ) + + get lastUpdate() { + return this.metadata.recordUpdated.toLocaleDateString( + this.translateService.currentLang + ) + } back() { this.searchService.updateFilters({}) diff --git a/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.html b/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.html index 401e9b1ee2..aff63e96d6 100644 --- a/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.html +++ b/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.html @@ -1,10 +1,18 @@ -
- {{ - favoriteCount - }} +
+ {{ favoriteCount }} +
diff --git a/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.spec.ts b/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.spec.ts index c123fe48ff..6b2a429f59 100644 --- a/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.spec.ts +++ b/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.spec.ts @@ -66,6 +66,7 @@ describe('FavoriteStarComponent', () => { favoritesService = TestBed.inject(FavoritesService) fixture = TestBed.createComponent(FavoriteStarComponent) component = fixture.componentInstance + component.displayCount = 'true' fixture.detectChanges() starToggle = fixture.debugElement.query( By.directive(StarToggleComponent) diff --git a/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.ts b/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.ts index ddc2b9186a..2928e02c2e 100644 --- a/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.ts +++ b/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.ts @@ -27,6 +27,7 @@ import { PlatformServiceInterface } from '@geonetwork-ui/common/domain/platform. changeDetection: ChangeDetectionStrategy.OnPush, }) export class FavoriteStarComponent implements AfterViewInit, OnDestroy { + @Input() displayCount? = true @Input() set record(value) { this.record_ = value this.favoriteCount = diff --git a/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.html b/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.html index 70f8b1bb58..6922b307ad 100644 --- a/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.html +++ b/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.html @@ -5,5 +5,6 @@ [selected]="currentLang" ariaName="languages" [showTitle]="false" + [extraBtnClass]="'flex justify-items-center text-white !pl-2 !py-1'" > diff --git a/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.ts b/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.ts index aa631a93ec..ad781c73cf 100644 --- a/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.ts +++ b/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.ts @@ -34,7 +34,7 @@ export class LanguageSwitcherComponent implements OnInit { ngOnInit(): void { const languages = this.languagePlaceholder || DEFAULT_LANGUAGES this.languageList = languages.map((language) => ({ - label: `language.${language}`, + label: `${language}`.toUpperCase(), value: language, })) } diff --git a/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.html b/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.html index c525d967ba..97789516cf 100644 --- a/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.html +++ b/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.html @@ -1,6 +1,11 @@ diff --git a/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.spec.ts b/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.spec.ts index 03f3864f13..81d9283773 100644 --- a/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.spec.ts +++ b/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.spec.ts @@ -17,6 +17,8 @@ describe('NavigationButtonComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(NavigationButtonComponent) component = fixture.componentInstance + component.icon = 'navigate_before' + component.label = 'Retours aux résultats' fixture.detectChanges() }) diff --git a/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.css b/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.css index 37815a4641..efc5d63ed2 100644 --- a/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.css +++ b/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.css @@ -11,6 +11,7 @@ mat-icon { font-size: 1.5em; margin-top: -0.1em; font-variation-settings: 'opsz' 40; + stroke: var(--color-primary-darker); } .star-filled { diff --git a/translations/de.json b/translations/de.json index 20e6e1a395..13a5d2104b 100644 --- a/translations/de.json +++ b/translations/de.json @@ -115,6 +115,7 @@ "datahub.news.contact.title": "", "datahub.news.feed": "Nachrichtenfeed", "datahub.news.figures": "Indikatoren", + "datahub.record.addToFavorites": "", "datahub.search.back": "Zurück zu den Ergebnissen", "datahub.search.filter.all": "Alle", "datahub.search.filter.generatedByWfs": "Generiert durch API", @@ -218,6 +219,7 @@ "record.metadata.formats": "", "record.metadata.isOpenData": "Open Data", "record.metadata.keywords": "Stichworte", + "record.metadata.lastUpdate": "", "record.metadata.links": "Links", "record.metadata.noUsage": "Für diesen Datensatz sind keine Verwendungsbedingungen angegeben.", "record.metadata.origin": "Über die Daten", @@ -244,6 +246,7 @@ "record.metadata.related": "Ähnliche Datensätze", "record.metadata.sheet": "Weitere Informationen erhalten Sie unter :", "record.metadata.title": "Titel", + "record.metadata.type": "", "record.metadata.updateFrequency": "Aktualisierungsfrequenz der Daten", "record.metadata.updateStatus": "Aktualisierungsstatus der Daten", "record.metadata.updatedOn": "Letzte Aktualisierung der Dateninformationen", diff --git a/translations/en.json b/translations/en.json index de0d52101d..b18200e83a 100644 --- a/translations/en.json +++ b/translations/en.json @@ -115,7 +115,8 @@ "datahub.news.contact.title": "A specific need?", "datahub.news.feed": "News feed", "datahub.news.figures": "Indicators", - "datahub.search.back": "Back to results", + "datahub.record.addToFavorites": "Add to favorites", + "datahub.search.back": "Back", "datahub.search.filter.all": "All", "datahub.search.filter.generatedByWfs": "generated by an API", "datahub.search.filter.others": "Others", @@ -218,6 +219,7 @@ "record.metadata.formats": "Formats", "record.metadata.isOpenData": "Open Data", "record.metadata.keywords": "Keywords", + "record.metadata.lastUpdate": "Last updated on", "record.metadata.links": "Links", "record.metadata.noUsage": "No usage conditions specified for this record.", "record.metadata.origin": "About the data", @@ -244,6 +246,7 @@ "record.metadata.related": "Related records", "record.metadata.sheet": "More information available from:", "record.metadata.title": "Title", + "record.metadata.type": "Geographical dataset", "record.metadata.updateFrequency": "Data Update Frequency", "record.metadata.updateStatus": "Data Update Status", "record.metadata.updatedOn": "Last Data Information Update", diff --git a/translations/es.json b/translations/es.json index f645ff47e9..3f6b3d283e 100644 --- a/translations/es.json +++ b/translations/es.json @@ -115,6 +115,7 @@ "datahub.news.contact.title": "", "datahub.news.feed": "", "datahub.news.figures": "", + "datahub.record.addToFavorites": "", "datahub.search.back": "", "datahub.search.filter.all": "", "datahub.search.filter.generatedByWfs": "", @@ -218,6 +219,7 @@ "record.metadata.formats": "", "record.metadata.isOpenData": "", "record.metadata.keywords": "", + "record.metadata.lastUpdate": "", "record.metadata.links": "", "record.metadata.noUsage": "", "record.metadata.origin": "", @@ -244,6 +246,7 @@ "record.metadata.related": "", "record.metadata.sheet": "", "record.metadata.title": "", + "record.metadata.type": "", "record.metadata.updateFrequency": "", "record.metadata.updateStatus": "", "record.metadata.updatedOn": "", diff --git a/translations/fr.json b/translations/fr.json index b4dd3237c9..7764c39814 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -115,7 +115,8 @@ "datahub.news.contact.title": "Un besoin spécifique ?", "datahub.news.feed": "Fil d'activité", "datahub.news.figures": "Quelques chiffres", - "datahub.search.back": "Retour aux résultats", + "datahub.record.addToFavorites": "Ajouter aux favoris", + "datahub.search.back": "Retour", "datahub.search.filter.all": "Tous", "datahub.search.filter.generatedByWfs": "généré par une API", "datahub.search.filter.others": "Autres", @@ -218,6 +219,7 @@ "record.metadata.formats": "Formats", "record.metadata.isOpenData": "Donnée Ouverte", "record.metadata.keywords": "Mots clés", + "record.metadata.lastUpdate": "Mis à jour le", "record.metadata.links": "Liens", "record.metadata.noUsage": "Aucune condition d'utilisation spécifiée pour ces données", "record.metadata.origin": "À propos des données", @@ -244,6 +246,7 @@ "record.metadata.related": "Voir aussi", "record.metadata.sheet": "Plus d'informations à l'adresse suivante :", "record.metadata.title": "Titre", + "record.metadata.type": "Donnée géographique", "record.metadata.updateFrequency": "Fréquence de mise à jour des données", "record.metadata.updateStatus": "Statut de mise à jour des données", "record.metadata.updatedOn": "Dernière mise à jour des informations sur les données", diff --git a/translations/it.json b/translations/it.json index 95d9a9a7b3..d7182a0907 100644 --- a/translations/it.json +++ b/translations/it.json @@ -110,12 +110,13 @@ "datahub.header.organisations": "Organizzazioni", "datahub.header.popularRecords": "Più popolari", "datahub.header.title.html": "
Tutti i dati
pubblici della mia organizzazione
", - "datahub.news.contact.contactus": "", - "datahub.news.contact.html": "", - "datahub.news.contact.title": "", + "datahub.news.contact.contactus": "Contattateci", + "datahub.news.contact.html": "

Ha bisogno di dati che non sono attualmente disponibili sulla piattaforma?

I nostri team sono qui per aiutarla.

", + "datahub.news.contact.title": "Ha un bisogno specifico?", "datahub.news.feed": "Feed di attività", "datahub.news.figures": "Alcune figure", - "datahub.search.back": "Torna ai risultati", + "datahub.record.addToFavorites": "Aggiungere a miei preferiti", + "datahub.search.back": "Ritorna", "datahub.search.filter.all": "Tutti", "datahub.search.filter.generatedByWfs": "generato da un'API", "datahub.search.filter.others": "Altri", @@ -142,7 +143,7 @@ "downloads.format.unknown": "sconosciuto", "downloads.wfs.featuretype.not.found": "Il layer non è stato trovato", "dropFile": "Trascina il suo file", - "externalviewer.dataset.unnamed": "", + "externalviewer.dataset.unnamed": "Layer del datahub", "facets.block.title.OrgForResource": "Organizzazione", "facets.block.title.availableInServices": "Disponibile per", "facets.block.title.cl_hierarchyLevel.key": "Tipo di risorsa", @@ -218,6 +219,7 @@ "record.metadata.formats": "Formati", "record.metadata.isOpenData": "Data aperta", "record.metadata.keywords": "Parole chiave", + "record.metadata.lastUpdate": "Ultimo aggiornamento", "record.metadata.links": "Collegamenti", "record.metadata.noUsage": "Nessuna condizione d'uso specificata per questi dati", "record.metadata.origin": "Informazioni sui dati", @@ -244,6 +246,7 @@ "record.metadata.related": "Vedi anche", "record.metadata.sheet": "Per ulteriori informazioni, cliccate qui:", "record.metadata.title": "Titolo", + "record.metadata.type": "Dati geografici", "record.metadata.updateFrequency": "Frequenza di aggiornamento dei dati", "record.metadata.updateStatus": "Stato di aggiornamento dei dati", "record.metadata.updatedOn": "Ultimo aggiornamento delle informazioni sui dati", @@ -255,10 +258,10 @@ "record.was.created.time": "ha creato questi dati {time}", "records": "record", "results.layout.selectOne": "Mostra risultati", - "results.records.hits.displayedOn": "", + "results.records.hits.displayedOn": "{displayed, plural, =0{Nessun record} one{1 record visualizzato} other{{displayed} records visualizzati}} {hits, plural, other{su {hits} in totale.}}", "results.records.hits.empty.help.html": "Suggerimenti:
  • Prova con altre parole chiave
  • Cerca con meno parole
", "results.records.hits.found": "{hits, plural, =0{Nessuna corrispondenza.} one{1 record trovato.} other{{hits} risultati.}}", - "results.records.hits.selected": "", + "results.records.hits.selected": "{amount, plural, one{1 selezionato} other{{ amount } selezionati}}", "results.showMore": "Altri risultati...", "results.sortBy.dateStamp": "Più recente", "results.sortBy.popularity": "Popolarità", @@ -309,8 +312,8 @@ "tooltip.html.copy": "Copiare il HTML", "tooltip.url.copy": "Copiare l'URL", "tooltip.url.open": "Aprire l'URL", - "ui.readLess": "", - "ui.readMore": "", + "ui.readLess": "Ridurre", + "ui.readMore": "Leggi di più", "wfs.featuretype.notfound": "La classe di oggetto non è stata trovata nel servizio", "wfs.geojsongml.notsupported": "Il servizio non supporta il formato GeoJSON o GML", "wfs.unreachable.cors": "Il servizio non è accessibile a causa di limitazioni CORS", diff --git a/translations/nl.json b/translations/nl.json index a7a0178cd9..c0140d7e91 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -115,6 +115,7 @@ "datahub.news.contact.title": "", "datahub.news.feed": "", "datahub.news.figures": "", + "datahub.record.addToFavorites": "", "datahub.search.back": "", "datahub.search.filter.all": "", "datahub.search.filter.generatedByWfs": "", @@ -218,6 +219,7 @@ "record.metadata.formats": "", "record.metadata.isOpenData": "", "record.metadata.keywords": "", + "record.metadata.lastUpdate": "", "record.metadata.links": "", "record.metadata.noUsage": "", "record.metadata.origin": "", @@ -244,6 +246,7 @@ "record.metadata.related": "", "record.metadata.sheet": "", "record.metadata.title": "", + "record.metadata.type": "", "record.metadata.updateFrequency": "", "record.metadata.updateStatus": "", "record.metadata.updatedOn": "", diff --git a/translations/pt.json b/translations/pt.json index 63b3833b70..81cd78a9d2 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -115,6 +115,7 @@ "datahub.news.contact.title": "", "datahub.news.feed": "", "datahub.news.figures": "", + "datahub.record.addToFavorites": "", "datahub.search.back": "", "datahub.search.filter.all": "", "datahub.search.filter.generatedByWfs": "", @@ -218,6 +219,7 @@ "record.metadata.formats": "", "record.metadata.isOpenData": "", "record.metadata.keywords": "", + "record.metadata.lastUpdate": "", "record.metadata.links": "", "record.metadata.noUsage": "", "record.metadata.origin": "", @@ -244,6 +246,7 @@ "record.metadata.related": "", "record.metadata.sheet": "", "record.metadata.title": "", + "record.metadata.type": "", "record.metadata.updateFrequency": "", "record.metadata.updateStatus": "", "record.metadata.updatedOn": "", diff --git a/translations/sk.json b/translations/sk.json index 40e0c45af2..981d95840d 100644 --- a/translations/sk.json +++ b/translations/sk.json @@ -115,6 +115,7 @@ "datahub.news.contact.title": "", "datahub.news.feed": "Spravodajský kanál", "datahub.news.figures": "Ukazovatele", + "datahub.record.addToFavorites": "", "datahub.search.back": "Späť na výsledky", "datahub.search.filter.all": "Všetky", "datahub.search.filter.generatedByWfs": "vygenerované cez API", @@ -218,6 +219,7 @@ "record.metadata.formats": "Formáty", "record.metadata.isOpenData": "Otvorené dáta", "record.metadata.keywords": "Kľúčové slová", + "record.metadata.lastUpdate": "", "record.metadata.links": "Odkazy", "record.metadata.noUsage": "Pre túto položku nie sú špecifikované žiadne podmienky použitia.", "record.metadata.origin": "Pôvod", @@ -244,6 +246,7 @@ "record.metadata.related": "Súvisiace záznamy", "record.metadata.sheet": "Ďalšie metadáta sú k dispozícii na:", "record.metadata.title": "Názov", + "record.metadata.type": "", "record.metadata.updateFrequency": "Frekvencia aktualizácie metadát", "record.metadata.updateStatus": "Stav aktualizácie metadát", "record.metadata.updatedOn": "Posledná aktualizácia metadát",