mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
AAE-49653 Code improvement
This commit is contained in:
+2
-2
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, DestroyRef, EventEmitter, inject, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||
import { combineLatest, defer, EMPTY, Observable, Subscription } from 'rxjs';
|
||||
import { combineLatest, defer, EMPTY, Observable, of, Subscription } from 'rxjs';
|
||||
import { ProcessFilterCloudService } from '../../services/process-filter-cloud.service';
|
||||
import { ProcessFilterCloudModel } from '../../models/process-filter-cloud.model';
|
||||
import { AppConfigService, IconModule, TranslationService } from '@alfresco/adf-core';
|
||||
@@ -131,7 +131,7 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges {
|
||||
getFilters(appName: string): void {
|
||||
this.filtersLoadedFor = appName;
|
||||
const filters$ = this.filterCountersCloudService.getProcessFilters(appName);
|
||||
this.filters$ = filters$.pipe(catchError(() => EMPTY));
|
||||
this.filters$ = filters$.pipe(catchError(() => of([])));
|
||||
|
||||
filters$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
|
||||
next: (res) => {
|
||||
|
||||
+10
-14
@@ -176,22 +176,18 @@ export class TaskFiltersCloudComponent extends BaseTaskFiltersCloudComponent imp
|
||||
});
|
||||
}
|
||||
|
||||
initFilterCounterNotifications() {
|
||||
if (!this.appName) {
|
||||
return;
|
||||
}
|
||||
if (!this.enableNotifications) {
|
||||
initFilterCounterNotifications(): void {
|
||||
if (this.appName && this.enableNotifications) {
|
||||
this.filterCountersCloudService
|
||||
.getEngineEvents(this.appName, FilterCounterEntityType.TASK)
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe((events) => {
|
||||
events.forEach((taskEvent) => this.checkFilterCounter(taskEvent.entity));
|
||||
this.filterCounterUpdated.emit(events);
|
||||
});
|
||||
} else {
|
||||
this.counters = {};
|
||||
return;
|
||||
}
|
||||
|
||||
this.filterCountersCloudService
|
||||
.getEngineEvents(this.appName, FilterCounterEntityType.TASK)
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe((events) => {
|
||||
events.forEach((taskEvent) => this.checkFilterCounter(taskEvent.entity));
|
||||
this.filterCounterUpdated.emit(events);
|
||||
});
|
||||
}
|
||||
|
||||
checkFilterCounter(filterNotification: TaskDetailsCloudModel) {
|
||||
|
||||
Reference in New Issue
Block a user