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

Flow for adding in images in the gallery without going through the media library #5166

Merged

Conversation

jorgefilipecosta
Copy link
Member

@jorgefilipecosta jorgefilipecosta commented Feb 20, 2018

Closes: #1704

This PR implements a button that appears when the gallery is selected and allows the user to upload new images without going through the media library.

How Has This Been Tested?

Add a gallery block add some images. Select the block to see a plus button is present in the position a new image will appear if it is added.
Try to use the button to upload one or more images.
Unselect the block and see the button disappears.

Screenshots (jpeg or gifs if applicable):

screen shot 2018-02-20 at 17 39 36

screen shot 2018-02-20 at 17 39 45

screen shot 2018-02-20 at 17 39 52

@jorgefilipecosta jorgefilipecosta added [Type] Enhancement A suggestion for improvement. [Feature] Blocks Overall functionality of blocks labels Feb 20, 2018
@jorgefilipecosta jorgefilipecosta self-assigned this Feb 20, 2018
@jorgefilipecosta jorgefilipecosta force-pushed the add/flow-adding-new-items-gallery-no-media-library branch from d7e01fe to 3352339 Compare February 20, 2018 17:49
@jorgefilipecosta jorgefilipecosta added the Needs Design Feedback Needs general design feedback. label Feb 20, 2018
@jasmussen
Copy link
Contributor

This is totally totally lovely and works perfectly. Superb work!

Can you add the following CSS to the gray button that gets added?

    border: none;
    border-radius: 0;

Adding that will remove the transparent border, and make it look like a square image placeholder instead of a button. With that in, 👍 👍 👌

@jorgefilipecosta jorgefilipecosta force-pushed the add/flow-adding-new-items-gallery-no-media-library branch from 3352339 to 533599d Compare February 21, 2018 11:54
@jorgefilipecosta
Copy link
Member Author

Thank you @jasmussen for providing the CSS for the improvement and for the feedback, it was applied. I kept a border when the button is focused/with mouse over, to make it look clickable. If you think this border should also be removed, please let me know and I will remove it :)

@jasmussen
Copy link
Contributor

Awesome, I think that looks great. The reason for removing the border is that the button has a 1px transparent border, so that it doesn't "jump around" when a visible border is applied. But this is a non-issue with the way you use the button, so this looks good to go to me!

@jorgefilipecosta jorgefilipecosta requested a review from a team February 21, 2018 12:28
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

👍 nice

{ isSelected &&
<li className="blocks-gallery-item">
<FormFileUpload
multiple={ true }
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: you could drop the ={ true }

.button.blocks-gallery-add-item-button {
box-shadow: none;
border: none;
border-radius: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

indentation issue

@StaggerLeee
Copy link

Let it inherit color of admin theme ? To be different than Inserter button.

@jasmussen
Copy link
Contributor

Let it inherit color of admin theme ? To be different than Inserter button.

That could be nice, a big splash of color.

@jorgefilipecosta jorgefilipecosta force-pushed the add/flow-adding-new-items-gallery-no-media-library branch from 533599d to b1e5a00 Compare February 23, 2018 15:16
@jorgefilipecosta jorgefilipecosta force-pushed the add/flow-adding-new-items-gallery-no-media-library branch from b1e5a00 to 9c6cce7 Compare February 23, 2018 16:10
@jorgefilipecosta jorgefilipecosta merged commit aa1df37 into master Feb 23, 2018
@jorgefilipecosta jorgefilipecosta deleted the add/flow-adding-new-items-gallery-no-media-library branch February 23, 2018 17:50
@jorgefilipecosta
Copy link
Member Author

Thank you for your suggestion @StaggerLeee 👍 . I also think it may be a good idea to explore the use of admin colors. Maybe there are also other similar cases where admin colors could be used it is for sure something to check.

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 Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants