Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jahow committed Dec 13, 2024
1 parent c4a1156 commit f6a93a3
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 102 deletions.
11 changes: 0 additions & 11 deletions apps/geoadmin-demo/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@
id="geoadmin-root"
src="https://map.geo.admin.ch/#embed?bgLayer=ch.swisstopo.pixelkarte-grau"
></iframe>
<gn-search-input
api-url="https://www.geocat.ch/geonetwork/srv/api"
primary-color="#0f4395"
secondary-color="#8bc832"
></gn-search-input>
<gn-results-list
api-url="https://www.geocat.ch/geonetwork/srv/api"
layout="ROW"
primary-color="#0f4395"
secondary-color="#8bc832"
></gn-results-list>

<script>
GNUI.recordsRepository
Expand Down
15 changes: 8 additions & 7 deletions apps/geoadmin-demo/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
globalThis.ngJest = {
testEnvironmentOptions: {
errorOnUnknownElements: true,
errorOnUnknownProperties: true,
},
}
import 'jest-preset-angular/setup-jest'
import '../../../jest.setup'

class ResizeObserverMock {
observe = jest.fn()
unobserve = jest.fn()
}

;(window as any).ResizeObserver = ResizeObserverMock
31 changes: 12 additions & 19 deletions apps/webcomponents/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
<main class="w-2/3 mx-auto my-12">
<gn-search-input
class="mt-28"
api-url="https://www.geo2france.fr/geonetwork/srv/api"
primary-color="#0f4395"
secondary-color="#8bc832"
main-color="#555"
background-color="#fdfbff"
main-font="'Inter', sans-serif"
title-font="'DM Serif Display', serif"
></gn-search-input>

<gn-facets
api-url="https://www.geo2france.fr/geonetwork/srv/api"
facet-config='{"tag.default":{"terms":{"field":"tag.default","include":".*","size": 10}}}'
></gn-facets>
<gn-results-list
api-url="https://www.geo2france.fr/geonetwork/srv/api"
></gn-results-list>
<main class="py-12">
<wc-gn-record-view
class="mx-auto w-[500px] h-[700px] overflow-auto"
apiUrl="https://www.geocat.ch/geonetwork/srv/api"
recordId="8698bf0b-fceb-4f0f-989b-111e7c4af0a4"
primaryColor="#0f4395"
secondaryColor="#8bc832"
mainColor="#555"
backgroundColor="#fdfbff"
mainFont="'Inter', sans-serif"
titleFont="'DM Serif Display', serif"
></wc-gn-record-view>
</main>
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,35 @@
{{ record.title }}
</div>
<gn-ui-metadata-info [metadata]="record"></gn-ui-metadata-info>
{{ record | json }}
<gn-ui-image-overlay-preview
class="block h-[185px] mb-5"
[imageUrl]="record?.overviews?.[0]?.url"
>
</gn-ui-image-overlay-preview>
<gn-ui-metadata-contact [metadata]="record"> </gn-ui-metadata-contact>

<div class="font-title text-lg my-4" translate>
record.metadata.download
<div class="font-title text-lg my-4">
<span translate> record.metadata.download</span>
<gn-ui-previous-next-buttons
[listComponent]="downloads"
></gn-ui-previous-next-buttons>
</div>
<gn-ui-block-list containerClass="gap-4 py-10">
<gn-ui-block-list containerClass="gap-4 py-10" #downloads>
<gn-ui-download-item
#block
*ngFor="let otherLink of getDownloads(record.onlineResources)"
[link]="otherLink"
></gn-ui-download-item>
</gn-ui-block-list>

<div class="font-title text-lg my-4" translate>record.metadata.links</div>
<gn-ui-block-list containerClass="gap-4 py-10">
<div class="font-title text-lg my-4">
<span translate>record.metadata.links</span>
<gn-ui-previous-next-buttons
[listComponent]="links"
></gn-ui-previous-next-buttons>
</div>
<gn-ui-block-list containerClass="gap-4 py-10" #links>
<gn-ui-link-card
#block
*ngFor="let otherLink of getLinks(record.onlineResources)"
Expand All @@ -35,8 +44,13 @@
></gn-ui-link-card>
</gn-ui-block-list>

<div class="font-title text-lg my-4" translate>record.metadata.api</div>
<gn-ui-block-list containerClass="gap-4 py-10">
<div class="font-title text-lg my-4">
<span translate>record.metadata.api</span>
<gn-ui-previous-next-buttons
[listComponent]="apis"
></gn-ui-previous-next-buttons>
</div>
<gn-ui-block-list containerClass="gap-4 py-10" #apis>
<gn-ui-api-card
#block
*ngFor="let otherLink of getAPIs(record.onlineResources)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
OnInit,
ViewEncapsulation,
} from '@angular/core'
import { SearchFacade, SearchService } from '@geonetwork-ui/feature/search'
import { SearchFacade } from '@geonetwork-ui/feature/search'
import { BaseComponent } from '../base.component'
import { Observable } from 'rxjs'
import {
Expand All @@ -24,7 +24,7 @@ import {
styleUrls: ['./gn-record-view.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.ShadowDom,
providers: [SearchFacade, SearchService],
providers: [SearchFacade],
})
export class GnRecordViewComponent extends BaseComponent implements OnInit {
@Input() recordId!: string
Expand Down
8 changes: 6 additions & 2 deletions apps/webcomponents/src/app/webcomponents.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ import { RecordsRepositoryInterface } from '@geonetwork-ui/common/domain/reposit
import { PlatformServiceInterface } from '@geonetwork-ui/common/domain/platform.service.interface'
import { GnRecordViewComponent } from './components/gn-record-view/gn-record-view.component'
import { LetDirective } from '@ngrx/component'
import { BlockListComponent } from '@geonetwork-ui/ui/layout'
import {
BlockListComponent,
PreviousNextButtonsComponent,
} from '@geonetwork-ui/ui/layout'

const CUSTOM_ELEMENTS: [new (...args) => BaseComponent, string][] = [
[GnFacetsComponent, 'gn-facets'],
Expand Down Expand Up @@ -126,6 +129,7 @@ const CUSTOM_ELEMENTS: [new (...args) => BaseComponent, string][] = [
LinkCardComponent,
ApiCardComponent,
DownloadItemComponent,
PreviousNextButtonsComponent,
],
providers: [
provideGn4(),
Expand All @@ -139,7 +143,7 @@ const CUSTOM_ELEMENTS: [new (...args) => BaseComponent, string][] = [
},
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
// bootstrap: [AppComponent],
bootstrap: [AppComponent],
})
export class WebcomponentsModule {
constructor(private injector: Injector) {
Expand Down
106 changes: 53 additions & 53 deletions apps/webcomponents/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,58 +40,58 @@
</style>
</head>
<body>
<main class="container">
<h1 class="text-3xl">GeoNetwork demo</h1>
<ul>
<li class="mt-5">
<a href="gn-results-list.sample.html"
>Results List ROW, "show more" button</a
>
</li>
<li>
<a href="gn-results-list-multiple.sample.html"
>Results List TITLE, fixed, multiple</a
>
</li>
<li>
<a href="gn-results-list-watch.sample.html"
>Results List TITLE, watchers</a
>
</li>
<li>
<a href="gn-results-list-filter.sample.html"
>Results List TITLE, filters</a
>
</li>
<li class="mt-5">
<a href="gn-search-input.sample.html">Search Input</a>
</li>
<li>
<a href="gn-search-input-and-results.sample.html"
>Search Input + Results List (infinite scroll)</a
>
</li>
<li class="mt-5">
<a href="gn-dataset-view-table.sample.html"
>Preview dataset as table</a
>
</li>
<li>
<a href="gn-dataset-view-chart.sample.html"
>Preview dataset as chart</a
>
</li>
<li>
<a href="gn-dataset-view-map.sample.html">Preview dataset as map</a>
</li>
<li class="mt-5">
<a href="gn-map-viewer.sample.html">Map viewer</a>
</li>
<li class="mt-5">
<a href="gn-figure-datasets.sample.html">Figures - Datasets</a>
</li>
</ul>
</main>
<!-- <wc-root></wc-root>-->
<!-- <main class="container">-->
<!-- <h1 class="text-3xl">GeoNetwork demo</h1>-->
<!-- <ul>-->
<!-- <li class="mt-5">-->
<!-- <a href="gn-results-list.sample.html"-->
<!-- >Results List ROW, "show more" button</a-->
<!-- >-->
<!-- </li>-->
<!-- <li>-->
<!-- <a href="gn-results-list-multiple.sample.html"-->
<!-- >Results List TITLE, fixed, multiple</a-->
<!-- >-->
<!-- </li>-->
<!-- <li>-->
<!-- <a href="gn-results-list-watch.sample.html"-->
<!-- >Results List TITLE, watchers</a-->
<!-- >-->
<!-- </li>-->
<!-- <li>-->
<!-- <a href="gn-results-list-filter.sample.html"-->
<!-- >Results List TITLE, filters</a-->
<!-- >-->
<!-- </li>-->
<!-- <li class="mt-5">-->
<!-- <a href="gn-search-input.sample.html">Search Input</a>-->
<!-- </li>-->
<!-- <li>-->
<!-- <a href="gn-search-input-and-results.sample.html"-->
<!-- >Search Input + Results List (infinite scroll)</a-->
<!-- >-->
<!-- </li>-->
<!-- <li class="mt-5">-->
<!-- <a href="gn-dataset-view-table.sample.html"-->
<!-- >Preview dataset as table</a-->
<!-- >-->
<!-- </li>-->
<!-- <li>-->
<!-- <a href="gn-dataset-view-chart.sample.html"-->
<!-- >Preview dataset as chart</a-->
<!-- >-->
<!-- </li>-->
<!-- <li>-->
<!-- <a href="gn-dataset-view-map.sample.html">Preview dataset as map</a>-->
<!-- </li>-->
<!-- <li class="mt-5">-->
<!-- <a href="gn-map-viewer.sample.html">Map viewer</a>-->
<!-- </li>-->
<!-- <li class="mt-5">-->
<!-- <a href="gn-figure-datasets.sample.html">Figures - Datasets</a>-->
<!-- </li>-->
<!-- </ul>-->
<!-- </main>-->
<wc-root></wc-root>
</body>
</html>
2 changes: 1 addition & 1 deletion conf/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fonts_stylesheet_url = "https://fonts.googleapis.com/css2?family=Public+Sans:wgh
# The advanced search filters available to the user can be customized with this setting.
# The following fields can be used for filtering: 'publisher', 'format', 'publicationYear', 'standard', 'inspireKeyword', 'topic', 'isSpatial', 'license'
# any other field will be ignored
advanced_filters = ['topic', 'publisher', 'contact', 'keyword', 'resourceType', 'representationType', 'format']
advanced_filters = ['availableServices', 'topic', 'publisher', 'contact', 'keyword', 'resourceType', 'representationType', 'format']

# One or several search presets can be defined here; every search preset is composed of:
# - a name (which can be a translation key)
Expand Down

0 comments on commit f6a93a3

Please sign in to comment.