Skip to content
Snippets Groups Projects
Commit e74b7ea7 authored by Xiao Gui's avatar Xiao Gui
Browse files

chore: fix busy signal in regional features

parent 30c696f0
No related branches found
No related tags found
No related merge requests found
......@@ -18,14 +18,11 @@ export class KgRegionalFeaturesListDirective extends BsRegionInputBase implement
// must not use switchmapto here
switchMap(() => {
this.busyEmitter.emit(true)
return merge(
of([]),
this.getFeatureInstancesList(KG_REGIONAL_FEATURE_KEY).pipe(
catchError(() => of([])),
tap(() => {
this.busyEmitter.emit(false)
}),
)
return this.getFeatureInstancesList(KG_REGIONAL_FEATURE_KEY).pipe(
catchError(() => of([])),
tap(() => {
this.busyEmitter.emit(false)
}),
)
}),
startWith([])
......
......@@ -164,15 +164,10 @@ export class RegionalFeatureWrapperCmp implements OnChanges, OnDestroy{
arg['name'] = contextedFeature.result['name']
arg['description'] = ' '
arg['isGdprProtected'] = true
/**
* todo use actual fetched data
*/
const re = /\(dataset:([a-f0-9-]+)\)/.exec(arg['name'])
if (re) {
arg['urls'] = [{
doi: `https://search.kg.ebrains.eu/instances/${re[1]}`
}]
}
arg['urls'] = []
for (const info of contextedFeature.result['origin_datainfos']) {
arg['urls'].push(...(info.urls || []))
}
}
if (contextedFeature.featureName === EbrainsRegionalFeatureName) {
......
<spinner-cmp *ngIf="busy$ | async; else resultTmpl"></spinner-cmp>
<ng-template [ngTemplateOutlet]="resultTmpl">
</ng-template>
<ng-template #busyTmpl>
<spinner-cmp></spinner-cmp>
</ng-template>
<ng-template #resultTmpl>
......@@ -27,6 +32,10 @@
<div class="feature-container"
[attr.aria-label]="ARIA_LABELS.LIST_OF_DATASETS_ARIA_LABEL">
<!-- if busy, show spinner -->
<ng-template [ngIf]="busy$ | async">
<ng-template [ngTemplateOutlet]="busyTmpl"></ng-template>
</ng-template>
<div *ngFor="let feature of registeredFeatures; let index = index"
class="overflow-hidden">
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment