diff --git a/apps/datahub/src/app/app.component.html b/apps/datahub/src/app/app.component.html index feeab422e..7c528cf29 100644 --- a/apps/datahub/src/app/app.component.html +++ b/apps/datahub/src/app/app.component.html @@ -2,5 +2,6 @@ gnUiSearchRouterContainer="mainSearch" class="selection:bg-primary-lightest selection:text-primary-darker" > + diff --git a/apps/datahub/src/app/app.module.ts b/apps/datahub/src/app/app.module.ts index fab5cee22..94e03f809 100644 --- a/apps/datahub/src/app/app.module.ts +++ b/apps/datahub/src/app/app.module.ts @@ -77,6 +77,7 @@ import { RecordDownloadsComponent } from './record/record-downloads/record-downl import { RecordApisComponent } from './record/record-apis/record-apis.component' import { MatTabsModule } from '@angular/material/tabs' 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 @@ -101,6 +102,7 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : [] RecordOtherlinksComponent, RecordDownloadsComponent, RecordApisComponent, + 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..7fd1bb832 --- /dev/null +++ b/apps/datahub/src/app/home/geocat-header/geocat-header.component.html @@ -0,0 +1,16 @@ +
+
+ {{ + 'datahub.header.documentation' | translate + }} + {{ + 'datahub.header.admin' | translate + }} + +
+
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..e6ee16551 --- /dev/null +++ b/apps/datahub/src/app/home/geocat-header/geocat-header.component.ts @@ -0,0 +1,26 @@ +import { Component } 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 { + 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 2c737a8b0..106026063 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 @@ -83,8 +83,4 @@ > - 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 70f8b1bb5..135ad500a 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,7 @@ [selected]="currentLang" ariaName="languages" [showTitle]="false" + [extraBtnClass]="'border-0'" + class="text-sm" >