Customise item-metadata-list-element.component in DSpace 10

19 views
Skip to first unread message

Gary Hsu

unread,
Sep 8, 2026, 3:38:45 AM (12 days ago) Sep 8
to DSpace Technical Support
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.

I follow the example from the project component described in this post: https://github.com/DSpace/dspace-angular/pull/2277
 
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: 






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)
select a lab.png


After refreshing (service provider)
page refresh.png
Reply all
Reply to author
Forward
0 new messages