mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00

Conflicts: src/app/browse-by/browse-by-guard.spec.ts src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.ts src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts
31 lines
1.7 KiB
TypeScript
31 lines
1.7 KiB
TypeScript
import { MetadataRepresentationType } from '../../../../core/shared/metadata-representation/metadata-representation.model';
|
|
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)
|
|
@Component({
|
|
selector: 'ds-plain-text-metadata-list-element',
|
|
templateUrl: './plain-text-metadata-list-element.component.html'
|
|
})
|
|
/**
|
|
* A component for displaying MetadataRepresentation objects in the form of plain text
|
|
* It will simply use the value retrieved from MetadataRepresentation.getValue() to display as plain text
|
|
*/
|
|
export class PlainTextMetadataListElementComponent extends MetadataRepresentationListElementComponent {
|
|
/**
|
|
* Get the appropriate query parameters for this browse link, depending on whether the browse definition
|
|
* expects 'startsWith' (eg browse by date) or 'value' (eg browse by title)
|
|
*/
|
|
getQueryParams() {
|
|
let queryParams = {startsWith: this.mdRepresentation.getValue()};
|
|
if (this.mdRepresentation.browseDefinition.getRenderType() === VALUE_LIST_BROWSE_DEFINITION.value) {
|
|
return {value: this.mdRepresentation.getValue()};
|
|
}
|
|
return queryParams;
|
|
}
|
|
}
|