Skip to content

Commit 2b765b1

Browse files
John Schulzelasticmachine
andauthored
[7.x] [Ingest Manager] Use EPR's Image.path if available (#76434)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent dd3b598 commit 2b765b1

File tree

5 files changed

+43
-21
lines changed

5 files changed

+43
-21
lines changed

x-pack/plugins/ingest_manager/common/openapi/spec_oas3.json

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,11 +1425,13 @@
14251425
},
14261426
"icons": [
14271427
{
1428-
"src": "/package/coredns-1.0.1/img/icon.png",
1428+
"path": "/package/coredns-1.0.1/img/icon.png",
1429+
"src": "/img/icon.png",
14291430
"size": "1800x1800"
14301431
},
14311432
{
1432-
"src": "/package/coredns-1.0.1/img/icon.svg",
1433+
"path": "/package/coredns-1.0.1/img/icon.svg",
1434+
"src": "/img/icon.svg",
14331435
"size": "255x144",
14341436
"type": "image/svg+xml"
14351437
}
@@ -1704,7 +1706,8 @@
17041706
},
17051707
"icons": [
17061708
{
1707-
"src": "/package/endpoint/0.3.0/img/logo-endpoint-64-color.svg",
1709+
"path": "/package/endpoint/0.3.0/img/logo-endpoint-64-color.svg",
1710+
"src": "/img/logo-endpoint-64-color.svg",
17081711
"size": "16x16",
17091712
"type": "image/svg+xml"
17101713
}
@@ -2001,7 +2004,8 @@
20012004
"download": "/epr/aws/aws-0.0.3.tar.gz",
20022005
"icons": [
20032006
{
2004-
"src": "/package/aws/0.0.3/img/logo_aws.svg",
2007+
"path": "/package/aws/0.0.3/img/logo_aws.svg",
2008+
"src": "/img/logo_aws.svg",
20052009
"title": "logo aws",
20062010
"size": "32x32",
20072011
"type": "image/svg+xml"
@@ -2019,7 +2023,8 @@
20192023
"download": "/epr/endpoint/endpoint-0.1.0.tar.gz",
20202024
"icons": [
20212025
{
2022-
"src": "/package/endpoint/0.1.0/img/logo-endpoint-64-color.svg",
2026+
"path": "/package/endpoint/0.1.0/img/logo-endpoint-64-color.svg",
2027+
"src": "/img/logo-endpoint-64-color.svg",
20232028
"size": "16x16",
20242029
"type": "image/svg+xml"
20252030
}
@@ -2087,7 +2092,8 @@
20872092
"download": "/epr/log/log-0.9.0.tar.gz",
20882093
"icons": [
20892094
{
2090-
"src": "/package/log/0.9.0/img/icon.svg",
2095+
"path": "/package/log/0.9.0/img/icon.svg",
2096+
"src": "/img/icon.svg",
20912097
"type": "image/svg+xml"
20922098
}
20932099
],
@@ -2103,7 +2109,8 @@
21032109
"download": "/epr/longdocs/longdocs-1.0.4.tar.gz",
21042110
"icons": [
21052111
{
2106-
"src": "/package/longdocs/1.0.4/img/icon.svg",
2112+
"path": "/package/longdocs/1.0.4/img/icon.svg",
2113+
"src": "/img/icon.svg",
21072114
"type": "image/svg+xml"
21082115
}
21092116
],
@@ -2119,7 +2126,8 @@
21192126
"download": "/epr/metricsonly/metricsonly-2.0.1.tar.gz",
21202127
"icons": [
21212128
{
2122-
"src": "/package/metricsonly/2.0.1/img/icon.svg",
2129+
"path": "/package/metricsonly/2.0.1/img/icon.svg",
2130+
"src": "/img/icon.svg",
21232131
"type": "image/svg+xml"
21242132
}
21252133
],
@@ -2135,7 +2143,8 @@
21352143
"download": "/epr/multiversion/multiversion-1.1.0.tar.gz",
21362144
"icons": [
21372145
{
2138-
"src": "/package/multiversion/1.1.0/img/icon.svg",
2146+
"path": "/package/multiversion/1.1.0/img/icon.svg",
2147+
"src": "/img/icon.svg",
21392148
"type": "image/svg+xml"
21402149
}
21412150
],
@@ -2151,7 +2160,8 @@
21512160
"download": "/epr/mysql/mysql-0.1.0.tar.gz",
21522161
"icons": [
21532162
{
2154-
"src": "/package/mysql/0.1.0/img/logo_mysql.svg",
2163+
"path": "/package/mysql/0.1.0/img/logo_mysql.svg",
2164+
"src": "/img/logo_mysql.svg",
21552165
"title": "logo mysql",
21562166
"size": "32x32",
21572167
"type": "image/svg+xml"
@@ -2169,7 +2179,8 @@
21692179
"download": "/epr/nginx/nginx-0.1.0.tar.gz",
21702180
"icons": [
21712181
{
2172-
"src": "/package/nginx/0.1.0/img/logo_nginx.svg",
2182+
"path": "/package/nginx/0.1.0/img/logo_nginx.svg",
2183+
"src": "/img/logo_nginx.svg",
21732184
"title": "logo nginx",
21742185
"size": "32x32",
21752186
"type": "image/svg+xml"
@@ -2187,7 +2198,8 @@
21872198
"download": "/epr/redis/redis-0.1.0.tar.gz",
21882199
"icons": [
21892200
{
2190-
"src": "/package/redis/0.1.0/img/logo_redis.svg",
2201+
"path": "/package/redis/0.1.0/img/logo_redis.svg",
2202+
"src": "/img/logo_redis.svg",
21912203
"title": "logo redis",
21922204
"size": "32x32",
21932205
"type": "image/svg+xml"
@@ -2205,7 +2217,8 @@
22052217
"download": "/epr/reference/reference-1.0.0.tar.gz",
22062218
"icons": [
22072219
{
2208-
"src": "/package/reference/1.0.0/img/icon.svg",
2220+
"path": "/package/reference/1.0.0/img/icon.svg",
2221+
"src": "/img/icon.svg",
22092222
"size": "32x32",
22102223
"type": "image/svg+xml"
22112224
}
@@ -2222,7 +2235,8 @@
22222235
"download": "/epr/system/system-0.1.0.tar.gz",
22232236
"icons": [
22242237
{
2225-
"src": "/package/system/0.1.0/img/system.svg",
2238+
"path": "/package/system/0.1.0/img/system.svg",
2239+
"src": "/img/system.svg",
22262240
"title": "system",
22272241
"size": "1000x1000",
22282242
"type": "image/svg+xml"
@@ -3913,11 +3927,20 @@
39133927
"src": {
39143928
"type": "string"
39153929
},
3930+
"path": {
3931+
"type": "string"
3932+
},
39163933
"title": {
39173934
"type": "string"
3935+
},
3936+
"size": {
3937+
"type": "string"
3938+
},
3939+
"type": {
3940+
"type": "string"
39183941
}
39193942
},
3920-
"required": ["src"]
3943+
"required": ["src", "path"]
39213944
}
39223945
},
39233946
"icons": {

x-pack/plugins/ingest_manager/common/types/models/epm.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ export interface RegistryPackage {
7474
}
7575

7676
interface RegistryImage {
77-
// https://github.com/elastic/package-registry/blob/master/util/package.go#L74
78-
// says src is potentially missing but I couldn't find any examples
79-
// it seems like src should be required. How can you have an image with no reference to the content?
8077
src: string;
78+
path: string;
8179
title?: string;
8280
size?: string;
8381
type?: string;

x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_package_icon_type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const usePackageIconType = ({
4242
const svgIcons = (paramIcons || iconList)?.filter(
4343
(iconDef) => iconDef.type === 'image/svg+xml'
4444
);
45-
const localIconSrc = Array.isArray(svgIcons) && svgIcons[0]?.src;
45+
const localIconSrc = Array.isArray(svgIcons) && (svgIcons[0].path || svgIcons[0].src);
4646
if (localIconSrc) {
4747
CACHED_ICONS.set(pkgKey, toImage(localIconSrc));
4848
setIconType(CACHED_ICONS.get(pkgKey) || '');

x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/screens/detail/screenshots.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function Screenshots(props: ScreenshotProps) {
7575
set image to same width. Will need to update if size changes.
7676
*/}
7777
<EuiImage
78-
url={toImage(image.src)}
78+
url={toImage(image.path || image.src)}
7979
alt="screenshot image preview"
8080
size="l"
8181
allowFullScreen

x-pack/plugins/security_solution/common/endpoint/generate_data.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,8 @@ export class EndpointDocGenerator {
11321132
path: '/package/endpoint/0.5.0',
11331133
icons: [
11341134
{
1135-
src: '/package/endpoint/0.5.0/img/logo-endpoint-64-color.svg',
1135+
path: '/package/endpoint/0.5.0/img/logo-endpoint-64-color.svg',
1136+
src: '/img/logo-endpoint-64-color.svg',
11361137
size: '16x16',
11371138
type: 'image/svg+xml',
11381139
},

0 commit comments

Comments
 (0)