Skip to content

Comments

Blogging Prompts: Add prompt metadata to prompt posts#18808

Merged
wargcm merged 11 commits intotrunkfrom
feature/18429-post_metadata
Jun 10, 2022
Merged

Blogging Prompts: Add prompt metadata to prompt posts#18808
wargcm merged 11 commits intotrunkfrom
feature/18429-post_metadata

Conversation

@wargcm
Copy link
Contributor

@wargcm wargcm commented Jun 1, 2022

See: #18429
WPKit PR: wordpress-mobile/WordPressKit-iOS#515

Description

Adds prompt metadata to posts when answering a prompt in order to track if it has been answered.

Testing

Note: There's an existing caching issue where the prompt data will not update after answering the prompt. A temporary change is needed in BloggingPromptsService.swift:

// BloggingPromptsService.swift

    func todaysPrompt(success: @escaping (BloggingPrompt?) -> Void,
                      failure: @escaping (Error?) -> Void) {
//        guard localTodaysPrompt == nil else {
//            success(localTodaysPrompt)
//            return
//        }

        fetchTodaysPrompt(success: success, failure: failure)
    }

To test:

  • Enable bloggingPrompts feature flag in FeatureFlag.swift
  • Launch the app and sign in if necessary
  • Select a public site
  • Navigate to the 'My Site' tab
  • Tap on 'Answer Prompt'
  • In the editor, publish the post publicly
  • After the post is uploaded, trigger the todaysPrompt (switch to another blog and then back, this should call the configure method on the dashboard card which calls todaysPrompt)
  • Verify the prompt is marked as 'Answered' and the answer count is updated

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.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jun 1, 2022

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 pr18808-6f817e2 on your iPhone

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

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jun 1, 2022

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 pr18808-6f817e2 on your iPhone

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

@alpavanoglu
Copy link
Contributor

Hey, following the testing steps, I wasn't able to trigger todaysPrompt. Also even though I've answered the prompt the counter for it does not seem to increment.
Is there a specific way to make the todaysPrompt appear?

@wargcm
Copy link
Contributor Author

wargcm commented Jun 8, 2022

@alpavanoglu I thought that navigating back would trigger it but I was mistaken. I realize now those steps are incorrect after working on the prompt caching issue.

One way that should trigger the fetchPrompts call is switching blogs. I'll update the test instructions. Sorry about that!

@peril-wordpress-mobile
Copy link

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS

@wargcm wargcm merged commit 70522fd into trunk Jun 10, 2022
@wargcm wargcm deleted the feature/18429-post_metadata branch June 10, 2022 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants