Skip to content

Commit

Permalink
fix: define other variable for appState.globalLoading (#220)
Browse files Browse the repository at this point in the history
* fix: ocxSrc directive with external image url, ocx slots

* fix: loading remote component

* fix: lint issues

* fix: componentType may be undefined

* fix: improve permission cache, use of ocxSrc, fix overflow of user avatar menu

* fix: no permissions flickering

* fix: hide app when globalLoading is true to avoid unwanted behavior when switching apps

* fix: globalLoading as observable

* fix: define other variable for globalLoading

---------

Co-authored-by: kim.tran <[email protected]>
  • Loading branch information
KimFFVII and kim.tran authored Apr 12, 2024
1 parent 29edc72 commit 4ade83b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div class="layout-main">
<div class="layout-content relative">
<ocx-slot name="subHeader"></ocx-slot>
<ng-container *ngIf="(appStateService.globalLoading$.asObservable() | async) === false">
<ng-container *ngIf="showContent$ | async">
<ng-content></ng-content>
<router-outlet></router-outlet>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { HttpClient } from '@angular/common/http'
import { AfterViewInit, Component, HostListener, OnDestroy, OnInit, Renderer2 } from '@angular/core'
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'
import { AppStateService, Message, PortalMessageService, ThemeService, UserService } from '@onecx/angular-integration-interface'
import {
AppStateService,
Message,
PortalMessageService,
ThemeService,
UserService,
} from '@onecx/angular-integration-interface'
import { MessageService, PrimeNGConfig } from 'primeng/api'
import { filter, first, map, mergeMap, of } from 'rxjs'
import { filter, first, map, mergeMap, of, tap } from 'rxjs'

@Component({
selector: 'ocx-shell-portal-viewport',
Expand All @@ -27,6 +33,11 @@ export class PortalViewportComponent implements OnInit, AfterViewInit, OnDestroy
isMobile = false

globalErrMsg: string | undefined
showContent$ = this.appStateService.globalLoading$.pipe(
tap((v) => console.log('GLOBAL LOADING ', v)),
map((gl) => !gl),
tap((v) => console.log('SHOW CONTENT', v))
)

constructor(
private renderer: Renderer2,
Expand Down

0 comments on commit 4ade83b

Please sign in to comment.