Commit c0f38af 1 parent f3121a9 commit c0f38af Copy full SHA for c0f38af
File tree 7 files changed +68
-5
lines changed
libs/ui/catalog/src/lib/language-switcher
7 files changed +68
-5
lines changed Original file line number Diff line number Diff line change 2
2
gnUiSearchRouterContainer ="mainSearch "
3
3
class ="selection:bg-primary-lightest selection:text-primary-darker "
4
4
>
5
+ < datahub-geocat-header > </ datahub-geocat-header >
5
6
< router-outlet > </ router-outlet >
6
7
</ div >
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ import { RecordDownloadsComponent } from './record/record-downloads/record-downl
81
81
import { RecordApisComponent } from './record/record-apis/record-apis.component'
82
82
import { MatTabsModule } from '@angular/material/tabs'
83
83
import { ORGANIZATIONS_STRATEGY } from '@geonetwork-ui/api/repository/gn4'
84
+ import { GeocatHeaderComponent } from './home/geocat-header/geocat-header.component'
84
85
85
86
export const metaReducers : MetaReducer [ ] = ! environment . production ? [ ] : [ ]
86
87
// https://github.com/nrwl/nx/issues/191
@@ -105,6 +106,7 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : []
105
106
RecordOtherlinksComponent ,
106
107
RecordDownloadsComponent ,
107
108
RecordApisComponent ,
109
+ GeocatHeaderComponent ,
108
110
] ,
109
111
imports : [
110
112
BrowserModule ,
Original file line number Diff line number Diff line change
1
+ < div class ="px-5 ">
2
+ < div
3
+ class ="mx-auto flex items-center justify-center sm:justify-end gap-2 py-1 text-sm "
4
+ >
5
+ < a class ="block hover:underline mr-4 " [href] ="docLink " target ="_blank "> {{
6
+ 'datahub.header.documentation' | translate
7
+ }}</ a >
8
+ < a class ="block hover:underline " [href] ="gnLink " target ="_blank "> {{
9
+ 'datahub.header.admin' | translate
10
+ }}</ a >
11
+ < gn-ui-language-switcher
12
+ *ngIf ="showLanguageSwitcher "
13
+ class ="language-switcher "
14
+ > </ gn-ui-language-switcher >
15
+ </ div >
16
+ </ div >
Original file line number Diff line number Diff line change
1
+ import { ComponentFixture , TestBed } from '@angular/core/testing' ;
2
+
3
+ import { GeocatHeaderComponent } from './geocat-header.component' ;
4
+
5
+ describe ( 'GeocatHeaderComponent' , ( ) => {
6
+ let component : GeocatHeaderComponent ;
7
+ let fixture : ComponentFixture < GeocatHeaderComponent > ;
8
+
9
+ beforeEach ( ( ) => {
10
+ TestBed . configureTestingModule ( {
11
+ declarations : [ GeocatHeaderComponent ]
12
+ } ) ;
13
+ fixture = TestBed . createComponent ( GeocatHeaderComponent ) ;
14
+ component = fixture . componentInstance ;
15
+ fixture . detectChanges ( ) ;
16
+ } ) ;
17
+
18
+ it ( 'should create' , ( ) => {
19
+ expect ( component ) . toBeTruthy ( ) ;
20
+ } ) ;
21
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { Component } from '@angular/core'
2
+ import { TranslateService } from '@ngx-translate/core'
3
+ import { LANG_2_TO_3_MAPPER } from '@geonetwork-ui/util/i18n'
4
+ import { getGlobalConfig } from '@geonetwork-ui/util/app-config'
5
+
6
+ @Component ( {
7
+ selector : 'datahub-geocat-header' ,
8
+ templateUrl : './geocat-header.component.html' ,
9
+ } )
10
+ export class GeocatHeaderComponent {
11
+ showLanguageSwitcher = getGlobalConfig ( ) . LANGUAGES ?. length > 0
12
+
13
+ constructor ( private translate : TranslateService ) { }
14
+
15
+ get docLink ( ) {
16
+ return `https://www.geocat.admin.ch/${
17
+ this . translate . currentLang || 'en'
18
+ } /home.html`
19
+ }
20
+
21
+ get gnLink ( ) {
22
+ return `/geonetwork/srv/${
23
+ LANG_2_TO_3_MAPPER [ this . translate . currentLang ] || 'eng'
24
+ } /catalog.edit#/board`
25
+ }
26
+ }
Original file line number Diff line number Diff line change 84
84
> </ datahub-navigation-menu >
85
85
</ div >
86
86
</ div >
87
- < gn-ui-language-switcher
88
- *ngIf ="showLanguageSwitcher "
89
- class ="language-switcher absolute top-2.5 left-2.5 text-[13px] "
90
- > </ gn-ui-language-switcher >
91
87
</ header >
Original file line number Diff line number Diff line change 5
5
[selected] ="currentLang "
6
6
ariaName ="languages "
7
7
[showTitle] ="false "
8
- [extraBtnClass] ="'flex justify-items-center !pl-2 !py-1' "
8
+ [extraBtnClass] ="'flex justify-items-center text-white !pl-2 !py-1' "
9
+ class ="text-sm "
9
10
>
10
11
</ gn-ui-dropdown-selector >
You can’t perform that action at this time.
0 commit comments