Skip to content

Commit

Permalink
NAS-129891: Webui cache refresh should report progress of cache fill job
Browse files Browse the repository at this point in the history
(cherry picked from commit dbb15a0)
  • Loading branch information
AlexKarpov98 authored and bugclerk committed Oct 13, 2024
1 parent 8e83301 commit 1bb4779
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,25 @@ export class ActiveDirectoryComponent implements OnInit {

onRebuildCachePressed(): void {
this.isLoading = true;
this.systemGeneralService.refreshDirServicesCache().pipe(untilDestroyed(this)).subscribe({
next: () => {
this.isLoading = false;
this.snackbarService.success(
this.translate.instant(helptextActiveDirectory.activedirectory_custactions_clearcache_dialog_message),
);
this.cdr.markForCheck();
},
error: (error: unknown) => {
this.isLoading = false;
this.dialogService.error(this.errorHandler.parseError(error));
this.cdr.markForCheck();
},
});
this.dialogService
.jobDialog(this.systemGeneralService.refreshDirServicesCache())
.afterClosed()
.pipe(untilDestroyed(this)).subscribe({
next: ({ description }) => {
this.isLoading = false;
this.snackbarService.success(
this.translate.instant(
description || helptextActiveDirectory.activedirectory_custactions_clearcache_dialog_message,
),
);
this.cdr.markForCheck();
},
error: (error: unknown) => {
this.isLoading = false;
this.dialogService.error(this.errorHandler.parseError(error));
this.cdr.markForCheck();
},
});
}

onLeaveDomainPressed(): void {
Expand Down
31 changes: 17 additions & 14 deletions src/app/pages/directory-service/components/ldap/ldap.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,23 @@ export class LdapComponent implements OnInit {

onRebuildCachePressed(): void {
this.isLoading = true;
this.systemGeneralService.refreshDirServicesCache().pipe(untilDestroyed(this)).subscribe({
next: () => {
this.isLoading = false;
this.snackbar.success(
this.translate.instant(helptextLdap.ldap_custactions_clearcache_dialog_message),
);
this.cdr.markForCheck();
},
error: (error: unknown) => {
this.isLoading = false;
this.dialogService.error(this.errorHandler.parseError(error));
this.cdr.markForCheck();
},
});
this.dialogService
.jobDialog(this.systemGeneralService.refreshDirServicesCache())
.afterClosed()
.pipe(untilDestroyed(this)).subscribe({
next: ({ description }) => {
this.isLoading = false;
this.snackbar.success(
this.translate.instant(description || helptextLdap.ldap_custactions_clearcache_dialog_message),
);
this.cdr.markForCheck();
},
error: (error: unknown) => {
this.isLoading = false;
this.dialogService.error(this.errorHandler.parseError(error));
this.cdr.markForCheck();
},
});
}

onSubmit(): void {
Expand Down

0 comments on commit 1bb4779

Please sign in to comment.