This is an automated email from the ASF dual-hosted git repository. hshpak pushed a commit to branch feat/DATALAB-2960/refresh-button-should-not-impact-on-filtered-options in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
commit eaa854877606f7abaab272c0237fff40d605b065 Author: Hennadii_Shpak <[email protected]> AuthorDate: Fri Aug 5 16:30:40 2022 +0300 added request on reload btn --- .../webapp/src/app/resources/images/images.component.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/images/images.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/images/images.component.ts index 7d9a7ee12..f0d05e393 100644 --- a/services/self-service/src/main/resources/webapp/src/app/resources/images/images.component.ts +++ b/services/self-service/src/main/resources/webapp/src/app/resources/images/images.component.ts @@ -25,7 +25,7 @@ import { map, tap} from 'rxjs/operators'; import { ToastrService } from 'ngx-toastr'; import { GeneralEnvironmentStatus } from '../../administration/management/management.model'; -import { HealthStatusService } from '../../core/services'; +import { ApplicationSecurityService, HealthStatusService } from '../../core/services'; import { FilteredColumnList, ImageFilterFormDropdownData, ImageFilterFormValue, ImageModel, ProjectModel } from './images.model'; import { TooltipStatuses, @@ -89,6 +89,7 @@ export class ImagesComponent implements OnInit, OnDestroy { private imagesService: ImagesService, private progressBarService: ProgressBarService, private route: ActivatedRoute, + private applicationSecurityService: ApplicationSecurityService ) { } ngOnInit(): void { @@ -132,6 +133,7 @@ export class ImagesComponent implements OnInit, OnDestroy { } onRefreshClick(): void { + this.checkAuthorize(); this.imagesService.getImagePageInfo().subscribe(); this.activeProjectName = ''; } @@ -194,6 +196,12 @@ export class ImagesComponent implements OnInit, OnDestroy { this.imagesService.resetFilterField(dropdownFieldNames, DropdownSelectAllValue); } + private checkAuthorize() { + this.applicationSecurityService.isLoggedIn().subscribe(() => { + this.getEnvironmentHealthStatus(); + }); + } + private getEnvironmentHealthStatus(): void { this.healthStatusService.getEnvironmentHealthStatus().subscribe( (result: GeneralEnvironmentStatus) => { @@ -255,8 +263,4 @@ export class ImagesComponent implements OnInit, OnDestroy { private initIsImageListFiltered(): void { this.$isFiltered = this.imagesService.$isImageListFiltered; } - - get isImageSelected(): boolean { - return this.imagesService.isImageSelected(); - } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
