perf(frontend): optimize initial bundle size with lazy-loaded dialogs and localized chart providers (#1110)

This commit is contained in:
brios
2026-05-18 23:05:10 +02:00
committed by GitHub
parent 4afc738dd4
commit c6cbdcfa11
32 changed files with 532 additions and 405 deletions
@@ -28,7 +28,7 @@ describe('IconPickerService', () => {
});
it('returns the icon selected by the dialog', async () => {
dialogLauncherService.openIconPickerDialog.mockReturnValue({
dialogLauncherService.openIconPickerDialog.mockResolvedValue({
onClose: of({type: 'PRIME_NG', value: 'pi pi-book'}),
});
@@ -1,5 +1,5 @@
import {inject, Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {EMPTY, from, Observable, switchMap} from 'rxjs';
import {DialogLauncherService} from '../services/dialog-launcher.service';
export interface IconSelection {
@@ -12,7 +12,13 @@ export class IconPickerService {
private dialogLauncherService = inject(DialogLauncherService);
open(): Observable<IconSelection> {
const ref = this.dialogLauncherService.openIconPickerDialog();
return ref!.onClose as Observable<IconSelection>;
return from(this.dialogLauncherService.openIconPickerDialog()).pipe(
switchMap(ref => {
if (!ref) {
return EMPTY;
}
return ref.onClose as Observable<IconSelection>;
})
);
}
}