diff --git a/plugins/woocommerce-admin/.babelrc b/plugins/woocommerce-admin/.babelrc index 0cd6f4c17fe..34ede714513 100644 --- a/plugins/woocommerce-admin/.babelrc +++ b/plugins/woocommerce-admin/.babelrc @@ -11,7 +11,7 @@ [ "@wordpress/babel-plugin-makepot", { - "output": "languages/woo-dash.pot" + "output": "languages/wc-admin.pot" } ], "transform-async-generator-functions" diff --git a/plugins/woocommerce-admin/Gruntfile.js b/plugins/woocommerce-admin/Gruntfile.js index 0f87ea9ce8b..6febcc51e86 100755 --- a/plugins/woocommerce-admin/Gruntfile.js +++ b/plugins/woocommerce-admin/Gruntfile.js @@ -1,3 +1,4 @@ +/* eslint-disable */ module.exports = function( grunt ) { 'use strict'; @@ -9,7 +10,7 @@ module.exports = function( grunt ) { addtextdomain: { options: { - textdomain: 'woo-dash', + textdomain: 'wc-admin', }, update_all_domains: { options: { @@ -24,8 +25,8 @@ module.exports = function( grunt ) { options: { domainPath: '/languages', exclude: [ '\.git/*', 'bin/*', 'node_modules/*', 'tests/*' ], - mainFile: 'woo-dash.php', - potFilename: 'woo-dash.pot', + mainFile: 'wc-admin.php', + potFilename: 'wc-admin.pot', potHeaders: { poedit: true, 'x-poedit-keywordslist': true diff --git a/plugins/woocommerce-admin/README.md b/plugins/woocommerce-admin/README.md index 09bce607f75..a1fea3753f4 100644 --- a/plugins/woocommerce-admin/README.md +++ b/plugins/woocommerce-admin/README.md @@ -1,10 +1,10 @@ -# WooCommerce Dashboard +# WooCommerce Admin -This is a feature plugin for a modern, javascript-driven dashboard for WooCommerce. +This is a feature plugin for a modern, javascript-driven WooCommerce Admin experience. ## Prerequisites -[Gutenberg](https://wordpress.org/plugins/gutenberg/) and [WooCommerce](https://wordpress.org/plugins/woocommerce/) should be installed prior to activating the WooCommerce Dashboard feature plugin. +[Gutenberg](https://wordpress.org/plugins/gutenberg/) and [WooCommerce](https://wordpress.org/plugins/woocommerce/) should be installed prior to activating the WooCommerce Admin feature plugin. You also need v3 of the WooCommerce REST API via [wc-api-dev](https://github.com/woocommerce/wc-api-dev/) or [the feature branch](https://github.com/woocommerce/woocommerce/tree/feature/rest-api-v3). For better debugging, it's also recommended you add `define( 'SCRIPT_DEBUG', true );` to your wp-config. This will load the unminified version of all libraries, and specifically the development build of React. diff --git a/plugins/woocommerce-admin/client/analytics/index.js b/plugins/woocommerce-admin/client/analytics/index.js index 8b27f15034a..9948253a4a2 100644 --- a/plugins/woocommerce-admin/client/analytics/index.js +++ b/plugins/woocommerce-admin/client/analytics/index.js @@ -17,7 +17,7 @@ export default class extends Component { const { query, path } = this.props; return ( -
+

Example single line button - default width 100% of container

diff --git a/plugins/woocommerce-admin/client/analytics/report/example.js b/plugins/woocommerce-admin/client/analytics/report/example.js index 0afa4518f70..c75c5e94da4 100644 --- a/plugins/woocommerce-admin/client/analytics/report/example.js +++ b/plugins/woocommerce-admin/client/analytics/report/example.js @@ -17,24 +17,24 @@ export default class extends Component {
- - + + ); diff --git a/plugins/woocommerce-admin/client/analytics/report/revenue.js b/plugins/woocommerce-admin/client/analytics/report/revenue.js index 62a8ea3093d..bcc596b8677 100644 --- a/plugins/woocommerce-admin/client/analytics/report/revenue.js +++ b/plugins/woocommerce-admin/client/analytics/report/revenue.js @@ -97,22 +97,22 @@ class RevenueReport extends Component { const rows = this.getRowsContent( intervalStats ); const headers = [ - __( 'Date', 'woo-dash' ), - __( 'Orders', 'woo-dash' ), - __( 'Gross Revenue', 'woo-dash' ), - __( 'Refunds', 'woo-dash' ), - __( 'Coupons', 'woo-dash' ), - __( 'Taxes', 'woo-dash' ), - __( 'Shipping', 'woo-dash' ), - __( 'Net Revenue', 'woo-dash' ), + __( 'Date', 'wc-admin' ), + __( 'Orders', 'wc-admin' ), + __( 'Gross Revenue', 'wc-admin' ), + __( 'Refunds', 'wc-admin' ), + __( 'Coupons', 'wc-admin' ), + __( 'Taxes', 'wc-admin' ), + __( 'Shipping', 'wc-admin' ), + __( 'Net Revenue', 'wc-admin' ), ]; return (
@@ -120,23 +120,23 @@ class RevenueReport extends Component { diff --git a/plugins/woocommerce-admin/client/components/calendar/index.js b/plugins/woocommerce-admin/client/components/calendar/index.js index 7c0cbe0f86e..cc004fad8d4 100644 --- a/plugins/woocommerce-admin/client/components/calendar/index.js +++ b/plugins/woocommerce-admin/client/components/calendar/index.js @@ -28,7 +28,7 @@ const END_DATE = 'endDate'; // 782px is the width designated by Gutenberg's `` component. // * https://github.com/WordPress/gutenberg/blob/c8f8806d4465a83c1a0bc62d5c61377b56fa7214/components/popover/utils.js#L6 const isMobileViewport = () => window.innerWidth < 782; -const shortDateFormat = __( 'MM/DD/YYYY', 'woo-dash' ); +const shortDateFormat = __( 'MM/DD/YYYY', 'wc-admin' ); class DateRange extends Component { constructor( props ) { @@ -103,7 +103,7 @@ class DateRange extends Component { value={ afterText } type="text" onChange={ partial( this.onInputChange, 'after' ) } - aria-label={ __( 'Start Date', 'woo-dash' ) } + aria-label={ __( 'Start Date', 'wc-admin' ) } id="after-date-string" aria-describedby="after-date-string-message" /> @@ -111,17 +111,17 @@ class DateRange extends Component { { sprintf( __( "Date input describing a selected date range's start date in format %s", - 'woo-dash' + 'wc-admin' ), shortDateFormat ) }

- { __( 'to', 'woo-dash' ) } + { __( 'to', 'wc-admin' ) } @@ -129,7 +129,7 @@ class DateRange extends Component { { sprintf( __( "Date input describing a selected date range's end date in format %s", - 'woo-dash' + 'wc-admin' ), shortDateFormat ) } diff --git a/plugins/woocommerce-admin/client/components/calendar/phrases.js b/plugins/woocommerce-admin/client/components/calendar/phrases.js index f8a022e2f5d..f74632751a5 100644 --- a/plugins/woocommerce-admin/client/components/calendar/phrases.js +++ b/plugins/woocommerce-admin/client/components/calendar/phrases.js @@ -5,36 +5,36 @@ import { __, sprintf } from '@wordpress/i18n'; export default { - calendarLabel: __( 'Calendar', 'woo-dash' ), - closeDatePicker: __( 'Close', 'woo-dash' ), - focusStartDate: __( 'Interact with the calendar and select start and end dates.', 'woo-dash' ), - clearDate: __( 'Clear Date', 'woo-dash' ), - clearDates: __( 'Clear Dates', 'woo-dash' ), - jumpToPrevMonth: __( 'Move backward to switch to the previous month.', 'woo-dash' ), - jumpToNextMonth: __( 'Move forward to switch to the next month.', 'woo-dash' ), - enterKey: __( 'Enter key', 'woo-dash' ), - leftArrowRightArrow: __( 'Right and left arrow keys', 'woo-dash' ), - upArrowDownArrow: __( 'up and down arrow keys', 'woo-dash' ), - pageUpPageDown: __( 'page up and page down keys', 'woo-dash' ), - homeEnd: __( 'Home and end keys', 'woo-dash' ), - escape: __( 'Escape key', 'woo-dash' ), - questionMark: __( 'Question mark', 'woo-dash' ), - selectFocusedDate: __( 'Select the date in focus.', 'woo-dash' ), - moveFocusByOneDay: __( 'Move backward (left) and forward (right) by one day.', 'woo-dash' ), - moveFocusByOneWeek: __( 'Move backward (up) and forward (down) by one week.', 'woo-dash' ), - moveFocusByOneMonth: __( 'Switch months.', 'woo-dash' ), - moveFocustoStartAndEndOfWeek: __( 'Go to the first or last day of a week.', 'woo-dash' ), - returnFocusToInput: __( 'Return to the date input field.', 'woo-dash' ), + calendarLabel: __( 'Calendar', 'wc-admin' ), + closeDatePicker: __( 'Close', 'wc-admin' ), + focusStartDate: __( 'Interact with the calendar and select start and end dates.', 'wc-admin' ), + clearDate: __( 'Clear Date', 'wc-admin' ), + clearDates: __( 'Clear Dates', 'wc-admin' ), + jumpToPrevMonth: __( 'Move backward to switch to the previous month.', 'wc-admin' ), + jumpToNextMonth: __( 'Move forward to switch to the next month.', 'wc-admin' ), + enterKey: __( 'Enter key', 'wc-admin' ), + leftArrowRightArrow: __( 'Right and left arrow keys', 'wc-admin' ), + upArrowDownArrow: __( 'up and down arrow keys', 'wc-admin' ), + pageUpPageDown: __( 'page up and page down keys', 'wc-admin' ), + homeEnd: __( 'Home and end keys', 'wc-admin' ), + escape: __( 'Escape key', 'wc-admin' ), + questionMark: __( 'Question mark', 'wc-admin' ), + selectFocusedDate: __( 'Select the date in focus.', 'wc-admin' ), + moveFocusByOneDay: __( 'Move backward (left) and forward (right) by one day.', 'wc-admin' ), + moveFocusByOneWeek: __( 'Move backward (up) and forward (down) by one week.', 'wc-admin' ), + moveFocusByOneMonth: __( 'Switch months.', 'wc-admin' ), + moveFocustoStartAndEndOfWeek: __( 'Go to the first or last day of a week.', 'wc-admin' ), + returnFocusToInput: __( 'Return to the date input field.', 'wc-admin' ), keyboardNavigationInstructions: __( `Press the down arrow key to interact with the calendar and select a date.`, - 'woo-dash' + 'wc-admin' ), chooseAvailableStartDate: ( { date } ) => - sprintf( __( 'Select %s as a start date.', 'woo-dash' ), date ), + sprintf( __( 'Select %s as a start date.', 'wc-admin' ), date ), chooseAvailableEndDate: ( { date } ) => - sprintf( __( 'Select %s as an end date.', 'woo-dash' ), date ), + sprintf( __( 'Select %s as an end date.', 'wc-admin' ), date ), chooseAvailableDate: ( { date } ) => date, - dateIsUnavailable: ( { date } ) => sprintf( __( '%s is not selectable.', 'woo-dash' ), date ), - dateIsSelected: ( { date } ) => sprintf( __( 'Selected. %s', 'woo-dash' ), date ), + dateIsUnavailable: ( { date } ) => sprintf( __( '%s is not selectable.', 'wc-admin' ), date ), + dateIsSelected: ( { date } ) => sprintf( __( 'Selected. %s', 'wc-admin' ), date ), }; diff --git a/plugins/woocommerce-admin/client/components/count/index.js b/plugins/woocommerce-admin/client/components/count/index.js index 8c49c534645..b37ecbd12d1 100644 --- a/plugins/woocommerce-admin/client/components/count/index.js +++ b/plugins/woocommerce-admin/client/components/count/index.js @@ -11,7 +11,7 @@ import './style.scss'; const Count = ( { count, label } ) => { if ( ! label ) { - label = sprintf( __( 'Total %d', 'woo-dash' ), count ); + label = sprintf( __( 'Total %d', 'wc-admin' ), count ); } return ( diff --git a/plugins/woocommerce-admin/client/components/date-picker/compare-periods.js b/plugins/woocommerce-admin/client/components/date-picker/compare-periods.js index 4ab81d501d7..e2d326ddd5a 100644 --- a/plugins/woocommerce-admin/client/components/date-picker/compare-periods.js +++ b/plugins/woocommerce-admin/client/components/date-picker/compare-periods.js @@ -12,8 +12,8 @@ import PropTypes from 'prop-types'; import SegmentedSelection from 'components/segmented-selection'; const compareValues = [ - { value: 'previous_period', label: __( 'Previous Period', 'woo-dash' ) }, - { value: 'previous_year', label: __( 'Previous Year', 'woo-dash' ) }, + { value: 'previous_period', label: __( 'Previous Period', 'wc-admin' ) }, + { value: 'previous_year', label: __( 'Previous Year', 'wc-admin' ) }, ]; class ComparePeriods extends Component { @@ -25,7 +25,7 @@ class ComparePeriods extends Component { selected={ compare } onSelect={ onSelect } name="compare" - legend={ __( 'compare to', 'woo-dash' ) } + legend={ __( 'compare to', 'wc-admin' ) } /> ); } diff --git a/plugins/woocommerce-admin/client/components/date-picker/content.js b/plugins/woocommerce-admin/client/components/date-picker/content.js index 22c63be0868..f24c3c1fc78 100644 --- a/plugins/woocommerce-admin/client/components/date-picker/content.js +++ b/plugins/woocommerce-admin/client/components/date-picker/content.js @@ -48,22 +48,22 @@ class DatePickerContent extends Component { return ( - { __( 'Select date range and comparison', 'woo-dash' ) } + { __( 'Select date range and comparison', 'wc-admin' ) }
- { __( 'select a date range', 'woo-dash' ) } + { __( 'select a date range', 'wc-admin' ) } ) } - { __( 'compare to', 'woo-dash' ) } + { __( 'compare to', 'wc-admin' ) } { isValidSelection( selectedTab ) ? ( - { __( 'Update', 'woo-dash' ) } + { __( 'Update', 'wc-admin' ) } ) : ( ) } diff --git a/plugins/woocommerce-admin/client/components/date-picker/index.js b/plugins/woocommerce-admin/client/components/date-picker/index.js index 774eb2be43d..251a5965c69 100644 --- a/plugins/woocommerce-admin/client/components/date-picker/index.js +++ b/plugins/woocommerce-admin/client/components/date-picker/index.js @@ -72,7 +72,7 @@ class DatePicker extends Component { const { primary, secondary } = getCurrentDates( queryWithDefaults ); return [ `${ primary.label } (${ primary.range })`, - `${ __( 'vs.', 'woo-dash' ) } ${ secondary.label } (${ secondary.range })`, + `${ __( 'vs.', 'wc-admin' ) } ${ secondary.label } (${ secondary.range })`, ]; } @@ -88,7 +88,7 @@ class DatePicker extends Component { const { period, compare, after, before } = this.state; return ( -

{ __( 'Date Range', 'woo-dash' ) }:

+

{ __( 'Date Range', 'wc-admin' ) }:

); } diff --git a/plugins/woocommerce-admin/client/components/higher-order/use-filters/index.js b/plugins/woocommerce-admin/client/components/higher-order/use-filters/index.js index 419d2b9d22d..eec65bb1120 100644 --- a/plugins/woocommerce-admin/client/components/higher-order/use-filters/index.js +++ b/plugins/woocommerce-admin/client/components/higher-order/use-filters/index.js @@ -1,11 +1,8 @@ +/** @format */ /** * External dependencies */ import { debounce, isArray, uniqueId } from 'lodash'; - -/** - * WordPress dependencies - */ import { Component } from '@wordpress/element'; import { addAction, removeAction } from '@wordpress/hooks'; @@ -30,7 +27,7 @@ export default function useFilters( hookName ) { super( props ); this.onHooksUpdated = this.onHooksUpdated.bind( this ); - this.namespace = uniqueId( 'woo-dash/use-filters/component-' ); + this.namespace = uniqueId( 'wc-admin/use-filters/component-' ); this.throttledForceUpdate = debounce( () => { this.forceUpdate(); }, ANIMATION_FRAME_PERIOD ); diff --git a/plugins/woocommerce-admin/client/components/link/index.js b/plugins/woocommerce-admin/client/components/link/index.js index 2dc8243b373..1c11ea2d366 100644 --- a/plugins/woocommerce-admin/client/components/link/index.js +++ b/plugins/woocommerce-admin/client/components/link/index.js @@ -22,7 +22,7 @@ class Link extends Component { ); } - const path = wpAdmin ? getAdminLink( to ) : getAdminLink( 'admin.php?page=woodash#' + to ); + const path = wpAdmin ? getAdminLink( to ) : getAdminLink( 'admin.php?page=wcadmin#' + to ); return ( { children } diff --git a/plugins/woocommerce-admin/client/components/pagination/index.js b/plugins/woocommerce-admin/client/components/pagination/index.js index c2976d02851..5fc0694714e 100644 --- a/plugins/woocommerce-admin/client/components/pagination/index.js +++ b/plugins/woocommerce-admin/client/components/pagination/index.js @@ -109,7 +109,7 @@ class Pagination extends Component { role="status" aria-live="polite" > - { sprintf( __( 'Page %d of %d', 'woo-dash' ), page, this.pageCount ) } + { sprintf( __( 'Page %d of %d', 'wc-admin' ), page, this.pageCount ) }
1 ) } onClick={ this.previousPage } icon="arrow-left-alt2" - label={ __( 'Previous Page', 'woo-dash' ) } + label={ __( 'Previous Page', 'wc-admin' ) } size={ 18 } />
@@ -143,7 +143,7 @@ class Pagination extends Component { return (