Skip to content
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

Image Block: Adding an image upload button #2260

Merged
merged 3 commits into from
Aug 8, 2017

Conversation

youknowriad
Copy link
Contributor

to upload an image without opening the media modal.

closes #1702

@youknowriad youknowriad added [Feature] Blocks Overall functionality of blocks [Feature] Media Anything that impacts the experience of managing media labels Aug 7, 2017
@youknowriad youknowriad self-assigned this Aug 7, 2017
@@ -0,0 +1,51 @@
/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we call this FileUpload? I don't think I would have found it easily with this name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to group all the "form" related components by calling them Form* but I don't mind changing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FormFileUpload maybe

@codecov
Copy link

codecov bot commented Aug 7, 2017

Codecov Report

Merging #2260 into master will decrease coverage by 0.2%.
The diff coverage is 27.77%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2260      +/-   ##
=========================================
- Coverage   24.21%     24%   -0.21%     
=========================================
  Files         142     145       +3     
  Lines        4465    4541      +76     
  Branches      758     768      +10     
=========================================
+ Hits         1081    1090       +9     
- Misses       2857    2916      +59     
- Partials      527     535       +8
Impacted Files Coverage Δ
blocks/library/image/index.js 14.7% <0%> (-0.92%) ⬇️
components/form-file-upload/index.js 71.42% <71.42%> (ø)
blocks/library/categories/index.js 3.22% <0%> (ø)
blocks/library/categories/data.js 0% <0%> (ø)
blocks/library/button/index.js 35.29% <0%> (+8.62%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6f3a08...6cc9c45. Read the comment docs.

@mtias
Copy link
Member

mtias commented Aug 7, 2017

Works great for me!

@mtias
Copy link
Member

mtias commented Aug 7, 2017

@jasmussen the upload button has a hover effect that the "insert from media library" does not. Not sure what the status should be.

@jasmussen
Copy link
Contributor

the upload button has a hover effect that the "insert from media library" does not. Not sure what the status should be.

The blue hover effect is caused by the button having a components-icon-button CSS class. We can either address the CSS or remove the class. What makes the most sense?

@youknowriad
Copy link
Contributor Author

Fixed the hover color, kept the class because it's automatically included in the IconButton component.

@mkaz
Copy link
Member

mkaz commented Aug 7, 2017

Looks good, it works for me.

I want to use the same method for the Gallery block and uploading of multiple images. Looking at the code, it looks like you have support for multiple in the form-file-upload button, however the function that processes the uploads is in the image block, could we break that out to be independent, so any block can use it.

👍 to commit and I can abstract it out for you if you like

@youknowriad
Copy link
Contributor Author

@mkaz yeah, we'd probably want to extract this function somewhere. Let's merge this and will let you abstract while working on the gallery.

Thanks everyone for the reviews. Merging

@youknowriad youknowriad merged commit c6ac654 into master Aug 8, 2017
@youknowriad youknowriad deleted the add/image-upload-button branch August 8, 2017 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Media Anything that impacts the experience of managing media
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "upload" button to image block placeholder
4 participants