Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#58524 closed task (blessed) (fixed)

Rest API: add /revisions endpoint for global styles

Reported by: ramonopoly Owned by: isabel_brison
Priority: normal Milestone: 6.3
Component: REST API Version: 6.3
Severity: normal Keywords: has-patch has-unit-tests gutenberg-merge add-to-field-guide
Cc: Focuses:

Description

The following Global Revisions UI was added to Gutenberg in ​https://github.com/WordPress/gutenberg/pull/50089

To support this, an endpoint (/wp/v2/global-styles/revisions) that returns revisions for the global styles custom post was added and updated in:

​https://github.com/WordPress/gutenberg/pull/49974
​https://github.com/WordPress/gutenberg/pull/50234

We need to synchronize the PHP changes that add the endpoint to returns revisions for the global styles custom post.

Change History (16)

This ticket was mentioned in ​PR #4606 on ​WordPress/wordpress-develop by ​@ramonopoly.


3 years ago
#1

  • Keywords has-patch has-unit-tests added

The following Global Revisions UI was added to Gutenberg in:

To support this, an endpoint (/wp/v2/global-styles/revisions) that returns revisions for the global styles custom post was added and updated in:

This PR adds the endpoint to Core and adds tests.

Trac ticket: https://core.trac.wordpress.org/ticket/58524

## Testing

To test the endpoint in the site editor, fire up this branch and head over to the site editor.

In your browser's console, switch to the network tab and run the following :

await wp.apiFetch( { url: `/index.php?rest_route=%2Fwp%2Fv2%2Fglobal-styles%2F${ wp.data.select('core').__experimentalGetCurrentGlobalStylesId() }%2Frevisions&_locale=user` } );

npm run test:php -- --filter WP_REST_Global_Styles_Revisions_Controller_Test

#2 @ramonopoly
3 years ago

  • Keywords gutenberg-merge added
  • Type defect (bug) → enhancement
  • Version → trunk

#3 @isabel_brison
3 years ago

  • Milestone Awaiting Review → 6.3

​@ramonopoly commented on ​PR #4606:


3 years ago
#4

Thank @TimothyBJacobs @spacedmonkey and @peterwilsoncc for helping me make this patch better.

I think I've addressed all of the feedback, (except for the ​context test) at least I think so. Please let me know where it can be improved.

​@ramonopoly commented on ​PR #4606:


3 years ago
#5

A couple of nitpics. This is nearly there. Is there a committer / owner for this change?

I appreciate the continued feedback 🙇

I'll get those changes in today and will liaise with @tellthemachines to get it committed

This ticket was mentioned in ​Slack in #core by chaion07. ​View the logs.


3 years ago

#7 @chaion07
3 years ago

  • Type enhancement → task (blessed)

Thanks @ramonopoly for reporting this. We discussed this ticket during a recent bug-scrub session. Based on the feedback we are updating the ticket with the following changes:

  1. Converting it into a Task
  2. Keeping in the 6.3 milestone

Cheers!

Props to @audrasjb

#8 @isabel_brison
3 years ago

  • Owner set to isabel_brison
  • Resolution → fixed
  • Status new → closed

In 56082:

REST API: add revisions endpoint for global styles.

Adds an endpoint that returns revisions to the global styles custom post.

Props ramonopoly, peterwilsoncc, spacedmonkey, mukesh27, timothyblynjacobs.
Fixes #58524.

​@isabel_brison commented on ​PR #4606:


3 years ago
#9

committed in r56082 / ​c345180.

This ticket was mentioned in ​PR #4750 on ​WordPress/wordpress-develop by ​@ramonopoly.


3 years ago
#10

Some missed formatting and also implementing feedback from ​https://github.com/WordPress/wordpress-develop/pull/4606#pullrequestreview-1500696132 (adding missing @covers to tests and swapping order of @ticket and @covers order)

Trac ticket: https://core.trac.wordpress.org/ticket/58524

​@ramonopoly commented on ​PR #4606:


3 years ago
#11

The unit tests could do with @covers.

Thanks! PR for that here: ​https://github.com/WordPress/wordpress-develop/pull/4750

#12 @isabel_brison
3 years ago

In 56105:

REST API: updates test annotations for global styles revisions

Adds @covers annotations to tests and fixes incorrect spacing.

Props ramonopoly, mukesh27.
See #58524.

​@isabel_brison commented on ​PR #4750:


3 years ago
#13

committed in r56105 / ​41277f1.

#14 @milana_cap
3 years ago

  • Keywords add-to-field-guide added

#15 @audrasjb
3 years ago

In 56272:

Docs: Fix indentation issue in WP_REST_Global_Styles_Revisions_Controller class.

Follow-up to [56082].

See #57840, #58524.

#16 @joedolson
3 years ago

In 56280:

Docs: Fix indentation issue in WP_REST_Global_Styles_Revisions_Controller class.

Follow-up to [56082].
Reviewed by joedolson.
Merges [56272] to the 6.3 branch.
See #57840, #58524.

Note: See TracTickets for help on using tickets.