-
Notifications
You must be signed in to change notification settings - Fork 295
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
Change the placement of the feature flag check for Ad Blocking Recovery settings #7203
Conversation
Build files for 8fc8d6e have been deleted. |
Size Change: -3.84 kB (0%) Total Size: 1.35 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the work here, @tofumatt, absolutely accurate!
I'm being very nitpicky here. I understand updating stories/tests wasn't mentioned in the IB, however, test suites for both the AdBlockingRecoveryCTA
and AdBlockingRecoveryToggle
components include tests to verify if the adBlockerDetection
feature flag is enabled.
AdBlockingRecoveryCTA
:
site-kit-wp/assets/js/modules/adsense/components/common/AdBlockingRecoveryCTA.test.js
Lines 37 to 43 in 9fa3d85
[ | |
'the Ad blocker detection feature flag is not enabled', | |
ACCOUNT_STATUS_PENDING, | |
SITE_STATUS_READY, | |
'', | |
false, | |
], |
AdBlockingRecoveryToggle
:
site-kit-wp/assets/js/modules/adsense/components/common/AdBlockingRecoveryToggle.test.js
Line 45 in 9fa3d85
[ 'the Ad blocker detection feature flag is not enabled', false ], |
Also, all the other tests within the above test suites set the adBlockerDetection
feature flag to be enabled.
The tests still work flawlessly with them existing there. Now that the feature flag checks have been removed from the components within, do you think these checks are redundant and should be removed from the tests?
Also, the Storybook stories for AdBlockingRecoveryCTA
and AdBlockingRecoveryToggle
components set the adBlockerDetection
feature flag to be enabled. For example:
site-kit-wp/assets/js/modules/adsense/components/common/AdBlockingRecoveryCTA.stories.js
Lines 44 to 46 in 9fa3d85
Ready.parameters = { | |
features: [ 'adBlockerDetection' ], | |
}; |
Do you think these should also be removed?
Nitpicks are okay, but also these are hardly nitpicks, great catches! 🙏🏻
Yes, they should be removed. Thank you for finding/noticing this! These For future reference to any devs reading this, arrays of something like: {
testName: 'Adsense site status is not ready',
accountStatus: ACCOUNT_STATUS_READY,
siteStatus: SITE_STATUS_ADDED,
recoverySetupStatus: '',
adBlockerDetectionFeatureFlag: true,
}, over [
'Adsense site status is not ready',
ACCOUNT_STATUS_READY,
SITE_STATUS_ADDED,
'',
true,
], for |
I absolutely agree, thank you for the example! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tofumatt ! This is almost there, just one more thing which is needed.
<AdBlockingRecoveryToggle /> | ||
{ adBlockerDetectionEnabled && ( | ||
<Fragment> | ||
<AdBlockingRecoveryCTA /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component is also rendered in the SettingsView
which is still being rendered unconditionally.
site-kit-wp/assets/js/modules/adsense/components/settings/SettingsView.js
Lines 225 to 228 in 94ecff3
) } | |
<AdBlockingRecoveryCTA /> | |
</div> |
Apologies, I missed this in the IB too.
A few more things I noticed when looking at the
Secondarily, I don't think these messages match the descriptions site-kit-wp/assets/js/modules/adsense/components/settings/SettingsView.js Lines 188 to 204 in 94ecff3
I noticed this when the setup was completed and both toggles were on, but the view was showing Ad blocking recovery tag is not placed .
The tag is placed for both of these statuses – it's the blank string where they're not placed (this would probably be better as a named value as well. We also have an enum value for the statuses now as well but that's a minor detail. This one should be revisited and corrected separately. I'll push a fix for the additional guards that were missed and send it back to you @tofumatt for MR 👍 cc: @kuasha420 ☝️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for catching that one @aaemnnosttv! 👍🏻
Summary
Addresses issue:
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist