Close activity panel tabs by default and track (https://github.com/woocommerce/woocommerce-admin/pull/6566)
* Close activity panels by default and track shown * Add task list shown data to tracks * Add changelog and testing instructions * Fire the panel tracks again when the task list is hidden
This commit is contained in:
parent
be7d28d4bc
commit
4d445350ea
|
@ -2,6 +2,15 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
### Close activity panel tabs by default and track #6566
|
||||
|
||||
1. Open your browser console and enter `localStorage.setItem( 'debug', 'wc-admin:tracks' );`. Make sure the "Verbose" is selected under the levels shown.
|
||||
2. With the task list enabled, navigate to the homescreen.
|
||||
3. Check that the `wcadmin_activity_panel_visible_panels` event is shown with `taskList: true` in its data.
|
||||
4. Hide the task list.
|
||||
5. Note that `wcadmin_activity_panel_visible_panels` event is shown with visible activity panels.
|
||||
6. After refreshing, make sure that the "Orders" activity panel is closed by default.
|
||||
|
||||
### Update undefined task name properties for help panel tracks #6565
|
||||
|
||||
1. Enter `localStorage.setItem( 'debug', 'wc-admin:*' );` into your console. Leave your console open.
|
||||
|
|
|
@ -12,6 +12,8 @@ import {
|
|||
} from '@wordpress/components';
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
import { OPTIONS_STORE_NAME } from '@woocommerce/data';
|
||||
import { recordEvent } from '@woocommerce/tracks';
|
||||
import { useEffect } from '@wordpress/element';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
@ -52,6 +54,17 @@ export const ActivityPanel = () => {
|
|||
|
||||
const panels = getAllPanels( panelsData );
|
||||
|
||||
useEffect( () => {
|
||||
const visiblePanels = panels.reduce(
|
||||
( acc, panel ) => {
|
||||
acc[ panel.id ] = true;
|
||||
return acc;
|
||||
},
|
||||
{ taskList: panelsData.isTaskListHidden !== 'yes' }
|
||||
);
|
||||
recordEvent( 'activity_panel_visible_panels', visiblePanels );
|
||||
}, [ panelsData.isTaskListHidden ] );
|
||||
|
||||
if ( panels.length === 0 ) {
|
||||
return null;
|
||||
}
|
||||
|
@ -86,6 +99,15 @@ export const ActivityPanel = () => {
|
|||
initialOpen={ initialOpen }
|
||||
collapsible={ collapsible }
|
||||
disabled={ ! collapsible }
|
||||
onToggle={ ( isOpen ) => {
|
||||
if ( ! isOpen ) {
|
||||
return;
|
||||
}
|
||||
|
||||
recordEvent( 'activity_panel_open', {
|
||||
tab: id,
|
||||
} );
|
||||
} }
|
||||
>
|
||||
<PanelRow>{ panel }</PanelRow>
|
||||
</PanelBody>
|
||||
|
|
|
@ -31,7 +31,7 @@ export function getAllPanels( {
|
|||
count: countUnreadOrders,
|
||||
collapsible: true,
|
||||
id: 'orders-panel',
|
||||
initialOpen: true,
|
||||
initialOpen: false,
|
||||
panel: (
|
||||
<OrdersPanel
|
||||
countUnreadOrders={ countUnreadOrders }
|
||||
|
|
|
@ -75,6 +75,7 @@ Release and roadmap notes are available on the [WooCommerce Developers Blog](htt
|
|||
|
||||
== Unreleased ==
|
||||
|
||||
- Dev: Close activity panel tabs by default and track #6566
|
||||
- Dev: Update undefined task name properties for help panel tracks #6565
|
||||
- Fix: Allow the manager role to query certain options #6577
|
||||
- Fix: Fix hidden menu title on smaller screens #6562
|
||||
|
|
Loading…
Reference in New Issue