Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Release: 3.1.0 #2938

Merged
merged 17 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/wordpress-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ jobs:
tag:
name: New Release
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- uses: act10ns/slack@v1
with:
status: starting
if: always()
- name: Checkout code
uses: actions/checkout@v2
- name: WordPress Plugin Deploy
Expand All @@ -27,3 +33,8 @@ jobs:
asset_path: ${{github.workspace}}/woo-gutenberg-products-block.zip
asset_name: woo-gutenberg-products-block.zip
asset_content_type: application/zip
- uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: always()
23 changes: 12 additions & 11 deletions assets/js/base/components/panel/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@
}

.wc-blocks-components-panel__button {
@include reset-box();
height: auto;
line-height: 1;
margin-bottom: em(6px);
margin-top: em(6px);
padding-bottom: em($gap-small - 6px);
padding-right: #{24px + $gap-smaller};
padding-top: em($gap-small - 6px);
position: relative;
text-align: left;
width: 100%;

&,
&:hover,
&:focus,
&:active {
@include reset-box();
@include reset-typography();
background: transparent;
box-shadow: none;
height: auto;
line-height: 1;
margin-bottom: em(6px);
margin-top: em(6px);
padding-bottom: em($gap-small - 6px);
padding-right: #{24px + $gap-smaller};
padding-top: em($gap-small - 6px);
position: relative;
text-align: left;
width: 100%;
}

> .wc-blocks-components-panel__button-icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const reducer = (
break;
case SET_IDLE:
newState =
state.state !== IDLE
state.status !== IDLE
? {
...state,
status: IDLE,
Expand Down
11 changes: 9 additions & 2 deletions assets/js/base/utils/render-frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export const renderFrontend = ( {
const containers = document.querySelectorAll( selector );

if ( containers.length ) {
// @todo Remove Suspense compatibility fix once WP 5.2 is no longer supported.
// If Suspense is not available (WP 5.2), use a noop component instead.
const noopComponent = ( { children } ) => {
return <>{ children }</>;
};
const SuspenseComponent = Suspense || noopComponent;

// Use Array.forEach for IE11 compatibility.
Array.prototype.forEach.call( containers, ( el, i ) => {
const props = getProps( el, i );
Expand All @@ -34,11 +41,11 @@ export const renderFrontend = ( {

render(
<BlockErrorBoundary { ...errorBoundaryProps }>
<Suspense
<SuspenseComponent
fallback={ <div className="wc-block-placeholder" /> }
>
<Block { ...props } attributes={ attributes } />
</Suspense>
</SuspenseComponent>
</BlockErrorBoundary>,
el
);
Expand Down
3 changes: 0 additions & 3 deletions assets/js/blocks/reviews/reviews-by-category/editor.scss

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/blocks/reviews/reviews-by-category/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Icon, review } from '@woocommerce/icons';
/**
* Internal dependencies
*/
import '../editor.scss';
import Editor from './edit';
import sharedAttributes from '../attributes';
import save from '../save.js';
Expand Down
4 changes: 0 additions & 4 deletions assets/js/blocks/reviews/reviews-by-product/editor.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.wc-block-reviews-by-product__selection {
width: 100%;
}

.components-base-control {
+ .wc-block-reviews-by-product__notice {
margin: -$gap 0 $gap;
Expand Down
1 change: 1 addition & 0 deletions bin/webpack-entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const entries = {
],
} ),

'reviews-style': './assets/js/blocks/reviews/editor.scss',
...getBlockEntries( '**/*.scss' ),
},
core: {
Expand Down
76 changes: 76 additions & 0 deletions docs/testing/releases/310.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
## Testing notes and ZIP for release 3.1.0

Zip file: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-gutenberg-products-block/files/4995326/woocommerce-gutenberg-products-block.zip)

### All Products

#### Product summary inner block renders in the frontend

First, let's make sure at least one of the products has a summary:

1. In the admin, go to Products > All Products.
2. Edit any of the products.
3. Scroll down to the Product short description text area.
4. If it's blank, add some text there.
5. In the sidebar, click on Update.

Now, let's make sure the bug is fixed:

1. Create a page and add the All Products block.
2. Click on the pencil icon on the block toolbar to edit it.
3. Below the image add an atomic block: the Product Summary.
4. Verify a text has appeared: <i>Fly your WordPress banner...</i>.
5. Click on Done at the bottom of the block.
6. Click on Publish at the top right of the screen to publish the page.
7. Click on the View Post button to view the post in the frontend side of your store.
8. Verify the Product summary block is rendered for products which have it.

#### There are no regressions with other inner blocks

There have been changes in the way All Products inner blocks are loaded, so it should be tested that other inner blocks, in addition to the Product summary block, work fine in the editor and the frontend.

### Styling regressions

This new release has a new system to generate the styles, so it would be great to test all blocks and verify there are no visual regressions or anything looking weird. The list of all blocks is:

- [ ] Featured Product Block
- [ ] Featured Category Block
- [ ] Hand-Picked products Block
- [ ] Best Selling Products Block
- [ ] Top Rated Products Block
- [ ] Newest Products Block
- [ ] On Sale Products Block
- [ ] Products by Category Block
- [ ] Products by Tag Block
- [ ] Products by Attribute Block
- [ ] Product Categories List Block
- [ ] Reviews by Product
- [ ] Reviews by Category
- [ ] All Reviews
- [ ] Product Search
- [ ] All Products
- [ ] Filter Products by Price
- [ ] Filter Products by Attribute
- [ ] Active Product Filters

**Note: The below blocks only need tested for the feature plugin**

- [ ] Cart
- [ ] Checkout

### API regressions

We also made some changes to our API endpoints to make them work correctly with WordPress 5.5. We should make sure interacting with the following blocks doesn't show errors in the console or the PHP logs:

- [ ] Reviews by Product
- [ ] Reviews by Category
- [ ] All Reviews
- [ ] All Products
- [ ] Filter Products by Price
- [ ] Filter Products by Attribute
- [ ] Active Product Filters

**Note: The below blocks only need tested for the feature plugin**

- [ ] Cart
- [ ] Checkout
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@woocommerce/block-library",
"title": "WooCommerce Blocks",
"author": "Automattic",
"version": "3.1.0-dev",
"version": "3.1.0",
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/",
"keywords": [
Expand Down
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: automattic, claudiulodro, tiagonoronha, jameskoster, ryelle, levinmedia, aljullu, mikejolley, nerrad, joshuawold, assassinateur, haszari
Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
Requires at least: 5.2
Tested up to: 5.4
Tested up to: 5.5
Requires PHP: 5.6
Stable tag: 3.0.0
Stable tag: 3.1.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -85,6 +85,11 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/

== Changelog ==

= 3.1.0 - 2020-07-29 =
- Fix missing permissions_callback arg in StoreApi route definitions [#2926](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2926)
- Fix 'Product Summary' in All Products block is not pulling in the short description of the product [#2913](https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/2913)
- dev: Add query filter when searching for a table [#2886](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2886) 👏 @pkelbert

= 3.0.0 - 2020-07-20 =

This release adds support for Cash on Delivery and Bank Transfer payment methods to the checkout block. The payment method extension api for the blocks [has an update to the `canMakePayment` property](https://woocommerce.wordpress.com/?p=6830).
Expand Down
2 changes: 1 addition & 1 deletion src/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static function container( $reset = false ) {
NewPackage::class,
function ( $container ) {
// leave for automated version bumping.
$version = '3.1.0-dev';
$version = '3.1.0';
return new NewPackage(
$version,
dirname( __DIR__ )
Expand Down
7 changes: 4 additions & 3 deletions src/StoreApi/Routes/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ public function get_path() {
public function get_args() {
return [
[
'methods' => \WP_REST_Server::READABLE,
'callback' => [ $this, 'get_response' ],
'args' => [
'methods' => \WP_REST_Server::READABLE,
'callback' => [ $this, 'get_response' ],
'permission_callback' => '__return_true',
'args' => [
'context' => $this->get_context_param( [ 'default' => 'view' ] ),
],
],
Expand Down
7 changes: 4 additions & 3 deletions src/StoreApi/Routes/CartAddItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ public function get_path() {
public function get_args() {
return [
[
'methods' => \WP_REST_Server::CREATABLE,
'callback' => [ $this, 'get_response' ],
'args' => [
'methods' => \WP_REST_Server::CREATABLE,
'callback' => [ $this, 'get_response' ],
'permission_callback' => '__return_true',
'args' => [
'id' => [
'description' => __( 'The cart item product or variation ID.', 'woo-gutenberg-products-block' ),
'type' => 'integer',
Expand Down
7 changes: 4 additions & 3 deletions src/StoreApi/Routes/CartApplyCoupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ public function get_path() {
public function get_args() {
return [
[
'methods' => \WP_REST_Server::CREATABLE,
'callback' => [ $this, 'get_response' ],
'args' => [
'methods' => \WP_REST_Server::CREATABLE,
'callback' => [ $this, 'get_response' ],
'permission_callback' => '__return_true',
'args' => [
'code' => [
'description' => __( 'Unique identifier for the coupon within the cart.', 'woo-gutenberg-products-block' ),
'type' => 'string',
Expand Down
19 changes: 11 additions & 8 deletions src/StoreApi/Routes/CartCoupons.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,23 @@ public function get_path() {
public function get_args() {
return [
[
'methods' => \WP_REST_Server::READABLE,
'callback' => [ $this, 'get_response' ],
'args' => [
'methods' => \WP_REST_Server::READABLE,
'callback' => [ $this, 'get_response' ],
'permission_callback' => '__return_true',
'args' => [
'context' => $this->get_context_param( [ 'default' => 'view' ] ),
],
],
[
'methods' => \WP_REST_Server::CREATABLE,
'callback' => [ $this, 'get_response' ],
'args' => $this->schema->get_endpoint_args_for_item_schema( \WP_REST_Server::CREATABLE ),
'methods' => \WP_REST_Server::CREATABLE,
'callback' => [ $this, 'get_response' ],
'permission_callback' => '__return_true',
'args' => $this->schema->get_endpoint_args_for_item_schema( \WP_REST_Server::CREATABLE ),
],
[
'methods' => \WP_REST_Server::DELETABLE,
'callback' => [ $this, 'get_response' ],
'methods' => \WP_REST_Server::DELETABLE,
'permission_callback' => '__return_true',
'callback' => [ $this, 'get_response' ],
],
'schema' => [ $this->schema, 'get_public_item_schema' ],
];
Expand Down
12 changes: 7 additions & 5 deletions src/StoreApi/Routes/CartCouponsByCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,17 @@ public function get_args() {
],
],
[
'methods' => \WP_REST_Server::READABLE,
'callback' => [ $this, 'get_response' ],
'args' => [
'methods' => \WP_REST_Server::READABLE,
'callback' => [ $this, 'get_response' ],
'permission_callback' => '__return_true',
'args' => [
'context' => $this->get_context_param( [ 'default' => 'view' ] ),
],
],
[
'methods' => \WP_REST_Server::DELETABLE,
'callback' => [ $this, 'get_response' ],
'methods' => \WP_REST_Server::DELETABLE,
'callback' => [ $this, 'get_response' ],
'permission_callback' => '__return_true',
],
'schema' => [ $this->schema, 'get_public_item_schema' ],
];
Expand Down
19 changes: 11 additions & 8 deletions src/StoreApi/Routes/CartItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,23 @@ public function get_path() {
public function get_args() {
return [
[
'methods' => \WP_REST_Server::READABLE,
'callback' => [ $this, 'get_response' ],
'args' => [
'methods' => \WP_REST_Server::READABLE,
'callback' => [ $this, 'get_response' ],
'permission_callback' => '__return_true',
'args' => [
'context' => $this->get_context_param( [ 'default' => 'view' ] ),
],
],
[
'methods' => \WP_REST_Server::CREATABLE,
'callback' => array( $this, 'get_response' ),
'args' => $this->schema->get_endpoint_args_for_item_schema( \WP_REST_Server::CREATABLE ),
'methods' => \WP_REST_Server::CREATABLE,
'callback' => array( $this, 'get_response' ),
'permission_callback' => '__return_true',
'args' => $this->schema->get_endpoint_args_for_item_schema( \WP_REST_Server::CREATABLE ),
],
[
'methods' => \WP_REST_Server::DELETABLE,
'callback' => [ $this, 'get_response' ],
'methods' => \WP_REST_Server::DELETABLE,
'callback' => [ $this, 'get_response' ],
'permission_callback' => '__return_true',
],
'schema' => [ $this->schema, 'get_public_item_schema' ],
];
Expand Down
Loading