Skip to content

Commit

Permalink
Merge branch 'develop' into Issue-#1425-Search-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
litvinets committed Sep 2, 2022
1 parent 6f0c926 commit 53a6ae3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
10 changes: 9 additions & 1 deletion src/app/header/progress-bar/progress-bar.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<div
*ngIf="isLoadingResultPage || isLoadingMetaData || isLoadingCabinet || isLoadingAdminData || isLoadingMainPage"
*ngIf="
isLoadingResultPage ||
isLoadingMetaData ||
isLoadingCabinet ||
isLoadingAdminData ||
isLoadingMainPage ||
isLoadingProvider ||
isAutorizationLoading
"
class="progress-bar">
<mat-progress-bar mode="indeterminate"> </mat-progress-bar>
</div>
38 changes: 30 additions & 8 deletions src/app/header/progress-bar/progress-bar.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RegistrationState } from 'src/app/shared/store/registration.state';
import { ProviderState } from './../../shared/store/provider.state';
import { MainPageState } from 'src/app/shared/store/main-page.state';
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Select } from '@ngxs/store';
Expand All @@ -24,13 +26,19 @@ export class ProgressBarComponent implements OnInit, OnDestroy {
isLoadingAdminData$: Observable<boolean>;
@Select(MainPageState.isLoadingData)
isLoadingMainPage$: Observable<boolean>;
@Select(ProviderState.isLoading)
isLoadingProvider$: Observable<boolean>;
@Select(RegistrationState.isAutorizationLoading)
isAutorizationLoading$: Observable<boolean>;

isLoadingResultPage: boolean;
isLoadingCabinet: boolean;
isLoadingMetaData: boolean;
isLoadingAdminData: boolean;
isLoadingNotifications: boolean;
isLoadingMainPage: boolean;
isAutorizationLoading: boolean;
isLoadingProvider: boolean;

private destroy$: Subject<boolean> = new Subject<boolean>();

Expand All @@ -42,16 +50,30 @@ export class ProgressBarComponent implements OnInit, OnDestroy {
this.isLoadingMetaData$,
this.isLoadingCabinet$,
this.isLoadingAdminData$,
this.isLoadingMainPage$
this.isLoadingMainPage$,
this.isAutorizationLoading$,
this.isLoadingProvider$,
])
.pipe(takeUntil(this.destroy$), delay(0))
.subscribe(([isLoadingResult, isLoadingMeta, isLoadingCabinet, isLoadingAdminData, isLoadingMainPage]) => {
this.isLoadingResultPage = isLoadingResult;
this.isLoadingMetaData = isLoadingMeta;
this.isLoadingCabinet = isLoadingCabinet;
this.isLoadingAdminData = isLoadingAdminData;
this.isLoadingMainPage = isLoadingMainPage;
});
.subscribe(
([
isLoadingResult,
isLoadingMeta,
isLoadingCabinet,
isLoadingAdminData,
isLoadingMainPage,
isAutorizationLoading,
isLoadingProvider,
]) => {
this.isLoadingResultPage = isLoadingResult;
this.isLoadingMetaData = isLoadingMeta;
this.isLoadingCabinet = isLoadingCabinet;
this.isLoadingAdminData = isLoadingAdminData;
this.isLoadingMainPage = isLoadingMainPage;
this.isAutorizationLoading = isAutorizationLoading;
this.isLoadingProvider = isLoadingProvider;
}
);
}

ngOnDestroy(): void {
Expand Down

0 comments on commit 53a6ae3

Please sign in to comment.