Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
Always show pre-publish checks
checkbox (#44595)
* Add show-prepublish-checks-section # Conflicts: # packages/js/product-editor/src/components/prepublish-panel/prepublish-panel.tsx # Conflicts: # packages/js/product-editor/src/components/prepublish-panel/style.scss * Add show-prepublish-checks hook * Refactor prepublish panel button visiblity # Conflicts: # packages/js/product-editor/src/components/header/header.tsx # Conflicts: # packages/js/product-editor/src/components/header/header.tsx * Fix footer styles * Add changelogs * Add content div * Fix styles # Conflicts: # packages/js/product-editor/src/components/prepublish-panel/style.scss * Rename recorded action * Fix styles * Hide panel after unchecking option * Improve resolving * Add new E2E test for merchant transforming classic cart to cart block (#44926) * Update the monorepo-utils gitignore to only include index.js and its license file. (#44932) * Fixed `@woocommerce/plugin-woocommerce` Watch (#44930) By default `nodemon` only watches for JS file changes. This expands the config so that it watch the file extensions that are actually produced by builds. * Update core package.json to remove nightly ci config (#45096) * Update core package.json to remove nightly ci config * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com> * Update blocks build message (#44811) * Update blocks build message * Add changefile(s) from automation for the following project(s): woocommerce * Update plugins/woocommerce/src/Blocks/Domain/Bootstrap.php Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> * Update plugins/woocommerce/src/Blocks/Domain/Bootstrap.php Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> * [CYS on Core] Update the themes list on the intro screen (#44822) * Update themes list on core. Update the themes data and remove hardcoded reference to free themes. * Update styles for the Free, Paid and active cards. * Add the color palletes to TT4 theme. * Update the references for default and core themes. * Add changefile(s) from automation for the following project(s): woocommerce * Update the link to TT4 theme * Update default value for price. --------- Co-authored-by: github-actions <github-actions@github.com> --------- Co-authored-by: Veljko V <veljano@yahoo.com> Co-authored-by: jonathansadowski <jonathansadowski@users.noreply.github.com> Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Roy Ho <roykho77@gmail.com> Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
- Loading branch information
1 parent
3d045a1
commit 3d3f6d6
Showing
10 changed files
with
137 additions
and
4 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/js/product-editor/changelog/add-43707_show_prepublish_checks_section
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: add | ||
|
||
Add Always show pre-publish checks checkbox #44595 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...js/product-editor/src/components/prepublish-panel/show-prepublish-checks-section/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './show-prepublish-checks-section'; |
39 changes: 39 additions & 0 deletions
39
...onents/prepublish-panel/show-prepublish-checks-section/show-prepublish-checks-section.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { createElement } from '@wordpress/element'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { recordEvent } from '@woocommerce/tracks'; | ||
import { CheckboxControl } from '@wordpress/components'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { TRACKS_SOURCE } from '../../../constants'; | ||
import { useShowPrepublishChecks } from '../../../hooks/use-show-prepublish-checks'; | ||
|
||
export function ShowPrepublishChecksSection() { | ||
const { isResolving, showPrepublishChecks, togglePrepublishChecks } = | ||
useShowPrepublishChecks(); | ||
|
||
if ( isResolving ) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div className="woocommerce-publish-panel-show-checks"> | ||
<CheckboxControl | ||
label={ __( 'Always show pre-publish checks.', 'woocommerce' ) } | ||
checked={ showPrepublishChecks } | ||
onChange={ ( selected: boolean ) => { | ||
togglePrepublishChecks(); | ||
recordEvent( 'product_prepublish_panel', { | ||
source: TRACKS_SOURCE, | ||
action: 'toggle_prepublish_checks', | ||
value: selected, | ||
} ); | ||
} } | ||
/> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/js/product-editor/src/hooks/use-show-prepublish-checks.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { useSelect, useDispatch } from '@wordpress/data'; | ||
import { OPTIONS_STORE_NAME } from '@woocommerce/data'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { SHOW_PREPUBLISH_CHECKS_ENABLED_OPTION_NAME } from '../constants'; | ||
|
||
export function useShowPrepublishChecks() { | ||
const { updateOptions } = useDispatch( OPTIONS_STORE_NAME ); | ||
|
||
const { isResolving, showPrepublishChecks } = useSelect( ( select ) => { | ||
const { getOption, hasFinishedResolution } = | ||
select( OPTIONS_STORE_NAME ); | ||
|
||
const showPrepublishChecksOption = | ||
getOption( SHOW_PREPUBLISH_CHECKS_ENABLED_OPTION_NAME ) || 'yes'; | ||
|
||
const resolving = ! hasFinishedResolution( 'getOption', [ | ||
SHOW_PREPUBLISH_CHECKS_ENABLED_OPTION_NAME, | ||
] ); | ||
|
||
return { | ||
isResolving: resolving, | ||
showPrepublishChecks: showPrepublishChecksOption === 'yes', | ||
}; | ||
}, [] ); | ||
|
||
const togglePrepublishChecks = () => { | ||
updateOptions( { | ||
[ SHOW_PREPUBLISH_CHECKS_ENABLED_OPTION_NAME ]: showPrepublishChecks | ||
? 'no' | ||
: 'yes', | ||
} ); | ||
}; | ||
|
||
return { | ||
isResolving, | ||
showPrepublishChecks, | ||
togglePrepublishChecks, | ||
}; | ||
} |
4 changes: 4 additions & 0 deletions
4
plugins/woocommerce/changelog/add-43707_show_prepublish_checks_section
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: add | ||
|
||
Add Always show pre-publish checks checkbox #44595 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters