Skip to content

Commit

Permalink
Fix crash at loading app analytics tabs (#369)
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Li <[email protected]>
  • Loading branch information
joshuali925 authored and Peter Fitzgibbons committed Apr 17, 2023
1 parent 2e46088 commit 048179b
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export function Application(props: AppDetailProps) {

const childBreadcrumbs = [
{
text: 'Application analytics',
text: 'Applications',
href: '#/',
},
{
Expand All @@ -295,6 +295,7 @@ export function Application(props: AppDetailProps) {
endTime={appEndTime}
setStartTime={setStartTimeForApp}
setEndTime={setEndTimeForApp}
parentBreadcrumb={parentBreadcrumbs[0]}
childBreadcrumbs={childBreadcrumbs}
toasts={toasts}
/>
Expand All @@ -314,6 +315,7 @@ export function Application(props: AppDetailProps) {
page="app"
nameColumnAction={nameColumnAction}
traceColumnAction={traceColumnAction}
parentBreadcrumb={parentBreadcrumbs[0]}
childBreadcrumbs={childBreadcrumbs}
startTime={appStartTime}
endTime={appEndTime}
Expand All @@ -337,6 +339,7 @@ export function Application(props: AppDetailProps) {
<TracesContent
{...props}
page="app"
parentBreadcrumb={parentBreadcrumbs[0]}
childBreadcrumbs={childBreadcrumbs}
traceIdColumnAction={traceIdColumnAction}
startTime={appStartTime}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const Configuration = (props: ConfigProps) => {
fill
data-test-subj="editApplicationButton"
onClick={() => {
window.location.assign(`${last(parentBreadcrumbs)!.href}/edit/${appId}`);
window.location.assign(`#/edit/${appId}`);
}}
>
Edit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,29 @@ exports[`Dashboard component renders dashboard 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBrand": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbs": [MockFunction] {
"calls": Array [
Array [
Array [
undefined,
Object {
"href": "#/trace_analytics/home",
"text": "Trace analytics",
},
Object {
"href": "#/trace_analytics/home",
"text": "Dashboard",
},
],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down Expand Up @@ -305,7 +327,29 @@ exports[`Dashboard component renders dashboard 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBrand": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbs": [MockFunction] {
"calls": Array [
Array [
Array [
undefined,
Object {
"href": "#/trace_analytics/home",
"text": "Trace analytics",
},
Object {
"href": "#/trace_analytics/home",
"text": "Dashboard",
},
],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down Expand Up @@ -2372,7 +2416,29 @@ exports[`Dashboard component renders empty dashboard 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBrand": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbs": [MockFunction] {
"calls": Array [
Array [
Array [
undefined,
Object {
"href": "#/trace_analytics/home",
"text": "Trace analytics",
},
Object {
"href": "#/trace_analytics/home",
"text": "Dashboard",
},
],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down Expand Up @@ -2614,7 +2680,29 @@ exports[`Dashboard component renders empty dashboard 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBrand": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbs": [MockFunction] {
"calls": Array [
Array [
Array [
undefined,
Object {
"href": "#/trace_analytics/home",
"text": "Trace analytics",
},
Object {
"href": "#/trace_analytics/home",
"text": "Dashboard",
},
],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down Expand Up @@ -4654,7 +4742,29 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBrand": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbs": [MockFunction] {
"calls": Array [
Array [
Array [
undefined,
Object {
"href": "#/trace_analytics/home",
"text": "Trace analytics",
},
Object {
"href": "#/trace_analytics/home",
"text": "Dashboard",
},
],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down Expand Up @@ -4902,7 +5012,29 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBrand": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbs": [MockFunction] {
"calls": Array [
Array [
Array [
undefined,
Object {
"href": "#/trace_analytics/home",
"text": "Trace analytics",
},
Object {
"href": "#/trace_analytics/home",
"text": "Dashboard",
},
],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,11 @@ exports[`Services component renders empty services page 1`] = `
}
nameColumnAction={[Function]}
page="services"
parentBreadcrumbs={
Array [
Object {
"href": "test#/",
"text": "test",
},
]
parentBreadcrumb={
Object {
"href": "test#/",
"text": "test",
}
}
query=""
setEndTime={[MockFunction]}
Expand Down Expand Up @@ -378,13 +376,11 @@ exports[`Services component renders empty services page 1`] = `
}
nameColumnAction={[Function]}
page="services"
parentBreadcrumbs={
Array [
Object {
"href": "test#/",
"text": "test",
},
]
parentBreadcrumb={
Object {
"href": "test#/",
"text": "test",
}
}
query=""
setEndTime={[MockFunction]}
Expand Down Expand Up @@ -1957,10 +1953,7 @@ exports[`Services component renders jaeger services page 1`] = `
"calls": Array [
Array [
Array [
Object {
"href": "test#/",
"text": "test",
},
undefined,
Object {
"href": "#/trace_analytics/home",
"text": "Trace analytics",
Expand Down Expand Up @@ -2232,10 +2225,7 @@ exports[`Services component renders jaeger services page 1`] = `
"calls": Array [
Array [
Array [
Object {
"href": "test#/",
"text": "test",
},
undefined,
Object {
"href": "#/trace_analytics/home",
"text": "Trace analytics",
Expand Down Expand Up @@ -3361,10 +3351,7 @@ exports[`Services component renders services page 1`] = `
"calls": Array [
Array [
Array [
Object {
"href": "test#/",
"text": "test",
},
undefined,
Object {
"href": "#/trace_analytics/home",
"text": "Trace analytics",
Expand Down Expand Up @@ -3635,10 +3622,7 @@ exports[`Services component renders services page 1`] = `
"calls": Array [
Array [
Array [
Object {
"href": "test#/",
"text": "test",
},
undefined,
Object {
"href": "#/trace_analytics/home",
"text": "Trace analytics",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Services component', () => {
<Services
http={core.http}
chrome={core.chrome}
parentBreadcrumbs={[{ text: 'test', href: 'test#/' }]}
parentBreadcrumb={{ text: 'test', href: 'test#/' }}
childBreadcrumbs={serviceBreadcrumbs}
nameColumnAction={nameColumnAction}
traceColumnAction={traceColumnAction}
Expand All @@ -53,7 +53,7 @@ describe('Services component', () => {
endTime="now"
setEndTime={setEndTime}
page="services"
mode='data_prepper'
mode="data_prepper"
dataPrepperIndicesExist={true}
modes={modes}
/>
Expand Down Expand Up @@ -99,7 +99,7 @@ describe('Services component', () => {
endTime="now"
setEndTime={setEndTime}
page="services"
mode='data_prepper'
mode="data_prepper"
dataPrepperIndicesExist={true}
modes={modes}
/>
Expand Down Expand Up @@ -145,7 +145,7 @@ describe('Services component', () => {
endTime="now"
setEndTime={setEndTime}
page="services"
mode='jaeger'
mode="jaeger"
dataPrepperIndicesExist={false}
jaegerIndicesExist={true}
modes={modes}
Expand Down
Loading

0 comments on commit 048179b

Please sign in to comment.