* Deregister core cart/checkout scripts and styles when rendering the blocks
* Fix regression: redirect to full cart when adding a product from empty cart
* Make it so it scrolls to the top
* Update assets/js/base/utils/legacy-events.js
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* Add check for jQuery availability
* Listen to removed from cart event too
* Remove unnecessary useEffect dependency
* Remove jQuery event subscriptions on component unmount
* Fix tests
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* more setup configuration for rtl
* move default state for cart out of reducer
This also creates a file for default store states, it should make it easier to execute tests in various environments.
* Make sure there’s a default object for cart line item row
* set defaults for cartData
* add fetchMock as a global in eslint config
* add initial cart flow tests
This is just to get the ball rolling, the cart block needs more tests
* fix missing @wordpress/jest-console configs (because I overwrote the original configuration)
* update test because of change in branch
* switch import order
* add globals.d.ts file to declare globals we use.
This is a quick solution to prevent typescript linting warning about `fetchMock`. At some point we could also create a proper interface for it or import the types (if they exist) for the `jest-mock` package.
The new `globals.d.ts` file is excluded from published builds.
* Revert "Move blocks to stable flag (https://github.com/woocommerce/woocommerce-blocks/pull/2261)"
This reverts commit a005649ab8.
* migrate to number based gating
* add todo to watch feature flag
* remove flags from build
* change flag in travis
* load flag in right order
* expose flag to js
* simplify flag definition
* more feature flags
* wrap flag in check
* add helper functions
* add helpers in PHP
* fix typo in flag
* move php code to src/domain/package
* tweak if condition
* return flag to travis
* fix broken block name
* 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>
* introduce feature flags
* move config to webpack-helper
* remove package default
* add gating to frontendConfig and coreConfig
* add feature gating to PHP
* add flag to start command
* move code to Bootstrap.php
* remove flag from npm start
* add eslint rule
* add strict equal only rule
* update messages to use tokens
* update strictBinary to whitelistedFlag and add all tests
* update to correct messageId key
* add more tests
* highlight wrong flag
* Update dependencies order
* Create eslint WooCommerce plugin with dependency group rule
* Update WCPackageLocality definition so it only includes External and Internal
* Rename WPPackageLocality to WCPackageLocality
* Delete old typedef
* Add dependency injection container for blocks
* Add new Pacakge and Bootstrap classes.
- Bootstrap for bootstrapping the plugin.
- Package will replace `src/Package` and added as a dependency for any classes needing package info.
* Introduce AssetsDataRegistry for managing asset data
* refactor existing classes to use new DIC and Asset Data Registry
- this is the bare minimum needed to make this pull viable.
- further refactors will be done in more atomic smaller pulls for easier review.
* add new settings handling and export `@woocommerce/settings` as an alias to wc.wcSettings
- the export is exposed php side on the `wc-settings` handle.
* Remove unnecessary concatenation
* Fix typos and improve doc blocks
* fix php linting issue
* Use better escaping function.
* improve jsdoc spacing
* improve test assertion
* use fully qualified class names in bootstrap
* improve comment block to account for dynamic version string replace on build
* handle exceptions a bit differently
* correct dependency reference in webpack config
* remove blank lines
* fix doc block comment alignment
* Various doc/grammar/spacing fixes from code review.
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* improve naming, documentation and logic of filter callbacks
While this is intended for sanitization/validation, the callback ultimately provides flexibility for filtering the value before returning or setting in state so `filter` is a better name for this.
* Install prettier
* Reformat all files
* Add prettier to precommit hook
* Update prettier settings to match Gutenberg code standards
* Reformat files with new settings
* Improve legibility in some line breaks
* Add initial work for Product Categories List block
* Add empty category toggle
* Add option to show list as a dropdown
* Fix console warnings
* Only show proptypes linter warning if the component declares proptypes
* Add frontend script to render the product categories
* Split wcSettings & wc_product_block_data globals so that the later can be used from the frontend
* Remove wp dependencies, these are added by the webpack script now
* Capture all "woo packages" into a separate script chunk
These require `wcSettings`, which can't be available on the frontend - but we do need vendors on the frontend.
* Rewrite component into a function
* Fix validation error on editor reload
* 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