Skip to content

Commit

Permalink
Social: Refactor feature option storing (#34113)
Browse files Browse the repository at this point in the history
* Add the new settings object + tests

* Update initial states + previous usages

* Update UI + store functions

* changelog

* Fix versions

* Add control for fetching both options together

* Social: Remove deprecated feature files (#34114)

* Remove unneeded files

* changelog

* Social: Refresh store on Publicize module toggle via 1 call (#34142)

* Remove previous refresh functionality

* Add wrapper to refresh settings in class component on Jetpack Settings

* Refresh on social admin page on module toggle change

* Remove useEffect

* Run useEffect only once on module update

* Show toggles instantly on change + only refresh ones on page lifetime

* Update ref logic

* Rename structure

* Fixup versions

* Fix template issue, and make sure it's migrated

* fix tests

* Test fix

* Fix auto-conversion migration logic + add test

* Add auto-conversion sync option

* changelog

* Update versions

* Fix versions

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/7128457475
  • Loading branch information
gmjuhasz authored and matticbot committed Dec 7, 2023
1 parent a167313 commit 38bb00c
Show file tree
Hide file tree
Showing 11 changed files with 284 additions and 553 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.38.0-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Changed
- Social: Refactored storing of feature options to use core functions

### Removed
- Social: Removed deprecated files because of refactore

## [0.37.2] - 2023-12-03
### Changed
- Updated package dependencies. [#34411]
Expand Down Expand Up @@ -426,6 +436,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated package dependencies.
- Update package.json metadata.

[0.38.0-alpha]: https://github.com/Automattic/jetpack-publicize/compare/v0.37.2...v0.38.0-alpha
[0.37.2]: https://github.com/Automattic/jetpack-publicize/compare/v0.37.1...v0.37.2
[0.37.1]: https://github.com/Automattic/jetpack-publicize/compare/v0.37.0...v0.37.1
[0.37.0]: https://github.com/Automattic/jetpack-publicize/compare/v0.36.6...v0.37.0
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"link-template": "https://github.com/Automattic/jetpack-publicize/compare/v${old}...v${new}"
},
"branch-alias": {
"dev-trunk": "0.37.x-dev"
"dev-trunk": "0.38.x-dev"
}
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-publicize",
"version": "0.37.2",
"version": "0.38.0-alpha",
"description": "Publicize makes it easy to share your site’s posts on several social media networks automatically when you publish a new post.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/publicize/#readme",
"bugs": {
Expand Down
143 changes: 0 additions & 143 deletions src/auto-conversion-settings/class-rest-settings-controller.php

This file was deleted.

117 changes: 0 additions & 117 deletions src/auto-conversion-settings/class-settings.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/class-publicize-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ public function register_post_meta() {
'single' => true,
'default' => array(
'image_generator_settings' => array(
'template' => ( new Social_Image_Generator\Settings() )->get_default_template(),
'template' => ( new Jetpack_Social_Settings\Settings() )->sig_get_default_template(),
'enabled' => false,
),
),
Expand Down
3 changes: 2 additions & 1 deletion src/class-publicize-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public static function on_jetpack_feature_publicize_enabled() {
add_action( 'rest_api_init', array( new Connections_Post_Field(), 'register_fields' ), 5 );
add_action( 'rest_api_init', array( new REST_Controller(), 'register_rest_routes' ) );
add_action( 'current_screen', array( static::class, 'init_sharing_limits' ) );
add_action( 'rest_api_init', array( new Auto_Conversion\REST_Settings_Controller(), 'register_routes' ) );
add_action( 'rest_api_init', array( new Jetpack_Social_Settings\Settings(), 'register_settings' ) );
add_action( 'admin_init', array( new Jetpack_Social_Settings\Settings(), 'register_settings' ) );

( new Social_Image_Generator\Setup() )->init();
}
Expand Down
Loading

0 comments on commit 38bb00c

Please sign in to comment.