diff --git a/.github/actions/setup-woocommerce-monorepo/action.yml b/.github/actions/setup-woocommerce-monorepo/action.yml
index 037794d8631..ff077909f57 100644
--- a/.github/actions/setup-woocommerce-monorepo/action.yml
+++ b/.github/actions/setup-woocommerce-monorepo/action.yml
@@ -1,5 +1,6 @@
name: Setup WooCommerce Monorepo
description: Handles the installation, building, and caching of the projects within the monorepo.
+permissions: {}
inputs:
install-filters:
diff --git a/.github/workflows/build-release-zip-file.yml b/.github/workflows/build-release-zip-file.yml
index c1cc55eb04d..f07d234fc40 100644
--- a/.github/workflows/build-release-zip-file.yml
+++ b/.github/workflows/build-release-zip-file.yml
@@ -6,10 +6,15 @@ on:
description: 'By default the zip file is generated from the branch the workflow runs from, but you can specify an explicit reference to use instead here (e.g. refs/tags/tag_name or refs/heads/release/x.x). The resulting file will be available as an artifact on the workflow run.'
required: false
default: ''
+
+permissions: {}
+
jobs:
build:
name: Build release zip file
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml
index ba2b99d4814..5c02d361b52 100644
--- a/.github/workflows/build-release.yml
+++ b/.github/workflows/build-release.yml
@@ -2,10 +2,15 @@ name: Build release asset
on:
release:
types: [published]
+
+permissions: {}
+
jobs:
build:
name: Build release asset
runs-on: ubuntu-20.04
+ permissions:
+ contents: write
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/bump-wp-l-2-support.yml b/.github/workflows/bump-wp-l-2-support.yml
new file mode 100644
index 00000000000..71ea90ad73e
--- /dev/null
+++ b/.github/workflows/bump-wp-l-2-support.yml
@@ -0,0 +1,287 @@
+name: Bump WP L-2 Support
+on:
+ workflow_dispatch:
+ inputs:
+ releaseBranch:
+ description: Provide the release branch you want to bump the WP L-2 support. Example release/6.9. Note that trunk will also be bumped to match.
+ default: ''
+ required: true
+
+permissions: {}
+
+env:
+ GIT_COMMITTER_NAME: 'WooCommerce Bot'
+ GIT_COMMITTER_EMAIL: 'no-reply@woocommerce.com'
+ GIT_AUTHOR_NAME: 'WooCommerce Bot'
+ GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
+
+jobs:
+ check-release-branch-exists:
+ name: Check for existence of release branch
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Check for release branch
+ id: release-branch-check
+ uses: actions/github-script@v6
+ with:
+ script: |
+ // This will throw an error for non-200 responses, which prevents subsequent jobs from completing, as desired.
+ await github.request( 'GET /repos/{owner}/{repo}/branches/{branch}', {
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ branch: '${{ inputs.releaseBranch }}',
+ } );
+
+ validate-bump:
+ name: Validate and bump WP L-2 support version
+ runs-on: ubuntu-20.04
+ needs: check-release-branch-exists
+ if: success()
+ permissions:
+ actions: write
+ contents: write
+ pull-requests: write
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Get latest WP version
+ id: latestWP
+ uses: actions/github-script@v6
+ with:
+ script: |
+ const https = require( 'https' );
+
+ https.get( 'https://api.wordpress.org/core/stable-check/1.0/', ( resp ) => {
+ let data = '';
+
+ // A chunk of data has been received.
+ resp.on( 'data', ( chunk ) => {
+ data += chunk;
+ } );
+
+ // The whole response has been received. Print out the result.
+ resp.on( 'end', () => {
+ JSON.parse(data, ( key, val ) => {
+ if ( val === 'latest' ) {
+ core.setOutput( 'version', key )
+ }
+ } );
+ } );
+
+ } ).on( 'error', ( err ) => {
+ console.log( 'Error: ' + err.message );
+ } );
+
+ - name: Get L-2 WP version
+ id: l2Version
+ if: steps.latestWP.outputs.version != '' && steps.latestWP.outputs.version != null
+ uses: actions/github-script@v6
+ with:
+ script: |
+ const version = "${{ steps.latestWP.outputs.version }}";
+ const latestWPVersionMajor = version.split( '.' )[0];
+ const latestWPVersionMinor = version.split( '.' )[1];
+ const l2 = (parseInt( ( latestWPVersionMajor + latestWPVersionMinor ), 10 ) - 2 ).toString();
+ const l2Major = l2.split( '' )[0];
+ const l2Minor = l2.split( '' )[1];
+ core.setOutput( 'version', l2Major + '.' + l2Minor );
+
+ - name: Git fetch the release branch
+ run: git fetch origin ${{ inputs.releaseBranch }}
+
+ - name: Checkout release branch
+ run: git checkout ${{ inputs.releaseBranch }}
+
+ - name: Create a PR branch based on release branch
+ run: git checkout -b WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/${{ inputs.releaseBranch }}
+
+ - name: Check if WP L-2 support needs to be bumped the release branch
+ id: readmeWPVersion
+ if: steps.l2Version.outputs.version != '' && steps.l2Version.outputs.version != null
+ uses: actions/github-script@v6
+ with:
+ script: |
+ const fs = require( 'node:fs' );
+ const l2Version = "${{ steps.l2Version.outputs.version }}";
+ let readme = '';
+
+ fs.readFile( './plugins/woocommerce/readme.txt', 'utf-8', function( err, data ) {
+ if ( err ) {
+ console.error( err );
+ }
+
+ readme = data.split( "\n" );
+ const newReadme = [];
+ let needsChange = false;
+
+ for ( const line of readme ) {
+ if ( line.match( /Requires\sat\sleast:\s\d+\.\d/ ) ) {
+ const readmeVersion = line.match( /\d+\.\d/ );
+
+ // If the versions don't match, means we need to make a change.
+ if ( readmeVersion != l2Version ) {
+ needsChange = true;
+
+ newReadme.push( 'Requires at least: ' + l2Version );
+ continue;
+ }
+ }
+
+ newReadme.push( line );
+ }
+
+ if ( needsChange ) {
+ fs.writeFile( './plugins/woocommerce/readme.txt', newReadme.join( "\n" ), err => {
+ if ( err ) {
+ core.setFailed( `Unable to bump the WP L-2 support version. ${err}` );
+ }
+
+ core.setOutput( 'needsChange', needsChange );
+
+ // Copy the readme.txt file to the root of VM to be used later.
+ fs.writeFile( '../../readme.txt', newReadme.join( "\n" ), err => {
+ if ( err ) {
+ core.setFailed( `Unable to copy the readme.txt file to the root of VM. ${err}` );
+ }
+ } );
+ } );
+ } else {
+ core.setFailed( 'No changes needed. WP Version is L-2 compatible.' );
+ }
+ } );
+
+ - name: Commit changes
+ if: steps.readmeWPVersion.outputs.needsChange == 'true'
+ run: git commit --no-verify -am "Update readme.txt WP L-2 support version."
+
+ - name: Push changes
+ if: steps.readmeWPVersion.outputs.needsChange == 'true'
+ run: git push origin WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/${{ inputs.releaseBranch }}
+
+ - name: Push the PR up to GitHub
+ id: release-branch-pr
+ if: steps.readmeWPVersion.outputs.needsChange == 'true'
+ uses: actions/github-script@v6
+ with:
+ script: |
+ const PRBody = "This PR bumps the WP version to L-2 compatible for the release branch ${{ inputs.releaseBranch }}.\n";
+
+ const pr = await github.rest.pulls.create( {
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ title: "Bump WP Version to L-2 compatible for ${{ inputs.releaseBranch }}",
+ head: "WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/${{ inputs.releaseBranch }}",
+ base: "${{ inputs.releaseBranch }}",
+ body: PRBody
+ } );
+
+ if ( pr.status != 201 ) {
+ core.setFailed( "Unable to push WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/${{ inputs.releaseBranch }} to GitHub." );
+ }
+
+ core.setOutput( 'pr', pr.data.number );
+
+ await github.rest.pulls.requestReviewers( {
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ pull_number: pr.data.number,
+ reviewers: [ context.actor ]
+ } );
+
+ - name: Checkout trunk branch
+ if: steps.release-branch-pr.outputs.pr != '' && steps.release-branch-pr.outputs.pr != null
+ run: git checkout trunk
+
+ - name: Create a branch based on trunk branch
+ if: steps.release-branch-pr.outputs.pr != '' && steps.release-branch-pr.outputs.pr != null
+ run: git checkout -b WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/trunk
+
+ - name: Check if WP L-2 support needs to be bumped for trunk
+ id: readmeWPVersionTrunk
+ if: steps.release-branch-pr.outputs.pr != '' && steps.release-branch-pr.outputs.pr != null
+ uses: actions/github-script@v6
+ with:
+ script: |
+ const fs = require( 'node:fs' );
+ const l2Version = "${{ steps.l2Version.outputs.version }}";
+ let readme = '';
+
+ fs.readFile( './plugins/woocommerce/readme.txt', 'utf-8', function( err, data ) {
+ if ( err ) {
+ console.error( err );
+ }
+
+ readme = data.split( "\n" );
+ const newReadme = [];
+ let needsChange = false;
+
+ for ( const line of readme ) {
+ if ( line.match( /Requires\sat\sleast:\s\d+\.\d/ ) ) {
+ const readmeVersion = line.match( /\d+\.\d/ );
+
+ // If the versions don't match, means we need to make a change.
+ if ( readmeVersion != l2Version ) {
+ needsChange = true;
+
+ newReadme.push( 'Requires at least: ' + l2Version );
+ continue;
+ }
+ }
+
+ newReadme.push( line );
+ }
+
+ if ( needsChange ) {
+ fs.writeFile( './plugins/woocommerce/readme.txt', newReadme.join( "\n" ), err => {
+ if ( err ) {
+ core.setFailed( `Unable to bump the WP L-2 support version. ${err}` );
+ }
+
+ core.setOutput( 'needsChange', needsChange );
+
+ // Copy the readme.txt file to the root of VM to be used later.
+ fs.writeFile( '../../readme.txt', newReadme.join( "\n" ), err => {
+ if ( err ) {
+ core.setFailed( `Unable to copy the readme.txt file to the root of VM. ${err}` );
+ }
+ } );
+ } );
+ } else {
+ core.setFailed( 'No changes needed. WP Version is L-2 compatible.' );
+ }
+ } );
+
+ - name: Commit changes
+ if: steps.readmeWPVersionTrunk.outputs.needsChange == 'true'
+ run: git commit --no-verify -am "Update readme.txt WP L-2 support version."
+
+ - name: Push changes
+ if: steps.readmeWPVersionTrunk.outputs.needsChange == 'true'
+ run: git push origin WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/trunk
+
+ - name: Push the PR up to GitHub
+ if: steps.readmeWPVersionTrunk.outputs.needsChange == 'true'
+ uses: actions/github-script@v6
+ with:
+ script: |
+ const PRBody = "This PR bumps the WP version to L-2 compatible for trunk.\n";
+
+ const pr = await github.rest.pulls.create( {
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ title: "Bump WP Version to L-2 compatible for trunk",
+ head: "WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/trunk",
+ base: "trunk",
+ body: PRBody
+ } );
+
+ if ( pr.status != 201 ) {
+ core.setFailed( "Unable to push WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/trunk to GitHub." );
+ }
+
+ await github.rest.pulls.requestReviewers( {
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ pull_number: pr.data.number,
+ reviewers: [ context.actor ]
+ } );
diff --git a/.github/workflows/cherry-pick.yml b/.github/workflows/cherry-pick.yml
index 312ff9d6dcb..280a3268b57 100644
--- a/.github/workflows/cherry-pick.yml
+++ b/.github/workflows/cherry-pick.yml
@@ -30,6 +30,8 @@ env:
GIT_AUTHOR_NAME: 'WooCommerce Bot'
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
+permissions: {}
+
jobs:
verify:
name: Verify
@@ -122,6 +124,10 @@ jobs:
cherry-pick-run:
name: Run cherry pick tool
runs-on: ubuntu-20.04
+ permissions:
+ actions: write
+ contents: write
+ pull-requests: write
needs: [prep, check-release-branch-exists]
if: success()
steps:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 512e609e1e0..423398bb8be 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -12,11 +12,16 @@ defaults:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+
+permissions: {}
+
jobs:
test:
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }}
timeout-minutes: 30
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
continue-on-error: ${{ matrix.wp == 'nightly' }}
strategy:
fail-fast: false
diff --git a/.github/workflows/community-label.yml b/.github/workflows/community-label.yml
index 6856aec116f..b4d772af526 100644
--- a/.github/workflows/community-label.yml
+++ b/.github/workflows/community-label.yml
@@ -10,10 +10,16 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+permissions: {}
+
jobs:
verify:
name: Verify
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
+ pull-requests: write
+ issues: write
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/cot-build-and-e2e-tests-daily.yml b/.github/workflows/cot-build-and-e2e-tests-daily.yml
index 51cd250ce12..a38d042cc1e 100644
--- a/.github/workflows/cot-build-and-e2e-tests-daily.yml
+++ b/.github/workflows/cot-build-and-e2e-tests-daily.yml
@@ -8,10 +8,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+permissions: {}
+
jobs:
cot-e2e-tests-run:
name: Runs E2E tests with COT enabled.
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
env:
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-report
@@ -66,6 +70,8 @@ jobs:
cot-api-tests-run:
name: Runs API tests with COT enabled.
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
env:
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-results
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-report
@@ -124,6 +130,8 @@ jobs:
contains( needs.*.result, 'failure' )
)
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
needs: [cot-api-tests-run, cot-e2e-tests-run]
steps:
- name: Create dirs
diff --git a/.github/workflows/cot-pr-build-and-e2e-tests.yml b/.github/workflows/cot-pr-build-and-e2e-tests.yml
index e5e6e4bd4cc..fd8abdaa596 100644
--- a/.github/workflows/cot-pr-build-and-e2e-tests.yml
+++ b/.github/workflows/cot-pr-build-and-e2e-tests.yml
@@ -1,18 +1,20 @@
name: Run tests against PR in an environment with COT enabled
on:
pull_request:
- types: [labeled]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+permissions: {}
+
jobs:
cot-e2e-tests-run:
name: Runs E2E tests with COT enabled.
- if: "${{ github.event_name == 'workflow_dispatch' || github.event.label.name == 'focus: custom order tables' }}"
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
env:
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-report
@@ -66,8 +68,9 @@ jobs:
cot-api-tests-run:
name: Runs API tests with COT enabled.
- if: "${{ github.event_name == 'workflow_dispatch' || github.event.label.name == 'focus: custom order tables' }}"
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
env:
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-results
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-report
@@ -116,99 +119,101 @@ jobs:
if-no-files-found: ignore
retention-days: 5
- test-summary:
- name: Post test results
- if: |
- always() &&
- ! github.event.pull_request.head.repo.fork &&
- (
- contains( needs.*.result, 'success' ) ||
- contains( needs.*.result, 'failure' )
- )
- runs-on: ubuntu-20.04
- needs: [cot-api-tests-run, cot-e2e-tests-run]
- steps:
- - name: Create dirs
- run: |
- mkdir -p repo
- mkdir -p artifacts/api
- mkdir -p artifacts/e2e
- mkdir -p output
-
- - name: Checkout code
- uses: actions/checkout@v3
- with:
- path: repo
-
- - name: Download API test report artifact
- uses: actions/download-artifact@v3
- with:
- name: api-test-report---pr-${{ github.event.number }}
- path: artifacts/api
-
- - name: Download Playwright E2E test report artifact
- uses: actions/download-artifact@v3
- with:
- name: e2e-test-report---pr-${{ github.event.number }}
- path: artifacts/e2e
-
- - name: Prepare test summary
- id: prepare-test-summary
- uses: actions/github-script@v6
- env:
- API_SUMMARY_PATH: ${{ github.workspace }}/artifacts/api/allure-report/widgets/summary.json
- E2E_PW_SUMMARY_PATH: ${{ github.workspace }}/artifacts/e2e/allure-report/widgets/summary.json
- PR_NUMBER: ${{ github.event.number }}
- SHA: ${{ github.event.pull_request.head.sha }}
- with:
- result-encoding: string
- script: |
- const script = require( './repo/.github/workflows/scripts/prepare-test-summary.js' )
- return await script( { core } )
-
- - name: Find PR comment by github-actions[bot]
- uses: peter-evans/find-comment@v2
- id: find-comment
- with:
- issue-number: ${{ github.event.pull_request.number }}
- comment-author: 'github-actions[bot]'
- body-includes: Test Results Summary
-
- - name: Create or update PR comment
- uses: peter-evans/create-or-update-comment@v2
- with:
- comment-id: ${{ steps.find-comment.outputs.comment-id }}
- issue-number: ${{ github.event.pull_request.number }}
- body: ${{ steps.prepare-test-summary.outputs.result }}
- edit-mode: replace
-
- publish-test-reports:
- name: Publish test reports
- if: |
- always() &&
- ! github.event.pull_request.head.repo.fork &&
- (
- contains( needs.*.result, 'success' ) ||
- contains( needs.*.result, 'failure' )
- )
- runs-on: ubuntu-20.04
- needs: [cot-api-tests-run, cot-e2e-tests-run]
- env:
- GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
- PR_NUMBER: ${{ github.event.number }}
- RUN_ID: ${{ github.run_id }}
- COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
- steps:
- - name: Publish test reports
- env:
- API_ARTIFACT: api-test-report---pr-${{ github.event.number }}
- E2E_ARTIFACT: e2e-test-report---pr-${{ github.event.number }}
- run: |
- gh workflow run publish-test-reports-pr.yml \
- -f run_id=$RUN_ID \
- -f api_artifact=$API_ARTIFACT \
- -f e2e_artifact=$E2E_ARTIFACT \
- -f pr_number=$PR_NUMBER \
- -f commit_sha=$COMMIT_SHA \
- -f s3_root=public \
- --repo woocommerce/woocommerce-test-reports
+# test-summary:
+# name: Post test results
+# if: |
+# always() &&
+# ! github.event.pull_request.head.repo.fork &&
+# (
+# contains( needs.*.result, 'success' ) ||
+# contains( needs.*.result, 'failure' )
+# )
+# runs-on: ubuntu-20.04
+# permissions:
+# contents: read
+# needs: [cot-api-tests-run, cot-e2e-tests-run]
+# steps:
+# - name: Create dirs
+# run: |
+# mkdir -p repo
+# mkdir -p artifacts/api
+# mkdir -p artifacts/e2e
+# mkdir -p output
+#
+# - name: Checkout code
+# uses: actions/checkout@v3
+# with:
+# path: repo
+#
+# - name: Download API test report artifact
+# uses: actions/download-artifact@v3
+# with:
+# name: api-test-report---pr-${{ github.event.number }}
+# path: artifacts/api
+#
+# - name: Download Playwright E2E test report artifact
+# uses: actions/download-artifact@v3
+# with:
+# name: e2e-test-report---pr-${{ github.event.number }}
+# path: artifacts/e2e
+#
+# - name: Prepare test summary
+# id: prepare-test-summary
+# uses: actions/github-script@v6
+# env:
+# API_SUMMARY_PATH: ${{ github.workspace }}/artifacts/api/allure-report/widgets/summary.json
+# E2E_PW_SUMMARY_PATH: ${{ github.workspace }}/artifacts/e2e/allure-report/widgets/summary.json
+# PR_NUMBER: ${{ github.event.number }}
+# SHA: ${{ github.event.pull_request.head.sha }}
+# with:
+# result-encoding: string
+# script: |
+# const script = require( './repo/.github/workflows/scripts/prepare-test-summary.js' )
+# return await script( { core } )
+#
+# - name: Find PR comment by github-actions[bot]
+# uses: peter-evans/find-comment@v2
+# id: find-comment
+# with:
+# issue-number: ${{ github.event.pull_request.number }}
+# comment-author: 'github-actions[bot]'
+# body-includes: Test Results Summary
+#
+# - name: Create or update PR comment
+# uses: peter-evans/create-or-update-comment@v2
+# with:
+# comment-id: ${{ steps.find-comment.outputs.comment-id }}
+# issue-number: ${{ github.event.pull_request.number }}
+# body: ${{ steps.prepare-test-summary.outputs.result }}
+# edit-mode: replace
+#
+# publish-test-reports:
+# name: Publish test reports
+# if: |
+# always() &&
+# ! github.event.pull_request.head.repo.fork &&
+# (
+# contains( needs.*.result, 'success' ) ||
+# contains( needs.*.result, 'failure' )
+# )
+# runs-on: ubuntu-20.04
+# needs: [cot-api-tests-run, cot-e2e-tests-run]
+# env:
+# GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
+# PR_NUMBER: ${{ github.event.number }}
+# RUN_ID: ${{ github.run_id }}
+# COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
+# steps:
+# - name: Publish test reports
+# env:
+# API_ARTIFACT: api-test-report---pr-${{ github.event.number }}
+# E2E_ARTIFACT: e2e-test-report---pr-${{ github.event.number }}
+# run: |
+# gh workflow run publish-test-reports-pr.yml \
+# -f run_id=$RUN_ID \
+# -f api_artifact=$API_ARTIFACT \
+# -f e2e_artifact=$E2E_ARTIFACT \
+# -f pr_number=$PR_NUMBER \
+# -f commit_sha=$COMMIT_SHA \
+# -f s3_root=public \
+# --repo woocommerce/woocommerce-test-reports
diff --git a/.github/workflows/mirrors.yml b/.github/workflows/mirrors.yml
index b3cb91069ee..37ccec1fec0 100644
--- a/.github/workflows/mirrors.yml
+++ b/.github/workflows/mirrors.yml
@@ -4,11 +4,15 @@ on:
branches: ["trunk", "release/**"]
workflow_dispatch:
+permissions: {}
+
jobs:
build:
if: github.repository == 'woocommerce/woocommerce'
name: Build WooCommerce zip
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
steps:
- uses: actions/checkout@v3
@@ -35,6 +39,8 @@ jobs:
name: Push to Mirror
needs: [build]
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
steps:
- name: Create directories
run: |
diff --git a/.github/workflows/nightly-builds.yml b/.github/workflows/nightly-builds.yml
index 06227ac6615..64903cb5075 100644
--- a/.github/workflows/nightly-builds.yml
+++ b/.github/workflows/nightly-builds.yml
@@ -3,6 +3,9 @@ on:
schedule:
- cron: '0 0 * * *' # Run at 12 AM UTC.
workflow_dispatch:
+
+permissions: {}
+
jobs:
build:
if: github.repository_owner == 'woocommerce'
@@ -12,6 +15,8 @@ jobs:
matrix:
build: [trunk]
runs-on: ubuntu-20.04
+ permissions:
+ contents: write
steps:
- uses: actions/checkout@v3
with:
@@ -40,6 +45,8 @@ jobs:
update:
name: Update nightly tag commit ref
runs-on: ubuntu-20.04
+ permissions:
+ contents: write
steps:
- name: Update nightly tag
uses: richardsimko/github-tag-action@v1.0.5
diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml
index 8f4a78d5424..1400a50dbe5 100644
--- a/.github/workflows/package-release.yml
+++ b/.github/workflows/package-release.yml
@@ -6,10 +6,15 @@ on:
description: 'Enter a specific package to release, or releases separated by commas, ie @woocommerce/components,@woocommerce/number. Leaving this input blank will release all eligible packages.'
required: false
default: '-a'
+
+permissions: {}
+
jobs:
release:
name: Run packages release script
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml
index 7ed2c418986..6f2b9bb284b 100644
--- a/.github/workflows/post-release.yml
+++ b/.github/workflows/post-release.yml
@@ -9,10 +9,15 @@ env:
GIT_AUTHOR_NAME: 'WooCommerce Bot'
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
+permissions: {}
+
jobs:
changelog-version-update:
name: Update changelog and version
runs-on: ubuntu-20.04
+ permissions:
+ contents: write
+ pull-requests: write
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/pr-build-and-e2e-tests-skip.yml b/.github/workflows/pr-build-and-e2e-tests-skip.yml
new file mode 100644
index 00000000000..2bddb65e0dd
--- /dev/null
+++ b/.github/workflows/pr-build-and-e2e-tests-skip.yml
@@ -0,0 +1,12 @@
+# Duplicate workflow that returns success for this check when there is no relevant file change. See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
+name: Run tests against PR
+on:
+ pull_request:
+ paths:
+ - '!**'
+ - '**/changelog/**'
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - run: 'echo "No build required"'
diff --git a/.github/workflows/pr-build-and-e2e-tests.yml b/.github/workflows/pr-build-and-e2e-tests.yml
index d66270ba70d..085ff943031 100644
--- a/.github/workflows/pr-build-and-e2e-tests.yml
+++ b/.github/workflows/pr-build-and-e2e-tests.yml
@@ -1,16 +1,22 @@
name: Run tests against PR
on:
- pull_request:
workflow_dispatch:
+ pull_request:
+ paths-ignore:
+ - '**/changelog/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+permissions: {}
+
jobs:
e2e-tests-run:
name: Runs E2E tests.
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
env:
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-results
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-report
@@ -79,6 +85,8 @@ jobs:
api-tests-run:
name: Runs API tests.
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
env:
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-results
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-report
@@ -129,6 +137,8 @@ jobs:
k6-tests-run:
name: Runs k6 Performance tests
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
steps:
- uses: actions/checkout@v3
@@ -162,6 +172,10 @@ jobs:
)
runs-on: ubuntu-20.04
needs: [api-tests-run, e2e-tests-run]
+ permissions:
+ contents: read
+ issues: write
+ pull-requests: write
env:
E2E_GRAND_TOTAL: ${{needs.e2e-tests-run.outputs.E2E_GRAND_TOTAL}}
steps:
diff --git a/.github/workflows/pr-build-live-branch-skip.yml b/.github/workflows/pr-build-live-branch-skip.yml
new file mode 100644
index 00000000000..5d7358217e5
--- /dev/null
+++ b/.github/workflows/pr-build-live-branch-skip.yml
@@ -0,0 +1,12 @@
+# Duplicate workflow that returns success for this check when there is no relevant file change. See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
+name: Build Live Branch
+on:
+ pull_request:
+ paths:
+ - '!**'
+ - '**/changelog/**'
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - run: 'echo "No build required"'
diff --git a/.github/workflows/pr-build-live-branch.yml b/.github/workflows/pr-build-live-branch.yml
index 00706c67d74..838796d5351 100644
--- a/.github/workflows/pr-build-live-branch.yml
+++ b/.github/workflows/pr-build-live-branch.yml
@@ -1,16 +1,22 @@
name: Build Live Branch
on:
pull_request:
+ paths-ignore:
+ - '**/changelog/**'
concurrency:
# Cancel concurrent jobs on pull_request but not push, by including the run_id in the concurrency group for the latter.
group: build-${{ github.event_name == 'push' && github.run_id || 'pr' }}-${{ github.ref }}
cancel-in-progress: true
+permissions: {}
+
jobs:
build:
if: github.repository_owner == 'woocommerce'
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/pr-code-coverage-skip.yml b/.github/workflows/pr-code-coverage-skip.yml
new file mode 100644
index 00000000000..b181d912077
--- /dev/null
+++ b/.github/workflows/pr-code-coverage-skip.yml
@@ -0,0 +1,12 @@
+# Duplicate workflow that returns success for this check when there is no relevant file change. See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
+name: Run code coverage on PR
+on:
+ pull_request:
+ paths:
+ - '!**'
+ - '**/changelog/**'
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - run: 'echo "No build required"'
diff --git a/.github/workflows/pr-code-coverage.yml b/.github/workflows/pr-code-coverage.yml
index 4f8e67820c1..826b070898d 100644
--- a/.github/workflows/pr-code-coverage.yml
+++ b/.github/workflows/pr-code-coverage.yml
@@ -1,54 +1,60 @@
name: Run code coverage on PR
on:
- pull_request:
- workflow_dispatch:
+ pull_request:
+ paths-ignore:
+ - '**/changelog/**'
+ workflow_dispatch:
defaults:
- run:
- shell: bash
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
+ run:
+ shell: bash
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+permissions: {}
+
jobs:
- test:
- name: Code coverage (PHP 7.4, WP Latest)
- timeout-minutes: 30
- runs-on: ubuntu-20.04
- services:
- database:
- image: mysql:5.6
- env:
- MYSQL_ROOT_PASSWORD: root
- ports:
- - 3306:3306
- options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 100
+ test:
+ name: Code coverage (PHP 7.4, WP Latest)
+ timeout-minutes: 30
+ runs-on: ubuntu-20.04
+ permissions:
+ contents: read
+ services:
+ database:
+ image: mysql:5.6
+ env:
+ MYSQL_ROOT_PASSWORD: root
+ ports:
+ - 3306:3306
+ options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 100
- - name: Setup WooCommerce Monorepo
- uses: ./.github/actions/setup-woocommerce-monorepo
+ - name: Setup WooCommerce Monorepo
+ uses: ./.github/actions/setup-woocommerce-monorepo
- - name: Tool versions
- run: |
- php --version
- composer --version
+ - name: Tool versions
+ run: |
+ php --version
+ composer --version
- - name: Build Admin feature config
- working-directory: plugins/woocommerce
- run:
- pnpm run build:feature-config
+ - name: Build Admin feature config
+ working-directory: plugins/woocommerce
+ run: pnpm run build:feature-config
- - name: Init DB and WP
- working-directory: plugins/woocommerce
- run: bash tests/bin/install.sh woo_test root root 127.0.0.1 latest
+ - name: Init DB and WP
+ working-directory: plugins/woocommerce
+ run: bash tests/bin/install.sh woo_test root root 127.0.0.1 latest
- - name: Run unit tests with code coverage. Allow to fail.
- working-directory: plugins/woocommerce
- run: |
- RUN_CODE_COVERAGE=1 bash tests/bin/phpunit.sh
- exit 0
-
- - name: Send code coverage to Codecov.
- run: |
- bash <(curl -s https://codecov.io/bash)
+ - name: Run unit tests with code coverage. Allow to fail.
+ working-directory: plugins/woocommerce
+ run: |
+ RUN_CODE_COVERAGE=1 bash tests/bin/phpunit.sh
+ exit 0
+
+ - name: Send code coverage to Codecov.
+ run: |
+ bash <(curl -s https://codecov.io/bash)
diff --git a/.github/workflows/pr-code-sniff-skip.yml b/.github/workflows/pr-code-sniff-skip.yml
new file mode 100644
index 00000000000..b181d912077
--- /dev/null
+++ b/.github/workflows/pr-code-sniff-skip.yml
@@ -0,0 +1,12 @@
+# Duplicate workflow that returns success for this check when there is no relevant file change. See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
+name: Run code coverage on PR
+on:
+ pull_request:
+ paths:
+ - '!**'
+ - '**/changelog/**'
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - run: 'echo "No build required"'
diff --git a/.github/workflows/pr-code-sniff.yml b/.github/workflows/pr-code-sniff.yml
index f18a5aae4e6..7578e652db6 100644
--- a/.github/workflows/pr-code-sniff.yml
+++ b/.github/workflows/pr-code-sniff.yml
@@ -1,5 +1,8 @@
name: Run code sniff on PR
-on: pull_request
+on:
+ pull_request:
+ paths-ignore:
+ - '**/changelog/**'
defaults:
run:
shell: bash
@@ -8,11 +11,16 @@ concurrency:
cancel-in-progress: true
env:
PHPCS: ./plugins/woocommerce/vendor/bin/phpcs # Run WooCommerce phpcs setup in phpcs-changed instead of default
+
+permissions: {}
+
jobs:
test:
name: Code sniff (PHP 7.4, WP Latest)
timeout-minutes: 15
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
steps:
- uses: actions/checkout@v3
with:
diff --git a/.github/workflows/pr-highlight-changes-skip.yml b/.github/workflows/pr-highlight-changes-skip.yml
new file mode 100644
index 00000000000..b30e97fb9d2
--- /dev/null
+++ b/.github/workflows/pr-highlight-changes-skip.yml
@@ -0,0 +1,12 @@
+# Duplicate workflow that returns success for this check when there is no relevant file change. See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
+name: Highlight templates changes
+on:
+ pull_request:
+ paths:
+ - '!**'
+ - '**/changelog/**'
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - run: 'echo "No build required"'
diff --git a/.github/workflows/pr-highlight-changes.yml b/.github/workflows/pr-highlight-changes.yml
index 2d6d86e6fce..b856e966768 100644
--- a/.github/workflows/pr-highlight-changes.yml
+++ b/.github/workflows/pr-highlight-changes.yml
@@ -1,9 +1,17 @@
name: Highlight templates changes
-on: pull_request
+on:
+ pull_request:
+ paths-ignore:
+ - '**/changelog/**'
+
+permissions: {}
+
jobs:
analyze:
name: Check pull request changes to highlight
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
outputs:
results: ${{ steps.results.outputs.results }}
steps:
@@ -24,32 +32,32 @@ jobs:
- name: Check results
uses: actions/github-script@v6
with:
- script: |
- const template = '${{ steps.run.outputs.templates }}';
+ script: |
+ const template = '${{ steps.run.outputs.templates }}';
- if ( template === '' ) {
- return;
- }
+ if ( template === '' ) {
+ return;
+ }
- const templateArr = template.split( '\n' );
- const modTemplateArr = [];
- let needsVersionBump = false;
+ const templateArr = template.split( '\n' );
+ const modTemplateArr = [];
+ let needsVersionBump = false;
- templateArr.forEach( ( el ) => {
- if ( el.match( /NOTICE/ ) ) {
- modTemplateArr.pop();
- return;
- }
+ templateArr.forEach( ( el ) => {
+ if ( el.match( /NOTICE/ ) ) {
+ modTemplateArr.pop();
+ return;
+ }
- if ( el.match( /WARNING/ ) ) {
- needsVersionBump = true;
- }
+ if ( el.match( /WARNING/ ) ) {
+ needsVersionBump = true;
+ }
- modTemplateArr.push( el );
- } );
+ modTemplateArr.push( el );
+ } );
- const templateResult = modTemplateArr.join( '\n' );
+ const templateResult = modTemplateArr.join( '\n' );
- if ( needsVersionBump ) {
- core.setFailed( `Templates have changed but template versions were not bumped:\n${ templateResult }` );
- }
+ if ( needsVersionBump ) {
+ core.setFailed( `Templates have changed but template versions were not bumped:\n${ templateResult }` );
+ }
diff --git a/.github/workflows/pr-lint-monorepo.yml b/.github/workflows/pr-lint-monorepo.yml
index afc92bc4eed..684e8ca1ebd 100644
--- a/.github/workflows/pr-lint-monorepo.yml
+++ b/.github/workflows/pr-lint-monorepo.yml
@@ -1,32 +1,37 @@
name: Run lint checks potentially affecting projects across the monorepo
on:
- pull_request:
- branches:
- - 'trunk'
+ pull_request:
+ branches:
+ - 'trunk'
concurrency:
- group: changelogger-${{ github.event_name }}-${{ github.ref }}
- cancel-in-progress: true
+ group: changelogger-${{ github.event_name }}-${{ github.ref }}
+ cancel-in-progress: true
+
+permissions: {}
+
jobs:
- changelogger_used:
- name: Changelogger use
- runs-on: ubuntu-20.04
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v3
- with:
- ref: ${{ github.event.pull_request.head.sha }}
- fetch-depth: 0
+ changelogger_used:
+ name: Changelogger use
+ runs-on: ubuntu-20.04
+ permissions:
+ contents: read
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ fetch-depth: 0
- - name: Setup WooCommerce Monorepo
- uses: ./.github/actions/setup-woocommerce-monorepo
- with:
- build: false
+ - name: Setup WooCommerce Monorepo
+ uses: ./.github/actions/setup-woocommerce-monorepo
+ with:
+ build: false
- - name: Check change files are touched for touched projects
- env:
- BASE: ${{ github.event.pull_request.base.sha }}
- HEAD: ${{ github.event.pull_request.head.sha }}
- run: php tools/monorepo/check-changelogger-use.php --debug "$BASE" "$HEAD"
+ - name: Check change files are touched for touched projects
+ env:
+ BASE: ${{ github.event.pull_request.base.sha }}
+ HEAD: ${{ github.event.pull_request.head.sha }}
+ run: php tools/monorepo/check-changelogger-use.php --debug "$BASE" "$HEAD"
- - name: Run changelog validation
- run: pnpm run -r changelog validate
+ - name: Run changelog validation
+ run: pnpm run -r changelog validate
diff --git a/.github/workflows/pr-lint-test-js.yml b/.github/workflows/pr-lint-test-js.yml
index cc1c14680e8..c5a58e444a6 100644
--- a/.github/workflows/pr-lint-test-js.yml
+++ b/.github/workflows/pr-lint-test-js.yml
@@ -1,22 +1,29 @@
name: Lint and tests for JS packages and woocommerce-admin/client
-on: pull_request
+on:
+ pull_request:
+ paths-ignore:
+ - '**/changelog/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+permissions: {}
+
jobs:
lint-test-js:
name: Lint and Test JS
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
steps:
- uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
- uses: ./.github/actions/setup-woocommerce-monorepo
+ uses: ./.github/actions/setup-woocommerce-monorepo
- name: Lint
run: pnpm run -r --filter='woocommerce/client/admin...' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api' --color lint
- name: Test
- run: pnpm run test --filter='woocommerce/client/admin...' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api' --color
+ run: pnpm run test --filter='woocommerce/client/admin...' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api' --color
diff --git a/.github/workflows/pr-lint-test-skip.yml b/.github/workflows/pr-lint-test-skip.yml
new file mode 100644
index 00000000000..14929964ae1
--- /dev/null
+++ b/.github/workflows/pr-lint-test-skip.yml
@@ -0,0 +1,12 @@
+# Duplicate workflow that returns success for this check when there is no relevant file change. See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
+name: Run smoke tests against pull request.
+on:
+ pull_request:
+ paths:
+ - '!**'
+ - '**/changelog/**'
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - run: 'echo "No build required"'
diff --git a/.github/workflows/pr-project-label.yml b/.github/workflows/pr-project-label.yml
index 8c189eace6b..efcbda4b3d6 100644
--- a/.github/workflows/pr-project-label.yml
+++ b/.github/workflows/pr-project-label.yml
@@ -1,18 +1,23 @@
name: 'Label Pull Request Project'
on:
- pull_request_target:
- types:
- - opened
- - synchronize
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
+ pull_request_target:
+ types:
+ - opened
+ - synchronize
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+permissions: {}
jobs:
- label_project:
- runs-on: ubuntu-20.04
- steps:
- - uses: actions/labeler@v3
- with:
- repo-token: "${{ secrets.GITHUB_TOKEN }}"
- configuration-path: .github/project-pr-labeler.yml
+ label_project:
+ runs-on: ubuntu-20.04
+ permissions:
+ contents: read
+ pull-requests: write
+ steps:
+ - uses: actions/labeler@v3
+ with:
+ repo-token: '${{ secrets.GITHUB_TOKEN }}'
+ configuration-path: .github/project-pr-labeler.yml
diff --git a/.github/workflows/pr-smoke-test-skip.yml b/.github/workflows/pr-smoke-test-skip.yml
new file mode 100644
index 00000000000..586208c4b77
--- /dev/null
+++ b/.github/workflows/pr-smoke-test-skip.yml
@@ -0,0 +1,12 @@
+# Duplicate workflow that returns success for this check when there is no relevant file change. See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
+name: Lint and tests for JS packages and woocommerce-admin/client
+on:
+ pull_request:
+ paths:
+ - '!**'
+ - '**/changelog/**'
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - run: 'echo "No build required"'
diff --git a/.github/workflows/pr-smoke-test.yml b/.github/workflows/pr-smoke-test.yml
index 45e6077c0cf..897433e8936 100644
--- a/.github/workflows/pr-smoke-test.yml
+++ b/.github/workflows/pr-smoke-test.yml
@@ -1,19 +1,26 @@
name: Run smoke tests against pull request.
on:
pull_request:
+ paths-ignore:
+ - '**/changelog/**'
branches:
- trunk
types:
- labeled
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+permissions: {}
jobs:
prcheck:
name: Smoke test a pull request.
if: "${{ contains(github.event.label.name, 'run: smoke tests') }}"
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
+ pull-requests: write
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/pr-unit-tests-skip.yml b/.github/workflows/pr-unit-tests-skip.yml
new file mode 100644
index 00000000000..d91241ce164
--- /dev/null
+++ b/.github/workflows/pr-unit-tests-skip.yml
@@ -0,0 +1,12 @@
+# Duplicate workflow that returns success for this check when there is no relevant file change. See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
+name: Run unit tests on PR
+on:
+ pull_request:
+ paths:
+ - '!**'
+ - '**/changelog/**'
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - run: 'echo "No build required"'
diff --git a/.github/workflows/pr-unit-tests.yml b/.github/workflows/pr-unit-tests.yml
index de6e02122d5..18da726ee35 100644
--- a/.github/workflows/pr-unit-tests.yml
+++ b/.github/workflows/pr-unit-tests.yml
@@ -1,18 +1,24 @@
name: Run unit tests on PR
-on:
- pull_request
+on:
+ pull_request:
+ paths-ignore:
+ - '**/changelog/**'
defaults:
- run:
- shell: bash
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
+ run:
+ shell: bash
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+permissions: {}
jobs:
test:
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }}
timeout-minutes: 30
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
continue-on-error: ${{ matrix.wp == 'nightly' }}
strategy:
fail-fast: false
@@ -22,9 +28,9 @@ jobs:
include:
- wp: nightly
php: '7.4'
- - wp: '5.9'
+ - wp: '6.0'
php: 7.4
- - wp: '5.8'
+ - wp: '5.9'
php: 7.4
services:
database:
@@ -40,25 +46,12 @@ jobs:
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
- php-version: ${{ matrix.php }}
+ php-version: ${{ matrix.php }}
- name: Tool versions
run: |
- php --version
- composer --version
-
- - name: Add PHP8 Compatibility.
- run: |
- if [ "$(php -r "echo version_compare(PHP_VERSION,'8.0','>=');")" ]; then
- cd plugins/woocommerce
- curl -L https://github.com/woocommerce/phpunit/archive/add-compatibility-with-php8-to-phpunit-7.zip -o /tmp/phpunit-7.5-fork.zip
- unzip -d /tmp/phpunit-7.5-fork /tmp/phpunit-7.5-fork.zip
- composer bin phpunit config --unset platform
- composer bin phpunit config repositories.0 '{"type": "path", "url": "/tmp/phpunit-7.5-fork/phpunit-add-compatibility-with-php8-to-phpunit-7", "options": {"symlink": false}}'
- composer bin phpunit require --dev -W phpunit/phpunit:@dev --ignore-platform-reqs
- rm -rf ./vendor/phpunit/
- composer dump-autoload
- fi
+ php --version
+ composer --version
- name: Init DB and WP
working-directory: plugins/woocommerce
diff --git a/.github/workflows/prepare-package-release.yml b/.github/workflows/prepare-package-release.yml
index 6a524e58613..0f311150cf1 100644
--- a/.github/workflows/prepare-package-release.yml
+++ b/.github/workflows/prepare-package-release.yml
@@ -6,10 +6,16 @@ on:
description: 'Enter a specific package to release, or packages separated by commas, ie @woocommerce/components,@woocommerce/number. Leaving this input to the default "-a" will prepare to release all eligible packages.'
required: false
default: '-a'
+
+permissions: {}
+
jobs:
prepare:
name: Run prepare script
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
+ pull-requests: write
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/prime-cache.yml b/.github/workflows/prime-cache.yml
index 90a260a6f26..a5d604a1625 100644
--- a/.github/workflows/prime-cache.yml
+++ b/.github/workflows/prime-cache.yml
@@ -9,10 +9,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+permissions: {}
+
jobs:
prime:
name: Prime cache
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/pull-request-post-merge-processing.yml b/.github/workflows/pull-request-post-merge-processing.yml
index 9ce002c31b6..208cf6736cb 100644
--- a/.github/workflows/pull-request-post-merge-processing.yml
+++ b/.github/workflows/pull-request-post-merge-processing.yml
@@ -3,11 +3,15 @@ on:
pull_request_target:
types: [closed]
+permissions: {}
+
jobs:
process-pull-request-after-merge:
name: "Process a pull request after it's merged"
if: github.event.pull_request.merged == true
runs-on: ubuntu-20.04
+ permissions:
+ pull-requests: write
steps:
- name: "Get the action scripts"
run: |
diff --git a/.github/workflows/release-changelog.yml b/.github/workflows/release-changelog.yml
index 85f725a8a46..b8ce8d8572a 100644
--- a/.github/workflows/release-changelog.yml
+++ b/.github/workflows/release-changelog.yml
@@ -15,9 +15,14 @@ env:
GIT_AUTHOR_NAME: 'WooCommerce Bot'
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
+permissions: {}
+
jobs:
create-changelog-prs:
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
+ pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v3
diff --git a/.github/workflows/release-code-freeze.yml b/.github/workflows/release-code-freeze.yml
index 17aa826f569..ffb31eea89c 100644
--- a/.github/workflows/release-code-freeze.yml
+++ b/.github/workflows/release-code-freeze.yml
@@ -20,6 +20,8 @@ env:
GIT_AUTHOR_NAME: 'WooCommerce Bot'
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
+permissions: {}
+
jobs:
verify-code-freeze:
name: 'Verify that today is the day of the code freeze'
@@ -57,6 +59,8 @@ jobs:
maybe-create-next-milestone-and-release-branch:
name: 'Maybe create next milestone and release branch'
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
needs: verify-code-freeze
if: needs.verify-code-freeze.outputs.freeze == 0
outputs:
@@ -84,6 +88,9 @@ jobs:
prep-trunk:
name: Preps trunk for next development cycle
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
+ pull-requests: write
needs: maybe-create-next-milestone-and-release-branch
steps:
- name: Checkout code
@@ -151,6 +158,8 @@ jobs:
trigger-changelog-action:
name: 'Trigger changelog action'
runs-on: ubuntu-20.04
+ permissions:
+ actions: write
needs: maybe-create-next-milestone-and-release-branch
steps:
- name: 'Trigger changelog action'
diff --git a/.github/workflows/smoke-test-daily-site-check.yml b/.github/workflows/smoke-test-daily-site-check.yml
index ac71633d3b1..37b0de06ec9 100644
--- a/.github/workflows/smoke-test-daily-site-check.yml
+++ b/.github/workflows/smoke-test-daily-site-check.yml
@@ -3,6 +3,8 @@ on:
schedule:
- cron: '25 7 * * *'
+permissions: {}
+
jobs:
ping_site:
runs-on: ubuntu-20.04
diff --git a/.github/workflows/smoke-test-daily.yml b/.github/workflows/smoke-test-daily.yml
index 51d762e0e7d..7c5b9ea78ea 100644
--- a/.github/workflows/smoke-test-daily.yml
+++ b/.github/workflows/smoke-test-daily.yml
@@ -14,10 +14,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
+permissions: {}
+
jobs:
e2e-tests:
name: E2E tests on nightly build
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
env:
ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }}
ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }}
@@ -77,6 +81,8 @@ jobs:
api-tests:
name: API tests on nightly build
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
needs: [e2e-tests]
if: success() || failure()
env:
@@ -121,6 +127,8 @@ jobs:
k6-tests:
name: k6 tests on nightly build
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
needs: [api-tests]
if: success() || failure()
steps:
@@ -171,6 +179,8 @@ jobs:
test-plugins:
name: Smoke tests on trunk with ${{ matrix.plugin }} plugin installed
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
env:
USE_WP_ENV: 1
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
@@ -244,6 +254,8 @@ jobs:
( success() || failure() ) &&
! github.event.pull_request.head.repo.fork
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
needs: [test-plugins, k6-tests]
steps:
- name: Create dirs
diff --git a/.github/workflows/smoke-test-release.yml b/.github/workflows/smoke-test-release.yml
index f202b3467de..411538d05a4 100644
--- a/.github/workflows/smoke-test-release.yml
+++ b/.github/workflows/smoke-test-release.yml
@@ -5,10 +5,15 @@ on:
release_id:
description: 'WooCommerce Release Id'
required: true
+
+permissions: {}
+
jobs:
login-run:
name: Daily smoke test on release.
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
steps:
- uses: actions/checkout@v3
with:
@@ -49,6 +54,8 @@ jobs:
test-wp-version:
name: Smoke test on L-${{ matrix.wp }} WordPress version
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
strategy:
matrix:
wp: ['1', '2']
@@ -104,6 +111,8 @@ jobs:
test-plugins:
name: Smoke tests with ${{ matrix.plugin }} plugin installed
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
strategy:
fail-fast: false
matrix:
diff --git a/.github/workflows/stalebot.yml b/.github/workflows/stalebot.yml
index dc7e2c9b034..a512944ea96 100644
--- a/.github/workflows/stalebot.yml
+++ b/.github/workflows/stalebot.yml
@@ -3,11 +3,17 @@ on:
schedule:
- cron: '21 0 * * *'
+permissions: {}
+
jobs:
stale:
if: |
! contains(github.event.issue.labels.*.name, 'type: enhancement')
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
+ issues: write
+ pull-requests: write
steps:
- uses: actions/stale@v3
with:
diff --git a/.github/workflows/syncpack.yml b/.github/workflows/syncpack.yml
index f7898fa129f..56fb71d0964 100644
--- a/.github/workflows/syncpack.yml
+++ b/.github/workflows/syncpack.yml
@@ -6,9 +6,14 @@ on:
- trunk
paths:
- '**/package.json'
+
+permissions: {}
+
jobs:
syncpack:
runs-on: ubuntu-latest
+ permissions:
+ contents: read
name: syncpack
steps:
- name: 'Checkout'
diff --git a/.github/workflows/triage-label.yml b/.github/workflows/triage-label.yml
index ef9c5852437..b7f6485a31d 100644
--- a/.github/workflows/triage-label.yml
+++ b/.github/workflows/triage-label.yml
@@ -4,9 +4,14 @@ on:
issues:
types: opened
+permissions: {}
+
jobs:
add_label:
runs-on: ubuntu-20.04
+ permissions:
+ contents: read
+ issues: write
steps:
- uses: actions/checkout@v3
- uses: actions-ecosystem/action-add-labels@v1
diff --git a/.github/workflows/triage-replies.yml b/.github/workflows/triage-replies.yml
index a5429249306..d65d4842e0c 100644
--- a/.github/workflows/triage-replies.yml
+++ b/.github/workflows/triage-replies.yml
@@ -3,6 +3,9 @@ on:
issues:
types:
- labeled
+
+permissions: {}
+
jobs:
add-dev-comment:
if: "github.event.label.name == 'needs: developer feedback'"
diff --git a/.github/workflows/update-feedback-labels.yml b/.github/workflows/update-feedback-labels.yml
index 34caa1c31a1..d619bd9fc00 100644
--- a/.github/workflows/update-feedback-labels.yml
+++ b/.github/workflows/update-feedback-labels.yml
@@ -1,6 +1,8 @@
name: 'Update contributor feedback labels on comment'
on: 'issue_comment'
+permissions: {}
+
jobs:
feedback:
if: |
@@ -10,6 +12,8 @@ jobs:
github.event.issue.state == 'open' &&
contains(github.event.issue.labels.*.name, 'needs: author feedback')
runs-on: ubuntu-20.04
+ permissions:
+ issues: write
steps:
- name: Add has feedback
uses: actions-ecosystem/action-add-labels@v1
diff --git a/README.md b/README.md
index 8fef4f3d463..a16ac1fbde5 100644
--- a/README.md
+++ b/README.md
@@ -49,7 +49,10 @@ This repository is not suitable for support. Please don't use our issue tracker
* [The Official WooCommerce Facebook Group](https://www.facebook.com/groups/advanced.woocommerce).
* For customizations, you may want to check our list of [WooExperts](https://woocommerce.com/experts/) or [Codeable](https://codeable.io/).
-Support requests in issues on this repository will be closed on sight.
+NOTE: Unfortunately, we are unable to honor support requests in issues on this repository; as a result, any requests submitted in this manner will be closed.
+
+## Community
+For peer to peer support, real-time announcements, and office hours, please [join our slack community](https://woocommerce.com/community-slack/)!
## Contributing to WooCommerce
If you have a patch or have stumbled upon an issue with WooCommerce core, you can contribute this back to the code. Please read our [contributor guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/.github/CONTRIBUTING.md) for more information on how you can do this.
diff --git a/changelog.txt b/changelog.txt
index 2b78a742a29..bb51ad54255 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,5 +1,110 @@
== Changelog ==
+= 7.3.0 2023-01-10 =
+
+**WooCommerce**
+
+* Fix - Remove redundant Pinterest plugin from marketing task [#36158](https://github.com/woocommerce/woocommerce/pull/36158)
+* Fix - Corrects a hard-coded reference to the WP post meta table within the HPOS Migration Helper, that would fail on some sites. [#36100](https://github.com/woocommerce/woocommerce/pull/36100)
+* Fix - Add a blank space between the emoji and the message within a notice popup [#35698](https://github.com/woocommerce/woocommerce/pull/35698)
+* Fix - Add a data migration for changed New Zealand and Ukraine state codes [#35960](https://github.com/woocommerce/woocommerce/pull/35960)
+* Fix - Add back missing scss files from assets. [#35624](https://github.com/woocommerce/woocommerce/pull/35624)
+* Fix - Address HPOS synchronization issues relating to the deletion of orders. [#35723](https://github.com/woocommerce/woocommerce/pull/35723)
+* Fix - Avoid a potential fatal error when forming edit-order URLs. [#35995](https://github.com/woocommerce/woocommerce/pull/35995)
+* Fix - Fix call of array_key_exists in SSR. [#35598](https://github.com/woocommerce/woocommerce/pull/35598)
+* Fix - Fix ellipsis dropdown menu is mostly hidden within the task list [#35949](https://github.com/woocommerce/woocommerce/pull/35949)
+* Fix - Fixes fatal error resulting from translating the WooCommerce main menu. [#35695](https://github.com/woocommerce/woocommerce/pull/35695)
+* Fix - Fix get orders REST API endpoint when using 'search' or 'parent' and HPOS is enabled [#35818](https://github.com/woocommerce/woocommerce/pull/35818)
+* Fix - Fix handling of non-ASCII product attributes when the attributes lookup table is in use [#34432](https://github.com/woocommerce/woocommerce/pull/34432)
+* Fix - Fix handling of statuses in orders list table (HPOS). [#35370](https://github.com/woocommerce/woocommerce/pull/35370)
+* Fix - Fix logo icon for Google Listings and Ads. [#35732](https://github.com/woocommerce/woocommerce/pull/35732)
+* Fix - Fix product tab to be shown on production build [#35976](https://github.com/woocommerce/woocommerce/pull/35976)
+* Fix - Fix regexp used for filtering country dropdown on the store details step #35941 [#35942](https://github.com/woocommerce/woocommerce/pull/35942)
+* Fix - Fix the gap in the featured product checkbox [#35710](https://github.com/woocommerce/woocommerce/pull/35710)
+* Fix - Fix tooltips not appearing in the orders list admin page. [#35638](https://github.com/woocommerce/woocommerce/pull/35638)
+* Fix - Fix unread note count on inbox panel [#35396](https://github.com/woocommerce/woocommerce/pull/35396)
+* Fix - Fix unsaved modal propmt to not be shown during form submission [#35657](https://github.com/woocommerce/woocommerce/pull/35657)
+* Fix - Fix version in template and function docblocks. [#35473](https://github.com/woocommerce/woocommerce/pull/35473)
+* Fix - Fix WooCommerce Admin client React build warnings and remove unnecessary scss imports. [#35930](https://github.com/woocommerce/woocommerce/pull/35930)
+* Fix - Fix wrong query param in onboarding product api call [#35926](https://github.com/woocommerce/woocommerce/pull/35926)
+* Fix - If order types have not been registered, do not attempt to count orders. [#35820](https://github.com/woocommerce/woocommerce/pull/35820)
+* Fix - Make the 'unprotected upload directory' notice dismissable. [#33544](https://github.com/woocommerce/woocommerce/pull/33544)
+* Fix - Update Playwright to 1.28.0 and explicitly set PHP version in GH action [#35679](https://github.com/woocommerce/woocommerce/pull/35679)
+* Fix - When importing product CSV, ensure line breaks within header columns do not break the import process. [#35880](https://github.com/woocommerce/woocommerce/pull/35880)
+* Add - Add CES exit prompt for setting pages, when tracking is enabled. [#35761](https://github.com/woocommerce/woocommerce/pull/35761)
+* Add - Add CES feedback functionality to the share feedback button within the Product MVP. [#35690](https://github.com/woocommerce/woocommerce/pull/35690)
+* Add - Add Denmark postcode validation. [#35653](https://github.com/woocommerce/woocommerce/pull/35653)
+* Add - Add exit prompt logic to get feedback if users leave product pages without saving when tracking is enabled. [#35728](https://github.com/woocommerce/woocommerce/pull/35728)
+* Add - Add FormFileUpload component [#35358](https://github.com/woocommerce/woocommerce/pull/35358)
+* Add - Add HPOS information to WC Tracker. [#35446](https://github.com/woocommerce/woocommerce/pull/35446)
+* Add - Add new option to create new attribute within add attribute modal. [#35100](https://github.com/woocommerce/woocommerce/pull/35100)
+* Add - Add new product management breadcrumbs to header [#35596](https://github.com/woocommerce/woocommerce/pull/35596)
+* Add - Add new Product MVP CES footer for gathering feedback on the new product management screen. [#35652](https://github.com/woocommerce/woocommerce/pull/35652)
+* Add - Add one-click installation to recommended extensions in Marketing page. [#35542](https://github.com/woocommerce/woocommerce/pull/35542)
+* Add - Add pagination to variations list [#35979](https://github.com/woocommerce/woocommerce/pull/35979)
+* Add - Add product settings menu in header [#35592](https://github.com/woocommerce/woocommerce/pull/35592)
+* Add - Add product tab headers and move sections to respective tabs [#35862](https://github.com/woocommerce/woocommerce/pull/35862)
+* Add - Add product variations list to new product management experience [#35889](https://github.com/woocommerce/woocommerce/pull/35889)
+* Add - Add support for custom order types in HPOS admin UI. [#35658](https://github.com/woocommerce/woocommerce/pull/35658)
+* Add - Add the woocommerce_order_applied_coupon hook [#35616](https://github.com/woocommerce/woocommerce/pull/35616)
+* Add - Add tracks events for 'product_view_product_click' and 'product_view_product_dismiss' [#35582](https://github.com/woocommerce/woocommerce/pull/35582)
+* Add - Introduces action `woocommerce_order_list_table_restrict_manage_orders` as an equivalent of the legacy `restrict_manage_posts` hook. [#36000](https://github.com/woocommerce/woocommerce/pull/36000)
+* Add - Open categories menu list when the user focus the category field [#35606](https://github.com/woocommerce/woocommerce/pull/35606)
+* Update - Match country name or ' - region' when filtering country select control #36120 [#36159](https://github.com/woocommerce/woocommerce/pull/36159)
+* Update - Update WooCommerce Blocks to 9.1.3 [#36125](https://github.com/woocommerce/woocommerce/pull/36125)
+* Update - Adapt the summary text in the product management form. [#35717](https://github.com/woocommerce/woocommerce/pull/35717)
+* Update - Add Codisto for WooCommerce to free extensions list [#36009](https://github.com/woocommerce/woocommerce/pull/36009)
+* Update - Add experimental open menu on focus option to the attribute and attribute term input fields. [#35758](https://github.com/woocommerce/woocommerce/pull/35758)
+* Update - Add missing tracks events [#35262](https://github.com/woocommerce/woocommerce/pull/35262)
+* Update - Add Pinterest for WooCommerce to free extensions list [#36003](https://github.com/woocommerce/woocommerce/pull/36003)
+* Update - Automatically create the custom order tables if the corresponding feature is enabled [#35357](https://github.com/woocommerce/woocommerce/pull/35357)
+* Update - Disable TikTok in the OBW [#35924](https://github.com/woocommerce/woocommerce/pull/35924)
+* Update - Include taxes migration in MigrationHelper::migrate_country_states [#35967](https://github.com/woocommerce/woocommerce/pull/35967)
+* Update - Increase consistency in relation to the way taxonomy term ordering is persisted. [#34645](https://github.com/woocommerce/woocommerce/pull/34645)
+* Update - Make product form header and actions responsive for smaller viewports [#35623](https://github.com/woocommerce/woocommerce/pull/35623)
+* Update - Remove welcome to woocommerce store note [#35342](https://github.com/woocommerce/woocommerce/pull/35342)
+* Update - Surface Amazon Pay as "Additional Payment Options" for UK/EU/JP [#35726](https://github.com/woocommerce/woocommerce/pull/35726)
+* Update - Update api-core-tests readme to reference correct directory for .env file [#35759](https://github.com/woocommerce/woocommerce/pull/35759)
+* Update - Update country data in api-core-tests to prevent numerous test data updates [#35557](https://github.com/woocommerce/woocommerce/pull/35557)
+* Update - update FAQ in readme consumed by .org [#35696](https://github.com/woocommerce/woocommerce/pull/35696)
+* Update - Update WooCommerce Blocks to 9.1.1 [#36004](https://github.com/woocommerce/woocommerce/pull/36004)
+* Update - Update wording for In-App Marketplace tour. [#35929](https://github.com/woocommerce/woocommerce/pull/35929)
+* Update - Updating all CES events to support two questions in modal. [#35680](https://github.com/woocommerce/woocommerce/pull/35680)
+* Dev - Allow the user to select multiple images in the Media Library [#35722](https://github.com/woocommerce/woocommerce/pull/35722)
+* Dev - Check if blocks have been added to rich text editors before updating value [#35626](https://github.com/woocommerce/woocommerce/pull/35626)
+* Dev - Make e2e tests compatible with nightly and release smoke test sites. [#35492](https://github.com/woocommerce/woocommerce/pull/35492)
+* Dev - Move file picker by clicking card into the MediaUploader component [#35738](https://github.com/woocommerce/woocommerce/pull/35738)
+* Dev - Update the "can manually add a variation" E2E test to prevent automatic creation of variations from all attributes. [#36008](https://github.com/woocommerce/woocommerce/pull/36008)
+* Tweak - Avoid deprecation notices under PHP 8.1 when calling wp_parse_url(). [#35648](https://github.com/woocommerce/woocommerce/pull/35648)
+* Tweak - Correct the usage of 'address' and 'addresses' within `wc_get_account_menu_items()`. [#32026](https://github.com/woocommerce/woocommerce/pull/32026)
+* Tweak - Create ProductForm component to merge similar structures between AddProductPage and EditProductPage [#35783](https://github.com/woocommerce/woocommerce/pull/35783)
+* Tweak - Improves efficiency of code responsible for determining plugin IDs (during feature compatibility checks). [#35727](https://github.com/woocommerce/woocommerce/pull/35727)
+* Tweak - Make the formatted shipping address available via the `woocommerce_cart_no_shipping_available_html` hook. [#30723](https://github.com/woocommerce/woocommerce/pull/30723)
+* Tweak - Make the OrdersTableDataStore init_order_record() and get_order_data_for_ids() functions protected rather than private [#35829](https://github.com/woocommerce/woocommerce/pull/35829)
+* Tweak - Move CSS about notice outside of .woocommerce class scope [#35912](https://github.com/woocommerce/woocommerce/pull/35912)
+* Tweak - Resolve an error in the product tracking code by testing to see if the `post_type` query var is set before checking its value. [#34501](https://github.com/woocommerce/woocommerce/pull/34501)
+* Tweak - Simplify wording within the customer emails for on-hold orders. [#31886](https://github.com/woocommerce/woocommerce/pull/31886)
+* Tweak - WooCommerce has now been tested up to WordPress 6.1.x. [#35985](https://github.com/woocommerce/woocommerce/pull/35985)
+* Performance - Split CALC_FOUND_ROW query into seperate count query for better performance. [#35468](https://github.com/woocommerce/woocommerce/pull/35468)
+* Enhancement - Add a bottom padding to the whole form [#35721](https://github.com/woocommerce/woocommerce/pull/35721)
+* Enhancement - Add a confirmation modal when the user tries to navigate away with unsaved changes [#35625](https://github.com/woocommerce/woocommerce/pull/35625)
+* Enhancement - Add a default placeholder title for newly added attributes and always show remove button for attributes [#35904](https://github.com/woocommerce/woocommerce/pull/35904)
+* Enhancement - Add help tip for Product Image and Product Gallery meta boxes [#35834](https://github.com/woocommerce/woocommerce/pull/35834)
+* Enhancement - Add support for product attribute taxonomy template [#35617](https://github.com/woocommerce/woocommerce/pull/35617)
+* Enhancement - Add warning banner that informs the user if they have conflicting tax display settings [#36010](https://github.com/woocommerce/woocommerce/pull/36010)
+* Enhancement - Change the width of pricing fields, SKU and Shipping Class to 50% in big screens (>960px) in new product management experience [#35545](https://github.com/woocommerce/woocommerce/pull/35545)
+* Enhancement - Fix price field currency symbol position [#35718](https://github.com/woocommerce/woocommerce/pull/35718)
+* Enhancement - Improve element stacking in modals on tablet and mobile [#35733](https://github.com/woocommerce/woocommerce/pull/35733)
+* Security - Customers REST API endpoint will now return user metadata only when requester has an administrator role [#36408](https://github.com/woocommerce/woocommerce/pull/36408).
+
+= 7.2.3 2023-1-9
+
+**WooCommerce Blocks 8.9.4**
+
+* Fix - fatal error in WordPress 5.8 when creating a post or page. #7496
+* Fix - hangs in the block editor with WordPress 5.8. #8095
+* Fix - Filter by Attribute block crashing in the editor of WordPress 5.8. #8101
+
= 7.2.2 2022-12-21 =
** WooCommerce**
diff --git a/package.json b/package.json
index 56b3481ca33..1e35a659206 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,7 @@
"scripts": {
"build": "pnpm exec turbo run turbo:build",
"test": "pnpm exec turbo run turbo:test",
+ "clean": "pnpm store prune && git clean -fx **/node_modules && pnpm i",
"preinstall": "npx only-allow pnpm",
"postinstall": "pnpm git:update-hooks",
"git:update-hooks": "rm -r .git/hooks && mkdir -p .git/hooks && husky install",
diff --git a/packages/js/admin-e2e-tests/changelog/update-changelogger b/packages/js/admin-e2e-tests/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/admin-e2e-tests/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/admin-e2e-tests/composer.json b/packages/js/admin-e2e-tests/composer.json
index 90649ce14ac..6f20e363555 100644
--- a/packages/js/admin-e2e-tests/composer.json
+++ b/packages/js/admin-e2e-tests/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/admin-e2e-tests/composer.lock b/packages/js/admin-e2e-tests/composer.lock
index 602ff6fabdc..f448cbf9e57 100644
--- a/packages/js/admin-e2e-tests/composer.lock
+++ b/packages/js/admin-e2e-tests/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "cae17ca18e2a2a6cefe200df88081346",
+ "content-hash": "959b38edbc3ae0c3853c02e86852f583",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/packages/js/api/changelog/update-changelogger b/packages/js/api/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/api/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/api/composer.json b/packages/js/api/composer.json
index 384ed03b22e..02a86b11c3a 100644
--- a/packages/js/api/composer.json
+++ b/packages/js/api/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/api/composer.lock b/packages/js/api/composer.lock
index e2ee0a36abe..aa3ed289cf2 100644
--- a/packages/js/api/composer.lock
+++ b/packages/js/api/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "2ac4a9ea3ab4687cb26b0075128628de",
+ "content-hash": "8cdc2ba8c2e8669b3d48cf7e4cb3c379",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/packages/js/components/CHANGELOG.md b/packages/js/components/CHANGELOG.md
index a8bb8684c2a..a7a86402539 100644
--- a/packages/js/components/CHANGELOG.md
+++ b/packages/js/components/CHANGELOG.md
@@ -2,6 +2,41 @@
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [12.0.0](https://www.npmjs.com/package/@woocommerce/components/v/12.0.0) - 2022-12-28
+
+- Patch - Add name to exported popover slot used to display SelectControl Menu, so it is only used for SelectControl menus. [#36124]
+- Patch - Close DateTimePickerControl's dropdown when blurring from input. [#36124]
+- Patch - DateTimePickerControl's onChange now only fires when there is an actual change to the datetime. [#36124]
+- Patch - Fix DateTimePickerControl's popover styling when slot-fill is used. [#36124]
+- Patch - Fixed DatePicker to work in WordPress 6.1 when currentDate is set to a moment instance. [#36124]
+- Patch - Fix pagination label text from uppercase to normal and font styles [#36124]
+- Patch - Include react-dates styles (no longer in WP 6.1+). [#36124]
+- Minor - Set editor mode on initialization to prevent initial text editor focus [#36124]
+- Patch - Set initial values prop from reset form function as optional [#36124]
+- Patch - Add aria-label for simple select dropdown [#36124]
+- Patch - Add async filtering support to the `__experimentalSelectControl` component [#36124]
+- Minor - Add className prop to ListItem. [#36124]
+- Minor - Add className prop to Sortable [#36124]
+- Minor - Added ability to force time when DateTimePickerControl is date-only (timeForDateOnly prop). [#36124]
+- Minor - Add experimental ConditionalWrapper component [#36124]
+- Patch - Add experimental open menu when user focus the select control input element [#36124]
+- Minor - Adding isHidden option for primary button in TourKit component. [#36124]
+- Minor - Add support for custom suffix prop on SelectControl. [#36124]
+- Minor - Make Table component accept className prop. [#36124]
+- Minor - Move classname down in SelectControl Menu so it is on the actual Menu element. [#36124]
+- Major [ **BREAKING CHANGE** ] - Switch DateTimePickerControl formatting to PHP style, for WP compatibility. [#36124]
+- Patch - Updating downshift to 6.1.12. [#36124]
+- Minor - Allow the user to select multiple images in the Media Library [#36124]
+- Patch - Migrate search component to TS [#36124]
+- Minor - Move file picker by clicking card into the MediaUploader component [#36124]
+- Minor - Fix up initial block selection in RichTextEditor and add media blocks [#36124]
+- Patch - Updated image gallery toolbar position and tooltips. [#36124]
+- Patch - Update variable name within useFormContext. [#36124]
+- Minor - Add noDataLabel property into table.js component to allow No Data label customization. [#36124]
+- Patch - Align the field height across the whole form [#36124]
+- Patch - Fade the value selection field in the Attributes modal when no attribute is added [#36124]
+- Patch - Update font size and spacing in the tooltip component [#36124]
+
## [11.1.0](https://www.npmjs.com/package/@woocommerce/components/v/11.1.0) - 2022-10-24
- Minor - Allow passing of additional props to form inputs [#35160]
diff --git a/packages/js/components/changelog/add-34332-add-attribute-edit b/packages/js/components/changelog/add-34332-add-attribute-edit
deleted file mode 100644
index 42678d69bf9..00000000000
--- a/packages/js/components/changelog/add-34332-add-attribute-edit
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: update
-
-Updating downshift to 6.1.12.
diff --git a/packages/js/components/changelog/add-34_create_new_category_field_modal b/packages/js/components/changelog/add-34_create_new_category_field_modal
deleted file mode 100644
index 4bfc4ae8b9b..00000000000
--- a/packages/js/components/changelog/add-34_create_new_category_field_modal
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: update
-
-Move classname down in SelectControl Menu so it is on the actual Menu element.
diff --git a/packages/js/components/changelog/add-35046 b/packages/js/components/changelog/add-35046
deleted file mode 100644
index e9d7806593d..00000000000
--- a/packages/js/components/changelog/add-35046
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: add
-
-Add experimental ConditionalWrapper component
diff --git a/packages/js/components/changelog/add-35076 b/packages/js/components/changelog/add-35076
deleted file mode 100644
index acbe196ea01..00000000000
--- a/packages/js/components/changelog/add-35076
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: add
-
-Add async filtering support to the `__experimentalSelectControl` component
diff --git a/packages/js/components/changelog/add-35173-category-field-improvements b/packages/js/components/changelog/add-35173-category-field-improvements
deleted file mode 100644
index 5eb682fd22d..00000000000
--- a/packages/js/components/changelog/add-35173-category-field-improvements
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: add
-
-Add experimental open menu when user focus the select control input element
diff --git a/packages/js/components/changelog/add-35181_allow_select_multiple_images b/packages/js/components/changelog/add-35181_allow_select_multiple_images
deleted file mode 100644
index 247d164a7f7..00000000000
--- a/packages/js/components/changelog/add-35181_allow_select_multiple_images
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: dev
-
-Allow the user to select multiple images in the Media Library
diff --git a/packages/js/components/changelog/add-35301-delayed-ces-prompt b/packages/js/components/changelog/add-35301-delayed-ces-prompt
deleted file mode 100644
index a0589d9d4ab..00000000000
--- a/packages/js/components/changelog/add-35301-delayed-ces-prompt
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: add
-
-Adding isHidden option for primary button in TourKit component.
diff --git a/packages/js/components/changelog/add-35788 b/packages/js/components/changelog/add-35788
deleted file mode 100644
index 7d0c1f80dbc..00000000000
--- a/packages/js/components/changelog/add-35788
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fix
-
-Fix pagination label text from uppercase to normal and font styles
diff --git a/packages/js/components/changelog/add-36014-mvp-field-slot b/packages/js/components/changelog/add-36014-mvp-field-slot
new file mode 100644
index 00000000000..d4ba7a6730e
--- /dev/null
+++ b/packages/js/components/changelog/add-36014-mvp-field-slot
@@ -0,0 +1,4 @@
+Significance: minor
+Type: add
+
+Adding WooProductFieldItem slotfill.
diff --git a/packages/js/components/changelog/enhancement-table-add-no-data-label-property b/packages/js/components/changelog/add-36015-mvp-section-slot
similarity index 58%
rename from packages/js/components/changelog/enhancement-table-add-no-data-label-property
rename to packages/js/components/changelog/add-36015-mvp-section-slot
index 70efa89f698..e22146e0c31 100644
--- a/packages/js/components/changelog/enhancement-table-add-no-data-label-property
+++ b/packages/js/components/changelog/add-36015-mvp-section-slot
@@ -1,4 +1,4 @@
Significance: minor
-Type: enhancement
+Type: add
-Add noDataLabel property into table.js component to allow No Data label customization.
+Adding the WooProductSectionItem slotfill component.
diff --git a/packages/js/components/changelog/add-36074_product_form_field_registry b/packages/js/components/changelog/add-36074_product_form_field_registry
new file mode 100644
index 00000000000..bef870437e3
--- /dev/null
+++ b/packages/js/components/changelog/add-36074_product_form_field_registry
@@ -0,0 +1,4 @@
+Significance: minor
+Type: add
+
+Add product field store and helper functions for rendering fields from config.
diff --git a/packages/js/components/changelog/add-select-control-suffix b/packages/js/components/changelog/add-select-control-suffix
deleted file mode 100644
index 860761e71c0..00000000000
--- a/packages/js/components/changelog/add-select-control-suffix
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: add
-
-Add support for custom suffix prop on SelectControl.
diff --git a/packages/js/components/changelog/canceled b/packages/js/components/changelog/canceled
new file mode 100644
index 00000000000..2f8b5c512ca
--- /dev/null
+++ b/packages/js/components/changelog/canceled
@@ -0,0 +1,4 @@
+Significance: minor
+Type: tweak
+
+Update spelling of Cancelled to Canceled for US English.
diff --git a/packages/js/components/changelog/dev-35714_move_file_picker_to_media_uploader b/packages/js/components/changelog/dev-35714_move_file_picker_to_media_uploader
deleted file mode 100644
index 62cf00b1a9d..00000000000
--- a/packages/js/components/changelog/dev-35714_move_file_picker_to_media_uploader
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: dev
-
-Move file picker by clicking card into the MediaUploader component
diff --git a/packages/js/components/changelog/dev-adjust-sync b/packages/js/components/changelog/dev-migrate-link-ts
similarity index 50%
rename from packages/js/components/changelog/dev-adjust-sync
rename to packages/js/components/changelog/dev-migrate-link-ts
index f11d1e352f4..774c442e98f 100644
--- a/packages/js/components/changelog/dev-adjust-sync
+++ b/packages/js/components/changelog/dev-migrate-link-ts
@@ -1,5 +1,4 @@
Significance: patch
Type: dev
-Comment: Dev dependency bump
-
+Migrate Link component to TS
\ No newline at end of file
diff --git a/packages/js/components/changelog/dev-migrate-product-image-component-to-ts b/packages/js/components/changelog/dev-migrate-product-image-component-to-ts
new file mode 100644
index 00000000000..c86b6f4ce92
--- /dev/null
+++ b/packages/js/components/changelog/dev-migrate-product-image-component-to-ts
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Migrate ProductImage component to TS
\ No newline at end of file
diff --git a/packages/js/components/changelog/dev-migrate-search-component-to-ts b/packages/js/components/changelog/dev-migrate-section-component-to-ts
similarity index 50%
rename from packages/js/components/changelog/dev-migrate-search-component-to-ts
rename to packages/js/components/changelog/dev-migrate-section-component-to-ts
index ded2b14cc92..66400fa1063 100644
--- a/packages/js/components/changelog/dev-migrate-search-component-to-ts
+++ b/packages/js/components/changelog/dev-migrate-section-component-to-ts
@@ -1,4 +1,4 @@
Significance: patch
Type: dev
-Migrate search component to TS
+Migrate Section component to TS
\ No newline at end of file
diff --git a/packages/js/components/changelog/dev-migrate-tag-component-to-ts b/packages/js/components/changelog/dev-migrate-tag-component-to-ts
new file mode 100644
index 00000000000..e8c0ed291c6
--- /dev/null
+++ b/packages/js/components/changelog/dev-migrate-tag-component-to-ts
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Migrate Tag component to TS
diff --git a/packages/js/components/changelog/enhancement-35190-update-tooltip-styles b/packages/js/components/changelog/enhancement-35190-update-tooltip-styles
deleted file mode 100644
index 4d21861d602..00000000000
--- a/packages/js/components/changelog/enhancement-35190-update-tooltip-styles
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: enhancement
-
-Update font size and spacing in the tooltip component
diff --git a/packages/js/components/changelog/enhancement-35567 b/packages/js/components/changelog/enhancement-35567
deleted file mode 100644
index 0d4f5a995a9..00000000000
--- a/packages/js/components/changelog/enhancement-35567
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: enhancement
-
-Align the field height across the whole form
diff --git a/packages/js/components/changelog/enhancement-35568 b/packages/js/components/changelog/enhancement-35568
deleted file mode 100644
index 5c6dabeaa7e..00000000000
--- a/packages/js/components/changelog/enhancement-35568
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: enhancement
-
-Fade the value selection field in the Attributes modal when no attribute is added
diff --git a/packages/js/components/changelog/fix-35697 b/packages/js/components/changelog/fix-35697
deleted file mode 100644
index 8e9f36504c7..00000000000
--- a/packages/js/components/changelog/fix-35697
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: fix
-
-Set editor mode on initialization to prevent initial text editor focus
diff --git a/packages/js/components/changelog/fix-36129-table-className b/packages/js/components/changelog/fix-36129-table-className
deleted file mode 100644
index 1b601edb7bf..00000000000
--- a/packages/js/components/changelog/fix-36129-table-className
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: add
-
-Make Table component accept className prop.
diff --git a/packages/js/components/changelog/fix-36256_moving_list_item_moves_image b/packages/js/components/changelog/fix-36256_moving_list_item_moves_image
new file mode 100644
index 00000000000..2584c971946
--- /dev/null
+++ b/packages/js/components/changelog/fix-36256_moving_list_item_moves_image
@@ -0,0 +1,4 @@
+Significance: minor
+Type: fix
+
+Fix SortableItem duplicated id
diff --git a/packages/js/components/changelog/fix-analytics-daterange-custom-wp61 b/packages/js/components/changelog/fix-analytics-daterange-custom-wp61
deleted file mode 100644
index f965ebdce29..00000000000
--- a/packages/js/components/changelog/fix-analytics-daterange-custom-wp61
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fix
-
-Include react-dates styles (no longer in WP 6.1+).
diff --git a/packages/js/components/changelog/fix-date-time-picker-blur-close b/packages/js/components/changelog/fix-date-time-picker-blur-close
deleted file mode 100644
index 28fa1e5dcd4..00000000000
--- a/packages/js/components/changelog/fix-date-time-picker-blur-close
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fix
-
-Close DateTimePickerControl's dropdown when blurring from input.
diff --git a/packages/js/components/changelog/fix-date-time-picker-control-onchange b/packages/js/components/changelog/fix-date-time-picker-control-onchange
deleted file mode 100644
index f7074ae252b..00000000000
--- a/packages/js/components/changelog/fix-date-time-picker-control-onchange
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fix
-
-DateTimePickerControl's onChange now only fires when there is an actual change to the datetime.
diff --git a/packages/js/components/changelog/fix-date-time-picker-control-suffix-style b/packages/js/components/changelog/fix-date-time-picker-control-suffix-style
deleted file mode 100644
index 97b797ed6cb..00000000000
--- a/packages/js/components/changelog/fix-date-time-picker-control-suffix-style
+++ /dev/null
@@ -1,5 +0,0 @@
-Significance: patch
-Type: fix
-Comment: Just a minor tweak to the CSS for the DateTimePickerControl suffix.
-
-
diff --git a/packages/js/components/changelog/fix-datepicker-moment b/packages/js/components/changelog/fix-datepicker-moment
deleted file mode 100644
index 8d2aafbd252..00000000000
--- a/packages/js/components/changelog/fix-datepicker-moment
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fix
-
-Fixed DatePicker to work in WordPress 6.1 when currentDate is set to a moment instance.
diff --git a/packages/js/components/changelog/fix-form_ts_error b/packages/js/components/changelog/fix-form_ts_error
deleted file mode 100644
index fc0ec73f0ee..00000000000
--- a/packages/js/components/changelog/fix-form_ts_error
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: tweak
-
-Update variable name within useFormContext.
diff --git a/packages/js/components/changelog/fix-product-images-toolbar-positioning b/packages/js/components/changelog/fix-product-images-toolbar-positioning
deleted file mode 100644
index fc6df228ba7..00000000000
--- a/packages/js/components/changelog/fix-product-images-toolbar-positioning
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: tweak
-
-Updated image gallery toolbar position and tooltips.
diff --git a/packages/js/components/changelog/fix-rich-text-editor-selection b/packages/js/components/changelog/fix-rich-text-editor-selection
deleted file mode 100644
index 59caa9a16d8..00000000000
--- a/packages/js/components/changelog/fix-rich-text-editor-selection
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: tweak
-
-Fix up initial block selection in RichTextEditor and add media blocks
diff --git a/packages/js/components/changelog/fix-select-control-popover-slots b/packages/js/components/changelog/fix-select-control-popover-slots
deleted file mode 100644
index 81d59f026ab..00000000000
--- a/packages/js/components/changelog/fix-select-control-popover-slots
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fix
-
-Add name to exported popover slot used to display SelectControl Menu, so it is only used for SelectControl menus.
diff --git a/packages/js/components/changelog/fix-unsaved-prompt b/packages/js/components/changelog/fix-unsaved-prompt
deleted file mode 100644
index 80d311cee86..00000000000
--- a/packages/js/components/changelog/fix-unsaved-prompt
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fix
-
-Set initial values prop from reset form function as optional
diff --git a/packages/js/components/changelog/list-item-classname b/packages/js/components/changelog/list-item-classname
deleted file mode 100644
index 9f5a5ea0d55..00000000000
--- a/packages/js/components/changelog/list-item-classname
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: add
-
-Add className prop to ListItem.
diff --git a/packages/js/components/changelog/update-add-aria-label-for-simple-select-dropdown b/packages/js/components/changelog/update-add-aria-label-for-simple-select-dropdown
deleted file mode 100644
index ff75398a39b..00000000000
--- a/packages/js/components/changelog/update-add-aria-label-for-simple-select-dropdown
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: add
-
-Add aria-label for simple select dropdown
diff --git a/packages/js/components/changelog/update-changelogger b/packages/js/components/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/components/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/components/changelog/update-date-time-picker-control-force-time-to b/packages/js/components/changelog/update-date-time-picker-control-force-time-to
deleted file mode 100644
index fcf4278fc5f..00000000000
--- a/packages/js/components/changelog/update-date-time-picker-control-force-time-to
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: minor
-Type: add
-
-Added ability to force time when DateTimePickerControl is date-only (timeForDateOnly prop).
diff --git a/packages/js/components/changelog/update-date-time-picker-control-formatting b/packages/js/components/changelog/update-date-time-picker-control-formatting
deleted file mode 100644
index 800e0dbc01d..00000000000
--- a/packages/js/components/changelog/update-date-time-picker-control-formatting
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: major
-Type: update
-
-Switch DateTimePickerControl formatting to PHP style, for WP compatibility.
diff --git a/packages/js/components/changelog/update-date-time-picker-control-picker-classname b/packages/js/components/changelog/update-date-time-picker-control-picker-classname
deleted file mode 100644
index 4f444ed8862..00000000000
--- a/packages/js/components/changelog/update-date-time-picker-control-picker-classname
+++ /dev/null
@@ -1,4 +0,0 @@
-Significance: patch
-Type: fix
-
-Fix DateTimePickerControl's popover styling when slot-fill is used.
diff --git a/packages/js/components/composer.json b/packages/js/components/composer.json
index 9bb6df42457..002cbd95bab 100644
--- a/packages/js/components/composer.json
+++ b/packages/js/components/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/components/composer.lock b/packages/js/components/composer.lock
index 87b9fcf1a87..4324a3af9b4 100644
--- a/packages/js/components/composer.lock
+++ b/packages/js/components/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "75af54f4e83b1e2c7c96371c3288e355",
+ "content-hash": "0e715b7322bdb353060f76a3279195e1",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/packages/js/components/package.json b/packages/js/components/package.json
index 221e7c2de54..93dd1d7cb21 100644
--- a/packages/js/components/package.json
+++ b/packages/js/components/package.json
@@ -1,6 +1,6 @@
{
"name": "@woocommerce/components",
- "version": "11.1.0",
+ "version": "12.0.0",
"description": "UI components for WooCommerce.",
"author": "Automattic",
"license": "GPL-3.0-or-later",
@@ -118,6 +118,7 @@
"@types/prop-types": "^15.7.4",
"@types/react": "^17.0.2",
"@types/testing-library__jest-dom": "^5.14.3",
+ "@types/uuid": "^8.3.0",
"@types/wordpress__components": "^19.10.1",
"@types/wordpress__data": "^6.0.0",
"@types/wordpress__media-utils": "^3.0.0",
@@ -137,6 +138,7 @@
"sass-loader": "^10.2.1",
"ts-jest": "^27.1.3",
"typescript": "^4.8.3",
+ "uuid": "^8.3.0",
"webpack": "^5.70.0",
"webpack-cli": "^3.3.12"
},
diff --git a/packages/js/components/src/index.ts b/packages/js/components/src/index.ts
index f19e35f5a5e..8330ed8b4f2 100644
--- a/packages/js/components/src/index.ts
+++ b/packages/js/components/src/index.ts
@@ -21,7 +21,7 @@ export { default as FilterPicker } from './filter-picker';
export { H, Section } from './section';
export { ImageGallery, ImageGalleryItem } from './image-gallery';
export { default as ImageUpload } from './image-upload';
-export { default as Link } from './link';
+export { Link } from './link';
export { default as List } from './list';
export { MediaUploader } from './media-uploader';
export { default as MenuItem } from './ellipsis-menu/menu-item';
@@ -84,3 +84,6 @@ export { DynamicForm } from './dynamic-form';
export { default as TourKit } from './tour-kit';
export * as TourKitTypes from './tour-kit/types';
export { CollapsibleContent } from './collapsible-content';
+export { createOrderedChildren, sortFillsByOrder } from './utils';
+export { WooProductFieldItem as __experimentalWooProductFieldItem } from './woo-product-field-item';
+export { WooProductSectionItem as __experimentalWooProductSectionItem } from './woo-product-section-item';
diff --git a/packages/js/components/src/link/index.js b/packages/js/components/src/link/index.js
deleted file mode 100644
index 50cf32b1064..00000000000
--- a/packages/js/components/src/link/index.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * External dependencies
- */
-import PropTypes from 'prop-types';
-import { partial } from 'lodash';
-import { createElement } from '@wordpress/element';
-import { getHistory } from '@woocommerce/navigation';
-
-/**
- * Use `Link` to create a link to another resource. It accepts a type to automatically
- * create wp-admin links, wc-admin links, and external links.
- */
-
-function Link( { children, href, type, ...props } ) {
- // @todo Investigate further if we can use directly.
- // With React Router 5+, cannot be used outside of the main elements,
- // which seems to include components imported from @woocommerce/components. For now, we can use the history object directly.
- const wcAdminLinkHandler = ( onClick, event ) => {
- // If cmd, ctrl, alt, or shift are used, use default behavior to allow opening in a new tab.
- if (
- event.ctrlKey ||
- event.metaKey ||
- event.altKey ||
- event.shiftKey
- ) {
- return;
- }
-
- event.preventDefault();
-
- // If there is an onclick event, execute it.
- const onClickResult = onClick ? onClick( event ) : true;
-
- // Mimic browser behavior and only continue if onClickResult is not explicitly false.
- if ( onClickResult === false ) {
- return;
- }
-
- getHistory().push( event.target.closest( 'a' ).getAttribute( 'href' ) );
- };
-
- const passProps = {
- ...props,
- 'data-link-type': type,
- };
-
- if ( type === 'wc-admin' ) {
- passProps.onClick = partial( wcAdminLinkHandler, passProps.onClick );
- }
-
- return (
-
- { children }
-
- );
-}
-
-Link.propTypes = {
- /**
- * The resource to link to.
- */
- href: PropTypes.string.isRequired,
- /**
- * Type of link. For wp-admin and wc-admin, the correct prefix is appended.
- */
- type: PropTypes.oneOf( [ 'wp-admin', 'wc-admin', 'external' ] ).isRequired,
-};
-
-Link.defaultProps = {
- type: 'wc-admin',
-};
-
-Link.contextTypes = {
- router: PropTypes.object,
-};
-
-export default Link;
diff --git a/packages/js/components/src/link/index.tsx b/packages/js/components/src/link/index.tsx
new file mode 100644
index 00000000000..79f5aba23b4
--- /dev/null
+++ b/packages/js/components/src/link/index.tsx
@@ -0,0 +1,94 @@
+/**
+ * External dependencies
+ */
+import PropTypes from 'prop-types';
+import { partial } from 'lodash';
+import { createElement } from '@wordpress/element';
+import { getHistory } from '@woocommerce/navigation';
+import React from 'react';
+
+interface LinkProps {
+ /** Type of link. For wp-admin and wc-admin, the correct prefix is appended. */
+ type?: 'wc-admin' | 'wp-admin' | 'external';
+ /** The resource to link to. */
+ href: string;
+}
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+type LinkOnClickHandlerFunction = ( ...props: any ) => any; // we don't want to restrict this function at all
+type LinkOnclickHandler = (
+ onClick: LinkOnClickHandlerFunction | undefined,
+ event: React.MouseEvent< Element > | undefined
+) => void;
+
+/**
+ * Use `Link` to create a link to another resource. It accepts a type to automatically
+ * create wp-admin links, wc-admin links, and external links.
+ */
+export const Link = ( {
+ href,
+ children,
+ type = 'wc-admin',
+ ...props
+}: React.AnchorHTMLAttributes< HTMLAnchorElement > &
+ LinkProps ): React.ReactElement => {
+ // ( { children, href, type, ...props } ) => {
+ // @todo Investigate further if we can use directly.
+ // With React Router 5+, cannot be used outside of the main elements,
+ // which seems to include components imported from @woocommerce/components. For now, we can use the history object directly.
+ const wcAdminLinkHandler: LinkOnclickHandler = ( onClick, event ) => {
+ // If cmd, ctrl, alt, or shift are used, use default behavior to allow opening in a new tab.
+ if (
+ event?.ctrlKey ||
+ event?.metaKey ||
+ event?.altKey ||
+ event?.shiftKey
+ ) {
+ return;
+ }
+
+ event?.preventDefault();
+
+ // If there is an onclick event, execute it.
+ const onClickResult = onClick && event ? onClick( event ) : true;
+
+ // Mimic browser behavior and only continue if onClickResult is not explicitly false.
+ if ( onClickResult === false ) {
+ return;
+ }
+
+ if ( event?.target instanceof Element ) {
+ const closestEventTarget = event.target
+ .closest( 'a' )
+ ?.getAttribute( 'href' );
+ if ( closestEventTarget ) {
+ getHistory().push( closestEventTarget );
+ } else {
+ // eslint-disable-next-line no-console
+ console.error(
+ '@woocommerce/components/link is trying to push an undefined state into navigation stack'
+ ); // This shouldn't happen as we wrap with below
+ }
+ }
+ };
+
+ const passProps = {
+ ...props,
+ 'data-link-type': type,
+ };
+
+ if ( type === 'wc-admin' ) {
+ passProps.onClick = partial( wcAdminLinkHandler, passProps.onClick );
+ }
+
+ return (
+
+ { children }
+
+ );
+};
+
+Link.contextTypes = {
+ router: PropTypes.object,
+};
+
+export default Link;
diff --git a/packages/js/components/src/link/stories/index.js b/packages/js/components/src/link/stories/index.tsx
similarity index 95%
rename from packages/js/components/src/link/stories/index.js
rename to packages/js/components/src/link/stories/index.tsx
index b3ca2a03af0..dc048043a2a 100644
--- a/packages/js/components/src/link/stories/index.js
+++ b/packages/js/components/src/link/stories/index.tsx
@@ -3,11 +3,12 @@
*/
import { withConsole } from '@storybook/addon-console';
import { createElement } from '@wordpress/element';
+import React from 'react';
/**
* Internal dependencies
*/
-import Link from '../';
+import Link from '..';
function logLinkClick( event ) {
const a = event.currentTarget;
diff --git a/packages/js/components/src/link/test/index.js b/packages/js/components/src/link/test/index.tsx
similarity index 92%
rename from packages/js/components/src/link/test/index.js
rename to packages/js/components/src/link/test/index.tsx
index d5d54b9b42d..c800ed0c789 100644
--- a/packages/js/components/src/link/test/index.js
+++ b/packages/js/components/src/link/test/index.tsx
@@ -1,13 +1,13 @@
/**
* External dependencies
*/
-import { fireEvent, render } from '@testing-library/react';
+import { render, screen, fireEvent } from '@testing-library/react';
import { createElement } from '@wordpress/element';
/**
* Internal dependencies
*/
-import Link from '../index';
+import { Link } from '..';
describe( 'Link', () => {
it( 'should render `external` links', () => {
@@ -112,7 +112,7 @@ describe( 'Link', () => {
return false;
} );
- const { container } = render(
+ render(
{
);
- fireEvent.click( container.firstChild );
+ const testLink = screen.getByText( 'WooCommerce.com' );
+
+ fireEvent.click( testLink );
expect( clickHandler ).toHaveBeenCalled();
} );
diff --git a/packages/js/components/src/product-fields/README.md b/packages/js/components/src/product-fields/README.md
new file mode 100644
index 00000000000..3853b38445f
--- /dev/null
+++ b/packages/js/components/src/product-fields/README.md
@@ -0,0 +1,46 @@
+# Product Fields
+
+Product Fields are used within the WooCommerce Admin product editor, for rendering new fields using PHP.
+
+## Example
+
+```js
+// product-field.js
+( function ( element ) {
+ const el = element.createElement;
+
+ registerProductField( 'number', {
+ name: 'number',
+ render: () => {
+ return ;
+ },
+ } );
+} )( window.wp.element );
+```
+
+## API
+
+### registerProductField
+
+Registers a new product field provided a unique name and an object defining its
+behavior.
+
+_Usage_
+
+```js
+import { __ } from '@wordpress/i18n';
+import { registerProductField } from '@woocommerce/components';
+
+registerProductField( 'number', {
+ name: 'number',
+ render: () => {
+ return ;
+ },
+} );
+```
+
+_Parameters_
+
+- _fieldName_ `string`: Field name.
+- _settings_ `Object`: Field settings.
+ - _render_ `ComponentType`: React functional component to be rendered.
diff --git a/packages/js/components/src/product-fields/api/index.ts b/packages/js/components/src/product-fields/api/index.ts
new file mode 100644
index 00000000000..1954665dce2
--- /dev/null
+++ b/packages/js/components/src/product-fields/api/index.ts
@@ -0,0 +1,2 @@
+export * from './registration';
+export * from './render';
diff --git a/packages/js/components/src/product-fields/api/registration.ts b/packages/js/components/src/product-fields/api/registration.ts
new file mode 100644
index 00000000000..d9b8c5f4cc6
--- /dev/null
+++ b/packages/js/components/src/product-fields/api/registration.ts
@@ -0,0 +1,45 @@
+/**
+ * External dependencies
+ */
+import { select, dispatch } from '@wordpress/data';
+
+/**
+ * Internal dependencies
+ */
+import { store as productFieldStore } from '../store';
+import { ProductFieldDefinition } from '../store/types';
+
+/**
+ * Registers a new product field provided a unique name and an object defining its
+ * behavior. Once registered, the field is made available to use with the product form API.
+ *
+ * @param {string|Object} fieldName Field name.
+ * @param {Object} settings Field settings.
+ *
+ * @example
+ * ```js
+ * import { registerProductField } from '@woocommerce/components'
+ *
+ * registerProductFieldType( 'attributes-field', {
+ * } );
+ * ```
+ */
+export function registerProductField(
+ fieldName: string,
+ settings: ProductFieldDefinition
+) {
+ if ( select( productFieldStore ).getProductField( fieldName ) ) {
+ // eslint-disable-next-line no-console
+ console.error(
+ 'Product Field "' + fieldName + '" is already registered.'
+ );
+ return;
+ }
+
+ dispatch( productFieldStore ).registerProductField( {
+ attributes: {},
+ ...settings,
+ } );
+
+ return select( productFieldStore ).getProductField( fieldName );
+}
diff --git a/packages/js/components/src/product-fields/api/render.tsx b/packages/js/components/src/product-fields/api/render.tsx
new file mode 100644
index 00000000000..5fc727f08af
--- /dev/null
+++ b/packages/js/components/src/product-fields/api/render.tsx
@@ -0,0 +1,28 @@
+/**
+ * External dependencies
+ */
+import { select } from '@wordpress/data';
+import { createElement } from '@wordpress/element';
+
+/**
+ * Internal dependencies
+ */
+import { store as productFieldStore } from '../store';
+import { ProductFieldDefinition } from '../store/types';
+
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+export function renderField( name: string, props: Record< string, any > ) {
+ const fieldConfig: ProductFieldDefinition =
+ select( productFieldStore ).getProductField( name );
+
+ if ( fieldConfig.render ) {
+ return ;
+ }
+ if ( fieldConfig.type ) {
+ return createElement( 'input', {
+ type: fieldConfig.type,
+ ...props,
+ } );
+ }
+ return null;
+}
diff --git a/packages/js/components/src/product-fields/index.ts b/packages/js/components/src/product-fields/index.ts
new file mode 100644
index 00000000000..a28dcc4ff74
--- /dev/null
+++ b/packages/js/components/src/product-fields/index.ts
@@ -0,0 +1,2 @@
+export { store } from './store';
+export * from './api';
diff --git a/packages/js/components/src/product-fields/store/action-types.ts b/packages/js/components/src/product-fields/store/action-types.ts
new file mode 100644
index 00000000000..eee684797bf
--- /dev/null
+++ b/packages/js/components/src/product-fields/store/action-types.ts
@@ -0,0 +1,5 @@
+export enum TYPES {
+ REGISTER_FIELD = 'REGISTER_FIELD',
+}
+
+export default TYPES;
diff --git a/packages/js/components/src/product-fields/store/actions.ts b/packages/js/components/src/product-fields/store/actions.ts
new file mode 100644
index 00000000000..a8ad2f0eb8e
--- /dev/null
+++ b/packages/js/components/src/product-fields/store/actions.ts
@@ -0,0 +1,14 @@
+/**
+ * Internal dependencies
+ */
+import TYPES from './action-types';
+import { ProductFieldDefinition } from './types';
+
+export function registerProductField( field: ProductFieldDefinition ) {
+ return {
+ type: TYPES.REGISTER_FIELD as const,
+ field,
+ };
+}
+
+export type Actions = ReturnType< typeof registerProductField >;
diff --git a/packages/js/components/src/product-fields/store/constants.ts b/packages/js/components/src/product-fields/store/constants.ts
new file mode 100644
index 00000000000..d49d3fb3e21
--- /dev/null
+++ b/packages/js/components/src/product-fields/store/constants.ts
@@ -0,0 +1 @@
+export const STORE_NAME = 'wc/admin/product/fields';
diff --git a/packages/js/components/src/product-fields/store/index.ts b/packages/js/components/src/product-fields/store/index.ts
new file mode 100644
index 00000000000..9c53ed96870
--- /dev/null
+++ b/packages/js/components/src/product-fields/store/index.ts
@@ -0,0 +1,21 @@
+/**
+ * External dependencies
+ */
+import { createReduxStore, register } from '@wordpress/data';
+
+/**
+ * Internal dependencies
+ */
+import reducer from './reducer';
+import * as selectors from './selectors';
+import * as actions from './actions';
+import { STORE_NAME } from './constants';
+
+export const store = createReduxStore( STORE_NAME, {
+ // @ts-expect-error reducer has correct format.
+ reducer,
+ selectors,
+ actions,
+} );
+
+register( store );
diff --git a/packages/js/components/src/product-fields/store/reducer.ts b/packages/js/components/src/product-fields/store/reducer.ts
new file mode 100644
index 00000000000..cb2338f963e
--- /dev/null
+++ b/packages/js/components/src/product-fields/store/reducer.ts
@@ -0,0 +1,32 @@
+/**
+ * Internal dependencies
+ */
+import TYPES from './action-types';
+import { Actions } from './actions';
+import { ProductFieldState } from './types';
+
+const reducer = (
+ state: ProductFieldState = {
+ fields: {},
+ },
+ payload: Actions
+) => {
+ if ( payload && 'type' in payload ) {
+ switch ( payload.type ) {
+ case TYPES.REGISTER_FIELD:
+ return {
+ ...state,
+ fields: {
+ ...state.fields,
+ [ payload.field.name ]: payload.field,
+ },
+ };
+ default:
+ return state;
+ }
+ }
+ return state;
+};
+
+export type State = ReturnType< typeof reducer >;
+export default reducer;
diff --git a/packages/js/components/src/product-fields/store/selectors.ts b/packages/js/components/src/product-fields/store/selectors.ts
new file mode 100644
index 00000000000..bf65df94899
--- /dev/null
+++ b/packages/js/components/src/product-fields/store/selectors.ts
@@ -0,0 +1,20 @@
+/**
+ * External dependencies
+ */
+import memoize from 'memoize-one';
+
+/**
+ * Internal dependencies
+ */
+import { ProductFieldState } from './types';
+
+export function getProductField( state: ProductFieldState, name: string ) {
+ return state.fields[ name ] || null;
+}
+
+export const getRegisteredProductFields = memoize(
+ ( state: ProductFieldState ) => Object.keys( state.fields ),
+ ( [ newState ], [ oldState ] ) => {
+ return newState.fields === oldState.fields;
+ }
+);
diff --git a/packages/js/components/src/product-fields/store/types.ts b/packages/js/components/src/product-fields/store/types.ts
new file mode 100644
index 00000000000..c5de06cb663
--- /dev/null
+++ b/packages/js/components/src/product-fields/store/types.ts
@@ -0,0 +1,15 @@
+/**
+ * External dependencies
+ */
+import { ComponentType } from 'react';
+
+export type ProductFieldDefinition = {
+ name: string;
+ type?: string;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ render?: ComponentType;
+};
+
+export type ProductFieldState = {
+ fields: Record< string, ProductFieldDefinition >;
+};
diff --git a/packages/js/components/src/product-fields/stories/index.tsx b/packages/js/components/src/product-fields/stories/index.tsx
new file mode 100644
index 00000000000..04496d889ca
--- /dev/null
+++ b/packages/js/components/src/product-fields/stories/index.tsx
@@ -0,0 +1,71 @@
+/**
+ * External dependencies
+ */
+import React from 'react';
+import { useState, createElement } from '@wordpress/element';
+import { createRegistry, RegistryProvider, select } from '@wordpress/data';
+import {
+ // @ts-expect-error `__experimentalInputControl` does exist.
+ __experimentalInputControl as InputControl,
+} from '@wordpress/components';
+
+/**
+ * Internal dependencies
+ */
+import { store } from '../store';
+import { registerProductField, renderField } from '../api';
+
+const registry = createRegistry();
+// eslint-disable-next-line @typescript-eslint/ban-ts-comment
+// @ts-ignore No types for this exist yet.
+registry.register( store );
+
+registerProductField( 'text', {
+ name: 'text',
+ render: ( props ) => {
+ return ;
+ },
+} );
+
+registerProductField( 'number', {
+ name: 'number',
+ render: () => {
+ return ;
+ },
+} );
+
+const RenderField = () => {
+ const fields: string[] = select( store ).getRegisteredProductFields();
+ const [ selectedField, setSelectedField ] = useState(
+ fields ? fields[ 0 ] : undefined
+ );
+
+ const handleChange = ( event ) => {
+ setSelectedField( event.target.value );
+ };
+ return (
+
+
+ { selectedField && renderField( selectedField, { name: 'test' } ) }
+
+ );
+};
+
+export const Basic: React.FC = () => {
+ return (
+
+
+
+ );
+};
+
+export default {
+ title: 'WooCommerce Admin/experimental/product-fields',
+ component: Basic,
+};
diff --git a/packages/js/components/src/product-image/index.js b/packages/js/components/src/product-image/index.tsx
similarity index 65%
rename from packages/js/components/src/product-image/index.js
rename to packages/js/components/src/product-image/index.tsx
index 799b61eb2aa..a6b942648aa 100644
--- a/packages/js/components/src/product-image/index.js
+++ b/packages/js/components/src/product-image/index.tsx
@@ -2,7 +2,6 @@
* External dependencies
*/
import classnames from 'classnames';
-import PropTypes from 'prop-types';
import { get } from 'lodash';
import { createElement } from '@wordpress/element';
@@ -11,25 +10,47 @@ import { createElement } from '@wordpress/element';
*/
import { placeholderWhiteBackground as placeholder } from './placeholder';
+type Image = {
+ src?: string;
+};
+
+type ProductImageProps = {
+ /**
+ * Product or variation object. The image to display will be pulled from
+ * `product.images` or `variation.image`.
+ * See https://woocommerce.github.io/woocommerce-rest-api-docs/#product-properties
+ * and https://woocommerce.github.io/woocommerce-rest-api-docs/#product-variation-properties
+ */
+ product?: {
+ images?: Array< Image >;
+ image?: Image;
+ // ProductImage is only interested in product.images or varation.image
+ // but product object can have other properties that we don't control.
+ // allowing `any` here
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ } & Record< string, any >;
+ /** The width of image to display. */
+ width?: number;
+ /** The height of image to display. */
+ height?: number;
+ /** Additional CSS classes. */
+ className?: string;
+ /** Text to use as the image alt attribute. */
+ alt?: string;
+};
+
/**
* Use `ProductImage` to display a product's or variation's featured image.
* If no image can be found, a placeholder matching the front-end image
* placeholder will be displayed.
- *
- * @param {Object} props
- * @param {Object} props.product
- * @param {string} props.alt
- * @param {number} props.width
- * @param {number} props.height
- * @param {string} props.className
- * @return {Object} -
*/
-const ProductImage = ( {
+
+const ProductImage: React.VFC< ProductImageProps > = ( {
product,
+ width = 33,
+ height = 33,
+ className = '',
alt,
- width,
- height,
- className,
...props
} ) => {
// The first returned image from the API is the featured/product image.
@@ -54,36 +75,4 @@ const ProductImage = ( {
);
};
-ProductImage.propTypes = {
- /**
- * The width of image to display.
- */
- width: PropTypes.number,
- /**
- * The height of image to display.
- */
- height: PropTypes.number,
- /**
- * Additional CSS classes.
- */
- className: PropTypes.string,
- /**
- * Product or variation object. The image to display will be pulled from
- * `product.images` or `variation.image`.
- * See https://woocommerce.github.io/woocommerce-rest-api-docs/#product-properties
- * and https://woocommerce.github.io/woocommerce-rest-api-docs/#product-variation-properties
- */
- product: PropTypes.object,
- /**
- * Text to use as the image alt attribute.
- */
- alt: PropTypes.string,
-};
-
-ProductImage.defaultProps = {
- width: 33,
- height: 33,
- className: '',
-};
-
export default ProductImage;
diff --git a/packages/js/components/src/product-image/placeholder.js b/packages/js/components/src/product-image/placeholder.tsx
similarity index 100%
rename from packages/js/components/src/product-image/placeholder.js
rename to packages/js/components/src/product-image/placeholder.tsx
diff --git a/packages/js/components/src/product-image/stories/index.js b/packages/js/components/src/product-image/stories/index.tsx
similarity index 89%
rename from packages/js/components/src/product-image/stories/index.js
rename to packages/js/components/src/product-image/stories/index.tsx
index 1d6f0a504a6..12bc3473226 100644
--- a/packages/js/components/src/product-image/stories/index.js
+++ b/packages/js/components/src/product-image/stories/index.tsx
@@ -2,6 +2,7 @@
* External dependencies
*/
import { ProductImage } from '@woocommerce/components';
+import { createElement } from '@wordpress/element';
export const Basic = () => (
diff --git a/packages/js/components/src/product-image/test/__snapshots__/index.js.snap b/packages/js/components/src/product-image/test/__snapshots__/index.tsx.snap
similarity index 100%
rename from packages/js/components/src/product-image/test/__snapshots__/index.js.snap
rename to packages/js/components/src/product-image/test/__snapshots__/index.tsx.snap
diff --git a/packages/js/components/src/product-image/test/index.js b/packages/js/components/src/product-image/test/index.tsx
similarity index 98%
rename from packages/js/components/src/product-image/test/index.js
rename to packages/js/components/src/product-image/test/index.tsx
index f22c107d7e0..52995367574 100644
--- a/packages/js/components/src/product-image/test/index.js
+++ b/packages/js/components/src/product-image/test/index.tsx
@@ -7,7 +7,7 @@ import { createElement } from '@wordpress/element';
/**
* Internal dependencies
*/
-import ProductImage from '../';
+import ProductImage from '..';
describe( 'ProductImage', () => {
test( 'should render the passed alt prop', () => {
diff --git a/packages/js/components/src/search/autocompleters/product.tsx b/packages/js/components/src/search/autocompleters/product.tsx
index 44e70524063..906737911b8 100644
--- a/packages/js/components/src/search/autocompleters/product.tsx
+++ b/packages/js/components/src/search/autocompleters/product.tsx
@@ -66,7 +66,6 @@ const completer: AutoCompleter = {
const match = computeSuggestionMatch( product.name, query );
return (
- { /* @ts-expect-error TODO: migrate ProductImage component to TS. */ }
- { /* @ts-expect-error TODO: migrate ProductImage component to TS. */ }
) {
const level = useContext( Level );
const Heading = 'h' + Math.min( level, 6 );
diff --git a/packages/js/components/src/section/index.js b/packages/js/components/src/section/index.tsx
similarity index 100%
rename from packages/js/components/src/section/index.js
rename to packages/js/components/src/section/index.tsx
diff --git a/packages/js/components/src/section/section.js b/packages/js/components/src/section/section.js
deleted file mode 100644
index 43e1ad0849e..00000000000
--- a/packages/js/components/src/section/section.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * External dependencies
- */
-import PropTypes from 'prop-types';
-import { createElement } from '@wordpress/element';
-
-/**
- * Internal dependencies
- */
-import { Level } from './context';
-
-/**
- * The section wrapper, used to indicate a sub-section (and change the header level context).
- *
- * @param {Object} props
- * @param {import('react').ComponentType=} props.component
- * @param {import('react').ReactNode} props.children Children to render in the tip.
- * @param {string=} props.className
- * @return {JSX.Element} -
- */
-export function Section( { component, children, ...props } ) {
- const Component = component || 'div';
- return (
-
- { ( level ) => (
-
- { component === false ? (
- children
- ) : (
- { children }
- ) }
-
- ) }
-
- );
-}
-
-Section.propTypes = {
- /**
- * The wrapper component for this section. Optional, defaults to `div`. If passed false, no wrapper is used. Additional props
- * passed to Section are passed on to the component.
- */
- component: PropTypes.oneOfType( [
- PropTypes.func,
- PropTypes.string,
- PropTypes.bool,
- ] ),
- /**
- * The children inside this section, rendered in the `component`. This increases the context level for the next heading used.
- */
- children: PropTypes.node,
- /**
- * Optional classname
- */
- className: PropTypes.string,
-};
diff --git a/packages/js/components/src/section/section.tsx b/packages/js/components/src/section/section.tsx
new file mode 100644
index 00000000000..408c6e9937b
--- /dev/null
+++ b/packages/js/components/src/section/section.tsx
@@ -0,0 +1,42 @@
+/**
+ * External dependencies
+ */
+import { createElement } from '@wordpress/element';
+
+/**
+ * Internal dependencies
+ */
+import { Level } from './context';
+
+type SectionProps = {
+ /** The wrapper component for this section. Optional, defaults to `div`. If passed false, no wrapper is used. Additional props passed to Section are passed on to the component. */
+ component?: React.ComponentType | string | false;
+ /** Optional classname */
+ className?: string;
+ /** The children inside this section, rendered in the `component`. This increases the context level for the next heading used. */
+ children: React.ReactNode;
+};
+
+/**
+ * The section wrapper, used to indicate a sub-section (and change the header level context).
+ */
+export const Section: React.VFC< SectionProps > = ( {
+ component,
+ children,
+ ...props
+} ) => {
+ const Component = component || 'div';
+ return (
+
+ { ( level ) => (
+
+ { component === false ? (
+ children
+ ) : (
+ { children }
+ ) }
+
+ ) }
+
+ );
+};
diff --git a/packages/js/components/src/section/stories/index.js b/packages/js/components/src/section/stories/index.tsx
similarity index 91%
rename from packages/js/components/src/section/stories/index.js
rename to packages/js/components/src/section/stories/index.tsx
index c651b742921..866faa39001 100644
--- a/packages/js/components/src/section/stories/index.js
+++ b/packages/js/components/src/section/stories/index.tsx
@@ -2,6 +2,7 @@
* External dependencies
*/
import { H, Section } from '@woocommerce/components';
+import { createElement } from '@wordpress/element';
export const Basic = () => (
diff --git a/packages/js/components/src/sortable/sortable.tsx b/packages/js/components/src/sortable/sortable.tsx
index 66f4e0250da..97ec6c40728 100644
--- a/packages/js/components/src/sortable/sortable.tsx
+++ b/packages/js/components/src/sortable/sortable.tsx
@@ -14,6 +14,7 @@ import {
import { DragEvent, DragEventHandler, KeyboardEvent } from 'react';
import { speak } from '@wordpress/a11y';
import { throttle } from 'lodash';
+import { v4 } from 'uuid';
/**
* Internal dependencies
@@ -265,7 +266,7 @@ export const Sortable = ( {
React.MouseEventHandler< HTMLButtonElement >;
+ /** A more descriptive label for screen reader users. Defaults to the `name` prop. */
+ screenReaderLabel?: string;
+ /** Additional CSS classes. */
+ className?: string;
+};
+
+const Tag: React.VFC< Props > = ( {
id,
instanceId,
label,
@@ -77,6 +81,7 @@ const Tag = ( {
-
- { secondQuestion }
-
+ { secondQuestion && (
+
+ { secondQuestion }
+
+ ) }
-
-
- onRadioControlChange(
- value as string,
- setSecondQuestionScore
- )
- }
- />
-
+ { secondQuestion && (
+
+
+ onRadioControlChange(
+ value as string,
+ setSecondQuestionScore
+ )
+ }
+ />
+
+ ) }
{ [ firstQuestionScore, secondQuestionScore ].some(
( score ) => score === 1 || score === 2
@@ -250,9 +252,9 @@ function CustomerFeedbackModal( {
CustomerFeedbackModal.propTypes = {
recordScoreCallback: PropTypes.func.isRequired,
- title: PropTypes.string.isRequired,
+ title: PropTypes.string,
firstQuestion: PropTypes.string.isRequired,
- secondQuestion: PropTypes.string.isRequired,
+ secondQuestion: PropTypes.string,
defaultScore: PropTypes.number,
onCloseModal: PropTypes.func,
};
diff --git a/packages/js/customer-effort-score/src/customer-feedback-modal/test/index.tsx b/packages/js/customer-effort-score/src/customer-feedback-modal/test/index.tsx
index b4136fd3fe6..486f5026ad8 100644
--- a/packages/js/customer-effort-score/src/customer-feedback-modal/test/index.tsx
+++ b/packages/js/customer-effort-score/src/customer-feedback-modal/test/index.tsx
@@ -107,4 +107,34 @@ describe( 'CustomerFeedbackModal', () => {
} );
}
);
+
+ it( 'should render even if no second question is provided', async () => {
+ render(
+
+ );
+
+ // Wait for the modal to render.
+ await screen.findByRole( 'dialog' );
+ // Should be only one neutral emoji, since there is one question only
+ expect( screen.getAllByLabelText( 'Neutral' ).length ).toBe( 1 );
+ } );
+
+ it( 'should render default title if no title is provided', async () => {
+ render(
+
+ );
+
+ // Wait for the modal to render.
+ await screen.findByRole( 'dialog' );
+ expect(
+ screen.queryByLabelText( 'Please share your feedback' )
+ ).toBeInTheDocument();
+ } );
} );
diff --git a/packages/js/data/changelog/add-35989 b/packages/js/data/changelog/add-35989
new file mode 100644
index 00000000000..e4d315a532e
--- /dev/null
+++ b/packages/js/data/changelog/add-35989
@@ -0,0 +1,4 @@
+Significance: minor
+Type: add
+
+Add manage_stock parent value to product variation type definition
diff --git a/packages/js/components/changelog/add-35789_set_variations_list_fixed_height b/packages/js/data/changelog/add-36164
similarity index 50%
rename from packages/js/components/changelog/add-35789_set_variations_list_fixed_height
rename to packages/js/data/changelog/add-36164
index 6d397019d36..14b717dc4e0 100644
--- a/packages/js/components/changelog/add-35789_set_variations_list_fixed_height
+++ b/packages/js/data/changelog/add-36164
@@ -1,4 +1,4 @@
Significance: minor
Type: add
-Add className prop to Sortable
+Add tax classes datastore
diff --git a/packages/js/data/changelog/update-changelogger b/packages/js/data/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/data/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/data/composer.json b/packages/js/data/composer.json
index 62170ffbdf8..9aabc322160 100644
--- a/packages/js/data/composer.json
+++ b/packages/js/data/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/data/composer.lock b/packages/js/data/composer.lock
index 55d17fcef62..a339154793b 100644
--- a/packages/js/data/composer.lock
+++ b/packages/js/data/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "e8aae6511dda74f8220d58b7ae1e9e74",
+ "content-hash": "17a41dc458677cca1830b065f3c83635",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/packages/js/data/src/index.ts b/packages/js/data/src/index.ts
index 8805b6dc794..51c0d88a515 100644
--- a/packages/js/data/src/index.ts
+++ b/packages/js/data/src/index.ts
@@ -25,6 +25,7 @@ export { EXPERIMENTAL_PRODUCT_TAGS_STORE_NAME } from './product-tags';
export { EXPERIMENTAL_PRODUCT_CATEGORIES_STORE_NAME } from './product-categories';
export { EXPERIMENTAL_PRODUCT_ATTRIBUTE_TERMS_STORE_NAME } from './product-attribute-terms';
export { EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME } from './product-variations';
+export { EXPERIMENTAL_TAX_CLASSES_STORE_NAME } from './tax-classes';
export { PaymentGateway } from './payment-gateways/types';
// Export hooks
@@ -97,6 +98,7 @@ export {
ProductCategoryImage,
ProductCategorySelectors,
} from './product-categories/types';
+export { TaxClass } from './tax-classes/types';
/**
* Internal dependencies
@@ -122,6 +124,7 @@ import type { EXPERIMENTAL_PRODUCT_TAGS_STORE_NAME } from './product-tags';
import type { EXPERIMENTAL_PRODUCT_CATEGORIES_STORE_NAME } from './product-categories';
import type { EXPERIMENTAL_PRODUCT_ATTRIBUTE_TERMS_STORE_NAME } from './product-attribute-terms';
import type { EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME } from './product-variations';
+import type { EXPERIMENTAL_TAX_CLASSES_STORE_NAME } from './tax-classes';
export type WCDataStoreName =
| typeof REVIEWS_STORE_NAME
@@ -144,7 +147,8 @@ export type WCDataStoreName =
| typeof EXPERIMENTAL_SHIPPING_ZONES_STORE_NAME
| typeof EXPERIMENTAL_PRODUCT_TAGS_STORE_NAME
| typeof EXPERIMENTAL_PRODUCT_CATEGORIES_STORE_NAME
- | typeof EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME;
+ | typeof EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME
+ | typeof EXPERIMENTAL_TAX_CLASSES_STORE_NAME;
/**
* Internal dependencies
@@ -163,6 +167,7 @@ import { ProductTagSelectors } from './product-tags/types';
import { ProductCategorySelectors } from './product-categories/types';
import { ProductAttributeTermsSelectors } from './product-attribute-terms/types';
import { ProductVariationSelectors } from './product-variations/types';
+import { TaxClassSelectors } from './tax-classes/types';
// As we add types to all the package selectors we can fill out these unknown types with real ones. See one
// of the already typed selectors for an example of how you can do this.
@@ -208,6 +213,8 @@ export type WCSelectorType< T > = T extends typeof REVIEWS_STORE_NAME
? OrdersSelectors
: T extends typeof EXPERIMENTAL_SHIPPING_ZONES_STORE_NAME
? ShippingZonesSelectors
+ : T extends typeof EXPERIMENTAL_TAX_CLASSES_STORE_NAME
+ ? TaxClassSelectors
: never;
export interface WCDataSelector {
@@ -224,3 +231,4 @@ export { ActionDispatchers as ProductVariationsActions } from './product-variati
export { ActionDispatchers as ProductsStoreActions } from './products/actions';
export { ActionDispatchers as ProductShippingClassesActions } from './product-shipping-classes/types';
export { ActionDispatchers as ShippingZonesActions } from './shipping-zones/types';
+export { ActionDispatchers as TaxClassActions } from './tax-classes/types';
diff --git a/packages/js/data/src/product-variations/types.ts b/packages/js/data/src/product-variations/types.ts
index 5275ec24961..de021010a2f 100644
--- a/packages/js/data/src/product-variations/types.ts
+++ b/packages/js/data/src/product-variations/types.ts
@@ -55,13 +55,21 @@ export interface ProductVariationImage {
export type ProductVariation = Omit<
Product,
- 'name' | 'slug' | 'attributes' | 'images'
+ 'name' | 'slug' | 'attributes' | 'images' | 'manage_stock'
> & {
attributes: ProductVariationAttribute[];
/**
* Variation image data.
*/
image?: ProductVariationImage;
+ /**
+ * Stock management at variation level. It can have a
+ * 'parent' value if the parent product is managing
+ * the stock at the time the variation was created.
+ *
+ * @default false
+ */
+ manage_stock: boolean | 'parent';
};
type Query = Omit< ProductQuery, 'name' >;
diff --git a/packages/js/data/src/tax-classes/constants.ts b/packages/js/data/src/tax-classes/constants.ts
new file mode 100644
index 00000000000..8b64e032eab
--- /dev/null
+++ b/packages/js/data/src/tax-classes/constants.ts
@@ -0,0 +1,3 @@
+export const STORE_NAME = 'experimental/wc/admin/tax-classes';
+
+export const WC_TAX_CLASSES_NAMESPACE = '/wc/v3/taxes/classes';
diff --git a/packages/js/data/src/tax-classes/index.ts b/packages/js/data/src/tax-classes/index.ts
new file mode 100644
index 00000000000..0228df3a461
--- /dev/null
+++ b/packages/js/data/src/tax-classes/index.ts
@@ -0,0 +1,18 @@
+/**
+ * Internal dependencies
+ */
+import { createCrudDataStore } from '../crud';
+import { STORE_NAME, WC_TAX_CLASSES_NAMESPACE } from './constants';
+import * as resolvers from './resolvers';
+
+createCrudDataStore( {
+ storeName: STORE_NAME,
+ resourceName: 'TaxClass',
+ pluralResourceName: 'TaxClasses',
+ namespace: WC_TAX_CLASSES_NAMESPACE,
+ storeConfig: {
+ resolvers,
+ },
+} );
+
+export const EXPERIMENTAL_TAX_CLASSES_STORE_NAME = STORE_NAME;
diff --git a/packages/js/data/src/tax-classes/resolvers.ts b/packages/js/data/src/tax-classes/resolvers.ts
new file mode 100644
index 00000000000..11ad39e2ac0
--- /dev/null
+++ b/packages/js/data/src/tax-classes/resolvers.ts
@@ -0,0 +1,45 @@
+/**
+ * Internal dependencies
+ */
+import {
+ getItemsError,
+ getItemsSuccess,
+ getItemsTotalCountError,
+ getItemsTotalCountSuccess,
+} from '../crud/actions';
+import { getUrlParameters, getRestPath, cleanQuery } from '../crud/utils';
+import { Item, ItemQuery } from '../crud/types';
+import { request } from '../utils';
+import { WC_TAX_CLASSES_NAMESPACE } from './constants';
+
+export function* getTaxClasses( query?: Partial< ItemQuery > ) {
+ const urlParameters = getUrlParameters(
+ WC_TAX_CLASSES_NAMESPACE,
+ query || {}
+ );
+ const resourceQuery = cleanQuery( query || {}, WC_TAX_CLASSES_NAMESPACE );
+
+ try {
+ const path = getRestPath(
+ WC_TAX_CLASSES_NAMESPACE,
+ query || {},
+ urlParameters
+ );
+ const { items }: { items: Item[]; totalCount: number } = yield request<
+ ItemQuery,
+ Item
+ >( path, resourceQuery );
+
+ yield getItemsTotalCountSuccess( query, items.length );
+ yield getItemsSuccess(
+ query,
+ items.map( ( item ) => ( { ...item, id: item.id ?? item.slug } ) ),
+ urlParameters
+ );
+ return items;
+ } catch ( error ) {
+ yield getItemsTotalCountError( query, error );
+ yield getItemsError( query, error );
+ throw error;
+ }
+}
diff --git a/packages/js/data/src/tax-classes/types.ts b/packages/js/data/src/tax-classes/types.ts
new file mode 100644
index 00000000000..f55c6c129db
--- /dev/null
+++ b/packages/js/data/src/tax-classes/types.ts
@@ -0,0 +1,47 @@
+/**
+ * External dependencies
+ */
+import { DispatchFromMap } from '@automattic/data-stores';
+
+/**
+ * Internal dependencies
+ */
+import { CrudActions, CrudSelectors } from '../crud/types';
+import { BaseQueryParams } from '../types';
+
+/**
+ * Tax class properties
+ */
+export interface TaxClass {
+ /**
+ * Unique identifier for the resource.
+ */
+ readonly slug: string;
+ /**
+ * Tax class name.
+ */
+ name: string;
+}
+
+type Query = BaseQueryParams< keyof TaxClass >;
+
+type ReadOnlyProperties = 'slug';
+
+type MutableProperties = Omit< TaxClass, ReadOnlyProperties >;
+
+type TaxClassActions = CrudActions<
+ 'TaxClass',
+ TaxClass,
+ MutableProperties,
+ 'name'
+>;
+
+export type TaxClassSelectors = CrudSelectors<
+ 'TaxClass',
+ 'TaxClasses',
+ TaxClass,
+ Query,
+ MutableProperties
+>;
+
+export type ActionDispatchers = DispatchFromMap< TaxClassActions >;
diff --git a/packages/js/data/src/utils.ts b/packages/js/data/src/utils.ts
index 25f970a40fe..3ef273b813f 100644
--- a/packages/js/data/src/utils.ts
+++ b/packages/js/data/src/utils.ts
@@ -71,7 +71,6 @@ export function* request< Query extends BaseQueryParams, DataType >(
path: url,
method: 'GET',
} );
-
if ( isUnboundedRequest && ! ( 'data' in response ) ) {
return { items: response, totalCount: response.length };
}
diff --git a/packages/js/date/changelog/update-changelogger b/packages/js/date/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/date/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/date/composer.json b/packages/js/date/composer.json
index ba72efa1dc9..eaab577ba18 100644
--- a/packages/js/date/composer.json
+++ b/packages/js/date/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/date/composer.lock b/packages/js/date/composer.lock
index 762fa0eaa30..54e47fea560 100644
--- a/packages/js/date/composer.lock
+++ b/packages/js/date/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "c2e5c404a4fee4f6a5892f989459c502",
+ "content-hash": "d9d159c4b750dd3d45df132d1f35786f",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/packages/js/dependency-extraction-webpack-plugin/changelog/update-changelogger b/packages/js/dependency-extraction-webpack-plugin/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/dependency-extraction-webpack-plugin/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/dependency-extraction-webpack-plugin/composer.json b/packages/js/dependency-extraction-webpack-plugin/composer.json
index e093fbc6bc4..61c2a773d08 100644
--- a/packages/js/dependency-extraction-webpack-plugin/composer.json
+++ b/packages/js/dependency-extraction-webpack-plugin/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/dependency-extraction-webpack-plugin/composer.lock b/packages/js/dependency-extraction-webpack-plugin/composer.lock
index c03a208a91c..da4247133c7 100644
--- a/packages/js/dependency-extraction-webpack-plugin/composer.lock
+++ b/packages/js/dependency-extraction-webpack-plugin/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "024163a2e226f019b11933129ddfd115",
+ "content-hash": "1852d63966be2375d2f8edb607b861e9",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/packages/js/e2e-core-tests/src/specs/merchant/wp-admin-order-status-filters.test.js b/packages/js/e2e-core-tests/src/specs/merchant/wp-admin-order-status-filters.test.js
index 91a2451487b..5090f917a9c 100644
--- a/packages/js/e2e-core-tests/src/specs/merchant/wp-admin-order-status-filters.test.js
+++ b/packages/js/e2e-core-tests/src/specs/merchant/wp-admin-order-status-filters.test.js
@@ -16,7 +16,7 @@ const orderStatus = [
[ 'Processing', 'wc-processing' ],
[ 'On hold', 'wc-on-hold' ],
[ 'Completed', 'wc-completed' ],
- [ 'Cancelled', 'wc-cancelled' ],
+ [ 'Canceled', 'wc-cancelled' ],
[ 'Refunded', 'wc-refunded' ],
[ 'Failed', 'wc-failed' ],
];
diff --git a/packages/js/eslint-plugin/changelog/update-changelogger b/packages/js/eslint-plugin/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/eslint-plugin/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/eslint-plugin/composer.json b/packages/js/eslint-plugin/composer.json
index 8d62a41f972..5012dde7810 100644
--- a/packages/js/eslint-plugin/composer.json
+++ b/packages/js/eslint-plugin/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/eslint-plugin/composer.lock b/packages/js/eslint-plugin/composer.lock
index 25a718f685a..107253b0ce0 100644
--- a/packages/js/eslint-plugin/composer.lock
+++ b/packages/js/eslint-plugin/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "cfc0b63277f38526f4ff5300cfa22eca",
+ "content-hash": "243353ec23421c68191575ad267a7ccb",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/packages/js/experimental/changelog/update-changelogger b/packages/js/experimental/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/experimental/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/experimental/composer.json b/packages/js/experimental/composer.json
index e3476415ee7..3205900cc2d 100644
--- a/packages/js/experimental/composer.json
+++ b/packages/js/experimental/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/experimental/composer.lock b/packages/js/experimental/composer.lock
index c96ea1e4927..0670bdc43ab 100644
--- a/packages/js/experimental/composer.lock
+++ b/packages/js/experimental/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "8de7a23a39e8b1299465d2c26a261cf7",
+ "content-hash": "24b7e7383de02c18e0a5550dbdbb03b9",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/packages/js/explat/changelog/update-changelogger b/packages/js/explat/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/explat/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/explat/composer.json b/packages/js/explat/composer.json
index c743758573e..d3a25ad845c 100644
--- a/packages/js/explat/composer.json
+++ b/packages/js/explat/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/explat/composer.lock b/packages/js/explat/composer.lock
index 6d46ada4c30..4218525e9bd 100644
--- a/packages/js/explat/composer.lock
+++ b/packages/js/explat/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "c62661e12843ad431e9056ecdcfa696b",
+ "content-hash": "00d978b5b08bc69f9e23fd471d759d71",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/packages/js/extend-cart-checkout-block/changelog/update-changelogger b/packages/js/extend-cart-checkout-block/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/extend-cart-checkout-block/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/extend-cart-checkout-block/composer.json b/packages/js/extend-cart-checkout-block/composer.json
index 9c44b2a742c..72e09daf6f3 100644
--- a/packages/js/extend-cart-checkout-block/composer.json
+++ b/packages/js/extend-cart-checkout-block/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/extend-cart-checkout-block/composer.lock b/packages/js/extend-cart-checkout-block/composer.lock
index 4885651ee1f..32d9df34919 100644
--- a/packages/js/extend-cart-checkout-block/composer.lock
+++ b/packages/js/extend-cart-checkout-block/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "6bd29bd29a67b60a2199c7f520eada56",
+ "content-hash": "e22045358357e9c229d188944b337d8f",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/packages/js/navigation/changelog/fix-36205 b/packages/js/navigation/changelog/fix-36205
new file mode 100644
index 00000000000..5d6d183650d
--- /dev/null
+++ b/packages/js/navigation/changelog/fix-36205
@@ -0,0 +1,4 @@
+Significance: minor
+Type: dev
+
+Fix return value on parseAdminUrl
diff --git a/packages/js/navigation/changelog/update-changelogger b/packages/js/navigation/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/navigation/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/navigation/composer.json b/packages/js/navigation/composer.json
index b7f58a6164e..108f8491431 100644
--- a/packages/js/navigation/composer.json
+++ b/packages/js/navigation/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/navigation/composer.lock b/packages/js/navigation/composer.lock
index 28dcb6647a2..222d043ef11 100644
--- a/packages/js/navigation/composer.lock
+++ b/packages/js/navigation/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "0fc4e9b9f69b0b3f85fbc39b55f230d2",
+ "content-hash": "8dc2dd55c9c02cea672ce30791113055",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/packages/js/navigation/src/index.js b/packages/js/navigation/src/index.js
index 608eecf30a5..48f3adf998c 100644
--- a/packages/js/navigation/src/index.js
+++ b/packages/js/navigation/src/index.js
@@ -314,7 +314,7 @@ export const isWCAdmin = ( url = window.location.href ) => {
* Returns a parsed object for an absolute or relative admin URL.
*
* @param {*} url - the url to test.
- * @return {Object} - the URL object of the given url.
+ * @return {URL} - the URL object of the given url.
*/
export const parseAdminUrl = ( url ) => {
if ( url.startsWith( 'http' ) ) {
diff --git a/packages/js/number/changelog/update-changelogger b/packages/js/number/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/number/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/number/composer.json b/packages/js/number/composer.json
index caf1ed82b65..1b0987fe22b 100644
--- a/packages/js/number/composer.json
+++ b/packages/js/number/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/number/composer.lock b/packages/js/number/composer.lock
index 15f9588eb1c..3f53e203bae 100644
--- a/packages/js/number/composer.lock
+++ b/packages/js/number/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "f823beb8ba53e2ce3eb222a7225b9c81",
+ "content-hash": "87beeb0c840ac6ac539462236730d56d",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/packages/js/onboarding/changelog/update-changelogger b/packages/js/onboarding/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/onboarding/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/onboarding/composer.json b/packages/js/onboarding/composer.json
index 20ce9b28533..df6b1835fe9 100644
--- a/packages/js/onboarding/composer.json
+++ b/packages/js/onboarding/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/onboarding/composer.lock b/packages/js/onboarding/composer.lock
index 6fca3c5d6a1..760ff255dcc 100644
--- a/packages/js/onboarding/composer.lock
+++ b/packages/js/onboarding/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "24717ec0e0fb36f9ba425aa9c7f77ebf",
+ "content-hash": "3270cb0738d35835d789ab5d36483b86",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/packages/js/tracks/changelog/update-changelogger b/packages/js/tracks/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/packages/js/tracks/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/packages/js/tracks/composer.json b/packages/js/tracks/composer.json
index 8c8141d9e26..ff8e80b2295 100644
--- a/packages/js/tracks/composer.json
+++ b/packages/js/tracks/composer.json
@@ -5,7 +5,7 @@
"license": "GPL-3.0-or-later",
"minimum-stability": "dev",
"require-dev": {
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"config": {
"platform": {
diff --git a/packages/js/tracks/composer.lock b/packages/js/tracks/composer.lock
index d046d98a4e4..6d6107d9484 100644
--- a/packages/js/tracks/composer.lock
+++ b/packages/js/tracks/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "c1c9ce8ab810d38191077a10b9438963",
+ "content-hash": "187263d279049fb672fd761eb4496970",
"packages": [],
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -38,7 +38,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -60,9 +60,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "psr/log",
@@ -204,12 +204,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -249,7 +249,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -266,7 +266,7 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -274,12 +274,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -295,7 +295,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -334,7 +334,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -350,7 +350,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/plugins/woocommerce-admin/client/analytics/report/categories/breadcrumbs.js b/plugins/woocommerce-admin/client/analytics/report/categories/breadcrumbs.js
index 07865d6a017..6673112322e 100644
--- a/plugins/woocommerce-admin/client/analytics/report/categories/breadcrumbs.js
+++ b/plugins/woocommerce-admin/client/analytics/report/categories/breadcrumbs.js
@@ -4,6 +4,7 @@
import { Component } from '@wordpress/element';
import { first, last } from 'lodash';
import { Spinner } from '@wordpress/components';
+import { decodeEntities } from '@wordpress/html-entities';
import { Link } from '@woocommerce/components';
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
@@ -49,7 +50,9 @@ export default class CategoryBreadcrumbs extends Component {
return category ? (
- { this.getCategoryAncestors( category, categories ) }
+ { decodeEntities(
+ this.getCategoryAncestors( category, categories )
+ ) }
- { category.name }
+ { decodeEntities( category.name ) }
) : (
diff --git a/plugins/woocommerce-admin/client/hooks/usePreventLeavingPage.ts b/plugins/woocommerce-admin/client/hooks/usePreventLeavingPage.ts
index 2a7d938eec8..fe8cad7f193 100644
--- a/plugins/woocommerce-admin/client/hooks/usePreventLeavingPage.ts
+++ b/plugins/woocommerce-admin/client/hooks/usePreventLeavingPage.ts
@@ -3,10 +3,16 @@
*/
import { useContext, useEffect, useMemo } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
-import { UNSAFE_NavigationContext as NavigationContext } from 'react-router-dom';
+import { parseAdminUrl } from '@woocommerce/navigation';
+import {
+ Location,
+ UNSAFE_NavigationContext as NavigationContext,
+ useLocation,
+} from 'react-router-dom';
export default function usePreventLeavingPage(
hasUnsavedChanges: boolean,
+ shouldConfirm?: ( path: URL, fromUrl: Location ) => boolean,
/**
* Some browsers ignore this message currently on before unload event.
*
@@ -21,6 +27,7 @@ export default function usePreventLeavingPage(
[ message ]
);
const { navigator } = useContext( NavigationContext );
+ const fromUrl = useLocation();
// This effect prevent react router from navigate and show
// a confirmation message. It's a work around to beforeunload
@@ -30,6 +37,15 @@ export default function usePreventLeavingPage(
const push = navigator.push;
navigator.push = ( ...args: Parameters< typeof push > ) => {
+ const toUrl = parseAdminUrl( args[ 0 ] ) as URL;
+ if (
+ typeof shouldConfirm === 'function' &&
+ ! shouldConfirm( toUrl, fromUrl )
+ ) {
+ push( ...args );
+ return;
+ }
+
/* eslint-disable-next-line no-alert */
const result = window.confirm( confirmMessage );
if ( result !== false ) {
diff --git a/plugins/woocommerce-admin/client/layout/controller.js b/plugins/woocommerce-admin/client/layout/controller.js
index 4612662e02d..52f346a745b 100644
--- a/plugins/woocommerce-admin/client/layout/controller.js
+++ b/plugins/woocommerce-admin/client/layout/controller.js
@@ -199,7 +199,9 @@ export const getPages = () => {
wpOpenMenu: 'menu-posts-product',
capability: 'manage_woocommerce',
} );
+ }
+ if ( window.wcAdminFeatures[ 'product-variation-management' ] ) {
pages.push( {
container: EditProductPage,
path: '/product/:productId/variation/:variationId',
diff --git a/plugins/woocommerce-admin/client/products/constants.ts b/plugins/woocommerce-admin/client/products/constants.ts
index 090e98116df..0aa72fd516a 100644
--- a/plugins/woocommerce-admin/client/products/constants.ts
+++ b/plugins/woocommerce-admin/client/products/constants.ts
@@ -6,3 +6,4 @@ export const ADD_NEW_SHIPPING_CLASS_OPTION_VALUE =
'__ADD_NEW_SHIPPING_CLASS_OPTION__';
export const UNCATEGORIZED_CATEGORY_SLUG = 'uncategorized';
export const PRODUCT_VARIATION_TITLE_LIMIT = 32;
+export const STANDARD_RATE_TAX_CLASS_SLUG = 'standard';
diff --git a/plugins/woocommerce-admin/client/products/edit-product-page.tsx b/plugins/woocommerce-admin/client/products/edit-product-page.tsx
index b1104679c46..6606da226db 100644
--- a/plugins/woocommerce-admin/client/products/edit-product-page.tsx
+++ b/plugins/woocommerce-admin/client/products/edit-product-page.tsx
@@ -130,12 +130,14 @@ const EditProductPage: React.FC = () => {
) }
- { productVariation && product && (
-
- ) }
+ { window.wcAdminFeatures[ 'product-variation-management' ] &&
+ productVariation &&
+ product && (
+
+ ) }
{ ! isProductVariation &&
product &&
( product.status !== 'trash' || wasDeletedUsingAction ) && (
diff --git a/plugins/woocommerce-admin/client/products/fields/attribute-field/attribute-field.tsx b/plugins/woocommerce-admin/client/products/fields/attribute-field/attribute-field.tsx
index f3fe69a63fb..7c867af4a0d 100644
--- a/plugins/woocommerce-admin/client/products/fields/attribute-field/attribute-field.tsx
+++ b/plugins/woocommerce-admin/client/products/fields/attribute-field/attribute-field.tsx
@@ -24,7 +24,10 @@ import { getAdminLink } from '@woocommerce/settings';
import './attribute-field.scss';
import { AddAttributeModal } from './add-attribute-modal';
import { EditAttributeModal } from './edit-attribute-modal';
-import { reorderSortableProductAttributePositions } from './utils';
+import {
+ getAttributeKey,
+ reorderSortableProductAttributePositions,
+} from './utils';
import { sift } from '../../../utils';
import { AttributeEmptyState } from '../attribute-empty-state';
import {
@@ -242,15 +245,15 @@ export const AttributeField: React.FC< AttributeFieldProps > = ( {
const sortedAttributes = filteredAttributes.sort(
( a, b ) => a.position - b.position
);
- const attributeKeyValues = filteredAttributes.reduce(
+ const attributeKeyValues = value.reduce(
(
- keyValue: Record< number, ProductAttribute >,
+ keyValue: Record< number | string, ProductAttribute >,
attribute: ProductAttribute
) => {
- keyValue[ attribute.id ] = attribute;
+ keyValue[ getAttributeKey( attribute ) ] = attribute;
return keyValue;
},
- {} as Record< number, ProductAttribute >
+ {} as Record< number | string, ProductAttribute >
);
const attribute = hydratedAttributes.find(
@@ -271,9 +274,17 @@ export const AttributeField: React.FC< AttributeFieldProps > = ( {
{
+ const itemPositions = items.reduce(
+ ( positions, { props }, index ) => {
+ positions[ getAttributeKey( props.attribute ) ] =
+ index;
+ return positions;
+ },
+ {} as Record< number | string, number >
+ );
onChange(
reorderSortableProductAttributePositions(
- items,
+ itemPositions,
attributeKeyValues
)
);
diff --git a/plugins/woocommerce-admin/client/products/fields/attribute-field/test/utils.spec.ts b/plugins/woocommerce-admin/client/products/fields/attribute-field/test/utils.spec.ts
index 71964dd5fac..3a4d3628e67 100644
--- a/plugins/woocommerce-admin/client/products/fields/attribute-field/test/utils.spec.ts
+++ b/plugins/woocommerce-admin/client/products/fields/attribute-field/test/utils.spec.ts
@@ -6,9 +6,12 @@ import { ProductAttribute } from '@woocommerce/data';
/**
* Internal dependencies
*/
-import { reorderSortableProductAttributePositions } from '../utils';
+import {
+ getAttributeKey,
+ reorderSortableProductAttributePositions,
+} from '../utils';
-const attributeList: Record< number, ProductAttribute > = {
+const attributeList: Record< number | string, ProductAttribute > = {
15: {
id: 15,
name: 'Automotive',
@@ -25,10 +28,18 @@ const attributeList: Record< number, ProductAttribute > = {
variation: true,
options: [ 'Beige', 'black', 'Blue' ],
},
+ Quality: {
+ id: 0,
+ name: 'Quality',
+ position: 2,
+ visible: true,
+ variation: false,
+ options: [ 'low', 'high' ],
+ },
3: {
id: 3,
name: 'Random',
- position: 2,
+ position: 3,
visible: true,
variation: true,
options: [ 'Beige', 'black', 'Blue' ],
@@ -37,35 +48,25 @@ const attributeList: Record< number, ProductAttribute > = {
describe( 'reorderSortableProductAttributePositions', () => {
it( 'should update product attribute positions depending on JSX.Element order', () => {
- const elements = [
- { key: '3' },
- { key: '15' },
- { key: '1' },
- ] as JSX.Element[];
+ const elements = { 1: 0, 15: 1, 3: 2, Quality: 3 };
const newList = reorderSortableProductAttributePositions(
elements,
attributeList
);
expect( newList[ 0 ].position ).toEqual( 0 );
- expect( newList[ 0 ].id ).toEqual( 3 );
- expect( newList[ 1 ].position ).toEqual( 1 );
- expect( newList[ 1 ].id ).toEqual( 15 );
- expect( newList[ 2 ].position ).toEqual( 2 );
- expect( newList[ 2 ].id ).toEqual( 1 );
- } );
-
- it( 'should filter out elements that do not contain a key', () => {
- const elements = [
- { key: '3' },
- {},
- { key: '15' },
- {},
- { key: '1' },
- ] as JSX.Element[];
- const newList = reorderSortableProductAttributePositions(
- elements,
- attributeList
- );
- expect( newList.length ).toEqual( 3 );
+ expect( newList[ 0 ].id ).toEqual( 1 );
+ expect( newList[ 1 ].position ).toEqual( 2 );
+ expect( newList[ 1 ].id ).toEqual( 3 );
+ expect( newList[ 2 ].position ).toEqual( 1 );
+ expect( newList[ 2 ].id ).toEqual( 15 );
+ expect( newList[ 3 ].position ).toEqual( 3 );
+ expect( newList[ 3 ].id ).toEqual( 0 );
+ } );
+} );
+
+describe( 'getAttributeKey', () => {
+ it( 'should return the attribute key', () => {
+ expect( getAttributeKey( attributeList[ '15' ] ) ).toEqual( 15 );
+ expect( getAttributeKey( attributeList.Quality ) ).toEqual( 'Quality' );
} );
} );
diff --git a/plugins/woocommerce-admin/client/products/fields/attribute-field/utils.ts b/plugins/woocommerce-admin/client/products/fields/attribute-field/utils.ts
index 2fc31820553..a4928fe75f4 100644
--- a/plugins/woocommerce-admin/client/products/fields/attribute-field/utils.ts
+++ b/plugins/woocommerce-admin/client/products/fields/attribute-field/utils.ts
@@ -4,27 +4,40 @@
import { ProductAttribute } from '@woocommerce/data';
/**
- * Updates the position of a product attribute from the new items JSX.Element list.
+ * Returns the attribute key. The key will be the `id` or the `name` when the id is 0.
*
- * @param { JSX.Element[] } items list of JSX elements coming back from sortable container.
- * @param { Object } attributeKeyValues key value pair of product attributes.
+ * @param { ProductAttribute } attribute product attribute.
+ * @return string|number
+ */
+export function getAttributeKey(
+ attribute: ProductAttribute
+): number | string {
+ return attribute.id !== 0 ? attribute.id : attribute.name;
+}
+
+/**
+ * Updates the position of a product attribute from the new items list.
+ *
+ * @param { Object } items key value pair of list items positions.
+ * @param { Object } attributeKeyValues key value pair of product attributes.
*/
export function reorderSortableProductAttributePositions(
- items: JSX.Element[],
- attributeKeyValues: Record< number, ProductAttribute >
+ items: Record< number | string, number >,
+ attributeKeyValues: Record< number | string, ProductAttribute >
): ProductAttribute[] {
- return items
- .map( ( item, index ): ProductAttribute | undefined => {
- const key = item.key ? parseInt( item.key as string, 10 ) : NaN;
- if ( key !== NaN && attributeKeyValues[ key ] ) {
+ return Object.keys( attributeKeyValues ).map(
+ ( attributeKey: number | string ): ProductAttribute => {
+ if ( ! isNaN( items[ attributeKey ] ) ) {
return {
- ...attributeKeyValues[ key ],
- position: index,
+ ...attributeKeyValues[ attributeKey ],
+ position: items[ attributeKey ],
};
}
- return undefined;
- } )
- .filter( ( attr ): attr is ProductAttribute => attr !== undefined );
+ return {
+ ...attributeKeyValues[ attributeKey ],
+ };
+ }
+ );
}
/**
diff --git a/plugins/woocommerce-admin/client/products/fields/category-field/category-field-item.tsx b/plugins/woocommerce-admin/client/products/fields/category-field/category-field-item.tsx
index a2c54aaad21..1db5bd448a9 100644
--- a/plugins/woocommerce-admin/client/products/fields/category-field/category-field-item.tsx
+++ b/plugins/woocommerce-admin/client/products/fields/category-field/category-field-item.tsx
@@ -3,6 +3,7 @@
*/
import { CheckboxControl, Icon } from '@wordpress/components';
import { useEffect, useState } from '@wordpress/element';
+import { decodeEntities } from '@wordpress/html-entities';
import { chevronDown, chevronUp } from '@wordpress/icons';
import { ProductCategory } from '@woocommerce/data';
import { __experimentalSelectControlMenuItemProps as MenuItemProps } from '@woocommerce/components';
@@ -85,7 +86,7 @@ export const CategoryFieldItem: React.FC< CategoryFieldItemProps > = ( {
) }
item.data }
/>
diff --git a/plugins/woocommerce-admin/client/products/fields/options/options.tsx b/plugins/woocommerce-admin/client/products/fields/options/options.tsx
index 69b8b0a0e76..c35fa4e2695 100644
--- a/plugins/woocommerce-admin/client/products/fields/options/options.tsx
+++ b/plugins/woocommerce-admin/client/products/fields/options/options.tsx
@@ -1,13 +1,14 @@
/**
* External dependencies
*/
-import { __ } from '@wordpress/i18n';
-import { ProductAttribute } from '@woocommerce/data';
+import { Product, ProductAttribute } from '@woocommerce/data';
+import { useFormContext } from '@woocommerce/components';
/**
* Internal dependencies
*/
import { AttributeField } from '../attribute-field';
+import { useProductVariationsHelper } from '../../hooks/use-product-variations-helper';
type OptionsProps = {
value: ProductAttribute[];
@@ -20,11 +21,19 @@ export const Options: React.FC< OptionsProps > = ( {
onChange,
productId,
} ) => {
+ const { values } = useFormContext< Product >();
+ const { generateProductVariations } = useProductVariationsHelper();
+
+ const handleChange = async ( attributes: ProductAttribute[] ) => {
+ onChange( attributes );
+ generateProductVariations( { ...values, attributes } );
+ };
+
return (
);
diff --git a/plugins/woocommerce-admin/client/products/fields/variations/variations.tsx b/plugins/woocommerce-admin/client/products/fields/variations/variations.tsx
index f8dfafd04bb..5076f08090d 100644
--- a/plugins/woocommerce-admin/client/products/fields/variations/variations.tsx
+++ b/plugins/woocommerce-admin/client/products/fields/variations/variations.tsx
@@ -5,6 +5,7 @@ import { __, sprintf } from '@wordpress/i18n';
import { Button, Card, Spinner, Tooltip } from '@wordpress/components';
import {
EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME,
+ Product,
ProductVariation,
} from '@woocommerce/data';
import {
@@ -13,6 +14,7 @@ import {
Pagination,
Sortable,
Tag,
+ useFormContext,
} from '@woocommerce/components';
import { getNewPath } from '@woocommerce/navigation';
import { useContext, useState } from '@wordpress/element';
@@ -55,7 +57,8 @@ export const Variations: React.FC = () => {
const [ isUpdating, setIsUpdating ] = useState< Record< string, boolean > >(
{}
);
- const { productId } = useParams();
+ const { values } = useFormContext< Product >();
+ const productId = values.id;
const context = useContext( CurrencyContext );
const { formatAmount, getCurrencyConfig } = context;
const { isLoading, variations, totalCount } = useSelect(
@@ -82,7 +85,7 @@ export const Variations: React.FC = () => {
getProductVariationsTotalCount< number >( requestParams ),
};
},
- [ currentPage, perPage ]
+ [ currentPage, perPage, productId ]
);
const { updateProductVariation } = useDispatch(
@@ -202,7 +205,8 @@ export const Variations: React.FC = () => {
();
+
+ const [ isGenerating, setIsGenerating ] = useState( false );
+
+ const generateProductVariations = useCallback(
+ async ( product: Partial< Product > ) => {
+ setIsGenerating( true );
+
+ const createOrUpdateProduct = product.id
+ ? () =>
+ updateProduct< Promise< Product > >(
+ product.id,
+ product
+ )
+ : () => {
+ return createProduct< Promise< Product > >( {
+ ...product,
+ status: 'auto-draft',
+ name: product.name || AUTO_DRAFT_NAME,
+ } );
+ };
+
+ return createOrUpdateProduct()
+ .then( ( createdOrUpdatedProduct ) => {
+ if ( ! product.id ) {
+ resetForm( {
+ ...createdOrUpdatedProduct,
+ name: product.name || '',
+ } );
+ }
+ return _generateProductVariations( {
+ product_id: createdOrUpdatedProduct.id,
+ } );
+ } )
+ .then( () => {
+ return invalidateResolutionForStoreSelector(
+ 'getProductVariations'
+ );
+ } )
+ .finally( () => {
+ setIsGenerating( false );
+ } );
+ },
+ []
+ );
+
+ return {
+ generateProductVariations,
+ isGenerating,
+ };
+}
diff --git a/plugins/woocommerce-admin/client/products/hooks/use-variations-order.ts b/plugins/woocommerce-admin/client/products/hooks/use-variations-order.ts
index 99b2ffc4e37..e1747b43b46 100644
--- a/plugins/woocommerce-admin/client/products/hooks/use-variations-order.ts
+++ b/plugins/woocommerce-admin/client/products/hooks/use-variations-order.ts
@@ -4,10 +4,6 @@
import { useFormContext } from '@woocommerce/components';
import type { ProductVariation } from '@woocommerce/data';
-/**
- * Internal dependencies
- */
-
const KEY_SEPARATOR = ':';
function getVariationKey( variation: ProductVariation ) {
diff --git a/plugins/woocommerce-admin/client/products/layout/product-field-layout.tsx b/plugins/woocommerce-admin/client/products/layout/product-field-layout.tsx
deleted file mode 100644
index 853317f6f28..00000000000
--- a/plugins/woocommerce-admin/client/products/layout/product-field-layout.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Internal dependencies
- */
-import { WooProductFieldItem } from './woo-product-field-item';
-
-type ProductFieldLayoutProps = {
- fieldName: string;
- categoryName: string;
-};
-
-export const ProductFieldLayout: React.FC< ProductFieldLayoutProps > = ( {
- fieldName,
- categoryName,
- children,
-} ) => {
- return (
-
-
- { children }
-
-
- );
-};
diff --git a/plugins/woocommerce-admin/client/products/layout/product-section-layout.scss b/plugins/woocommerce-admin/client/products/layout/product-section-layout.scss
index ebc6c9d675e..acd31a35894 100644
--- a/plugins/woocommerce-admin/client/products/layout/product-section-layout.scss
+++ b/plugins/woocommerce-admin/client/products/layout/product-section-layout.scss
@@ -22,7 +22,7 @@
}
}
- .woocommerce-product-form__field {
+ .woocommerce-product-form__field:not(:first-child) {
margin-top: $gap-large;
> .components-base-control {
diff --git a/plugins/woocommerce-admin/client/products/layout/product-section-layout.tsx b/plugins/woocommerce-admin/client/products/layout/product-section-layout.tsx
index b3a9cdfcbe5..c3cba276725 100644
--- a/plugins/woocommerce-admin/client/products/layout/product-section-layout.tsx
+++ b/plugins/woocommerce-admin/client/products/layout/product-section-layout.tsx
@@ -8,7 +8,6 @@ import { FormSection } from '@woocommerce/components';
* Internal dependencies
*/
import './product-section-layout.scss';
-import { ProductFieldLayout } from './product-field-layout';
type ProductSectionLayoutProps = {
title: string;
@@ -31,12 +30,7 @@ export const ProductSectionLayout: React.FC< ProductSectionLayoutProps > = ( {
{ Children.map( children, ( child ) => {
if ( isValidElement( child ) && child.props.onChange ) {
return (
-
- { child }
-
+ { child }
);
}
return child;
diff --git a/plugins/woocommerce-admin/client/products/layout/test/product-field-layout.test.tsx b/plugins/woocommerce-admin/client/products/layout/test/product-field-layout.test.tsx
deleted file mode 100644
index df9d5dedeb1..00000000000
--- a/plugins/woocommerce-admin/client/products/layout/test/product-field-layout.test.tsx
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * External dependencies
- */
-import { render } from '@testing-library/react';
-import { SlotFillProvider } from '@wordpress/components';
-
-/**
- * Internal dependencies
- */
-import { ProductFieldLayout } from '../product-field-layout';
-import { WooProductFieldItem } from '../woo-product-field-item';
-
-describe( 'ProductFieldLayout', () => {
- beforeEach( () => {
- jest.clearAllMocks();
- } );
-
- it( 'should allow adding extra fields before the field using slot fill', () => {
- const { queryByText } = render(
-
-
- Name field
-
-
-
- );
- expect( queryByText( 'New field' ) ).toBeInTheDocument();
- expect( queryByText( 'New field' )?.nextSibling?.textContent ).toEqual(
- 'Name field'
- );
- } );
-
- it( 'should allow adding extra fields after the field using slot fill', () => {
- const { queryByText } = render(
-
-
- Name field
-
-
-
- );
- expect( queryByText( 'New field' ) ).toBeInTheDocument();
- expect( queryByText( 'Name field' )?.nextSibling?.textContent ).toEqual(
- 'New field'
- );
- } );
-
- it( 'should not render new slot fills when field name does not match', () => {
- const { queryByText } = render(
-
-
- Name field
-
-
-
- );
- expect( queryByText( 'New field' ) ).not.toBeInTheDocument();
- } );
-
- it( 'should not render new slot fills when category name does not match', () => {
- const { queryByText } = render(
-
-
- Name field
-
-
-
- );
- expect( queryByText( 'New field' ) ).not.toBeInTheDocument();
- } );
-} );
diff --git a/plugins/woocommerce-admin/client/products/layout/test/product-section-layout.test.tsx b/plugins/woocommerce-admin/client/products/layout/test/product-section-layout.test.tsx
index 8f8d7e8f6ab..45aa648e1fc 100644
--- a/plugins/woocommerce-admin/client/products/layout/test/product-section-layout.test.tsx
+++ b/plugins/woocommerce-admin/client/products/layout/test/product-section-layout.test.tsx
@@ -8,28 +8,10 @@ import { render } from '@testing-library/react';
*/
import { ProductSectionLayout } from '../product-section-layout';
-jest.mock( '../product-field-layout', () => {
- const productFieldLayoutMock: React.FC< {
- fieldName: string;
- categoryName: string;
- } > = ( { children, fieldName, categoryName } ) => {
- return (
-
- fieldName: { fieldName }
- categoryName: { categoryName }
- { children }
-
- );
- };
- return {
- ProductFieldLayout: productFieldLayoutMock,
- };
-} );
-
const SampleInputField: React.FC< { name: string; onChange: () => void } > = ( {
name,
} ) => {
- return smaple-input-field-{ name }
;
+ return sample-input-field-{ name }
;
};
describe( 'ProductSectionLayout', () => {
@@ -59,12 +41,9 @@ describe( 'ProductSectionLayout', () => {
);
- expect( queryByText( 'fieldName: name' ) ).toBeInTheDocument();
- expect( queryAllByText( 'categoryName: Title' ).length ).toEqual( 2 );
-
- expect( queryByText( 'smaple-input-field-name' ) ).toBeInTheDocument();
+ expect( queryByText( 'sample-input-field-name' ) ).toBeInTheDocument();
expect(
- queryByText( 'smaple-input-field-description' )
+ queryByText( 'sample-input-field-description' )
).toBeInTheDocument();
} );
diff --git a/plugins/woocommerce-admin/client/products/layout/woo-product-field-item.tsx b/plugins/woocommerce-admin/client/products/layout/woo-product-field-item.tsx
deleted file mode 100644
index 97d73f2d8a6..00000000000
--- a/plugins/woocommerce-admin/client/products/layout/woo-product-field-item.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * External dependencies
- */
-import React from 'react';
-import { Slot, Fill } from '@wordpress/components';
-import { snakeCase } from 'lodash';
-
-/**
- * Internal dependencies
- */
-import { createOrderedChildren, sortFillsByOrder } from '~/utils';
-
-// TODO: move this to a published JS package once ready.
-
-/**
- * Create a Fill for extensions to add items to the Product edit page.
- *
- * @slotFill WooProductFieldItem
- * @scope woocommerce-admin
- * @example
- * const MyProductDetailsFieldItem = () => (
- * My header item
- * );
- *
- * registerPlugin( 'my-extension', {
- * render: MyProductDetailsFieldItem,
- * scope: 'woocommerce-admin',
- * } );
- * @param {Object} param0
- * @param {Array} param0.children - Node children.
- * @param {string} param0.fieldName - Field name.
- * @param {string} param0.categoryName - Category name.
- * @param {number} param0.order - Order of Fill component.
- * @param {string} param0.location - Location before or after.
- */
-export const WooProductFieldItem: React.FC< {
- fieldName: string;
- categoryName: string;
- order?: number;
- location: 'before' | 'after';
-} > & {
- Slot: React.FC<
- Slot.Props & {
- fieldName: string;
- categoryName: string;
- location: 'before' | 'after';
- }
- >;
-} = ( { children, fieldName, categoryName, location, order = 1 } ) => {
- const categoryKey = snakeCase( categoryName );
- const fieldKey = snakeCase( fieldName );
- return (
-
- { ( fillProps: Fill.Props ) => {
- return createOrderedChildren( children, order, fillProps );
- } }
-
- );
-};
-
-WooProductFieldItem.Slot = ( {
- fillProps,
- fieldName,
- categoryName,
- location,
-} ) => {
- const categoryKey = snakeCase( categoryName );
- const fieldKey = snakeCase( fieldName );
- return (
-
- { sortFillsByOrder }
-
- );
-};
diff --git a/plugins/woocommerce-admin/client/products/product-form-actions.tsx b/plugins/woocommerce-admin/client/products/product-form-actions.tsx
index 47c7f4c63c6..63274767afb 100644
--- a/plugins/woocommerce-admin/client/products/product-form-actions.tsx
+++ b/plugins/woocommerce-admin/client/products/product-form-actions.tsx
@@ -24,6 +24,7 @@ import { store } from '@wordpress/viewport';
/**
* Internal dependencies
*/
+import { preventLeavingProductForm } from './utils/prevent-leaving-product-form';
import usePreventLeavingPage from '~/hooks/usePreventLeavingPage';
import { WooHeaderItem } from '~/header/utils';
import { useProductHelper } from './use-product-helper';
@@ -47,7 +48,8 @@ export const ProductFormActions: React.FC = () => {
const { isDirty, isValidForm, values, resetForm } =
useFormContext< Product >();
- usePreventLeavingPage( isDirty );
+ usePreventLeavingPage( isDirty, preventLeavingProductForm );
+
useCustomerEffortScoreExitPageTracker(
! values.id ? 'new_product' : 'editing_new_product',
isDirty
diff --git a/plugins/woocommerce-admin/client/products/product-form-tab.tsx b/plugins/woocommerce-admin/client/products/product-form-tab.tsx
index 2c2f0b9a814..cef50e510dd 100644
--- a/plugins/woocommerce-admin/client/products/product-form-tab.tsx
+++ b/plugins/woocommerce-admin/client/products/product-form-tab.tsx
@@ -8,7 +8,7 @@ export const ProductFormTab: React.FC< {
name: string;
title: string;
children: JSX.Element | JSX.Element[] | string;
-} > = ( { name, title, children } ) => {
+} > = ( { name, children } ) => {
const classes = classnames(
'woocommerce-product-form-tab',
'woocommerce-product-form-tab__' + name
diff --git a/plugins/woocommerce-admin/client/products/product-form.tsx b/plugins/woocommerce-admin/client/products/product-form.tsx
index 9b188078404..6be4974c9e8 100644
--- a/plugins/woocommerce-admin/client/products/product-form.tsx
+++ b/plugins/woocommerce-admin/client/products/product-form.tsx
@@ -1,7 +1,11 @@
/**
* External dependencies
*/
-import { Form, FormRef } from '@woocommerce/components';
+import {
+ Form,
+ FormRef,
+ __experimentalWooProductSectionItem as WooProductSectionItem,
+} from '@woocommerce/components';
import { PartialProduct, Product } from '@woocommerce/data';
import { Ref } from 'react';
@@ -47,6 +51,7 @@ export const ProductForm: React.FC< {
+
-
-
-
-
+ { window.wcAdminFeatures[ 'product-variation-management' ] ? (
+
+
+
+
+ ) : (
+ <>>
+ ) }
diff --git a/plugins/woocommerce-admin/client/products/product-page.scss b/plugins/woocommerce-admin/client/products/product-page.scss
index 56e8832e113..864dfdb0ecb 100644
--- a/plugins/woocommerce-admin/client/products/product-page.scss
+++ b/plugins/woocommerce-admin/client/products/product-page.scss
@@ -105,6 +105,13 @@
}
width: 50%;
}
+
+ .components-base-control__label {
+ .woocommerce-product-form__secondary-text {
+ display: block;
+ font-weight: 400;
+ }
+ }
}
.woocommerce-edit-product {
diff --git a/plugins/woocommerce-admin/client/products/product-variation-form-actions.tsx b/plugins/woocommerce-admin/client/products/product-variation-form-actions.tsx
index 30f462d0688..f059f1bf4aa 100644
--- a/plugins/woocommerce-admin/client/products/product-variation-form-actions.tsx
+++ b/plugins/woocommerce-admin/client/products/product-variation-form-actions.tsx
@@ -16,6 +16,7 @@ import { useState } from '@wordpress/element';
/**
* Internal dependencies
*/
+import { preventLeavingProductForm } from './utils/prevent-leaving-product-form';
import usePreventLeavingPage from '~/hooks/usePreventLeavingPage';
import { WooHeaderItem } from '~/header/utils';
import './product-form-actions.scss';
@@ -30,13 +31,19 @@ export const ProductVariationFormActions: React.FC = () => {
const { createNotice } = useDispatch( 'core/notices' );
const [ isSaving, setIsSaving ] = useState( false );
- usePreventLeavingPage( isDirty );
+ usePreventLeavingPage( isDirty, preventLeavingProductForm );
const onSave = async () => {
setIsSaving( true );
updateProductVariation< Promise< ProductVariation > >(
- { id: variationId, product_id: productId },
- values
+ { id: variationId, product_id: productId, context: 'edit' },
+ {
+ ...values,
+ manage_stock:
+ values.manage_stock === 'parent'
+ ? undefined
+ : values?.manage_stock,
+ }
)
.then( () => {
createNotice(
diff --git a/plugins/woocommerce-admin/client/products/product-variation-form.tsx b/plugins/woocommerce-admin/client/products/product-variation-form.tsx
index 4bc88c23941..738317e0a16 100644
--- a/plugins/woocommerce-admin/client/products/product-variation-form.tsx
+++ b/plugins/woocommerce-admin/client/products/product-variation-form.tsx
@@ -50,7 +50,7 @@ export const ProductVariationForm: React.FC< {
ref={ formRef }
>
-
+
diff --git a/plugins/woocommerce-admin/client/products/sections/pricing-section.tsx b/plugins/woocommerce-admin/client/products/sections/pricing-section.tsx
index ae88ab6b053..015e3fc9e79 100644
--- a/plugins/woocommerce-admin/client/products/sections/pricing-section.tsx
+++ b/plugins/woocommerce-admin/client/products/sections/pricing-section.tsx
@@ -3,6 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import {
+ CollapsibleContent,
DateTimePickerControl,
Link,
useFormContext,
@@ -12,6 +13,8 @@ import {
Product,
OPTIONS_STORE_NAME,
SETTINGS_STORE_NAME,
+ EXPERIMENTAL_TAX_CLASSES_STORE_NAME,
+ TaxClass,
} from '@woocommerce/data';
import { recordEvent } from '@woocommerce/tracks';
import { useContext, useEffect, useState } from '@wordpress/element';
@@ -26,6 +29,7 @@ import {
Card,
CardBody,
ToggleControl,
+ RadioControl,
} from '@wordpress/components';
/**
@@ -37,6 +41,7 @@ import { ProductSectionLayout } from '../layout/product-section-layout';
import { ADMIN_URL } from '../../utils/admin-settings';
import { CurrencyContext } from '../../lib/currency-context';
import { useProductHelper } from '../use-product-helper';
+import { STANDARD_RATE_TAX_CLASS_SLUG } from '../constants';
const PRODUCT_SCHEDULED_SALE_SLUG = 'product-scheduled-sale';
@@ -48,18 +53,34 @@ export const PricingSection: React.FC = () => {
useState( false );
const [ autoToggledSaleSchedule, setAutoToggledSaleSchedule ] =
useState( false );
- const { isResolving: isTaxSettingsResolving, taxSettings } = useSelect(
+ const {
+ isResolving: isTaxSettingsResolving,
+ taxSettings,
+ taxesEnabled,
+ } = useSelect( ( select ) => {
+ const { getSettings, hasFinishedResolution } =
+ select( SETTINGS_STORE_NAME );
+ return {
+ isResolving: ! hasFinishedResolution( 'getSettings', [ 'tax' ] ),
+ taxSettings: getSettings( 'tax' ).tax || {},
+ taxesEnabled:
+ getSettings( 'general' )?.general?.woocommerce_calc_taxes ===
+ 'yes',
+ };
+ } );
+
+ const { isResolving: isTaxClassesResolving, taxClasses } = useSelect(
( select ) => {
- const { getSettings, hasFinishedResolution } =
- select( SETTINGS_STORE_NAME );
+ const { hasFinishedResolution, getTaxClasses } = select(
+ EXPERIMENTAL_TAX_CLASSES_STORE_NAME
+ );
return {
- isResolving: ! hasFinishedResolution( 'getSettings', [
- 'tax',
- ] ),
- taxSettings: getSettings( 'tax' ).tax || {},
+ isResolving: ! hasFinishedResolution( 'getTaxClasses' ),
+ taxClasses: getTaxClasses< TaxClass[] >(),
};
}
);
+
const pricesIncludeTax =
taxSettings.woocommerce_prices_include_tax === 'yes';
const context = useContext( CurrencyContext );
@@ -200,6 +221,22 @@ export const PricingSection: React.FC = () => {
dateTimeFormat: dateFormat,
};
+ const taxStatusProps = getInputProps( 'tax_status' );
+ // These properties cause issues with the RadioControl component.
+ // A fix to form upstream would help if we can identify what type of input is used.
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-ignore
+ delete taxStatusProps.checked;
+ delete taxStatusProps.value;
+
+ const taxClassProps = getInputProps( 'tax_class' );
+ // These properties cause issues with the RadioControl component.
+ // A fix to form upstream would help if we can identify what type of input is used.
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-ignore
+ delete taxClassProps.checked;
+ delete taxClassProps.value;
+
return (
{
) }
+
+ { taxesEnabled && (
+
+
+
+
+
+ { ! isTaxClassesResolving &&
+ taxClasses.length > 0 && (
+
+
+ { __(
+ 'Tax class',
+ 'woocommerce'
+ ) }
+
+
+ { interpolateComponents( {
+ mixedString: __(
+ 'Apply a tax rate if this product qualifies for tax reduction or exemption. {{link}}Learn more{{/link}}',
+ 'woocommerce'
+ ),
+ components: {
+ link: (
+
+ <>>
+
+ ),
+ },
+ } ) }
+
+ >
+ }
+ options={ taxClasses.map(
+ ( taxClass ) => ( {
+ label: taxClass.name,
+ value:
+ taxClass.slug ===
+ STANDARD_RATE_TAX_CLASS_SLUG
+ ? ''
+ : taxClass.slug,
+ } )
+ ) }
+ />
+ ) }
+
+
+
+ ) }
);
};
diff --git a/plugins/woocommerce-admin/client/products/sections/product-details-section.tsx b/plugins/woocommerce-admin/client/products/sections/product-details-section.tsx
index 3002be75a1e..db2abe0848f 100644
--- a/plugins/woocommerce-admin/client/products/sections/product-details-section.tsx
+++ b/plugins/woocommerce-admin/client/products/sections/product-details-section.tsx
@@ -17,6 +17,7 @@ import {
useFormContext,
__experimentalRichTextEditor as RichTextEditor,
__experimentalTooltip as Tooltip,
+ __experimentalWooProductFieldItem as WooProductFieldItem,
} from '@woocommerce/components';
import interpolateComponents from '@automattic/interpolate-components';
import {
@@ -241,6 +242,7 @@ export const ProductDetailsSection: React.FC = () => {
'woocommerce'
) }
/>
+
diff --git a/plugins/woocommerce-admin/client/products/sections/product-variation-details-section.tsx b/plugins/woocommerce-admin/client/products/sections/product-variation-details-section.tsx
index c92c265c1f7..7886d844bb1 100644
--- a/plugins/woocommerce-admin/client/products/sections/product-variation-details-section.tsx
+++ b/plugins/woocommerce-admin/client/products/sections/product-variation-details-section.tsx
@@ -2,7 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
-import { BlockInstance, serialize, parse } from '@wordpress/blocks';
+import { BlockInstance, serialize, rawHandler } from '@wordpress/blocks';
import {
CheckboxControl,
Card,
@@ -55,7 +55,7 @@ export const ProductVariationDetailsSection: React.FC = () => {
const [ descriptionBlocks, setDescriptionBlocks ] = useState<
BlockInstance[]
- >( parse( values.description || '' ) );
+ >( rawHandler( { HTML: values.description } ) );
const imageFieldProps = getInputProps( 'image' );
diff --git a/plugins/woocommerce-admin/client/products/sections/product-variations-section.tsx b/plugins/woocommerce-admin/client/products/sections/product-variations-section.tsx
index a4719e372b6..2b16bbd1bb7 100644
--- a/plugins/woocommerce-admin/client/products/sections/product-variations-section.tsx
+++ b/plugins/woocommerce-admin/client/products/sections/product-variations-section.tsx
@@ -3,7 +3,8 @@
*/
import { __ } from '@wordpress/i18n';
import { recordEvent } from '@woocommerce/tracks';
-import { Link } from '@woocommerce/components';
+import { Link, useFormContext } from '@woocommerce/components';
+import { Product, ProductAttribute } from '@woocommerce/data';
/**
* Internal dependencies
@@ -12,6 +13,28 @@ import { ProductSectionLayout } from '../layout/product-section-layout';
import { Variations } from '../fields/variations';
export const ProductVariationsSection: React.FC = () => {
+ const {
+ getInputProps,
+ values: { id: productId },
+ } = useFormContext< Product >();
+
+ const { value: attributes }: { value: ProductAttribute[] } = getInputProps(
+ 'attributes',
+ {
+ productId,
+ }
+ );
+
+ const options = attributes
+ ? attributes.filter(
+ ( attribute: ProductAttribute ) => attribute.variation
+ )
+ : [];
+
+ if ( options.length === 0 ) {
+ return null;
+ }
+
return (
( { registerPlugin: jest.fn() } ) );
-jest.mock( '@wordpress/data', () => ( {
- ...jest.requireActual( '@wordpress/data' ),
+jest.mock( '@woocommerce/data', () => ( {
+ ...jest.requireActual( '@woocommerce/data' ),
useDispatch: jest.fn().mockReturnValue( { updateOptions: jest.fn() } ),
useSelect: jest.fn().mockReturnValue( { productCESAction: 'hide' } ),
} ) );
diff --git a/plugins/woocommerce-admin/client/products/use-product-helper.ts b/plugins/woocommerce-admin/client/products/use-product-helper.ts
index c53ef2c7f4e..d40129be55b 100644
--- a/plugins/woocommerce-admin/client/products/use-product-helper.ts
+++ b/plugins/woocommerce-admin/client/products/use-product-helper.ts
@@ -20,7 +20,9 @@ import { recordEvent } from '@woocommerce/tracks';
/**
* Internal dependencies
*/
+import { AUTO_DRAFT_NAME } from './utils/get-product-title';
import { CurrencyContext } from '../lib/currency-context';
+import { getDerivedProductType } from './utils/get-derived-product-type';
import {
NUMBERS_AND_DECIMAL_SEPARATOR,
ONLY_ONE_DECIMAL_SEPARATOR,
@@ -70,8 +72,8 @@ export function useProductHelper() {
/**
* Create product with status.
*
- * @param {Product} product the product to be created.
- * @param {string} status the product status.
+ * @param {Product} product the product to be created.
+ * @param {string} status the product status.
* @param {boolean} skipNotice if the notice should be skipped (default: false).
* @return {Promise} Returns a promise with the created product.
*/
@@ -88,6 +90,7 @@ export function useProductHelper() {
return createProduct( {
...product,
status,
+ type: getDerivedProductType( product ),
} ).then(
( newProduct ) => {
if ( ! skipNotice ) {
@@ -163,9 +166,9 @@ export function useProductHelper() {
/**
* Update product with status.
*
- * @param {number} productId the product id to be updated.
- * @param {Product} product the product to be updated.
- * @param {string} status the product status.
+ * @param {number} productId the product id to be updated.
+ * @param {Product} product the product to be updated.
+ * @param {string} status the product status.
* @param {boolean} skipNotice if the notice should be skipped (default: false).
* @return {Promise} Returns a promise with the updated product.
*/
@@ -183,6 +186,7 @@ export function useProductHelper() {
return updateProduct( productId, {
...product,
status,
+ type: getDerivedProductType( product ),
} )
.then( async ( updatedProduct ) =>
updateVariationsOrder(
@@ -242,7 +246,7 @@ export function useProductHelper() {
* Creates a copy of the given product with the given status.
*
* @param {Product} product the product to be copied.
- * @param {string} status the product status.
+ * @param {string} status the product status.
* @return {Promise} promise with the newly created and copied product.
*/
const copyProductWithStatus = useCallback(
@@ -250,7 +254,7 @@ export function useProductHelper() {
return createProductWithStatus(
removeReadonlyProperties( {
...product,
- name: ( product.name || 'AUTO-DRAFT' ) + ' - Copy',
+ name: ( product.name || AUTO_DRAFT_NAME ) + ' - Copy',
} ),
status
);
diff --git a/plugins/woocommerce-admin/client/products/utils/get-derived-product-type.ts b/plugins/woocommerce-admin/client/products/utils/get-derived-product-type.ts
new file mode 100644
index 00000000000..d2904d1c481
--- /dev/null
+++ b/plugins/woocommerce-admin/client/products/utils/get-derived-product-type.ts
@@ -0,0 +1,20 @@
+/**
+ * External dependencies
+ */
+import { Product } from '@woocommerce/data';
+
+export const getDerivedProductType = ( product: Partial< Product > ) => {
+ if ( ! window.wcAdminFeatures[ 'product-variation-management' ] ) {
+ return 'simple';
+ }
+
+ const hasOptions = !! product.attributes?.find(
+ ( attribute ) => attribute.options.length && attribute.variation
+ );
+
+ if ( hasOptions ) {
+ return 'variable';
+ }
+
+ return 'simple';
+};
diff --git a/plugins/woocommerce-admin/client/products/utils/get-product-title.ts b/plugins/woocommerce-admin/client/products/utils/get-product-title.ts
index e77175d8eb7..2f92e9d81b9 100644
--- a/plugins/woocommerce-admin/client/products/utils/get-product-title.ts
+++ b/plugins/woocommerce-admin/client/products/utils/get-product-title.ts
@@ -3,6 +3,8 @@
*/
import { __ } from '@wordpress/i18n';
+export const AUTO_DRAFT_NAME = 'AUTO-DRAFT';
+
/**
* Get the product title for use in the header.
*
@@ -20,7 +22,7 @@ export const getProductTitle = (
return name;
}
- if ( persistedName ) {
+ if ( persistedName && persistedName !== AUTO_DRAFT_NAME ) {
return persistedName;
}
diff --git a/plugins/woocommerce-admin/client/products/utils/prevent-leaving-product-form.ts b/plugins/woocommerce-admin/client/products/utils/prevent-leaving-product-form.ts
new file mode 100644
index 00000000000..9ede512a7c8
--- /dev/null
+++ b/plugins/woocommerce-admin/client/products/utils/prevent-leaving-product-form.ts
@@ -0,0 +1,15 @@
+/**
+ * External dependencies
+ */
+import { Location } from 'react-router-dom';
+
+/**
+ * Allow switching between tabs without prompting for unsaved changes.
+ */
+export const preventLeavingProductForm = ( toUrl: URL, fromUrl: Location ) => {
+ const toParams = new URLSearchParams( toUrl.search );
+ const fromParams = new URLSearchParams( fromUrl.search );
+ toParams.delete( 'tab' );
+ fromParams.delete( 'tab' );
+ return toParams.toString() !== fromParams.toString();
+};
diff --git a/plugins/woocommerce-admin/client/products/utils/test/get-derived-product-type.ts b/plugins/woocommerce-admin/client/products/utils/test/get-derived-product-type.ts
new file mode 100644
index 00000000000..67c4117fece
--- /dev/null
+++ b/plugins/woocommerce-admin/client/products/utils/test/get-derived-product-type.ts
@@ -0,0 +1,73 @@
+/**
+ * Internal dependencies
+ */
+import { getDerivedProductType } from '../get-derived-product-type';
+
+describe( 'getDerivedProductType', () => {
+ it( 'should be simple when no attributes exist', () => {
+ const type = getDerivedProductType( {
+ id: 123,
+ attributes: [],
+ } );
+ expect( type ).toBe( 'simple' );
+ } );
+
+ it( 'should be simple when no attributes used for variations exist', () => {
+ const type = getDerivedProductType( {
+ id: 123,
+ attributes: [
+ {
+ id: 0,
+ name: 'Color',
+ options: [ 'Red', 'Blue' ],
+ position: 0,
+ variation: false,
+ visible: true,
+ },
+ ],
+ } );
+ expect( type ).toBe( 'simple' );
+ } );
+
+ it( 'should be simple when no options exist for a variation', () => {
+ const type = getDerivedProductType( {
+ id: 123,
+ attributes: [
+ {
+ id: 0,
+ name: 'Color',
+ options: [],
+ position: 0,
+ variation: true,
+ visible: true,
+ },
+ ],
+ } );
+ expect( type ).toBe( 'simple' );
+ } );
+
+ it( 'should be variable when at least one attribute can be used for variations', () => {
+ const type = getDerivedProductType( {
+ id: 123,
+ attributes: [
+ {
+ id: 0,
+ name: 'Size',
+ options: [ 'Small', 'Medium' ],
+ position: 0,
+ variation: false,
+ visible: true,
+ },
+ {
+ id: 0,
+ name: 'Color',
+ options: [ 'Red', 'Blue' ],
+ position: 1,
+ variation: true,
+ visible: true,
+ },
+ ],
+ } );
+ expect( type ).toBe( 'variable' );
+ } );
+} );
diff --git a/plugins/woocommerce-admin/client/products/utils/test/get-product-title.test.ts b/plugins/woocommerce-admin/client/products/utils/test/get-product-title.test.ts
index fc259aaa216..c132b16c7ec 100644
--- a/plugins/woocommerce-admin/client/products/utils/test/get-product-title.test.ts
+++ b/plugins/woocommerce-admin/client/products/utils/test/get-product-title.test.ts
@@ -28,4 +28,9 @@ describe( 'getProductTitle', () => {
const title = getProductTitle( '', 'custom-type', undefined );
expect( title ).toBe( 'New product' );
} );
+
+ it( 'should return the generic add new string when the product title is the auto draft title', () => {
+ const title = getProductTitle( '', 'custom-type', 'AUTO-DRAFT' );
+ expect( title ).toBe( 'New product' );
+ } );
} );
diff --git a/plugins/woocommerce-admin/client/products/utils/test/prevent-leaving-product-form.test.ts b/plugins/woocommerce-admin/client/products/utils/test/prevent-leaving-product-form.test.ts
new file mode 100644
index 00000000000..90612268ae8
--- /dev/null
+++ b/plugins/woocommerce-admin/client/products/utils/test/prevent-leaving-product-form.test.ts
@@ -0,0 +1,55 @@
+/**
+ * External dependencies
+ */
+import { Location } from 'react-router-dom';
+
+/**
+ * Internal dependencies
+ */
+import { preventLeavingProductForm } from '../prevent-leaving-product-form';
+
+describe( 'preventLeavingProductForm', () => {
+ it( 'should allow leaving when the paths are identical', () => {
+ const toUrl = new URL(
+ 'http://mysite.com/admin.php?page=wc-admin&path=/product/123&tab=general'
+ );
+ const fromUrl = {
+ search: 'admin.php?page=wc-admin&path=/product/123&tab=general',
+ } as Location;
+ const shouldPrevent = preventLeavingProductForm( toUrl, fromUrl );
+ expect( shouldPrevent ).toBe( true );
+ } );
+
+ it( 'should prevent leaving when the paths are different', () => {
+ const toUrl = new URL(
+ 'http://mysite.com/admin.php?page=wc-admin&path=/product/456&tab=general'
+ );
+ const fromUrl = {
+ search: 'admin.php?page=wc-admin&path=/product/123&tab=general',
+ } as Location;
+ const shouldPrevent = preventLeavingProductForm( toUrl, fromUrl );
+ expect( shouldPrevent ).toBe( true );
+ } );
+
+ it( 'should allow leaving when the paths are the same but the tab is different', () => {
+ const toUrl = new URL(
+ 'http://mysite.com/admin.php?page=wc-admin&path=/product/123&tab=general'
+ );
+ const fromUrl = {
+ search: 'admin.php?page=wc-admin&path=/product/123&tab=shipping',
+ } as Location;
+ const shouldPrevent = preventLeavingProductForm( toUrl, fromUrl );
+ expect( shouldPrevent ).toBe( true );
+ } );
+
+ it( 'should prevent leaving when non-tab params are different', () => {
+ const toUrl = new URL(
+ 'http://mysite.com/admin.php?page=wc-admin&path=/product/123&tab=general&other_param=a'
+ );
+ const fromUrl = {
+ search: 'admin.php?page=wc-admin&path=/product/123&tab=shipping&other_param=b',
+ } as Location;
+ const shouldPrevent = preventLeavingProductForm( toUrl, fromUrl );
+ expect( shouldPrevent ).toBe( true );
+ } );
+} );
diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/use-create-product-by-type.ts b/plugins/woocommerce-admin/client/tasks/fills/products/use-create-product-by-type.ts
index 6232c08b688..080722aed7c 100644
--- a/plugins/woocommerce-admin/client/tasks/fills/products/use-create-product-by-type.ts
+++ b/plugins/woocommerce-admin/client/tasks/fills/products/use-create-product-by-type.ts
@@ -4,6 +4,9 @@
import { useDispatch } from '@wordpress/data';
import { ITEMS_STORE_NAME } from '@woocommerce/data';
import { getAdminLink } from '@woocommerce/settings';
+import { getNewPath, navigateTo } from '@woocommerce/navigation';
+import { loadExperimentAssignment } from '@woocommerce/explat';
+import moment from 'moment';
import { useState } from '@wordpress/element';
/**
@@ -25,6 +28,21 @@ export const useCreateProductByType = () => {
}
setIsRequesting( true );
+
+ if ( type === 'physical' ) {
+ const momentDate = moment().utc();
+ const year = momentDate.format( 'YYYY' );
+ const month = momentDate.format( 'MM' );
+ const assignment = await loadExperimentAssignment(
+ `woocommerce_product_creation_experience_${ year }${ month }_v1`
+ );
+
+ if ( assignment.variationName === 'treatment' ) {
+ navigateTo( { url: getNewPath( {}, '/add-product', {} ) } );
+ return;
+ }
+ }
+
try {
const data: {
id?: number;
diff --git a/plugins/woocommerce-admin/client/typings/global.d.ts b/plugins/woocommerce-admin/client/typings/global.d.ts
index 9c7567f6942..64b53b08048 100644
--- a/plugins/woocommerce-admin/client/typings/global.d.ts
+++ b/plugins/woocommerce-admin/client/typings/global.d.ts
@@ -20,6 +20,7 @@ declare global {
onboarding: boolean;
'onboarding-tasks': boolean;
'payment-gateway-suggestions': boolean;
+ 'product-variation-management': boolean;
'remote-inbox-notifications': boolean;
'remote-free-extensions': boolean;
settings: boolean;
diff --git a/plugins/woocommerce-beta-tester/changelog/dev-add-cli-command b/plugins/woocommerce-beta-tester/changelog/dev-add-cli-command
new file mode 100644
index 00000000000..b65eafa05a0
--- /dev/null
+++ b/plugins/woocommerce-beta-tester/changelog/dev-add-cli-command
@@ -0,0 +1,4 @@
+Significance: minor
+Type: add
+
+Add a wp cli command for activating live branches.
diff --git a/plugins/woocommerce-beta-tester/changelog/dev-enable-live-branches b/plugins/woocommerce-beta-tester/changelog/dev-enable-live-branches
new file mode 100644
index 00000000000..2bffdf70779
--- /dev/null
+++ b/plugins/woocommerce-beta-tester/changelog/dev-enable-live-branches
@@ -0,0 +1,4 @@
+Significance: minor
+Type: add
+
+Enable the live branches feature.
diff --git a/plugins/woocommerce-beta-tester/changelog/dev-integrate-combo-box-live-branch b/plugins/woocommerce-beta-tester/changelog/dev-integrate-combo-box-live-branch
new file mode 100644
index 00000000000..b98dd83d88c
--- /dev/null
+++ b/plugins/woocommerce-beta-tester/changelog/dev-integrate-combo-box-live-branch
@@ -0,0 +1,4 @@
+Significance: minor
+Type: add
+
+Update the live branches UI to improve finding and installing branches.
diff --git a/plugins/woocommerce-beta-tester/changelog/update-changelogger b/plugins/woocommerce-beta-tester/changelog/update-changelogger
new file mode 100644
index 00000000000..1674c919e78
--- /dev/null
+++ b/plugins/woocommerce-beta-tester/changelog/update-changelogger
@@ -0,0 +1,5 @@
+Significance: patch
+Type: fix
+Comment: Dev dependency update.
+
+
diff --git a/plugins/woocommerce-beta-tester/composer.json b/plugins/woocommerce-beta-tester/composer.json
index 0694cec1b52..43bafb929ff 100644
--- a/plugins/woocommerce-beta-tester/composer.json
+++ b/plugins/woocommerce-beta-tester/composer.json
@@ -6,14 +6,14 @@
"license": "GPL-3.0-or-later",
"prefer-stable": true,
"minimum-stability": "dev",
- "version": "2.1.0",
+ "version": "2.2.0",
"require": {
"composer/installers": "~1.7"
},
"require-dev": {
"phpunit/phpunit": "^6.5 || ^7.5",
"woocommerce/woocommerce-sniffs": "^0.1.3",
- "automattic/jetpack-changelogger": "3.1.3"
+ "automattic/jetpack-changelogger": "3.3.0"
},
"scripts": {
"test": [
diff --git a/plugins/woocommerce-beta-tester/composer.lock b/plugins/woocommerce-beta-tester/composer.lock
index 5f443f5dd42..1a608c200b2 100644
--- a/plugins/woocommerce-beta-tester/composer.lock
+++ b/plugins/woocommerce-beta-tester/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "f1e75252dada3cbba14f5c9b474ace42",
+ "content-hash": "e1ae720be342a5fd2aa3cbac6514537d",
"packages": [
{
"name": "composer/installers",
@@ -161,27 +161,27 @@
"packages-dev": [
{
"name": "automattic/jetpack-changelogger",
- "version": "v3.1.3",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-changelogger.git",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
- "reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
+ "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
+ "reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
"shasum": ""
},
"require": {
"php": ">=5.6",
- "symfony/console": "^3.4 || ^5.2",
- "symfony/process": "^3.4 || ^5.2",
+ "symfony/console": "^3.4 || ^5.2 || ^6.0",
+ "symfony/process": "^3.4 || ^5.2 || ^6.0",
"wikimedia/at-ease": "^1.2 || ^2.0"
},
"require-dev": {
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
- "yoast/phpunit-polyfills": "1.0.3"
+ "yoast/phpunit-polyfills": "1.0.4"
},
"bin": [
"bin/changelogger"
@@ -190,7 +190,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
- "dev-trunk": "3.1.x-dev"
+ "dev-trunk": "3.3.x-dev"
},
"mirror-repo": "Automattic/jetpack-changelogger",
"version-constants": {
@@ -212,9 +212,9 @@
],
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
"support": {
- "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
+ "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
},
- "time": "2022-06-21T07:31:56+00:00"
+ "time": "2022-12-26T13:49:01+00:00"
},
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
@@ -293,30 +293,30 @@
},
{
"name": "doctrine/instantiator",
- "version": "1.4.1",
+ "version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
- "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc"
+ "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc",
- "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b",
+ "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
- "doctrine/coding-standard": "^9",
+ "doctrine/coding-standard": "^9 || ^11",
"ext-pdo": "*",
"ext-phar": "*",
"phpbench/phpbench": "^0.16 || ^1",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-phpunit": "^1",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
- "vimeo/psalm": "^4.22"
+ "vimeo/psalm": "^4.30 || ^5.4"
},
"type": "library",
"autoload": {
@@ -343,7 +343,7 @@
],
"support": {
"issues": "https://github.com/doctrine/instantiator/issues",
- "source": "https://github.com/doctrine/instantiator/tree/1.4.1"
+ "source": "https://github.com/doctrine/instantiator/tree/1.5.0"
},
"funding": [
{
@@ -359,7 +359,7 @@
"type": "tidelift"
}
],
- "time": "2022-03-03T08:28:38+00:00"
+ "time": "2022-12-30T00:15:36+00:00"
},
{
"name": "myclabs/deep-copy",
@@ -594,16 +594,16 @@
},
{
"name": "phpcompatibility/phpcompatibility-paragonie",
- "version": "1.3.1",
+ "version": "1.3.2",
"source": {
"type": "git",
"url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
- "reference": "ddabec839cc003651f2ce695c938686d1086cf43"
+ "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/ddabec839cc003651f2ce695c938686d1086cf43",
- "reference": "ddabec839cc003651f2ce695c938686d1086cf43",
+ "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26",
+ "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26",
"shasum": ""
},
"require": {
@@ -640,26 +640,27 @@
"paragonie",
"phpcs",
"polyfill",
- "standards"
+ "standards",
+ "static analysis"
],
"support": {
"issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues",
"source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie"
},
- "time": "2021-02-15T10:24:51+00:00"
+ "time": "2022-10-25T01:46:02+00:00"
},
{
"name": "phpcompatibility/phpcompatibility-wp",
- "version": "2.1.3",
+ "version": "2.1.4",
"source": {
"type": "git",
"url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git",
- "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308"
+ "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/d55de55f88697b9cdb94bccf04f14eb3b11cf308",
- "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308",
+ "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5",
+ "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5",
"shasum": ""
},
"require": {
@@ -694,13 +695,14 @@
"compatibility",
"phpcs",
"standards",
+ "static analysis",
"wordpress"
],
"support": {
"issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues",
"source": "https://github.com/PHPCompatibility/PHPCompatibilityWP"
},
- "time": "2021-12-30T16:37:40+00:00"
+ "time": "2022-10-24T09:00:36+00:00"
},
{
"name": "phpdocumentor/reflection-common",
@@ -864,21 +866,21 @@
},
{
"name": "phpspec/prophecy",
- "version": "v1.15.0",
+ "version": "v1.16.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
- "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13"
+ "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
- "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be8cac52a0827776ff9ccda8c381ac5b71aeb359",
+ "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.2",
- "php": "^7.2 || ~8.0, <8.2",
+ "php": "^7.2 || 8.0.* || 8.1.* || 8.2.*",
"phpdocumentor/reflection-docblock": "^5.2",
"sebastian/comparator": "^3.0 || ^4.0",
"sebastian/recursion-context": "^3.0 || ^4.0"
@@ -925,9 +927,9 @@
],
"support": {
"issues": "https://github.com/phpspec/prophecy/issues",
- "source": "https://github.com/phpspec/prophecy/tree/v1.15.0"
+ "source": "https://github.com/phpspec/prophecy/tree/v1.16.0"
},
- "time": "2021-12-08T12:19:24+00:00"
+ "time": "2022-11-29T15:06:56+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -1415,16 +1417,16 @@
},
{
"name": "sebastian/comparator",
- "version": "3.0.3",
+ "version": "3.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "1071dfcef776a57013124ff35e1fc41ccd294758"
+ "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758",
- "reference": "1071dfcef776a57013124ff35e1fc41ccd294758",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dc7ceb4a24aede938c7af2a9ed1de09609ca770",
+ "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770",
"shasum": ""
},
"require": {
@@ -1477,7 +1479,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/comparator/issues",
- "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3"
+ "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.5"
},
"funding": [
{
@@ -1485,7 +1487,7 @@
"type": "github"
}
],
- "time": "2020-11-30T08:04:30+00:00"
+ "time": "2022-09-14T12:31:48+00:00"
},
{
"name": "sebastian/diff",
@@ -1618,16 +1620,16 @@
},
{
"name": "sebastian/exporter",
- "version": "3.1.4",
+ "version": "3.1.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db"
+ "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db",
- "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6",
+ "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6",
"shasum": ""
},
"require": {
@@ -1683,7 +1685,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
- "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.4"
+ "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.5"
},
"funding": [
{
@@ -1691,7 +1693,7 @@
"type": "github"
}
],
- "time": "2021-11-11T13:51:24+00:00"
+ "time": "2022-09-14T06:00:17+00:00"
},
{
"name": "sebastian/global-state",
@@ -2164,16 +2166,16 @@
},
{
"name": "symfony/debug",
- "version": "v4.4.41",
+ "version": "v4.4.44",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
- "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
+ "reference": "1a692492190773c5310bc7877cb590c04c2f05be",
"shasum": ""
},
"require": {
@@ -2212,7 +2214,7 @@
"description": "Provides tools to ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/debug/tree/v4.4.41"
+ "source": "https://github.com/symfony/debug/tree/v4.4.44"
},
"funding": [
{
@@ -2229,20 +2231,20 @@
}
],
"abandoned": "symfony/error-handler",
- "time": "2022-04-12T15:19:55+00:00"
+ "time": "2022-07-28T16:29:46+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.26.0",
+ "version": "v1.27.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -2257,7 +2259,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -2296,7 +2298,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -2312,7 +2314,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-admin-menus.php b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-admin-menus.php
index 3a79dd4b01c..7aa5efad1a8 100644
--- a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-admin-menus.php
+++ b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-admin-menus.php
@@ -153,6 +153,13 @@ Copy and paste the system status report from **WooCommerce > System Status** in
* @return string
*/
protected function construct_ssr() {
+ // This function depends on the WC core global being available. Sometimes, such as when we deactivate
+ // WC to install a live branches version, WC will not be available and cause a crash if we don't exit early
+ // here.
+ if ( ! class_exists( 'WC' ) ) {
+ return '';
+ }
+
if ( version_compare( WC()->version, '3.6', '<' ) ) {
return '';
}
@@ -332,7 +339,7 @@ Copy and paste the system status report from **WooCommerce > System Status** in
$items_to_remove = array( 'wc-beta-tester-settings', 'wc-beta-tester-version-picker', 'wc-beta-tester' );
if ( isset( $submenu['plugins.php'] ) ) {
foreach ( $submenu['plugins.php'] as $key => $menu ) {
- if ( in_array( $menu[2], $items_to_remove ) ) {
+ if ( in_array( $menu[2], $items_to_remove, true ) ) {
unset( $submenu['plugins.php'][ $key ] );
}
}
diff --git a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-cli.php b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-cli.php
new file mode 100644
index 00000000000..c10ae886d60
--- /dev/null
+++ b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-cli.php
@@ -0,0 +1,89 @@
+
+ * : The branch to install.
+ *
+ * ## Examples
+ *
+ * wp wc-beta-tester install update/some-branch
+ *
+ * @param array $args Arguments passed to CLI.
+ */
+ public function install( $args ) {
+ $installer = new WC_Beta_Tester_Live_Branches_Installer();
+
+ $branch = $args[0];
+
+ $info = $installer->get_branch_info_from_manifest( $branch );
+
+ if ( ! $info ) {
+ WP_CLI::error( "Could not find branch $branch in manifest" );
+ } else {
+ $install_result = $installer->install( $info->download_url, $info->branch, $info->version );
+
+ if ( is_wp_error( $install_result ) ) {
+ WP_CLI::error( $install_result->get_error_message() );
+ }
+
+ WP_CLI::success( "Installed $branch" );
+ }
+ }
+
+ /**
+ * Deactivate WooCommerce.
+ *
+ * ## Examples
+ * wp wc-beta-tester deactivate_woocommerce
+ */
+ public function deactivate_woocommerce() {
+ $installer = new WC_Beta_Tester_Live_Branches_Installer();
+ $installer->deactivate_woocommerce();
+
+ WP_CLI::success( 'Deactivated WooCommerce' );
+ }
+
+ /**
+ * Activate a live branch of the WooCommerce plugin.
+ *
+ * ## Options
+ *
+ * : The branch to activate.
+ *
+ * ## Examples
+ *
+ * wp wc-beta-tester activate update/some-branch*
+ *
+ * @param array $args Arguments passed to CLI.
+ */
+ public function activate( $args ) {
+ $installer = new WC_Beta_Tester_Live_Branches_Installer();
+ $branch = $args[0];
+ $info = $installer->get_branch_info_from_manifest( $branch );
+
+ if ( ! $info ) {
+ WP_CLI::error( "Could not find branch $branch in manifest" );
+ } else {
+ $installer->activate( $info->version );
+
+ WP_CLI::success( "Activated $branch" );
+ }
+ }
+}
diff --git a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches-installer.php b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches-installer.php
index 8d4d6aa6af8..42cf568a629 100644
--- a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches-installer.php
+++ b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches-installer.php
@@ -46,6 +46,26 @@ class WC_Beta_Tester_Live_Branches_Installer {
return $wp_filesystem;
}
+ /**
+ * Get the download url of a WooCommerce plugin version from the manifest.
+ *
+ * @param string $branch The name of the branch.
+ */
+ public function get_branch_info_from_manifest( $branch ) {
+ $response = wp_remote_get( 'https://betadownload.jetpack.me/woocommerce-branches.json' );
+ $body = wp_remote_retrieve_body( $response );
+
+ $obj = json_decode( $body );
+
+ foreach ( $obj->pr as $key => $value ) {
+ if ( $value->branch === $branch ) {
+ return $value;
+ }
+ }
+
+ return false;
+ }
+
/**
* Install a WooCommerce plugin version by download url.
*
diff --git a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches.php b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches.php
index 902dd5d35fb..c37fa558f86 100644
--- a/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches.php
+++ b/plugins/woocommerce-beta-tester/includes/class-wc-beta-tester-live-branches.php
@@ -18,9 +18,7 @@ class WC_Beta_Tester_Live_Branches {
add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ) );
// By the time this code runs it appears too late to hook into `admin_menu`.
-
- // NOTE - We don't have feature flags, so add the following code to enable it
- // in development: `$this->register_page()`.
+ $this->register_page();
}
/**
diff --git a/plugins/woocommerce-beta-tester/package.json b/plugins/woocommerce-beta-tester/package.json
index a30d8ce36f6..46a60c72a85 100644
--- a/plugins/woocommerce-beta-tester/package.json
+++ b/plugins/woocommerce-beta-tester/package.json
@@ -7,7 +7,7 @@
"url": "git://github.com/woocommerce/woocommerce-beta-tester.git"
},
"title": "WooCommerce Beta Tester",
- "version": "2.1.0",
+ "version": "2.2.0",
"homepage": "http://github.com/woocommerce/woocommerce-beta-tester",
"devDependencies": {
"@types/react": "^17.0.2",
diff --git a/plugins/woocommerce-beta-tester/readme.txt b/plugins/woocommerce-beta-tester/readme.txt
index a34ed4f4564..1fa933eeaac 100644
--- a/plugins/woocommerce-beta-tester/readme.txt
+++ b/plugins/woocommerce-beta-tester/readme.txt
@@ -3,7 +3,7 @@ Contributors: automattic, bor0, claudiosanches, claudiulodro, kloon, mikejolley,
Tags: woocommerce, woo commerce, beta, beta tester, bleeding edge, testing
Requires at least: 4.7
Tested up to: 6.0
-Stable tag: 2.1.0
+Stable tag: 2.2.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
diff --git a/plugins/woocommerce-beta-tester/src/live-branches/App.tsx b/plugins/woocommerce-beta-tester/src/live-branches/App.tsx
index 525687042ae..9f268128f52 100644
--- a/plugins/woocommerce-beta-tester/src/live-branches/App.tsx
+++ b/plugins/woocommerce-beta-tester/src/live-branches/App.tsx
@@ -2,15 +2,10 @@
* External dependencies
*/
import {
- Card,
- CardBody,
- CardFooter,
- CardHeader,
// @ts-ignore
__experimentalHeading as Heading,
} from '@wordpress/components';
import { Spinner } from '@woocommerce/components';
-import { css } from '@emotion/react';
/**
* Internal dependencies
@@ -18,10 +13,6 @@ import { css } from '@emotion/react';
import { useLiveBranchesData } from './hooks/live-branches';
import { BranchList } from './components/BranchList';
-const cardStyle = css( {
- marginTop: '32px',
-} );
-
export const App = () => {
const { branches, isLoading } = useLiveBranchesData();
@@ -30,19 +21,7 @@ export const App = () => {
Live Branches - Install and test WooCommerce PRs
-
-
- Active PRs
-
-
- { isLoading ? (
-
- ) : (
-
- ) }
-
-
-
+ { isLoading ? : }
>
);
};
diff --git a/plugins/woocommerce-beta-tester/src/live-branches/components/BranchList.tsx b/plugins/woocommerce-beta-tester/src/live-branches/components/BranchList.tsx
index be5f242cebb..3a1b4c8f490 100644
--- a/plugins/woocommerce-beta-tester/src/live-branches/components/BranchList.tsx
+++ b/plugins/woocommerce-beta-tester/src/live-branches/components/BranchList.tsx
@@ -8,15 +8,31 @@ import {
__experimentalItem as Item,
Button,
Spinner,
+ Card,
+ CardHeader,
+ CardBody,
+ CardFooter,
+ ComboboxControl,
} from '@wordpress/components';
import { useState } from 'react';
+import { css } from '@emotion/react';
/**
* Internal dependencies
*/
import { Branch, useLiveBranchInstall } from '../hooks/live-branches';
-const BranchListItem = ( { branch }: { branch: Branch } ) => {
+const cardStyle = css( {
+ marginTop: '32px',
+} );
+
+const BranchListItem = ( {
+ branch,
+ onBranchActive,
+}: {
+ branch: Branch;
+ onBranchActive: ( branch: Branch ) => void;
+} ) => {
const { isError, isInProgress, installAndActivate, activate, status } =
useLiveBranchInstall(
branch.download_url,
@@ -25,14 +41,24 @@ const BranchListItem = ( { branch }: { branch: Branch } ) => {
branch.install_status
);
+ const activateBranch = async () => {
+ await activate();
+ onBranchActive( branch );
+ };
+
+ const installAndActivateBranch = async () => {
+ await installAndActivate();
+ onBranchActive( branch );
+ };
+
const ActionButton = {
'not-installed': () => (
-