mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[AAE-4749] process filter notification fixes (#6773)
* process filter notification fixes * exclude flaky e2e
This commit is contained in:
parent
df8a8fb61f
commit
a5eb5acf5d
@ -8,5 +8,6 @@
|
||||
"C279931": "login problem APS not basic",
|
||||
"C279930": "login problem APS not basic",
|
||||
"C260241": "ADF-5335- this will exclude 2 tests",
|
||||
"C587515": "https://alfresco.atlassian.net/browse/ADF-5340"
|
||||
"C587515": "https://alfresco.atlassian.net/browse/ADF-5340",
|
||||
"C311290": "fix is in the progress by Vito"
|
||||
}
|
||||
|
@ -107,6 +107,17 @@ describe('EditProcessFilterCloudComponent', () => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
it('should not raise filter change events if filter remains the same', () => {
|
||||
let count = 0;
|
||||
component.filterChange.subscribe(() => count++);
|
||||
|
||||
component.processFilter = fakeFilter;
|
||||
component.processFilter = fakeFilter;
|
||||
component.processFilter = fakeFilter;
|
||||
|
||||
expect(count).toBe(1);
|
||||
});
|
||||
|
||||
it('should fetch process instance filter by id', async(() => {
|
||||
const processFilterIdChange = new SimpleChange(null, 'mock-process-filter-id', true);
|
||||
component.ngOnChanges({ 'id': processFilterIdChange });
|
||||
|
@ -103,6 +103,8 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges, OnDes
|
||||
|
||||
@Input()
|
||||
set processFilter(value: ProcessFilterCloudModel) {
|
||||
const isChanged = this.isFilterChanged(this._filter, value);
|
||||
|
||||
this._filter = value;
|
||||
|
||||
if (value?.appName) {
|
||||
@ -118,7 +120,9 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges, OnDes
|
||||
|
||||
this.buildForm(this.processFilterProperties);
|
||||
|
||||
this.filterChange.emit(value);
|
||||
if (isChanged) {
|
||||
this.filterChange.emit(value);
|
||||
}
|
||||
}
|
||||
|
||||
status: Array<DropdownOption> = [
|
||||
@ -637,6 +641,17 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges, OnDes
|
||||
];
|
||||
}
|
||||
|
||||
private isFilterChanged(oldValue: ProcessFilterCloudModel, newValue: ProcessFilterCloudModel): boolean {
|
||||
const oldJson = JSON.stringify(
|
||||
this.processFilterCloudService.writeQueryParams(oldValue || {}, this.filterProperties)
|
||||
);
|
||||
const newJson = JSON.stringify(
|
||||
this.processFilterCloudService.writeQueryParams(newValue || {}, this.filterProperties)
|
||||
);
|
||||
|
||||
return oldJson !== newJson;
|
||||
}
|
||||
|
||||
private createProcessFilterProperties(filterModel: ProcessFilterCloudModel): ProcessFilterProperties[] {
|
||||
const appVersionMultiple = [];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user