Commit Graph

499 Commits

Author SHA1 Message Date
Darren Ethier f8d6735baf Create typedefs and add basic typescript configuration (https://github.com/woocommerce/woocommerce-blocks/pull/1796)
* install typescript and add typedef support

* add typedefs for Cart things

* improve typescript config

- adds more base config
- add our aliases

* fix error caught by typescript!

* Tweak typescript configuration

* Add missing `@woocommerce/settings` alias to ts config

* Add alias for type-defs
2020-02-24 07:52:24 -05:00
renovate[bot] edd3745f4a Update dependency downshift to v4.1.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1771)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-21 10:53:50 +01:00
renovate[bot] 05d2815cf5 Update dependency eslint-plugin-jest to v23.7.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1772)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-19 16:36:56 +00:00
renovate[bot] 8209ecabbd Update dependency puppeteer to v2.1.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1773)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-19 16:36:23 +00:00
renovate[bot] cd7a34a651 Update dependency compare-versions to v3.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1770)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-19 16:36:06 +00:00
renovate[bot] d5df819644 Update Node.js to v12.16.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1769)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-19 16:35:04 +00:00
renovate[bot] 961a5274b2 Update dependency rimraf to v3.0.2 (https://github.com/woocommerce/woocommerce-blocks/pull/1774)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-19 16:34:39 +00:00
Mike Jolley d76c3e0714 Implement __experimentalCreateInterpolateElement for translations. (https://github.com/woocommerce/woocommerce-blocks/pull/1736)
* Improved placeholders of translatable string

* Improved one more string

* Include wordpress element package

* Implement __experimentalCreateInterpolateElement for translations

* Dump fragments

Co-authored-by: Claudio Sanches <contato@claudiosanches.com>
2020-02-17 16:31:55 +00:00
Albert Juhé Lluveras 6736a9d94a Add ShippingCalculator component (https://github.com/woocommerce/woocommerce-blocks/pull/1559)
* Create ShippingCalculatorAddress block

* Make 'change address' button to open/close the address form

* Create ShippingCalculator component

* Use CountryInput and CountyInput instead of TextInputs

* Fix city value not being set

* Fix shipping rate not appearing when there was only one option

* Unify postalCode and postCode to postcode

* Rename 'county' to 'state'

* Add reset styles for popular themes

* Increase cart-frontend.js max size
2020-02-17 12:12:15 +01:00
renovate[bot] 95abb4871a Update Node.js to v12.16.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1723)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-14 11:14:46 +00:00
Albert Juhé Lluveras 8297530e95 Fix ESLint error when commiting bin/webpack-helpers.js (https://github.com/woocommerce/woocommerce-blocks/pull/1729) 2020-02-13 14:16:16 +01:00
renovate[bot] 2320b8aa75 Update babel monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/1724)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-12 08:01:30 -08:00
renovate[bot] 173a83e524 Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/1722)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-12 07:55:38 -08:00
renovate[bot] 2e4e51b752 Update dependency commander to v4.1.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1725)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-12 07:43:36 -08:00
Mike Jolley 60d05aed19 Product search block e2e test (https://github.com/woocommerce/woocommerce-blocks/pull/1712)
* add docker files

* get tests to work

* remove irrelevant files

* add woocommerce as a dep

* remove eslintignore for tests

* undo travis chages till another PR

* remove local utils and call them directly from woocommerce

* remove travis db

* Block snapshot

* Test than the block can be inserted and interacted with

* Add snapshop

* Update snapshot

* rebase on master

* add a build script for just doing npm build on e2e tests

* just run build for e2e test job

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-02-11 12:23:23 -05:00
Darren Ethier a7cd7d6b22 Fix wp-cli container permissions issues for e2e docker test environment (https://github.com/woocommerce/woocommerce-blocks/pull/1716)
* add docker files

* get tests to work

* remove irrelevant files

* change userAgent to chrome

* add woocommerce as a dep

* add jest to eslint

* remove eslintignore for tests

* undo travis chages till another PR

* remove local utils and call them directly from woocommerce

* update deps

* add setup files to run tests

* export default wp link

* wait for select before selecting

* remove travis db

* ignore e2e tests in unit testing

* add tests

* add docker commands

* always run composer

* Make it possible to import directly from '@woocommerce/e2e-tests/utils'

* remove installing woocommerce via composer.

* add more docker npm scripts

* add custom docker config for wp-cli

* add changes to docker-composer.yml

Includes reading environment variables from `.env`

* revert customizations to .travis.yml

* move main docker file for the wordpress container to bin

* fix travis config

* rename wp install for travis builds back to original name

* use a version of docker-compose that travis supports

* add minor change to try and force travis test run

* fix incorrect command

* copy composer lock from master

* only run phpcs on /src directory

* give time for host to spin up for e2e tests

* increase sleep for waiting on container

* make sure plugin is built before running tests

* sigh fix improper command usage

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
2020-02-11 11:13:20 -05:00
renovate[bot] 43f56151cd Update wordpress monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/1709)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-10 17:02:09 -05:00
renovate[bot] 1007aff626 Update dependency cross-env to v7 (https://github.com/woocommerce/woocommerce-blocks/pull/1710)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-10 16:47:41 -05:00
renovate[bot] 1e708d4ce7 Update dependency lint-staged to v10 (https://github.com/woocommerce/woocommerce-blocks/pull/1711)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-10 16:47:05 -05:00
renovate[bot] 0a6190c708 Update storybook monorepo to v5.3.12 (https://github.com/woocommerce/woocommerce-blocks/pull/1708)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-10 16:45:25 -05:00
renovate[bot] bfadae7bba Update dependency @babel/core to v7.8.4 (https://github.com/woocommerce/woocommerce-blocks/pull/1707)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-10 16:34:11 -05:00
renovate[bot] b5e9e1851c Pin dependency create-file-webpack to 1.0.2 (https://github.com/woocommerce/woocommerce-blocks/pull/1706)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-10 16:25:59 -05:00
Seghir Nadir 8e3ac17585 Introduce feature flags (https://github.com/woocommerce/woocommerce-blocks/pull/1631)
* introduce feature flags

* move config to webpack-helper

* add flag to deploy command

* remove package default

* add cross-env

* add gating to frontendConfig and coreConfig

* exclude entries from being built on stable mode

* add feature gating to PHP

* add flag to start command

* add flags to travis

* add endpoints

* add better defaults for php

* move code to Bootstrap.php

* no need to spread single object

* ignore blocks.ini

* type check feature flag

* remove blocks.ini

* sanitize flag

* remove flag from npm start

* format condition

* keep spaces for package-lock.json

* check for env before going to block ini

* add env vars to travis

* whitelist env var
2020-01-31 21:04:37 +01:00
Seghir Nadir bfb2f33bfd add new icons and remove old ones (https://github.com/woocommerce/woocommerce-blocks/pull/1644)
* add new icons and remove old ones

* add docs

* add notes and remove gridicons

* update to folderStarred

* typos

* reorder imports

* update prop name to srcElement

* validate element

* fix bad import

* lowecase folderStarred

* add propTypes
2020-01-31 19:20:33 +01:00
Rua Haszard 7f44458418 Basic storybook implementation (https://github.com/woocommerce/woocommerce-blocks/pull/1636)
* install & configure storybook (via magic npx script)

* fix indentation in storybook generated files

* eslint ignore generated storybook files (for now at least)

* unhide storybook folder, consistent with Gutenberg project

* demo story for one of our components (with no css/styles)

* hack in scss webpack config & add story for button:
- fixes scss imports breaking storybook build
- note scss / styling doesn't work yet
+ organise our component stories into folder

* git ignore storybook-static build folder

* pin dependencies for storybook

* piggy-back off main webpack config for storybook module.rules (for scss)

* use gutenberg (wp-components) styles in storybook

* use system font for storybook, consistent with wp-admin/gberg and reasonable default for components in front end

* add --ci flag to prevent storybook opening new browser tab…
- see also https://github.com/storybookjs/storybook/issues/6201

* rename default stories to Default (following Gutenberg pattern)

* add story for ErrorPlaceholder

* failing ProductPreview story (committing to PR as an example for discussion)

* storybook for components/icons

* fix aliased dependencies in components for storybook:
append our webpack aliases to storybook webpack config

* basic story for PriceSlider (looks right but interaction broken)

* fix PriceSlider user interaction:
- PriceSlider expects client to handle onChange and pass in new min/max

* add comment about priceslider max/min (todoish)

* remove default stories from storybook scaffolding

* organise stories by module (aka folder in codebase)

* package-lock update after rebase

* remove unnecessary ignores (default stories are gone)

* delete experimental/risky/broken stories:
- icons components are changing in woocommerce/woocommerce-blocks#1644
- we need to refactor/do more work to get ProductPreview working (settings globals)

* remove unnecessary import

* clarify PriceSlider component intended usage comment in story

* remove redundant wrapper divs from stories

* add common storybook addons (used by Gutenberg storybook)

* rebuild package.lock after rebase

* remove unnecessary wrapper div

* package fixes after rebase

* add configuration for storybook source loader

* add decorators for a11y and knobs plugins

* remove unnecessary react import & import useState from WP

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-01-31 09:59:14 +13:00
renovate[bot] dd53b1779b Update wordpress monorepo (https://github.com/woocommerce/woocommerce-blocks/pull/1666)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-30 13:16:52 +01:00
renovate[bot] 2e78ff6187 Update dependency rimraf to v3.0.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1664)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-30 12:07:06 +01:00
renovate[bot] 35c0d176df Update npm to v6.13.7 (https://github.com/woocommerce/woocommerce-blocks/pull/1665)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-30 11:58:28 +01:00
renovate[bot] 3f982ab71c Update dependency eslint-config-prettier to v6.10.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1663)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-30 11:57:52 +01:00
renovate[bot] 3306726a35 Update dependency downshift to v4.0.8 (https://github.com/woocommerce/woocommerce-blocks/pull/1662)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-30 11:53:34 +01:00
renovate[bot] c13449d5e6 Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/1661)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-30 11:53:22 +01:00
Darren Ethier db14accc64 Update changelog script. (https://github.com/woocommerce/woocommerce-blocks/pull/1655)
This pull:

- removes zenhub option from package.json
- installs and implement `merge-config` package. This allows for usage of environment variables and command line variables along with `package.json` configuration for the changelog generation.
- implements new variable: `devNoteLabel` for indicating what label indicates the pull has (or requires) a devnote. Pull Requests with this label will have `[DN]` appended to the changelog entry.
- adds new variable: `changelogSrcType` for indicating what source to use for generating changelogs (can be `MILESTONE` or `ZENHUB_RELEASE`). Implemented detection of this in code, defaults to `MILESTONE`.
- Modify initial setup text so if user already has api key(s) setup, then we don't give instructions again. Also improve the output when keys aren't set to make it clear what needs done.
- Make the environment variable for Zenhub Api token consistent with Github token (`ZH_API_TOKEN` instead of `ZH_API_KEY`).
- Update package.json with changelog script variation for running it with zenhub release as the source.
- Update `RELEASE.md` docs to clarify changelog script options
- Add a `README.md` doc for the changelog script.
2020-01-28 08:47:26 -05:00
Albert Juhé Lluveras 2014e6f1e2 Reorganize dependencies in package.json (https://github.com/woocommerce/woocommerce-blocks/pull/1633)
* Reorganize dependencies in package.json

* Move '@wordpress' entries back to devDependencies
2020-01-24 13:00:11 +01:00
Mike Jolley d1737e76c2 Change default rows for product grid blocks to 3 (https://github.com/woocommerce/woocommerce-blocks/pull/1613)
* Change default rows to 3

* Handle all products rows change via deprecation

* Prevent errors if object is undefined

* HOC to set default attribute values

* Separate default attributes from attribute definitions

* Filters to set defaults

* Fix deprecation so attributes are not reordered

* Move flters to index file and limit which blocks are affected

* Fix object assign

* Use typeof for undefined checks

* Move hoc to filter file so it has context

* Fix up comment

* Avoid mutating props

* Prevent multiple `attributes` by cloning props

* Force attributes to be saved to HTML in a specific order, and handle migration

* useEffect to set attributes and avoid prop mutation

* Switch to class component
2020-01-22 16:58:25 +00:00
renovate[bot] 4b9d10c591 Update dependency node-sass to v4.13.1 (https://github.com/woocommerce/woocommerce-blocks/pull/1623)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-22 11:19:48 +01:00
renovate[bot] 48b510646f Update dependency downshift to v4.0.7 (https://github.com/woocommerce/woocommerce-blocks/pull/1621)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-22 11:19:40 +01:00
renovate[bot] ebcc98f43a Update dependency eslint-plugin-jest to v23.6.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1622)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-22 11:19:13 +01:00
renovate[bot] 88a9b686b9 Pin dependency @wordpress/html-entities to 2.5.0 (https://github.com/woocommerce/woocommerce-blocks/pull/1620)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-22 11:00:50 +01:00
Albert Juhé Lluveras cad3e72769 Create CountryInput component (https://github.com/woocommerce/woocommerce-blocks/pull/1585)
* Create initial CountryInput component

* Create ShippingCountryInput

* Create BillingCountryInput

* Make backgrounds white

* Correctly align options

* Add CSS resets for 20xy themes

* Fix wrong defaults in countries constants

* Make CountryInput respect 'prefers-reduced-motion'

* Reverse prefers-reduced-motion check

* Set max-width to CountryInput dropdown

* Use decodeEntities to print country names

* Avoid unnecessary JSON enconding and later parsing

* Make sure country name is also encoded when selected

* Fix countries default value
2020-01-17 17:58:08 +01:00
renovate[bot] dfc963b545 Pin dependencies (https://github.com/woocommerce/woocommerce-blocks/pull/1567)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-15 15:19:06 +00:00
renovate[bot] 8f73d68904 Update dependency css-loader to v3.4.2 (https://github.com/woocommerce/woocommerce-blocks/pull/1571)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-15 10:20:06 +01:00
renovate[bot] fa188ecc85 Update babel monorepo to v7.8.3 (https://github.com/woocommerce/woocommerce-blocks/pull/1568)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-15 10:19:51 +01:00
renovate[bot] 1f8e0ffcdf Update dependency autoprefixer to v9.7.4 (https://github.com/woocommerce/woocommerce-blocks/pull/1569)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-15 10:19:31 +01:00
renovate[bot] 095b992c75 Update dependency core-js to v3.6.4 (https://github.com/woocommerce/woocommerce-blocks/pull/1570)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-15 10:15:02 +01:00
renovate[bot] 5b13fc2b1a Update dependency downshift to v4.0.5 (https://github.com/woocommerce/woocommerce-blocks/pull/1572)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-01-15 10:12:04 +01:00
Darren Ethier a50dab39fc Improve changelog script (https://github.com/woocommerce/woocommerce-blocks/pull/1543)
The changelog script now has the following:

- constructed more modularly for easier maintenance.
- removed coupling to blocks repository so it can be used in more contexts (potentially publishing as it's own package).
- switched to use github v4 api (graphql) to reduce number of requests (reducing the likelihood of hitting api limits)
- added support for zenhub releases instead of github milestones for what pulls to derive changelog from.
2020-01-13 10:06:32 -05:00
Albert Juhé Lluveras 6c806bacac Remove vendors-frontend from Webpack config (https://github.com/woocommerce/woocommerce-blocks/pull/1544)
* Remove vendors-frontend from Webpack config

* Increase cart-frontend.js bundlewatch limit

* Remove 'wc-vendors-frontend' from Cart block dependencies
2020-01-10 20:21:14 +01:00
Albert Juhé Lluveras bd2b8cb279 Add Cart totals to Cart block (https://github.com/woocommerce/woocommerce-blocks/pull/1411)
* Add Cart totals to Cart block

* Accessibility improvements

* Load vendors styles separately

* Use same shipping placeholders for cart and checkout

* Refactor how we import @wordpress/components styles so only panel styles are imported

* Remove style-loader from vendors styles build process

* Add htmlFor attribute to TotalsCouponCodeInput

* Update totalItems shape to match API

* Fix wrong total items shape using numbers instead of strings

* Rename wc-blocks classes to wc-block

* Remove unnecessary parseInt()

* Add radix to parseInt()

* Rename totalRows to totalRowsConfig

* Move placeholder content out of the component

* Use Card component for cart's sidebar (https://github.com/woocommerce/woocommerce-blocks/pull/1423)

* Use Card component for cart's sidebar

* Split RadioControl component

* No need to use Label in RadioControlOption

* Remove no longer valid @todo comment

* Use 'checked' prop instead of 'selected' in RadioControlOption

* Rename wc-blocks classes to wc-block

* Rename wc-blocks classes to wc-block (II)

* Make sure radio control ids are unique using withComponentId

* Load PanelBody and PanelRow from last version of @wordpress/components

* Create vendors-frontend.js file

* Load wordpress-component instead of @wordpress/components from <Button> component

* Only load 'withRestApiHydration' HOC

* Make vendors-frontend a dependency of cart-frontend script

* Revert "Only load 'withRestApiHydration' HOC"

This reverts commit 9f9b9759a98047b26e7d8f04189ffe78c1d5bb06.

* Fix fieldset background
2020-01-10 15:37:27 +01:00
Rua Haszard 0763655d42 Cart block: line-items front end initial work (https://github.com/woocommerce/woocommerce-blocks/pull/1333)
* render block on front end, add `Shopping cart` heading (baby steps)

* fake data for editing full cart + show line count in header

* add note about core/html using `is-active` class for toggle state

* reinstate work-in-progress full cart component (lost in rebase)

* reinstate full cart from master

* component for full cart title & item count + margin tweaks:
- add margin between main cart & sidebar
- add margin after cart block

* add cart items sample data + factor sample product image to module

* use sample cart data for item count

* basic table of cart line items (no styling)

* prettification

* show images for cart line items + initial table styling

* cart quantity selector component (work in progress)

* use state for cart product quantity, allow incr/decr from UI (WIP)

* replace WIP custom quantity control with number edit (temporary)

* correctly format cart line item total price

* align cart item columns with headings + indent image on desktop

* tweak css for cart line item padding on mobile so it's more explicit

* show cart line item full price if discounted

* add placeholder for cart remove item link

* switch cart table to flex layout (was table)…
This will allow us to move things around for mobile/responsive layout.

* only show cart items table header on desktop

* more cart items styling - row borders, appropriate padding +
+ move image width to variable
+ fix class name plurality for row (item not items)

* use standard $gap instead of 1em for padding/margins

* responsive (mobile) layout for cart line items:
- shift line $ total to bottom right
- stack quantity selector in product info column

* remove extraneous cart table padding on mobile

* comment about unused styles for quantity selector component

* add follow up issue for todo

* remove inappropriate href

* render srcset & sizes for cart line item product image

* remove todo comment

* switch back to table markup for cart items (in progress):
- table is more semantic, associates headers with columns

* cart line items column widths - product column is larger (60%)

* reinstate table row borders

* bottom-align line item price on mobile

* cart contents heading should be H2 + prettify

* remove unused QuantitySelector code/styles, rename main class in line with BEM

* defaults for QuantitySelector props

* variable/property name tidies - match conventions/API

* fix bug: line total price is only bottom-align on small screen

* move QuantitySelector to root of components, intended to be generally useful

* use lineItem directly for cart, specify shape in PropTypes

* rename cart components to align with "line item" rather than "product"

* rejig class names to better align with new component names & BEM style

* show cart item image correct size:
- use single column for product image and info, with flex container
- specify image width (rem instead of px)

* fix safari issue - cart product images displaying vertically stretched

* shift product name left margin from image, to account for no-image case

* experiment: bump bundlewatch size limit for cart temporarily:
- our fake data inline image is heavy
- when we switch to real API we will no longer need it

* fix issue introduced when moving margin from image to details div:
- product details needs margin on left (not right)

* fix react props issues:
- explicitly destructure image props for srcSet (vs srcset)
- use API key field for line item key instead of id, fix duplicate test id
- CartLineItemsTable takes an array of lineItems (incorrect PropTypes)

* remove redundant divs + use conventional `null` (when no full price)

* override editor styles to ensure cart product image is correct size

* move cart items editor style override to editor.css

* add an explicit readable heading for cart heading to match visual layout
2020-01-10 11:50:14 +13:00
renovate[bot] 16da8d64b8 Update dependency downshift to v4 (https://github.com/woocommerce/woocommerce-blocks/pull/1511)
Co-authored-by: Renovate Bot <renovatebot@gmail.com>
2020-01-09 11:11:16 +01:00