fix "ng lint" command (#5012)

* update to latest js-api

* fix the "ng lint" command

* fix linting issues

* fix lint issues

* lint fixes

* code fixes

* fix html

* fix html

* update tests

* test fixes

* update tests

* fix tests and api

* fix code
This commit is contained in:
Denys Vuika
2019-08-29 16:35:30 +01:00
committed by Eugenio Romano
parent 140c64b79f
commit edc0945f39
162 changed files with 537 additions and 530 deletions

View File

@@ -514,7 +514,7 @@ describe('SearchControlComponent', () => {
it('should set deactivate the search after element is clicked', (done) => {
spyOn(component, 'isSearchBarActive').and.returnValue(true);
searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results))));
const clickDisposable = component.optionClicked.subscribe((item) => {
const clickDisposable = component.optionClicked.subscribe(() => {
expect(component.subscriptAnimationState.value).toBe('inactive');
clickDisposable.unsubscribe();
done();
@@ -533,7 +533,7 @@ describe('SearchControlComponent', () => {
it('should NOT reset the search term after element is clicked', (done) => {
spyOn(component, 'isSearchBarActive').and.returnValue(true);
searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results))));
const clickDisposable = component.optionClicked.subscribe((item) => {
const clickDisposable = component.optionClicked.subscribe(() => {
expect(component.searchTerm).not.toBeFalsy();
expect(component.searchTerm).toBe('TEST');
clickDisposable.unsubscribe();

View File

@@ -178,14 +178,14 @@ export class SearchTriggerDirective implements ControlValueAccessor, OnDestroy {
let isPanelOption: boolean = false;
if ( event ) {
const clickTarget = event.target as HTMLElement;
isPanelOption = !this.isNoResultOption(event) &&
isPanelOption = !this.isNoResultOption() &&
!!this.searchPanel.panel &&
!!this.searchPanel.panel.nativeElement.contains(clickTarget);
}
return isPanelOption;
}
private isNoResultOption(event: MouseEvent) {
private isNoResultOption() {
return this.searchPanel.results.list ? this.searchPanel.results.list.entries.length === 0 : true;
}