Skip to content

Commit 38c9a37

Browse files
authored
Merge pull request #291 from zhx828/add-no-result-info
Allow user suggests annotation in the search result
2 parents a9bc5dd + acfdc85 commit 38c9a37

8 files changed

+54
-19
lines changed

app/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@
288288
<script src="scripts/directives/search-box.js"></script>
289289
<script src="scripts/directives/search-icon.js"></script>
290290
<script src="scripts/directives/action-button.js"></script>
291+
<script src="scripts/directives/suggest-curation.js"></script>
291292
<!-- endbuild -->
292293
<script src="https://unpkg.com/[email protected]/bundles/ng-table.min.js"></script>
293294
</body>

app/scripts/directives/search-box.js

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ angular.module('oncokbStaticApp')
2727
}).join(', ') : '';
2828
}
2929
scope.content = {
30+
currentQuery: '',
3031
selectedGene: '',
3132
loadingSearchResult: false
3233
};
@@ -43,6 +44,7 @@ angular.module('oncokbStaticApp')
4344
};
4445

4546
scope.searchKeyUp = function(query) {
47+
scope.content.currentQuery = query;
4648
return api.blurSearch(query)
4749
.then(function(resp) {
4850
var result = resp;

app/scripts/directives/search-icon.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ angular.module('oncokbStaticApp')
1717
hideRect: false
1818
};
1919
scope.mouseLeave = function() {
20-
// set timeout for the animation from css.
21-
// Time should be the same with the transition time
22-
$timeout(function() {
23-
scope.data.hideRect = false;
24-
}, 500);
20+
scope.data.hideRect = false;
2521
};
2622
}
2723
};
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
angular.module('oncokbStaticApp')
3+
.directive('suggestCuration', function() {
4+
return {
5+
templateUrl: 'views/suggestCuration.html',
6+
restrict: 'E',
7+
scope: {
8+
suggestion: '='
9+
}
10+
};
11+
});

app/styles/_searchBox.scss

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,41 @@
1+
$border-radius: 5px;
2+
$padding: 6px 12px;
3+
$input-border: 1px solid #ccc;
4+
$box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
5+
16
.search-box {
27
input[type=search] {
38
text-align: left;
49
display: block;
510
width: 100%;
611
height: 50px;
7-
padding: 6px 12px;
12+
padding: $padding;
813
font-size: 20px;
914
line-height: 1.428571429;
1015
color: #555555;
1116
background: #fff none;
12-
border: 1px solid #ccc;
13-
border-radius: 5px;
14-
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
17+
border: $input-border;
18+
border-radius: $border-radius;
19+
box-shadow: $box-shadow;
1520
margin-bottom: 0;
1621
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
1722
}
1823
input[type=search]:focus {
1924
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
2025
border-color: $secondary-color;
2126
}
22-
input[type=search][aria-expanded=true] {
27+
input[type=search][aria-expanded=true], input[type=search].no-result {
2328
border-bottom-left-radius: 0;
2429
border-bottom-right-radius: 0;
2530
}
31+
.no-result-info {
32+
background: white;
33+
border-radius: 0 0 $border-radius $border-radius;
34+
padding: $padding;
35+
border: $input-border;
36+
border-top: 0;
37+
box-shadow: $box-shadow;
38+
}
2639
.row {
2740
margin-bottom: 40px;
2841
}

app/views/cancerGenes.html

+1-6
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,7 @@
103103
</a>
104104
</span>
105105
<span ng-if="x.oncokbAnnotated === 'No'">
106-
<a
107-
href="mailto:[email protected]?subject=Annotation suggestion for {{x.hugoSymbol}}&&body=Thank you for using the Cancer Gene Page feedback feature.%0A Please provide the following information for {{x.hugoSymbol}} curation:%0A%0AEvidence:%0APMIDs:%0AAbstracts:"
108-
target="_blank"
109-
title="suggest to annotate this gene"
110-
qtip qtip-content="Suggest to annotate {{x.hugoSymbol}}" my="bottom center"
111-
at="top center"><i class="fa fa-envelope-o" aria-hidden="true"></i></a>
106+
<suggest-curation suggestion="x.hugoSymbol"></suggest-curation>
112107
</span>
113108
</td>
114109
<td header="'geneType.html'" filter="{geneType:'text'}" sortable="'geneType'">

app/views/searchBox.html

+12-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
</div>
3333
<i class="oncogenic-icon-image"
3434
ng-class="getIconClass(match.model.oncogenicity, match.model.highestSensitiveLevel, match.model.highestResistanceLevel, match.model.vus)"/>
35-
<span class="no-annotation" ng-if="!match.model.variantExist">Not annotated by OncoKB</span>
35+
<span class="no-annotation" ng-if="!match.model.variantExist">
36+
<span>Not annotated by OncoKB</span>
37+
<suggest-curation suggestion="query"></suggest-curation>
38+
</span>
3639
</div>
3740
<div class="search-box-annotation">
3841
<span ng-if="match.model.annotation">{{match.model.annotation}}</span>
@@ -60,17 +63,23 @@
6063
</div>
6164
</script>
6265

63-
<div class="search-box">
64-
<input type="search" class="form-control" placeholder="Search Gene / Alteration / Drug"
66+
<div class="search-box" ng-init="noResultMatched">
67+
<input type="search" class="form-control" ng-class="noResultMatched ? 'no-result': ''" placeholder="Search Gene / Alteration / Drug"
6568
ng-model="content.selectedItem"
6669
typeahead-on-select="searchConfirmed($event)"
6770
uib-typeahead="item for item in searchKeyUp($viewValue)"
6871
typeahead-template-url="searchBoxTemplate.html"
6972
typeahead-wait-ms="200"
7073
typeahead-loading="content.loadingSearchResult"
7174
typeahead-min-length="2"
75+
typeahead-no-results="noResultMatched"
7276
>
7377
<div class="loading" ng-if="content.loadingSearchResult">
7478
<i class="fa fa-spinner fa-spin fa-2x fa-fw"></i>
7579
</div>
80+
<div ng-if="noResultMatched"
81+
class="no-result-info">
82+
<span>No result found, please send us an email if you would like {{content.currentQuery}} to be curated.</span>
83+
<suggest-curation suggestion="content.currentQuery"></suggest-curation>
84+
</div>
7685
</div>

app/views/suggestCuration.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<a
2+
href="mailto:[email protected]?subject=Annotation suggestion for {{suggestion}}&&body=Thank you for using the feedback feature.%0APlease provide the following information for {{suggestion}} curation:%0A%0AEvidence:%0APMIDs:%0AAbstracts:"
3+
target="_blank"
4+
title="suggest to annotate this gene"
5+
qtip qtip-content="Suggest to annotate {{suggestion}}" my="bottom center"
6+
at="top center">
7+
<i class="fa fa-envelope-o" aria-hidden="true"></i>
8+
</a>

0 commit comments

Comments
 (0)