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 { InjectionToken } from '@angular/core';
import mockSubmissionResponse from '../mocks/mock-submission-response.json';
export class MockResponseMap extends Map<string, any> {}; export class MockResponseMap extends Map<string, any> {};

View File

@@ -5,26 +5,16 @@
{ {
"fields": [ "fields": [
{ {
"input": { "input": {},
}, "label": "Journal",
"label": "Author", "mandatory": false,
"mandatory": true, "repeatable": false,
"repeatable": true, "hints": "Select the journal related to this volume.",
"mandatoryMessage": "At least one author (plain text or relationship) is required",
"hints": "Add an author",
"selectableRelationship": { "selectableRelationship": {
"relationshipType": "isAuthorOfPublication", "relationshipType": "isVolumeOfJournal",
"filter": null, "filter": "creativework.publisher:somepublishername",
"searchConfiguration": "personConfiguration" "searchConfiguration": "periodicalConfiguration"
}, },
"selectableMetadata": [
{
"metadata": "dc.contributor.author",
"label": null,
"authority": null,
"closed": false
}
],
"languageCodes": [] "languageCodes": []
} }
] ]

View File

@@ -54,7 +54,7 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy
subscription; subscription;
initialPagination = Object.assign(new PaginationComponentOptions(), { initialPagination = Object.assign(new PaginationComponentOptions(), {
id: 'submission-relation-list', id: 'submission-relation-list',
pageSize: 10 pageSize: 5
}); });
selection$: Observable<ListableObject[]>; selection$: Observable<ListableObject[]>;
itemRD$; itemRD$;
@@ -115,7 +115,7 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy
resetRoute() { resetRoute() {
this.router.navigate([], { 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; return ids;
} }
} else { } else {
return null; return [this.configData.selectableRelationship.relationshipType];
} }
} }
@@ -261,7 +261,7 @@ export abstract class FieldParser {
} }
public setAuthorityOptions(controlModel, authorityUuid) { 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( controlModel.authorityOptions = new AuthorityOptions(
this.configData.selectableMetadata[0].authority, this.configData.selectableMetadata[0].authority,
this.configData.selectableMetadata[0].metadata, this.configData.selectableMetadata[0].metadata,

View File

@@ -196,8 +196,7 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit {
const listCollection$: Observable<CollectionListEntry[]> = this.searchService.search( const listCollection$: Observable<CollectionListEntry[]> = this.searchService.search(
new PaginatedSearchOptions({ new PaginatedSearchOptions({
dsoType: DSpaceObjectType.COLLECTION, dsoType: DSpaceObjectType.COLLECTION,
pagination: new PaginationComponentOptions(), pagination: new PaginationComponentOptions()
// scope: 'c0e4de93-f506-4990-a840-d406f6f2ada7'
}) })
).pipe( ).pipe(
getSucceededRemoteData(), getSucceededRemoteData(),
@@ -210,7 +209,10 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit {
id: 'c0e4de93-f506-4990-a840-d406f6f2ada7', id: 'c0e4de93-f506-4990-a840-d406f6f2ada7',
name: 'Submission test' 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 { } else {
return listCollection.filter((v) => v.collection.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1).slice(0, 5); return listCollection.filter((v) => v.collection.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1).slice(0, 5);
} }
})); })
);
} }
} }