-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Easy image upload refactoring #1079
Conversation
…base64 encoded images.
…omatically use the one from the config.
…anually better than default FileLoader type).
Now it can be configured using widgetDefinition.uploadUrl (on uploadeasyimage widget). So one can use simply `widgetDefinition` event on editor to customize the upload URL if there's a need to.
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.
Tests on Firefox are constantly failing on my computer – unfortunately they're seem to be broken, not just unstable.
@@ -438,6 +430,30 @@ | |||
} ); | |||
|
|||
wait(); | |||
}, | |||
|
|||
'test cloudservices URL can be customized': function( editor ) { |
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.
Not only URL can be customised, but also loader type and additional request parameters. It'd be nice to have also tests for these.
For reasons unknown to me firefox fires Without getting into details I have changed listener type to This test suite relies on Also I have added requested test cases. |
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.
LGTM
What is the purpose of this pull request?
Other, refactoring of other PR.
Does your PR contain necessary tests?
All patches which change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.
This PR contains
What changes did you make?
This PR adds some fixes to #1052, the general idea was to simplify it and extract cloud-service (backend) stuff to a separate plugin.
There were already quite a few changes, many of which has been already fixed in #1062 and #1066.
Summary for this PR:
uploadUrl
is now optional, as the plugin uses CloudService loader which automatically picks up URL from the config.loadMethod
is now changed to upload. Since you proposed a more modern approach with object URL - I think it's fine, however we need a followup ticket to keep track of data allocated with it. See TP#3131.fileUploadResponse
,fileUploadRequest
as they're no longer needed (fixed in Cloud Services file loader #1062, Allow to use custom fileLoader in uploadRepository.create and upload widget #1066).uploadeasyimage
widget uses widget definition at a time of paste event to avoid Upload widget paste listener ignores changes in the uploadWidgetDefinition #1068. Though still I'm not happy that it's a copy pasta of a listener fromimageupload
plugin, we need to combine it. See TP#3132.easyimageUploadUrl
,easyimage_token
have been renamed tocloudServices_url
,cloudServices_token
respectively.responseData
structure in unit tests.There's one issue that latest FF is extremely unstable, that's something that we need to investigate in a followup ticket.
Once this is merged, I'll just give a final check to #1052 and that will be it in terms of uploading.