@@ -58,7 +58,9 @@ const DnDFlow = () => {
5858 const [ dockOpen , setDockOpen ] = useState ( false ) ;
5959 const [ logLines , setLogLines ] = useState ( [ ] ) ;
6060 const sseRef = useRef ( null ) ;
61- const append = ( line ) => setLogLines ( ( prev ) => [ ...prev , line ] ) ;
61+
62+ // for version information
63+ const [ versionInfo , setVersionInfo ] = useState ( null ) ;
6264
6365 // const onConnect = useCallback((params) => setEdges((eds) => addEdge(params, eds)), []);
6466
@@ -127,6 +129,24 @@ const DnDFlow = () => {
127129 }
128130 } ;
129131
132+ // Function to fetch version information
133+ const fetchVersionInfo = async ( ) => {
134+ try {
135+ const response = await fetch ( getApiEndpoint ( '/version' ) ) ;
136+ if ( response . ok ) {
137+ const versionData = await response . json ( ) ;
138+ setVersionInfo ( versionData ) ;
139+ return versionData ;
140+ } else {
141+ console . error ( 'Failed to fetch version information' ) ;
142+ return null ;
143+ }
144+ } catch ( error ) {
145+ console . error ( 'Error fetching version information:' , error ) ;
146+ return null ;
147+ }
148+ } ;
149+
130150 // Function to fetch documentation for a node type
131151 const fetchNodeDocumentation = async ( nodeType ) => {
132152 try {
@@ -224,6 +244,7 @@ const DnDFlow = () => {
224244 useEffect ( ( ) => {
225245 preloadDefaultValues ( ) ;
226246 preloadAllDocumentation ( ) ;
247+ fetchVersionInfo ( ) ; // Fetch version information on component mount
227248 } , [ ] ) ;
228249
229250 const onDrop = useCallback (
@@ -1129,10 +1150,18 @@ const DnDFlow = () => {
11291150 e . target . style . boxShadow = '0 2px 6px rgba(74, 144, 226, 0.3)' ;
11301151 } }
11311152 onClick = { ( ) => {
1132- // TODO - open modal, navigate to help page, etc.
1133- alert ( 'Help documentation coming soon! Check the README.md file in the repository for current documentation.' ) ;
1153+ // Display version information and help
1154+ const pathsimVersion = versionInfo ?. pathsim_version || 'Loading...' ;
1155+ const fcsVersion = versionInfo ?. fuel_cycle_sim_version || 'Loading...' ;
1156+
1157+ const message = `Help documentation coming soon!\n\n` +
1158+ `Version Information:\n` +
1159+ `• PathSim: ${ pathsimVersion } \n` +
1160+ `• Fuel Cycle Sim: ${ fcsVersion } \n\n` ;
1161+
1162+ alert ( message ) ;
11341163 } }
1135- title = "Get help and documentation "
1164+ title = "Get help, documentation, and version information "
11361165 >
11371166 ?
11381167 </ button >
0 commit comments