[Logs Explorer] Add redirect for old logs settings page (#209452)

## Summary

Closes - https://github.com/elastic/kibana/issues/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>
This commit is contained in:
Achyut Jhunjhunwala 2025-02-04 12:27:18 +01:00 committed by GitHub
parent aa701fea85
commit 7e6fb93819
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 1 deletions

View file

@ -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';
@ -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);
@ -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>
</>

View file

@ -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/**/*"]
}