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

2535: Consolidate Ad Creation #2623

Open
wants to merge 44 commits into
base: feature/2459-campaign-creation-flow
Choose a base branch
from

Conversation

asvinb
Copy link
Collaborator

@asvinb asvinb commented Sep 24, 2024

Changes proposed in this Pull Request:

Closes #2535 .

Replace this with a good description of your changes & reasoning.

Detailed test instructions:

  1. Go through the onboarding process and ensure a paid campaign can be created.
  2. Ensure the skip paid ads modal is displayed when the user clicks the skip button during the onboarding flow.
  3. Go through the setup ads flow and endure a paid campaign can be created.
  4. Ensure a paid campaign can be added via the "Add a paid campaign" button on the dashboard.
  5. Ensure a paid campaign can be edited via the "Edit" links on the dashboard.
  6. Test when billing is not setup flow, ie. the user is prompted to setup billing.
  7. Users should not be able to submit/continue any flow if billing is not set up and approved.
  8. Users are no longer able to view the targetted countries.

Additional details:

Changelog entry

@github-actions github-actions bot added the changelog: update Big changes to something that wasn't broken. label Sep 24, 2024
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 1.44928% with 68 lines in your changes missing coverage. Please review.

Project coverage is 61.0%. Comparing base (3d38d91) to head (34c53d7).

Files with missing lines Patch % Lines
...c/components/paid-ads/ads-campaign/ads-campaign.js 0.0% 31 Missing and 4 partials ⚠️
...rc/components/paid-ads/ads-campaign/skip-button.js 0.0% 19 Missing and 1 partial ⚠️
...s/paid-ads/ads-campaign/paid-ads-setup-sections.js 0.0% 6 Missing and 1 partial ⚠️
...c/components/paid-ads/billing-card/billing-card.js 14.3% 4 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                          Coverage Diff                          @@
##           feature/2459-campaign-creation-flow   #2623     +/-   ##
=====================================================================
- Coverage                                 62.6%   61.0%   -1.6%     
=====================================================================
  Files                                      319     330     +11     
  Lines                                     5063    5183    +120     
  Branches                                  1232    1254     +22     
=====================================================================
- Hits                                      3171    3162      -9     
- Misses                                    1718    1832    +114     
- Partials                                   174     189     +15     
Flag Coverage Δ
js-unit-tests 61.0% <1.4%> (-1.6%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../components/paid-ads/ads-campaign/clientSession.js 33.3% <ø> (ø)
.../src/components/paid-ads/ads-campaign/constants.js 100.0% <ø> (ø)
...src/components/paid-ads/ads-campaign/faqs-panel.js 66.7% <ø> (ø)
...paid-ads/ads-campaign/paid-ads-features-section.js 0.0% <ø> (ø)
...s/ads-campaign/skip-paid-ads-confirmation-modal.js 33.3% <ø> (ø)
js/src/pages/create-paid-ads-campaign/index.js 10.8% <ø> (ø)
js/src/pages/edit-paid-ads-campaign/index.js 9.4% <ø> (ø)
js/src/setup-ads/ads-stepper/index.js 100.0% <ø> (ø)
...c/components/paid-ads/billing-card/billing-card.js 6.7% <14.3%> (ø)
...s/paid-ads/ads-campaign/paid-ads-setup-sections.js 3.1% <0.0%> (ø)
... and 2 more

... and 7 files with indirect coverage changes

@asvinb asvinb changed the title Update/2535 consolidate ad creation ccf merged 2535: Consolidate Ad Creation Sep 25, 2024
@asvinb asvinb marked this pull request as ready for review September 25, 2024 18:05
@asvinb
Copy link
Collaborator Author

asvinb commented Sep 25, 2024

@joemcgill Can you kindly review PR please?
I've merged the campaign creation flow branch in this one and set it as the target branch where it'll simplify a lot of our work in the campaign creation flow tasks.
The other PR: #2575 should no longer be relevant now.

Copy link
Collaborator

@joemcgill joemcgill left a comment

Choose a reason for hiding this comment

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

This is looking really good so far. I've left some inline feedback.

Additionally, I noticed that with these changes that when I create a new campaign from after editing an existing campaign that the initial value gets filled from the session storage value in gla-onboarding-paid-ads.

Screenshot 2024-09-26 at 10 50 57 AM

Path: page=wc-admin&path=%2Fgoogle%2Fdashboard&subpath=%2Fcampaigns%2Fcreate

This may already get handled in the new minimum budget work we have in progress, but ideally session storage would not be a factor when creating a campaign other than your first one.

}

const description =
headerDescription ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

headerDescription seems to be a required property, should it default to null or '' to allow it to be empty? What if someone intentionally passes a falsey value to that prop? Won't this fallback kick in? Similarly, we don't seem to handle any default fallback for the headerTitle prop here. Is that intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@joemcgill I removed the headerDescription prop and instead conditionally set the description based on the isOnboardingFlow prop. Because it's only during the onboarding flow that the description is different.

}
/>

<FaqsSection />
Copy link
Collaborator

Choose a reason for hiding this comment

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

This FaqsSection component still doesn't include the improvements from ##2531. Can we cherry-pick those fixes into this branch as well and make sure this doesn't cause a regression when all is finalized?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@joemcgill I noticed the changes were merged to the feature/2458-streamline-onboarding branch. I only merged the campaign creation one. If we want to have those changes, then it's better we merge the feature/2458-streamline-onboarding branch?

Copy link
Collaborator

@joemcgill joemcgill Sep 27, 2024

Choose a reason for hiding this comment

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

The way I originally expected us to sequence this is for all of the 2458 work to be merged to develop and then pulled back into this branch to resolve merge conflicts before merging this work as well. However, we want to hold all of this work so it ships together. If we already had PRs set up for these feature branches, I think it would look like:

  • feature/2458-streamline-onboarding > develop (not merged until everything is ready)
    • feature/2590-consolidate-google-account-cards > feature/2458
    • feature/2459-campaign-creation > feature/2458
      • feature/2460-simplify-paid-ads-setup > feature/2459 (these are getting combined)
  • feature/2460-google-ads-value-prop (post onboarding) > develop (refreshed after 2458 is merged)

So I think there are two ways of managing this, we could either merge feature/2458 into feature/2459 and to update/2535 now, or wait and merge feature/2458 into feature/2459 after the feature branch is ready and resolve merge conflicts at that point. Even so, since this moves and replaces some of the changed files, we'll have to be careful about applying those changes here during that merge. I think either strategy is fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@joemcgill
The best way forward would be to merge #2458 into #2459 and then we merge everything in 2535.
I have a draft PR set up for it:
#2630

I have another PR ready to merge the updated 2459 into 2535 which we can review afterwards:
#2627

So right now, I think if we can review and merge #2630 and then the campaign creation branch would be the target branch for all future PRs.
Let me know what you think.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This sounds right to me. To make things a bit clearer, I'll create draft PRs for the feature branches because 2590 and 2459 should both me opened against 2458, that way we'll be able to see the conflicts that will need to be resolved in an upstream branch.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@asvinb I believe I've gotten all the feature branches updated and set up so that this should be ready to finish up. I've created the following draft PRs for the feature branches:

In doing so, I realized that we somehow had a duplicate feature branch for #2509 with a typo in the name (feature/2590... instead of feature/2509...) so I've updating all existing PRs to use the correct feature branch and deleted feature/2590...

I've merged all of the upstream changes from your merge conflict PRs here as well and fixed up an additional merge conflict that remained, so we should be in good shape now, but let me know if you have any issues.

if ( ! hasFinishedResolution ) {
return <SpinnerCard />;
}

if ( billingStatus.status === APPROVED && ! showNotice ) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: This could be combined with the if below and use a tertiary to show the success component or null based on the value of showNotice, which could improve readability and make the relationship between these two logic branches more obvious. Not a blocker.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice. Updated!

js/src/setup-mc/setup-stepper/saved-setup-stepper.js Outdated Show resolved Hide resolved
@asvinb
Copy link
Collaborator Author

asvinb commented Sep 30, 2024

@joemcgill I've made some updates where we are loading the amount from client session only during onboarding. Can you take a look and let me know what you think.

joemcgill and others added 2 commits September 30, 2024 14:08
…creation-ccf-onboarding-merged

Merge onboarding improvements branch into consolidated ad
Copy link
Collaborator

@joemcgill joemcgill left a comment

Choose a reason for hiding this comment

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

I think these updates are looking pretty good and are testing well for me locally. Left one suggestion, but marking as approved and ready for another QA pass.

One note for QA that should be kept in mind is that when this PR is tested with billing not approved, you'll see the billing setup card on this form as well as a duplicate billing step when creating your first campaigns from the dashboard, until #2536 is completed.

*/
export default function PaidAdsSetupSections( {
onStatesReceived,
countryCodes,
campaign,
loadCampaignFromClientSession,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is a clever way of handling this. If adding a prop for controlling this ends up being undesirable, an alternate option might be to clear the clientSession data whenever the a campaign is created, and update this component to only save the clientSession data if isCreation is true, but I don't see this as a blocker.

@ankitguptaindia
Copy link
Member

QA/Test Report-

Testing Environment -

  • WordPress: 6.6.2
  • Theme active on store: Twenty Twenty-Four Version: 1.2
  • WooCommerce - Version 9.3.3
  • PHP: 8.3
  • Web Server: Nginx
  • Browser: Chrome - Version 128
  • OS: macOS Sonoma 14.6.1

Test Results - Followed the testing instructions, acceptance criteria, and tested all possible ways to create, edit, and manage paid ad campaigns. All tests were passed when billing was not set, with billing set, and other use cases.

Next Step- Ready to Code Review(Woo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: update Big changes to something that wasn't broken.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consolidate the ad creation step in the Ads Setup flow with the one used in Onboarding
3 participants