-
Notifications
You must be signed in to change notification settings - Fork 296
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
Implement infrastructure for storing Idea Hub idea information with WordPress posts #3157
Comments
@ivankruchkoff the
Could you please elaborate a little bit more here? What exactly needs to be updated there? Do we need to add new tests or update existing ones? |
Updated
Updated |
IB ✔️ |
@eugene-manuilov The QA: Waiting for engineer to confirm |
@asvinb yes, it hasn't been added. I'll create a follow up PR. |
Thanks @asvinb, sorry I missed that bit in the PR! 😓 |
No worries @tofumatt . QA ✅ |
Since the Idea Hub module will allow creating WordPress posts based on Idea Hub ideas, it should be possible to store an idea's full information within a post. See more information on the overall approach.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Google\Site_Kit\Modules\Idea_Hub\Post_Idea_Name
class should be implemented which extendsGoogle\Site_Kit\Core\Storage\Post_Meta_Setting
.googlesitekitpersistent_idea_name
.Google\Site_Kit\Modules\Idea_Hub\Post_Idea_Text
class should be implemented which extendsGoogle\Site_Kit\Core\Storage\Post_Meta_Setting
.googlesitekitpersistent_idea_text
.Google\Site_Kit\Modules\Idea_Hub\Post_Idea_Topics
class should be implemented which extendsGoogle\Site_Kit\Core\Storage\Post_Meta_Setting
.googlesitekitpersistent_idea_topics
.mid
anddisplay_name
fields).mid
anddisplay_name
string fields.Idea_Hub
class should register the newPost_Meta_Setting
s implemented.Idea_Hub
class should receive two new protected methods:set_post_idea( int $post_id, array $idea ) : bool
: Stores metadata in the given post based on the idea passed, relying on the 3Post_Meta_Setting
s.$idea
is expected to be an associative array for a single idea (see Implement Idea Hub infrastructure (with mocks) for querying new ideas #3155 for the exact format of such an idea).get_post_idea( int $post_id ) : array | null
: Returns an idea array based on the post metadata (relying on the 3Post_Meta_Setting
s) stored in the post, or returnsnull
if any of the 3 pieces of data is not stored. The returned idea format should match the idea format returned by the API (see Implement Idea Hub infrastructure (with mocks) for querying new ideas #3155 for the exact format of such an idea).Implementation Brief
Following #3154,
Create a new file
includes/Modules/Idea_Hub/Post_Idea_Name.php
Create a new file
includes/Modules/Idea_Hub/Post_Idea_Text.php
Create a new file
includes/Modules/Idea_Hub/Post_Idea_Topics.php
Update the
register()
function inincludes/Modules/Idea_Hub.php
to register each of the newPost_Meta_Setting
s above.Add two new functions to
includes/Modules/Idea_Hub.php
,set_post_idea()
andget_post_idea()
per the AC.Test Coverage
Update
tests/phpunit/integration/Modules/Idea_HubTest.php
to addtest_set_post_idea()
andtest_get_post_idea()
Visual Regression Changes
QA Brief
set_post_idea
andget_post_idea
and they work as required in the AC.Changelog entry
The text was updated successfully, but these errors were encountered: