Skip to content

Commit

Permalink
Merge remote-tracking branch 'contributions/w2p-102415_Remote-lookup-…
Browse files Browse the repository at this point in the history
…entity-on-admin-edit_contribute-7.4' into dspace-7.6
  • Loading branch information
alexandrevryghem committed Jul 18, 2023
2 parents 404ccd9 + 155cd2b commit 776a44c
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ import { RemoteDataBuildService } from '../../../../../core/cache/builders/remot
import { getAllSucceededRemoteDataPayload } from '../../../../../core/shared/operators';
import { followLink } from '../../../../utils/follow-link-config.model';
import { RelationshipType } from '../../../../../core/shared/item-relationships/relationship-type.model';
import { FindListOptions } from '../../../../../core/data/find-list-options.model';
import { RequestParam } from '../../../../../core/cache/models/request-param.model';
import { getFirstSucceededRemoteDataPayload } from '../../../../../core/shared/operators';
import { PaginatedList } from '../../../../../core/data/paginated-list.model';

@Component({
selector: 'ds-dynamic-lookup-relation-modal',
Expand Down Expand Up @@ -173,6 +177,7 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy
if (!!this.currentItemIsLeftItem$) {
this.currentItemIsLeftItem$.subscribe((isLeft) => {
this.isLeft = isLeft;
this.label = this.relationshipType.leftwardType;
});
}

Expand Down Expand Up @@ -201,6 +206,19 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy
).pipe(
getAllSucceededRemoteDataPayload()
);
} else {
const findListOptions = Object.assign({}, new FindListOptions(), {

Check warning on line 210 in src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts

View check run for this annotation

Codecov / codecov/patch

src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts#L210

Added line #L210 was not covered by tests
elementsPerPage: 5,
currentPage: 1,
searchParams: [
new RequestParam('entityType', this.relationshipOptions.relationshipType)
]
});
this.externalSourcesRD$ = this.externalSourceService.searchBy('findByEntityType', findListOptions,

Check warning on line 217 in src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts

View check run for this annotation

Codecov / codecov/patch

src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts#L217

Added line #L217 was not covered by tests
true, true, followLink('entityTypes'))
.pipe(getFirstSucceededRemoteDataPayload(), map((r: PaginatedList<ExternalSource>) => {
return r.page;

Check warning on line 220 in src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts

View check run for this annotation

Codecov / codecov/patch

src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts#L220

Added line #L220 was not covered by tests
}));
}

this.setTotals();
Expand Down

0 comments on commit 776a44c

Please sign in to comment.