From 506a8b00861eb737e475e035ab63ece77c92b7e9 Mon Sep 17 00:00:00 2001 From: Fernando Marichal Date: Tue, 19 Mar 2024 12:15:33 -0400 Subject: [PATCH 01/28] Fix publish dropdown visibility in new product after hiding pre-publish modal (#45682) * Publish dropdown visible after hidding panel * Add changelog * Rename prop --- .../changelog/fix-45589_publish_dropdown_not_visible | 4 ++++ .../product-editor/src/components/header/header.tsx | 3 ++- .../header/publish-button/publish-button.tsx | 11 ++++++++--- .../src/components/header/publish-button/types.ts | 3 ++- 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 packages/js/product-editor/changelog/fix-45589_publish_dropdown_not_visible diff --git a/packages/js/product-editor/changelog/fix-45589_publish_dropdown_not_visible b/packages/js/product-editor/changelog/fix-45589_publish_dropdown_not_visible new file mode 100644 index 000000000000..0a60faeeb8ce --- /dev/null +++ b/packages/js/product-editor/changelog/fix-45589_publish_dropdown_not_visible @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Fix publish dropdown visibility in new product after hiding pre-publish modal #45682 diff --git a/packages/js/product-editor/src/components/header/header.tsx b/packages/js/product-editor/src/components/header/header.tsx index decae5160b4e..eb4a908fbd4f 100644 --- a/packages/js/product-editor/src/components/header/header.tsx +++ b/packages/js/product-editor/src/components/header/header.tsx @@ -249,7 +249,8 @@ export function Header( { diff --git a/packages/js/product-editor/src/components/header/publish-button/publish-button.tsx b/packages/js/product-editor/src/components/header/publish-button/publish-button.tsx index 106f43e85264..3ed47f61da2f 100644 --- a/packages/js/product-editor/src/components/header/publish-button/publish-button.tsx +++ b/packages/js/product-editor/src/components/header/publish-button/publish-button.tsx @@ -25,7 +25,8 @@ import type { PublishButtonProps } from './types'; export function PublishButton( { productType = 'product', - prePublish, + isMenuButton, + isPrePublishPanelVisible = true, ...props }: PublishButtonProps ) { const { createErrorNotice } = useDispatch( 'core/notices' ); @@ -68,7 +69,7 @@ export function PublishButton( { if ( productType === 'product' && window.wcAdminFeatures[ 'product-pre-publish-modal' ] && - prePublish + isMenuButton ) { function renderPublishButtonMenu( menuProps: Dropdown.RenderProps @@ -78,7 +79,11 @@ export function PublishButton( { ); } - if ( editedStatus !== 'publish' && editedStatus !== 'future' ) { + if ( + editedStatus !== 'publish' && + editedStatus !== 'future' && + isPrePublishPanelVisible + ) { function handlePrePublishButtonClick( event: MouseEvent< HTMLButtonElement > ) { diff --git a/packages/js/product-editor/src/components/header/publish-button/types.ts b/packages/js/product-editor/src/components/header/publish-button/types.ts index 4c38361c8f30..d007eee6bd31 100644 --- a/packages/js/product-editor/src/components/header/publish-button/types.ts +++ b/packages/js/product-editor/src/components/header/publish-button/types.ts @@ -8,5 +8,6 @@ export type PublishButtonProps = Omit< 'aria-disabled' | 'variant' | 'children' > & { productType?: string; - prePublish?: boolean; + isMenuButton?: boolean; + isPrePublishPanelVisible?: boolean; }; From 617b49464e0e4839eb3601ba988145aae3777bb4 Mon Sep 17 00:00:00 2001 From: Maikel Perez Date: Tue, 19 Mar 2024 13:16:34 -0300 Subject: [PATCH 02/28] Hidden tag inconsistency (#45679) * Header tag Hidden now is aligned with the Visibility: Hidden from the pre publish modal * Add changelog file --- packages/js/product-editor/changelog/fix-45665 | 4 ++++ packages/js/product-editor/src/components/header/header.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 packages/js/product-editor/changelog/fix-45665 diff --git a/packages/js/product-editor/changelog/fix-45665 b/packages/js/product-editor/changelog/fix-45665 new file mode 100644 index 000000000000..a32d020da444 --- /dev/null +++ b/packages/js/product-editor/changelog/fix-45665 @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Header tag Hidden now is aligned with the Visibility: Hidden from the pre publish modal diff --git a/packages/js/product-editor/src/components/header/header.tsx b/packages/js/product-editor/src/components/header/header.tsx index eb4a908fbd4f..44cda363a6cf 100644 --- a/packages/js/product-editor/src/components/header/header.tsx +++ b/packages/js/product-editor/src/components/header/header.tsx @@ -134,7 +134,7 @@ export function Header( { ); } if ( - ( productStatus !== 'future' && catalogVisibility === 'hidden' ) || + ( productStatus !== 'future' && catalogVisibility !== 'visible' ) || ( isVariation && productStatus === 'private' ) ) { tags.push( From c2f33b2f5b6746414c03b020207d76fbf91ca57c Mon Sep 17 00:00:00 2001 From: Maikel Perez Date: Tue, 19 Mar 2024 13:20:19 -0300 Subject: [PATCH 03/28] Replace the Draft tag with a Scheduled tag in the product header (#45685) * Show Scheduled product header tag when the product is been scheduled * Fix the pre publish modal header message when to say scheduled when the product has a date in the future * Add changelog file --- packages/js/product-editor/changelog/fix-45667 | 4 ++++ .../product-editor/src/components/header/header.tsx | 10 +++++++++- .../header/hooks/use-publish/use-publish.tsx | 11 +++++++++-- .../components/prepublish-panel/prepublish-panel.tsx | 7 ++++--- 4 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 packages/js/product-editor/changelog/fix-45667 diff --git a/packages/js/product-editor/changelog/fix-45667 b/packages/js/product-editor/changelog/fix-45667 new file mode 100644 index 000000000000..477c682dd0b4 --- /dev/null +++ b/packages/js/product-editor/changelog/fix-45667 @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Replace the Draft tag with a Scheduled tag in the product header diff --git a/packages/js/product-editor/src/components/header/header.tsx b/packages/js/product-editor/src/components/header/header.tsx index 44cda363a6cf..06b7a52e1d65 100644 --- a/packages/js/product-editor/src/components/header/header.tsx +++ b/packages/js/product-editor/src/components/header/header.tsx @@ -125,7 +125,7 @@ export function Header( { function getVisibilityTags() { const tags = []; - if ( productStatus === 'draft' || productStatus === 'future' ) { + if ( productStatus === 'draft' ) { tags.push( ); } + if ( productStatus === 'future' ) { + tags.push( + + ); + } if ( ( productStatus !== 'future' && catalogVisibility !== 'visible' ) || ( isVariation && productStatus === 'private' ) diff --git a/packages/js/product-editor/src/components/header/hooks/use-publish/use-publish.tsx b/packages/js/product-editor/src/components/header/hooks/use-publish/use-publish.tsx index f4805ee9e47f..09d3db63e59f 100644 --- a/packages/js/product-editor/src/components/header/hooks/use-publish/use-publish.tsx +++ b/packages/js/product-editor/src/components/header/hooks/use-publish/use-publish.tsx @@ -4,6 +4,7 @@ import { MouseEvent } from 'react'; import { Button } from '@wordpress/components'; import { useEntityProp } from '@wordpress/core-data'; +import { isInTheFuture } from '@wordpress/date'; import { __ } from '@wordpress/i18n'; import type { Product } from '@woocommerce/data'; @@ -28,12 +29,18 @@ export function usePublish< T = Product >( { const { isValidating, isDirty, isPublishing, publish } = useProductManager( productType ); - const [ status, , prevStatus ] = useEntityProp< Product[ 'status' ] >( + const [ , , prevStatus ] = useEntityProp< Product[ 'status' ] >( 'postType', productType, 'status' ); + const [ editedDate ] = useEntityProp< string >( + 'postType', + productType, + 'date_created_gmt' + ); + const isBusy = isPublishing || isValidating; const isDisabled = disabled || isBusy || ! isDirty; @@ -53,7 +60,7 @@ export function usePublish< T = Product >( { function getButtonText() { if ( window.wcAdminFeatures[ 'product-pre-publish-modal' ] && - status === 'future' + isInTheFuture( editedDate ) ) { return __( 'Schedule', 'woocommerce' ); } diff --git a/packages/js/product-editor/src/components/prepublish-panel/prepublish-panel.tsx b/packages/js/product-editor/src/components/prepublish-panel/prepublish-panel.tsx index 1be8366147cb..412211e290d2 100644 --- a/packages/js/product-editor/src/components/prepublish-panel/prepublish-panel.tsx +++ b/packages/js/product-editor/src/components/prepublish-panel/prepublish-panel.tsx @@ -10,6 +10,7 @@ import { useEntityProp } from '@wordpress/core-data'; import { closeSmall } from '@wordpress/icons'; import classnames from 'classnames'; import type { Product } from '@woocommerce/data'; +import { isInTheFuture } from '@wordpress/date'; /** * Internal dependencies @@ -30,10 +31,10 @@ export function PrepublishPanel( { 'woocommerce' ), }: PrepublishPanelProps ) { - const [ editedDate, , date ] = useEntityProp< string >( + const [ editedDate ] = useEntityProp< string >( 'postType', productType, - 'date_created' + 'date_created_gmt' ); const [ productStatus, , prevStatus ] = useEntityProp< @@ -47,7 +48,7 @@ export function PrepublishPanel( { ? productStatus === 'publish' : true; - if ( editedDate !== date ) { + if ( isInTheFuture( editedDate ) ) { title = __( 'Are you ready to schedule this product?', 'woocommerce' ); description = __( 'Your product will be published at the specified date and time.', From 298ed3c680c6df301aaf6869ccd6b06046d907d7 Mon Sep 17 00:00:00 2001 From: Fernando Marichal Date: Tue, 19 Mar 2024 12:21:29 -0400 Subject: [PATCH 04/28] Fix section title styles in the pre-publish panel on WP 6.5 (#45689) * Fix section title * Add changelog --- .../changelog/fix-45590_prepublish_panel_section_title | 4 ++++ .../product-editor/src/components/prepublish-panel/style.scss | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 packages/js/product-editor/changelog/fix-45590_prepublish_panel_section_title diff --git a/packages/js/product-editor/changelog/fix-45590_prepublish_panel_section_title b/packages/js/product-editor/changelog/fix-45590_prepublish_panel_section_title new file mode 100644 index 000000000000..09ae59af686a --- /dev/null +++ b/packages/js/product-editor/changelog/fix-45590_prepublish_panel_section_title @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Fix section title styles in the pre-publish panel on WP 6.5 #45689 diff --git a/packages/js/product-editor/src/components/prepublish-panel/style.scss b/packages/js/product-editor/src/components/prepublish-panel/style.scss index a325916e501c..8f03be6c9f74 100644 --- a/packages/js/product-editor/src/components/prepublish-panel/style.scss +++ b/packages/js/product-editor/src/components/prepublish-panel/style.scss @@ -53,6 +53,10 @@ &__content { min-height: calc( 100% - #{ $header-height + 220px } ); + .editor-post-publish-panel__link { + font-weight: 400; + padding-left: $gap-smallest; + } } &__footer { From 8631fb5d487b4172fc6277edd63cc3510455d6a5 Mon Sep 17 00:00:00 2001 From: jonathansadowski Date: Tue, 19 Mar 2024 11:47:51 -0500 Subject: [PATCH 05/28] Prepare for WP 6.5 by updated tested / required versions. (#45633) --- plugins/woocommerce/changelog/update-wp-6.5 | 4 ++++ plugins/woocommerce/readme.txt | 4 ++-- plugins/woocommerce/woocommerce.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 plugins/woocommerce/changelog/update-wp-6.5 diff --git a/plugins/woocommerce/changelog/update-wp-6.5 b/plugins/woocommerce/changelog/update-wp-6.5 new file mode 100644 index 000000000000..3295f89d0c5b --- /dev/null +++ b/plugins/woocommerce/changelog/update-wp-6.5 @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Update required and tested up to WP versions for the WordPress 6.5 release. diff --git a/plugins/woocommerce/readme.txt b/plugins/woocommerce/readme.txt index 9154fa42cf8f..d4a15a83ee72 100644 --- a/plugins/woocommerce/readme.txt +++ b/plugins/woocommerce/readme.txt @@ -1,8 +1,8 @@ === WooCommerce === Contributors: automattic, woocommerce, mikejolley, jameskoster, claudiosanches, rodrigosprimo, peterfabian1000, vedjain, jamosova, obliviousharmony, konamiman, sadowski, wpmuguru, royho, barryhughes-1, claudiulodro, tiagonoronha, ryelle, levinmedia, aljullu, nerrad, joshuawold, assassinateur, haszari, mppfeiffer, nielslange, opr18, ralucastn, tjcafferkey, danielwrobert, patriciahillebrandt, albarin, dinhtungdu, imanish003, karolmanijak, sunyatasattva, alexandrelara, gigitux, danieldudzic, samueljseay, alexflorisca, opr18, tarunvijwani, pauloarromba, saadtarhi, bor0, kloon, coreymckrill, jorgeatorres, leifsinger Tags: online store, ecommerce, shop, shopping cart, sell online, storefront, checkout, payments, woo, woo commerce, e-commerce, store -Requires at least: 6.3 -Tested up to: 6.4 +Requires at least: 6.4 +Tested up to: 6.5 Requires PHP: 7.4 Stable tag: 8.6.1 License: GPLv3 diff --git a/plugins/woocommerce/woocommerce.php b/plugins/woocommerce/woocommerce.php index 55be5ab14bfc..6d89b6140acb 100644 --- a/plugins/woocommerce/woocommerce.php +++ b/plugins/woocommerce/woocommerce.php @@ -8,7 +8,7 @@ * Author URI: https://woo.com * Text Domain: woocommerce * Domain Path: /i18n/languages/ - * Requires at least: 6.3 + * Requires at least: 6.4 * Requires PHP: 7.4 * * @package WooCommerce From 2fc83cbe85ae70ca861b10f5172d9a80329fd5c7 Mon Sep 17 00:00:00 2001 From: Patricia Hillebrandt Date: Tue, 19 Mar 2024 17:51:38 +0100 Subject: [PATCH 06/28] [CYS on Core] Add the sample product badge before the product name to mark placeholder products. (#45691) * Add the sample badge to dummy products on the main products list. * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions --- ...the-product-name-to-mark-placeholder-products | 4 ++++ .../class-wc-admin-list-table-products.php | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 plugins/woocommerce/changelog/45691-45690-cys-on-core-add-the-sample-product-badge-before-the-product-name-to-mark-placeholder-products diff --git a/plugins/woocommerce/changelog/45691-45690-cys-on-core-add-the-sample-product-badge-before-the-product-name-to-mark-placeholder-products b/plugins/woocommerce/changelog/45691-45690-cys-on-core-add-the-sample-product-badge-before-the-product-name-to-mark-placeholder-products new file mode 100644 index 000000000000..92a1e62b8458 --- /dev/null +++ b/plugins/woocommerce/changelog/45691-45690-cys-on-core-add-the-sample-product-badge-before-the-product-name-to-mark-placeholder-products @@ -0,0 +1,4 @@ +Significance: minor +Type: enhancement + +Add the sample product badge before the product name to mark placeholder products. \ No newline at end of file diff --git a/plugins/woocommerce/includes/admin/list-tables/class-wc-admin-list-table-products.php b/plugins/woocommerce/includes/admin/list-tables/class-wc-admin-list-table-products.php index 73c58f160b6a..628fce7af66d 100644 --- a/plugins/woocommerce/includes/admin/list-tables/class-wc-admin-list-table-products.php +++ b/plugins/woocommerce/includes/admin/list-tables/class-wc-admin-list-table-products.php @@ -40,6 +40,7 @@ public function __construct() { add_filter( 'views_edit-product', array( $this, 'product_views' ) ); add_filter( 'get_search_query', array( $this, 'search_label' ) ); add_filter( 'posts_clauses', array( $this, 'posts_clauses' ), 10, 2 ); + add_action( 'manage_product_posts_custom_column', array( $this, 'add_sample_product_badge' ), 9, 2 ); } /** @@ -658,4 +659,19 @@ public function add_variation_parents_for_shipping_class( $pieces, $wp_query ) { return $pieces; } + /** + * Add a sample product badge to the product list table. + * + * @param string $column_name Column name. + * @param int $post_id Post ID. + * + * @since 8.8.0 + */ + public function add_sample_product_badge( $column_name, $post_id ) { + $is_sample_product = 'product' === get_post_type( $post_id ) && get_post_meta( $post_id, '_headstart_post', true ); + + if ( $is_sample_product && 'name' === $column_name ) { + echo '' . esc_html__( 'Sample', 'woocommerce' ) . ''; + } + } } From 61236dab0df2f1aead7f639845f48acf20b47a67 Mon Sep 17 00:00:00 2001 From: Patricia Hillebrandt Date: Tue, 19 Mar 2024 17:57:24 +0100 Subject: [PATCH 07/28] =?UTF-8?q?[CYS=20on=20Core]=20Ensure=20the=20"Didn?= =?UTF-8?q?=E2=80=99t=20find=20a=20theme=20you=20like"=20text=20is=20displ?= =?UTF-8?q?ayed=20exclusively=20at=20the=20bottom=20of=20the=20themes=20ca?= =?UTF-8?q?rd=20(#45706)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Ensure the 'Didn’t find a theme you like' text is displayed exclusively at the bottom of the themes card * Limit the display of the CYS design banner to the Themes screen. * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions --- .../product-list-content.tsx | 65 +++++-------------- .../components/products/products.tsx | 34 +++++++++- ...oter-copy-being-displayed-on-discover-card | 4 ++ 3 files changed, 55 insertions(+), 48 deletions(-) create mode 100644 plugins/woocommerce/changelog/45706-fix-themes-card-footer-copy-being-displayed-on-discover-card diff --git a/plugins/woocommerce-admin/client/marketplace/components/product-list-content/product-list-content.tsx b/plugins/woocommerce-admin/client/marketplace/components/product-list-content/product-list-content.tsx index 55283701496e..91028817c34a 100644 --- a/plugins/woocommerce-admin/client/marketplace/components/product-list-content/product-list-content.tsx +++ b/plugins/woocommerce-admin/client/marketplace/components/product-list-content/product-list-content.tsx @@ -1,14 +1,8 @@ /** * External dependencies */ -import { - createInterpolateElement, - Fragment, - useEffect, - useState, -} from '@wordpress/element'; +import { Fragment, useEffect, useState } from '@wordpress/element'; import classnames from 'classnames'; -import { __ } from '@wordpress/i18n'; import { addQueryArgs } from '@wordpress/url'; /** @@ -120,49 +114,26 @@ export default function ProductListContent( props: { } ), } } /> - { index === bannerPosition && ( - { - const customizeStoreDesignUrl = - addQueryArgs( - `${ ADMIN_URL }admin.php`, - { - page: 'wc-admin', - path: '/customize-store/design', - } - ); - window.location.href = - customizeStoreDesignUrl; - } } - /> - ) } + { index === bannerPosition && + props.type === 'theme' && ( + { + const customizeStoreDesignUrl = + addQueryArgs( + `${ ADMIN_URL }admin.php`, + { + page: 'wc-admin', + path: '/customize-store/design', + } + ); + window.location.href = + customizeStoreDesignUrl; + } } + /> + ) } ) ) } -
- { __( 'Didn’t find a theme you like?', 'woocommerce' ) } - { createInterpolateElement( - __( - ' Browse the WordPress.org theme directory to discover more.', - 'woocommerce' - ), - { - a: ( - // eslint-disable-next-line jsx-a11y/anchor-has-content - - ), - } - ) } -
); } diff --git a/plugins/woocommerce-admin/client/marketplace/components/products/products.tsx b/plugins/woocommerce-admin/client/marketplace/components/products/products.tsx index 2d2528505172..3b23df17cab5 100644 --- a/plugins/woocommerce-admin/client/marketplace/components/products/products.tsx +++ b/plugins/woocommerce-admin/client/marketplace/components/products/products.tsx @@ -2,7 +2,11 @@ * External dependencies */ import { __, _n, sprintf } from '@wordpress/i18n'; -import { useContext, useState } from '@wordpress/element'; +import { + createInterpolateElement, + useContext, + useState, +} from '@wordpress/element'; import { getNewPath, navigateTo, useQuery } from '@woocommerce/navigation'; import { Button } from '@wordpress/components'; import classnames from 'classnames'; @@ -173,6 +177,34 @@ export default function Products( props: ProductsProps ) { searchTerm={ props.searchTerm } category={ category } /> + { props.type === 'theme' && ( +
+ + { __( 'Didn’t find a theme you like?', 'woocommerce' ) } + + { createInterpolateElement( + __( + ' Browse the WordPress.org theme directory to discover more.', + 'woocommerce' + ), + { + a: ( + // eslint-disable-next-line jsx-a11y/anchor-has-content + + ), + } + ) } +
+ ) } { showAllButton && (