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
Filter publications returned by TwG datapoint #5653
Comments
IB ✅ |
QA Update: ✅Verified:
|
The TwG team confirmed the above, so unfortunately we cannot filter publications to those that have |
I've updated the ACs and created a follow-up PR for the changes. |
QA Update: ✅Verified: The TwG GET:publications endpoint's response handling is adjusted so that the returned publications are filtered to only return those that satisfy both requirements:
I tested this when the status was NONE on the |
Thanks for clarifying and addressing this, @aaemnnosttv 👍 |
Feature Description
The TwG datapoint for
GET:publications
currently returns all publications a user has access to. According to the design doc, this should be filtered to a subset of publications that are relevant for the current site, but also for TwG as it can return other kinds of publications as well.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
GET:publications
endpoint's response handling should be adjusted so that the returned publications are filtered to only return those that satisfy both requirements:paymentOptions -> thankStickers
set totrue
.publicationPredicates -> businessPredicates -> supportsSiteKit
set totrue
but only if the onboarding state isONBOARDING_COMPLETE
.Implementation Brief
In the
includes/Modules/Thank_With_Google.php
, modify theparse_data_response
protected function to filter out publications that do not satisfy the above requirements.$response->getPublications()
to a variable.array_filter
helper loop through the$response->getPublications()
and do the following logic in the callback function:publication
object does not havepaymentOptions->thankStickers
set totrue
, remove the publication from the array.publication
object does not havepublicationPredicates->businessPredicates->supportsSiteKit
set totrue
, remove the publication from the array.$response->getPublications()
to theparse_data_response
function.Test Coverage
QA Brief
getPublications
selector in the browser console -googlesitekit.data.select('modules/thank-with-google').getPublications()
.Changelog entry
The text was updated successfully, but these errors were encountered: