From 5454456a21f37f1af07df030c56a2953ad33f999 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 22 Nov 2024 04:39:50 +1100 Subject: [PATCH] [8.15] [Automatic Import] Correctly output icons in the manifest (#201139) (#201222) # Backport This will backport the following commits from `main` to `8.15`: - [[Automatic Import] Correctly output icons in the manifest (#201139)](https://github.com/elastic/kibana/pull/201139) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Ilya Nikokoshev --- .../integration_builder/build_integration.test.ts | 9 ++++++++- .../integration_builder/build_integration.ts | 14 ++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/integration_assistant/server/integration_builder/build_integration.test.ts b/x-pack/plugins/integration_assistant/server/integration_builder/build_integration.test.ts index 50ec954bcb118..171b8004c9208 100644 --- a/x-pack/plugins/integration_assistant/server/integration_builder/build_integration.test.ts +++ b/x-pack/plugins/integration_assistant/server/integration_builder/build_integration.test.ts @@ -259,6 +259,13 @@ describe('renderPackageManifestYAML', () => { expect(manifest.name).toBe(integration.name); expect(manifest.type).toBe('integration'); expect(manifest.description).toBe(integration.description); - expect(manifest.icons).toBeTruthy(); + expect(Array.isArray(manifest.icons)).toBe(true); + expect((manifest.icons as object[]).length).toBe(1); + expect((manifest.icons as object[])[0]).toEqual({ + src: '/img/logo.svg', + title: 'Sample Integration Logo', + size: '32x32', + type: 'image/svg+xml', + }); }); }); diff --git a/x-pack/plugins/integration_assistant/server/integration_builder/build_integration.ts b/x-pack/plugins/integration_assistant/server/integration_builder/build_integration.ts index 0a97977c653a5..531a6e0325509 100644 --- a/x-pack/plugins/integration_assistant/server/integration_builder/build_integration.ts +++ b/x-pack/plugins/integration_assistant/server/integration_builder/build_integration.ts @@ -182,12 +182,14 @@ function createPackageManifestDict( }; if (package_logo !== undefined && package_logo !== '') { - data.icons = { - src: '/img/logo.svg', - title: `${package_title} Logo`, - size: '32x32', - type: 'image/svg+xml', - }; + data.icons = [ + { + src: '/img/logo.svg', + title: `${package_title} Logo`, + size: '32x32', + type: 'image/svg+xml', + }, + ]; } return data; }