Files
dspace-angular/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.ts
Alexandre Vryghem 053063d0f4 Merge remote-tracking branch 'upstream/main' into fix-ngonchanges-not-working-for-themed-components_contribute-main
# Conflicts:
#	src/app/shared/object-list/metadata-representation-list-element/metadata-representation-list-element.component.ts
#	src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.html
#	src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts
#	src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts
#	src/app/shared/shared.module.ts
#	src/app/shared/theme-support/themed.component.ts
#	src/themes/custom/lazy-theme.module.ts
2023-05-19 13:36:41 +02:00

30 lines
1.6 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';
//@metadataRepresentationComponent('Publication', MetadataRepresentationType.PlainText)
// For now, authority controlled fields are rendered the same way as plain text fields
//@metadataRepresentationComponent('Publication', MetadataRepresentationType.AuthorityControlled)
@metadataRepresentationComponent('Publication', MetadataRepresentationType.BrowseLink)
@Component({
selector: 'ds-browse-link-metadata-list-element',
templateUrl: './browse-link-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 BrowseLinkMetadataListElementComponent 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.metadataBrowse) {
return {value: this.mdRepresentation.getValue()};
}
return queryParams;
}
}