AAE-38626 Made cloud services extentable (#11450)

This commit is contained in:
Andreas Philippi
2025-12-15 11:54:19 +00:00
committed by GitHub
parent 14dbc4fe49
commit f6c7d90578
3 changed files with 15 additions and 17 deletions
@@ -50,8 +50,8 @@ export class ProcessFilterCloudService {
private filterKeyToBeRefreshedSource = new Subject<string>(); private filterKeyToBeRefreshedSource = new Subject<string>();
filterKeyToBeRefreshed$: Observable<string> = this.filterKeyToBeRefreshedSource.asObservable(); filterKeyToBeRefreshed$: Observable<string> = this.filterKeyToBeRefreshedSource.asObservable();
private readonly preferenceService = inject<PreferenceCloudServiceInterface>(PROCESS_FILTERS_SERVICE_TOKEN); protected readonly preferenceService = inject<PreferenceCloudServiceInterface>(PROCESS_FILTERS_SERVICE_TOKEN);
private readonly identityUserService = inject(IdentityUserService); protected readonly identityUserService = inject(IdentityUserService);
private readonly notificationCloudService = inject(NotificationCloudService); private readonly notificationCloudService = inject(NotificationCloudService);
constructor() { constructor() {
@@ -342,7 +342,7 @@ export class ProcessFilterCloudService {
* @param appName Name of the target app * @param appName Name of the target app
* @returns String of process instance filters preference key * @returns String of process instance filters preference key
*/ */
private prepareKey(appName: string): string { protected prepareKey(appName: string): string {
const user = this.identityUserService.getCurrentUserInfo(); const user = this.identityUserService.getCurrentUserInfo();
return `process-filters-${appName}-${user.username}`; return `process-filters-${appName}-${user.username}`;
} }
@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { Injectable, Inject } from '@angular/core'; import { Injectable, inject } from '@angular/core';
import { Observable, of, BehaviorSubject } from 'rxjs'; import { Observable, of, BehaviorSubject } from 'rxjs';
import { ServiceTaskFilterCloudModel } from '../models/filter-cloud.model'; import { ServiceTaskFilterCloudModel } from '../models/filter-cloud.model';
import { switchMap, map } from 'rxjs/operators'; import { switchMap, map } from 'rxjs/operators';
@@ -27,14 +27,11 @@ import { IdentityUserService } from '../../../people/services/identity-user.serv
providedIn: 'root' providedIn: 'root'
}) })
export class ServiceTaskFilterCloudService { export class ServiceTaskFilterCloudService {
private filtersSubject = new BehaviorSubject<ServiceTaskFilterCloudModel[]>([]); private readonly filtersSubject = new BehaviorSubject<ServiceTaskFilterCloudModel[]>([]);
filters$ = this.filtersSubject.asObservable(); readonly filters$ = this.filtersSubject.asObservable();
constructor( protected readonly preferenceService = inject<PreferenceCloudServiceInterface>(TASK_FILTERS_SERVICE_TOKEN);
private identityUserService: IdentityUserService, protected readonly identityUserService = inject(IdentityUserService);
@Inject(TASK_FILTERS_SERVICE_TOKEN)
public preferenceService: PreferenceCloudServiceInterface
) {}
/** /**
* Creates and returns the default task filters for an app. * Creates and returns the default task filters for an app.
@@ -242,7 +239,7 @@ export class ServiceTaskFilterCloudService {
* @param appName Name of the target app * @param appName Name of the target app
* @returns String of task filters preference key * @returns String of task filters preference key
*/ */
private prepareKey(appName: string): string { protected prepareKey(appName: string): string {
return `service-task-filters-${appName}-${this.identityUserService.getCurrentUserInfo().username}`; return `service-task-filters-${appName}-${this.identityUserService.getCurrentUserInfo().username}`;
} }
@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { Injectable, Inject } from '@angular/core'; import { Injectable, inject } from '@angular/core';
import { Observable, of, BehaviorSubject, throwError, Subject } from 'rxjs'; import { Observable, of, BehaviorSubject, throwError, Subject } from 'rxjs';
import { TaskFilterCloudModel } from '../models/filter-cloud.model'; import { TaskFilterCloudModel } from '../models/filter-cloud.model';
import { switchMap, map } from 'rxjs/operators'; import { switchMap, map } from 'rxjs/operators';
@@ -48,15 +48,16 @@ const TASK_EVENT_SUBSCRIPTION_QUERY = `
providedIn: 'root' providedIn: 'root'
}) })
export class TaskFilterCloudService extends BaseCloudService { export class TaskFilterCloudService extends BaseCloudService {
public preferenceService = inject<PreferenceCloudServiceInterface>(TASK_FILTERS_SERVICE_TOKEN);
protected identityUserService = inject(IdentityUserService);
private filtersSubject = new BehaviorSubject<TaskFilterCloudModel[]>([]); private filtersSubject = new BehaviorSubject<TaskFilterCloudModel[]>([]);
filters$ = this.filtersSubject.asObservable(); filters$ = this.filtersSubject.asObservable();
private filterKeyToBeRefreshedSource = new Subject<string>(); private filterKeyToBeRefreshedSource = new Subject<string>();
filterKeyToBeRefreshed$ = this.filterKeyToBeRefreshedSource.asObservable(); filterKeyToBeRefreshed$ = this.filterKeyToBeRefreshedSource.asObservable();
constructor( constructor(
private identityUserService: IdentityUserService,
@Inject(TASK_FILTERS_SERVICE_TOKEN)
public preferenceService: PreferenceCloudServiceInterface,
private notificationCloudService: NotificationCloudService, private notificationCloudService: NotificationCloudService,
adfHttpClient: AdfHttpClient adfHttpClient: AdfHttpClient
) { ) {
@@ -307,7 +308,7 @@ export class TaskFilterCloudService extends BaseCloudService {
* @param appName Name of the target app * @param appName Name of the target app
* @returns String of task filters preference key * @returns String of task filters preference key
*/ */
private prepareKey(appName: string): string { protected prepareKey(appName: string): string {
return `task-filters-${appName}-${this.identityUserService.getCurrentUserInfo().username}`; return `task-filters-${appName}-${this.identityUserService.getCurrentUserInfo().username}`;
} }