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

Remove the accounts connection page from the Ads Setup flow. #2595

Merged
Show file tree
Hide file tree
Changes from 11 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
80 changes: 44 additions & 36 deletions js/src/setup-ads/ads-stepper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
FILTER_ONBOARDING,
CONTEXT_ADS_ONBOARDING,
} from '.~/utils/tracks';
import { glaData } from '.~/constants';

/**
* @param {Object} props React props
Expand All @@ -27,6 +28,7 @@
*/
const AdsStepper = ( { formProps } ) => {
const [ step, setStep ] = useState( '1' );
const hasGoogleAdsId = glaData.initialWpData.adsId;
eason9487 marked this conversation as resolved.
Show resolved Hide resolved

useEventPropertiesFilter( FILTER_ONBOARDING, {
context: CONTEXT_ADS_ONBOARDING,
Expand Down Expand Up @@ -59,51 +61,57 @@
};

const handleCreateCampaignContinue = () => {
continueStep( '3' );
continueStep( hasGoogleAdsId ? '2' : '3' );
};

let steps = [
{
key: '1',
label: __( 'Set up your accounts', 'google-listings-and-ads' ),
content: (
<SetupAccounts onContinue={ handleSetupAccountsContinue } />
),
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,
},
];

if ( hasGoogleAdsId ) {
// Remove first step if there's an Ads account connected.
eason9487 marked this conversation as resolved.
Show resolved Hide resolved
steps.shift();

Check warning on line 97 in js/src/setup-ads/ads-stepper/index.js

View check run for this annotation

Codecov / codecov/patch

js/src/setup-ads/ads-stepper/index.js#L97

Added line #L97 was not covered by tests

steps = steps.map( ( singleStep ) => {
return {

Check warning on line 100 in js/src/setup-ads/ads-stepper/index.js

View check run for this annotation

Codecov / codecov/patch

js/src/setup-ads/ads-stepper/index.js#L99-L100

Added lines #L99 - L100 were not covered by tests
...singleStep,
key: ( parseInt( singleStep.key, 10 ) - 1 ).toString(),
eason9487 marked this conversation as resolved.
Show resolved Hide resolved
};
}, [] );
eason9487 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={ [
{
key: '1',
label: __(
'Set up your accounts',
'google-listings-and-ads'
),
content: (
<SetupAccounts
onContinue={ handleSetupAccountsContinue }
/>
),
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={ steps }
/>
);
};
Expand Down
Loading
Loading