diff --git a/apps/datahub/src/app/app.module.ts b/apps/datahub/src/app/app.module.ts index 70f8c76d3..a6abb75a8 100644 --- a/apps/datahub/src/app/app.module.ts +++ b/apps/datahub/src/app/app.module.ts @@ -71,6 +71,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations' import { GN_UI_VERSION } from '@geonetwork-ui/feature/record' import { LOGIN_URL } from '@geonetwork-ui/api/repository/gn4' import { ORGANIZATIONS_STRATEGY } from '@geonetwork-ui/api/repository/gn4' +import { GeocatHeaderComponent } from './home/geocat-header/geocat-header.component' export const metaReducers: MetaReducer[] = !environment.production ? [] : [] // https://github.com/nrwl/nx/issues/191 @@ -90,6 +91,7 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : [] LastCreatedComponent, KeyFiguresComponent, NavigationMenuComponent, + GeocatHeaderComponent, ], imports: [ BrowserModule, diff --git a/apps/datahub/src/app/home/geocat-header/geocat-header.component.html b/apps/datahub/src/app/home/geocat-header/geocat-header.component.html new file mode 100644 index 000000000..517d933c7 --- /dev/null +++ b/apps/datahub/src/app/home/geocat-header/geocat-header.component.html @@ -0,0 +1,22 @@ +
+
+ + {{ + 'datahub.header.documentation' | translate + }} + Geonetwork + +
+
diff --git a/apps/datahub/src/app/home/geocat-header/geocat-header.component.spec.ts b/apps/datahub/src/app/home/geocat-header/geocat-header.component.spec.ts new file mode 100644 index 000000000..1468b4eaa --- /dev/null +++ b/apps/datahub/src/app/home/geocat-header/geocat-header.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { GeocatHeaderComponent } from './geocat-header.component'; + +describe('GeocatHeaderComponent', () => { + let component: GeocatHeaderComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [GeocatHeaderComponent] + }); + fixture = TestBed.createComponent(GeocatHeaderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/apps/datahub/src/app/home/geocat-header/geocat-header.component.ts b/apps/datahub/src/app/home/geocat-header/geocat-header.component.ts new file mode 100644 index 000000000..04a882044 --- /dev/null +++ b/apps/datahub/src/app/home/geocat-header/geocat-header.component.ts @@ -0,0 +1,27 @@ +import { Component, Input } from '@angular/core' +import { TranslateService } from '@ngx-translate/core' +import { LANG_2_TO_3_MAPPER } from '@geonetwork-ui/util/i18n' +import { getGlobalConfig } from '@geonetwork-ui/util/app-config' + +@Component({ + selector: 'datahub-geocat-header', + templateUrl: './geocat-header.component.html', +}) +export class GeocatHeaderComponent { + @Input() horizontalPosition: 'start' | 'center' | 'end' = 'center' + showLanguageSwitcher = getGlobalConfig().LANGUAGES?.length > 0 + + constructor(private translate: TranslateService) {} + + get docLink() { + return `https://www.geocat.admin.ch/${ + this.translate.currentLang || 'en' + }/home.html` + } + + get gnLink() { + return `https://www.geocat.ch/geonetwork/srv/${ + LANG_2_TO_3_MAPPER[this.translate.currentLang] || 'eng' + }/catalog.edit#/board` + } +} diff --git a/apps/datahub/src/app/home/home-header/home-header.component.html b/apps/datahub/src/app/home/home-header/home-header.component.html index 6daed33a7..716cbbe13 100644 --- a/apps/datahub/src/app/home/home-header/home-header.component.html +++ b/apps/datahub/src/app/home/home-header/home-header.component.html @@ -2,6 +2,7 @@
+
- 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 f20951d6d..46ee50183 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 @@ -2,6 +2,7 @@
+