[CST-4504] Fixed issue for submission, removed tab when editing relationships, removed unused code & improved checking for remote data completed

This commit is contained in:
Rezart Vata
2021-09-22 17:01:24 +02:00
parent f1135d8a96
commit 681ab1ff88
4 changed files with 7 additions and 31 deletions

View File

@@ -276,32 +276,6 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy {
});
this.selectableListService.deselectAll(this.listId);
this.updates$.pipe(
switchMap((updates) =>
Object.values(updates).length > 0 ?
observableCombineLatest(
Object.values(updates)
.filter((update) => update.changeType !== FieldChangeType.REMOVE)
.map((update) => {
const field = update.field as RelationshipIdentifiable;
if (field.relationship) {
return this.getRelatedItem(field.relationship);
} else {
return observableOf(field.relatedItem);
}
})
) : observableOf([])
),
take(1),
map((items) => items.map((item) => {
const searchResult = new ItemSearchResult();
searchResult.indexableObject = item;
searchResult.hitHighlights = {};
return searchResult;
})),
).subscribe((items) => {
// this.selectableListService.select(this.listId, items);
});
}
/**

View File

@@ -44,7 +44,7 @@
</ds-dynamic-lookup-relation-external-source-tab>
</ng-template>
</ngb-tab>
<ngb-tab [disabled]="isEditRelationship" [title]="'submission.sections.describe.relationship-lookup.selection-tab.tab-title' | translate : {count: (selection$ | async)?.length}">
<ngb-tab *ngIf="!isEditRelationship" [title]="'submission.sections.describe.relationship-lookup.selection-tab.tab-title' | translate : {count: (selection$ | async)?.length}">
<ng-template ngbTabContent>
<ds-dynamic-lookup-relation-selection-tab
[selection$]="selection$"

View File

@@ -154,9 +154,11 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy
ngOnInit(): void {
this.currentItemIsLeftItem$.subscribe((isLeft) => {
this.isLeft = isLeft;
});
if(!!this.currentItemIsLeftItem$){
this.currentItemIsLeftItem$.subscribe((isLeft) => {
this.isLeft = isLeft;
});
}
this.selection$ = this.selectableListService

View File

@@ -167,7 +167,7 @@ export class DsDynamicLookupRelationSearchTabComponent implements OnInit, OnDest
switchMap((options) => this.lookupRelationService.getLocalResults(this.relationship, options).pipe(
startWith(undefined),
tap( res => {
if ( !!res && res.state === 'Success' && this.isEditRelationship ) {
if ( !!res && res.hasSucceeded && this.isEditRelationship ) {
const idOfItems = res.payload.page.map( itemSearchResult => {
return itemSearchResult.indexableObject.uuid;
});