Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrczarnas committed Jun 28, 2024
2 parents 44035b1 + 5f9d409 commit 266c98c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ const Tree = () => {
<div
style={{
position: 'absolute',
right: '30px',
right: '70px',
top: '-9px',
borderRadius: '3px'
}}
Expand All @@ -407,7 +407,7 @@ const Tree = () => {
<div
style={{
position: 'absolute',
right: '30px',
right: '45px',
top: '-9px',
borderRadius: '3px'
}}
Expand Down
20 changes: 10 additions & 10 deletions dqops/src/main/frontend/src/contexts/treeContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1656,25 +1656,25 @@ function TreeProvider(props: any) {
schemaNode?.label ?? '',
tableNode?.label ?? ''
);
if (firstLevelActiveTab === location.pathname) {
const value = ROUTES.TABLE_COLUMNS_VALUE(
checkType,
connectionNode?.label ?? '',
schemaNode?.label ?? '',
tableNode?.label ?? ''
);

if (firstLevelActiveTab === url) {
return;
}
dispatch(
addFirstLevelTab(checkType, {
url,
value: url,
value,
state: {},
label: node.label
})
);
history.push(
ROUTES.TABLE_COLUMNS(
checkType,
connectionNode?.label ?? '',
schemaNode?.label ?? '',
tableNode?.label ?? ''
)
);
history.push(url);
} else if (node.level === TREE_LEVEL.TABLE_INCIDENTS) {
const tableNode = findTreeNode(treeData, node.parentId ?? '');
const schemaNode = findTreeNode(treeData, tableNode?.parentId ?? '');
Expand Down
10 changes: 9 additions & 1 deletion dqops/src/main/frontend/src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';
import { useSelector } from 'react-redux';
import { useHistory } from 'react-router-dom';
import Header from '../../components/Header';
Expand Down Expand Up @@ -35,6 +35,14 @@ const HomePage = () => {
history.push(activeTab);
};

useEffect(() => {
if (!activeTab) {
dispatch(setHomeFirstLevelTab('/home'));
} else if (activeTab !== history.location.pathname) {
history.push(activeTab);
}
}, [activeTab]);

return (
<div style={{ height: 'calc(100vh - 200px)' }}>
<Header />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const initialState: ISourceState = {
tabs: []
},
home: {
activeTab: window.location.pathname === '/home' ? '/home' : '/tables'
activeTab: '/home'
}
};

Expand Down

0 comments on commit 266c98c

Please sign in to comment.