Skip to content

Commit

Permalink
Fix direct url load for trace analytics (opensearch-project#2024)
Browse files Browse the repository at this point in the history
* fix direct url load for trace analytics

Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>

* update side nav link

Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>

---------

Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>
  • Loading branch information
ps48 authored Aug 1, 2024
1 parent e7dd671 commit 1bfe411
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion public/components/trace_analytics/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ export const Home = (props: HomeProps) => {

const [dataSourceMDSId, setDataSourceMDSId] = useState([{ id: '', label: '' }]);
const [currentSelectedService, setCurrentSelectedService] = useState('');
const { defaultRoute = '/services' } = props;
let defaultRoute = props.defaultRoute ?? '/services';
const currentHash = window.location.hash.split('#')[1] || '';

if (currentHash === '/traces' || currentHash === '/services') {
defaultRoute = currentHash;
}

const { chrome } = props;
const isNavGroupEnabled = chrome.navGroup.getNavGroupEnabled();

Expand Down
2 changes: 1 addition & 1 deletion public/components/trace_analytics/trace_side_nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function TraceSideBar(props: { children: React.ReactNode }) {
{
name: 'Trace analytics',
id: 1,
href: '#/',
href: '#/services',
items: [
{
name: 'Services',
Expand Down

0 comments on commit 1bfe411

Please sign in to comment.