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

Media: Update media over storage limit error #4333

Merged
merged 1 commit into from
Mar 31, 2016

Conversation

gwwar
Copy link
Contributor

@gwwar gwwar commented Mar 25, 2016

This PR fixes #3898 and provides a more descriptive error message when you upload a media item and are out of space. Click on the notice action "Upgrade Plan" should take you to the plans page.

Desktop
screen shot 2016-03-29 at 9 14 43 am

Mobile: ( Note that our notices don't handle text + action + dismiss buttons nicely )
screen shot 2016-03-29 at 9 15 12 am

(And here when it breaks to the next line )
screen shot 2016-03-29 at 9 15 20 am

Testing

  • In the console call: localStorage.setItem('debug', 'calypso:analytics');
  • Navigate to http://calypso.localhost:3000/post
  • Select a wpcom site with a Free or Premium plan when prompted
  • Add items until you run out of space. (You also have permission to use gwwartest3.wordpress.com if you're lazy )
  • You should see the error notice.
  • A message like the following appears in the console:
    screen shot 2016-03-25 at 3 43 15 pm
  • Click on "Upgrade Plan"
  • A message like the following appears in the console:
    screen shot 2016-03-25 at 3 43 21 pm
  • The page should navigate to the plans page for your site.

cc @rralian @mtias @artpi @adambbecker @retrofox @aduth @apeatling

@gwwar gwwar self-assigned this Mar 25, 2016
@gwwar gwwar added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Feature] Media The media screen in Calypso, general media management, or integration with third party media. labels Mar 25, 2016
@gwwar gwwar added this to the Stark Iteration 0 milestone Mar 25, 2016
@gwwar gwwar force-pushed the update/media-over-limit-error branch from 3b0a0e1 to d932a45 Compare March 25, 2016 23:15
return null;
}
return (
<NoticeAction href="#" onClick={ this.navigateToPlans } onMount={ this.countStorageErrorImpression } >
Copy link
Contributor

Choose a reason for hiding this comment

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

Aside: Kinda wish we would render a <button /> from <NoticeAction /> if we didn't want to specify a href.

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 agree, we can improve usage here with the NoticeAction. Forcing an href for non-external links also requires us to prevent the default action.

@aduth
Copy link
Contributor

aduth commented Mar 28, 2016

Seems that analytics related to notice display and action are common enough that, perhaps in a separate pull request, we offer enhanced notice components with this functionality baked in. Thoughts?

analytics.tracks.recordEvent( 'calypso_upgrade_nudge_cta_click', {
cta_name: 'plan-media-storage-error'
} );
page( `/plans/${ this.props.siteSlug }` );
Copy link
Contributor

Choose a reason for hiding this comment

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

Assuming the role of my inner @apeatling ( 😄 ), do we worry that by not opening the page in a new tab, there's a feeling of uncertainty by being navigated away from the editor when clicking the call-to-action?

@aduth
Copy link
Contributor

aduth commented Mar 28, 2016

Behavior works as expected. 👍

One thing I noticed in testing - when deleting media from the media library, we don't update the storage progress bar display in the media modal. I might imagine it could be a common flow for users to "purge" unneeded media and expect to see the freed storage reflected in the progress bar.

@aduth aduth added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 28, 2016
@gwwar gwwar force-pushed the update/media-over-limit-error branch from d932a45 to fe30146 Compare March 28, 2016 17:46
@@ -23,6 +24,12 @@ export default React.createClass( {
};
},

componentDidMount() {
if ( this.props.onMount ) {
this.props.onMount();
Copy link
Member

Choose a reason for hiding this comment

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

Is there any other way we can handle this? Seems like a potential avenue for problematic usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was thinking of a more generic metrics component wrapper if we do want to track when certain components are rendered. Edit: see #4398

@gwwar
Copy link
Contributor Author

gwwar commented Mar 29, 2016

Outstanding future improvements for future PRs

I'll wait until #4398 lands before this is set back to needs review.

@gwwar gwwar force-pushed the update/media-over-limit-error branch from 844fd03 to 8010515 Compare March 30, 2016 17:53
@gwwar gwwar added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Mar 30, 2016
@aduth
Copy link
Contributor

aduth commented Mar 31, 2016

Looks good 👍

@aduth aduth added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 31, 2016
@gwwar
Copy link
Contributor Author

gwwar commented Mar 31, 2016

Thanks for the reviews! I'm going to squash.

@gwwar gwwar force-pushed the update/media-over-limit-error branch from 438dd75 to acc4599 Compare March 31, 2016 15:40
@gwwar gwwar merged commit 738ba58 into master Mar 31, 2016
@gwwar gwwar deleted the update/media-over-limit-error branch March 31, 2016 15:45
@apeatling
Copy link
Member

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media The media screen in Calypso, general media management, or integration with third party media.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Media: provide better error message for over-limit upload error
5 participants