mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-2835] Favorites list - incorrect viewer actions when opened via link (#1279)
* stop event propagation * tests
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
"
|
"
|
||||||
class="adf-datatable-cell-value"
|
class="adf-datatable-cell-value"
|
||||||
title="{{ node | adfNodeNameTooltip }}"
|
title="{{ node | adfNodeNameTooltip }}"
|
||||||
(click)="onClick()"
|
(click)="onLinkClick($event)"
|
||||||
>
|
>
|
||||||
{{ displayText$ | async }}
|
{{ displayText$ | async }}
|
||||||
</span>
|
</span>
|
||||||
|
@@ -105,4 +105,21 @@ describe('CustomNameColumnComponent', () => {
|
|||||||
fixture.debugElement.nativeElement.querySelector('aca-locked-by')
|
fixture.debugElement.nativeElement.querySelector('aca-locked-by')
|
||||||
).not.toBe(null);
|
).not.toBe(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should call parent component onClick method', () => {
|
||||||
|
const event = new MouseEvent('click');
|
||||||
|
spyOn(component, 'onClick');
|
||||||
|
|
||||||
|
component.onLinkClick(event);
|
||||||
|
|
||||||
|
expect(component.onClick).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should prevent event propagation', () => {
|
||||||
|
const event = new MouseEvent('click');
|
||||||
|
spyOn(event, 'stopPropagation');
|
||||||
|
|
||||||
|
component.onLinkClick(event);
|
||||||
|
expect(event.stopPropagation).toHaveBeenCalled();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -94,6 +94,11 @@ export class CustomNameColumnComponent extends NameColumnComponent
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onLinkClick(event: Event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
this.onClick();
|
||||||
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
super.ngOnDestroy();
|
super.ngOnDestroy();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user