Skip to content

Commit

Permalink
[Bug] Trace Analytics bugfix for breadcrumbs and id pathing (opensear…
Browse files Browse the repository at this point in the history
…ch-project#2037)

* bugfix ids and breadcrumbs

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* remove comments

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* quick fix

Signed-off-by: Adam Tackett <tackadam@amazon.com>

---------

Signed-off-by: Adam Tackett <tackadam@amazon.com>
Co-authored-by: Adam Tackett <tackadam@amazon.com>
  • Loading branch information
TackAdam and Adam Tackett authored Aug 3, 2024
1 parent b1a4c7c commit faf2207
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,14 @@ export function ServiceView(props: ServiceViewProps) {
useEffect(() => {
if (page !== 'serviceFlyout')
setNavBreadCrumbs(
[props.parentBreadcrumb],
[
props.parentBreadcrumb,
{
text: 'Trace analytics',
href: '#/',
href: '#/services',
},
],
[
{
text: 'Services',
href: '#/services',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,14 @@ export function TraceView(props: TraceViewProps) {

useEffect(() => {
setNavBreadCrumbs(
[props.parentBreadcrumb],
[
props.parentBreadcrumb,
{
text: 'Trace analytics',
href: '#/',
href: '#/services',
},
],
[
{
text: 'Traces',
href: '#/traces',
Expand Down
26 changes: 17 additions & 9 deletions public/components/trace_analytics/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const Home = (props: HomeProps) => {
let defaultRoute = props.defaultRoute ?? '/services';
const currentHash = window.location.hash.split('#')[1] || '';

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

Expand Down Expand Up @@ -196,21 +196,29 @@ export const Home = (props: HomeProps) => {
}, [mode]);

const serviceBreadcrumbs = [
{
text: 'Trace analytics',
href: '#/services',
},
...(!isNavGroupEnabled
? [
{
text: 'Trace analytics',
href: '#/services',
},
]
: []),
{
text: 'Services',
href: '#/services',
},
];

const traceBreadcrumbs = [
{
text: 'Trace analytics',
href: '#/services',
},
...(!isNavGroupEnabled
? [
{
text: 'Trace analytics',
href: '#/services',
},
]
: []),
{
text: 'Traces',
href: '#/traces',
Expand Down

0 comments on commit faf2207

Please sign in to comment.