Commit Graph

31 Commits

Author SHA1 Message Date
Joshua T Flowers 4a6b48dd92 Change link focus color in table links (https://github.com/woocommerce/woocommerce-admin/pull/570) 2018-10-18 11:44:26 -04:00
Paul Sealock 615c369ac8 Table: add missing CSS bracket 2018-10-18 15:58:39 +13:00
Joshua T Flowers d611817fc7 Change componentDidUnmount to componentWillUnmount (https://github.com/woocommerce/woocommerce-admin/pull/563) 2018-10-17 19:12:04 -04:00
Joshua T Flowers 34d7944988 Modify table download button styling (https://github.com/woocommerce/woocommerce-admin/pull/560) 2018-10-17 19:01:57 -04:00
Joshua T Flowers 5deecbb6ba Add table shadow element to tables (https://github.com/woocommerce/woocommerce-admin/pull/546)
* Add table shadow element to tables

* Update table shadow bg color

* Remove redundant styles

* Remove unused ref

* Update shadow relative to container table body

Use the container body so we don't have to update the transform on scroll for the table shadow.  Prevents jankiness on low-end devices

* Move table shadow to pseudo element
2018-10-17 17:56:09 -04:00
Joshua T Flowers 85e6aad4a3 Reposition chevron icon for first column in tables (https://github.com/woocommerce/woocommerce-admin/pull/549) 2018-10-17 11:42:33 -04:00
Albert Juhé Lluveras 17e9f151be Create ViewMoreList component (https://github.com/woocommerce/woocommerce-admin/pull/503)
* Create ViewMoreList component

* Update Tag component with the new style and popover

* Display number of times an item was bought in the Orders table (2x, 1x, ...)

* Refactor ViewMoreList so the elements to display in the list and the popover are different props

* Cleanup

* Fix CSV values for products and coupons

* Minor fixes

* Rename ViewMoreList prop from 'popoverItems' to 'items'

* Cleanup props

* Add ViewMoreList to devdocs examples

* Order Tag props alphabetically

* Move withState to export line so it doesn't break docs generation

* Rename 'is-not-unique' class name to 'is-inline'

* Fix missing comma

* Remove margin from popover list

* Use pseudo-selector to replace 'is-inline' class in cell links
2018-10-12 23:29:25 +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
Kelly Dwan dc5967197d Add a default value to `labels` (https://github.com/woocommerce/woocommerce-admin/pull/500)
Fixes an error where labels is undefined if nothing is passed through
2018-10-10 10:59:22 -04:00
Kelly Dwan 1351997eef TableCard: Add search to table header (https://github.com/woocommerce/woocommerce-admin/pull/495)
* Add label override options to TableCard

* Add search input to the tableHeader

* Style search in table header
2018-10-10 10:12:00 -04: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
Kelly Dwan 62276fb361 Add visual component docs from markdown examples (https://github.com/woocommerce/woocommerce-admin/pull/470)
* Remove content from README, leaving only the example

* Rename edited READMEs

* Add a devdocs page rendering from markdown example files

* Add more components to devdocs

* Add the rest of the component examples

* Add navigation to single components, show generated readme on single component view

* Style devdocs like calypso

* Split devdocs into two columns at “desktop” sizes

* Update segmented selection example

* Update link

* Add header to avoid notices error
2018-09-24 11:36:35 -04:00
Kelly Dwan f5dd2559db Documentation: Move topic READMEs into docs for discoverability (https://github.com/woocommerce/woocommerce-admin/pull/469)
* Move header/row documentation into the component, so it can be rendered in the external docs

* Move project READMEs into docs folder for exposure in docs site

* Regenerate docs, generate component folder sidebar with component list

* Update format of CSS docs
2018-09-24 11:22:14 -04:00
Kelly Dwan 1c6fe0e970 Compare Filter: Wrap up compare card functionality (https://github.com/woocommerce/woocommerce-admin/pull/431)
* Disable compare button if less than 2 items are selected

* Add a placeholder prop to the Search component

* Pass a placeholder label from filter configs for Search

* Add support for a label in Search

* Add Clear All link to reset comparison card

* Add a label when compare button is disabled

* Abstract the conditional tooltip/disabled button logic to a new component

* Add helpText as a customizable label

* Add icon to the search field

* Remove the parameter from query by passing in undefined
2018-09-19 13:16:52 -04:00
Kelly Dwan f2e0165d5f Component – Table: Add compare checkboxes (https://github.com/woocommerce/woocommerce-admin/pull/389)
* Switch to withInstanceId higher order component

* Add checkboxes to the rows in a TableCard, if a compareBy prop is set

* Add Compare button to update query param

* Populate the selected rows from the query parameter

* Update compare filter display & selected table rows when the query changes

* Skip displaying tags if the label is null/undefined

* Style table header with compare button, search placeholder

* Prevent setting just an ID list as the state, as this will wipe out already-fetched tag labels

* Update docs

* Shortcut out of fetching tag labels if the query is empty
2018-09-18 10:12:13 -04:00
Albert Juhé Lluveras 48ed6fa568 Make Top Selling Products table to have the same height in all states (https://github.com/woocommerce/woocommerce-admin/pull/394)
* Make table font-size accessible

* Make TopSellingProducts table load only five products

* Make empty message on TopSellingProducts table the same height than the table

* Update breaking test

* Use font-size mixin in table items/header
2018-09-13 11:05:26 +02:00
Justin Shreve f5479e1c18 Add loading indicators, error state, and EmptyContent to the revenue report. (#347, woocommerce/woocommerce-admin#348)
* Add loading indiciators for the revenue report.

* Improve accessibility, and fix up some documentation comments.

* Fix top border on mobile

* Add EmptyContent Component and revenue error/empty states. (https://github.com/woocommerce/woocommerce-admin/pull/348)

* Add EmptyContent Component and revenue error/empty states.

* Move relative image handling to ImageAsset, combine secondary and primary action rendering, add some missing isRequired proptypes, add empty error handling.

* Handle PR Feedback: Clean up button css, set a default for illustration, fix deprecation typo, some code cleanup.
2018-09-05 12:45:49 -04: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 e94ae40d4d Use native Array.isArray() instead of lodash function (https://github.com/woocommerce/woocommerce-admin/pull/346) 2018-09-03 17:09:09 +02:00
Kelly Dwan d36511479e Docs Project: Add documentation parser + inline documentation (https://github.com/woocommerce/woocommerce-admin/pull/336)
* Switch all components to default exports

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

* Add documentation to component file

* Fix table exports

* Move readme docs into inline docs

Includes updating new props, adding prop shapes

* Add doc-generation scripts to pull exported component docs into folder

* Remove key propType, causing react special-keys warning

* Fix proptype

* Update incorrect comment

* Remove template import, we can just use string concat

* Fix typo, update docs
2018-08-31 13:27:21 -04: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
Albert Juhé Lluveras 3dcb1339b3 Create TablePlaceholder component to be used when table contents are loading (https://github.com/woocommerce/woocommerce-admin/pull/338) 2018-08-31 16:43:25 +02:00
Kelly Dwan 0286bd9109 Apply scope only to the row headers (https://github.com/woocommerce/woocommerce-admin/pull/300) 2018-08-16 10:37:10 -04:00
Justin Shreve d4751e2c73 Fix Column Toggle Error (https://github.com/woocommerce/woocommerce-admin/pull/296)
* Fix column toggle error

* Use rows prop from props, preventing unnecessary re-rendering
2018-08-14 12:43:35 -04:00
Kelly Dwan ff8217165d Table: Update style to match design (https://github.com/woocommerce/woocommerce-admin/pull/289)
* Table: Add a hover state for rows

* Expand target area for table links to take over entire cell

* Add a purple link style for default links

* Increase contrast for links-on-hover-color

* Add “isNumeric” column identifier & right-align these cols
2018-08-13 11:25:32 -04:00
Kelly Dwan 4c2797d6cf Table: Add "required"/"sortable" meta to headers/columns (https://github.com/woocommerce/woocommerce-admin/pull/275)
* Switch headers to an object, use `header.label` to display title

* Change sort function to update a query param

* Clean up README

* Get the currently sorted column from the query

* Don’t allow toggling of required columns

* Add in direction-sorting (ascending/descending)

* Switch to aria-describedby so that the actual column name is read aloud

* Fix chevron orientation

* Handle hiding a sorted column

* Fall back to sorting by first item if no defaultSort col is set

* Fix arrow orientation again

* Update order_by to orderby to match wp_query param name
2018-08-06 13:01:41 -04:00
Kelly Dwan a4267202c5 Update TableCard component to handle toggling on/off specific columns (https://github.com/woocommerce/woocommerce-admin/pull/268) 2018-08-02 18:21:37 -04:00
Kelly Dwan 8141a9f66d Update/table component (https://github.com/woocommerce/woocommerce-admin/pull/251)
* Update mock data to reflect latest API format

* Update Table component to create a TableCard, TableSummary, and plain Table

Use the TableCard container to display mocked revenue data

* Add horizontal scroll only on the table itself

* Remove `sortable` prop, base column sortability on whether the `value` is true/false

Checking against a strict false should prevent any real 0 or ‘’ values from triggering unsortability

* Add a checkbox to the demo table

* Update accepted props

* Update README for TableCard, Table, and TableSummary

* Update README

* Fix confused defaults
2018-08-01 12:00:45 -04:00
Kelly Dwan 96925f77fa Component: Fix rows prop in Table (https://github.com/woocommerce/woocommerce-admin/pull/193)
* Move component lifecycle method to top of component

* Update rows if the rows passed in via props have changed

This lets us bring in API changes, but will wipe out any sorting (revisit in a later PR, perhaps)

* Pass rows through to Table even if we don’t have rows loaded yet

Adds todo comment to remind that we should come back to add a placeholder/loading state
2018-07-13 15:36:41 -04:00
Justin Shreve 71c12e6795 Update woo-dash naming to new wc-admin name (https://github.com/woocommerce/woocommerce-admin/pull/183) 2018-07-10 08:48:06 -04:00
Kelly Dwan b1c2b3fdc4 Add Table component (https://github.com/woocommerce/woocommerce-admin/pull/118)
* Update package-lock

* Add data table component

* Add fake data & display revenue on the analytics test report

* Update styling

* Display table inside a card

* Update mock data to be easier to scan for testing ascending/descending

* Fix sorting function to correctly sort all columns

* Check column content before determining “sortability” — objects (links) are not sortable

* Update README

* Add translation to scroll helper text
2018-06-20 11:09:37 -04:00