Sprint 9: add tenant-driven API resolution layer
This commit is contained in:
@@ -2,19 +2,18 @@
|
||||
import { Component, OnInit, signal, ApplicationRef, inject, DestroyRef } from '@angular/core';
|
||||
import { Router, RouterOutlet, NavigationEnd } from '@angular/router';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { HeaderComponent } from './components/header/header.component';
|
||||
import { FooterComponent } from './components/footer/footer.component';
|
||||
import { BackButtonComponent } from './components/back-button/back-button.component';
|
||||
import { interval, concat } from 'rxjs';
|
||||
import { filter, first } from 'rxjs/operators';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { environment } from '../environments/environment';
|
||||
import { SwUpdate } from '@angular/service-worker';
|
||||
import { TranslatePipe } from './i18n/translate.pipe';
|
||||
import { TranslateService } from './i18n/translate.service';
|
||||
import { PlatformRuntimeService } from './core/runtime/platform-runtime.service';
|
||||
import { UiRuntimeFacade } from './facades/runtime/ui-runtime.facade';
|
||||
import { ApiHealthService } from './services/api-health.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
@@ -29,7 +28,6 @@ export class App implements OnInit {
|
||||
serverAvailable = signal(false);
|
||||
|
||||
private destroyRef = inject(DestroyRef);
|
||||
private http = inject(HttpClient);
|
||||
private titleService = inject(Title);
|
||||
private swUpdate = inject(SwUpdate);
|
||||
private appRef = inject(ApplicationRef);
|
||||
@@ -37,6 +35,7 @@ export class App implements OnInit {
|
||||
private i18n = inject(TranslateService);
|
||||
private platformRuntime = inject(PlatformRuntimeService);
|
||||
private uiRuntime = inject(UiRuntimeFacade);
|
||||
private apiHealth = inject(ApiHealthService);
|
||||
|
||||
ngOnInit(): void {
|
||||
this.platformRuntime.initialize();
|
||||
@@ -61,7 +60,7 @@ export class App implements OnInit {
|
||||
|
||||
private checkServerHealth(): void {
|
||||
this.checkingServer.set(true);
|
||||
this.http.get<{ message: string }>(`${environment.apiUrl}/ping`)
|
||||
this.apiHealth.ping()
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe({
|
||||
next: () => {
|
||||
|
||||
Reference in New Issue
Block a user