move search button to extensions

This commit is contained in:
Denys Vuika
2023-03-01 15:45:22 +00:00
committed by Sheena Malhotra
parent be64da15ef
commit 52cbf442d4
9 changed files with 44 additions and 38 deletions

View File

@@ -21,6 +21,5 @@
</div>
</mat-menu>
<adf-toolbar-divider *ngIf="canShowSearchSeparator()"></adf-toolbar-divider>
<aca-search-input class="app-search-input"></aca-search-input>
</adf-toolbar>

View File

@@ -78,8 +78,4 @@ export class HeaderActionsComponent implements OnInit, OnDestroy {
canShowUploadButton(): boolean {
return this.uploadActions.length > 0;
}
canShowSearchSeparator(): boolean {
return this.canShowUploadButton() || this.canShowCreateButton();
}
}

View File

@@ -28,13 +28,6 @@
</mat-form-field>
</div>
<div *ngIf="!searchInputService.isSearchRoute()"
class="app-search-container">
<button mat-icon-button class="app-search-button" (click)="navigateToSearch()" [title]="'SEARCH.BUTTON.TOOLTIP' | translate">
<mat-icon [attr.aria-label]="'SEARCH.BUTTON.ARIA-LABEL' | translate">search</mat-icon>
</button>
</div>
<mat-menu #searchOptionsMenu="matMenu" [overlapTrigger]="true" class="app-search-options-menu">
<div (keydown.tab)="$event.stopPropagation()" (keydown.shift.tab)="$event.stopPropagation()">
<div cdkTrapFocus>

View File

@@ -210,26 +210,6 @@ describe('SearchInputComponent', () => {
});
});
describe('navigateToSearch()', () => {
it('should navigate to search on click of search icon', async () => {
spyOn(searchInputService, 'isSearchRoute').and.returnValue(false);
spyOn(component, 'navigateToSearch').and.callThrough();
spyOn(searchInputService, 'navigateToSearch').and.callThrough();
fixture.detectChanges();
await fixture.whenStable();
const searchIcon = fixture.debugElement.nativeElement.querySelector('.app-search-button');
searchIcon.click();
fixture.detectChanges();
await fixture.whenStable();
expect(component.navigateToSearch).toHaveBeenCalled();
expect(searchInputService.navigateToSearch).toHaveBeenCalledWith();
});
});
describe('exitSearch()', () => {
it('should exit search on click of close icon', async () => {
spyOn(searchInputService, 'isSearchRoute').and.returnValue(true);

View File

@@ -111,10 +111,6 @@ export class SearchInputComponent implements OnInit, OnDestroy {
}
}
navigateToSearch() {
this.searchInputService.navigateToSearch();
}
exitSearch() {
this.searchInputService.navigateBack();
}