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

Streamline campaign setup: When the accounts have been connected before, skip accounts setup step during the Ads-onboarding #2595

Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
25801ac
remove accounts setup page.
kt-12 Sep 9, 2024
02cfc1d
remove setup accounts component.
kt-12 Sep 9, 2024
423a2c1
restore setup account
kt-12 Sep 9, 2024
0b38575
if google connection is present show only step 2
kt-12 Sep 12, 2024
6d50d16
Merge branch 'feature/2534-remove-accounts-connection-page' of https:…
kt-12 Sep 12, 2024
46fca31
restore accounts file
kt-12 Sep 12, 2024
2bf96b3
add spinner when page loads
kt-12 Sep 12, 2024
dc08372
E2E test for with ad account.
kt-12 Sep 16, 2024
a40f273
check from global
kt-12 Sep 23, 2024
2651814
remove function.
kt-12 Sep 23, 2024
c26a029
remove new line.
kt-12 Sep 23, 2024
84b1ed0
address review comment.
kt-12 Sep 26, 2024
bd47567
remvoe comment
kt-12 Sep 26, 2024
0f52790
fix step value
kt-12 Sep 30, 2024
c84fa6f
fix e2e
kt-12 Sep 30, 2024
bfec773
remove additional test
kt-12 Sep 30, 2024
eadc445
Ensure Ads account is claimed before skipping step 1
joemcgill Oct 4, 2024
49ae5da
Speed up E2E test case
joemcgill Oct 4, 2024
ec5d05a
check if google account is not ready
kt-12 Oct 8, 2024
c7ad7f5
check if google account is not disconnected instead
kt-12 Oct 8, 2024
64051b6
Adjust isGoogleRead logic and fix linting issues
joemcgill Oct 8, 2024
caa4540
Merge branch 'feature/2459-campaign-creation-flow' into feature/2534-…
kt-12 Oct 10, 2024
c064183
remove google account check
kt-12 Oct 14, 2024
bb6fd03
update condition again
kt-12 Oct 17, 2024
200938c
Merge branch 'feature/2459-campaign-creation-flow' into feature/2534-…
kt-12 Oct 17, 2024
82d6a33
introduce wait for for the button to appear
kt-12 Oct 17, 2024
4bb48b1
spinner
kt-12 Oct 17, 2024
ac52735
remvoe googleAdsAccount null check
kt-12 Oct 18, 2024
110f48c
test work independetly
kt-12 Oct 18, 2024
95cabc9
remove defnition
kt-12 Oct 18, 2024
9eaff54
replace with findbyrole
kt-12 Oct 21, 2024
f957fa4
Merge branch 'feature/2459-campaign-creation-flow' into feature/2534-…
joemcgill Oct 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 50 additions & 32 deletions js/src/setup-ads/ads-stepper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import {
FILTER_ONBOARDING,
CONTEXT_ADS_ONBOARDING,
} from '.~/utils/tracks';

import useGoogleAdsAccount from '.~/hooks/useGoogleAdsAccount';
import AppSpinner from '.~/components/app-spinner';
/**
* @param {Object} props React props
* @param {Object} props.formProps Form props forwarded from `Form` component.
Expand All @@ -27,12 +28,18 @@ import {
*/
const AdsStepper = ( { formProps } ) => {
const [ step, setStep ] = useState( '1' );
const { hasFinishedResolution, hasGoogleAdsConnection } =
kt-12 marked this conversation as resolved.
Show resolved Hide resolved
useGoogleAdsAccount();

useEventPropertiesFilter( FILTER_ONBOARDING, {
context: CONTEXT_ADS_ONBOARDING,
step,
} );

if ( ! hasFinishedResolution && ! hasGoogleAdsConnection ) {
kt-12 marked this conversation as resolved.
Show resolved Hide resolved
return <AppSpinner />;
}

// Allow the users to go backward only, not forward.
// Users can only go forward by clicking on the Continue button.
const handleStepClick = ( value ) => {
Expand All @@ -55,21 +62,38 @@ const AdsStepper = ( { formProps } ) => {
};

const handleSetupAccountsContinue = () => {
continueStep( '2' );
continueStep( hasGoogleAdsConnection ? '1' : '2' );
kt-12 marked this conversation as resolved.
Show resolved Hide resolved
};

const handleCreateCampaignContinue = () => {
continueStep( '3' );
continueStep( hasGoogleAdsConnection ? '2' : '3' );
kt-12 marked this conversation as resolved.
Show resolved Hide resolved
};

return (
// This Stepper with this class name
// should be refactored into separate shared component.
// It is also used in the Setup MC flow.
<Stepper
className="gla-setup-stepper"
currentStep={ step }
steps={ [
const getSteps = () => {
kt-12 marked this conversation as resolved.
Show resolved Hide resolved
let steps = [
{
key: hasGoogleAdsConnection ? '1' : '2',
label: __(
'Create your paid campaign',
'google-listings-and-ads'
),
content: (
<AdsCampaign
trackingContext="setup-ads"
onContinue={ handleCreateCampaignContinue }
/>
),
onClick: handleStepClick,
},
{
key: hasGoogleAdsConnection ? '2' : '3',
label: __( 'Set up billing', 'google-listings-and-ads' ),
content: <SetupBilling formProps={ formProps } />,
onClick: handleStepClick,
},
];
if ( ! hasGoogleAdsConnection ) {
steps = [
{
key: '1',
label: __(
Expand All @@ -83,27 +107,21 @@ const AdsStepper = ( { formProps } ) => {
),
onClick: handleStepClick,
},
{
key: '2',
label: __(
'Create your paid campaign',
'google-listings-and-ads'
),
content: (
<AdsCampaign
trackingContext="setup-ads"
onContinue={ handleCreateCampaignContinue }
/>
),
onClick: handleStepClick,
},
{
key: '3',
label: __( 'Set up billing', 'google-listings-and-ads' ),
content: <SetupBilling formProps={ formProps } />,
onClick: handleStepClick,
},
] }
...steps,
];
}

return steps;
};

return (
// This Stepper with this class name
// should be refactored into separate shared component.
// It is also used in the Setup MC flow.
<Stepper
className="gla-setup-stepper"
currentStep={ step }
steps={ getSteps() }
kt-12 marked this conversation as resolved.
Show resolved Hide resolved
/>
);
};
Expand Down
Loading
Loading