Merge branch 'trunk' into add/api-tests-orders-crud

This commit is contained in:
Rodel 2021-11-10 21:47:35 +08:00
commit 684e1a19da
30 changed files with 11243 additions and 400 deletions

14
.gitignore vendored
View File

@ -5,10 +5,19 @@ Thumbs.db
# IDE files
.idea
.vscode/
project.xml
project.properties
.project
.settings*
*.sublime-project
*.sublime-workspace
.sublimelinterrc
# Eslint Cache
.eslintcache
# Environment files
wp-cli.local.yml
.wp-env.override.json
yarn-error.log
npm-debug.log
.pnpm-debug.log
@ -22,6 +31,7 @@ npm-debug.log
build/
build-module/
build-style/
dist/
# Project files
node_modules/
@ -37,5 +47,3 @@ tsconfig.tsbuildinfo
/tmp
packages/js/e2e-environment/config/default.json
packages/js/e2e-environment/docker/wp-cli/initialize.sh
packages/js/e2e-environment/build/
packages/js/e2e-environment/build-module/

37
nx.json
View File

@ -1,20 +1,17 @@
{
"npmScope": "woocommerce",
"affected": {
"defaultBase": "trunk"
},
"implicitDependencies": {
"package.json": {
"dependencies": "*",
"devDependencies": "*"
},
".eslintrc.json": "*"
},
"extends": "@nrwl/workspace/presets/npm.json",
"npmScope": "woocommerce-monorepo",
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/workspace/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"]
"cacheableOperations": [
"build",
"test",
"lint",
"package",
"prepare"
]
}
}
},
@ -24,7 +21,21 @@
"target": "build",
"projects": "dependencies"
}
],
"prepare": [
{
"target": "prepare",
"projects": "dependencies"
}
],
"package": [
{
"target": "package",
"projects": "dependencies"
}
]
},
"projects": {}
"affected": {
"defaultBase": "trunk"
}
}

View File

@ -1,39 +1,45 @@
{
"name": "woocommerce-monorepo",
"title": "WooCommerce Monorepo",
"description": "Monorepo for the WooCommerce ecosystem",
"homepage": "https://woocommerce.com/",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce.git"
},
"author": "Automattic",
"license": "GPL-3.0-or-later",
"bugs": {
"url": "https://github.com/woocommerce/woocommerce/issues"
},
"devDependencies": {
"@nrwl/tao": "12.10.0",
"@nrwl/cli": "12.10.0",
"@nrwl/workspace": "12.10.0",
"@types/node": "14.14.33",
"@woocommerce/eslint-plugin": "^1.2.0",
"@wordpress/prettier-config": "^1.0.5",
"chalk": "^4.1.2",
"glob": "^7.2.0",
"jest": "^27.0.6",
"mkdirp": "^1.0.4",
"node-stream-zip": "^1.13.6",
"prettier": "npm:wp-prettier@2.2.1-beta-1",
"request": "^2.88.2",
"typescript": "4.2.4"
},
"dependencies": {
"@babel/core": "7.12.9",
"@wordpress/babel-plugin-import-jsx-pragma": "^3.1.0",
"@wordpress/babel-preset-default": "^6.3.3",
"lodash": "^4.17.21",
"wp-textdomain": "1.0.1"
}
"name": "woocommerce-monorepo",
"title": "WooCommerce Monorepo",
"description": "Monorepo for the WooCommerce ecosystem",
"homepage": "https://woocommerce.com/",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce.git"
},
"author": "Automattic",
"license": "GPL-3.0-or-later",
"bugs": {
"url": "https://github.com/woocommerce/woocommerce/issues"
},
"scripts": {
"preinstall": "npx only-allow pnpm"
},
"devDependencies": {
"@automattic/nx-composer": "^0.1.0",
"@nrwl/cli": "latest",
"@nrwl/linter": "^13.1.3",
"@nrwl/tao": "latest",
"@nrwl/web": "^13.1.3",
"@nrwl/workspace": "latest",
"@types/node": "14.14.33",
"@woocommerce/eslint-plugin": "^1.2.0",
"@wordpress/prettier-config": "^1.0.5",
"chalk": "^4.1.2",
"glob": "^7.2.0",
"jest": "^27.0.6",
"mkdirp": "^1.0.4",
"node-stream-zip": "^1.13.6",
"prettier": "npm:wp-prettier@2.2.1-beta-1",
"request": "^2.88.2",
"typescript": "4.2.4"
},
"dependencies": {
"@babel/core": "7.12.9",
"@wordpress/babel-plugin-import-jsx-pragma": "^3.1.0",
"@wordpress/babel-preset-default": "^6.3.3",
"lodash": "^4.17.21",
"wp-textdomain": "1.0.1"
}
}

View File

@ -1,8 +1,2 @@
# Node modules
node_modules/
# Environment
.env
# Collection output
collection.json

View File

@ -0,0 +1,31 @@
{
"root": "packages/js/api-core-tests/",
"sourceRoot": "packages/js/api-core-tests",
"projectType": "library",
"targets": {
"test": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "test"
}
},
"test-hello": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "test:hello"
}
},
"make-collection": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "make:collection"
}
},
"test-api": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "test:api"
}
}
}
}

View File

@ -1,12 +1,9 @@
module.exports = {
parser: '@typescript-eslint/parser',
env: {
'jest/globals': true
'jest/globals': true,
},
ignorePatterns: [
'dist/',
'node_modules/'
],
ignorePatterns: [ 'dist/', 'node_modules/' ],
rules: {
'no-unused-vars': 'off',
'no-dupe-class-members': 'off',
@ -14,18 +11,11 @@ module.exports = {
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 2,
},
plugins: [
'@typescript-eslint'
],
extends: [
'plugin:@wordpress/eslint-plugin/recommended-with-formatting'
],
plugins: [ '@typescript-eslint/eslint-plugin' ],
extends: [ 'plugin:@wordpress/eslint-plugin/recommended-with-formatting' ],
overrides: [
{
files: [
'**/*.js',
'**/*.ts'
],
files: [ '**/*.js', '**/*.ts' ],
settings: {
jsdoc: {
mode: 'typescript',
@ -33,13 +23,10 @@ module.exports = {
},
},
{
files: [
'**/*.spec.ts',
'**/*.test.ts'
],
files: [ '**/*.spec.ts', '**/*.test.ts' ],
rules: {
'no-console': 'off',
}
}
]
}
},
},
],
};

View File

@ -1,18 +1,2 @@
# Editors
project.xml
project.properties
/nbproject/private/
.buildpath
.project
.settings*
.idea
.vscode
*.sublime-project
*.sublime-workspace
.sublimelinterrc
# Build Artifacts
/node_modules/
/dist/
tsconfig.tsbuildinfo

6711
packages/js/api/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -43,6 +43,9 @@
"@types/jest": "25.2.1",
"@types/moxios": "^0.4.9",
"@types/node": "13.13.5",
"@typescript-eslint/eslint-plugin": "^5.3.0",
"@typescript-eslint/parser": "^5.3.0",
"eslint": "^8.1.0",
"jest": "^25.1.0",
"jest-mock-extended": "^1.0.10",
"moxios": "0.4.0",

View File

@ -0,0 +1,43 @@
{
"root": "packages/js/api/",
"sourceRoot": "packages/js/api/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "build"
}
},
"clean": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "clean"
}
},
"compile": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "compile"
}
},
"prepare": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "prepare"
}
},
"lint": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "lint"
}
},
"test": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "test"
}
}
}
}

View File

@ -0,0 +1,5 @@
{
"root": "packages/js/e2e-core-tests/",
"sourceRoot": "packages/js/e2e-core-tests",
"projectType": "library"
}

View File

@ -2,7 +2,11 @@
echo "Initializing WooCommerce E2E"
wp plugin activate woocommerce
# This is a workaround to accommodate different directory names.
wp plugin activate --all
wp plugin deactivate akismet
wp plugin deactivate hello
wp theme install twentynineteen --activate
wp user create customer customer@woocommercecoree2etestsuite.com \
--user_pass=password \

View File

@ -41,6 +41,7 @@
"@babel/polyfill": "7.12.1",
"@babel/preset-env": "7.12.7",
"@wordpress/eslint-plugin": "7.3.0",
"eslint": "^8.1.0",
"ndb": "^1.1.5",
"semver": "^7.3.2"
},
@ -58,7 +59,8 @@
"docker:ssh": "docker exec -it $(node utils/get-app-name.js)_wordpress-www /bin/bash",
"test:e2e": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js",
"test:e2e-debug": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev --debug",
"test:e2e-dev": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev"
"test:e2e-dev": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev",
"lint": "eslint src"
},
"bin": {
"wc-e2e": "bin/wc-e2e.sh"

View File

@ -0,0 +1,79 @@
{
"root": "packages/js/e2e-environment/",
"sourceRoot": "packages/js/e2e-environment/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "build"
}
},
"lint": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "lint"
}
},
"clean": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "clean"
}
},
"compile": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "compile"
}
},
"prepare": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "prepare"
}
},
"docker-up": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "docker:up"
}
},
"docker-down": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "docker:down"
}
},
"docker-clear-all": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "docker:clear-all"
}
},
"docker-ssh": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "docker:ssh"
}
},
"test-e2e": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "test:e2e"
}
},
"test-e2e-debug": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "test:e2e-debug"
}
},
"test-e2e-dev": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "test:e2e-dev"
}
}
}
}

View File

@ -0,0 +1,32 @@
module.exports = {
parser: '@typescript-eslint/parser',
env: {
'jest/globals': true,
},
ignorePatterns: [ 'dist/', 'node_modules/' ],
rules: {
'no-unused-vars': 'off',
'no-dupe-class-members': 'off',
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 2,
},
plugins: [ '@typescript-eslint/eslint-plugin' ],
extends: [ 'plugin:@wordpress/eslint-plugin/recommended-with-formatting' ],
overrides: [
{
files: [ '**/*.js', '**/*.ts' ],
settings: {
jsdoc: {
mode: 'typescript',
},
},
},
{
files: [ '**/*.spec.ts', '**/*.test.ts' ],
rules: {
'no-console': 'off',
},
},
],
};

View File

@ -17,6 +17,11 @@
"faker": "^5.1.0",
"fishery": "^1.2.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.3.0",
"@typescript-eslint/parser": "^5.3.0",
"eslint": "^8.1.0"
},
"peerDependencies": {
"@woocommerce/api": "^0.2.0"
},
@ -27,6 +32,7 @@
"clean": "rm -rf ./build ./build-module",
"compile": "node ./../bin/build.js",
"build": "pnpm run clean && pnpm run compile",
"prepare": "pnpm run build"
"prepare": "pnpm run build",
"lint": "eslint src"
}
}

View File

@ -0,0 +1,37 @@
{
"root": "packages/js/e2e-utils/",
"sourceRoot": "packages/js/e2e-utils/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "build"
}
},
"clean": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "clean"
}
},
"compile": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "compile"
}
},
"prepare": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "prepare"
}
},
"lint": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "lint"
}
}
}
}

View File

@ -1,20 +1,7 @@
# Editors
project.xml
project.properties
/nbproject/private/
.buildpath
.project
.settings*
.idea
.vscode
.eslintcache
*.sublime-project
*.sublime-workspace
.sublimelinterrc
*.swp
# Grunt
node_modules/
none
# Sass
@ -27,12 +14,6 @@ none
# Minified JS
/assets/js/**/*.min.js
# OS X metadata
.DS_Store
# Windows junk
Thumbs.db
# Behat/CLI Tests
tests/cli/installer
tests/cli/composer.phar
@ -46,15 +27,9 @@ tests/cli/vendor
/tests/e2e/config/local-*.json
/tests/e2e/config/local.json
/tests/e2e/config/default.json
/tests/e2e/env/config/default.json
/tests/e2e/docker
/tests/e2e/env/docker/wp-cli/initialize.sh
/tests/e2e/env/build/
/tests/e2e/env/build-module/
/tests/e2e/screenshots
/tests/e2e/plugins
/tests/e2e/utils/build/
/tests/e2e/utils/build-module/
# Logs
/logs
@ -73,12 +48,5 @@ yarn.lock
/packages/*
!/packages/README.md
# Screenshots for e2e tests failures
/screenshots/
# Language files
i18n/languages/woocommerce.pot
# Build
build/
woocommerce.zip

View File

@ -366,6 +366,17 @@
color: #fff;
}
.addons-button-promoted {
float: right;
width: auto;
padding: 0 20px;
margin-top: 0;
}
.addons-button-promoted:hover {
opacity: 0.8;
}
.addons-button-expandable {
display: inline-block;
padding: 0 16px;
@ -504,6 +515,10 @@
padding: 0;
vertical-align: top;
&.addons-full-width {
max-width: 100%;
}
@media only screen and ( max-width: 768px ) {
max-width: none;
width: 100%;
@ -567,6 +582,35 @@
color: #1d2327; // Gray / Gray 90
}
&.featured,
&.promoted {
.label {
align-items: center;
border-radius: 2px;
background: #dcdcde;
display: flex;
flex-direction: row;
height: 20px;
justify-content: flex-end;
margin-bottom: 8px;
max-width: 52px;
padding: 3px 12px;
top: 28px;
right: 24px;
text-align: center;
&.promoted {
float: right;
max-width: 58px;
}
}
h2 {
color: #2c3338;
}
}
p {
color: #2c3338;
font-size: 14px;
@ -670,6 +714,18 @@
}
}
.product-footer-promoted {
align-items: flex-end;
display: flex;
justify-content: space-between;
padding: 24px;
.icon img {
border-radius: 4px;
width: 80px;
}
}
.addons-buttons-banner {
display: flex;
flex-direction: row;

View File

@ -269,6 +269,24 @@ return array(
'ZG' => __( 'Zug', 'woocommerce' ),
'ZH' => __( 'Zürich', 'woocommerce' ),
),
'CL' => array( // Chile states.
'CL-AI' => __( 'Aisén del General Carlos Ibañez del Campo', 'woocommerce' ),
'CL-AN' => __( 'Antofagasta', 'woocommerce' ),
'CL-AP' => __( 'Arica y Parinacota', 'woocommerce' ),
'CL-AR' => __( 'La Araucanía', 'woocommerce' ),
'CL-AT' => __( 'Atacama', 'woocommerce' ),
'CL-BI' => __( 'Biobío', 'woocommerce' ),
'CL-CO' => __( 'Coquimbo', 'woocommerce' ),
'CL-LI' => __( 'Libertador General Bernardo O\'Higgins', 'woocommerce' ),
'CL-LL' => __( 'Los Lagos', 'woocommerce' ),
'CL-LR' => __( 'Los Ríos', 'woocommerce' ),
'CL-MA' => __( 'Magallanes', 'woocommerce' ),
'CL-ML' => __( 'Maule', 'woocommerce' ),
'CL-NB' => __( 'Ñuble', 'woocommerce' ),
'CL-RM' => __( 'Región Metropolitana de Santiago', 'woocommerce' ),
'CL-TA' => __( 'Tarapacá', 'woocommerce' ),
'CL-VS' => __( 'Valparaíso', 'woocommerce' ),
),
'CN' => array( // Chinese states.
'CN1' => __( 'Yunnan / 云南', 'woocommerce' ),
'CN2' => __( 'Beijing / 北京', 'woocommerce' ),
@ -534,7 +552,7 @@ return array(
'SO' => __( 'Sololá', 'woocommerce' ),
'SU' => __( 'Suchitepéquez', 'woocommerce' ),
'TO' => __( 'Totonicapán', 'woocommerce' ),
'ZA' => __( 'Zacapa', 'woocommerce' )
'ZA' => __( 'Zacapa', 'woocommerce' ),
),
'HK' => array( // Hong Kong states.
'HONG KONG' => __( 'Hong Kong Island', 'woocommerce' ),
@ -1818,7 +1836,7 @@ return array(
'AE' => __( 'Armed Forces (AE)', 'woocommerce' ),
'AP' => __( 'Armed Forces (AP)', 'woocommerce' ),
),
'VE' => array( // Venezuela States. Ref: https://github.com/unicode-org/cldr/blob/release-38-1/common/subdivisions/en.xml#L5426-L5451
'VE' => array( // Venezuela States.
'A' => __( 'Capital', 'woocommerce' ),
'B' => __( 'Anzoátegui', 'woocommerce' ),
'C' => __( 'Apure', 'woocommerce' ),
@ -1843,7 +1861,7 @@ return array(
'W' => __( 'Federal Dependencies', 'woocommerce' ),
'X' => __( 'Vargas', 'woocommerce' ),
'Y' => __( 'Delta Amacuro', 'woocommerce' ),
'Z' => __( 'Amazonas', 'woocommerce' )
'Z' => __( 'Amazonas', 'woocommerce' ),
),
'VN' => array(),
'YT' => array(),

View File

@ -26,7 +26,7 @@ class WC_Admin_Addons {
* @return array of objects
*/
public static function get_featured() {
$featured = get_transient( 'wc_addons_featured' );
$featured = get_transient( 'wc_addons_featured_2' );
if ( false === $featured ) {
$headers = array();
$auth = WC_Helper_Options::get( 'auth' );
@ -46,7 +46,7 @@ class WC_Admin_Addons {
if ( ! is_wp_error( $raw_featured ) ) {
$featured = json_decode( wp_remote_retrieve_body( $raw_featured ) );
if ( $featured ) {
set_transient( 'wc_addons_featured', $featured, DAY_IN_SECONDS );
set_transient( 'wc_addons_featured_2', $featured, DAY_IN_SECONDS );
}
}
}
@ -891,6 +891,7 @@ class WC_Admin_Addons {
* Output HTML for a promotion action.
*
* @param array $action Array of action properties.
*
* @return void
*/
public static function output_promotion_action( array $action ) {
@ -1056,7 +1057,7 @@ class WC_Admin_Addons {
if ( $rating >= $index ) {
// Rating more that current star to show.
return 'fill';
} else if (
} elseif (
abs( $index - 1 - floor( $rating ) ) < 0.0000001 &&
0 < ( $rating - floor( $rating ) )
) {
@ -1206,6 +1207,15 @@ class WC_Admin_Addons {
if ( null === $mapped->reviews_count ) {
$mapped->reviews_count = $data->reviewsCount ?? null; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
}
// Featured & Promoted product card.
// Label.
$mapped->label = $data->label ?? null;
// Primary color.
$mapped->primary_color = $data->primary_color ?? null;
// Text color.
$mapped->text_color = $data->text_color ?? null;
// Button text.
$mapped->button = $data->button ?? null;
return $mapped;
}
@ -1234,25 +1244,69 @@ class WC_Admin_Addons {
if ( 'banner' === $block_type ) {
$product_details_classes .= ' addon-product-banner-details';
}
?>
if ( isset( $mapped->label ) && 'promoted' === $mapped->label ) {
$product_details_classes .= ' promoted';
} elseif ( isset( $mapped->label ) && 'featured' === $mapped->label ) {
$product_details_classes .= ' featured';
}
if ( 'promoted' === $mapped->label
&& ! empty( $mapped->primary_color )
&& ! empty( $mapped->text_color )
&& ! empty( $mapped->button ) ) {
// Promoted product card.
?>
<li class="product">
<div class="<?php echo esc_attr( $product_details_classes ); ?>" style="border-top: 5px solid <?php echo esc_html( $mapped->primary_color ); ?>;">
<span class="label promoted"><?php esc_attr_e( 'Promoted', 'woocommerce' ); ?></span>
<a href="<?php echo esc_url( $product_url ); ?>">
<h2><?php echo esc_html( $mapped->title ); ?></h2>
</a>
<p><?php echo wp_kses_post( $mapped->description ); ?></p>
</div>
<div class="product-footer-promoted">
<span class="icon"><img src="<?php echo esc_url( $mapped->icon ); ?>" /></span>
<a class="addons-button addons-button-promoted" style="background: <?php echo esc_html( $mapped->primary_color ); ?>; color: <?php echo esc_html( $mapped->text_color ); ?>;" href="<?php echo esc_url( $product_url ); ?>">
<?php echo esc_html( $mapped->button ); ?>
</a>
</div>
</li>
<?php
} else {
// Normal or "featured" product card.
?>
<li class="<?php echo esc_attr( implode( ' ', $class_names ) ); ?>">
<div class="<?php echo esc_attr( $product_details_classes ); ?>">
<div class="product-text-container">
<?php if ( isset( $mapped->label ) && 'featured' === $mapped->label ) { ?>
<span class="label featured"><?php esc_attr_e( 'Featured', 'woocommerce' ); ?></span>
<?php } ?>
<a href="<?php echo esc_url( $product_url ); ?>">
<h2><?php echo esc_html( $mapped->title ); ?></h2>
</a>
<?php if ( ! empty( $mapped->vendor_name ) && ! empty( $mapped->vendor_url ) ) : ?>
<div class="product-developed-by">
<?php
printf(
/* translators: %s vendor link */
esc_html__( 'Developed by %s', 'woocommerce' ),
sprintf(
'<a class="product-vendor-link" href="%1$s" target="_blank">%2$s</a>',
esc_url_raw( $mapped->vendor_url ),
esc_html( $mapped->vendor_name )
)
);
$vendor_url = add_query_arg(
array(
'utm_source' => 'extensionsscreen',
'utm_medium' => 'product',
'utm_campaign' => 'wcaddons',
'utm_content' => 'devpartner',
),
$mapped->vendor_url
);
printf(
/* translators: %s vendor link */
esc_html__( 'Developed by %s', 'woocommerce' ),
sprintf(
'<a class="product-vendor-link" href="%1$s" target="_blank">%2$s</a>',
esc_url_raw( $vendor_url ),
esc_html( $mapped->vendor_name )
)
);
?>
</div>
<?php endif; ?>
@ -1303,6 +1357,7 @@ class WC_Admin_Addons {
</a>
</div>
</li>
<?php
<?php
}
}
}

View File

@ -111,7 +111,7 @@ class WC_Admin_Setup_Wizard {
$country_code = WC()->countries->get_base_country();
// https://developers.taxjar.com/api/reference/#countries .
$tax_supported_countries = array_merge(
array( 'US', 'CA', 'AU' ),
array( 'US', 'CA', 'AU', 'GB' ),
WC()->countries->get_european_union_countries()
);

View File

@ -112,8 +112,9 @@ $current_section_name = __( 'Browse Categories', 'woocommerce' );
continue;
}
}
WC_Admin_Addons::render_product_card( $addon );
?>
<?php WC_Admin_Addons::render_product_card( $addon ); ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>

View File

@ -30,7 +30,7 @@ if ( ! class_exists( 'WC_Email_Customer_On_Hold_Order', false ) ) :
$this->id = 'customer_on_hold_order';
$this->customer_email = true;
$this->title = __( 'Order on-hold', 'woocommerce' );
$this->description = __( 'This is an order notification sent to customers containing order details after an order is placed on-hold.', 'woocommerce' );
$this->description = __( 'This is an order notification sent to customers containing order details after an order is placed on-hold from Pending, Cancelled or Failed order status.', 'woocommerce' );
$this->template_html = 'emails/customer-on-hold-order.php';
$this->template_plain = 'emails/plain/customer-on-hold-order.php';
$this->placeholders = array(

View File

@ -14,6 +14,7 @@
},
"scripts": {
"check:subset-installed": "pnpm list --depth 1 install-subset > /dev/null 2>&1",
"preinstall": "npx only-allow pnpm",
"install:subset-only": "pnpm install --no-package-lock --no-save install-subset",
"install:no-e2e": "pnpm run check:subset-installed --silent || pnpm run install:subset-only && pnpx install-subset i no-e2e",
"build": "./bin/build-zip.sh",

View File

@ -0,0 +1,115 @@
{
"root": "plugins/woocommerce/",
"sourceRoot": "plugins/woocommerce",
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "build"
}
},
"build-core": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "build:core"
}
},
"build-zip": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "build:zip"
}
},
"build-watch": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "build-watch"
}
},
"build-assets": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "build:assets"
}
},
"lint-js": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "lint:js"
}
},
"docker-up": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "docker:up"
}
},
"docker-down": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "docker:down"
}
},
"docker-ssh": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "docker:ssh"
}
},
"test-api": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "test:api"
}
},
"test-e2e": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "test:e2e"
}
},
"test-e2e-debug": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "test:e2e-debug"
}
},
"test-e2e-dev": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "test:e2e-dev"
}
},
"test-unit": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "test:unit"
}
},
"makepot": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "makepot"
}
},
"packages-fix-text-domain": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "packages:fix:textdomain"
}
},
"git-update-hooks": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "git:update-hooks"
}
},
"make-collection": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "make:collection"
}
}
}
}

View File

@ -2,7 +2,11 @@
echo "Initializing WooCommerce E2E"
wp plugin activate woocommerce
# This is a workaround to accommodate different directory names.
wp plugin activate --all
wp plugin deactivate akismet
wp plugin deactivate hello
wp theme install twentynineteen --activate
wp user create customer customer@woocommercecoree2etestsuite.com \
--user_pass=password \

View File

@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"references": [
{ "path": "tests/e2e/api" }
{ "path": "../../packages/js/api" }
],
"files": []
}

File diff suppressed because it is too large Load Diff

View File

@ -3,9 +3,9 @@
"projects": {
"@woocommerce/api": "packages/js/api",
"@woocommerce/api-core-tests": "packages/js/api-core-tests",
"@woocommerce/e2e-core-tests": "packages/js/core-tests",
"@woocommerce/e2e-core-tests": "packages/js/e2e-core-tests",
"@woocommerce/e2e-environment": "packages/js/e2e-environment",
"@woocommerce/e2e-utils": "packages/js/utils",
"@woocommerce/e2e-utils": "packages/js/e2e-utils",
"woocommerce": "plugins/woocommerce"
}
}