errorTypes = ErrorType
recordUrlGetter = this.getRecordUrl.bind(this)
@@ -60,6 +61,17 @@ export class ResultsListContainerComponent implements OnInit {
this.facade.setResultsLayout(this.layout)
}
+ this.pipelineForQualityScoreActivated = this.facade.results$.pipe(
+ tap((records) => {
+ if (records?.length > 0 && !records[0].extras?.qualityScore) {
+ console.warn(
+ 'It looks like the metadata quality indicator is not available on these records, probably due to a missing indexing pipeline'
+ )
+ }
+ }),
+ map((records) => !!records[0]?.extras.qualityScore)
+ )
+
this.error$ = this.facade.error$
this.errorCode$ = this.error$.pipe(
filter((error) => error !== null),
diff --git a/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.html b/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.html
index bfc88db01e..09036c9b6c 100644
--- a/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.html
+++ b/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.html
@@ -1,4 +1,4 @@
-
{{ icon }}
+
{{ icon }}
{{ labelKey | translate }}
diff --git a/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.spec.ts b/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.spec.ts
index 124ca72ada..444998f088 100644
--- a/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.spec.ts
+++ b/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.spec.ts
@@ -53,7 +53,7 @@ describe('MetadataQualityInfoComponent', () => {
fixture.detectChanges()
const iconElement = fixture.debugElement.query(By.css('mat-icon'))
- expect(iconElement.nativeElement.innerHTML).toBe('warning_amber')
+ expect(iconElement.nativeElement.innerHTML).toBe('warning')
const textElement = fixture.debugElement.query(By.css('.text'))
expect(textElement.nativeElement.innerHTML).toBe(
@@ -81,7 +81,7 @@ describe('MetadataQualityInfoComponent', () => {
fixture.detectChanges()
const iconElement = fixture.debugElement.query(By.css('mat-icon'))
- expect(iconElement.nativeElement.innerHTML).toBe('warning_amber')
+ expect(iconElement.nativeElement.innerHTML).toBe('warning')
const textElement = fixture.debugElement.query(By.css('.text'))
expect(textElement.nativeElement.innerHTML).toBe(
diff --git a/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.ts b/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.ts
index 57c75a1bb0..1a0891c2e8 100644
--- a/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.ts
+++ b/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.ts
@@ -33,7 +33,7 @@ export class MetadataQualityItemComponent implements MetadataQualityItem {
@Input() value: boolean
get icon() {
- return this.value ? 'check' : 'warning_amber'
+ return this.value ? 'check' : 'warning'
}
get labelKey() {
diff --git a/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.html b/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.html
index f24ab4e8b6..d56a5c1067 100644
--- a/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.html
+++ b/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.html
@@ -1,5 +1,5 @@
@Input() linkHref: string = null
- @Input() metadataQualityDisplay: MetadataQualityDisplay
+ @Input() metadataQualityDisplay: boolean
@Output() mdSelect = new EventEmitter()
subscription = new Subscription()
abstract: string
@@ -51,9 +50,6 @@ export class RecordPreviewComponent implements OnInit, OnDestroy {
get organization(): Organization {
return this.record.ownerOrganization
}
- get hasMetadataQualityWidget(): boolean {
- return this.metadataQualityDisplay?.widget === true
- }
constructor(protected elementRef: ElementRef) {}
diff --git a/libs/ui/search/src/lib/results-list-item/results-list-item.component.ts b/libs/ui/search/src/lib/results-list-item/results-list-item.component.ts
index 4edb676732..c8084239f6 100644
--- a/libs/ui/search/src/lib/results-list-item/results-list-item.component.ts
+++ b/libs/ui/search/src/lib/results-list-item/results-list-item.component.ts
@@ -14,7 +14,6 @@ import {
import { RecordPreviewComponent } from '../record-preview/record-preview.component'
import { ResultsLayoutConfigItem } from '../results-list/results-layout.config'
import { CatalogRecord } from '@geonetwork-ui/common/domain/model/record'
-import { MetadataQualityDisplay } from '@geonetwork-ui/ui/elements'
@Component({
selector: 'gn-ui-results-list-item',
@@ -26,7 +25,7 @@ export class ResultsListItemComponent implements OnChanges, AfterViewInit {
@Input() layoutConfig: ResultsLayoutConfigItem
@Input() record: CatalogRecord
@Input() favoriteTemplate: TemplateRef<{ $implicit: CatalogRecord }>
- @Input() metadataQualityDisplay: MetadataQualityDisplay
+ @Input() metadataQualityDisplay: boolean
@Input() linkHref: string
@Output() mdSelect = new EventEmitter()
initialized = false
diff --git a/libs/ui/search/src/lib/results-list/results-list.component.ts b/libs/ui/search/src/lib/results-list/results-list.component.ts
index 0297391f84..fc9fa7e424 100644
--- a/libs/ui/search/src/lib/results-list/results-list.component.ts
+++ b/libs/ui/search/src/lib/results-list/results-list.component.ts
@@ -3,6 +3,7 @@ import {
Component,
EventEmitter,
Input,
+ OnInit,
Output,
TemplateRef,
} from '@angular/core'
@@ -11,7 +12,6 @@ import {
ResultsLayoutConfigItem,
} from './results-layout.config'
import { CatalogRecord } from '@geonetwork-ui/common/domain/model/record'
-import { MetadataQualityDisplay } from '@geonetwork-ui/ui/elements'
@Component({
selector: 'gn-ui-results-list',
@@ -25,6 +25,6 @@ export class ResultsListComponent {
DEFAULT_RESULTS_LAYOUT_CONFIG['CARD']
@Input() favoriteTemplate: TemplateRef<{ $implicit: CatalogRecord }>
@Input() recordUrlGetter: (record: CatalogRecord) => string
- @Input() metadataQualityDisplay: MetadataQualityDisplay
+ @Input() metadataQualityDisplay: boolean
@Output() mdSelect = new EventEmitter()
}
diff --git a/libs/util/app-config/src/lib/app-config.ts b/libs/util/app-config/src/lib/app-config.ts
index 4c5a89142d..ec86a803ca 100644
--- a/libs/util/app-config/src/lib/app-config.ts
+++ b/libs/util/app-config/src/lib/app-config.ts
@@ -11,8 +11,8 @@ import {
GlobalConfig,
LayerConfig,
MapConfig,
- SearchConfig,
MetadataQualityConfig,
+ SearchConfig,
ThemeConfig,
} from './model'
import { TranslateCompiler, TranslateLoader } from '@ngx-translate/core'
@@ -245,20 +245,7 @@ export function loadAppConfig() {
parsed,
'metadata-quality',
[],
- [
- 'enabled',
- 'sortable',
- 'display_widget_in_detail',
- 'display_widget_in_search',
- 'display_title',
- 'display_description',
- 'display_topic',
- 'display_keywords',
- 'display_legal_constraints',
- 'display_contact',
- 'display_update_frequency',
- 'display_organisation',
- ],
+ ['enabled'],
warnings,
errors
)
@@ -268,22 +255,6 @@ export function loadAppConfig() {
: ({
ENABLED: parsedMetadataQualitySection.enabled,
SORTABLE: parsedMetadataQualitySection.sortable,
- DISPLAY_WIDGET_IN_DETAIL:
- parsedMetadataQualitySection.display_widget_in_detail,
- DISPLAY_WIDGET_IN_SEARCH:
- parsedMetadataQualitySection.display_widget_in_search,
- DISPLAY_TITLE: parsedMetadataQualitySection.display_title,
- DISPLAY_DESCRIPTION:
- parsedMetadataQualitySection.display_description,
- DISPLAY_TOPIC: parsedMetadataQualitySection.display_topic,
- DISPLAY_KEYWORDS: parsedMetadataQualitySection.display_keywords,
- DISPLAY_LEGAL_CONSTRAINTS:
- parsedMetadataQualitySection.display_legal_constraints,
- DISPLAY_CONTACT: parsedMetadataQualitySection.display_contact,
- DISPLAY_UPDATE_FREQUENCY:
- parsedMetadataQualitySection.display_update_frequency,
- DISPLAY_ORGANISATION:
- parsedMetadataQualitySection.display_organisation,
} as MetadataQualityConfig)
customTranslations = parseTranslationsConfigSection(
diff --git a/libs/util/app-config/src/lib/model.ts b/libs/util/app-config/src/lib/model.ts
index ba04e7211e..cc7c981dcb 100644
--- a/libs/util/app-config/src/lib/model.ts
+++ b/libs/util/app-config/src/lib/model.ts
@@ -54,17 +54,6 @@ export interface SearchConfig {
export interface MetadataQualityConfig {
ENABLED: boolean
- SORTABLE: boolean
- DISPLAY_WIDGET_IN_DETAIL: boolean
- DISPLAY_WIDGET_IN_SEARCH: boolean
- DISPLAY_TITLE: boolean
- DISPLAY_DESCRIPTION: boolean
- DISPLAY_TOPIC: boolean
- DISPLAY_KEYWORDS: boolean
- DISPLAY_LEGAL_CONSTRAINTS: boolean
- DISPLAY_CONTACT: boolean
- DISPLAY_UPDATE_FREQUENCY: boolean
- DISPLAY_ORGANISATION: boolean
}
export type CustomTranslations = { [translationKey: string]: string }
diff --git a/support-services/docker-compose.yml b/support-services/docker-compose.yml
index 340c104943..8ee3b01ff6 100644
--- a/support-services/docker-compose.yml
+++ b/support-services/docker-compose.yml
@@ -99,6 +99,17 @@ services:
ports:
- '8080:8080'
+ init-pipeline:
+ image: geonetwork/geonetwork-ui-tools-pipelines:latest
+ environment:
+ ES_HOST: http://elasticsearch:9200
+ RECORDS_INDEX: gn-records
+ depends_on:
+ geonetwork:
+ condition: service_healthy
+ elasticsearch:
+ condition: service_healthy
+
init:
image: alpine/curl
# only run init if volumes were cleared
@@ -110,6 +121,8 @@ services:
condition: service_healthy
elasticsearch:
condition: service_healthy
+ init-pipeline:
+ condition: service_completed_successfully
healthcheck:
test: ['CMD-SHELL', "sh -c '[ -f /done ]'"]
interval: 5s
diff --git a/support-services/docker-entrypoint.d/02-set-default-pipeline.sh b/support-services/docker-entrypoint.d/02-set-default-pipeline.sh
new file mode 100755
index 0000000000..42108454bf
--- /dev/null
+++ b/support-services/docker-entrypoint.d/02-set-default-pipeline.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+indexConfigDir=/mnt/geonetwork_data/config/index/
+
+echo "Setting default pipeline to geonetwork-ui ..."
+jq '.settings.index.default_pipeline = "geonetwork-ui"' ${indexConfigDir}records.json > /tmp.json
+mv /tmp.json ${indexConfigDir}records.json
diff --git a/tools/README.md b/tools/README.md
index 3b22f38909..cb8f1da6fb 100644
--- a/tools/README.md
+++ b/tools/README.md
@@ -18,7 +18,7 @@ offering greater control over the values returned by ElasticSearch and giving an
A CLI is provided to let you register or clear GeoNetwork-UI-related pipelines on an ES instance. For example:
```shell
-node pipelines/regiser-es-pipelines.js register --host=http://localhost:9200 --records-index=gn-records
+node pipelines/register-es-pipelines.js register --host=http://localhost:9200 --records-index=gn-records
```
A docker image can also be built to register the pipelines automatically in a docker environment: