-
@@ -52,8 +51,7 @@
[no title available]
-
@@ -68,8 +66,7 @@
-
+
{{result.acronym}}
@@ -139,7 +136,7 @@
+ class="uk-label" [class.uk-label-danger]="deposit" title="OpenAIRE Compatibility">
Not yet registered in OpenAIRE
{{' '}}
diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts
index 121c4bd7..d8d66880 100644
--- a/utils/result-preview/result-preview.component.ts
+++ b/utils/result-preview/result-preview.component.ts
@@ -32,6 +32,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0];
@Input() showOrcid: boolean = true;
@Input() showEnermaps: boolean = false;
+ @Input() deposit: boolean = false;
ngOnInit(): void {
if(this.hasLink) {
diff --git a/utils/staticAutoComplete/ISVocabularies.service.ts b/utils/staticAutoComplete/ISVocabularies.service.ts
index 127dcbd1..833d6ea9 100644
--- a/utils/staticAutoComplete/ISVocabularies.service.ts
+++ b/utils/staticAutoComplete/ISVocabularies.service.ts
@@ -11,6 +11,7 @@ export class ISVocabulariesService {
private vocabularies: Map
> = new Map>();
private provenanceActionVocabulary: BehaviorSubject<{}> = new BehaviorSubject(null);
private subjectsVocabulary: BehaviorSubject = new BehaviorSubject(null);
+ private relationsVocabulary: BehaviorSubject = new BehaviorSubject(null);
private subscriptions = [];
private vocabulariesPromises: Map> = new Map>();
constructor(private http: HttpClient) {}
@@ -259,6 +260,47 @@ export class ISVocabulariesService {
return subjectsVocabulary;
}
+ getRelationsVocabulary(properties: EnvProperties): Observable {
+ let vocabulary = "dnet:relation_relClass.json";
+ return from(this.getRelationsVocabularyFromServiceAsync(vocabulary, properties));
+ }
+
+ async getRelationsVocabularyFromServiceAsync (vocabularyName: string, properties: EnvProperties): Promise<{}> {
+ if(!this.relationsVocabulary || !this.relationsVocabulary.getValue()) {
+ await new Promise(resolve => {
+ this.subscriptions.push(this.getRelationsVocabularyFromService(vocabularyName, properties).subscribe(
+ vocabularyRes => {
+ this.relationsVocabulary.next(vocabularyRes);
+ resolve();
+ },
+ error => {
+ this.relationsVocabulary.next(null);
+ resolve();
+ }
+ ));
+ });
+ }
+ return this.relationsVocabulary.getValue();
+ }
+
+ getRelationsVocabularyFromService (vocabularyName: string, properties: EnvProperties): any {
+ let url = properties.vocabulariesAPI+vocabularyName;
+
+ return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
+ .pipe(map(res => res['terms']))
+ .pipe(map(res => this.parseRelationsVocabulary(res)));
+ }
+
+ parseRelationsVocabulary(terms: any) {
+ var relationsVocabulary: {} = {};
+ for(let term of terms) {
+ if(term.code != "keyword") {
+ relationsVocabulary[term.code] = term.englishName;
+ }
+ }
+ return relationsVocabulary;
+ }
+
private handleError(error: HttpErrorResponse) {
// in a real world app, we may send the error to some remote logging infrastructure