Skip to content

Commit 07b395b

Browse files
authored
Merge pull request #328 from TheJacksonLaboratory/feature/feedback-form
Feature/feedback form
2 parents 30c8958 + 615ce82 commit 07b395b

15 files changed

+134
-39
lines changed

src/app/app.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,5 @@ <h3 class="center menuTitle">Menu</h3>
7272
<router-outlet></router-outlet>
7373
</div>
7474
<app-footer class="mat-elevation-z4"></app-footer>
75+
<app-floating-feedback></app-floating-feedback>
7576
</mat-sidenav-container>

src/app/app.component.spec.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { TestBed, waitForAsync } from '@angular/core/testing';
22
import { NavbarComponent } from './shared/navbar/navbar.component';
33
import { FooterComponent } from './shared/footer/footer.component';
44
import { AppComponent } from './app.component';
5-
import { RouterTestingModule } from '@angular/router/testing';
65
import { environment } from '../environments/environment';
76
import { provideHttpClientTesting } from '@angular/common/http/testing';
87
import { GlobalMaterialModules } from './shared/modules/global.module';
@@ -13,23 +12,27 @@ import { NewsService } from './shared/news/news.service';
1312
import { SearchModule } from './shared/search/search.module';
1413
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
1514
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
16-
15+
import { FloatingFeedbackComponent } from './shared/floating-feedback/floating-feedback.component';
16+
import { provideRouter, RouterOutlet } from '@angular/router';
17+
import { provideLocationMocks } from '@angular/common/testing';
1718

1819
describe('AppComponent', () => {
1920
beforeEach(waitForAsync(() => {
2021
TestBed.configureTestingModule({
2122
declarations: [
2223
AppComponent,
2324
NavbarComponent,
24-
FooterComponent
25+
FooterComponent,
26+
FloatingFeedbackComponent
2527
],
26-
imports: [RouterTestingModule,
28+
imports: [
2729
GlobalMaterialModules,
2830
FormsModule,
2931
ExtrasModule,
3032
SearchModule,
31-
NoopAnimationsModule],
32-
providers: [SearchService, NewsService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
33+
NoopAnimationsModule, RouterOutlet],
34+
providers: [SearchService, NewsService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), provideRouter([]), // Pass your routes here if needed
35+
provideLocationMocks()]
3336
}).compileComponents();
3437
}));
3538

src/app/app.module.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,27 @@ import { NoPageFoundComponent } from './error/no-page-found.component';
1919
import { SearchModule } from './shared/search/search.module';
2020
import { NewsService } from './shared/news/news.service';
2121
import { SafeHtmlPipe } from './shared/pipes/sanitize.pipe';
22+
import { FloatingFeedbackComponent } from './shared/floating-feedback/floating-feedback.component';
2223

23-
@NgModule({ declarations: [
24+
@NgModule({
25+
declarations: [
2426
AppComponent,
2527
NavbarComponent,
2628
FooterComponent,
2729
NoPageFoundComponent,
28-
SafeHtmlPipe
30+
SafeHtmlPipe,
31+
FloatingFeedbackComponent
2932
],
30-
bootstrap: [AppComponent], imports: [BrowserModule,
33+
bootstrap: [AppComponent],
34+
imports: [BrowserModule,
3135
BrowserAnimationsModule,
3236
GlobalMaterialModules,
3337
ExtrasModule,
3438
RoutingModule,
35-
SearchModule], providers: [SearchService, NewsService, { provide: MAT_TABS_CONFIG, useValue: { animationDuration: '0ms' } }, provideHttpClient(withInterceptorsFromDi())] })
39+
SearchModule],
40+
providers: [SearchService, NewsService,
41+
{ provide: MAT_TABS_CONFIG, useValue: { animationDuration: '0ms' } },
42+
provideHttpClient(withInterceptorsFromDi())]
43+
})
3644
export class AppModule {
3745
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<a mat-fab
2+
color="secondary"
3+
routerLink="/feedback"
4+
matTooltip="Give Feedback"
5+
matTooltipPosition="left"
6+
class="feedback-fab"
7+
aria-label="Give Feedback">
8+
<mat-icon>feedback</mat-icon>
9+
</a>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
:host {
2+
position: fixed;
3+
bottom: 24px;
4+
right: 24px;
5+
z-index: 1000;
6+
7+
}
8+
9+
.feedback-fab {
10+
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
11+
background-color: #ff4081;
12+
fill: white;
13+
color: white;
14+
&:hover {
15+
transform: scale(1.1);
16+
}
17+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-floating-feedback',
5+
templateUrl: './floating-feedback.component.html',
6+
styleUrls: ['./floating-feedback.component.scss']
7+
})
8+
export class FloatingFeedbackComponent {}

src/app/shared/footer/footer.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<a href="https://www.jax.org/" target="__blank">
1515
<img class="footer-brand-larger" src="assets/jax_logo.png"/>
1616
</a>
17-
<a href="https://www.bihealth.org/" target="__blank">
17+
<a href="https://www.bihealth.org/" target="__blank" class="mr-4">
1818
<img class="footer-brand-larger" src="assets/bih-logo.svg"/>
1919
</a>
2020
</div>

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@
2424
<div class="result-title">
2525
Phenotypes - {{terms.length}} of {{termsCount}} displayed
2626
</div>
27-
<div class="result-list">
27+
<div class="result-list flex flex-column">
2828
<div class="result" (click)="closeDropDown()" routerLink="/browse/term/{{item.id}}"
2929
*ngFor="let item of terms;">
30-
<div class="id">{{item.id}}</div>
3130
<div class="name" *ngIf="!item.synonym" [innerHtml]="{name: item.name } | highlight: queryText"></div>
3231
<div class="name" *ngIf="item.synonym" [innerHtml]="{name: item.synonym } | highlight: queryText"></div>
33-
<br>
32+
<div class="id">{{item.id}}</div>
3433
</div>
3534
</div>
3635
</div>
@@ -39,11 +38,11 @@
3938
<div class="result-title">
4039
Diseases - {{diseases.length}} of {{diseasesCount}} displayed
4140
</div>
42-
<div class="result-list">
41+
<div class="result-list flex flex-column">
4342
<div class="result" (click)="closeDropDown()" routerLink="/browse/disease/{{item.id}}"
4443
*ngFor="let item of diseases;">
45-
<div class="id">{{dbOnly(item.id)}}</div>
4644
<div class="name" [innerHtml]="{name: item.name } | highlight: queryText"></div>
45+
<div class="id">{{item.id}}</div>
4746
<br>
4847
</div>
4948
</div>
@@ -53,11 +52,11 @@
5352
<div class="result-title">
5453
Genes - {{genes.length}} of {{genesCount}} displayed
5554
</div>
56-
<div class="result-list">
55+
<div class="result-list flex flex-column">
5756
<div class="result" (click)="closeDropDown()" routerLink="/browse/gene/{{item.id}}"
5857
*ngFor="let item of genes;">
59-
<div class="id">{{item.id.split(":")[0]}}</div>
6058
<div class="name" [innerHtml]="{name: item.name } | highlight: queryText"></div>
59+
<div class="id">{{item.id}}</div>
6160
<br>
6261
</div>
6362
</div>

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

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ $orange-hover: rgba(236, 151, 54, 0.8);
4343
position: relative;
4444
z-index: 999;
4545
line-height: 20px;
46+
padding: 0 0 .5rem 0;
4647

4748
& .search-all {
48-
padding: 2px 10px 0 10px;
4949
margin: 0 0 10px 0;
5050
font-weight: 900;
5151
background-color: $blue-searchall-color;
@@ -86,13 +86,15 @@ $orange-hover: rgba(236, 151, 54, 0.8);
8686
cursor: pointer;
8787
text-decoration: none;
8888
color: black !important;
89+
display: flex;
90+
flex-direction: column;
8991

9092
& .result {
9193
display: flex;
9294
align-items: center;
9395
flex-direction: row;
9496
justify-content: space-around;
95-
padding: 5px 10px 0 25px;
97+
padding: 5px 10px 0 10px;
9698
height: 25px;
9799
outline: none;
98100

@@ -117,22 +119,7 @@ $orange-hover: rgba(236, 151, 54, 0.8);
117119
font-size: 12px;
118120
color: grey;
119121
margin: 0 15px 0 0;
120-
}
121-
}
122-
}
123-
124-
& .term-result {
125-
& .result-list {
126-
& .result .id {
127-
width: 60px;
128-
}
129-
}
130-
}
131-
132-
& .disease-result {
133-
& .result-list {
134-
& .result .id {
135-
width: 50px;
122+
flex: 0 0 22%;
136123
}
137124
}
138125
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div class="container">
2+
<div class="form-container">
3+
<iframe
4+
[src]="safeFormUrl"
5+
width="100%"
6+
height="800"
7+
frameborder="0"
8+
marginheight="0"
9+
marginwidth="0">
10+
Loading…
11+
</iframe>
12+
</div>
13+
</div>

0 commit comments

Comments
 (0)