mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-3109] Change order of default process filters for DW (#5760)
* [ACA-3109] Change order of default process filters * Updated strings to constants; Fixed failing e2e * fixed lint * Fixed failed e2e
This commit is contained in:
@@ -102,9 +102,9 @@
|
||||
"COMPLETED_TASKS": "Completed Tasks"
|
||||
},
|
||||
"ADF_CLOUD_PROCESS_FILTERS": {
|
||||
"ALL_PROCESSES": "All Processes",
|
||||
"RUNNING_PROCESSES": "Running Processes",
|
||||
"COMPLETED_PROCESSES": "Completed Processes"
|
||||
"ALL_PROCESSES": "All",
|
||||
"RUNNING_PROCESSES": "Running",
|
||||
"COMPLETED_PROCESSES": "Completed"
|
||||
},
|
||||
"ADF_CLOUD_START_TASK": {
|
||||
"ERROR": {
|
||||
|
@@ -287,6 +287,17 @@ describe('ProcessFiltersCloudComponent', () => {
|
||||
filterButton.click();
|
||||
});
|
||||
|
||||
it('should not emit a filter click event on binding changes', () => {
|
||||
spyOn(component, 'selectFilterAndEmit').and.callThrough();
|
||||
|
||||
const change = new SimpleChange(null, undefined, false);
|
||||
component.ngOnChanges({ 'filterParam': change });
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(component.selectFilterAndEmit).toHaveBeenCalled();
|
||||
expect(component.currentFilter).not.toBeDefined();
|
||||
});
|
||||
|
||||
it('should reload filters by appName on binding changes', () => {
|
||||
spyOn(component, 'getFilters').and.stub();
|
||||
const appName = 'my-app-1';
|
||||
|
@@ -129,8 +129,12 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges, OnDestro
|
||||
* Select and emit the given filter
|
||||
*/
|
||||
public selectFilterAndEmit(newParamFilter: FilterParamsModel) {
|
||||
this.selectFilter(newParamFilter);
|
||||
this.filterClick.emit(this.currentFilter);
|
||||
if (newParamFilter) {
|
||||
this.selectFilter(newParamFilter);
|
||||
this.filterClick.emit(this.currentFilter);
|
||||
} else {
|
||||
this.currentFilter = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -258,15 +258,6 @@ export class ProcessFilterCloudService {
|
||||
*/
|
||||
private defaultProcessFilters(appName: string): ProcessFilterCloudModel[] {
|
||||
return [
|
||||
new ProcessFilterCloudModel({
|
||||
name: 'ADF_CLOUD_PROCESS_FILTERS.ALL_PROCESSES',
|
||||
key: 'all-processes',
|
||||
icon: 'adjust',
|
||||
appName: appName,
|
||||
sort: 'startDate',
|
||||
status: '',
|
||||
order: 'DESC'
|
||||
}),
|
||||
new ProcessFilterCloudModel({
|
||||
name: 'ADF_CLOUD_PROCESS_FILTERS.RUNNING_PROCESSES',
|
||||
icon: 'inbox',
|
||||
@@ -284,6 +275,15 @@ export class ProcessFilterCloudService {
|
||||
sort: 'startDate',
|
||||
status: 'COMPLETED',
|
||||
order: 'DESC'
|
||||
}),
|
||||
new ProcessFilterCloudModel({
|
||||
name: 'ADF_CLOUD_PROCESS_FILTERS.ALL_PROCESSES',
|
||||
key: 'all-processes',
|
||||
icon: 'adjust',
|
||||
appName: appName,
|
||||
sort: 'startDate',
|
||||
status: '',
|
||||
order: 'DESC'
|
||||
})
|
||||
];
|
||||
}
|
||||
|
Reference in New Issue
Block a user