Skip to content

Commit

Permalink
Finer selection of fake search bar in individual item pages
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Feb 5, 2024
1 parent 306ffe7 commit 195894d
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</a>
</div>
<div *ngIf="showSearchBar" class="search-div layout-desktop">
<app-bk-search-bar [fake]='true'></app-bk-search-bar>
<app-bk-search-bar [fake]='fakeSearchBar' (submit)='doSearch($event)'></app-bk-search-bar>
</div>
<div class='mobile-separator'></div>
<div class="menu-links layout-desktop">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class BkHeaderComponent {
@Input() showSearchBar = false;
@Input() showLanguages = false;
@Input() showShare = true;
@Input() fakeSearchBar = true;
public showAuth = false;
public showCollapsedMenu = signal(false);
collapseMenuSub: Subscription | null = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
[autofocus]='!disableAutofocus'
(keyup)="doSearch(searchBox.value)"
(keyup.backspace)="doSearch(searchBox.value)"
(keydown.enter)="doSubmit()"
[value]="searchTerm"
(focus)="isSearchBarHasFocus = true"
(focusout)="isSearchBarHasFocus = false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class BkSearchBar implements OnChanges, AfterViewInit, OnInit {

@Output() selected = new EventEmitter<any>();
@Output() search = new EventEmitter<string>();
@Output() submit = new EventEmitter<string>();

@ViewChild('searchBox') searchBox: ElementRef;
@ViewChild('btnSearchMenu') btnSearchMenu: ElementRef;
Expand Down Expand Up @@ -158,6 +159,11 @@ export class BkSearchBar implements OnChanges, AfterViewInit, OnInit {

this.search.emit(term);
}

doSubmit() {
this.calcExternalUrl();
this.submit.emit(this.externalUrl);
}

openCloseSearchTypeDropDown(event?: Event) {
event?.stopPropagation();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<app-container [showHeader]="true" [showSearchBar]="true" [listSideView]='true' [showShare]="false">
<app-container [showHeader]="true" [showSearchBar]="true" [listSideView]='true' [showShare]="false" [fakeSearchBar]='fakeSearchBar'>
<div #container class="budgetkey-item-wrapper container-fluid" [ngClass]="'style-' + style" *ngIf='init'>
<div class='item-container'>
<app-item-budget0dig *ngIf='prefix("budget/00/")' [item]='item'></app-item-budget0dig>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,7 @@ export class ItemPageComponent implements AfterViewInit, OnInit {
return searchPattern.test(this.itemId);
}

get fakeSearchBar() {
return this.itemId?.indexOf('units/') !== 0 && this.itemId?.indexOf('activities/gov_social_service') !== 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[showSearchBar]="showSearchBar"
[showLanguages]="showLanguages"
[showShare]="showShare"
[fakeSearchBar]="fakeSearchBar"
></app-bk-header>
<div class='scrollable'>
<div class='app'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class AppContainerComponent implements AfterViewInit, OnChanges {
@Input() showShare = true;
@Input() helpWidget = true;
@Input() listSideView = false;
@Input() fakeSearchBar = true;

configured = false;

Expand Down

0 comments on commit 195894d

Please sign in to comment.