Skip to content

Prompts List: don't show table behind empty views - #18662

Merged
ScoutHarris merged 1 commit into
trunkfrom
feature/18515-fix_loading_view
May 19, 2022
Merged

Prompts List: don't show table behind empty views#18662
ScoutHarris merged 1 commit into
trunkfrom
feature/18515-fix_loading_view

Conversation

@ScoutHarris

@ScoutHarris ScoutHarris commented May 19, 2022

Copy link
Copy Markdown
Contributor

Ref: #18515
Depends on: #18658

This fixes an issue where the table could be seen behind the loading, error, and no results views.

To test:

  • Start with a fresh install to purge any cached prompts.
  • Enable bloggingPrompts feature flag.
  • Go to the prompts list.
  • Verify the loading view is displayed correctly.
  • Following the hacks below for each view, verify the error and no results views are displayed correctly.

Hacks:

  • To show error view: in BloggingPromptsViewController:fetchPrompts, showErrorView() instead of setting prompts in the success block:
bloggingPromptsService.listPrompts(success: { [weak self] (prompts) in
    self?.isLoading = false
    self?.showErrorView()
    // self?.prompts = prompts.sorted(by: { $0.date.compare($1.date) == .orderedDescending })
}, 
...
  • To show no results view: in BloggingPromptsViewController:showNoResultsViewIfNeeded, comment out everything except showNoResultsView():
    func showNoResultsViewIfNeeded() {
//        guard !isLoading else {
//            showLoadingView()
//            return
//        }
//
//        guard prompts.isEmpty else {
//            hideNoResults()
//            return
//        }

        showNoResultsView()
    }

Before After
loading_before loading_after
error_before error_after
empty_before empty_after

Regression Notes

  1. Potential unintended areas of impact
    N/A

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    N/A

  3. What automated tests I added (or what prevented me from doing so)
    N/A

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • 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.

@ScoutHarris ScoutHarris added this to the 20.0 milestone May 19, 2022
@ScoutHarris ScoutHarris self-assigned this May 19, 2022
@ScoutHarris
ScoutHarris requested review from dvdchr and wargcm May 19, 2022 01:24
@ScoutHarris
ScoutHarris marked this pull request as ready for review May 19, 2022 01:24
@wpmobilebot

Copy link
Copy Markdown
Contributor
You can test the changes in Jetpack from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr18662-6ca5379 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@wpmobilebot

Copy link
Copy Markdown
Contributor
You can test the changes in WordPress from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr18662-6ca5379 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@wargcm wargcm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM :shipit:

Base automatically changed from feature/18429-use_cached_prompts to trunk May 19, 2022 21:30
@ScoutHarris
ScoutHarris merged commit 5477e92 into trunk May 19, 2022
@ScoutHarris
ScoutHarris deleted the feature/18515-fix_loading_view branch May 19, 2022 23:06
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.

3 participants