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

feat: better display of region loading

parent 4918b05e
No related branches found
No related tags found
No related merge requests found
<ng-template [ngIf]="region">
<mat-card class="mat-elevation-z4">
<!-- rgbDarkmode must be checked for strict equality to true/false
as if rgb is undefined, rgbDarkmode will be null/undefined
......@@ -218,3 +220,16 @@
</ng-template>
</mat-expansion-panel>
</ng-template>
</ng-template>
<ng-template [ngIf]="!region">
<mat-card class="mat-elevation-z4">
<h1 class="mat-h1 sidenav-cover-header-container">
<spinner-cmp class="d-inline-block"></spinner-cmp>
<span class="text-muted">
Loading region
</span>
</h1>
</mat-card>
</ng-template>
\ No newline at end of file
import { Component, ElementRef, Inject, Input, OnDestroy, Optional, TemplateRef, ViewChild } from "@angular/core";
import { select, Store } from "@ngrx/store";
import {combineLatest, Observable, of, Subject, Subscription} from "rxjs";
import {distinctUntilChanged, filter, map, shareReplay, startWith, switchMap } from "rxjs/operators";
import {catchError, distinctUntilChanged, filter, map, shareReplay, startWith, switchMap } from "rxjs/operators";
import { viewerStateSetSelectedRegions } from "src/services/state/viewerState/actions";
import {
viewerStateContextedSelectedRegionsSelector,
......@@ -77,6 +77,8 @@ import { ContextMenuService, TContextMenuReg } from "src/contextMenuModule";
context
}
}),
// in case detailed requests
catchError((err, obs) => of(r[0])),
shareReplay(1),
)
})
......
......@@ -474,12 +474,10 @@
<!-- single region tmpl -->
<ng-template #singleRegionTmpl let-region="region">
<!-- region detail -->
<ng-container *ngIf="region; else regionPlaceholderTmpl">
<region-menu
[region]="region"
class="flex-grow-1 bs-border-box ml-15px-n mr-15px-n mat-elevation-z4">
</region-menu>
</ng-container>
<region-menu
[region]="region"
class="flex-grow-1 bs-border-box ml-15px-n mr-15px-n mat-elevation-z4">
</region-menu>
</ng-template>
......
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