RED-4013: Fixed dashboard in Firefox
This commit is contained in:
parent
b174370216
commit
a9e5dbde3f
@ -25,6 +25,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.donut-chart {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.text-container {
|
.text-container {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -6,6 +6,16 @@ import { Observable } from 'rxjs';
|
|||||||
import { map, switchMap, tap } from 'rxjs/operators';
|
import { map, switchMap, tap } from 'rxjs/operators';
|
||||||
import { DossierStatesService } from '@services/entity-services/dossier-states.service';
|
import { DossierStatesService } from '@services/entity-services/dossier-states.service';
|
||||||
|
|
||||||
|
const templatesSorter = (a: DashboardStats, b: DashboardStats) => {
|
||||||
|
if (a.numberOfActiveDossiers > 0 && b.numberOfActiveDossiers === 0) {
|
||||||
|
return -1;
|
||||||
|
} else if (a.numberOfActiveDossiers === 0 && b.numberOfActiveDossiers > 0) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
@ -22,7 +32,7 @@ export class DashboardStatsService extends EntitiesService<DashboardStats, IDash
|
|||||||
return this.getAll(this._defaultModelPath).pipe(
|
return this.getAll(this._defaultModelPath).pipe(
|
||||||
mapEach(entity => new DashboardStats(entity)),
|
mapEach(entity => new DashboardStats(entity)),
|
||||||
switchMap(entities => this._dossierStatesService.loadAllForAllTemplates().pipe(map(() => entities))),
|
switchMap(entities => this._dossierStatesService.loadAllForAllTemplates().pipe(map(() => entities))),
|
||||||
tap(entities => entities.sort((a, b) => (a.numberOfActiveDossiers > 0 && b.numberOfActiveDossiers === 0 ? -1 : 1))),
|
tap(entities => entities.sort(templatesSorter)),
|
||||||
tap(entities => this.setEntities(entities)),
|
tap(entities => this.setEntities(entities)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user