mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 11:05:39 -04:00
## Summary Added the `meta` prop to the `FilePicker` component, also pass this down to the `FileUpload` component so that files created via the picker can have meta set. Close https://github.com/elastic/kibana/issues/151375 ## How to test 1. Start Kibana with examples `yarn start --run-examples` 2. Go to the "Developer examples" in the side-nav menu under analytics 3. Go to "Files example" 4. Upload a file via the "Select file" button, should present an empty file picker if you have no files, otherwise use the little upload component bottom left 5. Either select files or dismiss the modal 6. Inspect the uploaded file and see the `myCool: 'meta'` entry included with other metadata ## Screenshot A file uploaded via the `FilePicker` in the "Files example" plugin. <img width="897" alt="Screenshot 2023-02-16 at 11 41 06" src="https://user-images.githubusercontent.com/8155004/219342872-c39b5d81-7421-4187-bb1c-d6815d80a3dc.png"> ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios |
||
---|---|---|
.. | ||
src | ||
index.tsx | ||
jest.config.js | ||
kibana.jsonc | ||
package.json | ||
README.mdx | ||
tsconfig.json |
--- id: sharedUX/Components/FilePicker slug: /shared-ux/components/file-picker title: File picker description: Pick or upload files from Kibana. tags: ['shared-ux', 'component', 'files'] date: 2022-11-22 --- ## Description A component designed to capture the UX of picking files. Use cases include: * A dashboard user wanting to upload an image to their dashboard * A user picking a new avatar * A cases user selecting from a set of text files they want to attach to a case * ...and many more ## Usage Must be wrapped in the `FilesContext`. ```tsx <FilesContext ...> <FilePicker ... /> </FilesContext> ```