fixed server configuration read issues

This commit is contained in:
lotte
2019-08-27 16:08:27 +02:00
parent 56c93ff27e
commit fc6f5fd331
5 changed files with 19 additions and 27 deletions

View File

@@ -1,5 +1,4 @@
import { InjectionToken } from '@angular/core';
import mockSubmissionResponse from '../mocks/mock-submission-response.json';
export class MockResponseMap extends Map<string, any> {};

View File

@@ -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": []
}
]

View File

@@ -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<ListableObject[]>;
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 }),
});
}

View File

@@ -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,

View File

@@ -196,8 +196,7 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit {
const listCollection$: Observable<CollectionListEntry[]> = 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);
}
}));
})
);
}
}