Rename Inbox -> Activity from the activity header (https://github.com/woocommerce/woocommerce-admin/pull/7879)

* Add flag icon

* Rename Inbox to Activity

* Add changelog

* Update changelog
This commit is contained in:
Moon 2021-11-16 21:56:25 -08:00 committed by GitHub
parent db030bb938
commit 2e1473a25e
4 changed files with 42 additions and 15 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: Update
Rename Inbox to Activity from the activity header #7879

View File

@ -0,0 +1,28 @@
export const IconFlag = () => (
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<mask
id="mask0_2915:6733"
maskUnits="userSpaceOnUse"
x="4"
y="3"
width="16"
height="18"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M4.5 3.5H13.5L13.9 5.5H19.5V15.5H12.5L12.1 13.5H6.5V20.5H4.5V3.5ZM12.26 7.5L11.86 5.5H6.5V11.5H13.74L14.14 13.5H17.5V7.5H12.26Z"
fill="white"
/>
</mask>
<g mask="url(#mask0_2915:6733)">
<rect width="24" height="24" fill="#50575E" />
</g>
</svg>
);

View File

@ -5,12 +5,7 @@ import { __ } from '@wordpress/i18n';
import { lazy, useState } from '@wordpress/element';
import { useDispatch, useSelect } from '@wordpress/data';
import { uniqueId, find } from 'lodash';
import {
Icon,
help as helpIcon,
inbox as inboxIcon,
external,
} from '@wordpress/icons';
import { Icon, help as helpIcon, external } from '@wordpress/icons';
import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
import { H, Section } from '@woocommerce/components';
import {
@ -21,7 +16,6 @@ import {
import { getHistory, getNewPath } from '@woocommerce/navigation';
import { recordEvent } from '@woocommerce/tracks';
import { useSlot } from '@woocommerce/experimental';
/**
* Internal dependencies
*/
@ -30,6 +24,7 @@ import { isNotesPanelVisible } from './unread-indicators';
import { isWCAdmin } from '../../dashboard/utils';
import { Tabs } from './tabs';
import { SetupProgress } from './setup-progress';
import { IconFlag } from './icon-flag';
import { DisplayOptions } from './display-options';
import { HighlightTooltip } from './highlight-tooltip';
import { Panel } from './panel';
@ -224,10 +219,10 @@ export const ActivityPanel = ( { isEmbedded, query, userPreferencesData } ) => {
// @todo Pull in dynamic unread status/count
const getTabs = () => {
const inbox = {
name: 'inbox',
title: __( 'Inbox', 'woocommerce-admin' ),
icon: <Icon icon={ inboxIcon } />,
const activity = {
name: 'activity',
title: __( 'Activity', 'woocommerce-admin' ),
icon: <IconFlag />,
unread: hasUnreadNotes || hasAbbreviatedNotifications,
visible:
( isEmbedded || ! isHomescreen() ) && ! isPerformingSetupTask(),
@ -300,7 +295,7 @@ export const ActivityPanel = ( { isEmbedded, query, userPreferencesData } ) => {
},
};
return [ inbox, setup, previewSite, displayOptions, help ].filter(
return [ activity, setup, previewSite, displayOptions, help ].filter(
( tab ) => tab.visible
);
};
@ -309,7 +304,7 @@ export const ActivityPanel = ( { isEmbedded, query, userPreferencesData } ) => {
const { task } = query;
switch ( tab ) {
case 'inbox':
case 'activity':
return (
<InboxPanel
hasAbbreviatedNotifications={

View File

@ -70,7 +70,7 @@ describe( 'Activity Panel', () => {
it( 'should render inbox tab on embedded pages', () => {
render( <ActivityPanel isEmbedded query={ {} } /> );
expect( screen.getByText( 'Inbox' ) ).toBeDefined();
expect( screen.getByText( 'Activity' ) ).toBeDefined();
} );
it( 'should render inbox tab if not on home screen', () => {
@ -78,7 +78,7 @@ describe( 'Activity Panel', () => {
<ActivityPanel query={ { page: 'wc-admin', path: '/customers' } } />
);
expect( screen.getByText( 'Inbox' ) ).toBeDefined();
expect( screen.getByText( 'Activity' ) ).toBeDefined();
} );
it( 'should not render inbox tab on home screen', () => {