|
|
@@ -3,7 +3,7 @@ import { ActivatedRoute, Router, RouterModule, RouterOutlet, RoutesRecognized }
|
|
|
import { MatModule } from '../dependencies/angularlib/mat.module';
|
|
|
import { Angularlib } from 'angularlib/angularlib.module';
|
|
|
import { BaseComponent, untilDestroy } from 'angularlib/base.component';
|
|
|
-import { Subject, Subscription, filter, map, repeat, takeUntil, timer } from 'rxjs';
|
|
|
+import { Subject, Subscription, filter, map, repeat, take, takeUntil, timer } from 'rxjs';
|
|
|
import { Title } from '@angular/platform-browser';
|
|
|
import { LoginService } from 'angularlib/login/login.service';
|
|
|
import { CommonModule, DatePipe } from '@angular/common';
|
|
|
@@ -25,7 +25,7 @@ import { NotificationService } from 'angularlib/notification/notification.servic
|
|
|
import { env } from 'angularlib/environments/environment';
|
|
|
import { TranslatePipe } from 'angularlib/labels/translate.pipe';
|
|
|
import { ChatComponent } from 'angularlib/chat/chat.component';
|
|
|
-import * as confing from '../config/config.json';
|
|
|
+import { HttpClient } from '@angular/common/http';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-root',
|
|
|
@@ -79,6 +79,19 @@ export class AppComponent extends BaseComponent implements OnInit {
|
|
|
private notification = inject(NotificationService);
|
|
|
private tr = inject(TranslatePipe);
|
|
|
|
|
|
+ protected sampleMap = {
|
|
|
+ hidden:true,
|
|
|
+ markers: [
|
|
|
+ {position:{lat:1.55176,lng:110.33429},title:'Software Optima'}
|
|
|
+ ],
|
|
|
+ polygons: [
|
|
|
+ {paths: [{lat:1.551703,lng:110.334149},{lat:1.551703,lng:110.334409},{lat:1.55222,lng:110.33444},{lat:1.552223,lng:110.33417}],fillColor: "blue",strokeColor:'navy'},
|
|
|
+ {paths: [{lat:1.55222,lng:110.33413},{lat:1.55224,lng:110.33375},{lat:1.551432,lng:110.333715},{lat:1.551404,lng:110.334387},{lat:1.551685,lng:110.334395},{lat:1.551704,lng:110.334100}],fillColor: "red",strokeColor:'red'}
|
|
|
+ ]
|
|
|
+ };
|
|
|
+
|
|
|
+ private http = inject(HttpClient);
|
|
|
+
|
|
|
constructor(
|
|
|
private router: Router,
|
|
|
private store: Store,
|
|
|
@@ -100,14 +113,18 @@ export class AppComponent extends BaseComponent implements OnInit {
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
// check if site is under maintenance
|
|
|
- if (config?.maintenance?.active) {
|
|
|
- this.cs.dialog.showWarningDialog({
|
|
|
- title: 'Site Under Maintenance',
|
|
|
- content: `FIS is currently under maintenance.<br/>This maintenance is expected to continue until ${config?.maintenance?.endDatetime}.<br/>Sorry for any inconvenience caused.`,
|
|
|
- disableClose: true,
|
|
|
- hideCloseButton: true
|
|
|
- });
|
|
|
- }
|
|
|
+ this.http.get('./config/config.json').pipe(take(1)).subscribe({
|
|
|
+ next: (cfg:any) => {
|
|
|
+ if (cfg?.maintenance?.active) {
|
|
|
+ this.cs.dialog.showWarningDialog({
|
|
|
+ title: 'Site Under Maintenance',
|
|
|
+ content: `FIS is currently under maintenance.<br/>This maintenance is expected to continue until ${config?.maintenance?.endDatetime}.<br/>Sorry for any inconvenience caused.`,
|
|
|
+ disableClose: true,
|
|
|
+ hideCloseButton: true
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
this.router.events.pipe(untilDestroy(this),
|
|
|
filter((event) => event instanceof RoutesRecognized),
|