-
Notifications
You must be signed in to change notification settings - Fork 286
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
Add RRM module settings #8793
Comments
IB ✅ |
Hi @ankitrox, nice work so far on the QAB here too. I'd suggest that it states to "repeat the above for the |
QA Update
|
We have got it covered via the test case here
Added in QAB
Added in QAB |
QA Update
|
@kelvinballoo Property positioning in the object does not matter.
OR
Both are okay provided that values are same. |
QA Update ✅Tested this as per the ACs and these are working as expected:
|
Feature Description
The module settings required for Reader Revenue Manager should be added both in the server-side and datastore, including their validation. The module setting values should also be made available in the Site Kit debug information.
This issue should also be responsible for adding the
is_connected
andon_deactivation
methods for theModules\Reader_Revenue_Manager
class, where the module is considered connected when thepublicationID
module setting is set, and all the module settings are deleted on deactivation.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
publicationID
(string); Default: Empty string; Owned setting.publicationOnboardingState
(string); Default: Empty string.publicationOnboardingStateLastSyncedAtMs
(integer); Default: 0 (zero).publicationID
module setting set.Implementation Brief
Google\Site_Kit\Modules\Reader_Revenue_Manager\Settings
inincludes/Modules/Reader_Revenue_Manager/Settings.php
file.Module_Settings
and implementSetting_With_Owned_Keys_Interface
Setting_With_Owned_Keys_Trait
trait.OPTION
constant with the valuegooglesitekit_reader-revenue-manager_settings
register
function which callsparent::register()
and$this->register_owned_keys()
(provided by the trait) to register the owned keys.get_owned_keys
function that returns an array with the owned key defined in the ACs. ie.publicationID
.get_default
function with the keys and default values defined in the ACs.get_sanitize_callback
to ensure that the types of the settings fields are verified before saving.includes/Modules/Reader_Revenue_Manager.php
:Reader_Revenue_Manager
class implementModule_With_Deactivation
,Module_With_Owner
andModule_With_Settings
interfaces.Module_With_Owner_Trait
andModule_With_Settings_Trait
traits.setup_settings
function that returns a new instance ofGoogle\Site_Kit\Modules\Reader_Revenue_Manager\Settings
.is_connected
function that returns false ifpublicationID
is not set (ie. the default empty string). Otherwise returnparent::is_connected()
.on_deactivation
function that deletes the module settings.assets/js/module/reader-revenue-manager/datastore/base.js
:createModuleStore
call.assets/js/module/reader-revenue-manager/datastore/settings.js
:Test Coverage
SettingsTestCase
intests/phpunit/integration/Modules/Reader_Revenue_Manager/SettingsTest.php
tests/phpunit/integration/Modules/Reader_Revenue_ManagerTest.php
:Module_With_Settings_ContractTests
.QA Brief
There's no UI to test the feature as of now.
Testing publicationID setting
It should give the following object.
This should update the settings on server.
It should give following output
Testing publicationOnboardingState setting
It should give the following object.
This should update the settings on server.
It should give following output
Testing publicationOnboardingStateLastSyncedAtMs setting
It should give the following object.
This should update the settings on server.
It should give following output, note that timestamp will vary.
Connection logic should be implemented for the module so that it is considered connected with the publicationID module setting set.
Activate the module.
Run the following command in browser console. Remember to replace publicationID value with your publication ID in publisher center. It can be found in publisher center URL.
Refresh the page.
Site Kit > Settings > Reader Revenue Manager
, it should show as conneected. This is because publication ID is set.All module settings should be deleted when the module is disconnected.
undefined
at first run, so run it second time again as request may not have fulfilled for the first time.It will give you an object something like
Notice that this contains values for all the properties.
Note that the values for the properties should be empty string and for
publicationOnboardingStateLastSyncedAtMs
it shuld be zero.Changelog entry
The text was updated successfully, but these errors were encountered: