-
Notifications
You must be signed in to change notification settings - Fork 79
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
NEW Move the replace file into the more options action set #848
Conversation
@@ -70,6 +70,15 @@ class AssetDropzone extends Component { | |||
} | |||
} | |||
|
|||
componentDidUpdate() { | |||
// Reattach name to hiddenFileInput as dropzone recreates this element after each upload | |||
const name = this.props.name; |
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.
We'd prefer this to be destructured: const { name } = this.props;
const hiddenFileInput = document.querySelector('.dz-input-PreviewImage'); | ||
|
||
// Trigger a click on Dropzone's hidden file input in order to upload an image | ||
hiddenFileInput.click(); |
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.
It's probably worth checking that hiddenFileInput
is resolved before calling click on it
code/Forms/FileFormFactory.php
Outdated
*/ | ||
protected function getReplaceFileAction($record) | ||
{ | ||
$action = FormAction::create('replacefile', 'Replace file') |
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.
Can you please make the field title translatable?
Also looks the tests need some love =) |
Would be good to get this into the |
84af47b
to
7a06d1d
Compare
Sounds good @unclecheese, I'll get on to looking at the tests 🙂 |
01a63f4
to
6423656
Compare
6423656
to
f2b9ac0
Compare
Looking good. I'm going to add a behat test for it. |
Resolves #757