Skip to content

Commit 35082ac

Browse files
committed
got some of the sub-performance tabs working
1 parent 15ad731 commit 35082ac

File tree

5 files changed

+31
-25
lines changed

5 files changed

+31
-25
lines changed

src/app/components/StateRoute/History.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ function History(props: Record<string, unknown>): JSX.Element {
318318
makeD3Tree();
319319
}, [root /*, currLocation*/]); // if the 'root' or 'currLocation' changes, re-build the D3 Tree
320320

321-
// useEffect(() => {
322-
// dispatch(setCurrentTabInApp('history')); // dispatch sent at initial page load allowing changing "immer's" draft.currentTabInApp to 'webmetrics' to facilitate render.
323-
// }, []);
321+
useEffect(() => {
322+
dispatch(setCurrentTabInApp('history')); // dispatch sent at initial page load allowing changing "immer's" draft.currentTabInApp to 'webmetrics' to facilitate render.
323+
}, []);
324324

325325
// then rendering each node in History tab to render using D3, which will share area with LegendKey
326326
return (

src/app/components/StateRoute/PerformanceVisx/PerformanceVisx.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,14 @@ const PerformanceVisx = (props: PerformanceVisxProps): JSX.Element => {
193193
const [route, setRoute] = useState('All Routes');
194194
const [snapshot, setSnapshot] = useState('All Snapshots');
195195

196+
console.log('Performance tab has loaded!');
197+
196198
getActions();
197199

198-
// useEffect(() => {
199-
// dispatch(setCurrentTabInApp('performance')); // dispatch sent at initial page load allowing changing "immer's" draft.currentTabInApp to 'performance' to facilitate render.
200-
// }, [dispatch]);
200+
useEffect(() => {
201+
dispatch(setCurrentTabInApp('performance')); // dispatch sent at initial page load allowing changing "immer's" draft.currentTabInApp to 'performance' to facilitate render.
202+
renderForTutorial();
203+
}, []);
201204

202205
const allRoutes = []; // create allRoutes variable to hold urls
203206
const filteredSnapshots = [];
@@ -243,34 +246,36 @@ const PerformanceVisx = (props: PerformanceVisxProps): JSX.Element => {
243246
const renderForTutorial = () => {
244247
// This will redirect to the proper tabs during the tutorial
245248
// Updated redirect to Navigate v23 redirect no longer supported in react router dom after v6
246-
if (currentTabInApp === 'performance') return <Navigate to='/' />;
247-
if (currentTabInApp === 'performance-comparison') return <Navigate to='/comparison' />;
249+
console.log(currentTabInApp);
250+
if (currentTabInApp === 'performance') return <Navigate to='/performance/' />;
251+
if (currentTabInApp === '/performance-comparison')
252+
return <Navigate to='/performance/comparison' />;
248253
return null;
249254
};
250255

251256
return (
252257
<>
253258
<div className='performance-nav-bar-container'>
254-
<NavLink className='router-link-performance' end to='/'>
259+
<NavLink className='router-link-performance' end to='/performance/'>
255260
Snapshots View
256261
</NavLink>
257262
<NavLink
258263
className='router-link-performance'
259264
id='router-link-performance-comparison'
260-
to='/comparison'
265+
to='/performance/comparison'
261266
>
262267
Comparison View
263268
</NavLink>
264-
<NavLink className='router-link-performance' to='/componentdetails'>
269+
<NavLink className='router-link-performance' to='/performance/componentdetails'>
265270
Component Details
266271
</NavLink>
267272
</div>
268273

269-
{renderForTutorial()}
274+
{/* {renderForTutorial()} */}
270275

271276
<Routes>
272277
<Route
273-
path='/comparison'
278+
path='/performance/comparison'
274279
element={
275280
hierarchy && series !== false ? (
276281
<BarGraphComparison
@@ -296,7 +301,7 @@ const PerformanceVisx = (props: PerformanceVisxProps): JSX.Element => {
296301
}
297302
/>
298303
<Route
299-
path='componentdetails'
304+
path='/componentdetails'
300305
element={
301306
hierarchy ? (
302307
<RenderingFrequency data={data.componentData} />

src/app/components/StateRoute/StateRoute.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const StateRoute = (props: StateRouteProps) => {
115115
element={<Tree snapshot={snapshot} snapshots={snapshots} currLocation={currLocation} />}
116116
/>
117117
<Route
118-
path='*'
118+
path='/'
119119
element={
120120
hierarchy ? (
121121
<ParentSize className='componentMapContainer'>

src/app/containers/StateContainer.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ const StateContainer = (props: StateContainerProps): JSX.Element => {
4343
path='*'
4444
element={
4545
<div>*/}
46-
<StateRoute
47-
webMetrics={webMetrics}
48-
viewIndex={viewIndex}
49-
snapshot={snapshot}
50-
hierarchy={hierarchy}
51-
snapshots={snapshots}
52-
currLocation={currLocation}
53-
/>
54-
<Outlet/>
55-
{/*</div>
46+
<StateRoute
47+
webMetrics={webMetrics}
48+
viewIndex={viewIndex}
49+
snapshot={snapshot}
50+
hierarchy={hierarchy}
51+
snapshots={snapshots}
52+
currLocation={currLocation}
53+
/>
54+
{/* <Outlet/> */}
55+
{/*</div>
5656
}
5757
/>
5858
</Routes> */}

src/app/slices/mainSlice.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ export const mainSlice = createSlice({
268268

269269
setCurrentTabInApp: (state, action) => {
270270
state.currentTabInApp = action.payload;
271+
console.log('mainSlice currentTabInApp: ', state.currentTabInApp);
271272
},
272273

273274
pause: (state) => {

0 commit comments

Comments
 (0)