mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-01 08:00:47 +08:00
Change grid widget loading
This commit is contained in:
parent
460937e9b3
commit
98e774bb44
2 changed files with 23 additions and 9 deletions
|
@ -60,9 +60,13 @@
|
|||
</scrm-field>
|
||||
|
||||
</div>
|
||||
<div *ngIf="statistics.loading && loading" class="widget-entry-loading">
|
||||
<div *ngIf="initializing() || (statistics.loading && loading)" class="widget-entry-loading">
|
||||
|
||||
<scrm-inline-loading-spinner klass="d-flex flex-row"></scrm-inline-loading-spinner>
|
||||
<div class="pb-2 widget-entry-value">
|
||||
<div class=" rounded box-loading skeleton-field-content">
|
||||
...
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ng-container>
|
||||
|
@ -108,13 +112,16 @@
|
|||
</ng-container>
|
||||
|
||||
<!-- MISCONFIGURATION -->
|
||||
<ng-container
|
||||
*ngIf="col.statistic && !loading && (!vm.statistics[col.statistic].field || (vm.statistics[col.statistic].field && isEmptyFieldValue(vm.statistics[col.statistic].field.value)))">
|
||||
<div class="widget-entry-value {{getSizeClass(col.size)}}">
|
||||
-
|
||||
</div>
|
||||
<ng-container *ngIf="!initializing()">
|
||||
<ng-container
|
||||
*ngIf="col.statistic && !loading && (!vm.statistics[col.statistic].field || (vm.statistics[col.statistic].field && isEmptyFieldValue(vm.statistics[col.statistic].field.value)))">
|
||||
<div class="widget-entry-value {{getSizeClass(col.size)}}">
|
||||
-
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
||||
|
||||
</ng-container>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -24,10 +24,10 @@
|
|||
* the words "Supercharged by SuiteCRM".
|
||||
*/
|
||||
|
||||
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
|
||||
import {Component, Input, OnDestroy, OnInit, signal, WritableSignal} from '@angular/core';
|
||||
|
||||
import {combineLatestWith, Observable, of, Subscription} from 'rxjs';
|
||||
import {map, shareReplay, take} from 'rxjs/operators';
|
||||
import {map, shareReplay, take, tap} from 'rxjs/operators';
|
||||
import {SingleValueStatisticsStoreFactory} from '../../store/single-value-statistics/single-value-statistics.store.factory';
|
||||
import {LanguageStore} from '../../store/language/language.store';
|
||||
import {
|
||||
|
@ -92,6 +92,7 @@ export class GridWidgetComponent implements OnInit, OnDestroy {
|
|||
vm$: Observable<GridWidgetState>;
|
||||
loading = true;
|
||||
messageLabelKey: string;
|
||||
initializing: WritableSignal<boolean> = signal(true);
|
||||
private subs: Subscription[] = [];
|
||||
private statistics: StatisticsEntryMap = {};
|
||||
private loading$: Observable<boolean>;
|
||||
|
@ -421,6 +422,12 @@ export class GridWidgetComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
}
|
||||
|
||||
allStatistics$ = allStatistics$.pipe(tap(() => {
|
||||
if(this.initializing()) {
|
||||
this.initializing.set(false);
|
||||
}
|
||||
}));
|
||||
|
||||
this.vm$ = allStatistics$.pipe(
|
||||
combineLatestWith(layout$),
|
||||
map(([statistics, layout]: [SingleValueStatisticsState[], StatisticWidgetLayoutRow[]]) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue