diff --git a/src/app/core/dspace-rest-v2/mocks/mock-response-map.ts b/src/app/core/dspace-rest-v2/mocks/mock-response-map.ts index f681d63ab7..15ec504bc8 100644 --- a/src/app/core/dspace-rest-v2/mocks/mock-response-map.ts +++ b/src/app/core/dspace-rest-v2/mocks/mock-response-map.ts @@ -1,5 +1,4 @@ import { InjectionToken } from '@angular/core'; -import mockSubmissionResponse from '../mocks/mock-submission-response.json'; export class MockResponseMap extends Map {}; diff --git a/src/app/core/dspace-rest-v2/mocks/mock-submission-response.json b/src/app/core/dspace-rest-v2/mocks/mock-submission-response.json index 398b1b9907..eca33c9587 100644 --- a/src/app/core/dspace-rest-v2/mocks/mock-submission-response.json +++ b/src/app/core/dspace-rest-v2/mocks/mock-submission-response.json @@ -5,26 +5,16 @@ { "fields": [ { - "input": { - }, - "label": "Author", - "mandatory": true, - "repeatable": true, - "mandatoryMessage": "At least one author (plain text or relationship) is required", - "hints": "Add an author", + "input": {}, + "label": "Journal", + "mandatory": false, + "repeatable": false, + "hints": "Select the journal related to this volume.", "selectableRelationship": { - "relationshipType": "isAuthorOfPublication", - "filter": null, - "searchConfiguration": "personConfiguration" + "relationshipType": "isVolumeOfJournal", + "filter": "creativework.publisher:somepublishername", + "searchConfiguration": "periodicalConfiguration" }, - "selectableMetadata": [ - { - "metadata": "dc.contributor.author", - "label": null, - "authority": null, - "closed": false - } - ], "languageCodes": [] } ] diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts index 7d051b86b2..ed192aa193 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts @@ -54,7 +54,7 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy subscription; initialPagination = Object.assign(new PaginationComponentOptions(), { id: 'submission-relation-list', - pageSize: 10 + pageSize: 5 }); selection$: Observable; itemRD$; @@ -115,7 +115,7 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy resetRoute() { this.router.navigate([], { - queryParams: Object.assign({}, { page: 1, query: this.searchQuery }), + queryParams: Object.assign({}, { page: 1, query: this.searchQuery, pageSize: this.initialPagination.pageSize }), }); } diff --git a/src/app/shared/form/builder/parsers/field-parser.ts b/src/app/shared/form/builder/parsers/field-parser.ts index 7c07af10d9..f9aa710761 100644 --- a/src/app/shared/form/builder/parsers/field-parser.ts +++ b/src/app/shared/form/builder/parsers/field-parser.ts @@ -165,7 +165,7 @@ export abstract class FieldParser { return ids; } } else { - return null; + return [this.configData.selectableRelationship.relationshipType]; } } @@ -261,7 +261,7 @@ export abstract class FieldParser { } public setAuthorityOptions(controlModel, authorityUuid) { - if (isNotEmpty(this.configData.selectableMetadata[0].authority)) { + if (isNotEmpty(this.configData.selectableMetadata) && isNotEmpty(this.configData.selectableMetadata[0].authority)) { controlModel.authorityOptions = new AuthorityOptions( this.configData.selectableMetadata[0].authority, this.configData.selectableMetadata[0].metadata, diff --git a/src/app/submission/form/collection/submission-form-collection.component.ts b/src/app/submission/form/collection/submission-form-collection.component.ts index 33384d7507..94369fed2d 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.ts +++ b/src/app/submission/form/collection/submission-form-collection.component.ts @@ -196,8 +196,7 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit { const listCollection$: Observable = this.searchService.search( new PaginatedSearchOptions({ dsoType: DSpaceObjectType.COLLECTION, - pagination: new PaginationComponentOptions(), - // scope: 'c0e4de93-f506-4990-a840-d406f6f2ada7' + pagination: new PaginationComponentOptions() }) ).pipe( getSucceededRemoteData(), @@ -210,7 +209,10 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit { id: 'c0e4de93-f506-4990-a840-d406f6f2ada7', name: 'Submission test' }], - collection: { id: collection.indexableObject.id, name: collection.indexableObject.name } + collection: { + id: collection.indexableObject.id, + name: collection.indexableObject.name + } } }) }) @@ -237,7 +239,8 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit { } else { return listCollection.filter((v) => v.collection.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1).slice(0, 5); } - })); + }) + ); } }