diff --git a/src/res/css/plugin_styles.css b/src/res/css/plugin_styles.css index 8c8a08edb1bdfd264802d0a4315d99787dd06661..f69c0a7c5638f9efed54cb6157018fc4ba1ee38a 100644 --- a/src/res/css/plugin_styles.css +++ b/src/res/css/plugin_styles.css @@ -58,4 +58,11 @@ transform: translateY(2px); color:rgba(255,255,255,1.0); box-shadow: inset 0 2px 2px -2px rgba(0,0,0,0.2); +} + +[darktheme="true"] .alert.alert-danger +{ + color: #f2dede; + background-color: rgba(169, 68, 66, 0.5); + border-color: rgba(169, 68, 66,0.2) } \ No newline at end of file diff --git a/src/ui/kgEntryViewer/kgentry.component.ts b/src/ui/kgEntryViewer/kgentry.component.ts index 5d65b417591b038114d4cf267d08e0c181051a1c..a46314e4fcc49664386022911200be6cc91e64df 100644 --- a/src/ui/kgEntryViewer/kgentry.component.ts +++ b/src/ui/kgEntryViewer/kgentry.component.ts @@ -12,25 +12,27 @@ export class KgEntryViewer implements OnInit{ @Input() kgQueryString : string = null public kgData : any = null + public kgError : any = null ngOnInit(){ if(this.kgQueryString){ fetch(`${KGROOT}${this.kgQueryString}`) .then(res => res.json()) .then(json => { - console.log({json}) if(json.found) return json._source else - throw new Error('json.found returns false') + throw new Error('No documents were found.') }) .then(json => this.kgData = json) .catch(e => { console.error('fetching KG data error', e) this.kgData = null + this.kgError = JSON.stringify(e) }) }else{ console.error('kgQueryString empty!') + this.kgError = 'Knowledge Graph ID empty' } } diff --git a/src/ui/kgEntryViewer/kgentry.template.html b/src/ui/kgEntryViewer/kgentry.template.html index e43aeed7ff07753e75e9392ab790050a40d0c409..8b66cc73f6df1e32cb42ebd5232b61809bd0d6e1 100644 --- a/src/ui/kgEntryViewer/kgentry.template.html +++ b/src/ui/kgEntryViewer/kgentry.template.html @@ -117,10 +117,19 @@ </readmore-component> <a target = "_blank" [href] = "kgHref"> - See the entry in Knowledge Graph + See this dataset in the Knowledge Graph <i class = "glyphicon glyphicon-new-window"></i> </a> </div> <ng-template #showDefault> - Fetching KG Data ... + <div reportError *ngIf = "kgError"> + Fetching metadata from the Knowledge Graph failed - {{ kgError }} + </div> + <div *ngIf = "!kgError"> + Fetching KG Data + + <span class = "homeAnimationDots loadingAnimationDots">•</span> + <span class = "homeAnimationDots loadingAnimationDots">•</span> + <span class = "homeAnimationDots loadingAnimationDots">•</span> + </div> </ng-template> \ No newline at end of file