|
@@ -4,6 +4,7 @@ import {
|
|
|
inject,
|
|
inject,
|
|
|
OnInit,
|
|
OnInit,
|
|
|
ChangeDetectionStrategy,
|
|
ChangeDetectionStrategy,
|
|
|
|
|
+ signal,
|
|
|
} from '@angular/core';
|
|
} from '@angular/core';
|
|
|
import {
|
|
import {
|
|
|
ActivatedRoute,
|
|
ActivatedRoute,
|
|
@@ -36,17 +37,20 @@ import { Notification } from 'angularlib/notification/notification.actions';
|
|
|
import { generateId } from 'angularlib/base.service';
|
|
import { generateId } from 'angularlib/base.service';
|
|
|
import { Store } from '@ngxs/store';
|
|
import { Store } from '@ngxs/store';
|
|
|
import config from '../config/config.json';
|
|
import config from '../config/config.json';
|
|
|
|
|
+import info from '../config/info.json';
|
|
|
import { UIAuthActions } from 'angularlib/login/state/login.actions';
|
|
import { UIAuthActions } from 'angularlib/login/state/login.actions';
|
|
|
import { Platform } from '@angular/cdk/platform';
|
|
import { Platform } from '@angular/cdk/platform';
|
|
|
import { AppSettingsAction } from 'angularlib/ui.state/ui.state.actions';
|
|
import { AppSettingsAction } from 'angularlib/ui.state/ui.state.actions';
|
|
|
import { PushNotificationDecorator as LeavePushNotif } from 'fis/leave/decorators/push.notification.decorator';
|
|
import { PushNotificationDecorator as LeavePushNotif } from 'fis/leave/decorators/push.notification.decorator';
|
|
|
-import { FISMessaging } from 'fis/index';
|
|
|
|
|
|
|
+import { FISMessaging, FISPrograms } from 'fis/index';
|
|
|
import { BusinessDataModule } from 'fis/business.data/business.data.module';
|
|
import { BusinessDataModule } from 'fis/business.data/business.data.module';
|
|
|
import { NotificationService } from 'angularlib/notification/notification.service';
|
|
import { NotificationService } from 'angularlib/notification/notification.service';
|
|
|
import { env } from 'angularlib/environments/environment';
|
|
import { env } from 'angularlib/environments/environment';
|
|
|
import { TranslatePipe } from 'angularlib/labels/translate.pipe';
|
|
import { TranslatePipe } from 'angularlib/labels/translate.pipe';
|
|
|
import { ChatComponent } from 'angularlib/chat/chat.component';
|
|
import { ChatComponent } from 'angularlib/chat/chat.component';
|
|
|
import { HttpClient } from '@angular/common/http';
|
|
import { HttpClient } from '@angular/common/http';
|
|
|
|
|
+import { EventI } from 'fis-commons/event/event';
|
|
|
|
|
+import { AppService } from 'angularlib/app';
|
|
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
|
selector: 'app-root',
|
|
selector: 'app-root',
|
|
@@ -101,6 +105,8 @@ export class AppComponent extends BaseComponent implements OnInit {
|
|
|
private notification = inject(NotificationService);
|
|
private notification = inject(NotificationService);
|
|
|
private tr = inject(TranslatePipe);
|
|
private tr = inject(TranslatePipe);
|
|
|
|
|
|
|
|
|
|
+ protected info = info;
|
|
|
|
|
+
|
|
|
protected sampleMap = {
|
|
protected sampleMap = {
|
|
|
hidden: true,
|
|
hidden: true,
|
|
|
markers: [
|
|
markers: [
|
|
@@ -132,10 +138,14 @@ export class AppComponent extends BaseComponent implements OnInit {
|
|
|
],
|
|
],
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ protected programs = signal(FISPrograms);
|
|
|
|
|
+
|
|
|
private http = inject(HttpClient);
|
|
private http = inject(HttpClient);
|
|
|
|
|
|
|
|
|
|
+ private app = inject(AppService);
|
|
|
|
|
+
|
|
|
constructor(
|
|
constructor(
|
|
|
- private router: Router,
|
|
|
|
|
|
|
+ protected router: Router,
|
|
|
private store: Store,
|
|
private store: Store,
|
|
|
protected loginService: LoginService,
|
|
protected loginService: LoginService,
|
|
|
/**Platform Browser title */
|
|
/**Platform Browser title */
|
|
@@ -199,6 +209,8 @@ export class AppComponent extends BaseComponent implements OnInit {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
if (this.platform.ANDROID || this.platform.IOS) this.pwaPrompt();
|
|
if (this.platform.ANDROID || this.platform.IOS) this.pwaPrompt();
|
|
|
|
|
+ this.updateSidenavBadges();
|
|
|
|
|
+ console.debug('app initialized');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ngAfterViewInit() {
|
|
ngAfterViewInit() {
|
|
@@ -298,4 +310,23 @@ export class AppComponent extends BaseComponent implements OnInit {
|
|
|
chat.style.display = chat.style.display === 'none' ? 'flex' : 'none';
|
|
chat.style.display = chat.style.display === 'none' ? 'flex' : 'none';
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ private updateSidenavBadges() {
|
|
|
|
|
+ this.app.sidenav.badges.update.pipe(untilDestroy(this)).subscribe((event: EventI) => {
|
|
|
|
|
+ this.programs.update((programs) => {
|
|
|
|
|
+ return programs.map((program) => {
|
|
|
|
|
+ if (program.id === event.payload.categoryId) {
|
|
|
|
|
+ program.items = program.items.map((item:any) => {
|
|
|
|
|
+ if (item.id === event.payload.programId) item = {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ badge: event.payload.badge
|
|
|
|
|
+ }
|
|
|
|
|
+ return item;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ return program;
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|