diff --git a/utils/staticAutoComplete/ISVocabularies.service.ts b/utils/staticAutoComplete/ISVocabularies.service.ts index bae49d72..98581d05 100644 --- a/utils/staticAutoComplete/ISVocabularies.service.ts +++ b/utils/staticAutoComplete/ISVocabularies.service.ts @@ -50,8 +50,7 @@ export class ISVocabulariesService { } else if (field == "type" && (entity == "software" || entity == "other")) { return of([]); } else if (field == "type" && entity == "result" ) { - //return Observable.zip(this.getVocabularyFromService("dnet:publication_resource.json", properties),this.getVocabularyFromService("dnet:dataCite_resource.json", properties)); - return zip(from(this.getVocabularyFromServiceAsync("dnet:publication_resource.json", properties)),from(this.getVocabularyFromServiceAsync("dnet:dataCite_resource.json", properties))); + return zip(this.getVocabularyFromService("dnet:publication_resource.json", properties),this.getVocabularyFromService("dnet:dataCite_resource.json", properties)); } else if (field == "access" && (entity == "publication" || entity == "dataset" || entity == "software" || entity == "other" || entity == "result")) { // file= "accessMode.json"; // return this.getVocabularyFromFile(file); @@ -64,24 +63,24 @@ export class ISVocabulariesService { vocabulary = "dnet:datasource_typologies.json"; //return this.getVocabularyFromService(vocabulary, properties); return from(this.getVocabularyFromServiceAsync(vocabulary, properties)); - + } else if (field == "compatibility" && (entity == "dataprovider")) { // file = "dataProviderCompatibility.json"; // return this.getVocabularyFromFile(file); vocabulary = "dnet:datasourceCompatibilityLevel.json"; //return this.getVocabularyFromService(vocabulary, properties); return from(this.getVocabularyFromServiceAsync(vocabulary, properties)); - + } else if (field == "country") { // file = "countries.json"; // return this.getVocabularyFromFile(file); vocabulary = "dnet:countries.json"; //return this.getVocabularyFromService(vocabulary, properties); return from(this.getVocabularyFromServiceAsync(vocabulary, properties)); - + } return null; - + } async getVocabularyFromServiceAsync(vocabularyName: string, properties: EnvProperties): Promise { @@ -112,9 +111,9 @@ export class ISVocabulariesService { .pipe(map(res => res['terms'])) .pipe(map(res => this.parse(res, vocabularyName))) .pipe(catchError(this.handleError)); - + } - + parse(data: any, vocabularyName: string): AutoCompleteValue[] { var array: AutoCompleteValue[] = [] for (var i = 0; i < data.length; i++) { @@ -126,9 +125,9 @@ export class ISVocabulariesService { value.label = data[i].englishName; array.push(value); } - + return array; - + } getProvenanceActionVocabulary(properties: EnvProperties): Observable {