-
Notifications
You must be signed in to change notification settings - Fork 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
Media section/add link #11672
Media section/add link #11672
Conversation
I was excited to see this and works great with Chrome, but it doesn't seem to work for me with Firefox and IE. |
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.
Good catch @iamtakashi. It also looks like the
button doesn't work in the section and modal for FF either.
@@ -86,6 +87,7 @@ const PublishMenu = React.createClass( { | |||
queryable: true, | |||
config: 'manage/media', | |||
link: '/media', | |||
buttonLink: '/media/' + site.slug, |
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.
Let's guard here, since site might not be available yet.
buttonLink: site ? `/media/${ site.slug }` : `/media`;
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.
Ah, and it looks like testing http://calypso.localhost:3000/media/:siteId: with a clean cache comes up with a number of errors:
To clean out the cache on chrome or ff:
localStorage.clear(); indexedDB.deleteDatabase( 'calypso' );
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.
buttonLink: `/media/${ site.slug || '' }`;
?
@@ -73,6 +81,7 @@ module.exports = React.createClass( { | |||
accept={ this.getInputAccept() } | |||
multiple | |||
onChange={ this.uploadFiles } | |||
onClick={ this.onClick } |
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 should rename this method according to what the method does. One line above there is a nice example. When the onChange
event happens, then uploadFiles
.
event
=> action to take
.
Could it be something like openMediaModal
?
Just tested in FF, everything works as expected. LGTM |
className="media-library__upload-button-input" /> | ||
</form> | ||
</Button> | ||
<form ref="form" className={ classes }> |
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.
Interesting, I take it that the form wasn't fully filling the button area. In prod, if you happen to browser zoom in on IE, then click the bottom right you'll see that nothing happens, but if you click on top left it triggers normally.
If we run into this again later, we can just make the font size absurdly huge on the hidden input.
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.
Verified that upload works on Chrome, FF, Safari and IE11/Edge. Also verified that no errors are thrown on a clean cache. Unless you had any other comments @iamtakashi I think this is good to 🚢
👍 Good to go!! This is so cool to see working. |
1709c81
to
50d910f
Compare
7791f0f
to
a343b88
Compare
* Add proper button for upload * Make it look like other buttons * Make upload button work in FF * Add protection for when site is not ready yet * Small cleanup * Fixing css
* Add proper button for upload * Make it look like other buttons * Make upload button work in FF * Add protection for when site is not ready yet * Small cleanup * Fixing css
* Add proper button for upload * Make it look like other buttons * Make upload button work in FF * Add protection for when site is not ready yet * Small cleanup * Fixing css
* Add proper button for upload * Make it look like other buttons * Make upload button work in FF * Add protection for when site is not ready yet * Small cleanup * Fixing css
* Add proper button for upload * Make it look like other buttons * Make upload button work in FF * Add protection for when site is not ready yet * Small cleanup * Fixing css
Resolves #9135 , adds "Add" button next to media section in sidbar
CC @iamtakashi @gwwar @lamosty