Merge pull request #3098 from alexandrevryghem/w2p-115434_byLabel-related-entity-type_contribute-main

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-07 15:09:32 -05:00
committed by GitHub

View File

@@ -43,6 +43,7 @@ import {
AppConfig, AppConfig,
} from '../../../../../config/app-config.interface'; } from '../../../../../config/app-config.interface';
import { LinkService } from '../../../../core/cache/builders/link.service'; import { LinkService } from '../../../../core/cache/builders/link.service';
import { RequestParam } from '../../../../core/cache/models/request-param.model';
import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model'; import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model';
import { FieldUpdate } from '../../../../core/data/object-updates/field-update.model'; import { FieldUpdate } from '../../../../core/data/object-updates/field-update.model';
import { FieldUpdates } from '../../../../core/data/object-updates/field-updates.model'; import { FieldUpdates } from '../../../../core/data/object-updates/field-updates.model';
@@ -494,15 +495,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,