Skip to content

Commit

Permalink
show metadatalist of duplicate matches
Browse files Browse the repository at this point in the history
for every matching objects show the values defined in metadatalist. To improve the reason why the matching duplicates are shown only matching metadatafields are shown wich appear in the external-source object as well as in the matching object
  • Loading branch information
floriangantner committed Dec 13, 2023
1 parent 4812f18 commit e93d7cd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<div class="card p-1">
<ng-container
*ngFor="let match of object.matchObjects | slice: (pageConfig.currentPage-1) * pageConfig.pageSize : pageConfig.currentPage * pageConfig.pageSize">
<ds-themed-item-list-preview [item]="match" [object]="itemPreviewObject" [metadataList]="metadataList">
<ds-themed-item-list-preview [item]="match" [object]="itemPreviewObject" [metadataList]="filterMatchingValues(object.metadata)">
</ds-themed-item-list-preview>
<div class="offset-2">
<a class="btn btn-primary mt-1" ngbTooltip="{{'submission.workflow.generic.view-help' | translate}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ViewMode } from '../../../../../core/shared/view-mode.model';
import { Context } from '../../../../../core/shared/context.model';
import { Component, OnInit } from '@angular/core';
import { Metadata } from '../../../../../core/shared/metadata.utils';
import { MetadataValue } from '../../../../../core/shared/metadata.models';
import { MetadataMap, MetadataValue } from '../../../../../core/shared/metadata.models';
import { getItemPageRoute } from '../../../../../item-page/item-page-routing-paths';
import { DuplicateMatchMetadataDetailConfig } from '../../../../../submission/sections/detect-duplicate/models/duplicate-detail-metadata.model';
import { environment } from '../../../../../../environments/environment';
Expand Down Expand Up @@ -98,4 +98,14 @@ export class ExternalSourceEntryListSubmissionElementComponent extends AbstractL
return getItemPageRoute(item);
}
}

/**
* filter the metadata list from the configuration to the metadatafields which are present in the
* external-source entry
* @param metadatamap
*/
filterMatchingValues(metadatamap: MetadataMap): DuplicateMatchMetadataDetailConfig[] {
return this.metadataList.filter(value => metadatamap.hasOwnProperty(value.name));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ <h3 [innerHTML]="dsoTitle" [ngClass]="{'lead': true,'text-muted': !item.firstMet
</ds-truncatable-part>

<ds-additional-metadata [object]="item"></ds-additional-metadata>
<ng-container *ngFor="let entry of metadataList">
<span *ngIf="item.hasMetadata(entry.name)">
<span>{{entry.label | translate:{default: entry.label} }}: {{item.firstMetadataValue(entry.name)}}</span>
</span>
</ng-container>

</div>
</ds-truncatable>
Expand Down

0 comments on commit e93d7cd

Please sign in to comment.