Merge from master and ignore results landing changes

This commit is contained in:
Konstantinos Triantafyllou 2022-04-06 12:58:22 +03:00
commit e2f1cc4957
1 changed files with 15 additions and 11 deletions

View File

@ -125,14 +125,14 @@ export class ISVocabulariesService {
getLocalVocabularyFromService(vocabularyName: string, properties: EnvProperties): Observable<AutoCompleteValue[]> { getLocalVocabularyFromService(vocabularyName: string, properties: EnvProperties): Observable<AutoCompleteValue[]> {
if(vocabularyName == "sdg"){ if(vocabularyName == "sdg"){
let url = "/assets/vocabulary/sdg.json"; let url = properties.domain+"/assets/vocabulary/sdg.json";
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
//.map(res => <any> res.json()) //.map(res => <any> res.json())
.pipe(map(res => res['sdg'])) .pipe(map(res => res['sdg']))
.pipe(map(res => this.parseSDGs(res))) .pipe(map(res => this.parseSDGs(res)))
.pipe(catchError(this.handleError)); .pipe(catchError(this.handleError));
}else if( vocabularyName == "fos"){ }else if( vocabularyName == "fos"){
let url = "/assets/vocabulary/fos.json"; let url = properties.domain+"/assets/vocabulary/fos.json";
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
//.map(res => <any> res.json()) //.map(res => <any> res.json())
.pipe(map(res => res['fos'])) .pipe(map(res => res['fos']))
@ -146,7 +146,7 @@ export class ISVocabulariesService {
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
var value: AutoCompleteValue = new AutoCompleteValue(); var value: AutoCompleteValue = new AutoCompleteValue();
value.id = data[i].id;//data[i].code; value.id = data[i].id;//data[i].code;
value.label = data[i].label; value.label = data[i].id;
array.push(value); array.push(value);
} }
return array; return array;
@ -159,11 +159,13 @@ export class ISVocabulariesService {
value.id = fos.id;//data[i].code; value.id = fos.id;//data[i].code;
value.label = fos.label; value.label = fos.label;
array.push(value); array.push(value);
if(fos.children) {
for (let fos2 of fos.children) { for (let fos2 of fos.children) {
let value: AutoCompleteValue = new AutoCompleteValue(); let value: AutoCompleteValue = new AutoCompleteValue();
value.id = fos2.id;//data[i].code; value.id = fos2.id;//data[i].code;
value.label = fos2.label; value.label = fos2.label;
array.push(value); array.push(value);
if(fos2.children) {
for (let fos3 of fos2.children) { for (let fos3 of fos2.children) {
let value: AutoCompleteValue = new AutoCompleteValue(); let value: AutoCompleteValue = new AutoCompleteValue();
value.id = fos3.id;//data[i].code; value.id = fos3.id;//data[i].code;
@ -172,6 +174,8 @@ export class ISVocabulariesService {
} }
} }
} }
}
}
return array; return array;
} }
parse(data: any, vocabularyName: string): AutoCompleteValue[] { parse(data: any, vocabularyName: string): AutoCompleteValue[] {