Skip to content

Commit b9adaf1

Browse files
authored
Merge pull request #321 from TheJacksonLaboratory/hotfix/search-responsiveness
fixing search responsiveness
2 parents 17f51b4 + 57fe4ee commit b9adaf1

File tree

5 files changed

+29
-21
lines changed

5 files changed

+29
-21
lines changed

src/app/shared/navbar/navbar.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
.navbar-search-wrapper {
110110
line-height: 20px;
111111
font-size: 14px;
112-
height: 100%;
112+
height: 70%;
113113
}
114114

115115
.navbar-search-container {

src/app/shared/search/search/search.component.html

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
<div class="search-wrapper flex flex-row flex-wrap sm:flex-nowrap align-items-center justify-center">
2-
<mat-select class="search-filter sm:flex-[0_0_20%] flex-[0_0_80%] h-[45px]" placeholder="All" [(value)]="navFilter">
3-
<mat-option value="all">All</mat-option>
4-
<mat-option value="term">Term</mat-option>
5-
<mat-option value="disease">Disease</mat-option>
6-
<mat-option value="gene">Gene</mat-option>
7-
</mat-select>
8-
<input class="searchbar flex-[0_0_80%]" matInput placeholder="Search for phenotypes, diseases or genes..."
9-
(input)="contentChanging($event.target.value)"
10-
(keyup.enter)="submitQuery($event.target.value)"
11-
(focus)="toggleDropdown($event)"
12-
[(ngModel)]="queryString" #searchbar>
13-
<div class="search-output mat-elevation-z4 flex-[1_1_100%]" [@searchState]="searchstate">
1+
<div class="search-wrapper flex flex-row flex-wrap align-items-center justify-center">
2+
<div class="w-full flex flex-row flex-wrap sm:flex-nowrap align-items-center justify-center">
3+
<mat-select class="search-filter sm:flex-[0_0_20%] flex-[0_0_80%] h-[45px]" placeholder="All" [(value)]="navFilter">
4+
<mat-option value="all">All</mat-option>
5+
<mat-option value="term">Term</mat-option>
6+
<mat-option value="disease">Disease</mat-option>
7+
<mat-option value="gene">Gene</mat-option>
8+
</mat-select>
9+
<input class="searchbar flex-[0_0_80%]" matInput placeholder="Search for phenotypes, diseases or genes..."
10+
(input)="contentChanging($event.target.value)"
11+
(keyup.enter)="submitQuery($event.target.value)"
12+
(focus)="toggleDropdown($event)"
13+
[(ngModel)]="queryString" #searchbar>
14+
</div>
15+
<div class="search-output mat-elevation-z4 w-[80%] sm:ml-[20%] align-items-center justify-center" [@searchState]="searchstate">
1416
<div class="search-all" *ngIf="!notFoundFlag">
1517
<a routerLink="/browse/search" [queryParams]="{'q': queryText, 'navFilter': 'all'}" *ngIf="queryText">
1618
See all results for '{{queryText}}'
@@ -65,8 +67,11 @@ <h3>Sorry no results have been found!</h3>
6567
</div>
6668
</div>
6769
</div>
68-
<p class="hint w-full" *ngIf="searchstate !== 'active'">
69-
<strong>e.g. <a (click)="setQuery('Arachnodactyly')">Arachnodactyly</a> |
70+
<div class="flex flex-row flex-wrap align-items-center justify-center">
71+
<p class="hint w-full" *ngIf="showHint && searchstate !== 'active'">
72+
<strong>e.g. <a (click)="setQuery('Arachnodactyly')">Arachnodactyly</a> |
7073
<a (click)="setQuery('Marfan syndrome')">Marfan syndrome</a> |
7174
<a (click)="setQuery('FBN1')">FBN1</a></strong>
72-
</p>
75+
</p>
76+
</div>
77+

src/app/shared/search/search/search.component.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ $orange-hover: rgba(236, 151, 54, 0.8);
4242
background-color: white;
4343
position: relative;
4444
z-index: 999;
45+
line-height: 20px;
4546

4647
& .search-all {
4748
padding: 2px 10px 0 10px;
@@ -75,7 +76,7 @@ $orange-hover: rgba(236, 151, 54, 0.8);
7576
font-weight: bold;
7677
margin: 5px 0 0 0;
7778
padding: 5px;
78-
width: 40%;
79+
width: 100%;
7980
background-color: $category-label-green;
8081
color: white;
8182
cursor: default;

src/app/shared/search/search/search.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Router } from '@angular/router';
2-
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
2+
import { Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
33
import { Disease, Gene, SimpleTerm, Term } from '../../../browser/models/models';
44
import { SearchService } from '../service/search.service';
55

@@ -19,7 +19,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
1919
'visibility': 'hidden'
2020
})),
2121
state('active', style({
22-
'max-height': '500px',
22+
'max-height': '750px',
2323
'overflow-y': 'scroll',
2424
'visibility': 'visible'
2525
})),
@@ -31,6 +31,8 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
3131
]
3232
})
3333
export class SearchComponent implements OnInit {
34+
35+
@Input() showHint = false;
3436
terms: Term[] = [];
3537
diseases: SimpleTerm[] = [];
3638
genes: SimpleTerm[] = [];

src/app/static/home/home.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="search-container mat-elevation-z4">
44
<img class="main-logo" src="assets/hpo-logo-white.png"/>
55
<div class="searchbar-container">
6-
<app-search-bar></app-search-bar>
6+
<app-search-bar [showHint]="true"></app-search-bar>
77
</div>
88
</div>
99
</div>

0 commit comments

Comments
 (0)