1
1
define ( [
2
2
"backbone" , "handlebars" ,
3
3
"text!requestSearch/requestSearchResult.hbs" ,
4
- "common/modal" , "dataset/dataset-view" , "requestSearch/dataStoreLocationHelp" , "requestSearch/verifySendModal"
4
+ "common/modal" , "dataset/dataset-view" , "requestSearch/dataStoreLocationHelp" , "requestSearch/verifySendModal" ,
5
+ "requestSearch/alertUploadTime" , "requestSearch/dataTypesHelp" ,
5
6
] , function (
6
7
BB , HBS ,
7
8
requestSearchResultTemplate ,
8
- modal , viewDataset , viewHelp , confirmUpload
9
+ modal , viewDataset , viewHelp , confirmUpload ,
10
+ alertUploadTime , dataTypesHelp
9
11
) {
10
12
var statusIconMapping = {
11
13
'Uploaded' : 'fa-circle-check' ,
14
+ 'Querying' : 'fa-magnifying-glass' ,
15
+ 'Queued' : 'fa-hourglass' ,
12
16
'Unsent' : 'fa-circle-xmark' ,
13
17
'Unknown' : 'fa-circle-question' ,
14
18
'Error' : 'fa-circle-xmark' ,
@@ -42,6 +46,7 @@ define([
42
46
this . uploadData = this . uploadData . bind ( this ) ;
43
47
this . openVerifySend = this . openVerifySend . bind ( this ) ;
44
48
this . onDownloadClick = this . onDownloadClick . bind ( this ) ;
49
+ this . displayAlertThenPopulateStatus = this . displayAlertThenPopulateStatus . bind ( this ) ;
45
50
this . toggleGeno = this . toggleGeno . bind ( this ) ;
46
51
this . togglePheno = this . togglePheno . bind ( this ) ;
47
52
this . model . set ( "s3Directory" , opts . queryResult . id ) ;
@@ -58,6 +63,7 @@ define([
58
63
"click .request-result-data-button" : "onDownloadClick" ,
59
64
"click #data-request-btn" : "openDataRequestModal" ,
60
65
"click #data-store-help-button" : "openDataStoreHelp" ,
66
+ "click #data-types-help-button" : "openDataTypesHelp" ,
61
67
"click #upload-data-button" : "openVerifySend" ,
62
68
"click #refresh-status-btn" : "fetchQueryStatus" ,
63
69
"click #pheno_check" : "togglePheno" ,
@@ -112,6 +118,24 @@ define([
112
118
this . model . set ( "homeSite" , { site : response . homeSite , display : response . homeDisplay } ) ;
113
119
this . render ( ) ;
114
120
} ,
121
+ displayAlertThenPopulateStatus ( response ) {
122
+ if ( localStorage . getItem ( "disable-upload-reminder" ) === 'true' ) {
123
+ this . populateQueryStatus ( response ) ;
124
+ } else {
125
+ const populateQueryStatus = this . populateQueryStatus ;
126
+ const onClose = ( view ) => {
127
+ $ ( ".close" ) . click ( ) ;
128
+ $ ( "#data-request-btn" ) . focus ( ) ;
129
+ populateQueryStatus ( response ) ;
130
+ } ;
131
+ modal . displayModal (
132
+ new alertUploadTime ( { onClose } ) ,
133
+ "" ,
134
+ onClose ,
135
+ { width : "19%" }
136
+ ) ;
137
+ }
138
+ } ,
115
139
populateQueryStatus ( response ) {
116
140
this . model . set ( "approved" , response . approved ) ;
117
141
this . model . set ( "site" , response . site ) ;
@@ -130,7 +154,7 @@ define([
130
154
query . picSureId = this . model . get ( "queryId" ) ;
131
155
}
132
156
var site = this . model . get ( "selectedSite" ) ;
133
- var populateQueryStatus = this . populateQueryStatus ;
157
+ var displayAlertThenPopulateStatus = this . displayAlertThenPopulateStatus ;
134
158
$ . ajax ( {
135
159
url : window . location . origin + "/picsure/proxy/uploader/upload/" + site + "?dataType=" + dataType ,
136
160
headers : {
@@ -139,7 +163,7 @@ define([
139
163
data : JSON . stringify ( query ) ,
140
164
contentType : "application/json" ,
141
165
type : "POST" ,
142
- success : populateQueryStatus ,
166
+ success : displayAlertThenPopulateStatus ,
143
167
dataType : "json" ,
144
168
} ) ;
145
169
} ,
@@ -203,6 +227,19 @@ define([
203
227
{ width : "50%" }
204
228
) ;
205
229
} ,
230
+ openDataTypesHelp : function ( ) {
231
+ const onClose = ( view ) => {
232
+ $ ( ".close" ) . click ( ) ;
233
+ $ ( "#data-request-btn" ) . focus ( ) ;
234
+ } ;
235
+
236
+ modal . displayModal (
237
+ new dataTypesHelp ( { onClose } ) ,
238
+ "Data Types" ,
239
+ onClose ,
240
+ { width : "50%" }
241
+ ) ;
242
+ } ,
206
243
openVerifySend : function ( ) {
207
244
const onClose = ( view ) => {
208
245
$ ( ".close" ) . click ( ) ;
0 commit comments