-
Notifications
You must be signed in to change notification settings - Fork 215
Creation of All Products Block #899
Conversation
Aljullu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I based #994 on top of this PR, but we never did a review of it, so I left some suggestions/questions below. I'm ok dealing with them in a follow-up if we get less conflicts this way.
| line-height: 1; | ||
| } | ||
| } | ||
| /* Moved */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just remove the file?
| font-size: 1em; | ||
| font-family: star; /* stylelint-disable-line */ | ||
| font-weight: 400; | ||
| display: -block; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be inline-block?
| display: -block; | |
| display: inline-block; |
| * | ||
| * wp-block-{$this->block_name}, | ||
| * wc-block-{$this->block_name}, | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this comment mean?
src/Assets.php
Outdated
| 'isLargeCatalog' => $product_counts->publish > 200, | ||
| 'limitTags' => $tag_count > 100, | ||
| 'hasTags' => $tag_count > 0, | ||
| 'hasProducts' => $product_counts->publish > 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you think about naming this setting as hasPublishedProducts? I think it describes better its value.
src/RestApi/Controllers/Products.php
Outdated
| * | ||
| * @param array $permissions Array of access permissions. | ||
| * @param bool $permission Permission. | ||
| * @param string $context Context of the request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor alignment issue.
* Create withProducts HOC for All Products block * Add order select and pagination to All Products block * Go to first page when changing order * Add HOC test * Make sure block is updated whem columns/rows change in the editor * Fix 'SALE' badge positioning * Remove unnecessary key * Honor 'perPage' value when generating placeholders * Make placeholder sizes match rendered block item * Several CSS improvements * Remove unused CSS properties * Move getProducts to hocs utils * Remove All Products sample-data.json * Fix order select wrong margin in the editor * Refactor how loading image gets its size * Clear products when loadProducts start * Enhance pagination logic * Fix placeholder width * Fix regular_price check * Set product link max-width * Implement querystrings for the All Products block (#997) * Implement querystrings for the All Products block * Create withWindow HOC * Add with-window tests * Use renderFrontend util in All Products block (#1003) * Add with-window tests * Use renderFrontend util in All Products block
* Rename properties and components from 'order' to 'sort' * Rename onOrderChange to onSortChange
* Create withBrowserWindowProp HOC * Remove unnecessary expect's * Always pass window prop to propMap if it exists
* Scroll to top when switching pages in All Pages block * Improve keyboard navigation in the All Products block * Create withScrollToTop HOC * Fix variable name typo
…1040) * Create withQueryStringValues HOC and use it in ProductGrid component * Add tests * Add comment explaining urlParameterSuffix * Don't destructure props if only used once * Move dependencies check outside the HOC * Update test description * Remove HOCs no longer used
# Conflicts: # src/Assets.php # src/RestApi.php # src/RestApi/Controllers/Products.php
# Conflicts: # package-lock.json
* install @wordpress/data-controls and deepFreeze * add schema store * add query-state store * add collections store * add bundle entry point (and export store keys and constants) * add master README.md for new stores * add bundle configuration and register asset php side * Add missing param name Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com> * code style fixes * remove unnecessary period from test description * Simplify conditional * reorder imports (code style) * reorder imports and codestyle * refactor using lodash for state utils * reorder imports * reorder imports * reorder dependencies * reorder dependnecies an remove duplication block * remove errant tab * reorder dependencies
* add control for getting unparsed response from apiFetch * Modify action so it recieves a response object. * modify reducer to handle response object * improve selectors to make headers accessible - modifys existing `getCollection` to retrieve items from state. - adds `getCollectionHeader` selector * update resolvers to handle full response from request - also adds resolver for `getCollectionHeader` * update docs for changes * Improve spacing in doc Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com> * Fix spacing in inline docs Co-Authored-By: Albert Juhé Lluveras <aljullu@gmail.com> * change `getFromState` to receive an object instead of arguments list.
# Conflicts: # package-lock.json
# Conflicts: # assets/css/style.scss These styles were moved into `base/components/product-grid/style.scss`. I copied in the new breakpoint styles for product-grid.
|
closing this in favor of #1032 |
In progress attempt at #898. Currently only implementing the creation of the block, default placeholders if content/products are missing, and inspector settings.
Attributes and inspector controls I anticipate will be shared are in the
assets/js/blocks/productsdirectory. This block itself is underassets/js/blocks/products/all-products. This follows the patterns set by the new reviews blocks.