Commit d7fb220 1 parent 7547c79 commit d7fb220 Copy full SHA for d7fb220
File tree 8 files changed +88
-5
lines changed
8 files changed +88
-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 @@ -104,6 +104,7 @@ import {
104
104
} from '@ng-icons/material-icons/outline'
105
105
import { NgIconsModule , provideNgIconsConfig } from '@ng-icons/core'
106
106
import { ORGANIZATIONS_STRATEGY } from '@geonetwork-ui/api/repository/gn4'
107
+ import { GeocatHeaderComponent } from './home/geocat-header/geocat-header.component'
107
108
108
109
export const metaReducers : MetaReducer [ ] = ! environment . production ? [ ] : [ ]
109
110
@@ -176,6 +177,7 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : []
176
177
OrganisationsComponent ,
177
178
LanguageSwitcherComponent ,
178
179
LocationSearchComponent ,
180
+ GeocatHeaderComponent ,
179
181
] ,
180
182
providers : [
181
183
provideNgIconsConfig ( {
Original file line number Diff line number Diff line change
1
+ < div
2
+ class ="px-5 mx-auto flex items-center justify-center sm:justify-end gap-6 py-1 text-sm "
3
+ >
4
+ < a class ="block hover:underline " [href] ="gnLinkGeneral " target ="_blank "> {{
5
+ 'datahub.header.geonetwork' | translate
6
+ }}</ a >
7
+ < a class ="block hover:underline " [href] ="docLink " target ="_blank "> {{
8
+ 'datahub.header.documentation' | translate
9
+ }}</ a >
10
+ < a class ="block hover:underline " [href] ="gnLinkAdmin " target ="_blank "> {{
11
+ 'datahub.header.admin' | translate
12
+ }}</ a >
13
+ < gn-ui-language-switcher
14
+ *ngIf ="showLanguageSwitcher "
15
+ class ="language-switcher "
16
+ > </ gn-ui-language-switcher >
17
+ </ div >
Original file line number Diff line number Diff line change
1
+ import { ComponentFixture , TestBed } from '@angular/core/testing'
2
+ import { GeocatHeaderComponent } from './geocat-header.component'
3
+ import { TranslateModule } from '@ngx-translate/core'
4
+
5
+ jest . mock ( '@geonetwork-ui/util/app-config' , ( ) => ( {
6
+ getGlobalConfig : jest . fn ( ( ) => ( {
7
+ LANGUAGES : [ 'de' , 'fr' ] ,
8
+ } ) ) ,
9
+ } ) )
10
+
11
+ describe ( 'GeocatHeaderComponent' , ( ) => {
12
+ let component : GeocatHeaderComponent
13
+ let fixture : ComponentFixture < GeocatHeaderComponent >
14
+
15
+ beforeEach ( ( ) => {
16
+ TestBed . configureTestingModule ( {
17
+ declarations : [ GeocatHeaderComponent ] ,
18
+ imports : [ TranslateModule . forRoot ( ) ] ,
19
+ } )
20
+ fixture = TestBed . createComponent ( GeocatHeaderComponent )
21
+ component = fixture . componentInstance
22
+ fixture . detectChanges ( )
23
+ } )
24
+
25
+ it ( 'should create' , ( ) => {
26
+ expect ( component ) . toBeTruthy ( )
27
+ } )
28
+ } )
Original file line number Diff line number Diff line change
1
+ import { Component } from '@angular/core'
2
+ import { TranslateModule , 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
+ import { LanguageSwitcherComponent } from '@geonetwork-ui/ui/catalog'
6
+ import { CommonModule } from '@angular/common'
7
+
8
+ @Component ( {
9
+ selector : 'datahub-geocat-header' ,
10
+ templateUrl : './geocat-header.component.html' ,
11
+ imports : [ CommonModule , TranslateModule , LanguageSwitcherComponent ] ,
12
+ standalone : true ,
13
+ } )
14
+ export class GeocatHeaderComponent {
15
+ showLanguageSwitcher = getGlobalConfig ( ) . LANGUAGES ?. length > 0
16
+
17
+ constructor ( private translate : TranslateService ) { }
18
+
19
+ get docLink ( ) {
20
+ return `https://www.info.geocat.ch`
21
+ }
22
+
23
+ get gnLinkAdmin ( ) {
24
+ return `/geonetwork/srv/${
25
+ LANG_2_TO_3_MAPPER [ this . translate . currentLang ] || 'eng'
26
+ } /catalog.edit#/board`
27
+ }
28
+
29
+ get gnLinkGeneral ( ) {
30
+ return `/geonetwork/srv/${
31
+ LANG_2_TO_3_MAPPER [ this . translate . currentLang ] || 'eng'
32
+ } /catalog.search#/home`
33
+ }
34
+ }
Original file line number Diff line number Diff line change 91
91
class ="tabs flex justify-between font-medium -mx-5 sm:mx-0 sm:mt-32 inset-x-0 bottom-0 z-50 "
92
92
> </ datahub-navigation-menu >
93
93
</ div >
94
- < gn-ui-language-switcher
94
+ <!-- < gn-ui-language-switcher
95
95
*ngIf="showLanguageSwitcher"
96
96
class="language-switcher absolute top-3.5 right-6 text-[13px]"
97
97
[style.--color-main]="foregroundColor"
98
98
[style.--color-gray-300]="foregroundColor"
99
99
[style.--color-primary-darker]="foregroundColor"
100
100
[style.--color-primary-black]="foregroundColor"
101
- > </ gn-ui-language-switcher >
101
+ ></gn-ui-language-switcher> -->
102
102
</ div >
103
103
</ header >
Original file line number Diff line number Diff line change @@ -260,7 +260,8 @@ describe('HeaderComponent', () => {
260
260
} )
261
261
} )
262
262
263
- describe ( 'language switcher' , ( ) => {
263
+ // skipped for geocat
264
+ describe . skip ( 'language switcher' , ( ) => {
264
265
describe ( 'given predefined languages' , ( ) => {
265
266
it ( 'should display language switcher' , ( ) => {
266
267
const languageSwitcher = fixture . debugElement . queryAll (
Original file line number Diff line number Diff line change 12
12
>
13
13
</ gn-ui-navigation-button >
14
14
</ div >
15
- < div class ="flex flex-row mr-6 content-center gap-3 ">
15
+ <!-- < div class="flex flex-row mr-6 content-center gap-3">
16
16
<gn-ui-language-switcher
17
17
*ngIf="showLanguageSwitcher"
18
18
class="language-switcher text-[13px] mt-0.5"
19
19
[style.--color-main]="foregroundColor"
20
20
[style.--color-gray-300]="foregroundColor"
21
21
></gn-ui-language-switcher>
22
- </ div >
22
+ </div> -->
23
23
</ div >
24
24
< ng-container *ngIf ="organization ">
25
25
< div
You can’t perform that action at this time.
0 commit comments