Activity Panel: Hide Reviews Panel when Reviews are Disabled (https://github.com/woocommerce/woocommerce-admin/pull/1852)

This commit is contained in:
Albert Juhé Lluveras 2019-03-20 11:24:12 +01:00 committed by GitHub
parent b6b00848c0
commit 2f20720927
2 changed files with 10 additions and 7 deletions

View File

@ -112,13 +112,15 @@ class ActivityPanel extends Component {
icon: <Gridicon icon="clipboard" />,
unread: false,
},
{
'yes' === wcSettings.reviewsEnabled
? {
name: 'reviews',
title: __( 'Reviews', 'woocommerce-admin' ),
icon: <Gridicon icon="star" />,
unread: false,
},
];
}
: null,
].filter( Boolean );
}
getPanelContent( tab ) {

View File

@ -195,6 +195,7 @@ function wc_admin_print_script_settings() {
),
'currentUserData' => $current_user_data,
'alertCount' => WC_Admin_Notes::get_notes_count( 'error,update', 'unactioned' ),
'reviewsEnabled' => get_option( 'woocommerce_enable_reviews' ),
);
$settings = wc_admin_add_custom_settings( $settings );