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

Hide audio tab when the user has no audio #11841

Merged
merged 2 commits into from
May 11, 2020

Conversation

planarvoid
Copy link
Contributor

Fixes #11361

This PR hides the audio tab in the Media activity when the user has no audio. The activity now listens to the event and refreshes the tab layout style if there is a change to the number of audio files.

To test:

  • Go to a site without Audio media
  • Go to the My Site/Media
  • Check that the "Audio" tab is not visible
  • Go to Calypso and add an audio file to the site media library
  • Pull to refresh in the app
  • The "Audio" appears
  • Click on the "Audio" tab
  • The audio file is visible on the screen
  • Remote the audio file in Calypso
  • Pull to refresh in the app
  • The "Audio" tab disappears and the "All" tab is automatically selected

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented May 7, 2020

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented May 7, 2020

You can test the changes on this Pull Request by downloading the APK here.

@ashiagr
Copy link
Contributor

ashiagr commented May 8, 2020

Works as described 👍.

Just that "Upload Media" is visible again in the Audio tab if we delete audio file from the app and return to the media screen. Not sure if we want to select "All" tab in this scenario.

audio-tab

@planarvoid
Copy link
Contributor Author

thanks for the check @ashiagr !

I've implemented the fix in 882f665

Copy link
Contributor

@ashiagr ashiagr left a comment

Choose a reason for hiding this comment

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

LGTM, 🚢.

@ashiagr ashiagr merged commit 2c1c667 into develop May 11, 2020
@ashiagr ashiagr deleted the fix/hide-audio-tab-when-empty branch May 11, 2020 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the "Audio" tab in the media library if user has no uploaded audio files
2 participants