-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEATURE: Make accepted filetypes configurable #1900
Conversation
return this.props.imagesOnly ? 'Image' : 'Asset'; | ||
} | ||
|
||
acceptedFileTypes = () => { | ||
if (this.props.imagesOnly) { | ||
return ['.jpg', '.jpeg', '.png'].reduce((fileTypeString, fileType) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure which image formats I should allow here. Do we have a definition somewhere?
We could/should make it configurable later on I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, seeing SVG more and more. Absolutely needs to be configurable. What about jp2, webm, …?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question.
I work on a configurable solution soon.
@@ -64,6 +65,7 @@ export default class PreviewScreen extends PureComponent { | |||
highlight={highlight} | |||
ref={this.setAssetUploadReference} | |||
imagesOnly={true} | |||
accept={accept === undefined ? 'image/*' : accept} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could as well be accept || 'image/*'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a small comment, feel free to ignore and merge as is.
DOCS: Add accept option to Asset- and Image-Editor Documenting the new accept-option. See: neos/neos-ui#1900
DOCS: Add accept option to Asset- and Image-Editor Documenting the new accept-option. See: neos/neos-ui#1900
This makes accepted filetypes configurable via the mime type.
If nothing is set for an image editor
image/*
is used.You can add accepted filetypes to the editoroptions e.g:
closes #1879