-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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] FileUploader: processing of files before upload via interface #1623
Closed
nzamani
wants to merge
1
commit into
SAP:master
from
nzamani:feature-fileuploader-modify-blobs-before-upload-interface
Closed
[FEATURE] FileUploader: processing of files before upload via interface #1623
nzamani
wants to merge
1
commit into
SAP:master
from
nzamani:feature-fileuploader-modify-blobs-before-upload-interface
Conversation
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
When this pull request gets merged I will
|
nzamani
force-pushed
the
feature-fileuploader-modify-blobs-before-upload-interface
branch
from
August 2, 2017 08:16
c9353e9
to
e553dff
Compare
nzamani
added a commit
to nzamani/ui5-nabi-m
that referenced
this pull request
Aug 2, 2017
This will work if the following pull request get merged: SAP/openui5#1623 Currently, the overridden upload() uses private APIs. Once the pull request gets merged, the overridden upload() can be removed For details see code.
nzamani
added a commit
to nzamani/ui5-nabi-m
that referenced
this pull request
Aug 2, 2017
This will work if the following pull request get merged: SAP/openui5#1623 Currently, the overridden upload() uses private APIs. Once the pull request gets merged, the overridden upload() can be removed For details see code.
nzamani
force-pushed
the
feature-fileuploader-modify-blobs-before-upload-interface
branch
from
August 6, 2017 09:51
e553dff
to
89b0008
Compare
nzamani
force-pushed
the
feature-fileuploader-modify-blobs-before-upload-interface
branch
2 times, most recently
from
August 17, 2017 07:27
555c1d6
to
725ac2c
Compare
Hi @nzamani, Thank you for your pull request. We created an internal record 1770315265 to check the suggested changes. Regards, |
myordanov
approved these changes
Sep 4, 2017
…nterface This change introduces the new interface sap.ui.unified.IProcessableBlobs and changes the sap.ui.unified.FileUploader control to use this interface when upload() is called. It makes it save to implement custom controls that extend sap.ui.unified.FileUploader an which mobify the Files before they get uploaded. This comes in handy in use cases such as creating zip file for the upload. Internally Promises are used.
nzamani
force-pushed
the
feature-fileuploader-modify-blobs-before-upload-interface
branch
from
September 15, 2017 07:54
725ac2c
to
bdee22f
Compare
Hi Colleagues, Regards, Mihail. |
nzamani
added a commit
to nzamani/ui5-nabi-m
that referenced
this pull request
Sep 21, 2017
…y fallback Pull Request SAP/openui5#1623 is merged. This means we can now use the introduced interface ap.ui.unified.IProcessableBlobs in order to be "API safe".
matz3
referenced
this pull request
Sep 22, 2017
…ad using interface This change introduces the new interface sap.ui.unified.IProcessableBlobs and changes the sap.ui.unified.FileUploader control to use this interface when upload() is called. It makes it safe to implement custom controls that extend sap.ui.unified.FileUploader and which modify the Files before they get uploaded. This comes in handy in use cases such as creating zip file for the upload. Internally Promises are used. Change-Id: I5ff85b6da716d400826ee1f1f544f05d0e821706
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The sap.ui.unified.FileUploader is an amazing control. However, making reuse of the existing code in custom controls can sometimes only be implemented using private APIs of sap.ui.unified.FileUploader which is always a bad practice.
This change introduces the new interface sap.ui.unified.IUploadableBlobs and changes the sap.ui.unified.FileUploader control to use this interface when upload() is called. It makes it save to implement custom controls that extend sap.ui.unified.FileUploader in order to modify the files before they get uploaded. This comes in handy in many use cases such, i.e. creating zip files for the upload.
This changes introduces minimal changes to the upload() APIs by using Promises internally. Here, the interface API sap.ui.unified.IUploadableBlobs.getProcessedBlobsFromArray is used - a simple way to allow sub-controls to re-use the functionality in an "upgrade-save" way. The default implementation of the interface API does nothing but resolving the promise with the files received from the sap.ui.unified.FileUploader without changing them. This default implementation makes sure that the current behaviour is not changed.