Merge pull request #3034 from tdonohue/port_2954_to_7x

[Port dspace-7_x] Live import preview should show all metadata values, not only the first one
This commit is contained in:
Tim Donohue
2024-05-10 13:43:53 -05:00
committed by GitHub
3 changed files with 9 additions and 7 deletions

View File

@@ -18,10 +18,12 @@
</div>
</div>
<div *ngFor="let metadata of metadataList" class="row">
<div class="col-md-12">
<strong>{{'item.preview.' + metadata.key | translate}}</strong>
<p>{{metadata.value.value}}</p>
</div>
<p class="col-md-12">
<strong class="">{{'item.preview.' + metadata.key | translate}}</strong><br>
<ng-container *ngFor="let metadatum of metadata.values">
<span>{{metadatum.value}}</span><br>
</ng-container>
</p>
</div>
<div class="row">
<div class="col-md-12">

View File

@@ -105,7 +105,7 @@ describe('SubmissionImportExternalPreviewComponent test suite', () => {
it('Should init component properly', () => {
comp.externalSourceEntry = externalEntry;
const expected = [
{ key: 'dc.identifier.uri', value: Metadata.first(comp.externalSourceEntry.metadata, 'dc.identifier.uri') }
{ key: 'dc.identifier.uri', values: Metadata.all(comp.externalSourceEntry.metadata, 'dc.identifier.uri') },
];
fixture.detectChanges();

View File

@@ -27,7 +27,7 @@ export class SubmissionImportExternalPreviewComponent implements OnInit {
/**
* The entry metadata list
*/
public metadataList: { key: string, value: MetadataValue }[];
public metadataList: { key: string, values: MetadataValue[] }[];
/**
* The label prefix to use to generate the translation label
*/
@@ -62,7 +62,7 @@ export class SubmissionImportExternalPreviewComponent implements OnInit {
metadataKeys.forEach((key) => {
this.metadataList.push({
key: key,
value: Metadata.first(this.externalSourceEntry.metadata, key)
values: Metadata.all(this.externalSourceEntry.metadata, key)
});
});
}