mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
Change process and task search api selection from token-provided to input-provided (#10488)
This commit is contained in:
parent
ef2d184578
commit
0278544af1
@ -80,10 +80,11 @@ when the process list is empty:
|
|||||||
| stickyHeader | `boolean` | false | Toggles the sticky header mode. |
|
| stickyHeader | `boolean` | false | Toggles the sticky header mode. |
|
||||||
| suspendedFrom | `string` | "" | Filter the processes. Display only process with suspendedFrom equal to the supplied date. |
|
| suspendedFrom | `string` | "" | Filter the processes. Display only process with suspendedFrom equal to the supplied date. |
|
||||||
| suspendedTo | `string` | "" | Filter the processes. Display only process with suspendedTo equal to the supplied date. |
|
| suspendedTo | `string` | "" | Filter the processes. Display only process with suspendedTo equal to the supplied date. |
|
||||||
| names | `string[]` | [] | Filter the processes. Display only processes with names matching any of the supplied strings. This input will be used only if `PROCESS_SEARCH_API_METHOD_TOKEN` is provided with `POST` value. |
|
| searchApiMethod | `'POST' \| 'GET'` | `'GET'` | The HTTP method to use when searching for tasks. 'POST' value is supported from Activiti 8.7.0 forward. |
|
||||||
initiators | `string[]` | [] | Filter the processes. Display only processes started by any of the users whose usernames are present in the array. This input will be used only if `PROCESS_SEARCH_API_METHOD_TOKEN` is provided with `POST` value. |
|
| names | `string[]` | [] | Filter the processes. Display only processes with names matching any of the supplied strings. This input will be used only if `searchApiMethod` input is provided with `POST` value. |
|
||||||
| appVersions | `string[]` | [] | Filter the processes. Display only processes present in any of the specified app versions. This input will be used only if `PROCESS_SEARCH_API_METHOD_TOKEN` is provided with `POST` value. |
|
initiators | `string[]` | [] | Filter the processes. Display only processes started by any of the users whose usernames are present in the array. This input will be used only if `searchApiMethod` input is provided with `POST` value. |
|
||||||
| statuses | `string[]` | [] | Filter the processes. Display only processes with provided statuses. This input will be used only if `PROCESS_SEARCH_API_METHOD_TOKEN` is provided with `POST` value. |
|
| appVersions | `string[]` | [] | Filter the processes. Display only processes present in any of the specified app versions. This input will be used only if `searchApiMethod` input is provided with `POST` value. |
|
||||||
|
| statuses | `string[]` | [] | Filter the processes. Display only processes with provided statuses. This input will be used only if `searchApiMethod` input is provided with `POST` value. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
|
@ -87,12 +87,13 @@ when the task list is empty:
|
|||||||
| standalone | `boolean` | false | Filter the tasks. Display only the tasks that belong to a process in case is false or tasks that doesn't belong to a process in case of true. |
|
| standalone | `boolean` | false | Filter the tasks. Display only the tasks that belong to a process in case is false or tasks that doesn't belong to a process in case of true. |
|
||||||
| status | `string` | "" | Filter the tasks. Display only tasks with status equal to the supplied value. |
|
| status | `string` | "" | Filter the tasks. Display only tasks with status equal to the supplied value. |
|
||||||
| stickyHeader | `boolean` | false | Toggles the sticky header mode. |
|
| stickyHeader | `boolean` | false | Toggles the sticky header mode. |
|
||||||
| names | `string[]` | [] | Filter the tasks. Display only tasks with names matching any of the supplied strings. This input will be used only if `TASK_SEARCH_API_METHOD_TOKEN` is provided with `POST` value. |
|
| searchApiMethod | `'POST' \| 'GET'` | `'GET'` | The HTTP method to use when searching for tasks. 'POST' value is supported from Activiti 8.7.0 forward. |
|
||||||
| processDefinitionNames | `string[]` | [] | Filter the tasks. Display only tasks under provided processes. This input will be used only if `TASK_SEARCH_API_METHOD_TOKEN` is provided with `POST` value. |
|
| names | `string[]` | [] | Filter the tasks. Display only tasks with names matching any of the supplied strings. This input will be used only if `searchApiMethod` input is provided with `POST` value. |
|
||||||
| statuses | `string[]` | [] | Filter the tasks. Display only tasks with provided statuses. This input will be used only if `TASK_SEARCH_API_METHOD_TOKEN` is provided with `POST` value. |
|
| processDefinitionNames | `string[]` | [] | Filter the tasks. Display only tasks under provided processes. This input will be used only if `searchApiMethod` input is provided with `POST` value. |
|
||||||
| assignees | `string[]` | [] | Filter the tasks. Display only tasks with assignees whose usernames are present in the array. This input will be used only if `TASK_SEARCH_API_METHOD_TOKEN` is provided with `POST` value. |
|
| statuses | `string[]` | [] | Filter the tasks. Display only tasks with provided statuses. This input will be used only if `searchApiMethod` input is provided with `POST` value. |
|
||||||
| priorities | `string[]` | [] | Filter the tasks. Display only tasks with provided priorities. This input will be used only if `TASK_SEARCH_API_METHOD_TOKEN` is provided with `POST` value. |
|
| assignees | `string[]` | [] | Filter the tasks. Display only tasks with assignees whose usernames are present in the array. This input will be used only if `searchApiMethod` input is provided with `POST` value. |
|
||||||
| completedByUsers | `string[]` | [] | Filter the tasks. Display only tasks completed by users whose usernames are present in the array. This input will be used only if `TASK_SEARCH_API_METHOD_TOKEN` is provided with `POST` value. |
|
| priorities | `string[]` | [] | Filter the tasks. Display only tasks with provided priorities. This input will be used only if `searchApiMethod` input is provided with `POST` value. |
|
||||||
|
| completedByUsers | `string[]` | [] | Filter the tasks. Display only tasks completed by users whose usernames are present in the array. This input will be used only if `searchApiMethod` input is provided with `POST` value. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ import { of, throwError } from 'rxjs';
|
|||||||
import { ProcessFilterCloudService } from '../services/process-filter-cloud.service';
|
import { ProcessFilterCloudService } from '../services/process-filter-cloud.service';
|
||||||
import { ProcessFiltersCloudComponent } from './process-filters-cloud.component';
|
import { ProcessFiltersCloudComponent } from './process-filters-cloud.component';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { PROCESS_FILTERS_SERVICE_TOKEN, PROCESS_SEARCH_API_METHOD_TOKEN } from '../../../services/cloud-token.service';
|
import { PROCESS_FILTERS_SERVICE_TOKEN } from '../../../services/cloud-token.service';
|
||||||
import { LocalPreferenceCloudService } from '../../../services/local-preference-cloud.service';
|
import { LocalPreferenceCloudService } from '../../../services/local-preference-cloud.service';
|
||||||
import { mockProcessFilters } from '../mock/process-filters-cloud.mock';
|
import { mockProcessFilters } from '../mock/process-filters-cloud.mock';
|
||||||
import { AppConfigService, AppConfigServiceMock, NoopTranslateModule } from '@alfresco/adf-core';
|
import { AppConfigService, AppConfigServiceMock, NoopTranslateModule } from '@alfresco/adf-core';
|
||||||
@ -44,7 +44,7 @@ describe('ProcessFiltersCloudComponent', () => {
|
|||||||
let getProcessFiltersSpy: jasmine.Spy;
|
let getProcessFiltersSpy: jasmine.Spy;
|
||||||
let getProcessNotificationSubscriptionSpy: jasmine.Spy;
|
let getProcessNotificationSubscriptionSpy: jasmine.Spy;
|
||||||
|
|
||||||
const configureTestingModule = (providers: any[]) => {
|
const configureTestingModule = (searchApiMethod: 'GET' | 'POST') => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [NoopTranslateModule, NoopAnimationsModule, MatListModule],
|
imports: [NoopTranslateModule, NoopAnimationsModule, MatListModule],
|
||||||
providers: [
|
providers: [
|
||||||
@ -56,12 +56,12 @@ describe('ProcessFiltersCloudComponent', () => {
|
|||||||
}},
|
}},
|
||||||
{ provide: ProcessFilterCloudService, useValue: ProcessFilterCloudServiceMock },
|
{ provide: ProcessFilterCloudService, useValue: ProcessFilterCloudServiceMock },
|
||||||
NotificationCloudService,
|
NotificationCloudService,
|
||||||
ApolloModule,
|
ApolloModule
|
||||||
...providers
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(ProcessFiltersCloudComponent);
|
fixture = TestBed.createComponent(ProcessFiltersCloudComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
component.searchApiMethod = searchApiMethod;
|
||||||
|
|
||||||
processFilterService = TestBed.inject(ProcessFilterCloudService);
|
processFilterService = TestBed.inject(ProcessFilterCloudService);
|
||||||
getProcessFiltersSpy = spyOn(processFilterService, 'getProcessFilters').and.returnValue(of(mockProcessFilters));
|
getProcessFiltersSpy = spyOn(processFilterService, 'getProcessFilters').and.returnValue(of(mockProcessFilters));
|
||||||
@ -72,9 +72,9 @@ describe('ProcessFiltersCloudComponent', () => {
|
|||||||
fixture.destroy();
|
fixture.destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('PROCESS_SEARCH_API_METHOD_TOKEN injected with GET value', () => {
|
describe('searchApiMethod set to GET', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
configureTestingModule([{ provide: PROCESS_SEARCH_API_METHOD_TOKEN, useValue: 'GET' }]);
|
configureTestingModule('GET');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should attach specific icon for each filter if hasIcon is true', async () => {
|
it('should attach specific icon for each filter if hasIcon is true', async () => {
|
||||||
@ -229,9 +229,9 @@ describe('ProcessFiltersCloudComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('PROCESS_SEARCH_API_METHOD_TOKEN injected with POST value', () => {
|
describe('searchApiMethod set to POST', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
configureTestingModule([{ provide: PROCESS_SEARCH_API_METHOD_TOKEN, useValue: 'POST' }]);
|
configureTestingModule('POST');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should attach specific icon for each filter if hasIcon is true', async () => {
|
it('should attach specific icon for each filter if hasIcon is true', async () => {
|
||||||
@ -388,7 +388,7 @@ describe('ProcessFiltersCloudComponent', () => {
|
|||||||
|
|
||||||
describe('API agnostic', () => {
|
describe('API agnostic', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
configureTestingModule([]);
|
configureTestingModule('GET');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should emit an error with a bad response', () => {
|
it('should emit an error with a bad response', () => {
|
||||||
|
@ -34,7 +34,6 @@ import { AppConfigService, TranslationService } from '@alfresco/adf-core';
|
|||||||
import { FilterParamsModel } from '../../../task/task-filters/models/filter-cloud.model';
|
import { FilterParamsModel } from '../../../task/task-filters/models/filter-cloud.model';
|
||||||
import { debounceTime, tap } from 'rxjs/operators';
|
import { debounceTime, tap } from 'rxjs/operators';
|
||||||
import { ProcessListCloudService } from '../../../process/process-list/services/process-list-cloud.service';
|
import { ProcessListCloudService } from '../../../process/process-list/services/process-list-cloud.service';
|
||||||
import { PROCESS_SEARCH_API_METHOD_TOKEN } from '../../../services/cloud-token.service';
|
|
||||||
import { ProcessFilterCloudAdapter } from '../../process-list/models/process-cloud-query-request.model';
|
import { ProcessFilterCloudAdapter } from '../../process-list/models/process-cloud-query-request.model';
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
|
|
||||||
@ -49,6 +48,10 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges {
|
|||||||
@Input()
|
@Input()
|
||||||
appName: string = '';
|
appName: string = '';
|
||||||
|
|
||||||
|
/** (optional) From Activiti 8.7.0 forward, use the 'POST' method to get the process count */
|
||||||
|
@Input()
|
||||||
|
searchApiMethod: 'GET' | 'POST' = 'GET';
|
||||||
|
|
||||||
/** (optional) The filter to be selected by default */
|
/** (optional) The filter to be selected by default */
|
||||||
@Input()
|
@Input()
|
||||||
filterParam: FilterParamsModel;
|
filterParam: FilterParamsModel;
|
||||||
@ -90,7 +93,6 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges {
|
|||||||
private readonly translationService = inject(TranslationService);
|
private readonly translationService = inject(TranslationService);
|
||||||
private readonly appConfigService = inject(AppConfigService);
|
private readonly appConfigService = inject(AppConfigService);
|
||||||
private readonly processListCloudService = inject(ProcessListCloudService);
|
private readonly processListCloudService = inject(ProcessListCloudService);
|
||||||
private readonly searchMethod = inject<'GET' | 'POST'>(PROCESS_SEARCH_API_METHOD_TOKEN, { optional: true });
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.enableNotifications = this.appConfigService.get('notifications', true);
|
this.enableNotifications = this.appConfigService.get('notifications', true);
|
||||||
@ -322,7 +324,7 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fetchProcessFilterCounter(filter: ProcessFilterCloudModel): Observable<number> {
|
private fetchProcessFilterCounter(filter: ProcessFilterCloudModel): Observable<number> {
|
||||||
return this.searchMethod === 'POST'
|
return this.searchApiMethod === 'POST'
|
||||||
? this.processListCloudService.getProcessListCounter(new ProcessFilterCloudAdapter(filter))
|
? this.processListCloudService.getProcessListCounter(new ProcessFilterCloudAdapter(filter))
|
||||||
: this.processListCloudService.getProcessCounter(filter.appName, filter.status)
|
: this.processListCloudService.getProcessCounter(filter.appName, filter.status)
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ import { of } from 'rxjs';
|
|||||||
import { shareReplay, skip } from 'rxjs/operators';
|
import { shareReplay, skip } from 'rxjs/operators';
|
||||||
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
|
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
|
||||||
import { ProcessListCloudSortingModel } from '../models/process-list-sorting.model';
|
import { ProcessListCloudSortingModel } from '../models/process-list-sorting.model';
|
||||||
import { PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN, PROCESS_SEARCH_API_METHOD_TOKEN } from '../../../services/cloud-token.service';
|
import { PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN } from '../../../services/cloud-token.service';
|
||||||
import { ProcessListCloudPreferences } from '../models/process-cloud-preferences';
|
import { ProcessListCloudPreferences } from '../models/process-cloud-preferences';
|
||||||
import { PROCESS_LIST_CUSTOM_VARIABLE_COLUMN } from '../../../models/data-column-custom-data';
|
import { PROCESS_LIST_CUSTOM_VARIABLE_COLUMN } from '../../../models/data-column-custom-data';
|
||||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||||
@ -76,10 +76,9 @@ describe('ProcessListCloudComponent', () => {
|
|||||||
const fakeCustomSchemaName = 'fakeCustomSchema';
|
const fakeCustomSchemaName = 'fakeCustomSchema';
|
||||||
const schemaWithVariable = 'schemaWithVariableId';
|
const schemaWithVariable = 'schemaWithVariableId';
|
||||||
|
|
||||||
const configureTestingModule = (providers: any[]) => {
|
const configureTestingModule = (searchApiMethod: 'GET' | 'POST') => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [ProcessServiceCloudTestingModule],
|
imports: [ProcessServiceCloudTestingModule]
|
||||||
providers: providers
|
|
||||||
});
|
});
|
||||||
appConfig = TestBed.inject(AppConfigService);
|
appConfig = TestBed.inject(AppConfigService);
|
||||||
processListCloudService = TestBed.inject(ProcessListCloudService);
|
processListCloudService = TestBed.inject(ProcessListCloudService);
|
||||||
@ -118,6 +117,7 @@ describe('ProcessListCloudComponent', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
component.searchApiMethod = searchApiMethod;
|
||||||
component.isColumnSchemaCreated$ = of(true).pipe(shareReplay(1));
|
component.isColumnSchemaCreated$ = of(true).pipe(shareReplay(1));
|
||||||
loader = TestbedHarnessEnvironment.loader(fixture);
|
loader = TestbedHarnessEnvironment.loader(fixture);
|
||||||
};
|
};
|
||||||
@ -126,9 +126,9 @@ describe('ProcessListCloudComponent', () => {
|
|||||||
fixture.destroy();
|
fixture.destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('PROCESS_SEARCH_API_METHOD_TOKEN injected with GET value', () => {
|
describe('searchApiMethod set to GET', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
configureTestingModule([{ provide: PROCESS_SEARCH_API_METHOD_TOKEN, useValue: 'GET' }]);
|
configureTestingModule('GET');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should load spinner and show the content', async () => {
|
it('should load spinner and show the content', async () => {
|
||||||
@ -420,9 +420,9 @@ describe('ProcessListCloudComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('PROCESS_SEARCH_API_METHOD_TOKEN injected with POST value', () => {
|
describe('searchApiMethod set to POST', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
configureTestingModule([{ provide: PROCESS_SEARCH_API_METHOD_TOKEN, useValue: 'POST' }]);
|
configureTestingModule('POST');
|
||||||
component.appName = 'fake-app-name';
|
component.appName = 'fake-app-name';
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -698,7 +698,7 @@ describe('ProcessListCloudComponent', () => {
|
|||||||
|
|
||||||
describe('API agnostic', () => {
|
describe('API agnostic', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
configureTestingModule([]);
|
configureTestingModule('GET');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should use the default schemaColumn', () => {
|
it('should use the default schemaColumn', () => {
|
||||||
|
@ -23,7 +23,6 @@ import {
|
|||||||
Inject,
|
Inject,
|
||||||
Input,
|
Input,
|
||||||
OnChanges,
|
OnChanges,
|
||||||
Optional,
|
|
||||||
Output,
|
Output,
|
||||||
SimpleChanges,
|
SimpleChanges,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
@ -51,10 +50,7 @@ import { ProcessListRequestModel, ProcessQueryCloudRequestModel } from '../model
|
|||||||
import { ProcessListCloudSortingModel, ProcessListRequestSortingModel } from '../models/process-list-sorting.model';
|
import { ProcessListCloudSortingModel, ProcessListRequestSortingModel } from '../models/process-list-sorting.model';
|
||||||
import { filter, map, switchMap, take, tap } from 'rxjs/operators';
|
import { filter, map, switchMap, take, tap } from 'rxjs/operators';
|
||||||
import { PreferenceCloudServiceInterface } from '../../../services/preference-cloud.interface';
|
import { PreferenceCloudServiceInterface } from '../../../services/preference-cloud.interface';
|
||||||
import {
|
import { PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN } from '../../../services/cloud-token.service';
|
||||||
PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN,
|
|
||||||
PROCESS_SEARCH_API_METHOD_TOKEN
|
|
||||||
} from '../../../services/cloud-token.service';
|
|
||||||
import { ProcessListCloudPreferences } from '../models/process-cloud-preferences';
|
import { ProcessListCloudPreferences } from '../models/process-cloud-preferences';
|
||||||
import { ProcessListDatatableAdapter } from '../datatable/process-list-datatable-adapter';
|
import { ProcessListDatatableAdapter } from '../datatable/process-list-datatable-adapter';
|
||||||
import {
|
import {
|
||||||
@ -216,58 +212,62 @@ export class ProcessListCloudComponent
|
|||||||
@Input()
|
@Input()
|
||||||
isResizingEnabled: boolean = false;
|
isResizingEnabled: boolean = false;
|
||||||
|
|
||||||
|
/** From Activiti 8.7.0 forward, use 'POST' value and array inputs to enable advanced filtering. */
|
||||||
|
@Input()
|
||||||
|
searchApiMethod: 'GET' | 'POST' = 'GET';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the processes. Display only processes with names matching any of the supplied strings.
|
* Filter the processes. Display only processes with names matching any of the supplied strings.
|
||||||
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
names: string[] = [];
|
names: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the processes. Display only processes with instance Ids matching any of the supplied strings.
|
* Filter the processes. Display only processes with instance Ids matching any of the supplied strings.
|
||||||
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
ids: string[] = [];
|
ids: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the processes. Display only processes with parent Ids matching any of the supplied strings.
|
* Filter the processes. Display only processes with parent Ids matching any of the supplied strings.
|
||||||
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
parentIds: string[] = [];
|
parentIds: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the processes. Display only processes with definition names matching any of the supplied strings.
|
* Filter the processes. Display only processes with definition names matching any of the supplied strings.
|
||||||
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
processDefinitionNames: string[] = [];
|
processDefinitionNames: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the processes. Display only processes started by any of the users whose usernames are present in the array.
|
* Filter the processes. Display only processes started by any of the users whose usernames are present in the array.
|
||||||
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
initiators: string[] = [];
|
initiators: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the processes. Display only processes present in any of the specified app versions.
|
* Filter the processes. Display only processes present in any of the specified app versions.
|
||||||
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
appVersions: string[] = [];
|
appVersions: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the processes. Display only processes with provided statuses.
|
* Filter the processes. Display only processes with provided statuses.
|
||||||
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
statuses: string[] = [];
|
statuses: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the processes. Display only processes with specific process variables.
|
* Filter the processes. Display only processes with specific process variables.
|
||||||
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
processVariables: ProcessVariableFilterModel[];
|
processVariables: ProcessVariableFilterModel[];
|
||||||
@ -318,7 +318,6 @@ export class ProcessListCloudComponent
|
|||||||
private fetchProcessesTrigger$ = new Subject<void>();
|
private fetchProcessesTrigger$ = new Subject<void>();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(PROCESS_SEARCH_API_METHOD_TOKEN) @Optional() private searchMethod: 'GET' | 'POST',
|
|
||||||
private processListCloudService: ProcessListCloudService,
|
private processListCloudService: ProcessListCloudService,
|
||||||
appConfigService: AppConfigService,
|
appConfigService: AppConfigService,
|
||||||
private userPreferences: UserPreferencesService,
|
private userPreferences: UserPreferencesService,
|
||||||
@ -343,7 +342,7 @@ export class ProcessListCloudComponent
|
|||||||
tap(() => this.isLoading = true),
|
tap(() => this.isLoading = true),
|
||||||
filter(([isColumnSchemaCreated]) => isColumnSchemaCreated),
|
filter(([isColumnSchemaCreated]) => isColumnSchemaCreated),
|
||||||
switchMap(() => {
|
switchMap(() => {
|
||||||
if (this.searchMethod === 'POST') {
|
if (this.searchApiMethod === 'POST') {
|
||||||
const requestNode = this.createProcessListRequestNode();
|
const requestNode = this.createProcessListRequestNode();
|
||||||
this.processListRequestNode = requestNode;
|
this.processListRequestNode = requestNode;
|
||||||
return this.processListCloudService.fetchProcessList(requestNode).pipe(take(1));
|
return this.processListCloudService.fetchProcessList(requestNode).pipe(take(1));
|
||||||
|
@ -28,15 +28,3 @@ export const PROCESS_FILTERS_SERVICE_TOKEN = new InjectionToken<PreferenceCloudS
|
|||||||
export const TASK_FILTERS_SERVICE_TOKEN = new InjectionToken<PreferenceCloudServiceInterface>('task-filters-cloud');
|
export const TASK_FILTERS_SERVICE_TOKEN = new InjectionToken<PreferenceCloudServiceInterface>('task-filters-cloud');
|
||||||
|
|
||||||
export const TASK_LIST_CLOUD_TOKEN = new InjectionToken<TaskListCloudServiceInterface>('task-list-cloud');
|
export const TASK_LIST_CLOUD_TOKEN = new InjectionToken<TaskListCloudServiceInterface>('task-list-cloud');
|
||||||
|
|
||||||
/**
|
|
||||||
* Token used to indicate the API used to search for tasks.
|
|
||||||
* 'POST' value should be provided only if the used Activiti version is 8.7.0 or higher.
|
|
||||||
*/
|
|
||||||
export const TASK_SEARCH_API_METHOD_TOKEN = new InjectionToken<'GET' | 'POST'>('task-search-method');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Token used to indicate the API used to search for processes.
|
|
||||||
* 'POST' value should be provided only if the used Activiti version is 8.7.0 or higher.
|
|
||||||
*/
|
|
||||||
export const PROCESS_SEARCH_API_METHOD_TOKEN = new InjectionToken<'GET' | 'POST'>('process-search-method');
|
|
||||||
|
@ -20,7 +20,7 @@ import { SimpleChange } from '@angular/core';
|
|||||||
import { ComponentFixture, TestBed, fakeAsync } from '@angular/core/testing';
|
import { ComponentFixture, TestBed, fakeAsync } from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { first, of, throwError } from 'rxjs';
|
import { first, of, throwError } from 'rxjs';
|
||||||
import { TASK_FILTERS_SERVICE_TOKEN, TASK_SEARCH_API_METHOD_TOKEN } from '../../../services/cloud-token.service';
|
import { TASK_FILTERS_SERVICE_TOKEN } from '../../../services/cloud-token.service';
|
||||||
import { LocalPreferenceCloudService } from '../../../services/local-preference-cloud.service';
|
import { LocalPreferenceCloudService } from '../../../services/local-preference-cloud.service';
|
||||||
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
|
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
|
||||||
import { defaultTaskFiltersMock, fakeGlobalFilter, taskNotifications } from '../mock/task-filters-cloud.mock';
|
import { defaultTaskFiltersMock, fakeGlobalFilter, taskNotifications } from '../mock/task-filters-cloud.mock';
|
||||||
@ -45,10 +45,10 @@ describe('TaskFiltersCloudComponent', () => {
|
|||||||
let getTaskListFiltersSpy: jasmine.Spy;
|
let getTaskListFiltersSpy: jasmine.Spy;
|
||||||
let getTaskListCounterSpy: jasmine.Spy;
|
let getTaskListCounterSpy: jasmine.Spy;
|
||||||
|
|
||||||
const configureTestingModule = (providers: any[]) => {
|
const configureTestingModule = (searchApiMethod: 'GET' | 'POST') => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [ProcessServiceCloudTestingModule, TaskFiltersCloudModule],
|
imports: [ProcessServiceCloudTestingModule, TaskFiltersCloudModule],
|
||||||
providers: [{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }, ...providers]
|
providers: [{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }]
|
||||||
});
|
});
|
||||||
taskFilterService = TestBed.inject(TaskFilterCloudService);
|
taskFilterService = TestBed.inject(TaskFilterCloudService);
|
||||||
taskListService = TestBed.inject(TaskListCloudService);
|
taskListService = TestBed.inject(TaskListCloudService);
|
||||||
@ -62,15 +62,17 @@ describe('TaskFiltersCloudComponent', () => {
|
|||||||
fixture = TestBed.createComponent(TaskFiltersCloudComponent);
|
fixture = TestBed.createComponent(TaskFiltersCloudComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
loader = TestbedHarnessEnvironment.loader(fixture);
|
loader = TestbedHarnessEnvironment.loader(fixture);
|
||||||
|
|
||||||
|
component.searchApiMethod = searchApiMethod;
|
||||||
};
|
};
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
fixture.destroy();
|
fixture.destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('TASK_SEARCH_API_METHOD_TOKEN injected with GET value', () => {
|
describe('searchApiMethod set to GET', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
configureTestingModule([{ provide: TASK_SEARCH_API_METHOD_TOKEN, useValue: 'GET' }]);
|
configureTestingModule('GET');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should attach specific icon for each filter if hasIcon is true', async () => {
|
it('should attach specific icon for each filter if hasIcon is true', async () => {
|
||||||
@ -242,9 +244,9 @@ describe('TaskFiltersCloudComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('TASK_SEARCH_API_METHOD_TOKEN injected with POST value', () => {
|
describe('searchApiMethod set to POST', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
configureTestingModule([{ provide: TASK_SEARCH_API_METHOD_TOKEN, useValue: 'POST' }]);
|
configureTestingModule('POST');
|
||||||
component.showIcons = true;
|
component.showIcons = true;
|
||||||
component.appName = 'my-app-1';
|
component.appName = 'my-app-1';
|
||||||
});
|
});
|
||||||
@ -360,7 +362,7 @@ describe('TaskFiltersCloudComponent', () => {
|
|||||||
|
|
||||||
describe('API agnostic', () => {
|
describe('API agnostic', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
configureTestingModule([]);
|
configureTestingModule('GET');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should emit an error with a bad response', (done) => {
|
it('should emit an error with a bad response', (done) => {
|
||||||
|
@ -19,6 +19,7 @@ import {
|
|||||||
Component,
|
Component,
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
inject,
|
inject,
|
||||||
|
Input,
|
||||||
OnChanges,
|
OnChanges,
|
||||||
OnInit,
|
OnInit,
|
||||||
Output,
|
Output,
|
||||||
@ -35,7 +36,6 @@ import { TaskDetailsCloudModel } from '../../start-task/models/task-details-clou
|
|||||||
import { TaskCloudEngineEvent } from '../../../models/engine-event-cloud.model';
|
import { TaskCloudEngineEvent } from '../../../models/engine-event-cloud.model';
|
||||||
import { TaskListCloudService } from '../../task-list/services/task-list-cloud.service';
|
import { TaskListCloudService } from '../../task-list/services/task-list-cloud.service';
|
||||||
import { TaskFilterCloudAdapter } from '../../../models/filter-cloud-model';
|
import { TaskFilterCloudAdapter } from '../../../models/filter-cloud-model';
|
||||||
import { TASK_SEARCH_API_METHOD_TOKEN } from '../../../services/cloud-token.service';
|
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -45,6 +45,10 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class TaskFiltersCloudComponent extends BaseTaskFiltersCloudComponent implements OnInit, OnChanges {
|
export class TaskFiltersCloudComponent extends BaseTaskFiltersCloudComponent implements OnInit, OnChanges {
|
||||||
|
/** (optional) From Activiti 8.7.0 forward, use the 'POST' method to get the task count. */
|
||||||
|
@Input()
|
||||||
|
searchApiMethod: 'GET' | 'POST' = 'GET';
|
||||||
|
|
||||||
/** Emitted when a filter is being selected based on the filterParam input. */
|
/** Emitted when a filter is being selected based on the filterParam input. */
|
||||||
@Output()
|
@Output()
|
||||||
filterSelected = new EventEmitter<TaskFilterCloudModel>();
|
filterSelected = new EventEmitter<TaskFilterCloudModel>();
|
||||||
@ -71,7 +75,6 @@ export class TaskFiltersCloudComponent extends BaseTaskFiltersCloudComponent imp
|
|||||||
private readonly taskListCloudService = inject(TaskListCloudService);
|
private readonly taskListCloudService = inject(TaskListCloudService);
|
||||||
private readonly translationService = inject(TranslationService);
|
private readonly translationService = inject(TranslationService);
|
||||||
private readonly appConfigService = inject(AppConfigService);
|
private readonly appConfigService = inject(AppConfigService);
|
||||||
private readonly searchMethod = inject<'GET' | 'POST'>(TASK_SEARCH_API_METHOD_TOKEN, { optional: true });
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.enableNotifications = this.appConfigService.get('notifications', true);
|
this.enableNotifications = this.appConfigService.get('notifications', true);
|
||||||
@ -151,7 +154,7 @@ export class TaskFiltersCloudComponent extends BaseTaskFiltersCloudComponent imp
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fetchTaskFilterCounter(filter: TaskFilterCloudModel): Observable<number> {
|
private fetchTaskFilterCounter(filter: TaskFilterCloudModel): Observable<number> {
|
||||||
return this.searchMethod === 'POST'
|
return this.searchApiMethod === 'POST'
|
||||||
? this.taskListCloudService.getTaskListCounter(new TaskFilterCloudAdapter(filter))
|
? this.taskListCloudService.getTaskListCounter(new TaskFilterCloudAdapter(filter))
|
||||||
: this.taskFilterCloudService.getTaskFilterCounter(filter);
|
: this.taskFilterCloudService.getTaskFilterCounter(filter);
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ import { ProcessServiceCloudTestingModule } from '../../../testing/process-servi
|
|||||||
import { TaskListCloudSortingModel } from '../../../models/task-list-sorting.model';
|
import { TaskListCloudSortingModel } from '../../../models/task-list-sorting.model';
|
||||||
import { shareReplay, skip } from 'rxjs/operators';
|
import { shareReplay, skip } from 'rxjs/operators';
|
||||||
import { TaskListCloudServiceInterface } from '../../../services/task-list-cloud.service.interface';
|
import { TaskListCloudServiceInterface } from '../../../services/task-list-cloud.service.interface';
|
||||||
import { TASK_LIST_CLOUD_TOKEN, TASK_LIST_PREFERENCES_SERVICE_TOKEN, TASK_SEARCH_API_METHOD_TOKEN } from '../../../services/cloud-token.service';
|
import { TASK_LIST_CLOUD_TOKEN, TASK_LIST_PREFERENCES_SERVICE_TOKEN } from '../../../services/cloud-token.service';
|
||||||
import { TaskListCloudModule } from '../task-list-cloud.module';
|
import { TaskListCloudModule } from '../task-list-cloud.module';
|
||||||
import { PreferenceCloudServiceInterface } from '../../../services/preference-cloud.interface';
|
import { PreferenceCloudServiceInterface } from '../../../services/preference-cloud.interface';
|
||||||
import { HarnessLoader } from '@angular/cdk/testing';
|
import { HarnessLoader } from '@angular/cdk/testing';
|
||||||
@ -94,7 +94,7 @@ describe('TaskListCloudComponent', () => {
|
|||||||
updatePreference: of({})
|
updatePreference: of({})
|
||||||
});
|
});
|
||||||
|
|
||||||
const configureTestingModule = (providers: any[]) => {
|
const configureTestingModule = (searchApiMethod: 'GET' | 'POST') => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [ProcessServiceCloudTestingModule],
|
imports: [ProcessServiceCloudTestingModule],
|
||||||
providers: [
|
providers: [
|
||||||
@ -105,8 +105,7 @@ describe('TaskListCloudComponent', () => {
|
|||||||
{
|
{
|
||||||
provide: TASK_LIST_PREFERENCES_SERVICE_TOKEN,
|
provide: TASK_LIST_PREFERENCES_SERVICE_TOKEN,
|
||||||
useValue: preferencesService
|
useValue: preferencesService
|
||||||
},
|
}
|
||||||
...providers
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
appConfig = TestBed.inject(AppConfigService);
|
appConfig = TestBed.inject(AppConfigService);
|
||||||
@ -134,6 +133,7 @@ describe('TaskListCloudComponent', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
component.searchApiMethod = searchApiMethod;
|
||||||
component.isColumnSchemaCreated$ = of(true).pipe(shareReplay(1));
|
component.isColumnSchemaCreated$ = of(true).pipe(shareReplay(1));
|
||||||
loader = TestbedHarnessEnvironment.loader(fixture);
|
loader = TestbedHarnessEnvironment.loader(fixture);
|
||||||
};
|
};
|
||||||
@ -142,9 +142,9 @@ describe('TaskListCloudComponent', () => {
|
|||||||
fixture.destroy();
|
fixture.destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('TASK_SEARCH_API_METHOD_TOKEN injected with GET value', () => {
|
describe('searchApiMethod set to GET', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
configureTestingModule([{ provide: TASK_SEARCH_API_METHOD_TOKEN, useValue: 'GET' }]);
|
configureTestingModule('GET');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should load spinner and show the content', async () => {
|
it('should load spinner and show the content', async () => {
|
||||||
@ -285,9 +285,9 @@ describe('TaskListCloudComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('TASK_SEARCH_API_METHOD_TOKEN injected with POST value', () => {
|
describe('searchApiMethod set to POST', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
configureTestingModule([{ provide: TASK_SEARCH_API_METHOD_TOKEN, useValue: 'POST' }]);
|
configureTestingModule('POST');
|
||||||
component.appName = 'mock-app-name';
|
component.appName = 'mock-app-name';
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -428,7 +428,7 @@ describe('TaskListCloudComponent', () => {
|
|||||||
|
|
||||||
describe('API agnostic', () => {
|
describe('API agnostic', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
configureTestingModule([]);
|
configureTestingModule('GET');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be able to inject TaskListCloudService instance', () => {
|
it('should be able to inject TaskListCloudService instance', () => {
|
||||||
|
@ -15,12 +15,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, Inject, Input, Optional, ViewEncapsulation } from '@angular/core';
|
import { Component, Inject, Input, ViewEncapsulation } from '@angular/core';
|
||||||
import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
|
import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
|
||||||
import { TaskListRequestModel, TaskQueryCloudRequestModel } from '../../../models/filter-cloud-model';
|
import { TaskListRequestModel, TaskQueryCloudRequestModel } from '../../../models/filter-cloud-model';
|
||||||
import { BaseTaskListCloudComponent } from './base-task-list-cloud.component';
|
import { BaseTaskListCloudComponent } from './base-task-list-cloud.component';
|
||||||
import { TaskCloudService } from '../../services/task-cloud.service';
|
import { TaskCloudService } from '../../services/task-cloud.service';
|
||||||
import { TASK_LIST_CLOUD_TOKEN, TASK_LIST_PREFERENCES_SERVICE_TOKEN, TASK_SEARCH_API_METHOD_TOKEN } from '../../../services/cloud-token.service';
|
import { TASK_LIST_CLOUD_TOKEN, TASK_LIST_PREFERENCES_SERVICE_TOKEN } from '../../../services/cloud-token.service';
|
||||||
import { PreferenceCloudServiceInterface } from '../../../services/preference-cloud.interface';
|
import { PreferenceCloudServiceInterface } from '../../../services/preference-cloud.interface';
|
||||||
import { TaskListCloudServiceInterface } from '../../../services/task-list-cloud.service.interface';
|
import { TaskListCloudServiceInterface } from '../../../services/task-list-cloud.service.interface';
|
||||||
import { BehaviorSubject, combineLatest, Subject } from 'rxjs';
|
import { BehaviorSubject, combineLatest, Subject } from 'rxjs';
|
||||||
@ -148,79 +148,83 @@ export class TaskListCloudComponent extends BaseTaskListCloudComponent<ProcessLi
|
|||||||
@Input()
|
@Input()
|
||||||
candidateGroupId: string = '';
|
candidateGroupId: string = '';
|
||||||
|
|
||||||
|
/** From Activiti 8.7.0 forward, use the 'POST' value and array inputs to enable advanced filtering. */
|
||||||
|
@Input()
|
||||||
|
searchApiMethod: 'GET' | 'POST' = 'GET';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the tasks. Display only tasks with names matching any of the supplied strings.
|
* Filter the tasks. Display only tasks with names matching any of the supplied strings.
|
||||||
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
names: string[] = [];
|
names: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the tasks. Display only tasks with assignees whose usernames are present in the array.
|
* Filter the tasks. Display only tasks with assignees whose usernames are present in the array.
|
||||||
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
assignees: string[] = [];
|
assignees: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the tasks. Display only tasks with provided statuses.
|
* Filter the tasks. Display only tasks with provided statuses.
|
||||||
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
statuses: string[] = [];
|
statuses: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the tasks. Display only tasks under processes with provided definition names.
|
* Filter the tasks. Display only tasks under processes with provided definition names.
|
||||||
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
processDefinitionNames: string[] = [];
|
processDefinitionNames: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the tasks. Display only tasks with Ids matching any of the supplied strings.
|
* Filter the tasks. Display only tasks with Ids matching any of the supplied strings.
|
||||||
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
ids: string[] = [];
|
ids: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the tasks. Display only tasks with parentTaskIds matching any of the supplied strings.
|
* Filter the tasks. Display only tasks with parentTaskIds matching any of the supplied strings.
|
||||||
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
parentIds: string[] = [];
|
parentIds: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the tasks. Display only tasks with processInstanceIds matching any of the supplied strings.
|
* Filter the tasks. Display only tasks with processInstanceIds matching any of the supplied strings.
|
||||||
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
processInstanceIds: string[] = [];
|
processInstanceIds: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the tasks. Display only tasks under processes with provided names.
|
* Filter the tasks. Display only tasks under processes with provided names.
|
||||||
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
processNames: string[] = [];
|
processNames: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the tasks. Display only tasks with provided priorities.
|
* Filter the tasks. Display only tasks with provided priorities.
|
||||||
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
priorities: string[] = [];
|
priorities: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the tasks. Display only tasks completed by users whose usernames are present in the array.
|
* Filter the tasks. Display only tasks completed by users whose usernames are present in the array.
|
||||||
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
completedByUsers: string[] = [];
|
completedByUsers: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the processes. Display only processes with specific process variables.
|
* Filter the processes. Display only processes with specific process variables.
|
||||||
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if searchApiMethod input is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
processVariableFilters: ProcessVariableFilterModel[];
|
processVariableFilters: ProcessVariableFilterModel[];
|
||||||
@ -236,7 +240,6 @@ export class TaskListCloudComponent extends BaseTaskListCloudComponent<ProcessLi
|
|||||||
private fetchProcessesTrigger$ = new Subject<void>();
|
private fetchProcessesTrigger$ = new Subject<void>();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(TASK_SEARCH_API_METHOD_TOKEN) @Optional() private searchMethod: 'GET' | 'POST',
|
|
||||||
@Inject(TASK_LIST_CLOUD_TOKEN) public taskListCloudService: TaskListCloudServiceInterface,
|
@Inject(TASK_LIST_CLOUD_TOKEN) public taskListCloudService: TaskListCloudServiceInterface,
|
||||||
appConfigService: AppConfigService,
|
appConfigService: AppConfigService,
|
||||||
taskCloudService: TaskCloudService,
|
taskCloudService: TaskCloudService,
|
||||||
@ -251,7 +254,7 @@ export class TaskListCloudComponent extends BaseTaskListCloudComponent<ProcessLi
|
|||||||
tap(() => this.isReloadingSubject$.next(true)),
|
tap(() => this.isReloadingSubject$.next(true)),
|
||||||
filter((isColumnSchemaCreated) => !!isColumnSchemaCreated),
|
filter((isColumnSchemaCreated) => !!isColumnSchemaCreated),
|
||||||
switchMap(() => {
|
switchMap(() => {
|
||||||
if (this.searchMethod === 'POST') {
|
if (this.searchApiMethod === 'POST') {
|
||||||
const requestNode = this.createTaskListRequestNode();
|
const requestNode = this.createTaskListRequestNode();
|
||||||
return this.taskListCloudService.fetchTaskList(requestNode).pipe(take(1));
|
return this.taskListCloudService.fetchTaskList(requestNode).pipe(take(1));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user