diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportfailure.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportfailure.md index be1a20b3c71a4..e7de1014bdaf2 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportfailure.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportfailure.md @@ -20,6 +20,5 @@ export interface SavedObjectsImportFailure | [id](./kibana-plugin-core-public.savedobjectsimportfailure.id.md) | string | | | [meta](./kibana-plugin-core-public.savedobjectsimportfailure.meta.md) | { title?: string; icon?: string; } | | | [overwrite?](./kibana-plugin-core-public.savedobjectsimportfailure.overwrite.md) | boolean | (Optional) If overwrite is specified, an attempt was made to overwrite an existing object. | -| [title?](./kibana-plugin-core-public.savedobjectsimportfailure.title.md) | string | (Optional) | | [type](./kibana-plugin-core-public.savedobjectsimportfailure.type.md) | string | | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportfailure.title.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportfailure.title.md deleted file mode 100644 index 0024358bda030..0000000000000 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsimportfailure.title.md +++ /dev/null @@ -1,16 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectsImportFailure](./kibana-plugin-core-public.savedobjectsimportfailure.md) > [title](./kibana-plugin-core-public.savedobjectsimportfailure.title.md) - -## SavedObjectsImportFailure.title property - -> Warning: This API is now obsolete. -> -> Use `meta.title` instead -> - -Signature: - -```typescript -title?: string; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportfailure.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportfailure.md index 52db837479cf6..4bdc3d99028ab 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportfailure.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportfailure.md @@ -20,6 +20,5 @@ export interface SavedObjectsImportFailure | [id](./kibana-plugin-core-server.savedobjectsimportfailure.id.md) | string | | | [meta](./kibana-plugin-core-server.savedobjectsimportfailure.meta.md) | { title?: string; icon?: string; } | | | [overwrite?](./kibana-plugin-core-server.savedobjectsimportfailure.overwrite.md) | boolean | (Optional) If overwrite is specified, an attempt was made to overwrite an existing object. | -| [title?](./kibana-plugin-core-server.savedobjectsimportfailure.title.md) | string | (Optional) | | [type](./kibana-plugin-core-server.savedobjectsimportfailure.type.md) | string | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportfailure.title.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportfailure.title.md deleted file mode 100644 index 12326e6b0e4bb..0000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsimportfailure.title.md +++ /dev/null @@ -1,16 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsImportFailure](./kibana-plugin-core-server.savedobjectsimportfailure.md) > [title](./kibana-plugin-core-server.savedobjectsimportfailure.title.md) - -## SavedObjectsImportFailure.title property - -> Warning: This API is now obsolete. -> -> Use `meta.title` instead -> - -Signature: - -```typescript -title?: string; -``` diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index b30c009bf2538..348d20ea02e52 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -1255,8 +1255,6 @@ export interface SavedObjectsImportFailure { icon?: string; }; overwrite?: boolean; - // @deprecated (undocumented) - title?: string; // (undocumented) type: string; } diff --git a/src/core/server/saved_objects/import/import_saved_objects.test.ts b/src/core/server/saved_objects/import/import_saved_objects.test.ts index 2f31b4cf3ead3..046b9d3505cde 100644 --- a/src/core/server/saved_objects/import/import_saved_objects.test.ts +++ b/src/core/server/saved_objects/import/import_saved_objects.test.ts @@ -112,7 +112,6 @@ describe('#importSavedObjectsFromStream', () => { return { type: 'foo-type', id: uuidv4(), - title: 'some-title', meta: { title }, error: { type: 'conflict' }, }; diff --git a/src/core/server/saved_objects/import/lib/check_conflicts.test.ts b/src/core/server/saved_objects/import/lib/check_conflicts.test.ts index b2de6f11d5cb8..e11e880016550 100644 --- a/src/core/server/saved_objects/import/lib/check_conflicts.test.ts +++ b/src/core/server/saved_objects/import/lib/check_conflicts.test.ts @@ -108,13 +108,11 @@ describe('#checkConflicts', () => { errors: [ { ...obj2Error, - title: obj2.attributes.title, meta: { title: obj2.attributes.title }, error: { type: 'conflict' }, }, { ...obj4Error, - title: obj4.attributes.title, meta: { title: obj4.attributes.title }, error: { ...obj4Error.error, type: 'unknown' }, }, @@ -136,7 +134,6 @@ describe('#checkConflicts', () => { errors: [ { ...obj4Error, - title: obj4.attributes.title, meta: { title: obj4.attributes.title }, error: { ...obj4Error.error, type: 'unknown' }, }, @@ -174,13 +171,11 @@ describe('#checkConflicts', () => { errors: [ { ...obj2Error, - title: obj2.attributes.title, meta: { title: obj2.attributes.title }, error: { type: 'conflict', destinationId: 'some-object-id' }, }, { ...obj4Error, - title: obj4.attributes.title, meta: { title: obj4.attributes.title }, error: { ...obj4Error.error, type: 'unknown' }, }, diff --git a/src/core/server/saved_objects/import/lib/check_conflicts.ts b/src/core/server/saved_objects/import/lib/check_conflicts.ts index c15c4302491b4..3ab4b03e791b0 100644 --- a/src/core/server/saved_objects/import/lib/check_conflicts.ts +++ b/src/core/server/saved_objects/import/lib/check_conflicts.ts @@ -80,10 +80,10 @@ export async function checkConflicts({ importStateMap.set(`${type}:${id}`, { destinationId: uuidv4(), omitOriginId }); filteredObjects.push(object); } else if (errorObj && errorObj.statusCode !== 409) { - errors.push({ type, id, title, meta: { title }, error: { ...errorObj, type: 'unknown' } }); + errors.push({ type, id, meta: { title }, error: { ...errorObj, type: 'unknown' } }); } else if (errorObj?.statusCode === 409 && !ignoreRegularConflicts && !overwrite) { const error = { type: 'conflict' as 'conflict', ...(destinationId && { destinationId }) }; - errors.push({ type, id, title, meta: { title }, error }); + errors.push({ type, id, meta: { title }, error }); } else { filteredObjects.push(object); if (errorObj?.statusCode === 409) { diff --git a/src/core/server/saved_objects/import/lib/check_origin_conflicts.test.ts b/src/core/server/saved_objects/import/lib/check_origin_conflicts.test.ts index 12aa9f668a586..30f40e5e84c62 100644 --- a/src/core/server/saved_objects/import/lib/check_origin_conflicts.test.ts +++ b/src/core/server/saved_objects/import/lib/check_origin_conflicts.test.ts @@ -176,7 +176,6 @@ describe('#checkOriginConflicts', () => { ): SavedObjectsImportFailure => ({ type: object.type, id: object.id, - title: object.attributes.title, meta: { title: object.attributes.title }, error: { type: 'ambiguous_conflict', @@ -189,7 +188,6 @@ describe('#checkOriginConflicts', () => { ): SavedObjectsImportFailure => ({ type: object.type, id: object.id, - title: object.attributes?.title, meta: { title: object.attributes.title }, error: { type: 'conflict', diff --git a/src/core/server/saved_objects/import/lib/check_origin_conflicts.ts b/src/core/server/saved_objects/import/lib/check_origin_conflicts.ts index 46d38f7c44e5e..207eb59b126cd 100644 --- a/src/core/server/saved_objects/import/lib/check_origin_conflicts.ts +++ b/src/core/server/saved_objects/import/lib/check_origin_conflicts.ts @@ -229,7 +229,6 @@ export async function checkOriginConflicts({ errors.push({ type, id, - title, meta: { title }, error: { type: 'conflict', @@ -253,7 +252,6 @@ export async function checkOriginConflicts({ errors.push({ type, id, - title, meta: { title }, error: { type: 'ambiguous_conflict', diff --git a/src/core/server/saved_objects/import/lib/collect_saved_objects.test.ts b/src/core/server/saved_objects/import/lib/collect_saved_objects.test.ts index b401d71ffe498..c0c2d9e6bfede 100644 --- a/src/core/server/saved_objects/import/lib/collect_saved_objects.test.ts +++ b/src/core/server/saved_objects/import/lib/collect_saved_objects.test.ts @@ -157,7 +157,7 @@ describe('collectSavedObjects()', () => { const error = { type: 'unsupported_type' }; const { title } = obj1.attributes; - const errors = [{ error, type: obj1.type, id: obj1.id, title, meta: { title } }]; + const errors = [{ error, type: obj1.type, id: obj1.id, meta: { title } }]; expect(result).toEqual({ collectedObjects: [], errors, importStateMap: new Map() }); }); @@ -174,7 +174,7 @@ describe('collectSavedObjects()', () => { ]); const error = { type: 'unsupported_type' }; const { title } = obj2.attributes; - const errors = [{ error, type: obj2.type, id: obj2.id, title, meta: { title } }]; + const errors = [{ error, type: obj2.type, id: obj2.id, meta: { title } }]; expect(result).toEqual({ collectedObjects, errors, importStateMap }); }); @@ -192,7 +192,7 @@ describe('collectSavedObjects()', () => { const error = { type: 'unsupported_type' }; const { title } = obj1.attributes; - const errors = [{ error, type: obj1.type, id: obj1.id, title, meta: { title } }]; + const errors = [{ error, type: obj1.type, id: obj1.id, meta: { title } }]; expect(result).toEqual({ collectedObjects: [], errors, importStateMap: new Map() }); }); @@ -215,7 +215,7 @@ describe('collectSavedObjects()', () => { ]); const error = { type: 'unsupported_type' }; const { title } = obj1.attributes; - const errors = [{ error, type: obj1.type, id: obj1.id, title, meta: { title } }]; + const errors = [{ error, type: obj1.type, id: obj1.id, meta: { title } }]; expect(result).toEqual({ collectedObjects, errors, importStateMap }); }); }); diff --git a/src/core/server/saved_objects/import/lib/collect_saved_objects.ts b/src/core/server/saved_objects/import/lib/collect_saved_objects.ts index 209ae5ecf283e..66d75d7af5073 100644 --- a/src/core/server/saved_objects/import/lib/collect_saved_objects.ts +++ b/src/core/server/saved_objects/import/lib/collect_saved_objects.ts @@ -49,7 +49,6 @@ export async function collectSavedObjects({ errors.push({ id: obj.id, type: obj.type, - title, meta: { title }, error: { type: 'unsupported_type', diff --git a/src/core/server/saved_objects/import/lib/extract_errors.test.ts b/src/core/server/saved_objects/import/lib/extract_errors.test.ts index f3a9c2d89537d..a355094f07117 100644 --- a/src/core/server/saved_objects/import/lib/extract_errors.test.ts +++ b/src/core/server/saved_objects/import/lib/extract_errors.test.ts @@ -51,45 +51,42 @@ describe('extractErrors()', () => { ]; const result = extractErrors(savedObjects, savedObjects); expect(result).toMatchInlineSnapshot(` -Array [ - Object { - "error": Object { - "type": "conflict", - }, - "id": "2", - "meta": Object { - "title": "My Dashboard 2", - }, - "title": "My Dashboard 2", - "type": "dashboard", - }, - Object { - "error": Object { - "error": "Bad Request", - "message": "Bad Request", - "statusCode": 400, - "type": "unknown", - }, - "id": "3", - "meta": Object { - "title": "My Dashboard 3", - }, - "title": "My Dashboard 3", - "type": "dashboard", - }, - Object { - "error": Object { - "destinationId": "foo", - "type": "conflict", - }, - "id": "4", - "meta": Object { - "title": "My Dashboard 4", - }, - "title": "My Dashboard 4", - "type": "dashboard", - }, -] -`); + Array [ + Object { + "error": Object { + "type": "conflict", + }, + "id": "2", + "meta": Object { + "title": "My Dashboard 2", + }, + "type": "dashboard", + }, + Object { + "error": Object { + "error": "Bad Request", + "message": "Bad Request", + "statusCode": 400, + "type": "unknown", + }, + "id": "3", + "meta": Object { + "title": "My Dashboard 3", + }, + "type": "dashboard", + }, + Object { + "error": Object { + "destinationId": "foo", + "type": "conflict", + }, + "id": "4", + "meta": Object { + "title": "My Dashboard 4", + }, + "type": "dashboard", + }, + ] + `); }); }); diff --git a/src/core/server/saved_objects/import/lib/extract_errors.ts b/src/core/server/saved_objects/import/lib/extract_errors.ts index dbc88b01f9ae2..12d7612a4f960 100644 --- a/src/core/server/saved_objects/import/lib/extract_errors.ts +++ b/src/core/server/saved_objects/import/lib/extract_errors.ts @@ -30,7 +30,6 @@ export function extractErrors( errors.push({ id: savedObject.id, type: savedObject.type, - title, meta: { title }, error: { type: 'conflict', @@ -42,7 +41,6 @@ export function extractErrors( errors.push({ id: savedObject.id, type: savedObject.type, - title, meta: { title }, error: { ...savedObject.error, diff --git a/src/core/server/saved_objects/import/lib/validate_references.ts b/src/core/server/saved_objects/import/lib/validate_references.ts index 69e036cf77a3a..b454bf8c887a4 100644 --- a/src/core/server/saved_objects/import/lib/validate_references.ts +++ b/src/core/server/saved_objects/import/lib/validate_references.ts @@ -116,7 +116,6 @@ export async function validateReferences(params: ValidateReferencesParams) { errorMap[`${type}:${id}`] = { id, type, - title, meta: { title }, error: { type: 'missing_references', references: missingReferences }, }; diff --git a/src/core/server/saved_objects/import/resolve_import_errors.test.ts b/src/core/server/saved_objects/import/resolve_import_errors.test.ts index 5218def19852a..2a228df80f2d3 100644 --- a/src/core/server/saved_objects/import/resolve_import_errors.test.ts +++ b/src/core/server/saved_objects/import/resolve_import_errors.test.ts @@ -138,7 +138,6 @@ describe('#importSavedObjectsFromStream', () => { return { type: 'foo-type', id: uuidv4(), - title: 'some-title', meta: { title }, error: { type: 'conflict' }, }; diff --git a/src/core/server/saved_objects/import/types.ts b/src/core/server/saved_objects/import/types.ts index be1a67c931830..07ddc97db8a48 100644 --- a/src/core/server/saved_objects/import/types.ts +++ b/src/core/server/saved_objects/import/types.ts @@ -89,10 +89,6 @@ export interface SavedObjectsImportMissingReferencesError { export interface SavedObjectsImportFailure { id: string; type: string; - /** - * @deprecated Use `meta.title` instead - */ - title?: string; meta: { title?: string; icon?: string }; /** * If `overwrite` is specified, an attempt was made to overwrite an existing object. diff --git a/src/core/server/saved_objects/routes/integration_tests/import.test.ts b/src/core/server/saved_objects/routes/integration_tests/import.test.ts index d5f994a3e01ea..6f2dfe86a1525 100644 --- a/src/core/server/saved_objects/routes/integration_tests/import.test.ts +++ b/src/core/server/saved_objects/routes/integration_tests/import.test.ts @@ -229,7 +229,6 @@ describe(`POST ${URL}`, () => { { id: mockIndexPattern.id, type: mockIndexPattern.type, - title: mockIndexPattern.attributes.title, meta: { title: mockIndexPattern.attributes.title, icon: 'index-pattern-icon' }, error: { type: 'conflict' }, }, @@ -322,7 +321,6 @@ describe(`POST ${URL}`, () => { { id: 'my-vis', type: 'visualization', - title: 'my-vis', meta: { title: 'my-vis', icon: 'visualization-icon' }, error: { type: 'missing_references', @@ -386,7 +384,6 @@ describe(`POST ${URL}`, () => { { id: 'my-vis', type: 'visualization', - title: 'my-vis', meta: { title: 'my-vis', icon: 'visualization-icon' }, error: { type: 'missing_references', @@ -396,7 +393,6 @@ describe(`POST ${URL}`, () => { { id: 'my-vis', type: 'visualization', - title: 'my-vis', meta: { title: 'my-vis', icon: 'visualization-icon' }, error: { type: 'conflict' }, }, @@ -457,7 +453,6 @@ describe(`POST ${URL}`, () => { { id: 'my-vis', type: 'visualization', - title: 'my-vis', meta: { title: 'my-vis', icon: 'visualization-icon' }, overwrite: true, error: { diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index 6d5b06346225b..65ef524f83949 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -2501,8 +2501,6 @@ export interface SavedObjectsImportFailure { icon?: string; }; overwrite?: boolean; - // @deprecated (undocumented) - title?: string; // (undocumented) type: string; } diff --git a/test/api_integration/apis/saved_objects/import.ts b/test/api_integration/apis/saved_objects/import.ts index c899f082ec4d3..205325ae745bb 100644 --- a/test/api_integration/apis/saved_objects/import.ts +++ b/test/api_integration/apis/saved_objects/import.ts @@ -16,7 +16,6 @@ const createConflictError = ( object: Omit ): SavedObjectsImportFailure => ({ ...object, - title: object.meta.title, error: { type: 'conflict' }, }); @@ -123,7 +122,6 @@ export default function ({ getService }: FtrProviderContext) { { id: '1', type: 'wigwags', - title: 'my title', meta: { title: 'my title' }, error: { type: 'unsupported_type' }, }, @@ -221,7 +219,6 @@ export default function ({ getService }: FtrProviderContext) { { type: 'visualization', id: '1', - title: 'My visualization', meta: { title: 'My visualization', icon: 'visualizeApp' }, error: { type: 'missing_references', diff --git a/test/plugin_functional/test_suites/saved_objects_hidden_type/import.ts b/test/plugin_functional/test_suites/saved_objects_hidden_type/import.ts index 70241ade50a3d..f8fa3c11a1b8c 100644 --- a/test/plugin_functional/test_suites/saved_objects_hidden_type/import.ts +++ b/test/plugin_functional/test_suites/saved_objects_hidden_type/import.ts @@ -72,7 +72,6 @@ export default function ({ getService }: PluginFunctionalProviderContext) { { id: 'some-id-1', type: 'test-hidden-non-importable-exportable', - title: 'my title', meta: { title: 'my title', }, diff --git a/test/plugin_functional/test_suites/saved_objects_hidden_type/resolve_import_errors.ts b/test/plugin_functional/test_suites/saved_objects_hidden_type/resolve_import_errors.ts index 8af5e07ab69ad..be2af8cd5d115 100644 --- a/test/plugin_functional/test_suites/saved_objects_hidden_type/resolve_import_errors.ts +++ b/test/plugin_functional/test_suites/saved_objects_hidden_type/resolve_import_errors.ts @@ -95,7 +95,6 @@ export default function ({ getService }: PluginFunctionalProviderContext) { { id: 'op3767a1-9rcg-53u7-jkb3-3dnb74193awc', type: 'test-hidden-non-importable-exportable', - title: 'new title!', meta: { title: 'new title!', }, diff --git a/x-pack/test/spaces_api_integration/common/suites/copy_to_space.ts b/x-pack/test/spaces_api_integration/common/suites/copy_to_space.ts index 8ade75e90b541..bd343cad737aa 100644 --- a/x-pack/test/spaces_api_integration/common/suites/copy_to_space.ts +++ b/x-pack/test/spaces_api_integration/common/suites/copy_to_space.ts @@ -416,7 +416,6 @@ export function copyToSpaceTestSuiteFactory( destinationId: `cts_dashboard_${destination}`, // this conflicted with another dashboard in the destination space because of a shared originId }, id: `cts_dashboard_${spaceId}`, - title: `This is the ${spaceId} test space CTS dashboard`, type: 'dashboard', meta: { title: `This is the ${spaceId} test space CTS dashboard`, @@ -429,7 +428,6 @@ export function copyToSpaceTestSuiteFactory( destinationId: `cts_ip_1_${destination}`, // this conflicted with another index pattern in the destination space because of a shared originId }, id: `cts_ip_1_${spaceId}`, - title: `Copy to Space index pattern 1 from ${spaceId} space`, type: 'index-pattern', meta: { title: `Copy to Space index pattern 1 from ${spaceId} space`, @@ -442,7 +440,6 @@ export function copyToSpaceTestSuiteFactory( destinationId: `cts_vis_3_${destination}`, // this conflicted with another visualization in the destination space because of a shared originId }, id: `cts_vis_3_${spaceId}`, - title: `CTS vis 3 from ${spaceId} space`, type: 'visualization', meta: { title: `CTS vis 3 from ${spaceId} space`, @@ -591,7 +588,6 @@ export function copyToSpaceTestSuiteFactory( error: { type: 'conflict', destinationId }, type, id: inexactMatchIdA, - title, meta, }, ]); @@ -633,7 +629,6 @@ export function copyToSpaceTestSuiteFactory( error: { type: 'conflict', destinationId }, type, id: inexactMatchIdB, - title, meta, }, ]); @@ -675,7 +670,6 @@ export function copyToSpaceTestSuiteFactory( error: { type: 'conflict', destinationId }, type, id: inexactMatchIdC, - title, meta, }, ]); @@ -721,7 +715,6 @@ export function copyToSpaceTestSuiteFactory( error: { type: 'ambiguous_conflict', destinations }, type, id: ambiguousConflictId, - title, meta: { title, icon: 'beaker' }, }, ]); diff --git a/x-pack/test/spaces_api_integration/common/suites/resolve_copy_to_space_conflicts.ts b/x-pack/test/spaces_api_integration/common/suites/resolve_copy_to_space_conflicts.ts index 336b04832e2dc..75aea0a3fe4e0 100644 --- a/x-pack/test/spaces_api_integration/common/suites/resolve_copy_to_space_conflicts.ts +++ b/x-pack/test/spaces_api_integration/common/suites/resolve_copy_to_space_conflicts.ts @@ -163,7 +163,6 @@ export function resolveCopyToSpaceConflictsSuite( destinationId: `cts_ip_1_${destination}`, // this conflicted with another index pattern in the destination space because of a shared originId }, id: `cts_ip_1_${sourceSpaceId}`, - title: `Copy to Space index pattern 1 from ${sourceSpaceId} space`, meta: { title: `Copy to Space index pattern 1 from ${sourceSpaceId} space`, icon: 'indexPatternApp', @@ -176,7 +175,6 @@ export function resolveCopyToSpaceConflictsSuite( destinationId: `cts_vis_3_${destination}`, // this conflicted with another visualization in the destination space because of a shared originId }, id: `cts_vis_3_${sourceSpaceId}`, - title: `CTS vis 3 from ${sourceSpaceId} space`, meta: { title: `CTS vis 3 from ${sourceSpaceId} space`, icon: 'visualizeApp', @@ -211,7 +209,6 @@ export function resolveCopyToSpaceConflictsSuite( }, id: `cts_dashboard_${sourceSpaceId}`, type: 'dashboard', - title: `This is the ${sourceSpaceId} test space CTS dashboard`, meta: { title: `This is the ${sourceSpaceId} test space CTS dashboard`, icon: 'dashboardApp',