Skip to content

Commit

Permalink
[Logs Explorer] Add redirect for old logs settings page (elastic#209452)
Browse files Browse the repository at this point in the history
## Summary

Closes - elastic#209270

Added a redirect from old deprecated Logs Settings Page to Kibana
Advance Settings page

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
achyutjhunjhunwala and kibanamachine authored Feb 4, 2025
1 parent aa701fe commit 7e6fb93
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
type ObservabilityOnboardingLocatorParams,
OBSERVABILITY_ONBOARDING_LOCATOR,
} from '@kbn/deeplinks-observability';
import { MANAGEMENT_APP_LOCATOR } from '@kbn/deeplinks-management/constants';
import { dynamic } from '@kbn/shared-ux-utility';
import { type LogsLocatorParams, LOGS_LOCATOR_ID } from '@kbn/logs-shared-plugin/common';
import { LazyAlertDropdownWrapper } from '../../alerting/log_threshold';
Expand All @@ -40,6 +41,9 @@ export const LogsPageContent: React.FunctionComponent = () => {
const onboardingLocator = share?.url.locators.get<ObservabilityOnboardingLocatorParams>(
OBSERVABILITY_ONBOARDING_LOCATOR
);

const managementLocator = share?.url.locators.get(MANAGEMENT_APP_LOCATOR);

const { setHeaderActionMenu, theme$ } = useContext(HeaderActionMenuContext);

useReadOnlyBadge(!uiCapabilities?.logs?.save);
Expand Down Expand Up @@ -84,7 +88,19 @@ export const LogsPageContent: React.FunctionComponent = () => {
<RedirectWithQueryParams from={'/analysis'} to={routes.logsAnomalies.path} exact />
<RedirectWithQueryParams from={'/log-rate'} to={routes.logsAnomalies.path} exact />
<RedirectWithQueryParams from={'/'} to={routes.logsAnomalies.path} exact />
// Legacy renders and redirects
<Route
path="/settings"
exact
render={() => {
managementLocator?.navigate({
sectionId: 'kibana',
appId: 'settings?query=observability%3AlogSources',
});

return null;
}}
/>
<Route render={() => <NotFoundPage title={pageTitle} />} />
</Routes>
</>
Expand Down
3 changes: 2 additions & 1 deletion x-pack/solutions/observability/plugins/infra/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
"@kbn/observability-utils-common",
"@kbn/charts-theme",
"@kbn/response-ops-rule-params",
"@kbn/core-test-helpers-model-versions"
"@kbn/core-test-helpers-model-versions",
"@kbn/deeplinks-management"
],
"exclude": ["target/**/*"]
}

0 comments on commit 7e6fb93

Please sign in to comment.