Skip to content

Commit

Permalink
[8.x] [Automatic Import] Correctly output icons in the manifest (#201139
Browse files Browse the repository at this point in the history
) (#201225)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Automatic Import] Correctly output icons in the manifest
(#201139)](#201139)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ilya
Nikokoshev","email":"ilya.nikokoshev@elastic.co"},"sourceCommit":{"committedDate":"2024-11-21T15:34:07Z","message":"[Automatic
Import] Correctly output icons in the manifest (#201139)\n\n## Release
Note\r\n\r\nFixes a bug in Automatic Import where icons were not shown
after the\r\nintegration was installed.\r\n\r\n## Summary\r\n\r\nCloses
#201008.\r\n\r\nWhen implementing safe manifest output #192316 a bug
crept in:\r\nthe icons array was incorrectly output as a
dictionary\r\n\r\n icons:\r\n src: /img/logoElastic.svg\r\n title:
syslog_test3 Logo\r\n size: 32x32\r\n type: image/svg+xml\r\n\r\nand the
test was not smart enough to pick it up:\r\n\r\n
expect(manifest.icons).toBeTruthy();\r\n\r\nWe fix the field and add
better tests for
it.","sha":"30e075a1b601a9bd5564667b67b3112479d1eebc","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","v9.0.0","backport:prev-major","8.17
candidate","Team:Security-Scalability","Feature:AutomaticImport"],"title":"[Automatic
Import] Correctly output icons in the
manifest","number":201139,"url":"https://github.com/elastic/kibana/pull/201139","mergeCommit":{"message":"[Automatic
Import] Correctly output icons in the manifest (#201139)\n\n## Release
Note\r\n\r\nFixes a bug in Automatic Import where icons were not shown
after the\r\nintegration was installed.\r\n\r\n## Summary\r\n\r\nCloses
#201008.\r\n\r\nWhen implementing safe manifest output #192316 a bug
crept in:\r\nthe icons array was incorrectly output as a
dictionary\r\n\r\n icons:\r\n src: /img/logoElastic.svg\r\n title:
syslog_test3 Logo\r\n size: 32x32\r\n type: image/svg+xml\r\n\r\nand the
test was not smart enough to pick it up:\r\n\r\n
expect(manifest.icons).toBeTruthy();\r\n\r\nWe fix the field and add
better tests for
it.","sha":"30e075a1b601a9bd5564667b67b3112479d1eebc"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201139","number":201139,"mergeCommit":{"message":"[Automatic
Import] Correctly output icons in the manifest (#201139)\n\n## Release
Note\r\n\r\nFixes a bug in Automatic Import where icons were not shown
after the\r\nintegration was installed.\r\n\r\n## Summary\r\n\r\nCloses
#201008.\r\n\r\nWhen implementing safe manifest output #192316 a bug
crept in:\r\nthe icons array was incorrectly output as a
dictionary\r\n\r\n icons:\r\n src: /img/logoElastic.svg\r\n title:
syslog_test3 Logo\r\n size: 32x32\r\n type: image/svg+xml\r\n\r\nand the
test was not smart enough to pick it up:\r\n\r\n
expect(manifest.icons).toBeTruthy();\r\n\r\nWe fix the field and add
better tests for
it.","sha":"30e075a1b601a9bd5564667b67b3112479d1eebc"}}]}] BACKPORT-->

Co-authored-by: Ilya Nikokoshev <ilya.nikokoshev@elastic.co>
  • Loading branch information
kibanamachine and ilyannn authored Nov 21, 2024
1 parent 2aa0394 commit bf7e73f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,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',
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,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;
}
Expand Down

0 comments on commit bf7e73f

Please sign in to comment.