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
Create new Ads
module codebase structure in assets/js/modules
#8225
Comments
@10upsimon one thing that is missing in AC is that we need to create the |
@eugene-manuilov I've updated AC to include mention of a new |
Thanks, @10upsimon. This almost looks good to me. The only thing that I forgot about in my original comment is that we need to update the Ads module class to set up assets the same way how we do it in other modules. For example: site-kit-wp/includes/Modules/Tag_Manager.php Lines 517 to 546 in 74ca48b
It also means that we need to update the Ads module class to implement the site-kit-wp/includes/Modules/Tag_Manager.php Lines 60 to 61 in 74ca48b
|
@eugene-manuilov back to you for ACR, thank you |
Thanks, @10upsimon. AC ✔️ |
IB ✅ |
QA Update: ❌@zutigrm When I enable the I tested this on a fresh new site. Also, since the description is a single sentence, then, we shouldn't have a period in the end like the other modules, i.e. Tag Manager. I realize it has one on the Figma designs though, |
@wpdarren Thank you for your observations. It seems the assets trait got lost in one of the previous conflict syncs with develop. I sent the follow up. Also removed the dot from description |
QA Update: ✅Verified:
|
Feature Description
A new standalone module is required to be introduced to the Google Site Kit plugin. This module should follow the design patterns of existing modules that can currently be found in the
assets/js/modules
directory within the existing code base. Said new module should be namedads
, and should reside within a newly created directory atassets/js/modules/ads
. Where applicable, theadsModule
feature flag should be used to gate module functionality and presence/visibility. See issue #8197 for more context.Initially, during this phase, this module will not have any dashboard facing views.
See the applicable section(s) within the Ads Module design document: https://docs.google.com/document/d/1APuSv95bf62uhzlaFlW6jPrzPKy1avpRYd9W1MSAAJo/edit?resourcekey=0-UuynlcUz9CoubgldR6Z5sg#heading=h.9pk2w04qgbdj
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Ads
module should be present within the Site Kit application, gated by way of the recently addedadsModule
feature flag see issue AddadsModule
Feature Flag #8197.index.js
) atassets/js/modules/ads/index.js
is to be implemented, and is to follow necessary logical patterns relative to module data store(s), settings views/components etc. This module should follow the same pattern as other simpler modules, such as thesearch-console
module, which can be used as a guideline for basic base implementation.ads
module store should be associated with theAds
module. Ads store creation is a separate GH issue, see (TBA).SettingsEditComponent
, and should follow the design patterns of existing modules.SettingsViewComponent
, and should follow the design patterns of existing modules.SettingsFormComponent
, and should follow the design patterns of existing modules.Ads
icon should be created (see Figma) for use within the module scaffolding, as and where needed.Ads
module class by way of asetup_assets()
method, for reference see other areas of the codebase, such as:site-kit-wp/includes/Modules/Tag_Manager.php
Lines 517 to 546 in 74ca48b
Ads
module PHP class should be updated (if not already) to implement theModule_With_Assets
interfaceAds
module PHP class should be updated (if not already) to use theModule_With_Assets_Trait
traitAds
module PHP base class #8222 to ascertain if interface and trait have been implemented, or add if necessaryassets/js/googlesitekit-modules-ads.js
should be created, following the same pattern as existing modules./webpack.config.js
via the module config file at./webpack/modules.config.js
Implementation Brief
assets/js/modules/ads/datastore/constants
MODULES_ADS
assets/js/modules/ads/index.js
:assets/js/modules/search-console/index.js
as a starting point to borrow the core logic fromAds
module, wrapped underadsModule
feature flag.assets/js/modules/ads/datastore/index.js
assets/js/modules/search-console/datastore/index.js
as starting pointstore
use initially a placeholder object, with properties likeinitialState: {}, actions: {}
etc. These will be handled/added in other issueassets/js/modules/ads/components/settings/SettingsEdit.js
assets/js/modules/search-console/components/settings/SettingsEdit.js
as starting pointhasSearchConsoleAccess
,isDoingSubmitChanges
andviewComponent
component rendering logicdiv
wrapper with classgooglesitekit-setup-module googlesitekit-setup-module--ads
assets/js/modules/ads/components/settings/SettingsForm.js
assets/js/modules/search-console/components/settings/SettingsForm.js
as a starting point to get the basic logic fromgetModule
selector onCORE_MODULES
to retrieveads
modulegooglesitekit-ads-settings-fields
StoreErrorNotices
componentGoogle\Site_Kit\Modules\Ads
class:setup_assets
method, interfaces, etcassets/js/googlesitekit-modules-ads.js
fileassets/js/googlesitekit-modules-search-console.js
webpack/modules.config.js
:googlesitekit-modules-ads
to the list pointing to the previously added fileassets/js/googlesitekit-modules-ads.js
. You can follow an example heresite-kit-wp/webpack/modules.config.js
Lines 77 to 78 in ab9d76b
Test Coverage
assets/js/modules/index.test.js
QA Brief
Ads
module is not on the listadsModule
feature flagAds
module is present with proper icon and descriptionChangelog entry
The text was updated successfully, but these errors were encountered: