Merge pull request #2954 from atmire/w2p-104686_Live-import-preview-only-shows-first-mdv-7.6

Live import preview should show all metadata values, not only the first one
This commit is contained in:
Tim Donohue
2024-05-10 12:28:30 -05:00
committed by GitHub
3 changed files with 9 additions and 7 deletions

View File

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

View File

@@ -113,7 +113,7 @@ describe('SubmissionImportExternalPreviewComponent test suite', () => {
it('Should init component properly', () => { it('Should init component properly', () => {
comp.externalSourceEntry = externalEntry; comp.externalSourceEntry = externalEntry;
const expected = [ 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(); fixture.detectChanges();

View File

@@ -43,7 +43,7 @@ export class SubmissionImportExternalPreviewComponent implements OnInit {
/** /**
* The entry metadata list * 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 * The label prefix to use to generate the translation label
*/ */
@@ -78,7 +78,7 @@ export class SubmissionImportExternalPreviewComponent implements OnInit {
metadataKeys.forEach((key) => { metadataKeys.forEach((key) => {
this.metadataList.push({ this.metadataList.push({
key: key, key: key,
value: Metadata.first(this.externalSourceEntry.metadata, key), values: Metadata.all(this.externalSourceEntry.metadata, key),
}); });
}); });
} }