Skip to content

Commit 1bfe411

Browse files
authored
Fix direct url load for trace analytics (#2024)
* fix direct url load for trace analytics Signed-off-by: Shenoy Pratik <[email protected]> * update side nav link Signed-off-by: Shenoy Pratik <[email protected]> --------- Signed-off-by: Shenoy Pratik <[email protected]>
1 parent e7dd671 commit 1bfe411

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Diff for: public/components/trace_analytics/home.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@ export const Home = (props: HomeProps) => {
120120

121121
const [dataSourceMDSId, setDataSourceMDSId] = useState([{ id: '', label: '' }]);
122122
const [currentSelectedService, setCurrentSelectedService] = useState('');
123-
const { defaultRoute = '/services' } = props;
123+
let defaultRoute = props.defaultRoute ?? '/services';
124+
const currentHash = window.location.hash.split('#')[1] || '';
125+
126+
if (currentHash === '/traces' || currentHash === '/services') {
127+
defaultRoute = currentHash;
128+
}
129+
124130
const { chrome } = props;
125131
const isNavGroupEnabled = chrome.navGroup.getNavGroupEnabled();
126132

Diff for: public/components/trace_analytics/trace_side_nav.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function TraceSideBar(props: { children: React.ReactNode }) {
3030
{
3131
name: 'Trace analytics',
3232
id: 1,
33-
href: '#/',
33+
href: '#/services',
3434
items: [
3535
{
3636
name: 'Services',

0 commit comments

Comments
 (0)