Skip to content
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 setter and getter for comming soon setting to api #45604

Merged
merged 1 commit into from
Sep 15, 2020

Conversation

roo2
Copy link
Contributor

@roo2 roo2 commented Sep 14, 2020

Changes proposed in this Pull Request

Adds wpcom_public_coming_soon to the setting endpoint GET and POST endpoints

Testing instructions

Apply the generated diff, or checkout this branch and then run yarn dev --sync from ./apps/editing-toolkit/ to sync to your sandbox.

In a rest client calls the settings endpoint:

Test the POST
POST https://public-api.wordpress.com/rest/v1.4/sites/172971117/settings
Authorization: {{ authorization taken from browser }}
Cookie: {{ cookie taken from browser }}
{
	"wpcom_public_coming_soon": 1
}
Test the GET
GET https://public-api.wordpress.com/rest/v1.1/sites/172971117/settings
Authorization: {{ authorization taken from browser }}
Cookie: {{ cookie taken from browser }}

You should see "wpcom_public_coming_soon": 1 included in the response

@matticbot
Copy link
Contributor

@roo2 roo2 requested review from lsl and ramonjd September 14, 2020 00:14
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 14, 2020
@roo2 roo2 self-assigned this Sep 14, 2020
@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@matticbot
Copy link
Contributor

Caution: This PR affects files in the Editing Toolkit Plugin on WordPress.com
Please ensure your changes work on WordPress.com before merging.

D49466-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing the Editing Toolkit Plugin for more info: PCYsg-ly5-p2

@roo2 roo2 added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Sep 14, 2020

return $options;
}
add_filter( 'site_settings_endpoint_get', __NAMESPACE__ . '\add_public_coming_soon_to_settings_endpoint_get' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamziel

We're adding this filter like you did in D37770-code.

Any reason not to do it in the Editing Toolkit?

Copy link
Contributor

@adamziel adamziel Sep 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of all the async/distributed stuff, It took some days of drawing to figure out the phabricator parts - I'm not familiar with editing toolkit enough to be able to answer your question @ramonjd :(

Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested using https://developer.wordpress.com/docs/api/console-2014/

Confirmed that GET on sites/$site_id/settings returns settings: { ..., wpcom_public_coming_soon: 0 } in the body

@roo2 roo2 force-pushed the add/public-coming-soon-to-settings-endpoint branch from 93c0aaf to 2acf137 Compare September 15, 2020 01:13
@roo2 roo2 added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Sep 15, 2020
@roo2 roo2 merged commit 9cd507b into master Sep 15, 2020
@roo2 roo2 deleted the add/public-coming-soon-to-settings-endpoint branch September 15, 2020 04:20
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 15, 2020
This was referenced Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants