forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Files] Use upload component in files example (elastic#141362)
* added modal and removed hardcoded image upload * remove unused var * added shared imports file and hooked up modal component to example app * use the Image component from files and update the title for the files modal * set and show custom metadata * fix content type not being passed through to upload or to picker component * remove old commented out code
- Loading branch information
1 parent
2b4fc2e
commit 50df463
Showing
13 changed files
with
130 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { FunctionComponent } from 'react'; | ||
import React from 'react'; | ||
import { EuiModal, EuiModalHeader, EuiModalBody, EuiText } from '@elastic/eui'; | ||
import { exampleFileKind } from '../../common'; | ||
import { FilesClient, UploadFile } from '../imports'; | ||
|
||
interface Props { | ||
client: FilesClient; | ||
onDismiss: () => void; | ||
onUploaded: () => void; | ||
} | ||
|
||
export const Modal: FunctionComponent<Props> = ({ onDismiss, onUploaded, client }) => { | ||
return ( | ||
<EuiModal onClose={onDismiss}> | ||
<EuiModalHeader> | ||
<EuiText> | ||
<h2>Upload image</h2> | ||
</EuiText> | ||
</EuiModalHeader> | ||
<EuiModalBody> | ||
<UploadFile | ||
kind={exampleFileKind.id} | ||
client={client} | ||
onDone={onUploaded} | ||
meta={{ custom: 'meta' }} | ||
/> | ||
</EuiModalBody> | ||
</EuiModal> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export { | ||
FilesClient, | ||
FilesSetup, | ||
FilesStart, | ||
UploadFile, | ||
FilesContext, | ||
ScopedFilesClient, | ||
Image, | ||
} from '@kbn/files-plugin/public'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters