Skip to content

Commit

Permalink
Merge pull request DSpace#3107 from tdonohue/port_3098_to_7x
Browse files Browse the repository at this point in the history
[Port dspace-7_x] Fixed item edit relationships with same type name but different entities all being shown under same label
  • Loading branch information
tdonohue authored Jun 10, 2024
2 parents 0d3db9f + 31ab05f commit 2d28dfc
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import { FieldChangeType } from '../../../../core/data/object-updates/field-chan
import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface';
import { itemLinksToFollow } from '../../../../shared/utils/relation-query.utils';
import { EditItemRelationshipsService } from '../edit-item-relationships.service';
import { RequestParam } from '../../../../core/cache/models/request-param.model';

@Component({
selector: 'ds-edit-relationship-list',
Expand Down Expand Up @@ -464,15 +465,19 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy {
observableCombineLatest([
currentPagination$,
this.currentItemIsLeftItem$,
this.relatedEntityType$,
]).pipe(
switchMap(([currentPagination, currentItemIsLeftItem]: [PaginationComponentOptions, boolean]) => {
// get the relationships for the current item, relationshiptype and page
switchMap(([currentPagination, currentItemIsLeftItem, relatedEntityType]: [PaginationComponentOptions, boolean, ItemType]) => {
// get the relationships for the current page, item, relationship type and related entity type
return this.relationshipService.getItemRelationshipsByLabel(
this.item,
currentItemIsLeftItem ? this.relationshipType.leftwardType : this.relationshipType.rightwardType,
{
elementsPerPage: currentPagination.pageSize,
currentPage: currentPagination.currentPage
currentPage: currentPagination.currentPage,
searchParams: [
new RequestParam('relatedEntityType', relatedEntityType.label),
],
},
true,
true,
Expand Down

0 comments on commit 2d28dfc

Please sign in to comment.