Merge pull request #3107 from tdonohue/port_3098_to_7x

[Port dspace-7_x] Fixed item edit relationships with same type name but different entities all being shown under same label
This commit is contained in:
Tim Donohue
2024-06-10 09:32:40 -05:00
committed by GitHub

View File

@@ -64,6 +64,7 @@ import { FieldChangeType } from '../../../../core/data/object-updates/field-chan
import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface'; import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface';
import { itemLinksToFollow } from '../../../../shared/utils/relation-query.utils'; import { itemLinksToFollow } from '../../../../shared/utils/relation-query.utils';
import { EditItemRelationshipsService } from '../edit-item-relationships.service'; import { EditItemRelationshipsService } from '../edit-item-relationships.service';
import { RequestParam } from '../../../../core/cache/models/request-param.model';
@Component({ @Component({
selector: 'ds-edit-relationship-list', selector: 'ds-edit-relationship-list',
@@ -464,15 +465,19 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy {
observableCombineLatest([ observableCombineLatest([
currentPagination$, currentPagination$,
this.currentItemIsLeftItem$, this.currentItemIsLeftItem$,
this.relatedEntityType$,
]).pipe( ]).pipe(
switchMap(([currentPagination, currentItemIsLeftItem]: [PaginationComponentOptions, boolean]) => { switchMap(([currentPagination, currentItemIsLeftItem, relatedEntityType]: [PaginationComponentOptions, boolean, ItemType]) => {
// get the relationships for the current item, relationshiptype and page // get the relationships for the current page, item, relationship type and related entity type
return this.relationshipService.getItemRelationshipsByLabel( return this.relationshipService.getItemRelationshipsByLabel(
this.item, this.item,
currentItemIsLeftItem ? this.relationshipType.leftwardType : this.relationshipType.rightwardType, currentItemIsLeftItem ? this.relationshipType.leftwardType : this.relationshipType.rightwardType,
{ {
elementsPerPage: currentPagination.pageSize, elementsPerPage: currentPagination.pageSize,
currentPage: currentPagination.currentPage currentPage: currentPagination.currentPage,
searchParams: [
new RequestParam('relatedEntityType', relatedEntityType.label),
],
}, },
true, true,
true, true,