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

Implement navigation and tracking for Campaigns dashboard card #18783

Merged
merged 35 commits into from
Jul 19, 2023

Conversation

AjeshRPai
Copy link
Contributor

@AjeshRPai AjeshRPai commented Jul 17, 2023

Part of
#18521
#18525

Description

This PR implements the tracking and click logic in the Campaigns Card

This PR implements the following click events and the tracking associated with it in Campaigns card

  • Navigating to Campaign listing page on card click
  • Navigate to Blaze Flow Creation on Create Campaign Click
  • Navigate to Campaign Details on Campaigns item click

Also Implements the Site Menu Navigation

  • Navigate to Campaign listing page when blaze_campaigns is enabled
  • Navigate to Blaze Creation flow when blaze_campaigns is disabled

Also note that I have added the Skeleton classes for Campaign listing page and Detail page in this PR. There is no need to test these classes as of now since the logic will change in these classes

To test

Hide is working as expected, and my site refresh indicator is shown

  • Go to the Jetpack app with the account not having campaigns
  • Go to dashboard
  • Hide promo card
  • Verify that my site is refreshed and the card is hidden

Tracking is working as expected when the promo card shown

  • Go to the Jetpack app with the account not having campaigns
  • Go to dashboard
  • Verify promo card is not shown
  • 🔵 Tracked: my_site_dashboard_card_shown, Properties: {"type":"promote_with_blaze","subtype":"no_campaigns"}

Tracking is working as expected when the campaigns card shown

  • Go to the Jetpack app with an account having campaigns
  • Go to dashboard
  • 🔵 Tracked: my_site_dashboard_card_shown, Properties: {"type":"promote_with_blaze","subtype":"campaigns"}

Click on the Menu item - Blaze campaign enabled

  • Go to the Jetpack app with an account having campaigns
  • Go to dashboard
  • Click on Menu item - Blaze
  • Verify that the user is navigated to the Campaigns listing page
  • Verify that the tracking event is fired
  • 🔵 Tracked: blaze_entry_point_tapped, Properties: {"source":"menu_item"}
  • 🔵 Tracked: blaze_campaign_list_opened, Properties: {"source":"menu_item"}

Click on the Menu item - Blaze campaign disabled

  • Go to the Jetpack app with an account having campaigns
  • Go to dashboard
  • Click on Menu item - Blaze
  • Verify that the user is navigated to the Campaigns listing page
  • Verify that the tracking event is fired
  • 🔵 Tracked: blaze_entry_point_tapped, Properties: {"source":"menu_item"}
  • 🔵 Tracked: blaze_overlay_displayed, Properties: {"source":"menu_item"}

Click on the Dashboard Card - Blaze Campaign

  • Go to the Jetpack app with an account having campaigns
  • Go to dashboard
  • Click on Create Campaign
  • Verify that the user is navigated to Blaze Flow
  • 🔵 Tracked: blaze_entry_point_tapped, Properties: {"source":"dashboard_card"}
  • 🔵 Tracked: blaze_overlay_displayed, Properties: {"source":"dashboard_card"}
  • Repeat steps 1-2
  • Click on Campaign item
  • Verify event is tracked 🔵 Tracked: blaze_campaign_details_opened, Properties: {"source":"dashboard_card"}
  • Click on the dashboard card
  • Verify event tracked - 🔵 Tracked: blaze_campaign_list_opened, Properties: {"source":"dashboard_card"}

Ripple effect and Padding, Verify that the BlazeCampaignCard UI is as expected - compare it with the PR or Figma design

I had to re-arrange and add some columns in BlazeCampaignCard.
This is due to the fact that the click ripple of the view doesn’t fill the padding of the view in which click behavior is added. So adding padding to the column and setting it clickable makes the ripple to only fill the content. In order to fix that, I moved the padding from the parent column to the child view and set the parent clickable which makes the entire content to have the ripple effect.

Merge Instructions

Regression Notes

  1. Potential unintended areas of impact
  • Blaze Card - Promo card and Campaign card is not shown in correct time
  • Blaze Card UI is not correct
  • Click and tracking for the card is not correct
  1. What I did to test those areas of impact (or what existing automated tests I relied on)
  • Unit tests and Manual tests
  1. What automated tests I added (or what prevented me from doing so)
  • Added unit tests

PR submission checklist:

  • I have completed the Regression Notes.
  • 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.

UI Changes testing checklist:

  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

+ Adds: a class for handling the logic related to Blaze events to
seperate it from MySiteViewModel
+ Adds: the logic to handle the click and track the events on clicking
at the promo card
* Updates: the logic in MySiteViewModel to use BlazeViewModelSlice
@AjeshRPai AjeshRPai added this to the 22.9 milestone Jul 17, 2023
@AjeshRPai AjeshRPai self-assigned this Jul 17, 2023
@AjeshRPai AjeshRPai changed the base branch from trunk to issue/styling-of-the-dashboard-card July 17, 2023 14:36
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jul 17, 2023

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr18783-329c3ef
Commit329c3ef
Direct Downloadwordpress-prototype-build-pr18783-329c3ef.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jul 17, 2023

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr18783-329c3ef
Commit329c3ef
Direct Downloadjetpack-prototype-build-pr18783-329c3ef.apk
Note: Google Login is not supported on these builds.

AjeshRPai added 17 commits July 18, 2023 11:46
+ Adds: Parent activity for showing campaigns and campaign detail
+ Adds: CampaignListingFragment and CampaignListingViewModel for
listing the campaigns
Updates: the logic to remove the redundant logic and this will be added
in a seperate PR
+ Adds: Blaze Campaign page
+ Adds: Blaze Campaign Parent Viewmodel
+ Adds: Blaze Campaign UI state for navigating to list/detail page
…8525_implement_click_and_tracking

# Conflicts:
#	WordPress/src/main/res/values/strings.xml
+ Adds: the logic to navigate to campaign listing page when campaigns
feature is enabled otherwise navigate to blaze flow
@AjeshRPai AjeshRPai changed the title Implement click and tracking campaigns Implement navigation and tracking for Campaigns dashboard card Jul 19, 2023
Updates: MySiteViewModelTest to remove the blaze dependancies as those
will be tested in a seperate class targeting BlazeCardViewModelSlice
* Changes the order as in the usage
Base automatically changed from issue/styling-of-the-dashboard-card to trunk July 19, 2023 15:08
@AjeshRPai AjeshRPai marked this pull request as ready for review July 19, 2023 15:08
@AjeshRPai AjeshRPai requested a review from zwarm July 19, 2023 15:09
Copy link
Contributor

@zwarm zwarm left a comment

Choose a reason for hiding this comment

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

@AjeshRPai - things are looking good. A few small refactor areas. My compose knowledge is very low, so it's hard for me to say the code is efficient, but it works. :)

@peril-wordpress-mobile
Copy link

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

Generated by 🚫 dangerJS

@zwarm zwarm merged commit 90131e4 into trunk Jul 19, 2023
@zwarm zwarm deleted the issue/18521_18525_implement_click_and_tracking branch July 19, 2023 17:47
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