Remove legacy time axis advanced setting (#221419)

## Summary

Follow up to #210579. Close #193683.

This PR removes the deprecated `visualization:useLegacyTimeAxis`
advanced setting and all related code. This setting was previously used
to enable legacy time axis behavior for charts in Lens, Discover,
Visualize and TSVB, but has been deprecated and is no longer needed. All
usage of the setting was already removed in #210579, this PR just cleans
up the advanced setting itself.

## Changes

- Removed the `visualization:useLegacyTimeAxis` UI setting registration
from the charts plugin
- Removed `LEGACY_TIME_AXIS` constant export from charts common module
- Cleaned up related TypeScript configuration dependencies
- Removed telemetry schema entries for the deprecated setting
- Removed translation strings for the deprecated setting
- Adds a saved object migration to remove the setting (see [advanced
settings
migrations](https://docs.elastic.dev/kibana-dev-docs/tutorials/advanced-settings#registering-migrations))

### Identify risks

- Identified that a saved object migration needs to be added for the
removal of the setting. See this
[PR](https://github.com/elastic/kibana/pull/157699) for reference.
- Advanced settings [can be
overridden](https://www.elastic.co/docs/extend/kibana/ui-settings-service#uisettings-overrides)
in `kibana.yml`. If the setting is present in `kibana.yml` and we remove
support for it, if verification of the file was too strict, it would
fail to start Kibana. I verified that Kibana still starts when support
for the advanced setting was removed but it's still present in
`kibana.yml`.

## Release note 

Removal of the deprecated `visualization:useLegacyTimeAxis` advanced
setting.
This commit is contained in:
Walter M. Rafelsberger 2025-06-23 11:30:29 +02:00 committed by GitHub
parent 64df229998
commit b0f2c611f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 33 additions and 62 deletions

View file

@ -489,13 +489,6 @@ $$$timelion-targetbuckets$$$`timelion:target_buckets`
### Visualization [kibana-visualization-settings]
$$$visualization-uselegacytimeaxis$$$`visualization:useLegacyTimeAxis`
: :::{admonition} Deprecated in 8.10.0
This setting was deprecated in 8.10.0.
:::
Enables the legacy time axis for charts in Lens, Discover, Visualize and TSVB
$$$visualization-heatmap-maxbuckets$$$`visualization:heatmap:maxBuckets`
: The maximum number of buckets a datasource can return. High numbers can have a negative impact on your browser rendering performance.

View file

@ -26,7 +26,15 @@ export const modelVersions: SavedObjectsModelVersionMap = {
1: {
changes: [],
},
// 2: {
2: {
changes: [
{
type: 'data_removal',
removedAttributePaths: ['visualization:useLegacyTimeAxis'],
},
],
},
// 3: {
// changes: [ /* Put future migration here */ ],
// },
};

View file

@ -86,7 +86,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"cases-user-actions": "8ad74294b71edffa58fad7a40eea2388209477c9",
"cloud": "783f93b25887278becdf83841addd4e726550a51",
"cloud-security-posture-settings": "20453bee65db286a2cc1994e65cf4d7297d8173e",
"config": "7cb03ac2211a1a8a17a622632b6e6858e758aabb",
"config": "01265f01c36c7776d6a573262a6ede109633e302",
"config-global": "d9791e8f73edee884630e1cb6e4954ae513ce75e",
"connector_token": "e25821ecec3061806a6a9d4953273c18a749cc0f",
"core-usage-stats": "b3c04da317c957741ebcdedfea4524049fdc79ff",

View file

@ -71,4 +71,26 @@ describe('ui settings migrations', () => {
}),
]);
});
it('removes "visualization:useLegacyTimeAxis" setting', async () => {
const input = [
{
type: 'config',
id: '1',
attributes: {
'banners:textContent': 'my custom banner',
'visualization:useLegacyTimeAxis': true,
},
references: [],
},
];
const output = await testHarness.migrate(input);
expect(output[0].attributes).toMatchInlineSnapshot(`
Object {
"banners:textContent": "my custom banner",
}
`);
});
});

View file

@ -62,10 +62,6 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = {
type: 'long',
_meta: { description: 'Non-default value of setting.' },
},
'visualization:useLegacyTimeAxis': {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
},
'visualization:regionmap:showWarnings': {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },

View file

@ -51,7 +51,6 @@ export interface UsageStats {
'observability:aiAssistantSearchConnectorIndexPattern': string;
'onechat:mcpServer:enabled': boolean;
'visualization:heatmap:maxBuckets': number;
'visualization:useLegacyTimeAxis': boolean;
'visualization:regionmap:showWarnings': boolean;
'visualization:tileMap:maxPrecision': number;
'csv:separator': string;

View file

@ -7,8 +7,6 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
export const LEGACY_TIME_AXIS = 'visualization:useLegacyTimeAxis';
export type {
CustomPaletteArguments,
CustomPaletteState,

View file

@ -7,11 +7,9 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { i18n } from '@kbn/i18n';
import { schema } from '@kbn/config-schema';
import { CoreSetup, Plugin } from '@kbn/core/server';
import { ExpressionsServerSetup } from '@kbn/expressions-plugin/server';
import { LEGACY_TIME_AXIS, palette, systemPalette } from '../common';
import { palette, systemPalette } from '../common';
interface SetupDependencies {
expressions: ExpressionsServerSetup;
@ -21,33 +19,6 @@ export class ChartsServerPlugin implements Plugin<object, object> {
public setup(core: CoreSetup, dependencies: SetupDependencies) {
dependencies.expressions.registerFunction(palette);
dependencies.expressions.registerFunction(systemPalette);
core.uiSettings.register({
[LEGACY_TIME_AXIS]: {
name: i18n.translate('charts.advancedSettings.visualization.useLegacyTimeAxis.name', {
defaultMessage: 'Legacy chart time axis',
}),
value: false,
description: i18n.translate(
'charts.advancedSettings.visualization.useLegacyTimeAxis.description',
{
defaultMessage:
'Enables the legacy time axis for charts in Lens, Discover, Visualize and TSVB',
}
),
deprecation: {
message: i18n.translate(
'charts.advancedSettings.visualization.useLegacyTimeAxis.deprecation',
{
defaultMessage:
'This setting is deprecated and will not be supported in a future version.',
}
),
docLinksKey: 'visualizationSettings',
},
category: ['visualization'],
schema: schema.boolean(),
},
});
return {};
}

View file

@ -14,7 +14,6 @@
"@kbn/i18n-react",
"@kbn/ui-theme",
"@kbn/shared-ux-utility",
"@kbn/config-schema",
"@kbn/data-plugin",
"@kbn/core-lifecycle-browser-mocks",
"@kbn/palettes",

View file

@ -10653,12 +10653,6 @@
"description": "Non-default value of setting."
}
},
"visualization:useLegacyTimeAxis": {
"type": "boolean",
"_meta": {
"description": "Non-default value of setting."
}
},
"visualization:regionmap:showWarnings": {
"type": "boolean",
"_meta": {

View file

@ -249,9 +249,6 @@
"cellActions.extraActionsAriaLabel": "Actions supplémentaires",
"cellActions.showMoreActionsLabel": "Plus d'actions",
"cellActions.youAreInADialogContainingOptionsScreenReaderOnly": "Vous êtes dans une boîte de dialogue contenant des options pour le champ {fieldName}. Appuyez sur Tab pour naviguer entre les options. Appuyez sur Échap pour quitter.",
"charts.advancedSettings.visualization.useLegacyTimeAxis.deprecation": "Ce paramètre est déclassé et ne sera plus compatible avec les futures versions.",
"charts.advancedSettings.visualization.useLegacyTimeAxis.description": "Active l'axe de temps hérité pour les graphiques dans Lens, Discover, Visualize et TSVB",
"charts.advancedSettings.visualization.useLegacyTimeAxis.name": "Axe de temps hérité pour les graphiques",
"charts.colormaps.bluesText": "Bleus",
"charts.colormaps.greensText": "Verts",
"charts.colormaps.greenToRedText": "Vert à rouge",

View file

@ -249,9 +249,6 @@
"cellActions.extraActionsAriaLabel": "追加のアクション",
"cellActions.showMoreActionsLabel": "さらにアクションを表示",
"cellActions.youAreInADialogContainingOptionsScreenReaderOnly": "フィールド {fieldName} のオプションを含む、ダイアログを表示しています。Tab を押すと、オプションを操作します。Escapeを押すと、終了します。",
"charts.advancedSettings.visualization.useLegacyTimeAxis.deprecation": "この設定はサポートが終了し、将来のバージョンではサポートされません。",
"charts.advancedSettings.visualization.useLegacyTimeAxis.description": "Lens、Discover、Visualize、およびTSVBでグラフのレガシー時間軸を有効にします",
"charts.advancedSettings.visualization.useLegacyTimeAxis.name": "レガシーグラフ時間軸",
"charts.colormaps.bluesText": "青",
"charts.colormaps.greensText": "緑",
"charts.colormaps.greenToRedText": "緑から赤",

View file

@ -249,9 +249,6 @@
"cellActions.extraActionsAriaLabel": "附加操作",
"cellActions.showMoreActionsLabel": "更多操作",
"cellActions.youAreInADialogContainingOptionsScreenReaderOnly": "您在对话框中,其中包含 {fieldName} 字段的选项。按 tab 键导航选项。按 escape 退出。",
"charts.advancedSettings.visualization.useLegacyTimeAxis.deprecation": "此设置已过时,在未来版本中将不受支持。",
"charts.advancedSettings.visualization.useLegacyTimeAxis.description": "在 Lens、Discover、Visualize 和 TSVB 中为图表启用旧版时间轴",
"charts.advancedSettings.visualization.useLegacyTimeAxis.name": "旧版图表时间轴",
"charts.colormaps.bluesText": "蓝色",
"charts.colormaps.greensText": "绿色",
"charts.colormaps.greenToRedText": "绿到红",