From 188009f9376d5976b5db37e04c52a2b5bdaf9771 Mon Sep 17 00:00:00 2001 From: "Christiane (Tina) Heiligers" Date: Sun, 22 Jan 2023 13:41:55 -0700 Subject: [PATCH] [deprecations] Remove/update core-api deprecations targeted for removal by 8.8 (#147723) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../application/core-application-browser/src/app_leave.ts | 4 ++-- .../application/core-application-browser/src/app_mount.ts | 7 +++++-- packages/core/metrics/core-metrics-server/src/metrics.ts | 3 +-- .../src/core/document_migrator.test.ts | 2 +- .../src/core/migration_logger.ts | 1 - .../src/migration.mocks.ts | 1 - .../core-saved-objects-server/src/migration.ts | 5 ----- .../migrations/migrate_to_730/migrations_730.ts | 4 ++-- .../maps/server/saved_objects/saved_object_migrations.ts | 2 +- 9 files changed, 12 insertions(+), 17 deletions(-) diff --git a/packages/core/application/core-application-browser/src/app_leave.ts b/packages/core/application/core-application-browser/src/app_leave.ts index edc18c5ef8a48..bfc9d2480473c 100644 --- a/packages/core/application/core-application-browser/src/app_leave.ts +++ b/packages/core/application/core-application-browser/src/app_leave.ts @@ -17,9 +17,9 @@ import type { EuiButtonColor } from '@elastic/eui'; * * See {@link AppMountParameters} for detailed usage examples. * + * @remarks prefer {@link ScopedHistory.block} instead + * * @public - * @deprecated {@link AppMountParameters.onAppLeave} has been deprecated in favor of {@link ScopedHistory.block} - * @removeBy 8.8.0 */ export type AppLeaveHandler = ( factory: AppLeaveActionFactory, diff --git a/packages/core/application/core-application-browser/src/app_mount.ts b/packages/core/application/core-application-browser/src/app_mount.ts index 03cf63be5c6b3..6dbea9a8eaad5 100644 --- a/packages/core/application/core-application-browser/src/app_mount.ts +++ b/packages/core/application/core-application-browser/src/app_mount.ts @@ -142,6 +142,7 @@ export interface AppMountParameters { * This will be called either when the user goes to another application, or when * trying to close the tab or manually changing the url. * + * * @example * * ```ts @@ -165,8 +166,10 @@ export interface AppMountParameters { * } * ``` * - * @deprecated {@link ScopedHistory.block} should be used instead. - * @removeBy 8.8.0 + * @remarks prefer {@link ScopedHistory.block} instead + * Resources with names containing percent sign with other special characters or + * containing `%25` sequence can experience navigation issues. Refs https://github.com/elastic/kibana/issues/82440 and https://github.com/elastic/kibana/issues/132600 + */ onAppLeave: (handler: AppLeaveHandler) => void; diff --git a/packages/core/metrics/core-metrics-server/src/metrics.ts b/packages/core/metrics/core-metrics-server/src/metrics.ts index c20b2eb78d5d3..63a80dde1c371 100644 --- a/packages/core/metrics/core-metrics-server/src/metrics.ts +++ b/packages/core/metrics/core-metrics-server/src/metrics.ts @@ -191,8 +191,7 @@ export interface OpsMetrics { elasticsearch_client: ElasticsearchClientsMetrics; /** * Process related metrics. - * @deprecated use the processes field instead. - * @removeBy 8.8.0 + * @remarks processes field preferred */ process: OpsProcessMetrics; /** Process related metrics. Reports an array of objects for each kibana pid.*/ diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/document_migrator.test.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/document_migrator.test.ts index f8d2948510531..dd64014f815bd 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/document_migrator.test.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/document_migrator.test.ts @@ -738,7 +738,7 @@ describe('DocumentMigrator', () => { migrations: { '1.2.3': (doc, { log }) => { log.info(logTestMsg); - log.warning(logTestMsg); + log.warn(logTestMsg); return doc; }, }, diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/migration_logger.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/migration_logger.ts index c2ae13b70cbdd..e4851e9b3be00 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/migration_logger.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/migration_logger.ts @@ -25,7 +25,6 @@ export class MigrationLogger implements SavedObjectsMigrationLogger { public info = (msg: string) => this.logger.info(msg); public debug = (msg: string) => this.logger.debug(msg); - public warning = (msg: string) => this.logger.warn(msg); public warn = (msg: string) => this.logger.warn(msg); public error = (msg: string, meta: LogMeta) => this.logger.error(msg, meta); } diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/src/migration.mocks.ts b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/src/migration.mocks.ts index 6cb3cc3d1fd86..a32e683b579ab 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/src/migration.mocks.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/src/migration.mocks.ts @@ -16,7 +16,6 @@ export const createSavedObjectsMigrationLoggerMock = const mock = { debug: jest.fn(), info: jest.fn(), - warning: jest.fn(), warn: jest.fn(), error: jest.fn(), }; diff --git a/packages/core/saved-objects/core-saved-objects-server/src/migration.ts b/packages/core/saved-objects/core-saved-objects-server/src/migration.ts index 9ac9444a8dbee..9273009241e04 100644 --- a/packages/core/saved-objects/core-saved-objects-server/src/migration.ts +++ b/packages/core/saved-objects/core-saved-objects-server/src/migration.ts @@ -51,11 +51,6 @@ export type SavedObjectMigrationFn void; info: (msg: string) => void; - /** - * @deprecated Use `warn` instead. - * @removeBy 8.8.0 - */ - warning: (msg: string) => void; warn: (msg: string) => void; error: (msg: string, meta: Meta) => void; } diff --git a/src/plugins/dashboard/server/dashboard_saved_object/migrations/migrate_to_730/migrations_730.ts b/src/plugins/dashboard/server/dashboard_saved_object/migrations/migrate_to_730/migrations_730.ts index dcd1c2f2cb878..c92609858e32f 100644 --- a/src/plugins/dashboard/server/dashboard_saved_object/migrations/migrate_to_730/migrations_730.ts +++ b/src/plugins/dashboard/server/dashboard_saved_object/migrations/migrate_to_730/migrations_730.ts @@ -53,7 +53,7 @@ export const migrations730 = (doc: DashboardDoc700To720, { log }: SavedObjectMig moveFiltersToQuery(searchSource) ); } catch (e) { - log.warning( + log.warn( `Exception @ migrations730 while trying to migrate dashboard query filters!\n` + `${e.stack}\n` + `dashboard: ${inspect(doc, false, null)}` @@ -80,7 +80,7 @@ export const migrations730 = (doc: DashboardDoc700To720, { log }: SavedObjectMig delete doc.attributes.uiStateJSON; } catch (e) { - log.warning( + log.warn( `Exception @ migrations730 while trying to migrate dashboard panels!\n` + `Error: ${e.stack}\n` + `dashboard: ${inspect(doc, false, null)}` diff --git a/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts b/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts index 421054ac75067..4a55697e0f138 100644 --- a/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts +++ b/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts @@ -28,7 +28,7 @@ function logMigrationWarning( errorMsg: string, doc: SavedObjectUnsanitizedDoc ) { - context.log.warning( + context.log.warn( `map migration failed (${context.migrationVersion}). ${errorMsg}. attributes: ${JSON.stringify( doc )}`