* 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
* Add Feedback Prompt in Cart & Checkout blocks sidebar
* Add border
* Move getInspectorControls out of the component function
* Move feedback prompt to a HOC
* Add @todo comment to feedback link
* Use filter for withFeedbackPrompt
* Export withFeedbackPrompt from hocs index.js
* Typo
* Try moving the feedback texts to context
* Revert "Try moving the feedback texts to context"
This reverts commit 21f889b021ceea6fef722efab9663799829bc769.
* Revert "Use filter for withFeedbackPrompt"
This reverts commit 96bba029d61a383eafa2c0a1c08f7988e319b50d.
* Set feedback text in the HOC function
* Use arrow-function to simplify code
* Refactor
* Helper to get namespace routes from the REST Api
* Add routes to store settings
* HydrateRestApiData component
* Correct usage of useSelect
* Remove lodash
* Move code to HOC
* Update ProductControl to use HOCs
* Only show variations in certain ProductControls
* Cleanup
* Refactor withSingleSelected selected prop logic
* Fix selected values not being respected
* Fix wrong propTypes notation
* Set parent: 0 in getProducts util func
* Use static properties in withProductVariations
* Move messages outside of the functional component
* Check that variations is an array
* Fix debounced search
* Fix broken tests
* Rename withSingleSelected to withTransformSingleSelectToMultipleSelect
* Add withCategories HOC and show API errors in Product Category Control
* Create withAttributes HOC and display errors in Product Attribute Control
* Refactor formatError so it handles JS errors and API errors
* Rename 'onSelectAttribute' with 'onExpandAttribute'
* Add and update tests
* Fix error in product attributes endpoint
* Refactor ProductCategoryControl into a functional component
* Refactor ProductAttributeControl into a functional component
* Refactor formatError to use a 'message' and 'type' properties
* Replace enzyme with TestRenderer
* Fix formatErrors doctype format
* Rename 'frontend' error type to 'general'
* add new withSearchedProducts hoc
includes tests
* convert to functional component and wrap with new hoc
* remove dependency between tests
* Fix typo with PropTypes bool
Co-Authored-By: Albert Juhé Lluveras <contact@albertjuhe.com>
* remove unnecessary specific import
* fix bug introduced on refactor for selected prop recalc
* fix tests that were testing the wrong expectation
- also improved mocks a bit so they are a bit more realistic for the purpose of the test coverage.
* remove unnecessary Fragment
* tweak propType definitions and remove defaults
- this keeps argument expectations in sync with wrapped component and reduces chance of unexpected behaviour if `SearchListControl` logic changes.
* remove lodash.find dependency.
* Reset 'loaded' state in Featured Product and Category blocks
* Minor code improvements
* Remove state from ApiErrorPlaceholder
* Move getProduct to a HOC
* Undo changes in Featured Category
* Update proptypes
* Move error messages to <ApiErrorPlaceholder>
* Reorder props
* Move lifecycle methods to HOC
* Make <FeaturedProduct> component presentational
* Move withProduct to js/hocs
* Create NAMESPACE constant in utils
* Create getProduct util function
* Set 'error' and 'product' state to null instead of 'false' when they have no value
* Prevent getImageSrcFromProduct and getImageIdFromProduct returning an error when 'product' is not an object
* Add HOC tests
* Use 'toBe' and 'toBeNull' jest expect methods instead of 'toEqual' when possible
* Export HOCs from index
* Move mock implementation to beforeEach