Commit Graph

156 Commits

Author SHA1 Message Date
Michael Rogowski fef17476c8 Fix undefined error when selecting a product without an image (https://github.com/woocommerce/woocommerce-blocks/pull/254)
prior to this commit, an 'individual product' block would produce
an error if associated with a product with no image.
2018-12-17 15:15:32 -05:00
Kelly Dwan 395888a521 Fix mix of tabs/spaces 2018-12-15 11:41:39 -05:00
David Levin 0c9e3eb6ba resolving conflicts 2018-12-14 18:12:13 -08:00
David Levin 1bf9ab1fb5 resolve conflicts 2018-12-14 18:08:58 -08:00
David Levin 3b770feb90 remove unnecessary function from get-shortcode.js 2018-12-14 17:48:46 -08:00
Kelly Dwan 381752734b New Block: Add "On Sale Products" block (https://github.com/woocommerce/woocommerce-blocks/pull/239)
* Add “On Sale Products” block

* Remove categories requirement from fetching products on mount
2018-12-14 18:47:16 -05:00
David Levin cae9799ffc update ordering by rating 2018-12-14 12:21:56 -08:00
David Levin d30761ba2f Add top rated products block 2018-12-14 11:45:19 -08:00
Kelly Dwan 58f3764c36 Move product order list into a shared component (https://github.com/woocommerce/woocommerce-blocks/pull/238) 2018-12-14 09:57:32 -05:00
Kelly Dwan 43675515af Block: Add new "Best Selling Products" block (https://github.com/woocommerce/woocommerce-blocks/pull/221)
* Move from a JS file per block registration to one file registering all blocks

This will let webpack combine shared libraries, like gridicons

* Move global block settings to the “before all scripts” section

These shouldn’t be tied to a specific block file, since they’re used across all blocks

* Register both block types

We can also remove the scripts, since we enqueue these below

* Update getShortcode & getQuery to handle different block types

* Pass block type name to getQuery

* Update shared attributes - edit_mode is not a universal option, but categories will be

Categories is shared, but orderby is not

* Add “Best Selling Products” block

* Add a shared class name for product grid blocks

* Fix failing tests
2018-12-13 12:19:55 -05:00
Kelly Dwan e3dab1cbcc Product preview: Update "Add to cart" button to inherit theme's button styles (https://github.com/woocommerce/woocommerce-blocks/pull/223)
* Remove button styling & add classes to inherit style from core button

* Update to CSS grid

* Prevent warnings when running autoprefixer

* Update spacing in preview

* Update snapshots to reflect button markup change

* Switch to flexbox for IE 11 support

* Remove CSS grid autoprefixer support

* Fix spacing on preview items

* Fix stylelint issue

* Remove unnecessary rule
2018-12-13 12:19:06 -05:00
Joshua T Flowers fed2de790c Add key prop to dropdown elements (https://github.com/woocommerce/woocommerce-blocks/pull/229) 2018-12-11 17:29:15 -05:00
Kelly Dwan a92ae1477b Remove “center” alignment option (https://github.com/woocommerce/woocommerce-blocks/pull/214) 2018-12-05 12:00:40 -05:00
Kelly Dwan 02f8aa1091 Add styles for better reusable block preview (https://github.com/woocommerce/woocommerce-blocks/pull/210)
* Add styles for better reusable block preview

* Fix class names for legacy block preview style

* Check that `products` exists before checking length

* Fix stylelint issues
2018-12-04 15:40:00 -05:00
Kelly Dwan 723c8eedab Update textdomain to plugin slug (https://github.com/woocommerce/woocommerce-blocks/pull/199)
* Update textdomain in JS files

* Update textdomain in PHP files

* Add babel plugin to create pot & php files from JS

* Update textdomain in plugin header

* Update translations after rebase
2018-12-04 09:51:21 -05:00
Kelly Dwan 6572b79708 Category Selection: Add loading & no results states (https://github.com/woocommerce/woocommerce-blocks/pull/197)
* Add gridicons dependency

* Add loading & no results states

* Update test snapshots

* Remove redundant setState call
2018-12-03 19:17:22 -05:00
Kelly Dwan 5966050367 Add `woocommerce` as a supported keyword for the block (https://github.com/woocommerce/woocommerce-blocks/pull/198) 2018-12-03 19:17:10 -05:00
Kelly Dwan f0f62b5caa Category Selection: Always show "selected" section (https://github.com/woocommerce/woocommerce-blocks/pull/192)
* Always show the selected tags section, with a min-height to prevent jumping when selecting tags

* Only show the “clear all” button if there are selected items

* Update snapshot tests

* Update height for sidebar category selection
2018-12-03 16:05:12 -05:00
Kelly Dwan 50aa551268 Prevent scrollbar on bottom of category selection screen (https://github.com/woocommerce/woocommerce-blocks/pull/191)
Only show vertical scrollbar if the container is scrollable
2018-12-03 13:06:47 -05:00
Kelly Dwan 46cc38e3be Add the first category to deeply nested items (https://github.com/woocommerce/woocommerce-blocks/pull/189) 2018-12-03 13:06:28 -05:00
Kelly Dwan e1f8e7d552 Update tests after markup changes in 182 (https://github.com/woocommerce/woocommerce-blocks/pull/190) 2018-12-03 12:29:44 -05:00
Kelly Dwan e8538ca0cd Update role/selected code to make it clear to screen reader users that items are selected 2018-12-03 11:25:54 -05:00
Kelly Dwan f1f1a324a0 Add a specific class wrapper to the SVG 2018-12-03 11:25:32 -05:00
Kelly Dwan 94db1a65cf Update snapshots with added icons 2018-12-03 11:10:24 -05:00
Kelly Dwan c4ca6b484d Add icon to product category list 2018-12-03 11:10:23 -05:00
Kelly Dwan 5b9e615d45 Add checked/unchecked icons next to each menu item 2018-12-03 11:10:23 -05:00
Kelly Dwan 3d5571093a Don’t hide selected elements, instead add selection toggle 2018-12-03 11:10:22 -05:00
Kelly Dwan b8bdc2bf27 Category Selection: Add hierarchy support for nested categories (https://github.com/woocommerce/woocommerce-blocks/pull/179)
* Add buildTermsTree to handle hierarchical list input

* Append items if their parent is not in the given list

* Add `breadcrumbs` property to hierarchical list

* Display the “breadcrumbs” parent categories when searching

* Use display properties

we’re providing alternative text for screen reader users, so we can just toggle display values for the prefix

* Add all parent categories to name provided for screen readers

* Display parent category when parent is a currently selected item

* Add the depth class to items in defaultRenderItem

* Add a test for a hierarchical item list

* Clean up hierarchy docblock & commented-out code

* Update proptype

* Update depth CSS so we still indent very nested categories
2018-11-30 16:37:58 -05:00
Kelly Dwan dc1c1f7370 Add tests for SearchListControl (https://github.com/woocommerce/woocommerce-blocks/pull/174) 2018-11-30 15:39:16 -05:00
Claudio Sanches 81605bae30 New custom endpoints (https://github.com/woocommerce/woocommerce-blocks/pull/162)
* Included PHPCS and git hooks

* Fixed coding standards

* New Products endpoint

* Fixed product controller schema

* Improved products controller schema and response

* New product categories controller

* Updated REST API base to match WooCommerce authentication

* Fixed products/categories endpoint

* Better docblock

* Product attributes controller

* Product attribute terms controller

* Update REST API urls

* Reverted PHPCS changes

* Check permission only once while fetching posts

* Included raw price

* Included sku to products endpoint response

* Fixed endpoints in unit test

* Fixed routes in unit tests

* Check and use subscriber, contributor and author rules in unit tests
2018-11-30 14:12:56 -05:00
James Koster e9b3b341e5 Adjust category list max-height (https://github.com/woocommerce/woocommerce-blocks/pull/177) 2018-11-30 10:50:23 -05:00
Kelly Dwan 649f79903c Show the Layout settings as open by default (https://github.com/woocommerce/woocommerce-blocks/pull/175) 2018-11-29 21:00:46 -05:00
Kelly Dwan 6873f803d6 Fix React warning for array items needed unique key props (https://github.com/woocommerce/woocommerce-blocks/pull/173) 2018-11-29 20:57:15 -05:00
Kelly Dwan 4ac52b3cf3 Create a reusable search + list control for category selection (https://github.com/woocommerce/woocommerce-blocks/pull/166)
* Add new components for ProductCategoryControl, using a reusable SearchListControl

* Add sass variables from wc-admin

* Finish styling

* Save selected categories as selected for the block

* Style sidebar version of control

* Filter the categories list, highlight search term in result

* Filter out selected items in the filter list function

* Add spacing in the placeholder, remove unnecessary stylesheet

* Add a more descriptive label for screen readers

* Remove category references from list item options

* Switch to a configurable object of messages, so SearchListControl can be more customizable

* Add screen-reader message for toggling “done” and moving into preview

* Remove call to getProductCategoryControl

The component is simple enough to just drop in now :)

* Add documentation for all props

* Add padding to placeholder

* Rename fallbackrenderItem to defaultRenderItem

* Add a variable to save the selected count

* Add `isDestructive` to make link red

* Update item style

* Add a hover/focus background color
2018-11-29 13:10:08 -05:00
Kelly Dwan 6a50ebde8b Adds continuous integration testing with travis (https://github.com/woocommerce/woocommerce-blocks/pull/156)
* Add travis to run JS & CSS linting, JS tests, and PHPUnit tests

* Move API initiation out of the gutenberg/files check

So that php tests run without having to build the JS files

* Add very basic product endpoint tests

* Fix stylelint issues in CSS

* Remove e2e setup, replace with dependency setup

* Add missing install step

* Remove cache for now

* Add specific `har-validator` dependency because v 5.1.2 has disappeared

* Only run npm install for the JS test job

* Check for installed plugins

* Update install location

* Fix typo in plugin name

* Check the BRANCH variable, rather than TRAVIS_PULL_REQUEST_BRANCH, which is only set on PR runs

* Remove debug command

* A change to trigger CI

* Set the expected node & npm versions

* Remove copy-pasted command, does not apply
2018-11-27 12:12:48 -05:00
Kelly Dwan a4fb42fe3d Load only published products in the preview (https://github.com/woocommerce/woocommerce-blocks/pull/146)
* Load only published products in the preview

* Fix post status in legacy block too

* Filter searching for individual products to only search published products

* Update query tests with change
2018-11-26 11:03:26 -05:00
Kelly Dwan c98e607a6f Add the "edit mode" toggle to the product category block (https://github.com/woocommerce/woocommerce-blocks/pull/144)
* Add sass mixins and variables

* Add an edit mode toggle, with the ability to choose categories

* Only add align classes when align is defined
2018-11-21 11:33:21 -05:00
Kelly Dwan 2231c829d1 Add a basic product category block (https://github.com/woocommerce/woocommerce-blocks/pull/136)
* Add a second block, for “products by category”

* Fetch products in the given category, when attributes change

* Display the resulting products

* Style the product preview

* Create utils folder, move shared attributes

* Move getQuery to shared utils folder

* Create a helper function to get the shortcode string

* Support the menu_order setting

* Support center/wide/full alignment

* Update PropTypes

* Add tests

* Add text domain to translation functions
2018-11-19 11:33:17 -05:00
Kelly Dwan b52bb64d88 Move legacy block to “legacy” folder (https://github.com/woocommerce/woocommerce-blocks/pull/135) 2018-11-19 11:31:43 -05:00
Kelly Dwan 882cd4c7bb Set up Jest for JS testing (https://github.com/woocommerce/woocommerce-blocks/pull/130)
* Set up Jest testing

* Add a snapshot test for the product preview component
2018-11-16 10:43:51 -05:00
Kelly Dwan 702da46571 Add stylelint to find and fix css code style issues (https://github.com/woocommerce/woocommerce-blocks/pull/126)
* Add stylelint & WP gutenberg configuration

* Fix stylelint issues
2018-11-15 10:45:49 -05:00
Kelly Dwan 45f519590e Add eslint to find and fix code style issues (https://github.com/woocommerce/woocommerce-blocks/pull/123)
* Add eslint configuration

* Run eslint auto-fixer to cover fixable issues

* Use wp.element’s component to prevent undefined React error

* Add products data global to eslint config

* Fix remaining eslint errors by hand

* Fix eslint errors in webpack

* Remove duplicate rule
2018-11-13 14:21:04 -05:00
Kelly Dwan 140f4e5ed6 Update build process (https://github.com/woocommerce/woocommerce-blocks/pull/122)
* Add api-fetch dependency

* Remove compiled files from the repo

* Update build process, remove grunt

* Import CSS into block, as we now extract CSS via webpack to build

* Update enqueue scripts to reflect new build locations

* Detect if build files don’t exist, and instruct users to build project

* Update readme with build instructions

* Clarify where to run npm commands in info notice

* Only enqueue our JS files if we know they exist

* Clarify version compatibility between WC and WP 5.0
2018-11-13 14:12:32 -05:00
claudiulodro cb2e63f130 Merge remote-tracking branch 'origin/fix/106-wip' into HEAD 2018-09-06 11:48:37 -07:00
claudiulodro 30aa4814e6 Fix no products found bug in product search 2018-09-06 11:47:51 -07:00
Tiago Noronha 37a7a0ca6c Fade padding fix 2018-09-06 18:53:36 +01:00
claudiulodro 78d21584fa Fix bugs in specific select 2018-09-06 09:58:55 -07:00
claudiulodro dd0b7284e4 Fix bugs with sidebar info 2018-09-06 09:44:30 -07:00
claudiulodro 6d0167b356 Refactor single select 2018-09-06 09:31:05 -07:00
claudiulodro 5bebb96cfa Refactor specific select screen 2018-09-06 09:29:17 -07:00