Skip to content

Fix empty stats in post detail#11559

Merged
develric merged 5 commits intodevelopfrom
issue/11546-fix-empty-stats-in-post-detail
Mar 31, 2020
Merged

Fix empty stats in post detail#11559
develric merged 5 commits intodevelopfrom
issue/11546-fix-empty-stats-in-post-detail

Conversation

@planarvoid
Copy link
Copy Markdown
Contributor

Fixes #11546

We haven't been properly checking whether the model is empty. What we were receiving from the backend is a list of items (years, months) with value 0 instead of an empty list. This PR introduces a check to properly see if models are empty.

To test:

  • Go to a site with a post without any views
  • Go to Blog Posts
  • Click on the overflow menu/Stats on the Post without views
  • Notice that the blocks now show the message "No data yet" instead of previously visible lines with empty data

Screenshot_1585559959

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.

@planarvoid planarvoid added this to the 14.6 milestone Mar 30, 2020
@planarvoid planarvoid requested a review from develric March 30, 2020 09:19
@planarvoid planarvoid self-assigned this Mar 30, 2020
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Mar 30, 2020

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

Copy link
Copy Markdown
Contributor

@develric develric left a comment

Choose a reason for hiding this comment

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

Hi @planarvoid , tested with Pixel 3 Emu API 29; code looks good and works as described 👍 ! :shipit:

@develric develric merged commit ee55bc2 into develop Mar 31, 2020
@develric develric deleted the issue/11546-fix-empty-stats-in-post-detail branch March 31, 2020 20:49
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.

[GlobalStep] Android - Stats of Blog Posts with zero views display superfluous year lists.

3 participants