-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8636 from google/issue/8564-pax-extend-ads-settin…
…gs-edit-view Issue / 8564 PAX Extend Ads Settings Edit View
- Loading branch information
Showing
9 changed files
with
139 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
assets/js/modules/ads/components/settings/SettingsEdit.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/** | ||
* Ads SettingsEdit component stories. | ||
* | ||
* Site Kit by Google, Copyright 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import SettingsEdit from './SettingsEdit'; | ||
import { Cell, Grid, Row } from '../../../../material-components'; | ||
import { MODULES_ADS } from '../../datastore/constants'; | ||
import { provideModules } from '../../../../../../tests/js/utils'; | ||
import WithRegistrySetup from '../../../../../../tests/js/WithRegistrySetup'; | ||
|
||
function Template( args ) { | ||
return ( | ||
<div className="googlesitekit-layout"> | ||
<div className="googlesitekit-settings-module googlesitekit-settings-module--active googlesitekit-settings-module--ads"> | ||
<div className="googlesitekit-setup-module"> | ||
<div className="googlesitekit-settings-module__content googlesitekit-settings-module__content--open"> | ||
<Grid> | ||
<Row> | ||
<Cell size={ 12 }> | ||
<SettingsEdit { ...args } /> | ||
</Cell> | ||
</Row> | ||
</Grid> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export const Default = Template.bind( null ); | ||
Default.storyName = 'Default'; | ||
Default.scenario = { | ||
label: 'Modules/Ads/Settings/SettingsEdit/Default', | ||
delay: 250, | ||
}; | ||
Default.decorators = [ | ||
( Story ) => { | ||
const setupRegistry = ( registry ) => { | ||
registry.dispatch( MODULES_ADS ).receiveGetSettings( { | ||
conversionID: 'AW-123456789', | ||
} ); | ||
}; | ||
|
||
return ( | ||
<WithRegistrySetup func={ setupRegistry }> | ||
<Story /> | ||
</WithRegistrySetup> | ||
); | ||
}, | ||
]; | ||
|
||
export default { | ||
title: 'Modules/Ads/Settings/SettingsEdit', | ||
decorators: [ | ||
( Story ) => { | ||
const setupRegistry = ( registry ) => { | ||
provideModules( registry, [ | ||
{ | ||
slug: 'ads', | ||
active: true, | ||
connected: true, | ||
}, | ||
] ); | ||
}; | ||
|
||
return ( | ||
<WithRegistrySetup func={ setupRegistry }> | ||
<Story /> | ||
</WithRegistrySetup> | ||
); | ||
}, | ||
], | ||
features: [ 'adsModule' ], | ||
}; | ||
|
||
export const PaxConnected = Template.bind( null ); | ||
PaxConnected.storyName = 'With PAX onboarding'; | ||
PaxConnected.scenario = { | ||
label: 'Modules/Ads/Settings/SettingsEdit/PAX', | ||
delay: 250, | ||
}; | ||
PaxConnected.parameters = { | ||
features: [ 'adsPax' ], | ||
}; | ||
PaxConnected.decorators = [ | ||
( Story, { parameters } ) => { | ||
const setupRegistry = ( registry ) => { | ||
// Unset the value set in the prrevious scenario. | ||
registry.dispatch( MODULES_ADS ).setConversionID( null ); | ||
|
||
registry.dispatch( MODULES_ADS ).receiveGetSettings( { | ||
paxConversionID: 'AW-54321', | ||
extCustomerID: 'C-872756827HGFSD', | ||
} ); | ||
}; | ||
|
||
return ( | ||
<WithRegistrySetup | ||
func={ setupRegistry } | ||
features={ parameters.features || [] } | ||
> | ||
<Story /> | ||
</WithRegistrySetup> | ||
); | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+17.9 KB
...oogle-site-kit_Modules_Ads_Settings_SettingsEdit_Default_0_document_0_small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20.2 KB
...ogle-site-kit_Modules_Ads_Settings_SettingsEdit_Default_0_document_1_medium.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+21.5 KB
...oogle-site-kit_Modules_Ads_Settings_SettingsEdit_Default_0_document_2_large.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.2 KB
...ce/google-site-kit_Modules_Ads_Settings_SettingsEdit_PAX_0_document_0_small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.2 KB
...e/google-site-kit_Modules_Ads_Settings_SettingsEdit_PAX_0_document_1_medium.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.4 KB
...ce/google-site-kit_Modules_Ads_Settings_SettingsEdit_PAX_0_document_2_large.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.