11import { memo , useCallback , useEffect , useMemo , useRef , useState } from 'react'
22import { useSearchParams , useNavigate , Link } from 'react-router-dom'
33import { Collapse , InputNumber , Layout , Popover , Switch , Typography , Select , Spin , message } from 'antd'
4- import { BgColorsOutlined , DatabaseOutlined , DotChartOutlined , HolderOutlined , LeftOutlined , LinkOutlined , RightOutlined , SettingOutlined } from '@ant-design/icons'
4+ import { BgColorsOutlined , DatabaseOutlined , DotChartOutlined , HolderOutlined , InfoCircleOutlined , LeftOutlined , LinkOutlined , RightOutlined , SettingOutlined } from '@ant-design/icons'
55import { DeckGL } from '@deck.gl/react'
66import { OrthographicView } from '@deck.gl/core'
77import { PolygonLayer , ScatterplotLayer } from '@deck.gl/layers'
@@ -19,7 +19,6 @@ import ColorBySection from '../components/ColorBySection'
1919import SelectionOverlay from '../components/SelectionOverlay'
2020import SelectionToolbar from '../components/SelectionToolbar'
2121import SummaryPanel from '../components/SummaryPanel'
22- import { VersionTag } from '../components/VersionTag'
2322import { loadDatasets , saveDatasets } from '../utils/datasets'
2423
2524const { Sider, Content } = Layout
@@ -175,15 +174,55 @@ function CollapsedSidebar({ onExpand }: { onExpand: () => void }) {
175174 )
176175}
177176
177+ const infoRowStyle : React . CSSProperties = { display : 'flex' , justifyContent : 'space-between' , gap : 16 , fontSize : 12 }
178+
179+ function InfoPopoverContent ( ) {
180+ const backendInfo = useAppStore ( ( s ) => s . backendInfo )
181+
182+ return (
183+ < div style = { { display : 'flex' , flexDirection : 'column' , gap : 4 } } >
184+ < div style = { infoRowStyle } >
185+ < Typography . Text type = "secondary" > Version</ Typography . Text >
186+ < Typography . Text > v{ __APP_VERSION__ } </ Typography . Text >
187+ </ div >
188+ < div style = { infoRowStyle } >
189+ < Typography . Text type = "secondary" > SHA</ Typography . Text >
190+ < Typography . Text code style = { { fontSize : 11 } } > { __COMMIT_HASH__ } </ Typography . Text >
191+ </ div >
192+ { backendInfo && (
193+ < >
194+ < div style = { infoRowStyle } >
195+ < Typography . Text type = "secondary" > API version</ Typography . Text >
196+ < Typography . Text > v{ backendInfo . version } </ Typography . Text >
197+ </ div >
198+ < div style = { infoRowStyle } >
199+ < Typography . Text type = "secondary" > API environment</ Typography . Text >
200+ < Typography . Text > { backendInfo . environment } </ Typography . Text >
201+ </ div >
202+ { backendInfo . git_sha && (
203+ < div style = { infoRowStyle } >
204+ < Typography . Text type = "secondary" > API SHA</ Typography . Text >
205+ < Typography . Text code style = { { fontSize : 11 } } > { backendInfo . git_sha } </ Typography . Text >
206+ </ div >
207+ ) }
208+ </ >
209+ ) }
210+ </ div >
211+ )
212+ }
213+
178214function BrandingHeader ( ) {
179215 return (
180216 < div style = { { padding : '12px 16px' , borderBottom : '1px solid #f0f0f0' , display : 'flex' , justifyContent : 'space-between' , alignItems : 'center' } } >
181217 < Link to = "/" style = { { textDecoration : 'none' } } >
182218 < Typography . Title level = { 5 } style = { { margin : 0 } } >
183219 cBioPortal Cell Explorer{ ' ' }
184- < VersionTag version = { __APP_VERSION__ } commitHash = { __COMMIT_HASH__ } / >
220+ < span style = { { fontSize : 12 , color : '#999' , fontWeight : 'normal' } } > v { __APP_VERSION__ } </ span >
185221 </ Typography . Title >
186222 </ Link >
223+ < Popover content = { < InfoPopoverContent /> } trigger = "click" placement = "bottomRight" >
224+ < InfoCircleOutlined style = { { fontSize : 14 , color : '#999' , cursor : 'pointer' } } />
225+ </ Popover >
187226 </ div >
188227 )
189228}
0 commit comments