mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 20:43:08 +00:00
101623: Fixes after merge
This commit is contained in:
@@ -3,6 +3,7 @@ import { MetadataValue } from '../../../core/shared/metadata.models';
|
||||
import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface';
|
||||
import { BrowseDefinition } from '../../../core/shared/browse-definition.model';
|
||||
import { hasValue } from '../../../shared/empty.util';
|
||||
import { VALUE_LIST_BROWSE_DEFINITION } from '../../../core/shared/value-list-browse-definition.resource-type';
|
||||
|
||||
/**
|
||||
* This component renders the configured 'values' into the ds-metadata-field-wrapper component.
|
||||
@@ -84,7 +85,7 @@ export class MetadataValuesComponent implements OnChanges {
|
||||
*/
|
||||
getQueryParams(value) {
|
||||
let queryParams = {startsWith: value};
|
||||
if (this.browseDefinition.metadataBrowse) {
|
||||
if (this.browseDefinition.getRenderType() === VALUE_LIST_BROWSE_DEFINITION.value) {
|
||||
return {value: value};
|
||||
}
|
||||
return queryParams;
|
||||
|
@@ -2,6 +2,7 @@ import { MetadataRepresentationType } from '../../../../core/shared/metadata-rep
|
||||
import { Component } from '@angular/core';
|
||||
import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component';
|
||||
import { metadataRepresentationComponent } from '../../../metadata-representation/metadata-representation.decorator';
|
||||
import { VALUE_LIST_BROWSE_DEFINITION } from '../../../../core/shared/value-list-browse-definition.resource-type';
|
||||
//@metadataRepresentationComponent('Publication', MetadataRepresentationType.PlainText)
|
||||
// For now, authority controlled fields are rendered the same way as plain text fields
|
||||
//@metadataRepresentationComponent('Publication', MetadataRepresentationType.AuthorityControlled)
|
||||
@@ -21,7 +22,7 @@ export class BrowseLinkMetadataListElementComponent extends MetadataRepresentati
|
||||
*/
|
||||
getQueryParams() {
|
||||
let queryParams = {startsWith: this.metadataRepresentation.getValue()};
|
||||
if (this.metadataRepresentation.browseDefinition.metadataBrowse) {
|
||||
if (this.metadataRepresentation.browseDefinition.getRenderType() === VALUE_LIST_BROWSE_DEFINITION.value) {
|
||||
return {value: this.metadataRepresentation.getValue()};
|
||||
}
|
||||
return queryParams;
|
||||
|
@@ -2,6 +2,7 @@ import { MetadataRepresentationType } from '../../../../core/shared/metadata-rep
|
||||
import { Component } from '@angular/core';
|
||||
import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component';
|
||||
import { metadataRepresentationComponent } from '../../../metadata-representation/metadata-representation.decorator';
|
||||
import { VALUE_LIST_BROWSE_DEFINITION } from '../../../../core/shared/value-list-browse-definition.resource-type';
|
||||
|
||||
@metadataRepresentationComponent('Publication', MetadataRepresentationType.PlainText)
|
||||
// For now, authority controlled fields are rendered the same way as plain text fields
|
||||
@@ -21,7 +22,7 @@ export class PlainTextMetadataListElementComponent extends MetadataRepresentatio
|
||||
*/
|
||||
getQueryParams() {
|
||||
let queryParams = {startsWith: this.metadataRepresentation.getValue()};
|
||||
if (this.metadataRepresentation.browseDefinition.metadataBrowse) {
|
||||
if (this.metadataRepresentation.browseDefinition.getRenderType() === VALUE_LIST_BROWSE_DEFINITION.value) {
|
||||
return {value: this.metadataRepresentation.getValue()};
|
||||
}
|
||||
return queryParams;
|
||||
|
@@ -5,12 +5,14 @@ import { BrowseDefinition } from '../../core/shared/browse-definition.model';
|
||||
import { BrowseService } from '../../core/browse/browse.service';
|
||||
import { createSuccessfulRemoteDataObject } from '../remote-data.utils';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { FlatBrowseDefinition } from '../../core/shared/flat-browse-definition.model';
|
||||
import { ValueListBrowseDefinition } from '../../core/shared/value-list-browse-definition.model';
|
||||
|
||||
// This data is in post-serialized form (metadata -> metadataKeys)
|
||||
export const mockData: BrowseDefinition[] = [
|
||||
Object.assign(new BrowseDefinition, {
|
||||
Object.assign(new FlatBrowseDefinition(), {
|
||||
'id' : 'dateissued',
|
||||
'metadataBrowse' : false,
|
||||
'browseType': 'flatBrowse',
|
||||
'dataType' : 'date',
|
||||
'sortOptions' : EMPTY,
|
||||
'order' : 'ASC',
|
||||
@@ -18,9 +20,9 @@ export const mockData: BrowseDefinition[] = [
|
||||
'metadataKeys' : [ 'dc.date.issued' ],
|
||||
'_links' : EMPTY
|
||||
}),
|
||||
Object.assign(new BrowseDefinition, {
|
||||
Object.assign(new ValueListBrowseDefinition(), {
|
||||
'id' : 'author',
|
||||
'metadataBrowse' : true,
|
||||
'browseType' : 'valueList',
|
||||
'dataType' : 'text',
|
||||
'sortOptions' : EMPTY,
|
||||
'order' : 'ASC',
|
||||
|
Reference in New Issue
Block a user