Skip to content

Commit e994f66

Browse files
kibanamachineSupplementingelasticmachine
authored
[9.1] [Fleet] Add error message/status when dragging/dropping non-svg into custom integration (#226294) (#226438)
# Backport This will backport the following commits from `main` to `9.1`: - [[Fleet] Add error message/status when dragging/dropping non-svg into custom integration (#226294)](#226294) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Mason Herron","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-03T14:00:47Z","message":"[Fleet] Add error message/status when dragging/dropping non-svg into custom integration (#226294)\n\n## Summary\n\nCloses #225795 \n\n- Added error message/status when dragging and dropping in a non-SVG\nfile. Browsing already handled the case so no change needed.\n\n\nhttps://github.com/user-attachments/assets/9bf362fe-f10e-4bf5-a5ec-4e46bd71bd01\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [ ] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n### Identify risks\n\nN/A\n\n---------\n\nCo-authored-by: Elastic Machine <[email protected]>","sha":"24a5217de9e5db86694ae344d5ada971d36bd96c","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:prev-minor","v9.1.0","v9.2.0"],"title":"[Fleet] Add error message/status when dragging/dropping non-svg into custom integration","number":226294,"url":"https://github.com/elastic/kibana/pull/226294","mergeCommit":{"message":"[Fleet] Add error message/status when dragging/dropping non-svg into custom integration (#226294)\n\n## Summary\n\nCloses #225795 \n\n- Added error message/status when dragging and dropping in a non-SVG\nfile. Browsing already handled the case so no change needed.\n\n\nhttps://github.com/user-attachments/assets/9bf362fe-f10e-4bf5-a5ec-4e46bd71bd01\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [ ] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n### Identify risks\n\nN/A\n\n---------\n\nCo-authored-by: Elastic Machine <[email protected]>","sha":"24a5217de9e5db86694ae344d5ada971d36bd96c"}},"sourceBranch":"main","suggestedTargetBranches":["9.1"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226294","number":226294,"mergeCommit":{"message":"[Fleet] Add error message/status when dragging/dropping non-svg into custom integration (#226294)\n\n## Summary\n\nCloses #225795 \n\n- Added error message/status when dragging and dropping in a non-SVG\nfile. Browsing already handled the case so no change needed.\n\n\nhttps://github.com/user-attachments/assets/9bf362fe-f10e-4bf5-a5ec-4e46bd71bd01\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [ ] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n### Identify risks\n\nN/A\n\n---------\n\nCo-authored-by: Elastic Machine <[email protected]>","sha":"24a5217de9e5db86694ae344d5ada971d36bd96c"}}]}] BACKPORT--> Co-authored-by: Mason Herron <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
1 parent fe16f8e commit e994f66

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/integration_step.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ export const IntegrationStep = React.memo<IntegrationStepProps>(({ integrationSe
7777
setLogoError(`${logoFile.name} is too large, maximum size is 1Mb.`);
7878
return;
7979
}
80+
// make sure the logo is a svg type in the case of drag and drop
81+
if (!logoFile.name.endsWith('.svg') || !logoFile.type.startsWith('image/svg+xml')) {
82+
setLogoError(i18n.NON_SVG_ERROR);
83+
return;
84+
}
8085
logoFile
8186
.arrayBuffer()
8287
.then((fileBuffer) => {

x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/translations.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,10 @@ export const PREVIEW_TOOLTIP = i18n.translate(
5151
export const LOGO_ERROR = i18n.translate('xpack.automaticImport.step.integration.logo.error', {
5252
defaultMessage: 'Error processing logo file',
5353
});
54+
55+
export const NON_SVG_ERROR = i18n.translate(
56+
'xpack.automaticImport.step.integration.logo.nonSvgError',
57+
{
58+
defaultMessage: 'Only SVG files are allowed',
59+
}
60+
);

0 commit comments

Comments
 (0)