1+ /* eslint-disable @typescript-eslint/no-unused-vars */
2+ /* eslint-disable react/jsx-first-prop-new-line */
3+ /* eslint-disable no-trailing-spaces */
4+ /* eslint-disable react/jsx-indent-props */
5+ /* eslint-disable react/jsx-one-expression-per-line */
16/* eslint-disable max-len */
27/* eslint-disable object-curly-newline */
38import React , { useState } from 'react' ;
49import { MemoryRouter as Router , Route , NavLink , Switch } from 'react-router-dom' ;
510import Tree from './Tree' ;
611import PerfView from './PerfView' ;
12+ import { spawn } from 'child_process' ;
713
814const Chart = require ( './Chart' ) . default ;
915const ErrorHandler = require ( './ErrorHandler' ) . default ;
@@ -20,7 +26,7 @@ interface StateRouteProps {
2026
2127const StateRoute = ( props :StateRouteProps ) => {
2228 const { snapshot, hierarchy, snapshots, viewIndex } = props ;
23- const [ noRenderData , setNoRenderData ] = useState ( true ) ;
29+ const [ noRenderData , setNoRenderData ] = useState ( false ) ;
2430
2531 // gabi :: the hierarchy get set on the first click in the page, when page in refreshed we don't have a hierarchy so we need to check if hierarchy was initialize involk render chart
2632 const renderChart = ( ) => {
@@ -38,15 +44,26 @@ const StateRoute = (props:StateRouteProps) => {
3844 return < div className = "noState" > { NO_STATE_MSG } </ div > ;
3945 } ;
4046
47+ let perfChart ;
48+ if ( ! noRenderData ) {
49+ perfChart = (
50+ < PerfView viewIndex = { viewIndex }
51+ snapshots = { snapshots }
52+ setNoRenderData = { setNoRenderData }
53+ width = { 600 }
54+ height = { 1000 }
55+ />
56+ ) ;
57+ } else {
58+ perfChart = < div className = "no-data-message" > Rendering Data is not available for this application</ div > ;
59+ }
60+
4161 const renderPerfView = ( ) => {
42- if ( hierarchy ) {
43- return (
44- < ErrorHandler >
45- < PerfView viewIndex = { viewIndex } snapshots = { snapshots } setNoRenderData = { setNoRenderData } width = { 600 } height = { 1000 } />
46- </ ErrorHandler >
47- ) ;
48- }
49- return < div className = "noState" > { NO_STATE_MSG } </ div > ;
62+ return (
63+ < ErrorHandler >
64+ { perfChart }
65+ </ ErrorHandler >
66+ ) ;
5067 } ;
5168
5269 return (
0 commit comments