@@ -24,6 +24,16 @@ class Results extends React.Component {
2424 }
2525 }
2626
27+ submitToRnacentral ( event ) {
28+ event . preventDefault ( ) ;
29+ const state = store . getState ( ) ;
30+ state . rnacentral = true ;
31+ if ( state . sequence ) {
32+ store . dispatch ( actionCreators . onClearResult ( ) ) ;
33+ store . dispatch ( actionCreators . onSubmit ( state . sequence , [ ] ) ) ;
34+ }
35+ }
36+
2737 render ( ) {
2838 let h3Style = {
2939 color : this . props . customStyle && this . props . customStyle . h3Color ? this . props . customStyle . h3Color : "#666" ,
@@ -128,28 +138,31 @@ class Results extends React.Component {
128138 this . props . jobId && ( this . props . status === "loading" || this . props . status === "success" || this . props . status === "partial_success" ) && [
129139 < div className = "small-12 columns" key = { `results-div` } >
130140 < h3 style = { h3Style } > Similar sequences: { this . props . status === "loading" ? < i className = "animated infinite flash" > ...</ i > : < small > { this . props . hitCount } </ small > } { this . props . hits > 1000 ? < small > of { this . props . hits } < a href = "https://test.rnacentral.org/help/sequence-search" style = { { borderBottomStyle : "none" } } target = "_blank" > < i className = "icon icon-generic icon-help" style = { { fontSize : "70%" } } > </ i > </ a > </ small > : "" } </ h3 >
131- < div className = "small-3 columns" >
132- { this . props . entries && this . props . entries . length ?
133- < Facets
134- facets = { this . props . facets }
135- selectedFacets = { this . props . selectedFacets }
136- toggleFacet = { this . toggleFacet }
137- ordering = { this . props . ordering }
138- textSearchError = { this . props . textSearchError }
139- hideFacet = { this . props . hideFacet }
140- customStyle = { this . props . customStyle }
141- /> : '' }
142- </ div >
143- < div className = "small-9 columns" >
144- < section >
145- { this . props . entries . map ( ( entry , index ) => (
146- < ul key = { `${ entry } _${ index } ` } > < Hit entry = { entry } alignmentsCollapsed = { this . props . alignmentsCollapsed } onToggleAlignmentsCollapsed = { this . onToggleAlignmentsCollapsed } customStyle = { this . props . customStyle } databases = { this . props . databases } exactMatchUrsId = { exactMatchUrsId } /> </ ul >
147- ) ) }
148- < div className = "small-12 columns" >
149- { this . props . status === "loading" ? < i className = "animated infinite flash" > ...</ i > : ( this . props . status === "success" || this . props . status === "partial_success" ) && ( this . props . entries . length < this . props . hitCount ) && ( < a className = "button small" onClick = { this . props . onLoadMore } target = "_blank" > Load more</ a > ) }
141+ {
142+ this . props . entries && this . props . entries . length ? < div >
143+ < div className = "small-3 columns" >
144+ < Facets
145+ facets = { this . props . facets }
146+ selectedFacets = { this . props . selectedFacets }
147+ toggleFacet = { this . toggleFacet }
148+ ordering = { this . props . ordering }
149+ textSearchError = { this . props . textSearchError }
150+ hideFacet = { this . props . hideFacet }
151+ customStyle = { this . props . customStyle }
152+ />
150153 </ div >
151- </ section >
152- </ div >
154+ < div className = "small-9 columns" >
155+ < section >
156+ { this . props . entries . map ( ( entry , index ) => (
157+ < ul key = { `${ entry } _${ index } ` } > < Hit entry = { entry } alignmentsCollapsed = { this . props . alignmentsCollapsed } onToggleAlignmentsCollapsed = { this . onToggleAlignmentsCollapsed } customStyle = { this . props . customStyle } databases = { this . props . databases } exactMatchUrsId = { exactMatchUrsId } /> </ ul >
158+ ) ) }
159+ < div className = "small-12 columns" >
160+ { this . props . status === "loading" ? < i className = "animated infinite flash" > ...</ i > : ( this . props . status === "success" || this . props . status === "partial_success" ) && ( this . props . entries . length < this . props . hitCount ) && ( < a className = "button small" onClick = { this . props . onLoadMore } target = "_blank" > Load more</ a > ) }
161+ </ div >
162+ </ section >
163+ </ div >
164+ </ div > : this . props . rnacentral ? < div > No results.</ div > : < div > The query sequence did not match any { this . props . databases } sequences. You can < a href = "#" onClick = { this . submitToRnacentral } > try to search against RNAcentral</ a > .</ div >
165+ }
153166 </ div >
154167 ]
155168 }
@@ -174,6 +187,7 @@ function mapStateToProps(state) {
174187 jobList : state . jobList ,
175188 infernalEntries : state . infernalEntries ,
176189 exactMatch : state . exactMatch ,
190+ rnacentral : state . rnacentral ,
177191 } ;
178192}
179193
0 commit comments