* Changed some API responses

This commit adds changes to some API responses

* Changed "woocommerce_task_list_complete" loading in frontend

* Updated "$migrated_options" array

This commit updates "$migrated_options" array and adds a deletion control

* Changed "taskListComplete" in customizable.js

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
This commit is contained in:
Fernando 2020-06-10 10:33:30 -03:00 committed by GitHub
parent 7d42d389b8
commit 289636abba
4 changed files with 20 additions and 12 deletions

View File

@ -347,11 +347,9 @@ export default compose(
withSelectData.taskListHidden =
get( options, [ 'woocommerce_task_list_hidden' ], 'no' ) ===
'yes';
withSelectData.taskListComplete = get(
options,
[ 'woocommerce_task_list_complete' ],
false
);
withSelectData.taskListComplete =
get( options, [ 'woocommerce_task_list_complete' ], 'no' ) ===
'yes';
}
return withSelectData;

View File

@ -158,9 +158,9 @@ export default compose(
'woocommerce_task_list_complete',
'woocommerce_task_list_hidden',
] ),
taskListComplete: get( options, [
'woocommerce_task_list_complete',
] ),
taskListComplete:
get( options, [ 'woocommerce_task_list_complete' ] ) ===
'yes',
taskListHidden:
get( options, [ 'woocommerce_task_list_hidden' ] ) ===
'yes',

View File

@ -51,7 +51,7 @@ class TaskDashboard extends Component {
if ( ! incompleteTasks.length ) {
updateOptions( {
woocommerce_task_list_complete: true,
woocommerce_task_list_complete: 'yes',
} );
}
@ -80,7 +80,7 @@ class TaskDashboard extends Component {
if ( ! incompleteTasks.length && prevIncompleteTasks.length ) {
updateOptions( {
woocommerce_task_list_complete: true,
woocommerce_task_list_complete: 'yes',
} );
}

View File

@ -40,7 +40,7 @@ class Install {
'wc_admin_update_0251_remove_unsnooze_action',
'wc_admin_update_0251_db_version',
),
'1.1.0' => array(
'1.1.0' => array(
'wc_admin_update_110_remove_facebook_note',
'wc_admin_update_110_db_version',
),
@ -60,6 +60,8 @@ class Install {
'woocommerce_admin_last_orders_milestone' => 'wc_admin_last_orders_milestone',
'woocommerce_admin-wc-helper-last-refresh' => 'wc-admin-wc-helper-last-refresh',
'woocommerce_admin_report_export_status' => 'wc_admin_report_export_status',
'woocommerce_task_list_complete' => 'woocommerce_task_list_complete',
'woocommerce_task_list_hidden' => 'woocommerce_task_list_hidden',
);
/**
@ -87,8 +89,16 @@ class Install {
continue;
}
if ( '1' === $old_option_value ) {
$old_option_value = 'yes';
} elseif ( '0' === $old_option_value ) {
$old_option_value = 'no';
}
update_option( $new_option, $old_option_value );
delete_option( $old_option );
if ( $new_option !== $old_option ) {
delete_option( $old_option );
}
}
}