Commit Graph

78 Commits

Author SHA1 Message Date
Joshua T Flowers b7379def1b Format todo comments to match WC Core format (https://github.com/woocommerce/woocommerce-admin/pull/1474)
* Format todo comments to match WC Core format

* Remove variations todo comment
2019-02-06 14:41:53 +08:00
Joshua T Flowers 2c1f8c17c7 Fix incorrect label async request paths (https://github.com/woocommerce/woocommerce-admin/pull/1447) 2019-02-04 10:50:22 +08:00
Justin Shreve 53a6e49874 Finish cleaning up client/store. (https://github.com/woocommerce/woocommerce-admin/pull/1403) 2019-01-30 02:22:10 -05:00
Timmy Crawford 10c6016d4c Update usage of lib/number to @woocommerce/number (https://github.com/woocommerce/woocommerce-admin/pull/1400)
* Remove usage of lib/number

* Remove formatNumber usage when currency is used.

* Add wc-number as a dependency of wc-currency.

* Add locutus as a dev dependency.

* Add number to test helper.
2019-01-29 08:48:46 -08:00
Albert Juhé Lluveras 95c21e0cc3 Move 'getLabels' functions into lib/async-requests (https://github.com/woocommerce/woocommerce-admin/pull/1379)
* Move labels loading logic into a lib

* Avoid making API calls when displaying Order labels

* Move lib/labels into lib/async-requests

* Rename 'getCustomerLabel' to 'getCustomerLabels'
2019-01-24 10:35:27 +01:00
Justin Shreve 01b96ebea5 Hook up performance indicators to the REST API 2019-01-18 08:19:19 -05:00
Jeff Stieler 4fabbee20f numberFormat(): add test for new non-number precision value logic. 2019-01-17 16:28:00 -07:00
Jeff Stieler 2ad5922f1f Simplify precision preservation logic in numberFormat().
Props @Aljullu.
2019-01-17 16:25:44 -07:00
Jeff Stieler 858ec82e8c Rework numberFormat() to maintain decimal precision by default. 2019-01-16 18:41:15 -07:00
Jeff Stieler 78e1be139f Refactor numberFormat() to use the store settings for precision, decimal separator, and thousand separator. 2019-01-16 17:32:12 -07:00
Kelly Dwan 2a9cb6509b Build: Move components to packages dir (https://github.com/woocommerce/woocommerce-admin/pull/804)
* Move components to packages folder

* Update documentation generator to handle packages/components and client/components

* Update component locations

* Update CSS build process

* Remove react-dates css, this is already included by gutenberg

* Fix CSS style - single quotes

* Fix incorrect imports

* Update package-lock with new dependencies

* Update component locations for devdocs

* Fix location of tests
2018-11-15 13:16:23 -05:00
Jonathan Belcher c102e78523 Creates a helper function to get selected chart (https://github.com/woocommerce/woocommerce-admin/pull/794)
* Creates a helper function to get selected chart

* remove console log

* Make sure charts is never empty

* Clarify docs
2018-11-07 12:19:59 -05:00
Kelly Dwan 8af82f3dee Build: Move `lib/csv` to packages (https://github.com/woocommerce/woocommerce-admin/pull/756)
* Move CSV to packages

* Update CSV imports

* Add some basic usage documentation

* Add csv lib to the enqueued assets

* Change name to `csv-export`

* Update webpack build process to allow for package names with dashes

* Fix capitalization

* Update readme with docs extracted from jsdoc

* Fix merge conflict commit 😣

* Check that generateCSVFileName is called with correct params
2018-11-06 16:53:22 -05:00
Paul Sealock 50e635e716 Add Variations autocompleter 2018-11-05 17:43:59 -05:00
Kelly Dwan d27cb26ef7 Build: Move `lib/nav-utils` and `lib/history` to `@woocommerce/navigation` (https://github.com/woocommerce/woocommerce-admin/pull/763)
* Move nav-utils and history to new package

* Update config to build and use new navigation package

* Update all imports to use new navigation package

* Remove unnecessary README

* Update nav-utils path
2018-11-05 16:02:04 -05:00
Albert Juhé Lluveras 70e7e14e7a Persist time queries when clicking on breadcrumbs links (https://github.com/woocommerce/woocommerce-admin/pull/759)
* Make breadcrumbs links persist date queries

* Add tests to getTimeRelatedQuery() when query parameter not set

* Add comment explanation about navUtils self-import
2018-11-02 22:38:16 +01:00
Kelly Dwan c29043a3bc Switch to using `@wordpress/viewport` for responsive screen layouts (https://github.com/woocommerce/woocommerce-admin/pull/761)
* Switch to Gutenberg viewport package

* Switch CSS breakpoints to core-supported values

* Fix double-calendar logic
2018-11-02 15:20:11 -04:00
Kelly Dwan f62537fc17 Try: Add Lerna to split out utility packages (https://github.com/woocommerce/woocommerce-admin/pull/678)
* Add lerna & GB package-building script

* Move currency library to lerna module

* Update lerna config

* Add publish commands

* Add currency as an faux-external module

* Add separate command to build just core files

* Update dependency path

* Update build script to build all packages into `dist`

* Add packages to the jest test setup

* Move date library to packages

* Update imports to use @woocommerce/date

* Output wcSettings definition before any scripts are output

Fixes issues where wc-dates lib relies on settings object

* Add the build step into travis

* Update jest config to dynamically get package paths

* Update package postcss config to match wc-admin’s main config

* Add combined watch scripts for package+app, add a `clean` command to clean up old build files

* Ignore PHPCS error (leave todo message to fix)

* Concat files with a space, fix issue where all files join in one continuous string and fail the check
2018-10-30 14:57:48 -04:00
David Levin 6b72b004ac refactoring x-axis ticks (https://github.com/woocommerce/woocommerce-admin/pull/685)
* conflict resolution

* updated weekly interval formats

* updated week format to include day
2018-10-30 09:54:49 -07:00
Albert Juhé Lluveras 0caed9a28a Create QUERY_DEFAULTS object with default values for queries (https://github.com/woocommerce/woocommerce-admin/pull/686) 2018-10-26 10:19:39 +02:00
Robert Elliott 54ffd1bd0a Merge pull request woocommerce/woocommerce-admin#638 from woocommerce/add/charts-full-year
Chart: updated intervals to use the full year
2018-10-25 12:23:32 +02:00
Albert Juhé Lluveras 1c819740f4 Persist date params in Products table link (https://github.com/woocommerce/woocommerce-admin/pull/671) 2018-10-25 12:07:30 +02:00
Robert Elliott e21a6022e7 updated lib/date iintervals to use the full year incl. centruy, 2018-10-25 11:12:27 +02:00
Albert Juhé Lluveras 7be34b3f37 Move Download table logic inside the TableCard component (https://github.com/woocommerce/woocommerce-admin/pull/652)
* Move Download table logic inside the TableCard component

* Make title lowercase inside generateCSVFileName

* Update JSDoc comment
2018-10-24 09:48:20 +02:00
Paul Sealock 240599c095 Persist date related parameters on report navigation 2018-10-24 12:16:35 +13:00
Timmy Crawford f8d70506a1 Update/track usage logic (https://github.com/woocommerce/woocommerce-admin/pull/561)
* Tracks: Don't track if Jetpack is not present or in dev env.

* Check for JETPACK__VERSION instead.

* Fix linting errors

* Yoda conditions use you must
2018-10-22 08:56:02 -07:00
Allen Snook 9638b063a0 Add unit test for sanitize html 2018-10-19 14:21:54 -07:00
Allen Snook b8a83bf1e1 Allow selected tags through to the note content 2018-10-19 14:21:54 -07:00
Albert Juhé Lluveras 3982ebc32e Create appendTimestamp() utils function (https://github.com/woocommerce/woocommerce-admin/pull/542)
* appendTimestamp() utils function

* Make appendTimestamp() to throw and error if timeOfDay is not a valid value
2018-10-17 18:01:58 +02:00
Albert Juhé Lluveras 36c37afe49 Hide day from X axis when the time period is too long (https://github.com/woocommerce/woocommerce-admin/pull/525)
* Refactor getXTicks

* Hide day from X axis when the time period is too long

* Fix X axis labels misaligned in charts

* Align axis ticks to the first day of the month when not displaying the day number

* Store threshold in a variable

* Add missing JSDoc

* Fix charts hanging when the number of days selected was exactly 180

* Improve function naming

* Fix dayTicksThreshold mismatch between date format and chart layout
2018-10-17 15:44:43 +02:00
Albert Juhé Lluveras 9623898acd Add Orders table (https://github.com/woocommerce/woocommerce-admin/pull/493)
* Create Orders table

* Remove getOrderIds selector

* Create an OrdersReportTable component

* Alphabetically order extracted props

* Fix JS error for missing coupon properties

* Add TODO comment for missing customer type

* Add calculation for net revenue

* Align all table cells but identifier to the right

* Remove temporary text

* Improve cell link inline CSS

* Count several purchases of the same product as items sold

* Add TODO message to coupon link

* Add Download to Orders table

* Don't use camelCase for table column keys

* Cleanup

* Make products and coupons columns non-sortable

* Create renderList method to simplify products/coupons list creation

* Display correct currency for each order

* RTL table fixes

* Fix: products and coupons columns showing 'false' in CSV download

* Minor fixes

* Rename 'isIdentifier' with 'isLeftAligned' in table columns

* Remove toggleStatus method
2018-10-11 10:30:51 +02:00
Justin Shreve 5a6749b15c Make tabular data independent of chart interval (https://github.com/woocommerce/woocommerce-admin/pull/483)
* Make Tabular data independent of Chart Interval

* Make table and summary numbers placeholders independent of chart
2018-10-10 09:57:16 -04:00
Albert Juhé Lluveras 31289e8c82 Transpose and update format of chart tooltip dates (https://github.com/woocommerce/woocommerce-admin/pull/467)
* Fix dates transposed in revenue chart

* Update date format in revenue chart tooltip labels

* Load point label date formats from lib/date

* Pass point label format as a prop to the chart component
2018-09-24 13:11:18 +02:00
Paul Sealock a299aad167 Coupons: add config, autocompleter 2018-09-21 11:54:22 +12:00
Albert Juhé Lluveras a18a9cd89a Update tooltip title and labels in standard graphs (https://github.com/woocommerce/woocommerce-admin/pull/458)
* Allow adding a label for each specific point in a chart

* Update test fixtures

* Update README with new data format

* Simplify getPreviousDate function code

* Update tooltip dates format

* Add new prop to charts 'tooltipTitle' to override the date tooltip title

* Fix totals not being calculated in charts legend

* Fix JS error when hiding lines in chart

* Fix a couple of issues with chart README

* Add quotes around prop names

* Remove unused variable

* Remove colon after tooltip label
2018-09-20 16:28:22 +02:00
Kelly Dwan 7ecd6d160b Add mock product report, helper functions (https://github.com/woocommerce/woocommerce-admin/pull/387)
* Add a mock table to Products report

* Move onQueryChange to a helper function in nav-utils

* Add function to parse out ID lists from a query parameter

* Add a default value

Prevents undefined query params from erroring on the `.split`

* Use numberFormat rather than forcing type conversion, fix table header name

* Fix duplicate export caused by merge conflict
2018-09-17 12:50:20 -04:00
Timmy Crawford e541d4032f Tracks: Add basic util methods for tracks. (https://github.com/woocommerce/woocommerce-admin/pull/397) 2018-09-17 09:42:04 -07:00
Robert Elliott 45089c1602 2nd x-axis format 2018-09-14 11:53:54 +02:00
Robert Elliott b276750955 html encoder for currency symbols 2018-09-12 13:16:44 +02:00
Paul Sealock 925140fc78 Merge pull request woocommerce/woocommerce-admin#349 from woocommerce/add/advanced-filters-url-support
Advanced Filters: Add url support
2018-09-12 14:31:13 +12:00
Justin Shreve baf44d030f Add interval handling to the revenue report. 2018-09-12 12:28:25 +12:00
Paul Sealock 3e7bed27cc Search: move selected from state to props 2018-09-11 16:18:10 +12:00
Robert Elliott 9e4062c51f set d3 local and update number format 2018-09-07 14:39:31 +02:00
Justin Shreve 4e2661f3f1 Connect the revenue report to the api (https://github.com/woocommerce/woocommerce-admin/pull/316) 2018-09-03 11:25:38 -04:00
Albert Juhé Lluveras da2317f154 Add CSV download to Revenue table (https://github.com/woocommerce/woocommerce-admin/pull/326)
* Add CSV download to Revenue table

* Set revelant file name for revenue CSV file download

* Add package-lock.json

* Move CSV download logic inside /lib/

* Remove 'totals' from table CSV

* Check parameters are arrays in generateCSVDataFromTable

* Add @TODO comment about downloading large sets of data
2018-09-03 09:54:45 +02:00
Kelly Dwan 7711da472a Docs Project: Component cleanup (https://github.com/woocommerce/woocommerce-admin/pull/334)
* Validate component with helper function

Fixes compat issue with react-docgen

* Switch all components to default exports

This ensures we can read all components for documentation generation (plus, standardizing is good)

* inValidDays -> invalidDays

Invalid is a single word, so by capitalization rules the V should be lowercase

* Export child-components of Chart

* Fix table exports
2018-08-31 13:19:13 -04:00
Kelly Dwan f36d89cfaf Add path & query back to filter props (https://github.com/woocommerce/woocommerce-admin/pull/308) 2018-08-21 15:03:20 -04:00
Justin Shreve 4397ce8271 Add Revenue Report API/data-layer (https://github.com/woocommerce/woocommerce-admin/pull/293)
* Adds data layer functions for fetching the revenue report API

* Handle PR feedback: jsDoc updates, create query string util function, api namespace constat.

* Serialize query args in a consistent order
2018-08-15 09:44:49 -04:00
Kelly Dwan c16be4d061 Add ReportFilters Component
Add new function to merge query params into a given path

Add a new ReportFilter component, which extracts the date picker & filter picker

Add basic framework for product search

Add new AdvancedFilter to filter options

Remove duplicate CSS

Use library function for merging new query+path

Move filters folder out of reports

Use filter constant

Add README

Add path & query helper functions

Move filters into component folder

Switch to getPath/getQuery helpers

Update classes & merge styles

Remove query/path from READMEs

Add a readme to nav-utils
2018-08-15 11:15:30 +12:00
Timmy Crawford ac3e83590a Add tests for numberFormat 2018-08-09 11:50:56 -07:00