Skip to content

Commit 1d0df84

Browse files
committed
101623: Fixes after merge
1 parent fad1a7a commit 1d0df84

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

src/app/item-page/field-components/metadata-values/metadata-values.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { MetadataValue } from '../../../core/shared/metadata.models';
33
import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface';
44
import { BrowseDefinition } from '../../../core/shared/browse-definition.model';
55
import { hasValue } from '../../../shared/empty.util';
6+
import { VALUE_LIST_BROWSE_DEFINITION } from '../../../core/shared/value-list-browse-definition.resource-type';
67

78
/**
89
* This component renders the configured 'values' into the ds-metadata-field-wrapper component.
@@ -84,7 +85,7 @@ export class MetadataValuesComponent implements OnChanges {
8485
*/
8586
getQueryParams(value) {
8687
let queryParams = {startsWith: value};
87-
if (this.browseDefinition.metadataBrowse) {
88+
if (this.browseDefinition.getRenderType() === VALUE_LIST_BROWSE_DEFINITION.value) {
8889
return {value: value};
8990
}
9091
return queryParams;

src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { MetadataRepresentationType } from '../../../../core/shared/metadata-rep
22
import { Component } from '@angular/core';
33
import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component';
44
import { metadataRepresentationComponent } from '../../../metadata-representation/metadata-representation.decorator';
5+
import { VALUE_LIST_BROWSE_DEFINITION } from '../../../../core/shared/value-list-browse-definition.resource-type';
56
//@metadataRepresentationComponent('Publication', MetadataRepresentationType.PlainText)
67
// For now, authority controlled fields are rendered the same way as plain text fields
78
//@metadataRepresentationComponent('Publication', MetadataRepresentationType.AuthorityControlled)
@@ -21,7 +22,7 @@ export class BrowseLinkMetadataListElementComponent extends MetadataRepresentati
2122
*/
2223
getQueryParams() {
2324
let queryParams = {startsWith: this.metadataRepresentation.getValue()};
24-
if (this.metadataRepresentation.browseDefinition.metadataBrowse) {
25+
if (this.metadataRepresentation.browseDefinition.getRenderType() === VALUE_LIST_BROWSE_DEFINITION.value) {
2526
return {value: this.metadataRepresentation.getValue()};
2627
}
2728
return queryParams;

src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { MetadataRepresentationType } from '../../../../core/shared/metadata-rep
22
import { Component } from '@angular/core';
33
import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component';
44
import { metadataRepresentationComponent } from '../../../metadata-representation/metadata-representation.decorator';
5+
import { VALUE_LIST_BROWSE_DEFINITION } from '../../../../core/shared/value-list-browse-definition.resource-type';
56

67
@metadataRepresentationComponent('Publication', MetadataRepresentationType.PlainText)
78
// For now, authority controlled fields are rendered the same way as plain text fields
@@ -21,7 +22,7 @@ export class PlainTextMetadataListElementComponent extends MetadataRepresentatio
2122
*/
2223
getQueryParams() {
2324
let queryParams = {startsWith: this.metadataRepresentation.getValue()};
24-
if (this.metadataRepresentation.browseDefinition.metadataBrowse) {
25+
if (this.metadataRepresentation.browseDefinition.getRenderType() === VALUE_LIST_BROWSE_DEFINITION.value) {
2526
return {value: this.metadataRepresentation.getValue()};
2627
}
2728
return queryParams;

src/app/shared/testing/browse-definition-data-service.stub.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,24 @@ import { BrowseDefinition } from '../../core/shared/browse-definition.model';
55
import { BrowseService } from '../../core/browse/browse.service';
66
import { createSuccessfulRemoteDataObject } from '../remote-data.utils';
77
import { PageInfo } from '../../core/shared/page-info.model';
8+
import { FlatBrowseDefinition } from '../../core/shared/flat-browse-definition.model';
9+
import { ValueListBrowseDefinition } from '../../core/shared/value-list-browse-definition.model';
810

911
// This data is in post-serialized form (metadata -> metadataKeys)
1012
export const mockData: BrowseDefinition[] = [
11-
Object.assign(new BrowseDefinition, {
13+
Object.assign(new FlatBrowseDefinition(), {
1214
'id' : 'dateissued',
13-
'metadataBrowse' : false,
15+
'browseType': 'flatBrowse',
1416
'dataType' : 'date',
1517
'sortOptions' : EMPTY,
1618
'order' : 'ASC',
1719
'type' : 'browse',
1820
'metadataKeys' : [ 'dc.date.issued' ],
1921
'_links' : EMPTY
2022
}),
21-
Object.assign(new BrowseDefinition, {
23+
Object.assign(new ValueListBrowseDefinition(), {
2224
'id' : 'author',
23-
'metadataBrowse' : true,
25+
'browseType' : 'valueList',
2426
'dataType' : 'text',
2527
'sortOptions' : EMPTY,
2628
'order' : 'ASC',

0 commit comments

Comments
 (0)