Dear DSpace community members,
I have tried to create my own item-metadata-list-element component, which allows me to add the item to a submission form through the relationship.
The example is however based on DSpace 7 and the metadata decorator (@metadataRepresentationComponent) does not work anymore. I design my own component in the following files:
src/themes/fairlab/app/entity-groups/research-entities/metadata-representations/laboratory/laboratory-item-metadata-list-element.component.ts
import { Component } from '@angular/core';
import { RouterLink } from '@angular/router';
import { DSONameService } from '@dspace/core/breadcrumbs/dso-name.service';
import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap';
import { ItemMetadataRepresentationListElementComponent } from '../../../../../../../app/shared/object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component';
import { TruncatableComponent } from '../../../../../../../app/shared/truncatable/truncatable.component';
@Component({
selector: 'ds-laboratory-item-metadata-list-element',
templateUrl: './laboratory-item-metadata-list-element.component.html',
imports: [
NgbTooltip,
RouterLink,
TruncatableComponent,
],
})
/**
* The component for displaying an item of the type Laboratory
* as a metadata field.
*/
export class LaboratoryItemMetadataListElementComponent
extends ItemMetadataRepresentationListElementComponent {
constructor(
public dsoNameService: DSONameService,
) {
super();
}
}
The component is registered in lazy-listable-components.ts
import { LaboratoryItemMetadataListElementComponent } from
'./app/entity-groups/research-entities/metadata-representations/laboratory/laboratory-item-metadata-list-element.component';
export const LISTABLE_COMPONENTS = [
// existing entries...
LaboratoryItemMetadataListElementComponent,
];
I then encoutered several issues.
Firstly, in the submission form, I searched the existing items and added the the submission form. However, the display of metadata did not appear until I refresh the page (attached images 1 and 2).
Secondly, after clicking the delete icon, the following errors showed up:
data-services-map.ts:122 ERROR Error: The @link() for rightItem on Relationship models uses the resource type ITEM, but there is no service with an @dataService(ITEM) annotation in order to retrieve it
at link.service.ts:97:17
has anyone tried to create this component for DSpace 10 and might help me with this issue?
Best regards,
Gary
Add an item but no metadata shows up (service provider)
After refreshing (service provider)