You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Social | Improve service connect url generation (#42019)
* Move the publicize/services endpoint to publicize package
This commit:
- Moves the `wpcom/v2/publicize/services` endpoint from Jetpack plugin to publicize package
- Adds Services:: wpcom_get_all() method
- Updates the schema, using 'id' instead of 'name' because that helps us use the core getEntityRecords selectors
- Initializes the endpoint in Publicize_Setup
* Update services class to fix caching
This commit:
- Updates the `Services::get_all()` method to use `self::wpcom_get_all()`
- Updates the endpoint to use the updated `publicize/services` endpoint to get the service data
- Updates caching to use the same mechanism as used for connections caching to handle concurrent requests
- Removes URL from the cached services to avoid caching it.
- Updates the transient name with v1 to avoid PHP warnings when using an old transient
* Update the service fields as per the schema
This commit updates the fields in the front-end components to use the correct schema
* Create selectors and actions for services
This commit creates the required selectors and actions for the services list using the core APIs to avoid boilerplate for API call handling.
* Hydrate the core store with our entity config and initial state data
* Refresh the services list for on connect
When a user clicks on connect, it looks for the connect URL for the service, if it's not present, it refreshes the services list to get the connect URL.
* Disable connect button when loading services
When the user clicks on connect, an API call gets fired and till then we need to disable the connect buttons and also show "Connecting..." only for the button that was clicked.
* Use the supported services from the store instead of the initial state
Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/13521731190
Upstream-Ref: Automattic/jetpack@e31f822
0 commit comments