From 1d98b8c29f42d9511ca12520ecfdfa8157372614 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Thu, 11 Jul 2019 13:59:23 +0200 Subject: [PATCH] 62063: Browse config refactoring property metadata to id --- config/environment.default.js | 10 +++++----- .../browse-by-date-page.component.ts | 8 ++++---- .../browse-by-metadata-page.component.html | 2 +- .../browse-by-metadata-page.component.ts | 14 +++++++------- .../browse-by-switcher.component.spec.ts | 10 +++++----- .../browse-by-switcher.component.ts | 4 ++-- .../browse-by-title-page.component.ts | 4 ++-- src/app/+browse-by/browse-by-guard.spec.ts | 16 ++++++++-------- src/app/+browse-by/browse-by-guard.ts | 16 ++++++++-------- src/app/+browse-by/browse-by-routing.module.ts | 2 +- src/app/navbar/navbar.component.ts | 6 +++--- .../comcol-page-browse-by.component.html | 2 +- src/config/browse-by-type-config.interface.ts | 2 +- 13 files changed, 48 insertions(+), 48 deletions(-) diff --git a/config/environment.default.js b/config/environment.default.js index 5f60335652..84fd7405e2 100644 --- a/config/environment.default.js +++ b/config/environment.default.js @@ -153,25 +153,25 @@ module.exports = { // List of all the active Browse-By types // Adding a type will activate their Browse-By page and add them to the global navigation menu, as well as community and collection pages // Allowed fields and their purpose: - // metadata: The browse id to use for fetching info from the rest api + // id: The browse id to use for fetching info from the rest api // type: The type of Browse-By page to display // metadataField: The metadata-field used to create starts-with options (only necessary when the type is set to 'date') types: [ { - metadata: 'title', + id: 'title', type: 'title' }, { - metadata: 'dateissued', + id: 'dateissued', type: 'date', metadataField: 'dc.date.issued' }, { - metadata: 'author', + id: 'author', type: 'metadata' }, { - metadata: 'subject', + id: 'subject', type: 'metadata' } ] diff --git a/src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.ts b/src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.ts index ab22216afa..98d0cc9cd1 100644 --- a/src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.ts +++ b/src/app/+browse-by/+browse-by-date-page/browse-by-date-page.component.ts @@ -22,7 +22,7 @@ import { BrowseByType, rendersBrowseBy } from '../+browse-by-switcher/browse-by- }) /** * Component for browsing items by metadata definition of type 'date' - * A metadata definition is a short term used to describe one or multiple metadata fields. + * A metadata definition (a.k.a. browse id) is a short term used to describe one or multiple metadata fields. * An example would be 'dateissued' for 'dc.date.issued' */ @rendersBrowseBy(BrowseByType.Date) @@ -55,12 +55,12 @@ export class BrowseByDatePageComponent extends BrowseByMetadataPageComponent { }) .subscribe((params) => { const metadataField = params.metadataField || this.defaultMetadataField; - this.metadata = params.metadata || this.defaultMetadata; + this.browseId = params.id || this.defaultBrowseId; this.startsWith = +params.startsWith || params.startsWith; - const searchOptions = browseParamsToOptions(params, Object.assign({}), this.sortConfig, this.metadata); + const searchOptions = browseParamsToOptions(params, Object.assign({}), this.sortConfig, this.browseId); this.updatePageWithItems(searchOptions, this.value); this.updateParent(params.scope); - this.updateStartsWithOptions(this.metadata, metadataField, params.scope); + this.updateStartsWithOptions(this.browseId, metadataField, params.scope); })); } diff --git a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.html b/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.html index cf43f74eb0..c589c543d4 100644 --- a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.html +++ b/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.html @@ -1,7 +1,7 @@