[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:
Mercy Chrysolite
2020-06-16 14:14:28 +05:30
committed by GitHub
parent 904c7eff7c
commit 0349280d42
13 changed files with 68 additions and 40 deletions

View File

@@ -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": {

View File

@@ -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';

View File

@@ -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;
}
}
/**

View File

@@ -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'
})
];
}