Skip to content

Commit

Permalink
Update breadcrumb for Trace to default to service page
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Tackett <[email protected]>
  • Loading branch information
Adam Tackett committed Jul 5, 2024
1 parent f5e26f3 commit 6abb8ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
11 changes: 3 additions & 8 deletions public/components/trace_analytics/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const Home = (props: HomeProps) => {
const serviceBreadcrumbs = [
{
text: 'Trace analytics',
href: '#/',
href: '#/services',
},
{
text: 'Services',
Expand All @@ -174,7 +174,7 @@ export const Home = (props: HomeProps) => {
const traceBreadcrumbs = [
{
text: 'Trace analytics',
href: '#/',
href: '#/services',
},
{
text: 'Traces',
Expand Down Expand Up @@ -366,12 +366,7 @@ export const Home = (props: HomeProps) => {
/>
)}
/>
<Route
path="/"
render={() => (
<Redirect to={defaultRoute} />
)}
/>
<Route path="/" render={() => <Redirect to={defaultRoute} />} />
</HashRouter>
{flyout}
{spanFlyoutComponent}
Expand Down
12 changes: 6 additions & 6 deletions public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ export class ObservabilityPlugin
// prometheus: openSearchLocalDataSourcePluggable
};

const appMountWithStartPage = (startPage: string, defaultRoute?: string) => async (params: AppMountParameters) => {
const appMountWithStartPage = (startPage: string, defaultRoute?: string) => async (
params: AppMountParameters
) => {
const { Observability } = await import('./components/index');
const [coreStart, depsStart] = await core.getStartServices();
const dslService = new DSLService(coreStart.http);
Expand All @@ -291,7 +293,7 @@ export class ObservabilityPlugin
dataSourcePluggables, // just pass down for now due to time constraint, later may better expose this as context
dataSourceManagement,
coreStart.savedObjects,
defaultRoute,
defaultRoute
);
};

Expand Down Expand Up @@ -327,19 +329,17 @@ export class ObservabilityPlugin
mount: appMountWithStartPage('traces'),
});

// NEEDS CORRECTION OR REFACTOR //ADAM
// The new-added applications need to be wrapped by a feature flag check.
if (core.chrome.navGroup.getNavGroupEnabled()) {
core.application.register({
id: "observability-traces-nav",
id: 'observability-traces-nav',
title: observabilityTracesTitle,
order: observabilityTracesPluginOrder,
category: DEFAULT_APP_CATEGORIES.investigate,
mount: appMountWithStartPage('traces', '/traces'),
});

core.application.register({
id: "observability-services-nav",
id: 'observability-services-nav',
title: observabilityServicesTitle,
order: observabilityServicesPluginOrder,
category: DEFAULT_APP_CATEGORIES.investigate,
Expand Down

0 comments on commit 6abb8ed

Please sign in to comment.