Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support to import from external source on Edit Item > Relationships #2373

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
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 @@
if (!!this.currentItemIsLeftItem$) {
this.currentItemIsLeftItem$.subscribe((isLeft) => {
this.isLeft = isLeft;
this.label = this.relationshipType.leftwardType;
});
}

Expand Down Expand Up @@ -201,6 +206,19 @@
).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
22 changes: 22 additions & 0 deletions src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -2690,6 +2690,8 @@

"journalissue.page.titleprefix": "Journal Issue: ",

"journalissue.search.results.head": "Journal Issue Search Results",

"journalvolume.listelement.badge": "Journal Volume",

"journalvolume.page.description": "Description",
Expand All @@ -2702,6 +2704,8 @@

"journalvolume.page.volume": "Volume",

"journalvolume.search.results.head": "Journal Volume Search Results",

"iiifsearchable.listelement.badge": "Document Media",

"iiifsearchable.page.titleprefix": "Document: ",
Expand Down Expand Up @@ -3462,10 +3466,14 @@

"relationships.isIssueOf": "Journal Issues",

"relationships.isIssueOf.JournalIssue": "Journal Issue",

"relationships.isJournalIssueOf": "Journal Issue",

"relationships.isJournalOf": "Journals",

"relationships.isJournalVolumeOf": "Journal Volume",

"relationships.isOrgUnitOf": "Organizational Units",

"relationships.isPersonOf": "Authors",
Expand All @@ -3482,6 +3490,8 @@

"relationships.isVolumeOf": "Journal Volumes",

"relationships.isVolumeOf.JournalVolume": "Journal Volume",

"relationships.isContributorOf": "Contributors",

"relationships.isContributorOf.OrgUnit": "Contributor (Organizational Unit)",
Expand Down Expand Up @@ -4182,6 +4192,16 @@

"submission.sections.describe.relationship-lookup.search-tab.tab-title.arxiv": "arXiv ({{ count }})",

"submission.sections.describe.relationship-lookup.search-tab.tab-title.orcidWorks": "ORCID ({{ count }})",

"submission.sections.describe.relationship-lookup.search-tab.tab-title.crossref": "CrossRef ({{ count }})",

"submission.sections.describe.relationship-lookup.search-tab.tab-title.scopus": "Scopus ({{ count }})",

"submission.sections.describe.relationship-lookup.search-tab.tab-title.openaireFunding": "Funding OpenAIRE ({{ count }})",

"submission.sections.describe.relationship-lookup.search-tab.tab-title.sherpaJournalIssn": "Sherpa Journals by ISSN ({{ count }})",

"submission.sections.describe.relationship-lookup.search-tab.tab-title.isFundingAgencyOfPublication": "Search for Funding Agencies",

"submission.sections.describe.relationship-lookup.search-tab.tab-title.isFundingOfPublication": "Search for Funding",
Expand All @@ -4208,6 +4228,8 @@

"submission.sections.describe.relationship-lookup.selection-tab.tab-title": "Current Selection ({{ count }})",

"submission.sections.describe.relationship-lookup.title.Journal": "Journal",

"submission.sections.describe.relationship-lookup.title.isJournalIssueOfPublication": "Journal Issues",

"submission.sections.describe.relationship-lookup.title.JournalIssue": "Journal Issues",
Expand Down
Loading