@@ -4,6 +4,7 @@ import { withTracker } from 'meteor/react-meteor-data';
44import React , { useState } from 'react' ;
55import PropTypes from 'prop-types' ;
66import { Link } from 'react-router-dom' ;
7+ import SearchBar from '/imports/ui/main/SearchBar.jsx' ;
78
89import getQueryCount from '/imports/api/methods/getQueryCount.js' ;
910import { genomeCollection } from '/imports/api/genomes/genomeCollection.js' ;
@@ -14,9 +15,9 @@ import {
1415
1516import './landingpage.scss' ;
1617
17- function GeneNumber ( { _id : genomeId } ) {
18+ function GeneNumber ( { _id : genomeId , annotationName : annotationName } ) {
1819 const [ geneNumber , setGeneNumber ] = useState ( '...' ) ;
19- getQueryCount . call ( { query : { genomeId } } , ( err , res ) => {
20+ getQueryCount . call ( { query : { genomeId, annotationName } } , ( err , res ) => {
2021 setGeneNumber ( res ) ;
2122 } ) ;
2223 return (
@@ -31,32 +32,37 @@ function Stats({ genomes = [] }) {
3132 < table className = "table is-hoverable is-fullwidth has-background-white-bis" >
3233 < thead >
3334 < tr >
34- < th className = "has-text-weight-bold" > Name </ th >
35- < th className = "has-text-weight-bold" > Organism </ th >
35+ < th className = "has-text-weight-bold" > Genome </ th >
36+ < th className = "has-text-weight-bold" > Annotation </ th >
3637 < th className = "has-text-weight-bold has-text-centered" > Status</ th >
3738 < th className = "has-text-weight-bold has-text-right" > № genes</ th >
3839 </ tr >
3940 </ thead >
4041 < tbody >
4142 {
4243 genomes . map ( ( {
43- _id, name, organism, isPublic,
44- } ) => (
45- < tr key = { _id } className = "list-group-item d-flex justify-content-between" >
46- < td > { name } </ td >
47- < td > { organism } </ td >
48- < td className = "has-text-centered" >
49- {
50- isPublic
51- ? < span className = "tag is-success is-light" > Public</ span >
52- : < span className = "tag is-warning is-light" > Private</ span >
53- }
54- </ td >
55- < td className = "has-text-right" >
56- < GeneNumber _id = { _id } />
57- </ td >
58- </ tr >
59- ) )
44+ _id, name, isPublic, annotationTrack
45+ } ) => {
46+ if ( typeof annotationTrack === 'undefined' ) {
47+ return [ ]
48+ }
49+ return annotationTrack . map ( ( annotation ) => (
50+ < tr key = { annotation . _id } className = "list-group-item d-flex justify-content-between" >
51+ < td > { name } </ td >
52+ < td > { annotation . name } </ td >
53+ < td className = "has-text-centered" >
54+ {
55+ isPublic
56+ ? < span className = "tag is-success is-light" > Public</ span >
57+ : < span className = "tag is-warning is-light" > Private</ span >
58+ }
59+ </ td >
60+ < td className = "has-text-right" >
61+ < GeneNumber _id = { _id } annotationName = { annotation . name } />
62+ </ td >
63+ </ tr >
64+ ) )
65+ } )
6066 }
6167 </ tbody >
6268 </ table >
@@ -84,7 +90,7 @@ function statsDataTracker() {
8490}
8591
8692function hasNoGenomes ( { genomes } ) {
87- return typeof genomes === 'undefined' || genomes . length === 0 ;
93+ return typeof genomes === 'undefined' || genomes . length === 0 || ! genomes . some ( ( genome ) => typeof genome . annotationTrack !== 'undefined' && genome . annotationTrack . length > 0 ) ; ;
8894}
8995
9096function NoGenomes ( ) {
@@ -93,21 +99,21 @@ function NoGenomes() {
9399 ? (
94100 < article className = "message is-info" role = "alert" >
95101 < div className = "message-body" >
96- Currently no genomes are available
102+ Currently no annotated genomes are available
97103 </ div >
98104 </ article >
99105 )
100106 : (
101107 < article className = "message is-info" role = "alert" >
102108 < div className = "message-body" >
103- No public genomes are available.
109+ No public annotated genomes are available.
104110 { ! Meteor . settings . public . disable_user_login && (
105111 < >
106112 < Link to = "/login" >
107113 Sign in
108114 </ Link >
109115 to access private data.
110- </ >
116+ </ >
111117 ) }
112118 </ div >
113119 </ article >
@@ -139,14 +145,18 @@ function LandingPage() {
139145 </ a >
140146 )
141147 }
142-
148+
143149
144150 return (
145151 < >
146152 < section className = "hero is-small is-light is-bold" >
147153 < div className = "hero-body" >
154+ { ! Meteor . settings . public . disable_header && (
155+ < >
148156 < h1 className = "title" > GeneNoteBook </ h1 >
149157 < h2 className = "subtitle" > A collaborative notebook for genes and genomes </ h2 >
158+ </ >
159+ ) }
150160 < div className = "box" >
151161 < p className = "font-weight-light" >
152162 Through this site you can browse and query data for the following genomes:
@@ -157,7 +167,7 @@ function LandingPage() {
157167 ! Meteor . userId ( )
158168 && (
159169 < div className = "buttons are-small" role = "group" >
160- { ! ( Meteor . settings . public . disable_user_login === true || Meteor . settings . public . disable_user_registration === true ) && (
170+ { ! ( Meteor . settings . public . disable_user_login === true || Meteor . settings . public . disable_user_registration === true ) && (
161171 < Link to = "/register" className = "button is-success" >
162172 < span className = "icon-user-add" aria-hidden = "true" />
163173 Create account
@@ -169,10 +179,12 @@ function LandingPage() {
169179 Sign in
170180 </ Link >
171181 ) }
182+ { ! Meteor . settings . public . disable_header && (
172183 < a href = "http://genenotebook.github.io/" className = "button is-dark is-outlined" >
173184 < span className = "icon-github" aria-hidden = "true" />
174185 About GeneNotebook
175186 </ a >
187+ ) }
176188 </ div >
177189 )
178190 }
@@ -233,15 +245,9 @@ function LandingPage() {
233245 </ div >
234246 </ div >
235247 < div className = "content" >
236- Search genes by their attributes, such as GO-terms,
237- protein domains or manual annotations.
238- </ div >
239- < div className = "content" >
240- < Link to = { { path : '/' , state : { highLightSearch : true } } } className = "button is-warning is-light is-fullwidth" >
241- < span className = "icon-search" aria-hidden = "true" />
242- Search
243- </ Link >
248+ Search genes by their attributes, such as GO-terms, or protein domains.
244249 </ div >
250+ < SearchBar isBlock = { true } />
245251 </ div >
246252 </ div >
247253 </ div >
@@ -269,7 +275,7 @@ function LandingPage() {
269275 < div className = "content" >
270276 BLAST your protein or DNA sequence to genome annotations.
271277 </ div >
272- < div className = "content" >
278+ < div className = "content" >
273279 { blastLink }
274280 </ div >
275281 </ div >
0 commit comments