From 7e47b303405128bdaf5c00b505acfed4ad3318a7 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Fri, 14 Jan 2022 10:24:21 +0100 Subject: [PATCH] - correct sorting for solr results - correct authors in dataset citation --- src/router/index.ts | 6 ++++++ src/services/dataset.service.ts | 1 + .../dataset-detail.component.ts | 11 ++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/router/index.ts b/src/router/index.ts index e0c2144..24320b9 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -33,6 +33,12 @@ const routes = [ component: DatasetDetailComponent, props: true, }, + // { + // path: "/10.24341/tethys.:datasetId", + // name: "dataset2", + // component: DatasetDetailComponent, + // props: true, + // }, { path: "/services", name: "Services", diff --git a/src/services/dataset.service.ts b/src/services/dataset.service.ts index b1a10e4..45ab5a4 100644 --- a/src/services/dataset.service.ts +++ b/src/services/dataset.service.ts @@ -128,6 +128,7 @@ class DatasetService { // fq: ["subject:Steiermark", "language:de"], fq: filterFields, start: start, + sort: "server_date_published desc", facet: "on", // "facet.field": "language", "json.facet.language": '{ type: "terms", field: "language" }', diff --git a/src/views/dataset-detail.component.ts/dataset-detail.component.ts b/src/views/dataset-detail.component.ts/dataset-detail.component.ts index 8dcfd0d..44062e2 100644 --- a/src/views/dataset-detail.component.ts/dataset-detail.component.ts +++ b/src/views/dataset-detail.component.ts/dataset-detail.component.ts @@ -106,7 +106,16 @@ export default class DatasetDetailComponent extends Vue { } public getCitation(): string { - let citation = this.dataset.contributors.map((u) => u.last_name + ", " + u.first_name.substring(0, 1).toUpperCase() + ".").join(", "); + let citation = this.dataset.authors + .map((u) => { + let name = u.last_name; + if (u.first_name) { + name += ", " + u.first_name?.substring(0, 1).toUpperCase() + "."; + } + return name; + // u.last_name + ", " + u.first_name?.substring(0, 1).toUpperCase() + "." + }) + .join(", "); citation += " " + moment(this.dataset.server_date_published).format("YYYY") + ": "; citation += this.dataset.MainTitle?.value; citation += "." + this.dataset.creating_corporation + ", ";