-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
178 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
<gn-ui-badge>Test MEL</gn-ui-badge> | ||
<router-outlet></router-outlet> | ||
<mel-datahub-header></mel-datahub-header> | ||
<div gnUiSearchRouterContainer="mainSearch"> | ||
<router-outlet></router-outlet> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="h-16 px-8 bg-primary text-white flex items-center"> | ||
<div class="font-title uppercase text-lg font-bold" translate> | ||
mel.common.header.title | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'mel-datahub-header', | ||
templateUrl: './header.component.html', | ||
styles: ``, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class HeaderComponent {} |
14 changes: 14 additions & 0 deletions
14
apps/datahub/src/app/home/home-header/home-header.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="bg-beige"> | ||
<div class="pt-[139px]"> | ||
<h1 class="flex justify-center mel-page-title" translate=""> | ||
mel.datahub.home.title | ||
</h1> | ||
<div class="flex justify-center p-8 relative"> | ||
<gn-ui-fuzzy-search | ||
class="w-[645px] text-[17px] pointer-events-auto" | ||
(itemSelected)="onFuzzySearchSelection($event)" | ||
></gn-ui-fuzzy-search> | ||
</div> | ||
<div class="h-32"></div> | ||
</div> | ||
</div> |
31 changes: 31 additions & 0 deletions
31
apps/datahub/src/app/home/home-header/home-header.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { RouterFacade, SearchService } from 'geonetwork-ui'; | ||
import { CatalogRecord } from 'geonetwork-ui/src/libs/common/domain/src/lib/record'; | ||
import { SortByField } from 'geonetwork-ui/libs/common/domain/src/lib/search'; | ||
|
||
@Component({ | ||
selector: 'mel-datahub-home-header', | ||
templateUrl: './home-header.component.html', | ||
styles: ` | ||
::ng-deep .mdc-menu-surface.mat-mdc-autocomplete-panel { | ||
margin-top: 10px !important; | ||
border-radius: 8px; | ||
background-color: white; | ||
box-shadow: 0 2px 4px -1px #0003, 0 4px 5px #00000024, 0 1px 10px #0000001f; | ||
} | ||
`, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class HomeHeaderComponent { | ||
constructor( | ||
public routerFacade: RouterFacade, | ||
private searchService: SearchService | ||
) {} | ||
|
||
onFuzzySearchSelection(record: CatalogRecord) { | ||
this.routerFacade.goToMetadata(record); | ||
} | ||
clearSearchAndSort(sort: SortByField | string): void { | ||
this.searchService.setSortAndFilters({}, sort as SortByField); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<mel-datahub-home-header></mel-datahub-home-header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'mel-datahub-home-page', | ||
templateUrl: './home-page.component.html', | ||
styles: ``, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class HomePageComponent {} |
6 changes: 6 additions & 0 deletions
6
apps/datahub/src/app/search/search-header/search-header.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="bg-beige"> | ||
<div class="pt-[68px] container mx-auto"> | ||
<h1 class="flex mel-page-title" translate="">mel.datahub.search.title</h1> | ||
<div class="h-32"></div> | ||
</div> | ||
</div> |
24 changes: 24 additions & 0 deletions
24
apps/datahub/src/app/search/search-header/search-header.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { RouterFacade, SearchService } from 'geonetwork-ui'; | ||
import { CatalogRecord } from 'geonetwork-ui/src/libs/common/domain/src/lib/record'; | ||
import { SortByField } from 'geonetwork-ui/libs/common/domain/src/lib/search'; | ||
|
||
@Component({ | ||
selector: 'mel-datahub-search-header', | ||
templateUrl: './search-header.component.html', | ||
styles: ``, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class SearchHeaderComponent { | ||
constructor( | ||
public routerFacade: RouterFacade, | ||
private searchService: SearchService | ||
) {} | ||
|
||
onFuzzySearchSelection(record: CatalogRecord) { | ||
this.routerFacade.goToMetadata(record); | ||
} | ||
clearSearchAndSort(sort: SortByField | string): void { | ||
this.searchService.setSortAndFilters({}, sort as SortByField); | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
apps/datahub/src/app/search/search-page/search-page.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
<p>search-page works!</p> | ||
<mel-datahub-search-header></mel-datahub-search-header> | ||
<mel-datahub-search-results></mel-datahub-search-results> |
4 changes: 1 addition & 3 deletions
4
apps/datahub/src/app/search/search-page/search-page.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
apps/datahub/src/app/search/search-results/search-results.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div class="container mx-auto mt-8"> | ||
<div class="mt-6 rounded-lg text-gray-800 p-4 bg-slate-100"> | ||
<gn-ui-results-hits></gn-ui-results-hits> | ||
</div> | ||
<div class="mt-8"> | ||
<gn-ui-results-list-container | ||
showMore="button" | ||
[metadataQualityDisplay]="metadataQualityDisplay" | ||
(mdSelect)="onMetadataSelection($event)" | ||
></gn-ui-results-list-container> | ||
</div> | ||
</div> |
40 changes: 40 additions & 0 deletions
40
apps/datahub/src/app/search/search-results/search-results.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core' | ||
import { | ||
MetadataQualityDisplay, | ||
RouterFacade, | ||
SearchFacade, | ||
} from 'geonetwork-ui' | ||
import { CatalogRecord } from 'geonetwork-ui/src/libs/common/domain/src/lib/record' | ||
|
||
@Component({ | ||
selector: 'mel-datahub-search-results', | ||
templateUrl: './search-results.component.html', | ||
styles: ``, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class SearchResultsComponent implements OnInit { | ||
isQualitySortable = true | ||
metadataQualityDisplay = { | ||
widget: true, | ||
title: true, | ||
description: true, | ||
contact: true, | ||
keywords: true, | ||
legalConstraints: true, | ||
topic: true, | ||
updateFrequency: true, | ||
organisation: true, | ||
} as MetadataQualityDisplay | ||
|
||
constructor( | ||
private searchRouter: RouterFacade, | ||
private searchFacade: SearchFacade | ||
) {} | ||
ngOnInit() { | ||
this.searchFacade.setResultsLayout('CARD') | ||
} | ||
|
||
onMetadataSelection(metadata: CatalogRecord): void { | ||
this.searchRouter.goToMetadata(metadata) | ||
} | ||
} |