Make WordPress Core

Opened 10 months ago

Closed 10 months ago

Last modified 9 months ago

#58524 closed task (blessed) (fixed)

Rest API: add /revisions endpoint for global styles

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

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.


10 months 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
10 months ago

  • Keywords gutenberg-merge added
  • Type changed from defect (bug) to enhancement
  • Version set to trunk

#3 @isabel_brison
10 months ago

  • Milestone changed from Awaiting Review to 6.3

@ramonopoly commented on PR #4606:


10 months 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:


10 months 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.


10 months ago

#7 @chaion07
10 months ago

  • Type changed from enhancement to 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
10 months ago

  • Owner set to isabel_brison
  • Resolution set to fixed
  • Status changed from new to 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:


10 months ago
#9

committed in r56082 / c345180.

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


10 months 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:


10 months 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
10 months 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:


10 months ago
#13

committed in r56105 / 41277f1.

#14 @milana_cap
9 months ago

  • Keywords add-to-field-guide added

#15 @audrasjb
9 months ago

In 56272:

Docs: Fix indentation issue in WP_REST_Global_Styles_Revisions_Controller class.

Follow-up to [56082].

See #57840, #58524.

#16 @joedolson
9 months 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.