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
-
-
- -
New 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
-
-
- -
New 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
-
-
- -
New 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
-
-
- -
New 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': () => ( - ), installed: () => ( - ), @@ -64,22 +90,125 @@ const BranchListItem = ( { branch }: { branch: Branch } ) => { ); }; -export const BranchList = ( { branches }: { branches: Branch[] } ) => { - const activeBranch = branches.find( - ( branch ) => branch.install_status === 'active' - ); - - const nonActiveBranches = branches.filter( - ( branch ) => branch.install_status !== 'active' - ); - +const BranchInfo = ( { branch }: { branch: Branch } ) => { return ( - - { /* Sort the active branch if it exists to the top of the list */ } - { activeBranch && } - { nonActiveBranches.map( ( branch ) => ( - - ) ) } - +

+ Pull Request Branch:{ ' ' } + + { branch.branch } + + { ' | ' } + Version: { branch.version } |{ ' ' } + Download URL:{ ' ' } + { branch.download_url } +

+ ); +}; + +const WooCommerceVersionInfo = () => { + // @ts-ignore + const version = window?.wc?.wcSettings?.WC_VERSION || 'unknown'; + + return ( +

+ Live branch not installed. Running WooCommerce version: { version } +

+ ); +}; + +export const BranchList = ( { branches }: { branches: Branch[] } ) => { + const [ activeBranch, setActiveBranch ] = useState< Branch | null >( + branches.find( ( branch ) => branch.install_status === 'active' ) || + null + ); + + const installedBranches = branches.filter( + ( branch ) => branch.install_status === 'installed' + ); + + const uninstalledBranches = branches.filter( + ( branch ) => branch.install_status === 'not-installed' + ); + + const [ selectedBranch, setSelectedBranch ] = useState( + uninstalledBranches[ 0 ] + ); + + const installedBranchesExist = !! installedBranches.length; + + return ( + <> + + +

Currently Running

+
+ + { activeBranch && ( + + ) } + { ! activeBranch && } + + +
+ + +

Install and Activate Live Branches

+
+ + { + if ( branchVersion ) { + const branch = branches.find( + ( branch ) => + branch.version === branchVersion + ); + + if ( branch ) { + setSelectedBranch( branch ); + } + } + } } + value={ selectedBranch.version } + options={ uninstalledBranches.map( ( branch ) => { + return { + value: branch.version, + label: branch.branch, + }; + } ) } + /> + + + + +
+ { installedBranchesExist && ( + + +

Other Installed Branches

+
+ + + { installedBranches.map( ( branch ) => ( + + ) ) } + + + +
+ ) } + ); }; diff --git a/plugins/woocommerce-beta-tester/woocommerce-beta-tester.php b/plugins/woocommerce-beta-tester/woocommerce-beta-tester.php index 0e4b5a711ec..413d573e352 100644 --- a/plugins/woocommerce-beta-tester/woocommerce-beta-tester.php +++ b/plugins/woocommerce-beta-tester/woocommerce-beta-tester.php @@ -3,7 +3,7 @@ * Plugin Name: WooCommerce Beta Tester * Plugin URI: https://github.com/woocommerce/woocommerce-beta-tester * Description: Run bleeding edge versions of WooCommerce. This will replace your installed version of WooCommerce with the latest tagged release - use with caution, and not on production sites. - * Version: 2.1.0 + * Version: 2.2.0 * Author: WooCommerce * Author URI: http://woocommerce.com/ * Requires at least: 5.8 @@ -17,6 +17,12 @@ defined( 'ABSPATH' ) || exit; + +if ( defined( 'WP_CLI' ) ) { + require_once dirname( __FILE__ ) . '/includes/class-wc-beta-tester-cli.php'; + WP_CLI::add_command( 'wc-beta-tester', WC_Beta_Tester_CLI::class ); +} + // Define WC_BETA_TESTER_FILE. if ( ! defined( 'WC_BETA_TESTER_FILE' ) ) { define( 'WC_BETA_TESTER_FILE', __FILE__ ); @@ -63,7 +69,7 @@ function _wc_beta_tester_bootstrap() { } // Load admin. - require( 'plugin.php' ); + require 'plugin.php'; } add_action( 'plugins_loaded', '_wc_beta_tester_bootstrap' ); @@ -75,12 +81,12 @@ function add_extension_register_script() { $script_path = '/build/index.js'; $script_asset_path = dirname( __FILE__ ) . '/build/index.asset.php'; $script_asset = file_exists( $script_asset_path ) - ? require( $script_asset_path ) + ? require $script_asset_path : array( 'dependencies' => array(), 'version' => filemtime( $script_path ), ); - $script_url = plugins_url( $script_path, __FILE__ ); + $script_url = plugins_url( $script_path, __FILE__ ); wp_register_script( 'woocommerce-admin-test-helper', diff --git a/plugins/woocommerce/bin/composer/mozart/composer.lock b/plugins/woocommerce/bin/composer/mozart/composer.lock index 1b31825ab7b..5291be463e6 100644 --- a/plugins/woocommerce/bin/composer/mozart/composer.lock +++ b/plugins/woocommerce/bin/composer/mozart/composer.lock @@ -268,16 +268,16 @@ }, { "name": "symfony/console", - "version": "v5.4.15", + "version": "v5.4.17", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ea59bb0edfaf9f28d18d8791410ee0355f317669" + "reference": "58422fdcb0e715ed05b385f70d3e8b5ed4bbd45f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ea59bb0edfaf9f28d18d8791410ee0355f317669", - "reference": "ea59bb0edfaf9f28d18d8791410ee0355f317669", + "url": "https://api.github.com/repos/symfony/console/zipball/58422fdcb0e715ed05b385f70d3e8b5ed4bbd45f", + "reference": "58422fdcb0e715ed05b385f70d3e8b5ed4bbd45f", "shasum": "" }, "require": { @@ -347,7 +347,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.15" + "source": "https://github.com/symfony/console/tree/v5.4.17" }, "funding": [ { @@ -363,7 +363,7 @@ "type": "tidelift" } ], - "time": "2022-10-26T21:41:52+00:00" + "time": "2022-12-28T14:15:31+00:00" }, { "name": "symfony/deprecation-contracts", @@ -434,16 +434,16 @@ }, { "name": "symfony/finder", - "version": "v5.4.11", + "version": "v5.4.17", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c" + "reference": "40c08632019838dfb3350f18cf5563b8080055fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/7872a66f57caffa2916a584db1aa7f12adc76f8c", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c", + "url": "https://api.github.com/repos/symfony/finder/zipball/40c08632019838dfb3350f18cf5563b8080055fc", + "reference": "40c08632019838dfb3350f18cf5563b8080055fc", "shasum": "" }, "require": { @@ -477,7 +477,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.11" + "source": "https://github.com/symfony/finder/tree/v5.4.17" }, "funding": [ { @@ -493,20 +493,20 @@ "type": "tidelift" } ], - "time": "2022-07-29T07:37:50+00:00" + "time": "2022-12-22T10:31:03+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "shasum": "" }, "require": { @@ -521,7 +521,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -559,7 +559,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" }, "funding": [ { @@ -575,20 +575,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "433d05519ce6990bf3530fba6957499d327395c2" + "reference": "511a08c03c1960e08a883f4cffcacd219b758354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", - "reference": "433d05519ce6990bf3530fba6957499d327395c2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354", "shasum": "" }, "require": { @@ -600,7 +600,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -640,7 +640,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" }, "funding": [ { @@ -656,20 +656,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", "shasum": "" }, "require": { @@ -681,7 +681,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -724,7 +724,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" }, "funding": [ { @@ -740,20 +740,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+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": { @@ -768,7 +768,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -807,7 +807,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": [ { @@ -823,20 +823,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", "shasum": "" }, "require": { @@ -845,7 +845,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -886,7 +886,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" }, "funding": [ { @@ -902,20 +902,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", "shasum": "" }, "require": { @@ -924,7 +924,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -969,7 +969,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" }, "funding": [ { @@ -985,7 +985,7 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/service-contracts", @@ -1072,16 +1072,16 @@ }, { "name": "symfony/string", - "version": "v5.4.15", + "version": "v5.4.17", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed" + "reference": "55733a8664b8853b003e70251c58bc8cb2d82a6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", - "reference": "571334ce9f687e3e6af72db4d3b2a9431e4fd9ed", + "url": "https://api.github.com/repos/symfony/string/zipball/55733a8664b8853b003e70251c58bc8cb2d82a6b", + "reference": "55733a8664b8853b003e70251c58bc8cb2d82a6b", "shasum": "" }, "require": { @@ -1138,7 +1138,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.15" + "source": "https://github.com/symfony/string/tree/v5.4.17" }, "funding": [ { @@ -1154,7 +1154,7 @@ "type": "tidelift" } ], - "time": "2022-10-05T15:16:54+00:00" + "time": "2022-12-12T15:54:21+00:00" } ], "aliases": [], @@ -1169,5 +1169,5 @@ "platform-overrides": { "php": "7.3" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.0.0" } diff --git a/plugins/woocommerce/bin/composer/phpcs/composer.lock b/plugins/woocommerce/bin/composer/phpcs/composer.lock index 0e1a6def19c..29bcf29ff1d 100644 --- a/plugins/woocommerce/bin/composer/phpcs/composer.lock +++ b/plugins/woocommerce/bin/composer/phpcs/composer.lock @@ -475,5 +475,5 @@ "platform-overrides": { "php": "7.2" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.0.0" } diff --git a/plugins/woocommerce/bin/composer/phpunit/composer.lock b/plugins/woocommerce/bin/composer/phpunit/composer.lock index 1983c0a3a0b..c80d9739bc5 100644 --- a/plugins/woocommerce/bin/composer/phpunit/composer.lock +++ b/plugins/woocommerce/bin/composer/phpunit/composer.lock @@ -1697,5 +1697,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.0.0" } diff --git a/plugins/woocommerce/bin/composer/wp/composer.lock b/plugins/woocommerce/bin/composer/wp/composer.lock index 7ef28cb0bfd..84e38397103 100644 --- a/plugins/woocommerce/bin/composer/wp/composer.lock +++ b/plugins/woocommerce/bin/composer/wp/composer.lock @@ -67,16 +67,16 @@ }, { "name": "gettext/gettext", - "version": "v4.8.7", + "version": "v4.8.8", "source": { "type": "git", "url": "https://github.com/php-gettext/Gettext.git", - "reference": "3f7bc5ef23302a9059e64934f3d59e454516bec0" + "reference": "302a00aa9d6762c92c884d879c15d3ed05d6a37d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/3f7bc5ef23302a9059e64934f3d59e454516bec0", - "reference": "3f7bc5ef23302a9059e64934f3d59e454516bec0", + "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/302a00aa9d6762c92c884d879c15d3ed05d6a37d", + "reference": "302a00aa9d6762c92c884d879c15d3ed05d6a37d", "shasum": "" }, "require": { @@ -128,7 +128,7 @@ "support": { "email": "oom@oscarotero.com", "issues": "https://github.com/oscarotero/Gettext/issues", - "source": "https://github.com/php-gettext/Gettext/tree/v4.8.7" + "source": "https://github.com/php-gettext/Gettext/tree/v4.8.8" }, "funding": [ { @@ -144,7 +144,7 @@ "type": "patreon" } ], - "time": "2022-08-02T09:42:10+00:00" + "time": "2022-12-08T11:59:50+00:00" }, { "name": "gettext/languages", @@ -434,16 +434,16 @@ }, { "name": "wp-cli/i18n-command", - "version": "v2.4.0", + "version": "v2.4.1", "source": { "type": "git", "url": "https://github.com/wp-cli/i18n-command.git", - "reference": "45bc2b47a4ed103b871cd2ec5b483ab55ad12d99" + "reference": "22f7e6aa6ba23d0b50c45c75386c8151b991477e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/45bc2b47a4ed103b871cd2ec5b483ab55ad12d99", - "reference": "45bc2b47a4ed103b871cd2ec5b483ab55ad12d99", + "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/22f7e6aa6ba23d0b50c45c75386c8151b991477e", + "reference": "22f7e6aa6ba23d0b50c45c75386c8151b991477e", "shasum": "" }, "require": { @@ -496,9 +496,9 @@ "homepage": "https://github.com/wp-cli/i18n-command", "support": { "issues": "https://github.com/wp-cli/i18n-command/issues", - "source": "https://github.com/wp-cli/i18n-command/tree/v2.4.0" + "source": "https://github.com/wp-cli/i18n-command/tree/v2.4.1" }, - "time": "2022-07-04T21:43:20+00:00" + "time": "2022-12-09T19:09:17+00:00" }, { "name": "wp-cli/mustangostang-spyc", @@ -687,5 +687,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.0.0" } diff --git a/plugins/woocommerce/changelog/2023-01-05-09-16-47-168455 b/plugins/woocommerce/changelog/2023-01-05-09-16-47-168455 new file mode 100644 index 00000000000..6a084e8bc3f --- /dev/null +++ b/plugins/woocommerce/changelog/2023-01-05-09-16-47-168455 @@ -0,0 +1,4 @@ +Significance: patch +Type: enhancement + +Adds new order status filters for bacs and cheque email instructions. diff --git a/plugins/woocommerce/changelog/add-35778 b/plugins/woocommerce/changelog/add-35778 new file mode 100644 index 00000000000..69148c44e73 --- /dev/null +++ b/plugins/woocommerce/changelog/add-35778 @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Auto generate variations on option changes diff --git a/plugins/woocommerce/changelog/add-35989 b/plugins/woocommerce/changelog/add-35989 new file mode 100644 index 00000000000..a7e18645939 --- /dev/null +++ b/plugins/woocommerce/changelog/add-35989 @@ -0,0 +1,4 @@ +Significance: minor +Type: add + +Remove manage_stock 'parent' value before saving the variation diff --git a/plugins/woocommerce/changelog/add-36014-mvp-field-slot b/plugins/woocommerce/changelog/add-36014-mvp-field-slot new file mode 100644 index 00000000000..426654d8c1f --- /dev/null +++ b/plugins/woocommerce/changelog/add-36014-mvp-field-slot @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Adding WooProductFieldItem slot to product details section. diff --git a/plugins/woocommerce/changelog/add-36015-mvp-section-slot b/plugins/woocommerce/changelog/add-36015-mvp-section-slot new file mode 100644 index 00000000000..43c27626ea4 --- /dev/null +++ b/plugins/woocommerce/changelog/add-36015-mvp-section-slot @@ -0,0 +1,4 @@ +Significance: minor +Type: add + +Adding the WooProductSectionItem slot within the product editor general tab. diff --git a/plugins/woocommerce/changelog/add-36019_php_product_form_helper_classes b/plugins/woocommerce/changelog/add-36019_php_product_form_helper_classes new file mode 100644 index 00000000000..30b2c100ca4 --- /dev/null +++ b/plugins/woocommerce/changelog/add-36019_php_product_form_helper_classes @@ -0,0 +1,4 @@ +Significance: minor +Type: add + +Add initial product form PHP helper class to add new fields. diff --git a/plugins/woocommerce/changelog/add-36021_php_add_product_form_api_functions b/plugins/woocommerce/changelog/add-36021_php_add_product_form_api_functions new file mode 100644 index 00000000000..78c483c2cfc --- /dev/null +++ b/plugins/woocommerce/changelog/add-36021_php_add_product_form_api_functions @@ -0,0 +1,4 @@ +Significance: minor +Type: add + +Add new product form API for extending the new Product Form MVP. diff --git a/plugins/woocommerce/changelog/add-36117 b/plugins/woocommerce/changelog/add-36117 new file mode 100644 index 00000000000..e0727aa9e19 --- /dev/null +++ b/plugins/woocommerce/changelog/add-36117 @@ -0,0 +1,4 @@ +Significance: minor +Type: add + +Add ability to filter variations by local attributes in REST API diff --git a/plugins/woocommerce/changelog/add-36163_advanced_setting_option b/plugins/woocommerce/changelog/add-36163_advanced_setting_option new file mode 100644 index 00000000000..ec1ce1cee44 --- /dev/null +++ b/plugins/woocommerce/changelog/add-36163_advanced_setting_option @@ -0,0 +1,4 @@ +Significance: minor +Type: dev + +Add advanced setting option diff --git a/plugins/woocommerce/changelog/add-36164 b/plugins/woocommerce/changelog/add-36164 new file mode 100644 index 00000000000..7cf598709f9 --- /dev/null +++ b/plugins/woocommerce/changelog/add-36164 @@ -0,0 +1,4 @@ +Significance: minor +Type: add + +Include tax options in pricing section diff --git a/plugins/woocommerce/changelog/add-36276 b/plugins/woocommerce/changelog/add-36276 new file mode 100644 index 00000000000..ae891523bdb --- /dev/null +++ b/plugins/woocommerce/changelog/add-36276 @@ -0,0 +1,4 @@ +Significance: minor +Type: add + +Add product variations flag to only show work in development diff --git a/plugins/woocommerce/changelog/add-76-product-creation-experiment b/plugins/woocommerce/changelog/add-76-product-creation-experiment new file mode 100644 index 00000000000..70af2275260 --- /dev/null +++ b/plugins/woocommerce/changelog/add-76-product-creation-experiment @@ -0,0 +1,4 @@ +Significance: minor +Type: tweak + +Redirect to new product experience when in experiment group diff --git a/plugins/woocommerce/changelog/canceled b/plugins/woocommerce/changelog/canceled new file mode 100644 index 00000000000..2f8b5c512ca --- /dev/null +++ b/plugins/woocommerce/changelog/canceled @@ -0,0 +1,4 @@ +Significance: minor +Type: tweak + +Update spelling of Cancelled to Canceled for US English. diff --git a/plugins/woocommerce/changelog/dev-33551_streamline_first_variation_creation b/plugins/woocommerce/changelog/dev-33551_streamline_first_variation_creation deleted file mode 100644 index 6ea52390c8e..00000000000 --- a/plugins/woocommerce/changelog/dev-33551_streamline_first_variation_creation +++ /dev/null @@ -1,4 +0,0 @@ -Significance: minor -Type: dev - -Automatically show attributes in Variations diff --git a/plugins/woocommerce/changelog/dev-bump-stable-tag b/plugins/woocommerce/changelog/dev-bump-stable-tag new file mode 100644 index 00000000000..dd91470c3fc --- /dev/null +++ b/plugins/woocommerce/changelog/dev-bump-stable-tag @@ -0,0 +1,3 @@ +Significance: patch +Type: dev +Comment: Stable tag bump diff --git a/plugins/woocommerce/changelog/dev-update-browserslist-config b/plugins/woocommerce/changelog/dev-update-browserslist-config new file mode 100644 index 00000000000..e693d55dc97 --- /dev/null +++ b/plugins/woocommerce/changelog/dev-update-browserslist-config @@ -0,0 +1,4 @@ +Significance: major +Type: dev + +Update the browserslist config for legacy client JS to match Wordpress. diff --git a/plugins/woocommerce/changelog/e2e-fix-obw-industry-spec b/plugins/woocommerce/changelog/e2e-fix-obw-industry-spec new file mode 100644 index 00000000000..734416dfad8 --- /dev/null +++ b/plugins/woocommerce/changelog/e2e-fix-obw-industry-spec @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Fix flakiness of the `can save industry changes when navigating back to "Store Details"` E2E test. diff --git a/plugins/woocommerce/changelog/e2e-modify-search-selector b/plugins/woocommerce/changelog/e2e-modify-search-selector new file mode 100644 index 00000000000..3e918d4a174 --- /dev/null +++ b/plugins/woocommerce/changelog/e2e-modify-search-selector @@ -0,0 +1,5 @@ +Significance: patch +Type: fix +Comment: Minor change in E2E selectory. + + diff --git a/plugins/woocommerce/changelog/enable-hpos-check b/plugins/woocommerce/changelog/enable-hpos-check new file mode 100644 index 00000000000..e8e159e8594 --- /dev/null +++ b/plugins/woocommerce/changelog/enable-hpos-check @@ -0,0 +1,5 @@ +Significance: patch +Type: fix +Comment: Build process change. + + diff --git a/plugins/woocommerce/changelog/fix-240 b/plugins/woocommerce/changelog/fix-240 new file mode 100644 index 00000000000..f78ebaad257 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-240 @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Customers REST API endpoint will now return user metadata only when requester has an administrator role diff --git a/plugins/woocommerce/changelog/fix-31478-responsive-emails b/plugins/woocommerce/changelog/fix-31478-responsive-emails new file mode 100644 index 00000000000..54abf484093 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-31478-responsive-emails @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Ensure order emails are responsive in most email clients, including when the current language is RTL. diff --git a/plugins/woocommerce/changelog/fix-35486 b/plugins/woocommerce/changelog/fix-35486 new file mode 100644 index 00000000000..0510978af15 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-35486 @@ -0,0 +1,4 @@ +Significance: minor +Type: add + +Add support for sorting by order metadata in HPOS queries. diff --git a/plugins/woocommerce/changelog/fix-35647-hpos-meta-boxes b/plugins/woocommerce/changelog/fix-35647-hpos-meta-boxes new file mode 100644 index 00000000000..391f689ee59 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-35647-hpos-meta-boxes @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Makes it possible to use an `add_meta_boxes_` style hook in the HPOS editor, for parity with the traditional post editor. diff --git a/plugins/woocommerce/changelog/fix-35831 b/plugins/woocommerce/changelog/fix-35831 new file mode 100644 index 00000000000..88b473b7fbe --- /dev/null +++ b/plugins/woocommerce/changelog/fix-35831 @@ -0,0 +1,4 @@ +Significance: patch +Type: performance + +Speed up HPOS search query by using group by instead of distinct. diff --git a/plugins/woocommerce/changelog/fix-35852 b/plugins/woocommerce/changelog/fix-35852 new file mode 100644 index 00000000000..2cdfd732379 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-35852 @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Fix bug when filtering for customer_id=0. diff --git a/plugins/woocommerce/changelog/fix-35909 b/plugins/woocommerce/changelog/fix-35909 new file mode 100644 index 00000000000..7789fa59635 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-35909 @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Set child orders to be children of current order parent before deleting for consistency. diff --git a/plugins/woocommerce/changelog/fix-35983 b/plugins/woocommerce/changelog/fix-35983 new file mode 100644 index 00000000000..00f4750213c --- /dev/null +++ b/plugins/woocommerce/changelog/fix-35983 @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Fix for product filters when 'shop' page is the front page. diff --git a/plugins/woocommerce/changelog/fix-36007-sold-individually b/plugins/woocommerce/changelog/fix-36007-sold-individually new file mode 100644 index 00000000000..727cdd0ccc2 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36007-sold-individually @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +By default, hide the quantity selector within the single product page if a product is sold individually. diff --git a/plugins/woocommerce/changelog/fix-36007-sold-individually-amendment b/plugins/woocommerce/changelog/fix-36007-sold-individually-amendment new file mode 100644 index 00000000000..6b14c30ea53 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36007-sold-individually-amendment @@ -0,0 +1,5 @@ +Significance: patch +Type: tweak +Comment: We're tweaking an unreleased change which is already covered by a changelog entry added in PR#36350. + + diff --git a/plugins/woocommerce/changelog/fix-36181_hide_variations_section_when_empty b/plugins/woocommerce/changelog/fix-36181_hide_variations_section_when_empty new file mode 100644 index 00000000000..494a055c9cb --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36181_hide_variations_section_when_empty @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Hide Variations section when it is empty diff --git a/plugins/woocommerce/changelog/fix-36190_attribute_lists_corrupt_renders b/plugins/woocommerce/changelog/fix-36190_attribute_lists_corrupt_renders new file mode 100644 index 00000000000..99d4514d606 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36190_attribute_lists_corrupt_renders @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Fix attributes/options lists corrupt render #36236 diff --git a/plugins/woocommerce/changelog/fix-36204 b/plugins/woocommerce/changelog/fix-36204 new file mode 100644 index 00000000000..b82f195a017 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36204 @@ -0,0 +1,4 @@ +Significance: minor +Type: tweak + +Derive product type from product attributes diff --git a/plugins/woocommerce/changelog/fix-36205 b/plugins/woocommerce/changelog/fix-36205 new file mode 100644 index 00000000000..f44729496ac --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36205 @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Allow product tab navigation without prompting for unsaved changes diff --git a/plugins/woocommerce/changelog/fix-36206 b/plugins/woocommerce/changelog/fix-36206 new file mode 100644 index 00000000000..22250127df6 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36206 @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Convert HTML to blocks in product variation description diff --git a/plugins/woocommerce/changelog/fix-36212 b/plugins/woocommerce/changelog/fix-36212 new file mode 100644 index 00000000000..9540f4d7035 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36212 @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Skip custom search for HPOS API queries as it's handled already. diff --git a/plugins/woocommerce/changelog/fix-36214 b/plugins/woocommerce/changelog/fix-36214 new file mode 100644 index 00000000000..29a3e542e5d --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36214 @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Add support for sorting by includes param. diff --git a/plugins/woocommerce/changelog/fix-36237 b/plugins/woocommerce/changelog/fix-36237 new file mode 100644 index 00000000000..fa4b0ffbd34 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36237 @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Fix navigation between variations and tab selection diff --git a/plugins/woocommerce/changelog/fix-36255_reordering_list_items b/plugins/woocommerce/changelog/fix-36255_reordering_list_items new file mode 100644 index 00000000000..556c96c166e --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36255_reordering_list_items @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Fix reordering list items error diff --git a/plugins/woocommerce/changelog/fix-36293 b/plugins/woocommerce/changelog/fix-36293 new file mode 100644 index 00000000000..99915a68487 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36293 @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Remove persisted query on return to parent product from variation diff --git a/plugins/woocommerce/changelog/fix-analytics-category-breadcrumbs-html-entities b/plugins/woocommerce/changelog/fix-analytics-category-breadcrumbs-html-entities new file mode 100644 index 00000000000..5f087d9d1e0 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-analytics-category-breadcrumbs-html-entities @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Decode HTML entities in CategoryBreadcrumbs. diff --git a/plugins/woocommerce/changelog/fix-categories-dropdown-decode-html-entities b/plugins/woocommerce/changelog/fix-categories-dropdown-decode-html-entities new file mode 100644 index 00000000000..c9cb7cb1906 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-categories-dropdown-decode-html-entities @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Decode HTML entities in CategoryFieldItem. diff --git a/plugins/woocommerce/changelog/fix-coupon-code-a11y b/plugins/woocommerce/changelog/fix-coupon-code-a11y new file mode 100644 index 00000000000..6a4f60b8cc6 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-coupon-code-a11y @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Improve accessibility of the coupon code label, in the context of the cart page. diff --git a/plugins/woocommerce/changelog/fix-order-edit-consistency b/plugins/woocommerce/changelog/fix-order-edit-consistency new file mode 100644 index 00000000000..c4e9da59cf3 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-order-edit-consistency @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Make HPOS UX more consistent with posts UI (so that same e2e tests passes for both). diff --git a/plugins/woocommerce/changelog/fix-remove-redundant-pinterest-from-marketing-task b/plugins/woocommerce/changelog/fix-remove-redundant-pinterest-from-marketing-task deleted file mode 100644 index 5cd632d56f9..00000000000 --- a/plugins/woocommerce/changelog/fix-remove-redundant-pinterest-from-marketing-task +++ /dev/null @@ -1,4 +0,0 @@ -Significance: patch -Type: fix - -Remove redundant Pinterest plugin from marketing task diff --git a/plugins/woocommerce/changelog/fix-rest-api-refunds-for-hpos b/plugins/woocommerce/changelog/fix-rest-api-refunds-for-hpos new file mode 100644 index 00000000000..e6e45f39c4a --- /dev/null +++ b/plugins/woocommerce/changelog/fix-rest-api-refunds-for-hpos @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Fix REST API order refunds enpoint when HPOS is active, and make v2 orders endpoint compatible with HPOS diff --git a/plugins/woocommerce/changelog/fix-typo-in-regenerate_report_data-doc b/plugins/woocommerce/changelog/fix-typo-in-regenerate_report_data-doc new file mode 100644 index 00000000000..b535c082585 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-typo-in-regenerate_report_data-doc @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Fix typo in a function comment. diff --git a/plugins/woocommerce/changelog/fix-wc-cli-commands b/plugins/woocommerce/changelog/fix-wc-cli-commands new file mode 100644 index 00000000000..176fd4ad1e6 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-wc-cli-commands @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Fix the signature mismatch affecting wc cli commands ability to fetch user subscription data. diff --git a/plugins/woocommerce/changelog/four-digit-postcodes b/plugins/woocommerce/changelog/four-digit-postcodes new file mode 100644 index 00000000000..9616e6d6f13 --- /dev/null +++ b/plugins/woocommerce/changelog/four-digit-postcodes @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Validation of Norweigan postcodes has been added. diff --git a/plugins/woocommerce/changelog/joris-36343-variation-sort-order b/plugins/woocommerce/changelog/joris-36343-variation-sort-order new file mode 100644 index 00000000000..dbfacafe943 --- /dev/null +++ b/plugins/woocommerce/changelog/joris-36343-variation-sort-order @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Ensures product variation sort order is correctly persisted. diff --git a/plugins/woocommerce/changelog/update-changelogger b/plugins/woocommerce/changelog/update-changelogger new file mode 100644 index 00000000000..29fcd182779 --- /dev/null +++ b/plugins/woocommerce/changelog/update-changelogger @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: Updating a dev dependency, shipped package should not be affected. + + diff --git a/plugins/woocommerce/changelog/update-fix-country-select-control-match b/plugins/woocommerce/changelog/update-fix-country-select-control-match deleted file mode 100644 index 65c9ab1c64e..00000000000 --- a/plugins/woocommerce/changelog/update-fix-country-select-control-match +++ /dev/null @@ -1,4 +0,0 @@ -Significance: minor -Type: update - -Match country name or ' - region' when filtering country select control #36120 \ No newline at end of file diff --git a/plugins/woocommerce/changelog/update-k6-order-requests b/plugins/woocommerce/changelog/update-k6-order-requests new file mode 100644 index 00000000000..fcec53bf351 --- /dev/null +++ b/plugins/woocommerce/changelog/update-k6-order-requests @@ -0,0 +1,5 @@ +Significance: patch +Type: fix +Comment: perf test not included in release package + + diff --git a/plugins/woocommerce/changelog/update-k6-readme-variables b/plugins/woocommerce/changelog/update-k6-readme-variables new file mode 100644 index 00000000000..46bf0182f7b --- /dev/null +++ b/plugins/woocommerce/changelog/update-k6-readme-variables @@ -0,0 +1,5 @@ +Significance: patch +Type: fix +Comment: update variable names + + diff --git a/plugins/woocommerce/changelog/update-requires-at-least-5.9 b/plugins/woocommerce/changelog/update-requires-at-least-5.9 deleted file mode 100644 index 5807dcd8cf6..00000000000 --- a/plugins/woocommerce/changelog/update-requires-at-least-5.9 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: dev -Comment: update requires at least to same 5.9 - - diff --git a/plugins/woocommerce/changelog/update-tasklists-addtask b/plugins/woocommerce/changelog/update-tasklists-addtask new file mode 100644 index 00000000000..c1f178b56fc --- /dev/null +++ b/plugins/woocommerce/changelog/update-tasklists-addtask @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Update TaskLists::add_task() to reflect changes in TaskList::add_task() diff --git a/plugins/woocommerce/changelog/update-woocommerce-blocks-9.1.4 b/plugins/woocommerce/changelog/update-woocommerce-blocks-9.1.4 new file mode 100644 index 00000000000..a6644966078 --- /dev/null +++ b/plugins/woocommerce/changelog/update-woocommerce-blocks-9.1.4 @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Update WooCommerce Blocks to 9.1.4 diff --git a/plugins/woocommerce/changelog/upgrade-to-phpunit-8 b/plugins/woocommerce/changelog/upgrade-to-phpunit-8 new file mode 100644 index 00000000000..f08bce4ff53 --- /dev/null +++ b/plugins/woocommerce/changelog/upgrade-to-phpunit-8 @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Upgrade PHPUnit to v8 diff --git a/plugins/woocommerce/client/admin/config/core.json b/plugins/woocommerce/client/admin/config/core.json index 840cb77cc79..e9966a18156 100644 --- a/plugins/woocommerce/client/admin/config/core.json +++ b/plugins/woocommerce/client/admin/config/core.json @@ -14,9 +14,10 @@ "minified-js": false, "mobile-app-banner": true, "navigation": true, - "new-product-management-experience": false, + "new-product-management-experience": true, "onboarding": true, "onboarding-tasks": true, + "product-variation-management": false, "remote-inbox-notifications": true, "remote-free-extensions": true, "payment-gateway-suggestions": true, diff --git a/plugins/woocommerce/client/admin/config/development.json b/plugins/woocommerce/client/admin/config/development.json index f2110a7c86b..71a4f00d30c 100644 --- a/plugins/woocommerce/client/admin/config/development.json +++ b/plugins/woocommerce/client/admin/config/development.json @@ -14,10 +14,11 @@ "minified-js": true, "mobile-app-banner": true, "navigation": true, - "new-product-management-experience": false, + "new-product-management-experience": true, "onboarding": true, "onboarding-tasks": true, "payment-gateway-suggestions": true, + "product-variation-management": true, "remote-inbox-notifications": true, "remote-free-extensions": true, "settings": false, diff --git a/plugins/woocommerce/client/legacy/.browserslistrc b/plugins/woocommerce/client/legacy/.browserslistrc index 5d191931ac1..0152f61ef03 100644 --- a/plugins/woocommerce/client/legacy/.browserslistrc +++ b/plugins/woocommerce/client/legacy/.browserslistrc @@ -1,3 +1 @@ -> 0.1% -ie 8 -ie 9 +extends @wordpress/browserslist-config diff --git a/plugins/woocommerce/client/legacy/css/_common.scss b/plugins/woocommerce/client/legacy/css/_common.scss new file mode 100644 index 00000000000..9737c39c898 --- /dev/null +++ b/plugins/woocommerce/client/legacy/css/_common.scss @@ -0,0 +1,8 @@ +/** + * Contains rules common to all supported frontend themes. + */ + +/* We do not wish to display the quantity selector (within single product pages) if the product is sold individually. */ +.woocommerce.single-product .product.sold-individually .quantity { + display: none; +} diff --git a/plugins/woocommerce/client/legacy/css/admin.scss b/plugins/woocommerce/client/legacy/css/admin.scss index 1b20c18b198..e0d69f3b7db 100644 --- a/plugins/woocommerce/client/legacy/css/admin.scss +++ b/plugins/woocommerce/client/legacy/css/admin.scss @@ -4375,6 +4375,11 @@ img.help_tip { top: 20px; } + td.help-tooltip { + white-space: nowrap; + width: 8px; + } + .select2-container { vertical-align: top; margin-bottom: 3px; diff --git a/plugins/woocommerce/client/legacy/css/twenty-nineteen.scss b/plugins/woocommerce/client/legacy/css/twenty-nineteen.scss index fd257184f74..41630ae0b43 100644 --- a/plugins/woocommerce/client/legacy/css/twenty-nineteen.scss +++ b/plugins/woocommerce/client/legacy/css/twenty-nineteen.scss @@ -1,3 +1,4 @@ +@import "common"; @import 'mixins'; /** diff --git a/plugins/woocommerce/client/legacy/css/twenty-seventeen.scss b/plugins/woocommerce/client/legacy/css/twenty-seventeen.scss index f2c0af5bb9f..7e77f25c820 100644 --- a/plugins/woocommerce/client/legacy/css/twenty-seventeen.scss +++ b/plugins/woocommerce/client/legacy/css/twenty-seventeen.scss @@ -1,6 +1,7 @@ /** * Twenty Seventeen integration styles */ +@import "common"; @import "mixins"; @import "animation"; diff --git a/plugins/woocommerce/client/legacy/css/twenty-twenty-one.scss b/plugins/woocommerce/client/legacy/css/twenty-twenty-one.scss index 199deae3fc8..e7bbab55a2f 100644 --- a/plugins/woocommerce/client/legacy/css/twenty-twenty-one.scss +++ b/plugins/woocommerce/client/legacy/css/twenty-twenty-one.scss @@ -1,3 +1,4 @@ +@import "common"; @import "mixins"; /** diff --git a/plugins/woocommerce/client/legacy/css/twenty-twenty-three.scss b/plugins/woocommerce/client/legacy/css/twenty-twenty-three.scss index d33508ed3bd..6c6a8fa48d9 100644 --- a/plugins/woocommerce/client/legacy/css/twenty-twenty-three.scss +++ b/plugins/woocommerce/client/legacy/css/twenty-twenty-three.scss @@ -25,6 +25,7 @@ font-style: normal; } +@import "common"; @import "mixins"; @import "animation"; @@ -1130,7 +1131,7 @@ list-style: none; font-size: var( --wp--preset--font-size--small ); display: flow-root; - + &[role='alert']::before { background: #d5d5d5; color: black; @@ -1140,10 +1141,10 @@ padding-right: 3px; margin-right: 1rem; } - + a { color: var( --wp--preset--color--contrast ); - + .button { margin-top: -0.5rem; border: none; @@ -1151,24 +1152,24 @@ } } } - + .woocommerce-error[role='alert'] { margin: 0; - + &::before { content: 'X'; padding-right: 4px; padding-left: 4px; } - + li { display: inline-block; } } - + .woocommerce-message { &[role='alert']::before { content: '\2713'; } } - + diff --git a/plugins/woocommerce/client/legacy/css/twenty-twenty-two.scss b/plugins/woocommerce/client/legacy/css/twenty-twenty-two.scss index 3105e01ce15..7a54fe2318d 100644 --- a/plugins/woocommerce/client/legacy/css/twenty-twenty-two.scss +++ b/plugins/woocommerce/client/legacy/css/twenty-twenty-two.scss @@ -25,6 +25,7 @@ font-style: normal; } +@import "common"; @import "mixins"; @import "animation"; @import "variables"; diff --git a/plugins/woocommerce/client/legacy/css/twenty-twenty.scss b/plugins/woocommerce/client/legacy/css/twenty-twenty.scss index 6f91033da6c..0e758990c06 100644 --- a/plugins/woocommerce/client/legacy/css/twenty-twenty.scss +++ b/plugins/woocommerce/client/legacy/css/twenty-twenty.scss @@ -1,3 +1,4 @@ +@import "common"; @import "mixins"; /** diff --git a/plugins/woocommerce/client/legacy/css/woocommerce-blocktheme.scss b/plugins/woocommerce/client/legacy/css/woocommerce-blocktheme.scss index 1701887309a..41b17b64088 100644 --- a/plugins/woocommerce/client/legacy/css/woocommerce-blocktheme.scss +++ b/plugins/woocommerce/client/legacy/css/woocommerce-blocktheme.scss @@ -2,6 +2,7 @@ * woocommerce-blocktheme.scss * Block theme default styles to ensure WooCommerce looks better out of the box with block themes that are not optimised for WooCommerce specifically. */ +@import "common"; @import "fonts"; @import "variables"; diff --git a/plugins/woocommerce/client/legacy/css/woocommerce-layout.scss b/plugins/woocommerce/client/legacy/css/woocommerce-layout.scss index 2ff2655a82f..d9d4eafa2b0 100644 --- a/plugins/woocommerce/client/legacy/css/woocommerce-layout.scss +++ b/plugins/woocommerce/client/legacy/css/woocommerce-layout.scss @@ -284,10 +284,6 @@ .coupon { float: left; - - label { - display: none; - } } } } diff --git a/plugins/woocommerce/client/legacy/css/woocommerce.scss b/plugins/woocommerce/client/legacy/css/woocommerce.scss index efa4f5432d6..9b475942929 100644 --- a/plugins/woocommerce/client/legacy/css/woocommerce.scss +++ b/plugins/woocommerce/client/legacy/css/woocommerce.scss @@ -7,6 +7,7 @@ /** * Imports */ +@import "common"; @import "mixins"; @import "variables"; @import "animation"; diff --git a/plugins/woocommerce/client/legacy/js/admin/meta-boxes-product-variation.js b/plugins/woocommerce/client/legacy/js/admin/meta-boxes-product-variation.js index 53e16d05c41..84eab9d8bd5 100644 --- a/plugins/woocommerce/client/legacy/js/admin/meta-boxes-product-variation.js +++ b/plugins/woocommerce/client/legacy/js/admin/meta-boxes-product-variation.js @@ -49,10 +49,6 @@ jQuery( function ( $ ) { '.wc_input_variations_price', this.maybe_enable_button_to_add_price_to_variations ); - $( 'ul.wc-tabs a[href=#variable_product_options]' ).on( - 'click', - this.maybe_add_attributes_to_variations - ); }, /** @@ -377,24 +373,6 @@ jQuery( function ( $ ) { } ); }, - - /** - * Maybe add attributes to variations - */ - maybe_add_attributes_to_variations: function () { - var has_variation_attributes = $( - 'select.attribute_taxonomy' - ).data( 'is-used-for-variations' ); - if ( has_variation_attributes ) { - wc_meta_boxes_product_variations_ajax.link_all_variations( - true - ); - $( 'select.attribute_taxonomy' ).data( - 'is-used-for-variations', - false - ); - } - }, }; /** @@ -1017,16 +995,14 @@ jQuery( function ( $ ) { * * @return {Bool} */ - link_all_variations: function ( auto_link_variations = false ) { + link_all_variations: function () { wc_meta_boxes_product_variations_ajax.check_for_changes(); - var is_confirmed_action = auto_link_variations - ? true - : window.confirm( - woocommerce_admin_meta_boxes_variations.i18n_link_all_variations - ); - - if ( is_confirmed_action ) { + if ( + window.confirm( + woocommerce_admin_meta_boxes_variations.i18n_link_all_variations + ) + ) { wc_meta_boxes_product_variations_ajax.block(); var data = { diff --git a/plugins/woocommerce/client/legacy/js/admin/meta-boxes-product.js b/plugins/woocommerce/client/legacy/js/admin/meta-boxes-product.js index 3891fcc55d1..bebb8f422f0 100644 --- a/plugins/woocommerce/client/legacy/js/admin/meta-boxes-product.js +++ b/plugins/woocommerce/client/legacy/js/admin/meta-boxes-product.js @@ -775,13 +775,6 @@ jQuery( function ( $ ) { 'disabled-items', newSelectedAttributes ); - var isUsedForVariations = $( 'input#used-for-variation' ).is( - ':checked' - ); - $( 'select.attribute_taxonomy' ).data( - 'is-used-for-variations', - isUsedForVariations - ); // Reload variations panel. var this_page = window.location.toString(); @@ -1046,6 +1039,7 @@ jQuery( function ( $ ) { keepAlive: true, } ); + // add a tooltip to the right of the product image meta box "Set product image" and "Add product gallery images" const setProductImageLink = $( '#set-post-thumbnail' ); const tooltipMarkup = ``; diff --git a/plugins/woocommerce/composer.json b/plugins/woocommerce/composer.json index d5daec6c988..60cb6ae41f7 100644 --- a/plugins/woocommerce/composer.json +++ b/plugins/woocommerce/composer.json @@ -21,14 +21,15 @@ "maxmind-db/reader": "^1.11", "pelago/emogrifier": "^6.0", "woocommerce/action-scheduler": "3.4.2", - "woocommerce/woocommerce-blocks": "9.1.3" + "woocommerce/woocommerce-blocks": "9.1.4" }, "require-dev": { + "automattic/jetpack-changelogger": "^3.3.0", "bamarni/composer-bin-plugin": "^1.4", - "yoast/phpunit-polyfills": "^1.0", - "phpunit/phpunit": "7.5.20", - "automattic/jetpack-changelogger": "3.1.3", - "sebastian/comparator": "3.0.3" + "dms/phpunit-arraysubset-asserts": "^0.4.0", + "phpunit/phpunit": "^8.0", + "sebastian/comparator": "3.0.3", + "yoast/phpunit-polyfills": "^1.0" }, "config": { "optimize-autoloader": true, diff --git a/plugins/woocommerce/composer.lock b/plugins/woocommerce/composer.lock index 635c758280d..66036e5e61d 100644 --- a/plugins/woocommerce/composer.lock +++ b/plugins/woocommerce/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": "7b14c7f0f38737384718c9a013402d48", + "content-hash": "c00f9ad96d703d7e841895190ec42436", "packages": [ { "name": "automattic/jetpack-autoloader", @@ -628,16 +628,16 @@ }, { "name": "woocommerce/woocommerce-blocks", - "version": "v9.1.3", + "version": "v9.1.4", "source": { "type": "git", "url": "https://github.com/woocommerce/woocommerce-blocks.git", - "reference": "6e49666a8270f395d15c6b58cd0c5ce111df5ecf" + "reference": "03d5efd33206aa11684dee2c493bbbe9a4e417c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/woocommerce/woocommerce-blocks/zipball/6e49666a8270f395d15c6b58cd0c5ce111df5ecf", - "reference": "6e49666a8270f395d15c6b58cd0c5ce111df5ecf", + "url": "https://api.github.com/repos/woocommerce/woocommerce-blocks/zipball/03d5efd33206aa11684dee2c493bbbe9a4e417c8", + "reference": "03d5efd33206aa11684dee2c493bbbe9a4e417c8", "shasum": "" }, "require": { @@ -683,35 +683,35 @@ ], "support": { "issues": "https://github.com/woocommerce/woocommerce-blocks/issues", - "source": "https://github.com/woocommerce/woocommerce-blocks/tree/v9.1.3" + "source": "https://github.com/woocommerce/woocommerce-blocks/tree/v9.1.4" }, - "time": "2022-12-22T09:15:52+00:00" + "time": "2023-01-05T23:41:26+00:00" } ], "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" @@ -720,7 +720,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": { @@ -742,9 +742,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": "bamarni/composer-bin-plugin", @@ -797,31 +797,76 @@ "time": "2022-02-22T21:01:25+00:00" }, { - "name": "doctrine/instantiator", - "version": "1.4.1", + "name": "dms/phpunit-arraysubset-asserts", + "version": "v0.4.0", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "url": "https://github.com/rdohms/phpunit-arraysubset-asserts.git", + "reference": "428293c2a00eceefbad71a2dbdfb913febb35de2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/rdohms/phpunit-arraysubset-asserts/zipball/428293c2a00eceefbad71a2dbdfb913febb35de2", + "reference": "428293c2a00eceefbad71a2dbdfb913febb35de2", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0 || ^8.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "require-dev": { + "dms/coding-standard": "^9", + "squizlabs/php_codesniffer": "^3.4" + }, + "type": "library", + "autoload": { + "files": [ + "assertarraysubset-autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rafael Dohms", + "email": "rdohms@gmail.com" + } + ], + "description": "This package provides ArraySubset and related asserts once deprecated in PHPUnit 8", + "support": { + "issues": "https://github.com/rdohms/phpunit-arraysubset-asserts/issues", + "source": "https://github.com/rdohms/phpunit-arraysubset-asserts/tree/v0.4.0" + }, + "time": "2022-02-13T15:00:28+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + }, + "dist": { + "type": "zip", + "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": { @@ -848,7 +893,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": [ { @@ -864,7 +909,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "myclabs/deep-copy", @@ -927,28 +972,29 @@ }, { "name": "phar-io/manifest", - "version": "1.0.3", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -980,26 +1026,26 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/master" + "source": "https://github.com/phar-io/manifest/tree/2.0.3" }, - "time": "2018-07-08T19:23:20+00:00" + "time": "2021-07-20T11:28:43+00:00" }, { "name": "phar-io/version", - "version": "2.0.1", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -1031,273 +1077,46 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/master" + "source": "https://github.com/phar-io/version/tree/3.2.1" }, - "time": "2018-07-08T19:19:57+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" - }, - "time": "2022-03-15T21:29:03+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.16.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be8cac52a0827776ff9ccda8c381ac5b71aeb359", - "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.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" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.16.0" - }, - "time": "2022-11-29T15:06:56+00:00" + "time": "2022-02-21T01:04:05+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "6.1.4", + "version": "7.0.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" + "reference": "819f92bba8b001d4363065928088de22f25a3a48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", + "reference": "819f92bba8b001d4363065928088de22f25a3a48", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", + "php": ">=7.2", + "phpunit/php-file-iterator": "^2.0.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", + "phpunit/php-token-stream": "^3.1.3 || ^4.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1 || ^4.0", + "sebastian/environment": "^4.2.2", "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" + "theseer/tokenizer": "^1.1.3" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^8.2.2" }, "suggest": { - "ext-xdebug": "^2.6.0" + "ext-xdebug": "^2.7.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.1-dev" + "dev-master": "7.0-dev" } }, "autoload": { @@ -1325,9 +1144,15 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/master" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.15" }, - "time": "2018-10-31T16:06:48+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-07-26T12:20:09+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1555,53 +1380,48 @@ }, { "name": "phpunit/phpunit", - "version": "7.5.20", + "version": "8.5.29", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9467db479d1b0487c99733bb1e7944d32deded2c" + "reference": "e8c563c47a9a303662955518ca532b022b337f4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c", - "reference": "9467db479d1b0487c99733bb1e7944d32deded2c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e8c563c47a9a303662955518ca532b022b337f4d", + "reference": "e8c563c47a9a303662955518ca532b022b337f4d", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.1", + "doctrine/instantiator": "^1.3.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", - "php": "^7.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.0", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.2", + "phpunit/php-code-coverage": "^7.0.12", + "phpunit/php-file-iterator": "^2.0.4", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^4.0", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", + "phpunit/php-timer": "^2.1.2", + "sebastian/comparator": "^3.0.2", + "sebastian/diff": "^3.0.2", + "sebastian/environment": "^4.2.3", + "sebastian/exporter": "^3.1.2", + "sebastian/global-state": "^3.0.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0", + "sebastian/resource-operations": "^2.0.1", + "sebastian/type": "^1.1.3", "sebastian/version": "^2.0.1" }, - "conflict": { - "phpunit/phpunit-mock-objects": "*" - }, - "require-dev": { - "ext-pdo": "*" - }, "suggest": { "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" + "phpunit/php-invoker": "^2.0.0" }, "bin": [ "phpunit" @@ -1609,7 +1429,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.5-dev" + "dev-master": "8.5-dev" } }, "autoload": { @@ -1637,9 +1457,19 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/7.5.20" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.29" }, - "time": "2020-01-08T08:45:45+00:00" + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-08-22T13:59:39+00:00" }, { "name": "psr/log", @@ -2028,23 +1858,26 @@ }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/de036ec91d55d2a9e0db2ba975b512cdb1c23921", + "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=7.2", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "ext-dom": "*", + "phpunit/phpunit": "^8.0" }, "suggest": { "ext-uopz": "*" @@ -2052,7 +1885,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2077,9 +1910,15 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" + "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.2" }, - "time": "2017-04-27T15:39:26+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-02-10T06:55:38+00:00" }, { "name": "sebastian/object-enumerator", @@ -2308,6 +2147,62 @@ ], "time": "2020-11-30T07:30:19+00:00" }, + { + "name": "sebastian/type", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", + "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/1.1.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:25:11+00:00" + }, { "name": "sebastian/version", "version": "2.0.1", @@ -2702,64 +2597,6 @@ ], "time": "2021-07-28T10:34:58+00:00" }, - { - "name": "webmozart/assert", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" - }, - "time": "2022-06-03T18:03:27+00:00" - }, { "name": "wikimedia/at-ease", "version": "v2.0.0", @@ -2889,5 +2726,5 @@ "platform-overrides": { "php": "7.2" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.0.0" } diff --git a/plugins/woocommerce/includes/admin/class-wc-admin-settings.php b/plugins/woocommerce/includes/admin/class-wc-admin-settings.php index d10e7cc649a..1bcb512c5d3 100644 --- a/plugins/woocommerce/includes/admin/class-wc-admin-settings.php +++ b/plugins/woocommerce/includes/admin/class-wc-admin-settings.php @@ -492,6 +492,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) : ?> +
true, - 'query_string' => esc_url( '?source=' . $source ), + 'query_string' => '' !== $source ? esc_url( '?source=' . $source ) : '', ) ); diff --git a/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-attribute.php b/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-attribute.php index f63e6444159..56b248e409f 100644 --- a/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-attribute.php +++ b/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-attribute.php @@ -87,7 +87,7 @@ if ( ! defined( 'ABSPATH' ) ) {
- +
diff --git a/plugins/woocommerce/includes/admin/settings/class-wc-settings-accounts.php b/plugins/woocommerce/includes/admin/settings/class-wc-settings-accounts.php index be1c1dd71f7..851bc7d2d46 100644 --- a/plugins/woocommerce/includes/admin/settings/class-wc-settings-accounts.php +++ b/plugins/woocommerce/includes/admin/settings/class-wc-settings-accounts.php @@ -203,8 +203,8 @@ class WC_Settings_Accounts extends WC_Settings_Page { 'autoload' => false, ), array( - 'title' => __( 'Retain cancelled orders', 'woocommerce' ), - 'desc_tip' => __( 'Cancelled orders are unpaid and may have been cancelled by the store owner or customer. They will be trashed after the specified duration.', 'woocommerce' ), + 'title' => __( 'Retain canceled orders', 'woocommerce' ), + 'desc_tip' => __( 'Canceled orders are unpaid and may have been cancelled by the store owner or customer. They will be trashed after the specified duration.', 'woocommerce' ), 'id' => 'woocommerce_trash_cancelled_orders', 'type' => 'relative_date_selector', 'placeholder' => __( 'N/A', 'woocommerce' ), diff --git a/plugins/woocommerce/includes/class-wc-post-types.php b/plugins/woocommerce/includes/class-wc-post-types.php index 1ccafa5e2d7..43fcb6c975b 100644 --- a/plugins/woocommerce/includes/class-wc-post-types.php +++ b/plugins/woocommerce/includes/class-wc-post-types.php @@ -598,13 +598,13 @@ class WC_Post_Types { 'label_count' => _n_noop( 'Completed (%s)', 'Completed (%s)', 'woocommerce' ), ), 'wc-cancelled' => array( - 'label' => _x( 'Cancelled', 'Order status', 'woocommerce' ), + 'label' => _x( 'Canceled', 'Order status', 'woocommerce' ), 'public' => false, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, /* translators: %s: number of orders */ - 'label_count' => _n_noop( 'Cancelled (%s)', 'Cancelled (%s)', 'woocommerce' ), + 'label_count' => _n_noop( 'Canceled (%s)', 'Canceled (%s)', 'woocommerce' ), ), 'wc-refunded' => array( 'label' => _x( 'Refunded', 'Order status', 'woocommerce' ), diff --git a/plugins/woocommerce/includes/class-wc-query.php b/plugins/woocommerce/includes/class-wc-query.php index 7318ae2987c..82d190e0ce8 100644 --- a/plugins/woocommerce/includes/class-wc-query.php +++ b/plugins/woocommerce/includes/class-wc-query.php @@ -290,6 +290,36 @@ class WC_Query { return absint( get_option( 'page_on_front' ) ) === absint( $page_id ); } + /** + * Returns a copy of `$query` with all query vars that are allowed on the front page stripped. + * Used when the shop page is also the front page. + * + * @param array $query The unfiltered array. + * @return array The filtered query vars. + */ + private function filter_out_valid_front_page_query_vars( $query ) { + return array_filter( + $query, + function( $key ) { + return ! $this->is_query_var_valid_on_front_page( $key ); + }, + ARRAY_FILTER_USE_KEY + ); + } + + /** + * Checks whether a query var is allowed on the front page or not. + * + * @param string $query_var Query var name. + * @return boolean TRUE when query var is allowed on the front page. FALSE otherwise. + */ + private function is_query_var_valid_on_front_page( $query_var ) { + return in_array( $query_var, array( 'preview', 'page', 'paged', 'cpage', 'orderby' ), true ) + || in_array( $query_var, array( 'min_price', 'max_price', 'rating_filter' ), true ) + || 0 === strpos( $query_var, 'filter_' ) + || 0 === strpos( $query_var, 'query_type_' ); + } + /** * Hook into pre_get_posts to do the main product query. * @@ -318,8 +348,9 @@ class WC_Query { // When orderby is set, WordPress shows posts on the front-page. Get around that here. if ( $this->page_on_front_is( wc_get_page_id( 'shop' ) ) ) { - $_query = wp_parse_args( $q->query ); - if ( empty( $_query ) || ! array_diff( array_keys( $_query ), array( 'preview', 'page', 'paged', 'cpage', 'orderby' ) ) ) { + $_query = $this->filter_out_valid_front_page_query_vars( wp_parse_args( $q->query ) ); + + if ( empty( $_query ) ) { $q->set( 'page_id', (int) get_option( 'page_on_front' ) ); $q->is_page = true; $q->is_home = false; diff --git a/plugins/woocommerce/includes/class-wc-regenerate-images.php b/plugins/woocommerce/includes/class-wc-regenerate-images.php index ca59231e7fb..c2db4f8a8e1 100644 --- a/plugins/woocommerce/includes/class-wc-regenerate-images.php +++ b/plugins/woocommerce/includes/class-wc-regenerate-images.php @@ -158,7 +158,7 @@ class WC_Regenerate_Images { $log = wc_get_logger(); $log->info( - __( 'Cancelled product image regeneration job.', 'woocommerce' ), + __( 'Canceled product image regeneration job.', 'woocommerce' ), array( 'source' => 'wc-image-regeneration', ) diff --git a/plugins/woocommerce/includes/class-wc-validation.php b/plugins/woocommerce/includes/class-wc-validation.php index fed369ed25b..cc509dbf049 100644 --- a/plugins/woocommerce/includes/class-wc-validation.php +++ b/plugins/woocommerce/includes/class-wc-validation.php @@ -51,20 +51,18 @@ class WC_Validation { switch ( $country ) { case 'AT': + case 'BE': + case 'CH': + case 'HU': + case 'NO': $valid = (bool) preg_match( '/^([0-9]{4})$/', $postcode ); break; case 'BA': $valid = (bool) preg_match( '/^([7-8]{1})([0-9]{4})$/', $postcode ); break; - case 'BE': - $valid = (bool) preg_match( '/^([0-9]{4})$/i', $postcode ); - break; case 'BR': $valid = (bool) preg_match( '/^([0-9]{5})([-])?([0-9]{3})$/', $postcode ); break; - case 'CH': - $valid = (bool) preg_match( '/^([0-9]{4})$/i', $postcode ); - break; case 'DE': $valid = (bool) preg_match( '/^([0]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{3}$/', $postcode ); break; @@ -79,9 +77,6 @@ class WC_Validation { case 'GB': $valid = self::is_gb_postcode( $postcode ); break; - case 'HU': - $valid = (bool) preg_match( '/^([0-9]{4})$/i', $postcode ); - break; case 'IE': $valid = (bool) preg_match( '/([AC-FHKNPRTV-Y]\d{2}|D6W)[0-9AC-FHKNPRTV-Y]{4}/', wc_normalize_postcode( $postcode ) ); break; diff --git a/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php b/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php index 8864155371f..6e780300bd4 100644 --- a/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php +++ b/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php @@ -1238,7 +1238,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da // phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery $ids = $wpdb->get_col( $wpdb->prepare( - "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'product_variation' AND post_parent = %d AND post_status = 'publish' ORDER BY menu_order ASC, ID ASC", + "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'product_variation' AND post_parent = %d AND post_status in ( 'publish', 'private' ) ORDER BY menu_order ASC, ID ASC", $parent_id ) ); diff --git a/plugins/woocommerce/includes/emails/class-wc-email-cancelled-order.php b/plugins/woocommerce/includes/emails/class-wc-email-cancelled-order.php index eeb4d34c73e..7ed5a5fe221 100644 --- a/plugins/woocommerce/includes/emails/class-wc-email-cancelled-order.php +++ b/plugins/woocommerce/includes/emails/class-wc-email-cancelled-order.php @@ -28,8 +28,8 @@ if ( ! class_exists( 'WC_Email_Cancelled_Order', false ) ) : */ public function __construct() { $this->id = 'cancelled_order'; - $this->title = __( 'Cancelled order', 'woocommerce' ); - $this->description = __( 'Cancelled order emails are sent to chosen recipient(s) when orders have been marked cancelled (if they were previously processing or on-hold).', 'woocommerce' ); + $this->title = __( 'Canceled order', 'woocommerce' ); + $this->description = __( 'Canceled order emails are sent to chosen recipient(s) when orders have been marked canceled (if they were previously processing or on-hold).', 'woocommerce' ); $this->template_html = 'emails/admin-cancelled-order.php'; $this->template_plain = 'emails/plain/admin-cancelled-order.php'; $this->placeholders = array( @@ -66,7 +66,7 @@ if ( ! class_exists( 'WC_Email_Cancelled_Order', false ) ) : * @return string */ public function get_default_heading() { - return __( 'Order Cancelled: #{order_number}', 'woocommerce' ); + return __( 'Order Canceled: #{order_number}', 'woocommerce' ); } /** diff --git a/plugins/woocommerce/includes/emails/class-wc-email-customer-on-hold-order.php b/plugins/woocommerce/includes/emails/class-wc-email-customer-on-hold-order.php index 8be3f17c09d..bf7fd3487dc 100644 --- a/plugins/woocommerce/includes/emails/class-wc-email-customer-on-hold-order.php +++ b/plugins/woocommerce/includes/emails/class-wc-email-customer-on-hold-order.php @@ -30,7 +30,7 @@ if ( ! class_exists( 'WC_Email_Customer_On_Hold_Order', false ) ) : $this->id = 'customer_on_hold_order'; $this->customer_email = true; $this->title = __( 'Order on-hold', 'woocommerce' ); - $this->description = __( 'This is an order notification sent to customers containing order details after an order is placed on-hold from Pending, Cancelled or Failed order status.', 'woocommerce' ); + $this->description = __( 'This is an order notification sent to customers containing order details after an order is placed on-hold from Pending, Canceled or Failed order status.', 'woocommerce' ); $this->template_html = 'emails/customer-on-hold-order.php'; $this->template_plain = 'emails/plain/customer-on-hold-order.php'; $this->placeholders = array( diff --git a/plugins/woocommerce/includes/gateways/bacs/class-wc-gateway-bacs.php b/plugins/woocommerce/includes/gateways/bacs/class-wc-gateway-bacs.php index 3d98230c900..9b593fb859d 100644 --- a/plugins/woocommerce/includes/gateways/bacs/class-wc-gateway-bacs.php +++ b/plugins/woocommerce/includes/gateways/bacs/class-wc-gateway-bacs.php @@ -259,8 +259,14 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { * @param bool $plain_text Email format: plain text or HTML. */ public function email_instructions( $order, $sent_to_admin, $plain_text = false ) { - - if ( ! $sent_to_admin && 'bacs' === $order->get_payment_method() && $order->has_status( 'on-hold' ) ) { + /** + * Filter the email instructions order status. + * + * @since 7.4 + * @param string $terms The order status. + * @param object $order The order object. + */ + if ( ! $sent_to_admin && 'bacs' === $order->get_payment_method() && $order->has_status( apply_filters( 'woocommerce_bacs_email_instructions_order_status', 'on-hold', $order ) ) ) { if ( $this->instructions ) { echo wp_kses_post( wpautop( wptexturize( $this->instructions ) ) . PHP_EOL ); } diff --git a/plugins/woocommerce/includes/gateways/cheque/class-wc-gateway-cheque.php b/plugins/woocommerce/includes/gateways/cheque/class-wc-gateway-cheque.php index 7023a7fb6e8..022c2e3235d 100644 --- a/plugins/woocommerce/includes/gateways/cheque/class-wc-gateway-cheque.php +++ b/plugins/woocommerce/includes/gateways/cheque/class-wc-gateway-cheque.php @@ -102,7 +102,14 @@ class WC_Gateway_Cheque extends WC_Payment_Gateway { * @param bool $plain_text Email format: plain text or HTML. */ public function email_instructions( $order, $sent_to_admin, $plain_text = false ) { - if ( $this->instructions && ! $sent_to_admin && 'cheque' === $order->get_payment_method() && $order->has_status( 'on-hold' ) ) { + /** + * Filter the email instructions order status. + * + * @since 7.4 + * @param string $terms The order status. + * @param object $order The order object. + */ + if ( $this->instructions && ! $sent_to_admin && 'cheque' === $order->get_payment_method() && $order->has_status( apply_filters( 'woocommerce_cheque_email_instructions_order_status', 'on-hold', $order ) ) ) { echo wp_kses_post( wpautop( wptexturize( $this->instructions ) ) . PHP_EOL ); } } diff --git a/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-customers-v2-controller.php b/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-customers-v2-controller.php index b7e023b0d49..27623124df4 100644 --- a/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-customers-v2-controller.php +++ b/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-customers-v2-controller.php @@ -33,17 +33,34 @@ class WC_REST_Customers_V2_Controller extends WC_REST_Customers_V1_Controller { * @return array */ protected function get_formatted_item_data( $object ) { + $formatted_data = $this->get_formatted_item_data_core( $object ); + $formatted_data['orders_count'] = $object->get_order_count(); + $formatted_data['total_spent'] = $object->get_total_spent(); + return $formatted_data; + } + + /** + * Get formatted item data, not including orders count nor total spent. + * This method is needed because v3 API doesn't return those two fields. + * + * @internal This method could disappear or have its name or signature changed in future releases. + * + * @param WC_Data $object WC_Data instance. + * @return array + */ + protected function get_formatted_item_data_core( $object ) { $data = $object->get_data(); $format_date = array( 'date_created', 'date_modified' ); // Format date values. foreach ( $format_date as $key ) { + // Date created is stored UTC, date modified is stored WP local time. $datetime = 'date_created' === $key ? get_date_from_gmt( gmdate( 'Y-m-d H:i:s', $data[ $key ]->getTimestamp() ) ) : $data[ $key ]; $data[ $key ] = wc_rest_prepare_date_response( $datetime, false ); $data[ $key . '_gmt' ] = wc_rest_prepare_date_response( $datetime ); } - return array( + $formatted_data = array( 'id' => $object->get_id(), 'date_created' => $data['date_created'], 'date_created_gmt' => $data['date_created_gmt'], @@ -57,11 +74,14 @@ class WC_REST_Customers_V2_Controller extends WC_REST_Customers_V1_Controller { 'billing' => $data['billing'], 'shipping' => $data['shipping'], 'is_paying_customer' => $data['is_paying_customer'], - 'orders_count' => $object->get_order_count(), - 'total_spent' => $object->get_total_spent(), 'avatar_url' => $object->get_avatar_url(), - 'meta_data' => $data['meta_data'], ); + + if ( wc_current_user_has_role( 'administrator' ) ) { + $formatted_data['meta_data'] = $data['meta_data']; + } + + return $formatted_data; } /** @@ -80,6 +100,7 @@ class WC_REST_Customers_V2_Controller extends WC_REST_Customers_V1_Controller { $response = rest_ensure_response( $data ); $response->add_links( $this->prepare_links( $user_data ) ); + //phpcs:disable WooCommerce.Commenting.CommentHooks.MissingSinceComment /** * Filter customer data returned from the REST API. * @@ -88,6 +109,7 @@ class WC_REST_Customers_V2_Controller extends WC_REST_Customers_V1_Controller { * @param WP_REST_Request $request Request object. */ return apply_filters( 'woocommerce_rest_prepare_customer', $response, $user_data, $request ); + //phpcs:enable WooCommerce.Commenting.CommentHooks.MissingSinceComment } /** diff --git a/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller.php b/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller.php index 88601765bc7..9f49bb546c9 100644 --- a/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller.php +++ b/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller.php @@ -10,6 +10,9 @@ defined( 'ABSPATH' ) || exit; +use Automattic\WooCommerce\Utilities\OrderUtil; + +// phpcs:disable Squiz.Classes.ClassFileName.NoMatch, Squiz.Classes.ValidClassName.NotCamelCaps -- Legacy class name, can't change without breaking backward compat. /** * REST API Orders controller class. * @@ -18,6 +21,7 @@ defined( 'ABSPATH' ) || exit; */ class WC_REST_Orders_V2_Controller extends WC_REST_CRUD_Controller { + // phpcs:enable /** * Endpoint namespace. * @@ -314,7 +318,7 @@ class WC_REST_Orders_V2_Controller extends WC_REST_CRUD_Controller { if ( array_key_exists( $meta_item->id, $formatted_meta_data ) ) { $formatted_meta_item = $formatted_meta_data[ $meta_item->id ]; - $result['display_key'] = wc_clean( $formatted_meta_item->display_key ); + $result['display_key'] = wc_clean( $formatted_meta_item->display_key ); $result['display_value'] = wc_clean( $formatted_meta_item->display_value ); } @@ -346,14 +350,14 @@ class WC_REST_Orders_V2_Controller extends WC_REST_CRUD_Controller { // Only fetch fields that we need. $fields = $this->get_fields_for_response( $this->request ); foreach ( $dependent_fields as $field_key => $dependency ) { - if ( in_array( $field_key, $fields ) && ! in_array( $dependency, $fields ) ) { + if ( in_array( $field_key, $fields, true ) && ! in_array( $dependency, $fields, true ) ) { $fields[] = $dependency; } } - $extra_fields = array_intersect( $extra_fields, $fields ); - $format_decimal = array_intersect( $format_decimal, $fields ); - $format_date = array_intersect( $format_date, $fields ); + $extra_fields = array_intersect( $extra_fields, $fields ); + $format_decimal = array_intersect( $format_decimal, $fields ); + $format_date = array_intersect( $format_date, $fields ); $format_line_items = array_intersect( $format_line_items, $fields ); @@ -506,6 +510,8 @@ class WC_REST_Orders_V2_Controller extends WC_REST_CRUD_Controller { * @param WP_REST_Response $response The response object. * @param WC_Data $object Object data. * @param WP_REST_Request $request Request object. + * + * @since 4.5.0 */ return apply_filters( "woocommerce_rest_prepare_{$this->post_type}_object", $response, $object, $request ); } @@ -594,7 +600,7 @@ class WC_REST_Orders_V2_Controller extends WC_REST_CRUD_Controller { } // Search. - if ( ! empty( $args['s'] ) ) { + if ( ! OrderUtil::custom_orders_table_usage_is_enabled() && ! empty( $args['s'] ) ) { $order_ids = wc_order_search( $args['s'] ); if ( ! empty( $order_ids ) ) { @@ -610,6 +616,8 @@ class WC_REST_Orders_V2_Controller extends WC_REST_CRUD_Controller { * * @param array $args Key value array of query var to query value. * @param WP_REST_Request $request The request used. + * + * @since 4.5.0. */ $args = apply_filters( 'woocommerce_rest_orders_prepare_object_query', $args, $request ); @@ -693,6 +701,8 @@ class WC_REST_Orders_V2_Controller extends WC_REST_CRUD_Controller { * @param WC_Data $order Object object. * @param WP_REST_Request $request Request object. * @param bool $creating If is creating a new object. + * + * @since 4.5.0. */ return apply_filters( "woocommerce_rest_pre_insert_{$this->post_type}_object", $order, $request, $creating ); } @@ -979,6 +989,14 @@ class WC_REST_Orders_V2_Controller extends WC_REST_CRUD_Controller { // Prepare item data. $item = $this->$method( $posted, $action, $item ); + /** + * Allow extensions be notified before the item before is saved. + * + * @param WC_Order_Item $item The item object. + * @param array $posted The item data. + * + * @since 4.5.0. + */ do_action( 'woocommerce_rest_set_order_item', $item, $posted ); // If creating the order, add the item to it. @@ -1982,4 +2000,33 @@ class WC_REST_Orders_V2_Controller extends WC_REST_CRUD_Controller { return $params; } + + /** + * Get objects. + * + * @param array $query_args Query args. + * @return array + */ + protected function get_objects( $query_args ) { + // Do not use WC_Order_Query for the CPT datastore. + if ( ! OrderUtil::custom_orders_table_usage_is_enabled() ) { + return parent::get_objects( $query_args ); + } + + $query = new \WC_Order_Query( + array_merge( + $query_args, + array( + 'paginate' => true, + ) + ) + ); + $results = $query->get_orders(); + + return array( + 'objects' => $results->orders, + 'total' => $results->total, + 'pages' => $results->max_num_pages, + ); + } } diff --git a/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-customers-controller.php b/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-customers-controller.php index 217aef00b6e..ceb6f302a08 100644 --- a/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-customers-controller.php +++ b/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-customers-controller.php @@ -34,34 +34,7 @@ class WC_REST_Customers_Controller extends WC_REST_Customers_V2_Controller { * @return array */ protected function get_formatted_item_data( $object ) { - $data = $object->get_data(); - $format_date = array( 'date_created', 'date_modified' ); - - // Format date values. - foreach ( $format_date as $key ) { - // Date created is stored UTC, date modified is stored WP local time. - $datetime = 'date_created' === $key ? get_date_from_gmt( gmdate( 'Y-m-d H:i:s', $data[ $key ]->getTimestamp() ) ) : $data[ $key ]; - $data[ $key ] = wc_rest_prepare_date_response( $datetime, false ); - $data[ $key . '_gmt' ] = wc_rest_prepare_date_response( $datetime ); - } - - return array( - 'id' => $object->get_id(), - 'date_created' => $data['date_created'], - 'date_created_gmt' => $data['date_created_gmt'], - 'date_modified' => $data['date_modified'], - 'date_modified_gmt' => $data['date_modified_gmt'], - 'email' => $data['email'], - 'first_name' => $data['first_name'], - 'last_name' => $data['last_name'], - 'role' => $data['role'], - 'username' => $data['username'], - 'billing' => $data['billing'], - 'shipping' => $data['shipping'], - 'is_paying_customer' => $data['is_paying_customer'], - 'avatar_url' => $object->get_avatar_url(), - 'meta_data' => $data['meta_data'], - ); + return $this->get_formatted_item_data_core( $object ); } /** diff --git a/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-orders-controller.php b/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-orders-controller.php index 1da530b5b39..b594de2284f 100644 --- a/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-orders-controller.php +++ b/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-orders-controller.php @@ -158,6 +158,8 @@ class WC_REST_Orders_Controller extends WC_REST_Orders_V2_Controller { * The dynamic portion of the hook name, `$this->post_type`, * refers to the object type slug. * + * @since 7.4.0 + * * @param WC_Data $order Object object. * @param WP_REST_Request $request Request object. * @param bool $creating If is creating a new object. @@ -244,7 +246,7 @@ class WC_REST_Orders_Controller extends WC_REST_Orders_V2_Controller { $cpt_hidden_keys = array(); if ( OrderUtil::custom_orders_table_usage_is_enabled() ) { - $cpt_hidden_keys = (new \WC_Order_Data_Store_CPT())->get_internal_meta_keys(); + $cpt_hidden_keys = ( new \WC_Order_Data_Store_CPT() )->get_internal_meta_keys(); } // XXX: This might be removed once we finalize the design for internal keys vs meta vs props in COT. @@ -279,7 +281,7 @@ class WC_REST_Orders_Controller extends WC_REST_Orders_V2_Controller { ? $request['customer'] : null; - if ( $cot_customer ) { + if ( ! is_null( $cot_customer ) ) { unset( $request['customer'] ); } @@ -310,35 +312,6 @@ class WC_REST_Orders_Controller extends WC_REST_Orders_V2_Controller { return $args; } - /** - * Get objects. - * - * @param array $query_args Query args. - * @return array - */ - protected function get_objects( $query_args ) { - // Do not use WC_Order_Query for the CPT datastore. - if ( ! OrderUtil::custom_orders_table_usage_is_enabled() ) { - return parent::get_objects( $query_args ); - } - - $query = new \WC_Order_Query( - array_merge( - $query_args, - array( - 'paginate' => true, - ) - ) - ); - $results = $query->get_orders(); - - return array( - 'objects' => $results->orders, - 'total' => $results->total, - 'pages' => $results->max_num_pages, - ); - } - /** * Get the Order's schema, conforming to JSON Schema. * diff --git a/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-product-variations-controller.php b/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-product-variations-controller.php index 8c025b89a53..da5ba612522 100644 --- a/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-product-variations-controller.php +++ b/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-product-variations-controller.php @@ -809,6 +809,22 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Product_Variations_V // Set post_status. $args['post_status'] = $request['status']; + // Filter by local attributes. + if ( ! empty( $request['local_attributes'] ) && is_array( $request['local_attributes'] ) ) { + foreach ( $request['local_attributes'] as $attribute ) { + if ( ! isset( $attribute['attribute'] ) || ! isset( $attribute['term'] ) ) { + continue; + } + $args['meta_query'] = $this->add_meta_query( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query + $args, + array( + 'key' => 'attribute_' . $attribute['attribute'], + 'value' => $attribute['term'], + ) + ); + } + } + // Filter by sku. if ( ! empty( $request['sku'] ) ) { $skus = explode( ',', $request['sku'] ); diff --git a/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-products-controller.php b/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-products-controller.php index 3c7b79b7d66..2cc6137d064 100644 --- a/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-products-controller.php +++ b/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-products-controller.php @@ -867,7 +867,7 @@ class WC_REST_Products_Controller extends WC_REST_Products_V2_Controller { 'description' => __( 'Product status (post status).', 'woocommerce' ), 'type' => 'string', 'default' => 'publish', - 'enum' => array_merge( array_keys( get_post_statuses() ), array( 'future' ) ), + 'enum' => array_merge( array_keys( get_post_statuses() ), array( 'future', 'auto-draft', 'trash' ) ), 'context' => array( 'view', 'edit' ), ), 'featured' => array( diff --git a/plugins/woocommerce/includes/wc-order-functions.php b/plugins/woocommerce/includes/wc-order-functions.php index 7a40e589768..a385c21d5f2 100644 --- a/plugins/woocommerce/includes/wc-order-functions.php +++ b/plugins/woocommerce/includes/wc-order-functions.php @@ -98,7 +98,7 @@ function wc_get_order_statuses() { 'wc-processing' => _x( 'Processing', 'Order status', 'woocommerce' ), 'wc-on-hold' => _x( 'On hold', 'Order status', 'woocommerce' ), 'wc-completed' => _x( 'Completed', 'Order status', 'woocommerce' ), - 'wc-cancelled' => _x( 'Cancelled', 'Order status', 'woocommerce' ), + 'wc-cancelled' => _x( 'Canceled', 'Order status', 'woocommerce' ), 'wc-refunded' => _x( 'Refunded', 'Order status', 'woocommerce' ), 'wc-failed' => _x( 'Failed', 'Order status', 'woocommerce' ), ); diff --git a/plugins/woocommerce/package.json b/plugins/woocommerce/package.json index 6a43466b9b7..08578cd8252 100644 --- a/plugins/woocommerce/package.json +++ b/plugins/woocommerce/package.json @@ -108,5 +108,8 @@ "> 0.1%", "ie 8", "ie 9" - ] + ], + "dependencies": { + "@wordpress/browserslist-config": "^5.7.0" + } } diff --git a/plugins/woocommerce/readme.txt b/plugins/woocommerce/readme.txt index 3e6e005e4a7..fbf8438d6d9 100644 --- a/plugins/woocommerce/readme.txt +++ b/plugins/woocommerce/readme.txt @@ -4,7 +4,7 @@ Tags: online store, ecommerce, shop, shopping cart, sell online, storefront, che Requires at least: 5.9 Tested up to: 6.1 Requires PHP: 7.2 -Stable tag: 7.1.1 +Stable tag: 7.2.3 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/plugins/woocommerce/src/Admin/API/Init.php b/plugins/woocommerce/src/Admin/API/Init.php index 625374b2683..78b7d8df9d6 100644 --- a/plugins/woocommerce/src/Admin/API/Init.php +++ b/plugins/woocommerce/src/Admin/API/Init.php @@ -92,6 +92,11 @@ class Init { 'Automattic\WooCommerce\Admin\API\MobileAppMagicLink', ); + $product_form_controllers = array(); + if ( Features::is_enabled( 'new-product-management-experience' ) ) { + $product_form_controllers[] = 'Automattic\WooCommerce\Admin\API\ProductForm'; + } + if ( Features::is_enabled( 'analytics' ) ) { $analytics_controllers = array( 'Automattic\WooCommerce\Admin\API\Customers', @@ -122,9 +127,15 @@ class Init { // The performance indicators controller must be registered last, after other /stats endpoints have been registered. $analytics_controllers[] = 'Automattic\WooCommerce\Admin\API\Reports\PerformanceIndicators\Controller'; - $controllers = array_merge( $controllers, $analytics_controllers ); + $controllers = array_merge( $controllers, $analytics_controllers, $product_form_controllers ); } + /** + * Filter for the WooCommerce Admin REST controllers. + * + * @since 3.5.0 + * @param array $controllers List of rest API controllers. + */ $controllers = apply_filters( 'woocommerce_admin_rest_controllers', $controllers ); foreach ( $controllers as $controller ) { diff --git a/plugins/woocommerce/src/Admin/API/ProductForm.php b/plugins/woocommerce/src/Admin/API/ProductForm.php new file mode 100644 index 00000000000..9d2603be4cb --- /dev/null +++ b/plugins/woocommerce/src/Admin/API/ProductForm.php @@ -0,0 +1,130 @@ +namespace, + '/' . $this->rest_base, + array( + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => array( $this, 'get_form_config' ), + 'permission_callback' => array( $this, 'get_product_form_permission_check' ), + ), + 'schema' => array( $this, 'get_public_item_schema' ), + ) + ); + register_rest_route( + $this->namespace, + '/' . $this->rest_base . '/fields', + array( + array( + 'methods' => \WP_REST_Server::READABLE, + 'callback' => array( $this, 'get_fields' ), + 'permission_callback' => array( $this, 'get_product_form_permission_check' ), + ), + 'schema' => array( $this, 'get_public_item_schema' ), + ) + ); + } + + /** + * Check if a given request has access to manage woocommerce. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function get_product_form_permission_check( $request ) { + if ( ! current_user_can( 'manage_woocommerce' ) ) { + return new \WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to retrieve product form data.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); + } + + return true; + } + + /** + * Get the form fields. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_fields( $request ) { + $json = array_map( + function( $field ) { + return $field->get_json(); + }, + FormFactory::get_fields() + ); + + return rest_ensure_response( $json ); + } + + /** + * Get the form config. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_form_config( $request ) { + $fields = array_map( + function( $field ) { + return $field->get_json(); + }, + FormFactory::get_fields() + ); + $subsections = array_map( + function( $subsection ) { + return $subsection->get_json(); + }, + FormFactory::get_subsections() + ); + $sections = array_map( + function( $section ) { + return $section->get_json(); + }, + FormFactory::get_sections() + ); + + return rest_ensure_response( + array( + 'fields' => $fields, + 'subsections' => $subsections, + 'sections' => $sections, + ) + ); + } +} diff --git a/plugins/woocommerce/src/Admin/Features/Features.php b/plugins/woocommerce/src/Admin/Features/Features.php index ab3ae7e7f46..b6aecbc68c8 100644 --- a/plugins/woocommerce/src/Admin/Features/Features.php +++ b/plugins/woocommerce/src/Admin/Features/Features.php @@ -26,11 +26,12 @@ class Features { * @var array */ protected static $optional_features = array( - 'multichannel-marketing' => array( 'default' => 'no' ), - 'navigation' => array( 'default' => 'no' ), - 'settings' => array( 'default' => 'no' ), - 'analytics' => array( 'default' => 'yes' ), - 'remote-inbox-notifications' => array( 'default' => 'yes' ), + 'multichannel-marketing' => array( 'default' => 'no' ), + 'navigation' => array( 'default' => 'no' ), + 'settings' => array( 'default' => 'no' ), + 'new-product-management-experience' => array( 'default' => 'no' ), + 'analytics' => array( 'default' => 'yes' ), + 'remote-inbox-notifications' => array( 'default' => 'yes' ), ); /** @@ -41,6 +42,7 @@ class Features { protected static $beta_features = array( 'multichannel-marketing', 'navigation', + 'new-product-management-experience', 'settings', ); diff --git a/plugins/woocommerce/src/Admin/Features/NewProductManagementExperience.php b/plugins/woocommerce/src/Admin/Features/NewProductManagementExperience.php index cb27b95b337..8480f1b0be9 100644 --- a/plugins/woocommerce/src/Admin/Features/NewProductManagementExperience.php +++ b/plugins/woocommerce/src/Admin/Features/NewProductManagementExperience.php @@ -13,6 +13,11 @@ use \Automattic\WooCommerce\Internal\Admin\Loader; */ class NewProductManagementExperience { + /** + * Option name used to toggle this feature. + */ + const TOGGLE_OPTION_NAME = 'woocommerce_new_product_management_enabled'; + /** * Constructor */ diff --git a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskLists.php b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskLists.php index ab81e5c0983..b374bd9d760 100644 --- a/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskLists.php +++ b/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskLists.php @@ -288,10 +288,11 @@ class TaskLists { * Add task to a given task list. * * @param string $list_id List ID to add the task to. - * @param array $args Task properties. + * @param Task $task Task object. + * * @return \WP_Error|Task */ - public static function add_task( $list_id, $args ) { + public static function add_task( $list_id, $task ) { if ( ! isset( self::$lists[ $list_id ] ) ) { return new \WP_Error( 'woocommerce_task_list_invalid_list', @@ -299,7 +300,7 @@ class TaskLists { ); } - self::$lists[ $list_id ]->add_task( $args ); + self::$lists[ $list_id ]->add_task( $task ); } /** diff --git a/plugins/woocommerce/src/Admin/ReportsSync.php b/plugins/woocommerce/src/Admin/ReportsSync.php index 8ab314d7f61..520470423fe 100644 --- a/plugins/woocommerce/src/Admin/ReportsSync.php +++ b/plugins/woocommerce/src/Admin/ReportsSync.php @@ -71,7 +71,7 @@ class ReportsSync { * Regenerate data for reports. * * @param int|bool $days Number of days to import. - * @param bool $skip_existing Skip exisiting records. + * @param bool $skip_existing Skip existing records. * @return string */ public static function regenerate_report_data( $days, $skip_existing ) { diff --git a/plugins/woocommerce/src/Internal/Admin/Orders/Edit.php b/plugins/woocommerce/src/Internal/Admin/Orders/Edit.php index b268779a2e1..c1df8e59130 100644 --- a/plugins/woocommerce/src/Internal/Admin/Orders/Edit.php +++ b/plugins/woocommerce/src/Internal/Admin/Orders/Edit.php @@ -33,6 +33,20 @@ class Edit { */ private $order; + /** + * Action name that the form is currently handling. Could be new_order or edit_order. + * + * @var string + */ + private $current_action; + + /** + * Message to be displayed to the user. Index of message from the messages array registered when declaring shop_order post type. + * + * @var int + */ + private $message; + /** * Hooks all meta-boxes for order edit page. This is static since this may be called by post edit form rendering. * @@ -89,6 +103,7 @@ class Edit { */ public function setup( \WC_Order $order ) { $this->order = $order; + $wc_screen_id = wc_get_page_screen_id( 'shop-order' ); $current_screen = get_current_screen(); $current_screen->is_block_editor( false ); $this->screen_id = $current_screen->id; @@ -107,10 +122,30 @@ class Edit { * * @since 3.8.0. */ - do_action( 'add_meta_boxes', wc_get_page_screen_id( 'shop-order' ), $this->order ); + do_action( 'add_meta_boxes', $wc_screen_id, $this->order ); + + /** + * Provides an opportunity to inject custom meta boxes into the order editor screen. This + * hook is an analog of `add_meta_boxes_` as provided by WordPress core. + * + * @since 7.4.0 + * + * @oaram WC_Order $order The order being edited. + */ + do_action( 'add_meta_boxes_' . $wc_screen_id, $this->order ); + $this->enqueue_scripts(); } + /** + * Set the current action for the form. + * + * @param string $action Action name. + */ + public function set_current_action( string $action ) { + $this->current_action = $action; + } + /** * Hooks meta box for order specific meta. */ @@ -151,6 +186,9 @@ class Edit { */ do_action( 'woocommerce_process_shop_order_meta', $this->order->get_id(), $this->order ); + // Order updated message. + $this->message = 1; + // Refresh the order from DB. $this->order = wc_get_order( $this->order->get_id() ); $theorder = $this->order; @@ -176,7 +214,39 @@ class Edit { * Render order edit page. */ public function display() { - $this->render_wrapper_start(); + /** + * This is used by the order edit page to show messages in the notice fields. + * It should be similar to post_updated_messages filter, i.e.: + * array( + * {order_type} => array( + * 1 => 'Order updated.', + * 2 => 'Custom field updated.', + * ... + * ). + * + * The index to be displayed is computed from the $_GET['message'] variable. + * + * @since 7.4.0. + */ + $messages = apply_filters( 'woocommerce_order_updated_messages', array() ); + + /** + * Backward compatibility for displaying messages using the post fields. + * + * @since 7.4.0. (Although available earlier by the posts based screen). + */ + $messages = apply_filters( 'post_updated_messages', $messages ); + + $message = $this->message; + if ( isset( $_GET['message'] ) ) { + $message = absint( $_GET['message'] ); + } + + if ( isset( $message ) ) { + $message = $messages[ $this->order->get_type() ][ $message ] ?? false; + } + + $this->render_wrapper_start( '', $message ); $this->render_meta_boxes(); $this->render_wrapper_end(); } @@ -198,10 +268,14 @@ class Edit { ?>

- labels->edit_item ); ?> + current_action ? esc_html( $post_type->labels->add_new_item ) : esc_html( $post_type->labels->edit_item ); + ?>

' . esc_html( $post_type->labels->add_new ) . ''; + if ( 'edit_order' === $this->current_action ) { + echo ' ' . esc_html( $post_type->labels->add_new ) . ''; + } ?>
diff --git a/plugins/woocommerce/src/Internal/Admin/Orders/ListTable.php b/plugins/woocommerce/src/Internal/Admin/Orders/ListTable.php index 6b548868c17..60af687f117 100644 --- a/plugins/woocommerce/src/Internal/Admin/Orders/ListTable.php +++ b/plugins/woocommerce/src/Internal/Admin/Orders/ListTable.php @@ -365,6 +365,8 @@ class ListTable extends WP_List_Table { $direction = strtoupper( sanitize_text_field( wp_unslash( $_GET['order'] ?? '' ) ) ); if ( ! in_array( $field, $sortable, true ) ) { + $this->order_query_args['orderby'] = 'id'; + $this->order_query_args['order'] = 'DESC'; return; } diff --git a/plugins/woocommerce/src/Internal/Admin/Orders/PageController.php b/plugins/woocommerce/src/Internal/Admin/Orders/PageController.php index 16558b2b831..b2e93628844 100644 --- a/plugins/woocommerce/src/Internal/Admin/Orders/PageController.php +++ b/plugins/woocommerce/src/Internal/Admin/Orders/PageController.php @@ -211,6 +211,7 @@ class PageController { $this->order_edit_form = new Edit(); $this->order_edit_form->setup( $this->order ); } + $this->order_edit_form->set_current_action( $this->current_action ); $this->order_edit_form->display(); break; case 'list_orders': @@ -285,7 +286,7 @@ class PageController { $this->order = new $order_class_name(); $this->order->set_object_read( false ); - $this->order->set_status( 'auto-draft' ); + $this->order->set_status( 'pending' ); $this->order->save(); $theorder = $this->order; diff --git a/plugins/woocommerce/src/Internal/Admin/ProductForm/Component.php b/plugins/woocommerce/src/Internal/Admin/ProductForm/Component.php new file mode 100644 index 00000000000..421b663dc30 --- /dev/null +++ b/plugins/woocommerce/src/Internal/Admin/ProductForm/Component.php @@ -0,0 +1,114 @@ +id = $id; + $this->plugin_id = $plugin_id; + $this->additional_args = $additional_args; + } + + /** + * Component arguments. + * + * @return array + */ + public function get_additional_args() { + return $this->additional_args; + } + + /** + * Component arguments. + * + * @param string $key key of argument. + * @return mixed + */ + public function get_additional_argument( $key ) { + return self::get_argument_from_path( $this->additional_args, $key ); + } + + /** + * Get the component as JSON. + * + * @return array + */ + public function get_json() { + return array_merge( + array( + 'id' => $this->get_id(), + 'plugin_id' => $this->get_plugin_id(), + ), + $this->get_additional_args() + ); + } + + /** + * Sorting function for product form component. + * + * @param Component $a Component a. + * @param Component $b Component b. + * @param array $sort_by key and order to sort by. + * @return int + */ + public static function sort( $a, $b, $sort_by = array() ) { + $key = $sort_by['key']; + $a_val = $a->get_additional_argument( $key ); + $b_val = $b->get_additional_argument( $key ); + if ( 'asc' === $sort_by['order'] ) { + return $a_val <=> $b_val; + } else { + return $b_val <=> $a_val; + } + } + + /** + * Gets argument by dot notation path. + * + * @param array $arguments Arguments array. + * @param string $path Path for argument key. + * @param string $delimiter Path delimiter, default: '.'. + * @return mixed|null + */ + public static function get_argument_from_path( $arguments, $path, $delimiter = '.' ) { + $path_keys = explode( $delimiter, $path ); + $num_keys = count( $path_keys ); + + $val = $arguments; + for ( $i = 0; $i < $num_keys; $i++ ) { + $key = $path_keys[ $i ]; + if ( array_key_exists( $key, $val ) ) { + $val = $val[ $key ]; + } else { + $val = null; + break; + } + } + return $val; + } +} diff --git a/plugins/woocommerce/src/Internal/Admin/ProductForm/ComponentTrait.php b/plugins/woocommerce/src/Internal/Admin/ProductForm/ComponentTrait.php new file mode 100644 index 00000000000..ce2d75eada5 --- /dev/null +++ b/plugins/woocommerce/src/Internal/Admin/ProductForm/ComponentTrait.php @@ -0,0 +1,59 @@ +id; + } + + /** + * Return plugin id. + * + * @return string + */ + public function get_plugin_id() { + return $this->plugin_id; + } +} diff --git a/plugins/woocommerce/src/Internal/Admin/ProductForm/Field.php b/plugins/woocommerce/src/Internal/Admin/ProductForm/Field.php new file mode 100644 index 00000000000..0f471d67832 --- /dev/null +++ b/plugins/woocommerce/src/Internal/Admin/ProductForm/Field.php @@ -0,0 +1,77 @@ + (string) Field type. Required. + * 'section' => (string) Field location. Required. + * 'order' => (int) Field order. + * 'properties' => (array) Field properties. + * ). + * @throws \Exception If there are missing arguments. + */ + public function __construct( $id, $plugin_id, $additional_args ) { + parent::__construct( $id, $plugin_id, $additional_args ); + + $missing_arguments = self::get_missing_arguments( $additional_args ); + if ( count( $missing_arguments ) > 0 ) { + throw new \Exception( + sprintf( + /* translators: 1: Missing arguments list. */ + esc_html__( 'You are missing required arguments of WooCommerce ProductForm Field: %1$s', 'woocommerce' ), + join( ', ', $missing_arguments ) + ) + ); + } + $this->type = $additional_args['type']; + } + + /** + * Get missing arguments of args array. + * + * @param array $args field arguments. + * @return array + */ + public static function get_missing_arguments( $args ) { + return array_values( + array_filter( + self::REQUIRED_ARGUMENTS, + function( $arg_key ) use ( $args ) { + return null === self::get_argument_from_path( $args, $arg_key ); + } + ) + ); + } +} diff --git a/plugins/woocommerce/src/Internal/Admin/ProductForm/FormFactory.php b/plugins/woocommerce/src/Internal/Admin/ProductForm/FormFactory.php new file mode 100644 index 00000000000..e42fd2991d6 --- /dev/null +++ b/plugins/woocommerce/src/Internal/Admin/ProductForm/FormFactory.php @@ -0,0 +1,264 @@ + (string) Field type. Required. + * 'section' => (string) Field location. Required. + * 'order' => (int) Field order. + * 'properties' => (array) Field properties. + * 'name' => (string) Field name. + * ). + * @return Field|WP_Error New field or WP_Error. + */ + public static function add_field( $id, $plugin_id, $args ) { + $new_field = self::create_item( 'field', 'Field', $id, $plugin_id, $args ); + if ( is_wp_error( $new_field ) ) { + return $new_field; + } + self::$form_fields[ $id ] = $new_field; + return $new_field; + } + + /** + * Adds a Subsection to the product form. + * + * @param string $id Subsection id. + * @param string $plugin_id Plugin id. + * @param array $args Array containing the necessary arguments. + * @return Card|WP_Error New subsection or WP_Error. + */ + public static function add_subsection( $id, $plugin_id, $args = array() ) { + $new_subsection = self::create_item( 'subsection', 'Subsection', $id, $plugin_id, $args ); + if ( is_wp_error( $new_subsection ) ) { + return $new_subsection; + } + self::$form_subsections[ $id ] = $new_subsection; + return $new_subsection; + } + + /** + * Adds a section to the product form. + * + * @param string $id Card id. + * @param string $plugin_id Plugin id. + * @param array $args Array containing the necessary arguments. + * @return Card|WP_Error New section or WP_Error. + */ + public static function add_section( $id, $plugin_id, $args ) { + $new_section = self::create_item( 'section', 'Section', $id, $plugin_id, $args ); + if ( is_wp_error( $new_section ) ) { + return $new_section; + } + self::$form_sections[ $id ] = $new_section; + return $new_section; + } + + /** + * Returns form config. + * + * @return array form config. + */ + public static function get_form_config() { + return array( + 'fields' => self::get_fields(), + 'cards' => self::get_cards(), + 'sections' => self::get_sections(), + ); + } + + /** + * Returns list of registered fields. + * + * @param array $sort_by key and order to sort by. + * @return array list of registered fields. + */ + public static function get_fields( $sort_by = array( + 'key' => 'order', + 'order' => 'asc', + ) ) { + return self::get_items( 'field', 'Field', $sort_by ); + } + + /** + * Returns list of registered cards. + * + * @param array $sort_by key and order to sort by. + * @return array list of registered cards. + */ + public static function get_subsections( $sort_by = array( + 'key' => 'order', + 'order' => 'asc', + ) ) { + return self::get_items( 'subsection', 'Subsection', $sort_by ); + } + + /** + * Returns list of registered sections. + * + * @param array $sort_by key and order to sort by. + * @return array list of registered sections. + */ + public static function get_sections( $sort_by = array( + 'key' => 'order', + 'order' => 'asc', + ) ) { + return self::get_items( 'section', 'Section', $sort_by ); + } + + /** + * Returns list of registered items. + * + * @param string $type Form component type. + * @return array List of registered items. + */ + private static function get_item_list( $type ) { + $mapping = array( + 'field' => self::$form_fields, + 'subsection' => self::$form_subsections, + 'section' => self::$form_sections, + ); + if ( array_key_exists( $type, $mapping ) ) { + return $mapping[ $type ]; + } + return array(); + } + + /** + * Returns list of registered items. + * + * @param string $type Form component type. + * @param class-string $class_name Class of component type. + * @param array $sort_by key and order to sort by. + * @return array list of registered items. + */ + private static function get_items( $type, $class_name, $sort_by = array( + 'key' => 'order', + 'order' => 'asc', + ) ) { + $item_list = self::get_item_list( $type ); + $class = 'Automattic\\WooCommerce\\Internal\\Admin\\ProductForm\\' . $class_name; + $items = array_values( $item_list ); + if ( class_exists( $class ) && method_exists( $class, 'sort' ) ) { + usort( + $items, + function ( $a, $b ) use ( $sort_by, $class ) { + return $class::sort( $a, $b, $sort_by ); + } + ); + } + return $items; + } + + /** + * Creates a new item. + * + * @param string $type Form component type. + * @param class-string $class_name Class of component type. + * @param string $id Item id. + * @param string $plugin_id Plugin id. + * @param array $args additional arguments for item. + * @return Field|Card|Section|WP_Error New product form item or WP_Error. + */ + private static function create_item( $type, $class_name, $id, $plugin_id, $args ) { + $item_list = self::get_item_list( $type ); + $class = 'Automattic\\WooCommerce\\Internal\\Admin\\ProductForm\\' . $class_name; + if ( ! class_exists( $class ) ) { + return new WP_Error( + 'wc_product_form_' . $type . '_missing_form_class', + sprintf( + /* translators: 1: missing class name. */ + esc_html__( '%1$s class does not exist.', 'woocommerce' ), + $class + ) + ); + } + if ( isset( $item_list[ $id ] ) ) { + return new WP_Error( + 'wc_product_form_' . $type . '_duplicate_field_id', + sprintf( + /* translators: 1: Item type 2: Duplicate registered item id. */ + esc_html__( 'You have attempted to register a duplicate form %1$s with WooCommerce Form: %2$s', 'woocommerce' ), + $type, + '`' . $id . '`' + ) + ); + } + + $defaults = array( + 'order' => 20, + ); + + $item_arguments = wp_parse_args( $args, $defaults ); + + try { + return new $class( $id, $plugin_id, $item_arguments ); + } catch ( \Exception $e ) { + return new WP_Error( + 'wc_product_form_' . $type . '_class_creation', + $e->getMessage() + ); + } + } +} + diff --git a/plugins/woocommerce/src/Internal/Admin/ProductForm/README.md b/plugins/woocommerce/src/Internal/Admin/ProductForm/README.md new file mode 100644 index 00000000000..058f995de8d --- /dev/null +++ b/plugins/woocommerce/src/Internal/Admin/ProductForm/README.md @@ -0,0 +1,26 @@ +# Product Form + +This folder contains helper classes to specifically extend the WooCommerce Admin product form. +This will primarily be done through the `Form` class, under the `Automattic\WooCommerce\Internal\Admin\ProductForm` namespace. + +## Ex - Adding a new field: + +```php +function add_product_form_field() { + if ( + ! method_exists( '\Automattic\WooCommerce\Internal\Admin\ProductForm\FormFactory', 'add_field' ) + ) { + return; + } + + \Automattic\WooCommerce\Internal\Admin\ProductForm\FormFactory::add_field( + 'test_new_field', + 'woocommerce-plugin-name', + array( + 'type' => 'text', + 'location' => 'plugin-details', + ) + ); +} +add_filter( 'admin_init', 'add_product_form_field' ); +``` diff --git a/plugins/woocommerce/src/Internal/Admin/ProductForm/Section.php b/plugins/woocommerce/src/Internal/Admin/ProductForm/Section.php new file mode 100644 index 00000000000..049be3f4ef4 --- /dev/null +++ b/plugins/woocommerce/src/Internal/Admin/ProductForm/Section.php @@ -0,0 +1,93 @@ + (int) Section order. + * 'title' => (string) Section description. + * 'description' => (string) Section description. + * ). + * @throws \Exception If there are missing arguments. + */ + public function __construct( $id, $plugin_id, $additional_args ) { + parent::__construct( $id, $plugin_id, $additional_args ); + + $missing_arguments = self::get_missing_arguments( $additional_args ); + if ( count( $missing_arguments ) > 0 ) { + throw new \Exception( + sprintf( + /* translators: 1: Missing arguments list. */ + esc_html__( 'You are missing required arguments of WooCommerce ProductForm Section: %1$s', 'woocommerce' ), + join( ', ', $missing_arguments ) + ) + ); + } + $this->title = $additional_args['title']; + } + + /** + * Field arguments. + * + * @return array + */ + public function get_arguments() { + return $this->additional_args; + } + + /** + * Get the section as JSON. + * + * @return array + */ + public function get_json() { + return array( + 'id' => $this->get_id(), + 'plugin_id' => $this->get_plugin_id(), + 'arguments' => $this->get_arguments(), + ); + } + + /** + * Get missing arguments of args array. + * + * @param array $args section arguments. + * @return array + */ + public static function get_missing_arguments( $args ) { + return array_filter( + self::REQUIRED_ARGUMENTS, + function( $arg_key ) use ( $args ) { + return null === self::get_argument_from_path( $args, $arg_key ); + } + ); + } +} diff --git a/plugins/woocommerce/src/Internal/Admin/ProductForm/Subsection.php b/plugins/woocommerce/src/Internal/Admin/ProductForm/Subsection.php new file mode 100644 index 00000000000..05a857f0876 --- /dev/null +++ b/plugins/woocommerce/src/Internal/Admin/ProductForm/Subsection.php @@ -0,0 +1,11 @@ +upshift_child_orders( $order ); $this->delete_order_data_from_custom_order_tables( $order_id ); + $order->set_id( 0 ); // If this datastore method is called while the posts table is authoritative, refrain from deleting post data. @@ -1796,10 +1793,31 @@ FROM $order_meta_table } } + /** + * Helper method to set child orders to the parent order's parent. + * + * @param \WC_Abstract_Order $order Order object. + * + * @return void + */ + private function upshift_child_orders( $order ) { + global $wpdb; + $order_table = self::get_orders_table_name(); + $order_parent = $order->get_parent_id(); + $wpdb->update( + $order_table, + array( 'parent_order_id' => $order_parent ), + array( 'parent_order_id' => $order->get_id() ), + array( '%d' ), + array( '%d' ) + ); + } + /** * Trashes an order. * - * @param WC_Order $order The order object + * @param WC_Order $order The order object. + * * @return void */ public function trash_order( $order ) { @@ -1919,9 +1937,9 @@ FROM $order_meta_table $data_synchronizer = wc_get_container()->get( DataSynchronizer::class ); if ( $data_synchronizer->data_sync_is_enabled() ) { - //The previous $order->save() will have forced a sync to the posts table, - //this implies that the post status is not "trash" anymore, and thus - //wp_untrash_post would do nothing. + // The previous $order->save() will have forced a sync to the posts table, + // this implies that the post status is not "trash" anymore, and thus + // wp_untrash_post would do nothing. wp_update_post( array( 'ID' => $id, @@ -1998,6 +2016,8 @@ FROM $order_meta_table * This should not contain and specific meta or actions, so that it can be used other order types safely. * * @param \WC_Order $order Order object. + * @param bool $force_all_fields Force update all fields, instead of calculating and updating only changed fields. + * @param bool $backfill Whether to backfill data to post datastore. * * @return void * @@ -2027,7 +2047,7 @@ FROM $order_meta_table /** * Method to update an order in the database. * - * @param \WC_Order $order + * @param \WC_Order $order Order object. */ public function update( &$order ) { // Before updating, ensure date paid is set if missing. @@ -2083,6 +2103,7 @@ FROM $order_meta_table * This is expected to be reused by other order types, and should not contain any specific metadata updates or actions. * * @param \WC_Order $order Order object. + * @param bool $backfill Whether to backfill data to post tables. * * @return array $changes Array of changes. * @@ -2135,7 +2156,8 @@ FROM $order_meta_table /** * Helper function to update billing and shipping address metadata. - * @param \WC_Abstract_Order $order Order Object + * + * @param \WC_Abstract_Order $order Order Object. * @param array $changes Array of changes. * * @return void @@ -2234,6 +2256,13 @@ FROM $order_meta_table } + /** + * Performs actual query to get orders. Uses `OrdersTableQuery` to build and generate the query. + * + * @param array $query_vars Query variables. + * + * @return array|object List of orders and count of orders. + */ public function query( $query_vars ) { if ( ! isset( $query_vars['paginate'] ) || ! $query_vars['paginate'] ) { $query_vars['no_found_rows'] = true; @@ -2282,10 +2311,6 @@ FROM $order_meta_table return $orders; } - public function get_order_item_type( $order, $order_item_id ) { - return 'line_item'; - } - //phpcs:enable Squiz.Commenting, Generic.Commenting /** diff --git a/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableMetaQuery.php b/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableMetaQuery.php index f3add477193..5c5482f92b7 100644 --- a/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableMetaQuery.php +++ b/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableMetaQuery.php @@ -73,6 +73,13 @@ class OrdersTableMetaQuery { */ private $queries = array(); + /** + * Flat list of clauses by name. + * + * @var array + */ + private $flattened_clauses = array(); + /** * JOIN clauses to add to the main SQL query. * @@ -129,6 +136,73 @@ class OrdersTableMetaQuery { ); } + /** + * Returns a list of names (corresponding to meta_query clauses) that can be used as an 'orderby' arg. + * + * @since 7.4 + * + * @return array + */ + public function get_orderby_keys(): array { + if ( ! $this->flattened_clauses ) { + return array(); + } + + $keys = array(); + $keys[] = 'meta_value'; + $keys[] = 'meta_value_num'; + + $first_clause = reset( $this->flattened_clauses ); + if ( $first_clause && ! empty( $first_clause['key'] ) ) { + $keys[] = $first_clause['key']; + } + + $keys = array_merge( + $keys, + array_keys( $this->flattened_clauses ) + ); + + return $keys; + } + + /** + * Returns an SQL fragment for the given meta_query key that can be used in an ORDER BY clause. + * Call {@see 'get_orderby_keys'} to obtain a list of valid keys. + * + * @since 7.4 + * + * @param string $key The key name. + * @return string + * + * @throws \Exception When an invalid key is passed. + */ + public function get_orderby_clause_for_key( string $key ): string { + $clause = false; + + if ( isset( $this->flattened_clauses[ $key ] ) ) { + $clause = $this->flattened_clauses[ $key ]; + } else { + $first_clause = reset( $this->flattened_clauses ); + + if ( $first_clause && ! empty( $first_clause['key'] ) ) { + if ( 'meta_value_num' === $key ) { + return "{$first_clause['alias']}.meta_value+0"; + } + + if ( 'meta_value' === $key || $first_clause['key'] === $key ) { + $clause = $first_clause; + } + } + } + + if ( ! $clause ) { + // translators: %s is a meta_query key. + throw new \Exception( sprintf( __( 'Invalid meta_query clause key: %s.', 'woocommerce' ), $key ) ); + } + + return "CAST({$clause['alias']}.meta_value AS {$clause['cast']})"; + } + /** * Checks whether a given meta_query clause is atomic or not (i.e. not nested). * @@ -158,8 +232,8 @@ class OrdersTableMetaQuery { unset( $arg['value'] ); } - $arg['compare'] = isset( $arg['compare'] ) ? strtoupper( $arg['compare'] ) : ( isset( $arg['value'] ) && is_array( $arg['value'] ) ? 'IN' : '=' ); - $arg['compare_key'] = isset( $arg['compare_key'] ) ? strtoupper( $arg['compare_key'] ) : ( isset( $arg['key'] ) && is_array( $arg['key'] ) ? 'IN' : '=' ); + $arg['compare'] = isset( $arg['compare'] ) ? strtoupper( $arg['compare'] ) : ( isset( $arg['value'] ) && is_array( $arg['value'] ) ? 'IN' : '=' ); + $arg['compare_key'] = isset( $arg['compare_key'] ) ? strtoupper( $arg['compare_key'] ) : ( isset( $arg['key'] ) && is_array( $arg['key'] ) ? 'IN' : '=' ); if ( ! in_array( $arg['compare'], self::NON_NUMERIC_OPERATORS, true ) && ! in_array( $arg['compare'], self::NUMERIC_OPERATORS, true ) ) { $arg['compare'] = '='; @@ -169,7 +243,8 @@ class OrdersTableMetaQuery { $arg['compare_key'] = '='; } - $sanitized[ $key ] = $arg; + $sanitized[ $key ] = $arg; + $sanitized[ $key ]['index'] = $key; } else { $sanitized_arg = $this->sanitize_meta_query( $arg ); @@ -298,12 +373,24 @@ class OrdersTableMetaQuery { $this->generate_where_for_clause_value( $arg ), ) ); + + // Store clauses by their key for ORDER BY purposes. + $flat_clause_key = is_int( $arg['index'] ) ? $arg['alias'] : $arg['index']; + + $unique_flat_key = $flat_clause_key; + $i = 1; + while ( isset( $this->flattened_clauses[ $unique_flat_key ] ) ) { + $unique_flat_key = $flat_clause_key . '-' . $i; + $i++; + } + + $this->flattened_clauses[ $unique_flat_key ] =& $arg; } else { // Nested. $relation = $arg['relation']; unset( $arg['relation'] ); - foreach ( $arg as $key => &$clause ) { + foreach ( $arg as $index => &$clause ) { $chunks[] = $this->process( $clause, $arg ); } diff --git a/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableQuery.php b/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableQuery.php index 8b71df2aed5..b6ff8f91be6 100644 --- a/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableQuery.php +++ b/plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableQuery.php @@ -509,15 +509,36 @@ class OrdersTableQuery { return; } - if ( is_string( $orderby ) ) { - $orderby = array( $orderby => $order ); + // No need to sanitize, will be processed in calling function. + if ( 'include' === $orderby || 'post__in' === $orderby ) { + return; } + if ( is_string( $orderby ) ) { + $orderby_fields = array_map( 'trim', explode( ' ', $orderby ) ); + $orderby = array(); + foreach ( $orderby_fields as $field ) { + $orderby[ $field ] = $order; + } + } + + $allowed_orderby = array_merge( + array_keys( $mapping ), + array_values( $mapping ), + $this->meta_query ? $this->meta_query->get_orderby_keys() : array() + ); + $this->args['orderby'] = array(); foreach ( $orderby as $order_key => $order ) { - if ( isset( $mapping[ $order_key ] ) ) { - $this->args['orderby'][ $mapping[ $order_key ] ] = $this->sanitize_order( $order ); + if ( ! in_array( $order_key, $allowed_orderby, true ) ) { + continue; } + + if ( isset( $mapping[ $order_key ] ) ) { + $order_key = $mapping[ $order_key ]; + } + + $this->args['orderby'][ $order_key ] = $this->sanitize_order( $order ); } } @@ -572,9 +593,6 @@ class OrdersTableQuery { $this->join = $sql['join'] ? array_merge( $this->join, $sql['join'] ) : $this->join; $this->where = $sql['where'] ? array_merge( $this->where, array( $sql['where'] ) ) : $this->where; - if ( $sql['join'] ) { - $this->groupby[] = "{$this->tables['orders']}.id"; - } } // Date queries. @@ -588,12 +606,10 @@ class OrdersTableQuery { $orders_table = $this->tables['orders']; - // SELECT [fields]. - $this->fields = "{$orders_table}.id"; - $fields = $this->fields; - - // SQL_CALC_FOUND_ROWS. - $found_rows = ''; + // Group by is a faster substitute for DISTINCT, as long as we are only selecting IDs. MySQL don't like it when we join tables and use DISTINCT. + $this->groupby[] = "{$this->tables['orders']}.id"; + $this->fields = "{$orders_table}.id"; + $fields = $this->fields; // JOIN. $join = implode( ' ', array_unique( array_filter( array_map( 'trim', $this->join ) ) ) ); @@ -619,7 +635,7 @@ class OrdersTableQuery { // GROUP BY. $groupby = $this->groupby ? 'GROUP BY ' . implode( ', ', (array) $this->groupby ) : ''; - $this->sql = "SELECT $found_rows DISTINCT $fields FROM $orders_table $join WHERE $where $groupby $orderby $limits"; + $this->sql = "SELECT $fields FROM $orders_table $join WHERE $where $groupby $orderby $limits"; $this->build_count_query( $fields, $join, $where, $groupby ); } @@ -636,7 +652,7 @@ class OrdersTableQuery { wc_doing_it_wrong( __FUNCTION__, 'Count query can only be build after main query is built.', '7.3.0' ); } $orders_table = $this->tables['orders']; - $this->count_sql = "SELECT COUNT(DISTINCT $fields) FROM $orders_table $join WHERE $where $groupby"; + $this->count_sql = "SELECT COUNT(DISTINCT $fields) FROM $orders_table $join WHERE $where"; } /** @@ -977,8 +993,24 @@ class OrdersTableQuery { return; } + if ( 'include' === $orderby || 'post__in' === $orderby ) { + $ids = $this->args['id'] ?? $this->args['includes']; + if ( empty( $ids ) ) { + return; + } + $ids = array_map( 'absint', $ids ); + $this->orderby = array( "FIELD( {$this->tables['orders']}.id, " . implode( ',', $ids ) . ' )' ); + return; + } + + $meta_orderby_keys = $this->meta_query ? $this->meta_query->get_orderby_keys() : array(); + $orderby_array = array(); foreach ( $this->args['orderby'] as $_orderby => $order ) { + if ( in_array( $_orderby, $meta_orderby_keys, true ) ) { + $_orderby = $this->meta_query->get_orderby_clause_for_key( $_orderby ); + } + $orderby_array[] = "{$_orderby} {$order}"; } diff --git a/plugins/woocommerce/src/Internal/Features/FeaturesController.php b/plugins/woocommerce/src/Internal/Features/FeaturesController.php index bf2622df5c2..5fe17a80970 100644 --- a/plugins/woocommerce/src/Internal/Features/FeaturesController.php +++ b/plugins/woocommerce/src/Internal/Features/FeaturesController.php @@ -8,6 +8,7 @@ namespace Automattic\WooCommerce\Internal\Features; use Automattic\Jetpack\Constants; use Automattic\WooCommerce\Internal\Admin\Analytics; use Automattic\WooCommerce\Admin\Features\Navigation\Init; +use Automattic\WooCommerce\Admin\Features\NewProductManagementExperience; use Automattic\WooCommerce\Internal\Traits\AccessiblePrivateMethods; use Automattic\WooCommerce\Proxies\LegacyProxy; use Automattic\WooCommerce\Utilities\ArrayUtil; @@ -89,25 +90,31 @@ class FeaturesController { */ public function __construct() { $features = array( - 'analytics' => array( + 'analytics' => array( 'name' => __( 'Analytics', 'woocommerce' ), 'description' => __( 'Enables WooCommerce Analytics', 'woocommerce' ), 'is_experimental' => false, 'enabled_by_default' => true, ), - 'new_navigation' => array( + 'new_navigation' => array( 'name' => __( 'Navigation', 'woocommerce' ), 'description' => __( 'Adds the new WooCommerce navigation experience to the dashboard', 'woocommerce' ), 'is_experimental' => false, ), - 'custom_order_tables' => array( + 'new_product_management' => array( + 'name' => __( 'New product editor', 'woocommerce' ), + 'description' => __( 'Try the new product editor (Beta)', 'woocommerce' ), + 'tooltip' => __( 'Enable to try the new, simplified product editor (currently in development and only available for simple products). No extension support yet.', 'woocommerce' ), + 'is_experimental' => false, + ), + 'custom_order_tables' => array( 'name' => __( 'High-Performance order storage (COT)', 'woocommerce' ), 'description' => __( 'Enable the high performance order storage feature.', 'woocommerce' ), 'is_experimental' => true, ), ); - $this->legacy_feature_ids = array( 'analytics', 'new_navigation' ); + $this->legacy_feature_ids = array( 'analytics', 'new_navigation', 'new_product_management' ); $this->init_features( $features ); @@ -393,6 +400,8 @@ class FeaturesController { return Analytics::TOGGLE_OPTION_NAME; } elseif ( 'new_navigation' === $feature_id ) { return Init::TOGGLE_OPTION_NAME; + } elseif ( 'new_product_management' === $feature_id ) { + return NewProductManagementExperience::TOGGLE_OPTION_NAME; } return "woocommerce_feature_${feature_id}_enabled"; @@ -450,7 +459,7 @@ class FeaturesController { $matches = array(); $success = preg_match( '/^woocommerce_feature_([a-zA-Z0-9_]+)_enabled$/', $option, $matches ); - if ( ! $success && Analytics::TOGGLE_OPTION_NAME !== $option && Init::TOGGLE_OPTION_NAME !== $option ) { + if ( ! $success && Analytics::TOGGLE_OPTION_NAME !== $option && Init::TOGGLE_OPTION_NAME !== $option && NewProductManagementExperience::TOGGLE_OPTION_NAME !== $option ) { return; } @@ -462,6 +471,8 @@ class FeaturesController { $feature_id = 'analytics'; } elseif ( Init::TOGGLE_OPTION_NAME === $option ) { $feature_id = 'new_navigation'; + } elseif ( NewProductManagementExperience::TOGGLE_OPTION_NAME === $option ) { + $feature_id = 'new_product_management'; } else { $feature_id = $matches[1]; } @@ -590,6 +601,7 @@ class FeaturesController { $description = $feature['description']; $disabled = false; $desc_tip = ''; + $tooltip = isset( $feature['tooltip'] ) ? $feature['tooltip'] : ''; if ( ( 'analytics' === $feature_id || 'new_navigation' === $feature_id ) && $admin_features_disabled ) { $disabled = true; @@ -675,6 +687,7 @@ class FeaturesController { 'id' => $this->feature_enable_option_name( $feature_id ), 'disabled' => $disabled && ! $this->force_allow_enabling_features, 'desc_tip' => $desc_tip, + 'tooltip' => $tooltip, 'default' => $this->feature_is_enabled_by_default( $feature_id ) ? 'yes' : 'no', ); } diff --git a/plugins/woocommerce/templates/cart/cart.php b/plugins/woocommerce/templates/cart/cart.php index ed571ab99ca..a8f8c22d83d 100644 --- a/plugins/woocommerce/templates/cart/cart.php +++ b/plugins/woocommerce/templates/cart/cart.php @@ -12,7 +12,7 @@ * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce\Templates - * @version 7.0.1 + * @version 7.4.0 */ defined( 'ABSPATH' ) || exit; @@ -144,7 +144,7 @@ do_action( 'woocommerce_before_cart' ); ?>
- +
diff --git a/plugins/woocommerce/templates/emails/email-footer.php b/plugins/woocommerce/templates/emails/email-footer.php index 4579924cd85..d1734c59d5d 100644 --- a/plugins/woocommerce/templates/emails/email-footer.php +++ b/plugins/woocommerce/templates/emails/email-footer.php @@ -12,45 +12,64 @@ * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails - * @version 3.7.0 + * @version 7.4.0 */ defined( 'ABSPATH' ) || exit; ?> -
+
+ + + + - + - - - - - - - - - - - - + + + + + diff --git a/plugins/woocommerce/templates/emails/email-header.php b/plugins/woocommerce/templates/emails/email-header.php index 23793c022ab..d3bf90e597c 100644 --- a/plugins/woocommerce/templates/emails/email-header.php +++ b/plugins/woocommerce/templates/emails/email-header.php @@ -12,7 +12,7 @@ * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails - * @version 4.0.0 + * @version 7.4.0 */ if ( ! defined( 'ABSPATH' ) ) { @@ -24,42 +24,49 @@ if ( ! defined( 'ABSPATH' ) ) { > + <?php echo get_bloginfo( 'name', 'display' ); ?> ="0" marginwidth="0" topmargin="0" marginheight="0" offset="0"> -
- - -
-
- ' . get_bloginfo( 'name', 'display' ) . '

'; - } - ?> -
- +
+ + +
+
+ - - -
- - +
+ ' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '

'; + } + ?> +
+
- -
-

+
+ + + + + +
+

+
+
- -
- - -
- - +
+ + -
-
+
+ + + +
+
diff --git a/plugins/woocommerce/templates/emails/email-styles.php b/plugins/woocommerce/templates/emails/email-styles.php index 6b4a2fd10f1..fc042ea49a1 100644 --- a/plugins/woocommerce/templates/emails/email-styles.php +++ b/plugins/woocommerce/templates/emails/email-styles.php @@ -12,7 +12,7 @@ * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce\Templates\Emails - * @version 4.0.0 + * @version 7.4.0 */ if ( ! defined( 'ABSPATH' ) ) { @@ -44,15 +44,21 @@ $text_lighter_40 = wc_hex_lighter( $text, 40 ); // body{padding: 0;} ensures proper scale/positioning of the email in the iOS native email app. ?> body { + background-color: ; padding: 0; + text-align: center; +} + +#outer_wrapper { + background-color: ; } #wrapper { - background-color: ; - margin: 0; + margin: 0 auto; padding: 70px 0; -webkit-text-size-adjust: none !important; width: 100%; + max-width: 600px; } #template_container { @@ -225,4 +231,23 @@ img { margin-: 10px; max-width: 100%; } + +/** + * Media queries are not supported by all email clients, however they do work on modern mobile + * Gmail clients and can help us achieve better consistency there. + */ +@media screen and (max-width: 600px) { + #header_wrapper { + padding: 27px 36px !important; + font-size: 24px; + } + + #body_content table > tbody > tr > td { + padding: 10px !important; + } + + #body_content_inner { + font-size: 10px !important; + } +} { expect.arrayContaining([ expect.objectContaining({ "slug": "cancelled", - "name": "Cancelled", + "name": "Canceled", "total": expect.any(Number) }) ])); diff --git a/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js b/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js index 378ce377755..fd643ad419f 100644 --- a/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js +++ b/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js @@ -141,8 +141,8 @@ test.describe('Settings API tests: CRUD', () => { expect.arrayContaining([ expect.objectContaining({ id: "email_cancelled_order", - label: "Cancelled order", - description: "Cancelled order emails are sent to chosen recipient(s) when orders have been marked cancelled (if they were previously processing or on-hold).", + label: "Canceled order", + description: "Canceled order emails are sent to chosen recipient(s) when orders have been marked canceled (if they were previously processing or on-hold).", parent_id: "email", "sub_groups": expect.arrayContaining([]), }) @@ -162,7 +162,7 @@ test.describe('Settings API tests: CRUD', () => { expect.objectContaining({ id: "email_customer_on_hold_order", label: "Order on-hold", - description: "This is an order notification sent to customers containing order details after an order is placed on-hold from Pending, Cancelled or Failed order status.", + description: "This is an order notification sent to customers containing order details after an order is placed on-hold from Pending, Canceled or Failed order status.", parent_id: "email", "sub_groups": expect.arrayContaining([]), }) @@ -2550,4 +2550,4 @@ test.describe('Settings API tests: CRUD', () => { }); }); -}); \ No newline at end of file +}); diff --git a/plugins/woocommerce/tests/e2e-pw/tests/activate-and-setup/complete-onboarding-wizard.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/activate-and-setup/complete-onboarding-wizard.spec.js index 6aad523cb38..6fe61713ae1 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/activate-and-setup/complete-onboarding-wizard.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/activate-and-setup/complete-onboarding-wizard.spec.js @@ -27,6 +27,10 @@ test.describe( 'Store owner can complete onboarding wizard', () => { storeDetails.us.expectedIndustries ); await page.click( 'button >> text=Continue' ); + await expect( page ).toHaveURL( /.*step=product-types/ ); + await expect( + page.locator( '.product-types button >> text=Continue' ) + ).toBeVisible(); } ); // eslint-disable-next-line jest/expect-expect @@ -41,8 +45,8 @@ test.describe( 'Store owner can complete onboarding wizard', () => { // Navigate back to "Store Details" section await page.click( 'button >> text=Store Details' ); - await onboarding.handleSaveChangesModal( page, { saveChanges: true } ); + await page.locator( 'text="Welcome to WooCommerce"' ).waitFor(); // Navigate back to "Industry" section await page.click( 'button >> text=Industry' ); diff --git a/plugins/woocommerce/tests/e2e-pw/tests/admin-analytics/analytics.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/admin-analytics/analytics.spec.js index 6d42ce0419a..7f301af5eb8 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/admin-analytics/analytics.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/admin-analytics/analytics.spec.js @@ -23,7 +23,9 @@ test.describe( 'Analytics pages', () => { await page.goto( `/wp-admin/admin.php?page=wc-admin&path=%2Fanalytics%2F${ urlTitle }` ); - const pageTitle = page.locator( 'h1' ); + const pageTitle = page.locator( + '.woocommerce-layout__header-wrapper > h1' + ); await expect( pageTitle ).toContainText( aPages ); await expect( page.locator( '#woocommerce-layout__primary' ) diff --git a/plugins/woocommerce/tests/e2e-pw/tests/admin-tasks/payment.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/admin-tasks/payment.spec.js index b21e4cbe5a4..79168eca6c7 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/admin-tasks/payment.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/admin-tasks/payment.spec.js @@ -1,85 +1,91 @@ -const { test, expect } = require('@playwright/test'); -const wcApi = require('@woocommerce/woocommerce-rest-api').default; +const { test, expect } = require( '@playwright/test' ); +const wcApi = require( '@woocommerce/woocommerce-rest-api' ).default; -test.describe('Payment setup task', () => { - test.use({ storageState: process.env.ADMINSTATE }); +test.describe( 'Payment setup task', () => { + test.use( { storageState: process.env.ADMINSTATE } ); - test.beforeEach(async ({ page }) => { - await page.goto('wp-admin/admin.php?page=wc-admin&path=/setup-wizard'); - await page.click('text=Skip setup store details'); - await page.click('text=No thanks'); - await page.waitForLoadState('networkidle'); - }); + test.beforeEach( async ( { page } ) => { + await page.goto( + 'wp-admin/admin.php?page=wc-admin&path=/setup-wizard' + ); + await page.click( 'text=Skip setup store details' ); + await page.click( 'text=No thanks' ); + await page.waitForLoadState( 'networkidle' ); + } ); - test.afterAll(async ({ baseURL }) => { - const api = new wcApi({ + test.afterAll( async ( { baseURL } ) => { + const api = new wcApi( { url: baseURL, consumerKey: process.env.CONSUMER_KEY, consumerSecret: process.env.CONSUMER_SECRET, version: 'wc/v3', - }); - await api.put('payment_gateways/bacs', { + } ); + await api.put( 'payment_gateways/bacs', { enabled: false, - }); - await api.put('payment_gateways/cod', { + } ); + await api.put( 'payment_gateways/cod', { enabled: false, - }); - }); + } ); + } ); - test('Can visit the payment setup task from the homescreen if the setup wizard has been skipped', async ({ + test( 'Can visit the payment setup task from the homescreen if the setup wizard has been skipped', async ( { page, - }) => { - await page.goto('wp-admin/admin.php?page=wc-admin'); - await page.click('text=Set up payments'); - await expect(page.locator('h1')).toHaveText('Set up payments'); - }); + } ) => { + await page.goto( 'wp-admin/admin.php?page=wc-admin' ); + await page.click( 'text=Set up payments' ); + await expect( + page.locator( '.woocommerce-layout__header-wrapper > h1' ) + ).toHaveText( 'Set up payments' ); + } ); - test('Saving valid bank account transfer details enables the payment method', async ({ + test( 'Saving valid bank account transfer details enables the payment method', async ( { page, - }) => { + } ) => { // load the bank transfer page await page.goto( 'wp-admin/admin.php?page=wc-admin&task=payments&id=bacs' ); // purposely no await -- close the help dialog if/when it appears - page.locator('.components-button.is-small.has-icon') + page.locator( '.components-button.is-small.has-icon' ) .click() - .catch(() => {}); + .catch( () => {} ); // fill in bank transfer form - await page.fill('//input[@placeholder="Account name"]', 'Savings'); - await page.fill('//input[@placeholder="Account number"]', '1234'); - await page.fill('//input[@placeholder="Bank name"]', 'Test Bank'); - await page.fill('//input[@placeholder="Sort code"]', '12'); - await page.fill('//input[@placeholder="IBAN"]', '12 3456 7890'); - await page.fill('//input[@placeholder="BIC / Swift"]', 'ABBA'); - await page.click('text=Save'); + await page.fill( '//input[@placeholder="Account name"]', 'Savings' ); + await page.fill( '//input[@placeholder="Account number"]', '1234' ); + await page.fill( '//input[@placeholder="Bank name"]', 'Test Bank' ); + await page.fill( '//input[@placeholder="Sort code"]', '12' ); + await page.fill( '//input[@placeholder="IBAN"]', '12 3456 7890' ); + await page.fill( '//input[@placeholder="BIC / Swift"]', 'ABBA' ); + await page.click( 'text=Save' ); // check that bank transfers were set up await expect( - page.locator('div.components-snackbar__content') - ).toContainText('Direct bank transfer details added successfully'); + page.locator( 'div.components-snackbar__content' ) + ).toContainText( 'Direct bank transfer details added successfully' ); - await page.goto('wp-admin/admin.php?page=wc-settings&tab=checkout'); + await page.goto( 'wp-admin/admin.php?page=wc-settings&tab=checkout' ); await expect( - page.locator('//tr[@data-gateway_id="bacs"]/td[@class="status"]/a') - ).toHaveClass('wc-payment-gateway-method-toggle-enabled'); - }); + page.locator( + '//tr[@data-gateway_id="bacs"]/td[@class="status"]/a' + ) + ).toHaveClass( 'wc-payment-gateway-method-toggle-enabled' ); + } ); - test('Enabling cash on delivery enables the payment method', async ({ + test( 'Enabling cash on delivery enables the payment method', async ( { page, baseURL, - }) => { + } ) => { // Payments page differs if located outside of a WCPay-supported country, so make sure we aren't. - const api = new wcApi({ + const api = new wcApi( { url: baseURL, consumerKey: process.env.CONSUMER_KEY, consumerSecret: process.env.CONSUMER_SECRET, version: 'wc/v3', - }); + } ); // ensure store address is US - await api.post('settings/general/batch', { + await api.post( 'settings/general/batch', { update: [ { id: 'woocommerce_store_address', @@ -98,28 +104,28 @@ test.describe('Payment setup task', () => { value: '94107', }, ], - }); - await page.goto('wp-admin/admin.php?page=wc-admin&task=payments'); + } ); + await page.goto( 'wp-admin/admin.php?page=wc-admin&task=payments' ); // purposely no await -- close the help dialog if/when it appears - page.locator('.components-button.is-small.has-icon') + page.locator( '.components-button.is-small.has-icon' ) .click() - .catch(() => {}); - await page.waitForLoadState('networkidle'); + .catch( () => {} ); + await page.waitForLoadState( 'networkidle' ); // purposely no await again - page.click('button.toggle-button'); + page.click( 'button.toggle-button' ); // enable COD payment option await page.click( 'div.woocommerce-task-payment-cod > div.woocommerce-task-payment__footer > button' ); - await page.waitForLoadState('networkidle'); + await page.waitForLoadState( 'networkidle' ); - await page.goto('wp-admin/admin.php?page=wc-settings&tab=checkout'); + await page.goto( 'wp-admin/admin.php?page=wc-settings&tab=checkout' ); await expect( - page.locator('//tr[@data-gateway_id="cod"]/td[@class="status"]/a') - ).toHaveClass('wc-payment-gateway-method-toggle-enabled'); - }); -}); + page.locator( '//tr[@data-gateway_id="cod"]/td[@class="status"]/a' ) + ).toHaveClass( 'wc-payment-gateway-method-toggle-enabled' ); + } ); +} ); diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-edit.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-edit.spec.js index 862c0277575..7cd8c268535 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-edit.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-edit.spec.js @@ -46,8 +46,8 @@ test.describe( 'Edit order', () => { await page.goto( `wp-admin/post.php?post=${ orderId }&action=edit` ); // make sure we're on the order details page - await expect( page.locator( 'h1.components-text' ) ).toContainText( - 'Edit Order' + await expect( page.locator( 'h1.wp-heading-inline' ) ).toContainText( + /Edit [oO]rder/ ); } ); diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-search.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-search.spec.js index bb3f7cbb051..a5d9762c4f3 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-search.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-search.spec.js @@ -140,7 +140,7 @@ test.describe( 'WooCommerce Orders > Search orders', () => { test( 'can search for order by order id', async ( { page } ) => { await page.goto( 'wp-admin/edit.php?post_type=shop_order' ); - await page.fill( '#post-search-input', orderId.toString() ); + await page.fill( '[type=search][name=s]', orderId.toString() ); await page.click( '#search-submit' ); await expect( @@ -153,7 +153,7 @@ test.describe( 'WooCommerce Orders > Search orders', () => { page, } ) => { await page.goto( 'wp-admin/edit.php?post_type=shop_order' ); - await page.fill( '#post-search-input', queries[ i ][ 0 ] ); + await page.fill( '[type=search][name=s]', queries[ i ][ 0 ] ); await page.click( '#search-submit' ); await expect( diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-status-filter.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-status-filter.spec.js index 589a3bf08b9..04dc5261e58 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-status-filter.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-status-filter.spec.js @@ -10,7 +10,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/plugins/woocommerce/tests/legacy/bootstrap.php b/plugins/woocommerce/tests/legacy/bootstrap.php index 171219764d4..01aef6f2c19 100644 --- a/plugins/woocommerce/tests/legacy/bootstrap.php +++ b/plugins/woocommerce/tests/legacy/bootstrap.php @@ -13,7 +13,7 @@ use Automattic\WooCommerce\Testing\Tools\CodeHacking\Hacks\StaticMockerHack; use Automattic\WooCommerce\Testing\Tools\CodeHacking\Hacks\FunctionsMockerHack; use Automattic\WooCommerce\Testing\Tools\CodeHacking\Hacks\BypassFinalsHack; use Automattic\WooCommerce\Testing\Tools\DependencyManagement\MockableLegacyProxy; -\PHPUnit\Framework\Error\Deprecated::$enabled = false; + /** * Class WC_Unit_Tests_Bootstrap */ diff --git a/plugins/woocommerce/tests/legacy/data/sample-email.html b/plugins/woocommerce/tests/legacy/data/sample-email.html index a76b328ed2d..2f0bee06493 100644 --- a/plugins/woocommerce/tests/legacy/data/sample-email.html +++ b/plugins/woocommerce/tests/legacy/data/sample-email.html @@ -1,5 +1,5 @@ -

Hello World!

+

Hello World!

diff --git a/plugins/woocommerce/tests/legacy/unit-tests/order/class-wc-tests-order-functions.php b/plugins/woocommerce/tests/legacy/unit-tests/order/class-wc-tests-order-functions.php index 1999e4cf626..eb110323302 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/order/class-wc-tests-order-functions.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/order/class-wc-tests-order-functions.php @@ -29,7 +29,7 @@ class WC_Tests_Order_Functions extends WC_Unit_Test_Case { 'wc-processing' => _x( 'Processing', 'Order status', 'woocommerce' ), 'wc-on-hold' => _x( 'On hold', 'Order status', 'woocommerce' ), 'wc-completed' => _x( 'Completed', 'Order status', 'woocommerce' ), - 'wc-cancelled' => _x( 'Cancelled', 'Order status', 'woocommerce' ), + 'wc-cancelled' => _x( 'Canceled', 'Order status', 'woocommerce' ), 'wc-refunded' => _x( 'Refunded', 'Order status', 'woocommerce' ), 'wc-failed' => _x( 'Failed', 'Order status', 'woocommerce' ), ) diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/api-init.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/api-init.php index 68a569bdbb9..9428bcb0c68 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/api-init.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/api-init.php @@ -9,11 +9,14 @@ use Automattic\WooCommerce\Internal\Admin\Schedulers\CustomersScheduler; use Automattic\WooCommerce\Internal\Admin\Schedulers\OrdersScheduler; use \Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore as OrdersStatsDataStore; +use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts; /** * Class WC_Admin_Tests_API_Init */ class WC_Admin_Tests_API_Init extends WC_REST_Unit_Test_Case { + use ArraySubsetAsserts; + /** * Set up. */ diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/batch-queue.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/batch-queue.php index 42406606520..eee1f28473e 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/batch-queue.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/batch-queue.php @@ -8,6 +8,7 @@ use Automattic\WooCommerce\Internal\Admin\Schedulers\CustomersScheduler; use Automattic\WooCommerce\Internal\Admin\Schedulers\OrdersScheduler; +use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts; /** * Reports Generation Batch Queue Test Class @@ -16,6 +17,8 @@ use Automattic\WooCommerce\Internal\Admin\Schedulers\OrdersScheduler; * @since 3.5.0 */ class WC_Admin_Tests_Reports_Regenerate_Batching extends WC_REST_Unit_Test_Case { + use ArraySubsetAsserts; + /** * Queue batch size. * diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/category-lookup.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/category-lookup.php index ce001e434cf..90da3721054 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/category-lookup.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/category-lookup.php @@ -25,7 +25,7 @@ class WC_Admin_Tests_Category_Lookup extends WP_UnitTestCase { * Setup */ - public function setUp() { + public function setUp(): void { delete_transient('wc_installing'); parent::setUp(); $parent = wp_insert_term( 'test_parent', 'product_cat' ); diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/product-form/field.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/product-form/field.php new file mode 100644 index 00000000000..f1d45786b13 --- /dev/null +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/product-form/field.php @@ -0,0 +1,28 @@ + 'product_details', + ) + ); + + $this->assertEquals( array( 'type', 'properties.name', 'properties.label' ), $missing_args ); + } +} + diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/product-form/form-factory.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/product-form/form-factory.php new file mode 100644 index 00000000000..14f3bca9d7c --- /dev/null +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/product-form/form-factory.php @@ -0,0 +1,206 @@ +assertInstanceOf( 'WP_Error', $field ); + $this->assertContains( 'You are missing required arguments of WooCommerce ProductForm Field: type, section, properties.name, properties.label', $field->get_error_message() ); + } + + /** + * Test add_field duplicate field id. + */ + public function test_add_field_duplicate_field_id() { + Form::add_field( + 'id', + 'woocommerce', + array( + 'type' => 'text', + 'section' => 'product_details', + 'properties' => array( + 'label' => 'label', + 'name' => 'name', + ), + ) + ); + + $field_duplicate = Form::add_field( + 'id', + 'woocommerce', + array( + 'type' => 'text', + 'section' => 'product_details', + 'properties' => array( + 'label' => 'label', + 'name' => 'name', + ), + ) + ); + $this->assertInstanceOf( 'WP_Error', $field_duplicate ); + $this->assertContains( 'You have attempted to register a duplicate form field with WooCommerce Form: `id`', $field_duplicate->get_error_message() ); + } + + /** + * Test that get_fields. + */ + public function test_get_fields() { + Form::add_field( + 'id', + 'woocommerce', + array( + 'type' => 'text', + 'section' => 'product_details', + 'properties' => array( + 'label' => 'label', + 'name' => 'name', + ), + ) + ); + + Form::add_field( + 'id2', + 'woocommerce', + array( + 'type' => 'textarea', + 'section' => 'product_details', + 'properties' => array( + 'label' => 'label', + 'name' => 'name', + ), + ) + ); + + $fields = Form::get_fields(); + $this->assertEquals( 2, count( $fields ) ); + $this->assertEquals( 'text', $fields[0]->type ); + $this->assertEquals( 'textarea', $fields[1]->type ); + } + + /** + * Test that get_fields. + */ + public function test_get_fields_sort_default() { + Form::add_field( + 'id', + 'woocommerce', + array( + 'type' => 'text', + 'section' => 'product_details', + 'properties' => array( + 'label' => 'label', + 'name' => 'name', + ), + ) + ); + + Form::add_field( + 'id2', + 'woocommerce', + array( + 'type' => 'textarea', + 'section' => 'product_details', + 'properties' => array( + 'label' => 'label', + 'name' => 'name', + ), + ) + ); + + Form::add_field( + 'first', + 'woocommerce', + array( + 'order' => 1, + 'type' => 'textarea', + 'section' => 'product_details', + 'properties' => array( + 'label' => 'label', + 'name' => 'name', + ), + ) + ); + + $fields = Form::get_fields(); + $this->assertEquals( 3, count( $fields ) ); + $this->assertEquals( 'first', $fields[0]->get_id() ); + $this->assertEquals( 'id', $fields[1]->get_id() ); + $this->assertEquals( 'id2', $fields[2]->get_id() ); + } + + /** + * Test that get_cards. + */ + public function test_get_cards_sort_default() { + Form::add_subsection( + 'id', + 'woocommerce' + ); + + Form::add_subsection( + 'id2', + 'woocommerce' + ); + + Form::add_subsection( + 'first', + 'woocommerce', + array( + 'order' => 1, + ) + ); + + $subsections = Form::get_subsections(); + $this->assertEquals( 3, count( $subsections ) ); + $this->assertEquals( 'first', $subsections[0]->get_id() ); + $this->assertEquals( 'id', $subsections[1]->get_id() ); + $this->assertEquals( 'id2', $subsections[2]->get_id() ); + } + + /** + * Test that get_sections. + */ + public function test_get_sections_sort_default() { + Form::add_section( + 'id', + 'woocommerce', + array() + ); + + Form::add_section( + 'id2', + 'woocommerce', + array( + 'title' => 'title', + ) + ); + + Form::add_section( + 'first', + 'woocommerce', + array( + 'order' => 1, + 'title' => 'title', + ) + ); + + $sections = Form::get_sections(); + $this->assertEquals( 2, count( $sections ) ); + $this->assertEquals( 'first', $sections[0]->get_id() ); + $this->assertEquals( 'id2', $sections[1]->get_id() ); + } +} + diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/transformer-service.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/transformer-service.php index c6264f30760..ac564a954af 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/transformer-service.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/remote-inbox-notifications/transformer-service.php @@ -29,18 +29,19 @@ class WC_Admin_Tests_RemoteInboxNotifications_TransformerService extends WC_Unit } /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage Missing required config value: use + * @testdox An exception is thrown when the transformer config is missing 'use' */ public function test_it_throw_exception_when_transformer_config_is_missing_use() { + $this->expectException( InvalidArgumentException::class ); + $this->expectExceptionMessage( 'Missing required config value: use' ); TransformerService::apply( array( 'value' ), array( new stdClass() ), null ); } /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage Unable to find a transformer by name: i_do_not_exist + * @testdox An exception is thrown when the transformer is not found */ public function test_it_throws_exception_when_transformer_is_not_found() { + $this->expectExceptionMessage( 'Unable to find a transformer by name: i_do_not_exist' ); $transformer = $this->transformer_config( 'i_do_not_exist' ); TransformerService::apply( array( 'value' ), array( $transformer ), null ); } diff --git a/plugins/woocommerce/tests/performance/README.md b/plugins/woocommerce/tests/performance/README.md index 8b00be00b4c..87515c3d014 100644 --- a/plugins/woocommerce/tests/performance/README.md +++ b/plugins/woocommerce/tests/performance/README.md @@ -76,11 +76,11 @@ base_url | base URL of the test environment | yes `__ENV.URL` base_host | base host of the test environment (for use in headers) | yes `__ENV.HOST` admin_username | username for admin user | yes `__ENV.A_USER` admin_password | password for admin user | yes `__ENV.A_PW` -admin_acc_login | set to true if site needs to use my account for admin login | yes `__ENV.A_PW` +admin_acc_login | set to true if site needs to use my account for admin login | yes `__ENV.A_ACC_LOGIN` customer_username | username for customer user | yes `__ENV.C_USER` customer_password | password for customer user | yes `__ENV.C_PW` customer_user_id | user id for customer user | yes `__ENV.C_UID` -cot_status | set to true if site is using order tables | yes `__ENV.C_PW` +cot_status | set to true if site is using order tables | yes `__ENV.COT` admin_orders_base_url | url part for order urls when posts table is used | no cot_admin_orders_base_url | url part for order urls when orders table is used | no addresses_customer_billing_* | billing address details for existing customer user | no diff --git a/plugins/woocommerce/tests/performance/requests/merchant/add-order.js b/plugins/woocommerce/tests/performance/requests/merchant/add-order.js index 6020ffaa832..308130aa726 100644 --- a/plugins/woocommerce/tests/performance/requests/merchant/add-order.js +++ b/plugins/woocommerce/tests/performance/requests/merchant/add-order.js @@ -57,10 +57,10 @@ let admin_update_order_assert; if ( cot_status === true ) { admin_new_order_base = 'admin.php?page=wc-orders&action=new'; admin_update_order_base = 'admin.php?page=wc-orders&action=edit'; - admin_new_order_assert = 'Edit order '; - admin_open_order_assert = 'Edit order '; + admin_new_order_assert = 'post_status" type="hidden" value="auto-draft'; + admin_open_order_assert = 'post_status" type="hidden" value="pending'; admin_created_order_assert = 'changed from auto-draft to'; - admin_update_order_assert = 'changed from auto-draft to'; + admin_update_order_assert = 'changed from Pending payment to Completed'; } else { admin_new_order_base = 'post-new.php?post_type=shop_order'; admin_update_order_base = 'post.php'; @@ -145,7 +145,11 @@ export function addOrder() { .find( 'input[id=post_ID]' ) .first() .attr( 'value' ); - hpos_post_id = findBetween( response.body, 'post_id":"', '",' ); + hpos_post_id = findBetween( + response.body, + ';id=', + '" method="post" id="order"' + ); heartbeat_nonce = findBetween( response.body, 'heartbeatSettings = {"nonce":"', @@ -299,18 +303,18 @@ export function addOrder() { [ 'order_date_second', '01' ], [ 'order_note', '' ], [ 'order_note_type', '' ], - [ 'order_status', 'wc-pending' ], //change - [ 'original_post_status', 'auto-draft' ], //wc-pending - [ 'original_post_title', '' ], //string + [ 'order_status', 'wc-pending' ], + [ 'original_post_status', 'auto-draft' ], + [ 'original_post_title', '' ], [ 'originalaction', 'editpost' ], [ 'post_ID', `${ post_id }` ], [ 'post_author', '1' ], - [ 'post_status', 'auto-draft' ], //pending - [ 'post_title', '%2COrder' ], //string + [ 'post_status', 'auto-draft' ], + [ 'post_title', '%2COrder' ], [ 'post_type', 'shop_order' ], [ 'referredby', '' ], [ 'samplepermalinknonce', `${ sample_permalink_nonce }` ], - [ 'save', 'Create' ], //Update + [ 'save', 'Create' ], [ 'user_ID', '1' ], [ 'wc_order_action', '' ], [ 'woocommerce_meta_nonce', `${ woocommerce_meta_nonce }` ], @@ -361,11 +365,11 @@ export function addOrder() { [ 'order_note', '' ], [ 'order_note_type', '' ], [ 'order_status', 'wc-pending' ], - [ 'original_order_status', 'auto-draft' ], //pending - [ 'post_status', 'auto-draft' ], //pending + [ 'original_order_status', 'auto-draft' ], + [ 'post_status', 'auto-draft' ], [ 'post_title', 'Order' ], [ 'referredby', '' ], - [ 'save', 'Create' ], //Save + [ 'save', 'Create' ], [ 'wc_order_action', '' ], [ 'woocommerce_meta_nonce', `${ woocommerce_meta_nonce }` ], ] ); @@ -487,12 +491,12 @@ export function addOrder() { [ 'order_note_type', '' ], [ 'order_status', 'wc-completed' ], [ 'original_post_status', 'wc-pending' ], - [ 'original_post_title', '' ], //string + [ 'original_post_title', '' ], [ 'originalaction', 'editpost' ], [ 'post_ID', `${ post_id }` ], [ 'post_author', '1' ], [ 'post_status', 'pending' ], - [ 'post_title', '%2COrder' ], //string + [ 'post_title', '%2COrder' ], [ 'post_type', 'shop_order' ], [ 'referredby', '' ], [ 'samplepermalinknonce', `${ sample_permalink_nonce }` ], @@ -574,8 +578,6 @@ export function addOrder() { ); check( response, { 'is status 200': ( r ) => r.status === 200, - "body contains: 'Edit order' header": ( response ) => - response.body.includes( `${ admin_open_order_assert }` ), "body contains: 'Order updated' confirmation": ( response ) => response.body.includes( `${ admin_update_order_assert }` ), } ); diff --git a/plugins/woocommerce/tests/performance/tests/gh-action-daily-ext-requests.js b/plugins/woocommerce/tests/performance/tests/gh-action-daily-ext-requests.js index 01e670e7bb8..7ecec81086e 100644 --- a/plugins/woocommerce/tests/performance/tests/gh-action-daily-ext-requests.js +++ b/plugins/woocommerce/tests/performance/tests/gh-action-daily-ext-requests.js @@ -83,165 +83,166 @@ export const options = { }, }, thresholds: { - checks: ['rate==1'], + checks: [ 'rate==1' ], + // Listing individual metrics due to https://github.com/grafana/k6/issues/1321 'http_req_duration{name:Shopper - Site Root}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Shop Page}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Search Products}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Category Page}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Product Page}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=add_to_cart}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - View Cart}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Remove Item From Cart}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=apply_coupon}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Update Cart}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - View Checkout}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=update_order_review}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=checkout}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Order Received}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=get_refreshed_fragments}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Login to Checkout}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account Login Page}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Login to My Account}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account Orders}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account Open Order}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Merchant - WP Login Page}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Login to WP Admin}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - WC-Admin}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-analytics/orders?}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-analytics/products/reviews?}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-analytics/products/low-in-stock?}': - [`${merchant_request_threshold}`], + [ `${ merchant_request_threshold }` ], 'http_req_duration{name:Merchant - All Orders}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Completed Orders}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - New Order Page}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Create New Order}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Open Order}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Update Existing Order Status}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Search Orders By Product}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Search Orders By Customer Email}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Search Orders By Customer Address}': - [`${merchant_request_threshold}`], + [ `${ merchant_request_threshold }` ], 'http_req_duration{name:Merchant - Filter Orders By Month}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Filter Orders By Customer}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - All Products}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Add New Product}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - action=sample-permalink}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - action=heartbeat autosave}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Update New Product}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Coupons}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-admin/onboarding/tasks?}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-analytics/admin/notes?}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-admin/options?options=woocommerce_ces_tracks_queue}': - [`${merchant_request_threshold}`], + [ `${ merchant_request_threshold }` ], 'http_req_duration{name:Merchant - action=heartbeat}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:API - Create Order}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Retrieve Order}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Update Order (Status)}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Delete Order}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Batch Create Orders}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Batch Update (Status) Orders}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], }, }; diff --git a/plugins/woocommerce/tests/performance/tests/gh-action-pr-requests.js b/plugins/woocommerce/tests/performance/tests/gh-action-pr-requests.js index ac98b0330f6..afd8f10b4a1 100644 --- a/plugins/woocommerce/tests/performance/tests/gh-action-pr-requests.js +++ b/plugins/woocommerce/tests/performance/tests/gh-action-pr-requests.js @@ -85,6 +85,7 @@ export const options = { }, thresholds: { checks: [ 'rate==1' ], + // Listing individual metrics due to https://github.com/grafana/k6/issues/1321 'http_req_duration{name:Shopper - Site Root}': [ `${ shopper_request_threshold }`, ], @@ -140,13 +141,13 @@ export const options = { `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account Orders}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account Open Order}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Merchant - WP Login Page}': [ `${ merchant_request_threshold }`, diff --git a/plugins/woocommerce/tests/performance/tests/simple-all-requests.js b/plugins/woocommerce/tests/performance/tests/simple-all-requests.js index 6eb654c15a0..52c79b9dc52 100644 --- a/plugins/woocommerce/tests/performance/tests/simple-all-requests.js +++ b/plugins/woocommerce/tests/performance/tests/simple-all-requests.js @@ -87,165 +87,166 @@ export const options = { }, }, thresholds: { - checks: ['rate==1'], + checks: [ 'rate==1' ], + // Listing individual metrics due to https://github.com/grafana/k6/issues/1321 'http_req_duration{name:Shopper - Site Root}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Shop Page}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Search Products}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Category Page}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Product Page}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=add_to_cart}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - View Cart}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Remove Item From Cart}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=apply_coupon}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Update Cart}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - View Checkout}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=update_order_review}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=checkout}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Order Received}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=get_refreshed_fragments}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Login to Checkout}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account Login Page}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Login to My Account}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account Orders}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account Open Order}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Merchant - WP Login Page}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Login to WP Admin}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - WC-Admin}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-analytics/orders?}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-analytics/products/reviews?}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-analytics/products/low-in-stock?}': - [`${merchant_request_threshold}`], + [ `${ merchant_request_threshold }` ], 'http_req_duration{name:Merchant - All Orders}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Completed Orders}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - New Order Page}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Create New Order}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Open Order}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Update Existing Order Status}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Search Orders By Product}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Search Orders By Customer Email}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Search Orders By Customer Address}': - [`${merchant_request_threshold}`], + [ `${ merchant_request_threshold }` ], 'http_req_duration{name:Merchant - Filter Orders By Month}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Filter Orders By Customer}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - All Products}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Add New Product}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - action=sample-permalink}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - action=heartbeat autosave}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Update New Product}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Coupons}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-admin/onboarding/tasks?}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-analytics/admin/notes?}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-admin/options?options=woocommerce_ces_tracks_queue}': - [`${merchant_request_threshold}`], + [ `${ merchant_request_threshold }` ], 'http_req_duration{name:Merchant - action=heartbeat}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:API - Create Order}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Retrieve Order}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Update Order (Status)}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Delete Order}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Batch Create Orders}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Batch Update (Status) Orders}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], }, }; @@ -275,7 +276,7 @@ export function cartFlow() { } export function allMerchantFlow() { - if (admin_acc_login === true) { + if ( admin_acc_login === true ) { myAccountMerchantLogin(); } else { wpLogin(); diff --git a/plugins/woocommerce/tests/performance/tests/wc-baseline-load.js b/plugins/woocommerce/tests/performance/tests/wc-baseline-load.js index d2ae164f612..936ecacfb24 100644 --- a/plugins/woocommerce/tests/performance/tests/wc-baseline-load.js +++ b/plugins/woocommerce/tests/performance/tests/wc-baseline-load.js @@ -118,171 +118,172 @@ export const options = { }, }, thresholds: { + // Listing individual metrics due to https://github.com/grafana/k6/issues/1321 'http_req_duration{name:Shopper - Site Root}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Shop Page}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Search Products}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Category Page}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Product Page}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=add_to_cart}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - View Cart}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Remove Item From Cart}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=apply_coupon}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Update Cart}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - View Checkout}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=update_order_review}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=checkout}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Order Received}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - wc-ajax=get_refreshed_fragments}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Login to Checkout}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account Login Page}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - Login to My Account}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account Orders}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Shopper - My Account Open Order}': [ - `${shopper_request_threshold}`, + `${ shopper_request_threshold }`, ], 'http_req_duration{name:Merchant - WP Login Page}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Login to WP Admin}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - WC-Admin}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-analytics/orders?}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-analytics/products/reviews?}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-analytics/products/low-in-stock?}': - [`${merchant_request_threshold}`], + [ `${ merchant_request_threshold }` ], 'http_req_duration{name:Merchant - All Orders}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Completed Orders}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - New Order Page}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Create New Order}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Open Order}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Update Existing Order Status}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Search Orders By Product}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Search Orders By Customer Email}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Search Orders By Customer Address}': - [`${merchant_request_threshold}`], + [ `${ merchant_request_threshold }` ], 'http_req_duration{name:Merchant - Filter Orders By Month}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Filter Orders By Customer}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - All Products}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Add New Product}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - action=sample-permalink}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - action=heartbeat autosave}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Update New Product}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - Coupons}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-admin/onboarding/tasks?}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-analytics/admin/notes?}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:Merchant - wc-admin/options?options=woocommerce_ces_tracks_queue}': - [`${merchant_request_threshold}`], + [ `${ merchant_request_threshold }` ], 'http_req_duration{name:Merchant - action=heartbeat}': [ - `${merchant_request_threshold}`, + `${ merchant_request_threshold }`, ], 'http_req_duration{name:API - Create Order}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Retrieve Order}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Update Order (Status)}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Delete Order}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Batch Create Orders}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], 'http_req_duration{name:API - Batch Update (Status) Orders}': [ - `${api_request_threshold}`, + `${ api_request_threshold }`, ], }, }; // Use myAccountMerchantLogin() instead of wpLogin() if having issues with login. export function merchantOrderFlows() { - if (admin_acc_login === true) { + if ( admin_acc_login === true ) { myAccountMerchantLogin(); } else { wpLogin(); @@ -295,7 +296,7 @@ export function merchantOrderFlows() { // Use myAccountMerchantLogin() instead of wpLogin() if having issues with login. export function merchantOtherFlows() { - if (admin_acc_login === true) { + if ( admin_acc_login === true ) { myAccountMerchantLogin(); } else { wpLogin(); diff --git a/plugins/woocommerce/tests/php/includes/class-wc-emails-tests.php b/plugins/woocommerce/tests/php/includes/class-wc-emails-tests.php index 51ede419c73..40dcf501a66 100644 --- a/plugins/woocommerce/tests/php/includes/class-wc-emails-tests.php +++ b/plugins/woocommerce/tests/php/includes/class-wc-emails-tests.php @@ -56,7 +56,7 @@ class WC_Emails_Tests extends \WC_Unit_Test_Case { $email_object->order_meta( $order, true, true ); $content = ob_get_contents(); ob_end_clean(); - $this->assertContains( 'dummy_key', $content ); - $this->assertContains( 'dummy_meta_value', $content ); + $this->assertStringContainsString( 'dummy_key', $content ); + $this->assertStringContainsString( 'dummy_meta_value', $content ); } } diff --git a/plugins/woocommerce/tests/php/includes/wc-attribute-functions-test.php b/plugins/woocommerce/tests/php/includes/wc-attribute-functions-test.php index f8d13bfa516..351b43c0f54 100644 --- a/plugins/woocommerce/tests/php/includes/wc-attribute-functions-test.php +++ b/plugins/woocommerce/tests/php/includes/wc-attribute-functions-test.php @@ -121,15 +121,13 @@ class WC_Attribute_Functions_Test extends \WC_Unit_Test_Case { $ids = array(); $ids[] = wc_create_attribute( array( 'name' => 'Brand' ) ); - $this->assertInternalType( - 'int', + $this->assertIsInt( end( $ids ), 'wc_create_attribute should return a numeric id on success.' ); $ids[] = wc_create_attribute( array( 'name' => str_repeat( 'n', 28 ) ) ); - $this->assertInternalType( - 'int', + $this->assertIsInt( end( $ids ), 'Attribute creation should succeed when its slug is 28 characters long.' ); diff --git a/plugins/woocommerce/tests/php/src/Internal/Admin/ProductReviews/ReviewsTest.php b/plugins/woocommerce/tests/php/src/Internal/Admin/ProductReviews/ReviewsTest.php index 87204d42849..4ac9d7d2696 100644 --- a/plugins/woocommerce/tests/php/src/Internal/Admin/ProductReviews/ReviewsTest.php +++ b/plugins/woocommerce/tests/php/src/Internal/Admin/ProductReviews/ReviewsTest.php @@ -362,7 +362,7 @@ class ReviewsTest extends WC_Unit_Test_Case { $result = $method->invoke( $reviews ); foreach ( $expected_result as $i => $expected_message ) { - $this->assertContains( $expected_message, $result[ $i ] ); + $this->assertStringContainsString( $expected_message, $result[ $i ] ); } } diff --git a/plugins/woocommerce/tests/php/src/Internal/BatchProcessing/BatchProcessingControllerTests.php b/plugins/woocommerce/tests/php/src/Internal/BatchProcessing/BatchProcessingControllerTests.php index 3bb694d9c91..9649e083266 100644 --- a/plugins/woocommerce/tests/php/src/Internal/BatchProcessing/BatchProcessingControllerTests.php +++ b/plugins/woocommerce/tests/php/src/Internal/BatchProcessing/BatchProcessingControllerTests.php @@ -144,7 +144,6 @@ class BatchProcessingControllerTests extends WC_Unit_Test_Case { */ public function test_process_single_update_unfinished() { $test_process_mock = $this->getMockBuilder( get_class( $this->test_process ) )->getMock(); - $test_process_mock->expects( $this->once() )->method( 'process_batch' )->willReturn( true ); $test_process_mock->method( 'get_total_pending_count' )->willReturn( 10 ); $test_process_mock->expects( $this->once() )->method( 'get_next_batch_to_process' )->willReturn( array( 'dummy_id' ) ); @@ -166,7 +165,6 @@ class BatchProcessingControllerTests extends WC_Unit_Test_Case { */ public function test_process_single_update_finished() { $test_process_mock = $this->getMockBuilder( get_class( $this->test_process ) )->getMock(); - $test_process_mock->expects( $this->once() )->method( 'process_batch' )->willReturn( true ); $test_process_mock->method( 'get_total_pending_count' )->willReturn( 0 ); $test_process_mock->expects( $this->once() )->method( 'get_next_batch_to_process' )->willReturn( array( 'dummy_id' ) ); diff --git a/plugins/woocommerce/tests/php/src/Internal/DataStores/Orders/DataSynchronizerTests.php b/plugins/woocommerce/tests/php/src/Internal/DataStores/Orders/DataSynchronizerTests.php index c02026c4952..eb76417d9a0 100644 --- a/plugins/woocommerce/tests/php/src/Internal/DataStores/Orders/DataSynchronizerTests.php +++ b/plugins/woocommerce/tests/php/src/Internal/DataStores/Orders/DataSynchronizerTests.php @@ -5,11 +5,13 @@ use Automattic\WooCommerce\Internal\DataStores\Orders\DataSynchronizer; use Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore; use Automattic\WooCommerce\Internal\Features\FeaturesController; use Automattic\WooCommerce\RestApi\UnitTests\Helpers\OrderHelper; +use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts; /** * Tests for DataSynchronizer class. */ class DataSynchronizerTests extends WC_Unit_Test_Case { + use ArraySubsetAsserts; /** * @var DataSynchronizer diff --git a/plugins/woocommerce/tests/php/src/Internal/DataStores/Orders/OrdersTableDataStoreTests.php b/plugins/woocommerce/tests/php/src/Internal/DataStores/Orders/OrdersTableDataStoreTests.php index 765095fe095..2d7b5685c55 100644 --- a/plugins/woocommerce/tests/php/src/Internal/DataStores/Orders/OrdersTableDataStoreTests.php +++ b/plugins/woocommerce/tests/php/src/Internal/DataStores/Orders/OrdersTableDataStoreTests.php @@ -722,6 +722,76 @@ class OrdersTableDataStoreTests extends WC_Unit_Test_Case { // phpcs:enable } + /** + * @testDox Tests queries involving 'orderby' and meta queries. + */ + public function test_cot_query_meta_orderby() { + $this->toggle_cot( true ); + + $order1 = new \WC_Order(); + $order1->add_meta_data( 'color', 'red' ); + $order1->add_meta_data( 'animal', 'lion' ); + $order1->add_meta_data( 'numeric_meta', '1000' ); + $order1->save(); + + $order2 = new \WC_Order(); + $order2->add_meta_data( 'color', 'green' ); + $order2->add_meta_data( 'animal', 'lion' ); + $order2->add_meta_data( 'numeric_meta', '500' ); + $order2->save(); + + $query_args = array( + 'orderby' => 'id', + 'order' => 'ASC', + 'meta_key' => 'color', // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key + ); + + // Check that orders are in order (when no meta ordering is involved). + $q = new OrdersTableQuery( $query_args ); + $this->assertEquals( $q->orders, array( $order1->get_id(), $order2->get_id() ) ); + + // When ordering by color $order2 should come first. + // Also tests that the key name is a valid synonym for the primary meta query. + $query_args['orderby'] = 'color'; + $q = new OrdersTableQuery( $query_args ); + $this->assertEquals( $q->orders, array( $order2->get_id(), $order1->get_id() ) ); + + // When ordering by 'numeric_meta' 1000 < 500 (due to alphabetical sorting by default). + // Also tests that 'meta_value' is a valid synonym for the primary meta query. + $query_args['meta_key'] = 'numeric_meta'; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key + $query_args['orderby'] = 'meta_value'; + $q = new OrdersTableQuery( $query_args ); + $this->assertEquals( $q->orders, array( $order1->get_id(), $order2->get_id() ) ); + + // Forcing numeric sorting with 'meta_value_num' reverses the order above. + $query_args['orderby'] = 'meta_value_num'; + $q = new OrdersTableQuery( $query_args ); + $this->assertEquals( $q->orders, array( $order2->get_id(), $order1->get_id() ) ); + + // Sorting by 'animal' meta is ambiguous. Test that we can order by various meta fields (and use the names in 'orderby'). + unset( $query_args['meta_key'] ); + $query_args['meta_query'] = array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query + 'animal_meta' => array( + 'key' => 'animal', + ), + 'color_meta' => array( + 'key' => 'color', + ), + ); + $query_args['orderby'] = array( + 'animal_meta' => 'ASC', + 'color_meta' => 'DESC', + ); + $q = new OrdersTableQuery( $query_args ); + $this->assertEquals( $q->orders, array( $order1->get_id(), $order2->get_id() ) ); + + // Order is reversed when changing the sort order for 'color_meta'. + $query_args['orderby']['color_meta'] = 'ASC'; + $q = new OrdersTableQuery( $query_args ); + $this->assertEquals( $q->orders, array( $order2->get_id(), $order1->get_id() ) ); + + } + /** * @testDox Tests queries involving the 'customer' query var. * @@ -1349,6 +1419,38 @@ class OrdersTableDataStoreTests extends WC_Unit_Test_Case { ); } + /** + * @testDox Ensure sorting by `includes` param works as expected. + */ + public function test_cot_query_sort_includes() { + $this->disable_cot_sync(); + $order_1 = new WC_Order(); + $this->switch_data_store( $order_1, $this->sut ); + $order_1->save(); + + $order_2 = new WC_Order(); + $this->switch_data_store( $order_2, $this->sut ); + $order_2->save(); + + $query = new OrdersTableQuery( + array( + 'orderby' => 'include', + 'includes' => array( $order_1->get_id(), $order_2->get_id() ), + ) + ); + $orders_array = $query->orders; + $this->assertEquals( array( $order_1->get_id(), $order_2->get_id() ), array( $orders_array[0], $orders_array[1] ) ); + + $query = new OrdersTableQuery( + array( + 'orderby' => 'include', + 'includes' => array( $order_2->get_id(), $order_1->get_id() ), + ) + ); + $orders_array = $query->orders; + $this->assertEquals( array( $order_2->get_id(), $order_1->get_id() ), array( $orders_array[0], $orders_array[1] ) ); + } + /** * @testDox Ensure search works as expected on updated orders. */ @@ -1899,6 +2001,25 @@ class OrdersTableDataStoreTests extends WC_Unit_Test_Case { $this->assertFalse( $should_sync_callable->call( $this->sut, $order ) ); } + /** + * @testDox When parent order is deleted, child orders should be upshifted. + */ + public function test_child_orders_are_promoted_when_parent_is_deleted() { + $this->toggle_cot( true ); + $order = new WC_Order(); + $order->save(); + + $child_order = new WC_Order(); + $child_order->set_parent_id( $order->get_id() ); + $child_order->save(); + + $this->assertEquals( $order->get_id(), $child_order->get_parent_id() ); + $this->sut->delete( $order, array( 'force_delete' => true ) ); + $child_order = wc_get_order( $child_order->get_id() ); + + $this->assertEquals( 0, $child_order->get_parent_id() ); + } + /** * @testDox Make sure get_order return false when checking an order of different order types without warning. */ diff --git a/plugins/woocommerce/tests/php/src/Internal/Orders/MobileMessagingHandlerTest.php b/plugins/woocommerce/tests/php/src/Internal/Orders/MobileMessagingHandlerTest.php index d2e415c8962..8c814234152 100644 --- a/plugins/woocommerce/tests/php/src/Internal/Orders/MobileMessagingHandlerTest.php +++ b/plugins/woocommerce/tests/php/src/Internal/Orders/MobileMessagingHandlerTest.php @@ -60,7 +60,7 @@ class MobileMessagingHandlerTest extends \WC_Unit_Test_Case { $mobile_message = MobileMessagingHandler::prepare_mobile_message( new WC_Order(), self::BLOG_ID, $now, self::DOMAIN ); - $this->assertContains( + $this->assertStringContainsString( 'href="https://woocommerce.com/mobile?blog_id=' . self::BLOG_ID . '&utm_campaign=deeplinks_promote_app&utm_medium=email&utm_source=' . self::DOMAIN . '&utm_term=' . self::BLOG_ID, $mobile_message ); @@ -76,7 +76,7 @@ class MobileMessagingHandlerTest extends \WC_Unit_Test_Case { $mobile_message = MobileMessagingHandler::prepare_mobile_message( $ipp_eligible_order, self::BLOG_ID, $now, self::DOMAIN ); - $this->assertContains( + $this->assertStringContainsString( 'href="https://woocommerce.com/mobile/orders/details?blog_id=' . self::BLOG_ID . '&order_id=' . self::ORDER_ID . '&utm_campaign=deeplinks_orders_details&utm_medium=email&utm_source=' . self::DOMAIN . '&utm_term=' . self::BLOG_ID, $mobile_message ); @@ -92,7 +92,7 @@ class MobileMessagingHandlerTest extends \WC_Unit_Test_Case { $mobile_message = MobileMessagingHandler::prepare_mobile_message( $ipp_eligible_order, self::BLOG_ID, $now, self::DOMAIN ); - $this->assertContains( + $this->assertStringContainsString( 'href="https://woocommerce.com/mobile/payments?blog_id=' . self::BLOG_ID . '&utm_campaign=deeplinks_payments&utm_medium=email&utm_source=' . self::DOMAIN . '&utm_term=' . self::BLOG_ID, $mobile_message ); @@ -112,7 +112,7 @@ class MobileMessagingHandlerTest extends \WC_Unit_Test_Case { $mobile_message = MobileMessagingHandler::prepare_mobile_message( $ipp_eligible_order, null, $now, self::DOMAIN ); - $this->assertContains( + $this->assertStringContainsString( 'href="https://woocommerce.com/mobile/payments?blog_id=0&utm_campaign=deeplinks_payments&utm_medium=email&utm_source=' . self::DOMAIN . '&utm_term=0', $mobile_message ); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 299870a211f..dbcbbc7aa92 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -207,6 +207,7 @@ importers: '@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__block-editor': ^7.0.0 '@types/wordpress__block-library': ^2.6.1 '@types/wordpress__blocks': ^11.0.7 @@ -279,6 +280,7 @@ importers: 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 dependencies: @@ -351,7 +353,7 @@ importers: '@storybook/api': 6.4.19_sfoxds7t5ydpegc3knd667wn6m '@storybook/components': 6.4.19_hiunvzosbwliizyirxfy6hjyim '@storybook/core-events': 6.4.19 - '@storybook/react': 6.4.19_hyxuuzpmppcxva5upf6kk6zg4m + '@storybook/react': 6.4.19_oycjqkyefi4akx2twppuux3udq '@storybook/theming': 6.4.19_sfoxds7t5ydpegc3knd667wn6m '@testing-library/dom': 8.11.3 '@testing-library/jest-dom': 5.16.2 @@ -363,6 +365,7 @@ importers: '@types/prop-types': 15.7.5 '@types/react': 17.0.50 '@types/testing-library__jest-dom': 5.14.3 + '@types/uuid': 8.3.4 '@types/wordpress__components': 19.10.1_sfoxds7t5ydpegc3knd667wn6m '@types/wordpress__data': 6.0.0 '@types/wordpress__media-utils': 3.0.0_sfoxds7t5ydpegc3knd667wn6m @@ -382,6 +385,7 @@ importers: sass-loader: 10.2.1_webpack@5.70.0 ts-jest: 27.1.3_wfmhell6c5i72vvtgtvpmkkb6i typescript: 4.8.4 + uuid: 8.3.2 webpack: 5.70.0_webpack-cli@3.3.12 webpack-cli: 3.3.12_webpack@5.70.0 @@ -940,7 +944,7 @@ importers: '@babel/runtime': 7.17.7 '@storybook/addon-actions': 6.4.19_sfoxds7t5ydpegc3knd667wn6m '@storybook/addon-console': 1.2.3_kthckm6zfmobggl2ahqbjihlce - '@storybook/react': 6.4.19_rs26ab2uzoae75jlo5at3ry5ie + '@storybook/react': 6.4.19_glozp6fblhaty2oacwbjl7ao2i '@testing-library/dom': 8.11.3 '@testing-library/react': 12.1.4_sfoxds7t5ydpegc3knd667wn6m '@testing-library/user-event': 13.5.0_gzufz4q333be4gqfrvipwvqt6a @@ -1328,6 +1332,7 @@ importers: '@woocommerce/woocommerce-rest-api': ^1.0.1 '@wordpress/babel-plugin-import-jsx-pragma': 1.1.3 '@wordpress/babel-preset-default': 3.0.2 + '@wordpress/browserslist-config': ^5.7.0 '@wordpress/env': ^4.8.0 '@wordpress/stylelint-config': 19.1.0 allure-commandline: ^2.17.2 @@ -1354,6 +1359,8 @@ importers: webpack: 5.70.0 webpack-cli: 3.3.12 wp-textdomain: 1.0.1 + dependencies: + '@wordpress/browserslist-config': 5.7.0 devDependencies: '@babel/cli': 7.12.8_@babel+core@7.12.9 '@babel/core': 7.12.9 @@ -2068,11 +2075,11 @@ importers: '@storybook/addon-viewport': 6.4.19_sfoxds7t5ydpegc3knd667wn6m '@storybook/addons': 6.4.19_sfoxds7t5ydpegc3knd667wn6m '@storybook/api': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/builder-webpack5': 6.4.19_bwojc7ty2esajt4slmy7gzriiq + '@storybook/builder-webpack5': 6.4.19_3n4gsnmxucj3bywv6syggoiztm '@storybook/components': 6.4.19_sfoxds7t5ydpegc3knd667wn6m '@storybook/core-events': 6.4.19 - '@storybook/manager-webpack5': 6.4.19_bwojc7ty2esajt4slmy7gzriiq - '@storybook/react': 6.4.19_bgawh2hvs42ew64xztrhknnlry + '@storybook/manager-webpack5': 6.4.19_3n4gsnmxucj3bywv6syggoiztm + '@storybook/react': 6.4.19_a55upwwpdj22rf6pemjk4qxjbi '@storybook/theming': 6.4.19_sfoxds7t5ydpegc3knd667wn6m '@woocommerce/eslint-plugin': link:../../packages/js/eslint-plugin react: 17.0.2 @@ -2440,7 +2447,7 @@ packages: resolution: {integrity: sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.16.10 + '@babel/highlight': 7.18.6 /@babel/code-frame/7.18.6: resolution: {integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==} @@ -2605,14 +2612,6 @@ packages: dependencies: '@babel/types': 7.19.3 - /@babel/helper-builder-binary-assignment-operator-visitor/7.16.0: - resolution: {integrity: sha512-9KuleLT0e77wFUku6TUkqZzCEymBdtuQQ27MhEKzf9UOOJu3cYj98kyaDAzxpC7lV6DGiZFuC8XqDsq8/Kl6aQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-explode-assignable-expression': 7.18.6 - '@babel/types': 7.19.3 - dev: true - /@babel/helper-builder-binary-assignment-operator-visitor/7.18.9: resolution: {integrity: sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw==} engines: {node: '>=6.9.0'} @@ -2629,7 +2628,7 @@ packages: '@babel/compat-data': 7.19.3 '@babel/core': 7.12.9 '@babel/helper-validator-option': 7.18.6 - browserslist: 4.20.4 + browserslist: 4.21.4 semver: 6.3.0 dev: true @@ -2710,23 +2709,6 @@ packages: browserslist: 4.21.4 semver: 6.3.0 - /@babel/helper-create-class-features-plugin/7.16.0_@babel+core@7.12.9: - resolution: {integrity: sha512-XLwWvqEaq19zFlF5PTgOod4bUA+XbkR4WLQBct1bkzmxJGB0ZEJaoKF4c8cgH9oBtCDuYJ8BP5NB9uFiEgO5QA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.12.9 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-function-name': 7.19.0 - '@babel/helper-member-expression-to-functions': 7.18.9 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/helper-replace-supers': 7.19.1 - '@babel/helper-split-export-declaration': 7.18.6 - transitivePeerDependencies: - - supports-color - dev: true - /@babel/helper-create-class-features-plugin/7.17.6_@babel+core@7.12.9: resolution: {integrity: sha512-SogLLSxXm2OkBbSsHZMM4tUi8fUzjs63AT/d0YQIzr6GSd8Hxsbk2KYDX0k0DweAzGMj/YWeiCsorIdtdcW8Eg==} engines: {node: '>=6.9.0'} @@ -2833,17 +2815,6 @@ packages: transitivePeerDependencies: - supports-color - /@babel/helper-create-regexp-features-plugin/7.16.0_@babel+core@7.12.9: - resolution: {integrity: sha512-3DyG0zAFAZKcOp7aVr33ddwkxJ0Z0Jr5V99y3I690eYLpukJsJvAbzTy1ewoCqsML8SbIrjH14Jc/nSQ4TvNPA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.12.9 - '@babel/helper-annotate-as-pure': 7.18.6 - regexpu-core: 4.8.0 - dev: true - /@babel/helper-create-regexp-features-plugin/7.19.0_@babel+core@7.12.9: resolution: {integrity: sha512-htnV+mHX32DF81amCDrwIDr8nrp1PTm+3wfBN9/v8QJOLEioOCOG7qNyq0nHeFiWbT3Eb7gsPwEmV64UCQ1jzw==} engines: {node: '>=6.9.0'} @@ -2894,96 +2865,6 @@ packages: - supports-color dev: true - /@babel/helper-define-polyfill-provider/0.3.0_@babel+core@7.12.9: - resolution: {integrity: sha512-7hfT8lUljl/tM3h+izTX/pO3W3frz2ok6Pk+gzys8iJqDfZrZy2pXjRTZAvG2YmfHun1X4q8/UZRLatMfqc5Tg==} - peerDependencies: - '@babel/core': ^7.4.0-0 - dependencies: - '@babel/core': 7.12.9 - '@babel/helper-compilation-targets': 7.19.3_@babel+core@7.12.9 - '@babel/helper-module-imports': 7.18.6 - '@babel/helper-plugin-utils': 7.19.0 - '@babel/traverse': 7.19.3 - debug: 4.3.4 - lodash.debounce: 4.0.8 - resolve: 1.22.1 - semver: 6.3.0 - transitivePeerDependencies: - - supports-color - dev: true - - /@babel/helper-define-polyfill-provider/0.3.0_@babel+core@7.16.12: - resolution: {integrity: sha512-7hfT8lUljl/tM3h+izTX/pO3W3frz2ok6Pk+gzys8iJqDfZrZy2pXjRTZAvG2YmfHun1X4q8/UZRLatMfqc5Tg==} - peerDependencies: - '@babel/core': ^7.4.0-0 - dependencies: - '@babel/core': 7.16.12 - '@babel/helper-compilation-targets': 7.19.3_@babel+core@7.16.12 - '@babel/helper-module-imports': 7.18.6 - '@babel/helper-plugin-utils': 7.19.0 - '@babel/traverse': 7.19.3 - debug: 4.3.4 - lodash.debounce: 4.0.8 - resolve: 1.22.1 - semver: 6.3.0 - transitivePeerDependencies: - - supports-color - dev: false - - /@babel/helper-define-polyfill-provider/0.3.0_@babel+core@7.17.8: - resolution: {integrity: sha512-7hfT8lUljl/tM3h+izTX/pO3W3frz2ok6Pk+gzys8iJqDfZrZy2pXjRTZAvG2YmfHun1X4q8/UZRLatMfqc5Tg==} - peerDependencies: - '@babel/core': ^7.4.0-0 - dependencies: - '@babel/core': 7.17.8 - '@babel/helper-compilation-targets': 7.19.3_@babel+core@7.17.8 - '@babel/helper-module-imports': 7.18.6 - '@babel/helper-plugin-utils': 7.19.0 - '@babel/traverse': 7.19.3 - debug: 4.3.4 - lodash.debounce: 4.0.8 - resolve: 1.22.1 - semver: 6.3.0 - transitivePeerDependencies: - - supports-color - dev: true - - /@babel/helper-define-polyfill-provider/0.3.1_@babel+core@7.12.9: - resolution: {integrity: sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA==} - peerDependencies: - '@babel/core': ^7.4.0-0 - dependencies: - '@babel/core': 7.12.9 - '@babel/helper-compilation-targets': 7.19.3_@babel+core@7.12.9 - '@babel/helper-module-imports': 7.18.6 - '@babel/helper-plugin-utils': 7.19.0 - '@babel/traverse': 7.19.3 - debug: 4.3.4 - lodash.debounce: 4.0.8 - resolve: 1.22.1 - semver: 6.3.0 - transitivePeerDependencies: - - supports-color - dev: true - - /@babel/helper-define-polyfill-provider/0.3.1_@babel+core@7.16.12: - resolution: {integrity: sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA==} - peerDependencies: - '@babel/core': ^7.4.0-0 - dependencies: - '@babel/core': 7.16.12 - '@babel/helper-compilation-targets': 7.19.3_@babel+core@7.16.12 - '@babel/helper-module-imports': 7.18.6 - '@babel/helper-plugin-utils': 7.19.0 - '@babel/traverse': 7.19.3 - debug: 4.3.4 - lodash.debounce: 4.0.8 - resolve: 1.22.1 - semver: 6.3.0 - transitivePeerDependencies: - - supports-color - dev: false - /@babel/helper-define-polyfill-provider/0.3.3_@babel+core@7.12.9: resolution: {integrity: sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww==} peerDependencies: @@ -3031,12 +2912,6 @@ packages: transitivePeerDependencies: - supports-color - /@babel/helper-environment-visitor/7.16.7: - resolution: {integrity: sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.3 - /@babel/helper-environment-visitor/7.18.9: resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==} engines: {node: '>=6.9.0'} @@ -3047,23 +2922,6 @@ packages: dependencies: '@babel/types': 7.19.3 - /@babel/helper-function-name/7.16.0: - resolution: {integrity: sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-get-function-arity': 7.16.7 - '@babel/template': 7.18.10 - '@babel/types': 7.19.3 - dev: true - - /@babel/helper-function-name/7.16.7: - resolution: {integrity: sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-get-function-arity': 7.16.7 - '@babel/template': 7.18.10 - '@babel/types': 7.19.3 - /@babel/helper-function-name/7.19.0: resolution: {integrity: sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==} engines: {node: '>=6.9.0'} @@ -3071,25 +2929,6 @@ packages: '@babel/template': 7.18.10 '@babel/types': 7.19.3 - /@babel/helper-get-function-arity/7.16.7: - resolution: {integrity: sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.3 - - /@babel/helper-hoist-variables/7.16.0: - resolution: {integrity: sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.3 - dev: true - - /@babel/helper-hoist-variables/7.16.7: - resolution: {integrity: sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.3 - /@babel/helper-hoist-variables/7.18.6: resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} engines: {node: '>=6.9.0'} @@ -3124,11 +2963,11 @@ packages: resolution: {integrity: sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-environment-visitor': 7.16.7 - '@babel/helper-module-imports': 7.16.7 - '@babel/helper-simple-access': 7.17.7 - '@babel/helper-split-export-declaration': 7.16.7 - '@babel/helper-validator-identifier': 7.16.7 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-simple-access': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 '@babel/template': 7.18.10 '@babel/traverse': 7.19.3 '@babel/types': 7.19.3 @@ -3150,13 +2989,6 @@ packages: transitivePeerDependencies: - supports-color - /@babel/helper-optimise-call-expression/7.16.0: - resolution: {integrity: sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.3 - dev: true - /@babel/helper-optimise-call-expression/7.18.6: resolution: {integrity: sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==} engines: {node: '>=6.9.0'} @@ -3183,8 +3015,8 @@ packages: resolution: {integrity: sha512-vGERmmhR+s7eH5Y/cp8PCVzj4XEjerq8jooMfxFdA5xVtAk9Sh4AQsrWgiErUEBjtGrBtOFKDUcWQFW4/dFwMA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-annotate-as-pure': 7.16.0 - '@babel/helper-wrap-function': 7.16.0 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-wrap-function': 7.19.0 '@babel/types': 7.19.3 transitivePeerDependencies: - supports-color @@ -3244,18 +3076,6 @@ packages: transitivePeerDependencies: - supports-color - /@babel/helper-replace-supers/7.16.0: - resolution: {integrity: sha512-TQxuQfSCdoha7cpRNJvfaYxxxzmbxXw/+6cS7V02eeDYyhxderSoMVALvwupA54/pZcOTtVeJ0xccp1nGWladA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-member-expression-to-functions': 7.18.9 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/traverse': 7.19.3 - '@babel/types': 7.19.3 - transitivePeerDependencies: - - supports-color - dev: true - /@babel/helper-replace-supers/7.19.1: resolution: {integrity: sha512-T7ahH7wV0Hfs46SFh5Jz3s0B6+o8g3c+7TMxu7xKfmHikg7EAZ3I2Qk9LFhjxXq8sL7UkP5JflezNwoZa8WvWw==} engines: {node: '>=6.9.0'} @@ -3268,51 +3088,18 @@ packages: transitivePeerDependencies: - supports-color - /@babel/helper-simple-access/7.16.0: - resolution: {integrity: sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.3 - dev: true - - /@babel/helper-simple-access/7.17.7: - resolution: {integrity: sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.3 - /@babel/helper-simple-access/7.18.6: resolution: {integrity: sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.19.3 - /@babel/helper-skip-transparent-expression-wrappers/7.16.0: - resolution: {integrity: sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.3 - dev: true - /@babel/helper-skip-transparent-expression-wrappers/7.18.9: resolution: {integrity: sha512-imytd2gHi3cJPsybLRbmFrF7u5BIEuI2cNheyKi3/iOBC63kNn3q8Crn2xVuESli0aM4KYsyEqKyS7lFL8YVtw==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.19.3 - /@babel/helper-split-export-declaration/7.16.0: - resolution: {integrity: sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.3 - dev: true - - /@babel/helper-split-export-declaration/7.16.7: - resolution: {integrity: sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.3 - /@babel/helper-split-export-declaration/7.18.6: resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} engines: {node: '>=6.9.0'} @@ -3323,14 +3110,6 @@ packages: resolution: {integrity: sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==} engines: {node: '>=6.9.0'} - /@babel/helper-validator-identifier/7.15.7: - resolution: {integrity: sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==} - engines: {node: '>=6.9.0'} - - /@babel/helper-validator-identifier/7.16.7: - resolution: {integrity: sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==} - engines: {node: '>=6.9.0'} - /@babel/helper-validator-identifier/7.19.1: resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} engines: {node: '>=6.9.0'} @@ -3348,18 +3127,6 @@ packages: resolution: {integrity: sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==} engines: {node: '>=6.9.0'} - /@babel/helper-wrap-function/7.16.0: - resolution: {integrity: sha512-VVMGzYY3vkWgCJML+qVLvGIam902mJW0FvT7Avj1zEe0Gn7D93aWdLblYARTxEw+6DhZmtzhBM2zv0ekE5zg1g==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-function-name': 7.19.0 - '@babel/template': 7.18.10 - '@babel/traverse': 7.19.3 - '@babel/types': 7.19.3 - transitivePeerDependencies: - - supports-color - dev: true - /@babel/helper-wrap-function/7.19.0: resolution: {integrity: sha512-txX8aN8CZyYGTwcLhlk87KRqncAzhh5TpQamZUa0/u3an36NtDpUP6bQgBCBcLeBs09R/OwQu3OjK0k/HwfNDg==} engines: {node: '>=6.9.0'} @@ -3381,14 +3148,6 @@ packages: transitivePeerDependencies: - supports-color - /@babel/highlight/7.16.10: - resolution: {integrity: sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-validator-identifier': 7.19.1 - chalk: 2.4.2 - js-tokens: 4.0.0 - /@babel/highlight/7.18.6: resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} engines: {node: '>=6.9.0'} @@ -3574,7 +3333,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-create-class-features-plugin': 7.16.0_@babel+core@7.12.9 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.12.9 '@babel/helper-plugin-utils': 7.19.0 transitivePeerDependencies: - supports-color @@ -3587,7 +3346,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.12.9 + '@babel/helper-create-class-features-plugin': 7.17.6_@babel+core@7.12.9 '@babel/helper-plugin-utils': 7.19.0 transitivePeerDependencies: - supports-color @@ -3600,7 +3359,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.16.12 - '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.16.12 + '@babel/helper-create-class-features-plugin': 7.17.6_@babel+core@7.16.12 '@babel/helper-plugin-utils': 7.19.0 transitivePeerDependencies: - supports-color @@ -4174,7 +3933,7 @@ packages: dependencies: '@babel/core': 7.12.9 '@babel/helper-plugin-utils': 7.19.0 - '@babel/helper-skip-transparent-expression-wrappers': 7.16.0 + '@babel/helper-skip-transparent-expression-wrappers': 7.18.9 '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.12.9 dev: true @@ -4255,7 +4014,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-create-class-features-plugin': 7.16.0_@babel+core@7.12.9 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.12.9 '@babel/helper-plugin-utils': 7.19.0 transitivePeerDependencies: - supports-color @@ -4321,7 +4080,7 @@ packages: '@babel/core': 7.12.9 '@babel/helper-annotate-as-pure': 7.16.7 '@babel/helper-create-class-features-plugin': 7.17.6_@babel+core@7.12.9 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-private-property-in-object': 7.14.5_@babel+core@7.12.9 transitivePeerDependencies: - supports-color @@ -4336,7 +4095,7 @@ packages: '@babel/core': 7.16.12 '@babel/helper-annotate-as-pure': 7.16.7 '@babel/helper-create-class-features-plugin': 7.17.6_@babel+core@7.16.12 - '@babel/helper-plugin-utils': 7.18.9 + '@babel/helper-plugin-utils': 7.19.0 '@babel/plugin-syntax-private-property-in-object': 7.14.5_@babel+core@7.16.12 transitivePeerDependencies: - supports-color @@ -4378,7 +4137,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-create-regexp-features-plugin': 7.16.0_@babel+core@7.12.9 + '@babel/helper-create-regexp-features-plugin': 7.19.0_@babel+core@7.12.9 '@babel/helper-plugin-utils': 7.19.0 dev: true @@ -5013,9 +4772,9 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-module-imports': 7.16.0 + '@babel/helper-module-imports': 7.18.6 '@babel/helper-plugin-utils': 7.19.0 - '@babel/helper-remap-async-to-generator': 7.16.4 + '@babel/helper-remap-async-to-generator': 7.18.9_@babel+core@7.12.9 transitivePeerDependencies: - supports-color dev: true @@ -5180,12 +4939,12 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-annotate-as-pure': 7.16.0 - '@babel/helper-function-name': 7.16.0 - '@babel/helper-optimise-call-expression': 7.16.0 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-optimise-call-expression': 7.18.6 '@babel/helper-plugin-utils': 7.19.0 - '@babel/helper-replace-supers': 7.16.0 - '@babel/helper-split-export-declaration': 7.16.0 + '@babel/helper-replace-supers': 7.19.1 + '@babel/helper-split-export-declaration': 7.18.6 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -5372,7 +5131,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-create-regexp-features-plugin': 7.16.0_@babel+core@7.12.9 + '@babel/helper-create-regexp-features-plugin': 7.19.0_@babel+core@7.12.9 '@babel/helper-plugin-utils': 7.19.0 dev: true @@ -5497,7 +5256,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-builder-binary-assignment-operator-visitor': 7.16.0 + '@babel/helper-builder-binary-assignment-operator-visitor': 7.18.9 '@babel/helper-plugin-utils': 7.19.0 dev: true @@ -5610,7 +5369,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-function-name': 7.16.0 + '@babel/helper-function-name': 7.19.0 '@babel/helper-plugin-utils': 7.19.0 dev: true @@ -5837,7 +5596,7 @@ packages: '@babel/core': 7.12.9 '@babel/helper-module-transforms': 7.19.0 '@babel/helper-plugin-utils': 7.19.0 - '@babel/helper-simple-access': 7.16.0 + '@babel/helper-simple-access': 7.18.6 babel-plugin-dynamic-import-node: 2.3.3 transitivePeerDependencies: - supports-color @@ -5908,10 +5667,10 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-hoist-variables': 7.16.0 + '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-module-transforms': 7.19.0 '@babel/helper-plugin-utils': 7.19.0 - '@babel/helper-validator-identifier': 7.15.7 + '@babel/helper-validator-identifier': 7.19.1 babel-plugin-dynamic-import-node: 2.3.3 transitivePeerDependencies: - supports-color @@ -6051,7 +5810,7 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-create-regexp-features-plugin': 7.16.0_@babel+core@7.12.9 + '@babel/helper-create-regexp-features-plugin': 7.19.0_@babel+core@7.12.9 dev: true /@babel/plugin-transform-named-capturing-groups-regex/7.16.8_@babel+core@7.12.9: @@ -6151,7 +5910,7 @@ packages: dependencies: '@babel/core': 7.12.9 '@babel/helper-plugin-utils': 7.19.0 - '@babel/helper-replace-supers': 7.16.0 + '@babel/helper-replace-supers': 7.19.1 transitivePeerDependencies: - supports-color dev: true @@ -6661,7 +6420,7 @@ packages: dependencies: '@babel/core': 7.12.9 '@babel/helper-plugin-utils': 7.19.0 - '@babel/helper-skip-transparent-expression-wrappers': 7.16.0 + '@babel/helper-skip-transparent-expression-wrappers': 7.18.9 dev: true /@babel/plugin-transform-spread/7.16.7_@babel+core@7.12.9: @@ -6950,7 +6709,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-create-regexp-features-plugin': 7.16.0_@babel+core@7.12.9 + '@babel/helper-create-regexp-features-plugin': 7.19.0_@babel+core@7.12.9 '@babel/helper-plugin-utils': 7.19.0 dev: true @@ -7592,10 +7351,10 @@ packages: dependencies: '@babel/code-frame': 7.18.6 '@babel/generator': 7.19.3 - '@babel/helper-environment-visitor': 7.16.7 - '@babel/helper-function-name': 7.16.7 - '@babel/helper-hoist-variables': 7.16.7 - '@babel/helper-split-export-declaration': 7.16.7 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 '@babel/parser': 7.19.3 '@babel/types': 7.19.3 debug: 4.3.4 @@ -7624,14 +7383,14 @@ packages: resolution: {integrity: sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-validator-identifier': 7.15.7 + '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 /@babel/types/7.17.0: resolution: {integrity: sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-validator-identifier': 7.16.7 + '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 /@babel/types/7.19.3: @@ -10337,7 +10096,7 @@ packages: '@storybook/node-logger': 6.4.19 '@storybook/postinstall': 6.4.19 '@storybook/preview-web': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/react': 6.4.19_bgawh2hvs42ew64xztrhknnlry + '@storybook/react': 6.4.19_a55upwwpdj22rf6pemjk4qxjbi '@storybook/source-loader': 6.4.19_sfoxds7t5ydpegc3knd667wn6m '@storybook/store': 6.4.19_sfoxds7t5ydpegc3knd667wn6m '@storybook/theming': 6.4.19_sfoxds7t5ydpegc3knd667wn6m @@ -10450,7 +10209,7 @@ packages: '@storybook/node-logger': 6.4.19 '@storybook/postinstall': 6.4.19 '@storybook/preview-web': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/react': 6.4.19_hyxuuzpmppcxva5upf6kk6zg4m + '@storybook/react': 6.4.19_oycjqkyefi4akx2twppuux3udq '@storybook/source-loader': 6.4.19_sfoxds7t5ydpegc3knd667wn6m '@storybook/store': 6.4.19_sfoxds7t5ydpegc3knd667wn6m '@storybook/theming': 6.4.19_sfoxds7t5ydpegc3knd667wn6m @@ -10666,6 +10425,99 @@ packages: util-deprecate: 1.0.2 dev: true + /@storybook/builder-webpack4/6.4.19_3n4gsnmxucj3bywv6syggoiztm: + resolution: {integrity: sha512-wxA6SMH11duc9D53aeVVBwrVRemFIoxHp/dOugkkg6ZZFAb4ZmWzf/ENc3vQIZdZpfNRi7IZIZEOfoHc994cmw==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 + react-dom: ^16.8.0 || ^17.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@babel/core': 7.17.8 + '@babel/plugin-proposal-class-properties': 7.18.6_@babel+core@7.17.8 + '@babel/plugin-proposal-decorators': 7.16.4_@babel+core@7.17.8 + '@babel/plugin-proposal-export-default-from': 7.16.7_@babel+core@7.17.8 + '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6_@babel+core@7.17.8 + '@babel/plugin-proposal-object-rest-spread': 7.18.9_@babel+core@7.17.8 + '@babel/plugin-proposal-optional-chaining': 7.18.9_@babel+core@7.17.8 + '@babel/plugin-proposal-private-methods': 7.18.6_@babel+core@7.17.8 + '@babel/plugin-syntax-dynamic-import': 7.8.3_@babel+core@7.17.8 + '@babel/plugin-transform-arrow-functions': 7.18.6_@babel+core@7.17.8 + '@babel/plugin-transform-block-scoping': 7.18.9_@babel+core@7.17.8 + '@babel/plugin-transform-classes': 7.19.0_@babel+core@7.17.8 + '@babel/plugin-transform-destructuring': 7.18.13_@babel+core@7.17.8 + '@babel/plugin-transform-for-of': 7.18.8_@babel+core@7.17.8 + '@babel/plugin-transform-parameters': 7.18.8_@babel+core@7.17.8 + '@babel/plugin-transform-shorthand-properties': 7.18.6_@babel+core@7.17.8 + '@babel/plugin-transform-spread': 7.19.0_@babel+core@7.17.8 + '@babel/plugin-transform-template-literals': 7.18.9_@babel+core@7.17.8 + '@babel/preset-env': 7.19.3_@babel+core@7.17.8 + '@babel/preset-react': 7.16.7_@babel+core@7.17.8 + '@babel/preset-typescript': 7.18.6_@babel+core@7.17.8 + '@storybook/addons': 6.4.19_sfoxds7t5ydpegc3knd667wn6m + '@storybook/api': 6.4.19_sfoxds7t5ydpegc3knd667wn6m + '@storybook/channel-postmessage': 6.4.19 + '@storybook/channels': 6.4.19 + '@storybook/client-api': 6.4.19_sfoxds7t5ydpegc3knd667wn6m + '@storybook/client-logger': 6.4.19 + '@storybook/components': 6.4.19_sfoxds7t5ydpegc3knd667wn6m + '@storybook/core-common': 6.4.19_56jbash75ng5psbctf36wqywr4 + '@storybook/core-events': 6.4.19 + '@storybook/node-logger': 6.4.19 + '@storybook/preview-web': 6.4.19_sfoxds7t5ydpegc3knd667wn6m + '@storybook/router': 6.4.19_sfoxds7t5ydpegc3knd667wn6m + '@storybook/semver': 7.3.2 + '@storybook/store': 6.4.19_sfoxds7t5ydpegc3knd667wn6m + '@storybook/theming': 6.4.19_sfoxds7t5ydpegc3knd667wn6m + '@storybook/ui': 6.4.19_sfoxds7t5ydpegc3knd667wn6m + '@types/node': 14.14.33 + '@types/webpack': 4.41.32 + autoprefixer: 9.8.6 + babel-loader: 8.2.3_w4x3pzrj2omidyjy5w3nzug7xy + babel-plugin-macros: 2.8.0 + babel-plugin-polyfill-corejs3: 0.1.7_@babel+core@7.17.8 + case-sensitive-paths-webpack-plugin: 2.4.0 + core-js: 3.25.5 + css-loader: 3.6.0_webpack@4.46.0 + file-loader: 6.2.0_webpack@4.46.0 + find-up: 5.0.0 + fork-ts-checker-webpack-plugin: 4.1.6_lasgyenclx45ngbljrbo537mpe + glob: 7.2.0 + glob-promise: 3.4.0_glob@7.2.0 + global: 4.4.0 + html-webpack-plugin: 4.5.2_webpack@4.46.0 + pnp-webpack-plugin: 1.6.4_typescript@4.8.4 + postcss: 7.0.39 + postcss-flexbugs-fixes: 4.2.1 + postcss-loader: 4.2.0_gzaxsinx64nntyd3vmdqwl7coe + raw-loader: 4.0.2_webpack@4.46.0 + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + stable: 0.1.8 + style-loader: 1.3.0_webpack@4.46.0 + terser-webpack-plugin: 4.2.3_acorn@8.8.1+webpack@4.46.0 + ts-dedent: 2.2.0 + typescript: 4.8.4 + url-loader: 4.1.1_lit45vopotvaqup7lrvlnvtxwy + util-deprecate: 1.0.2 + webpack: 4.46.0 + webpack-dev-middleware: 3.7.3_webpack@4.46.0 + webpack-filter-warnings-plugin: 1.2.1_webpack@4.46.0 + webpack-hot-middleware: 2.25.1 + webpack-virtual-modules: 0.2.2 + transitivePeerDependencies: + - '@types/react' + - acorn + - bluebird + - eslint + - supports-color + - vue-template-compiler + - webpack-cli + - webpack-command + dev: true + /@storybook/builder-webpack4/6.4.19_6fawffbhajw2qfspjn7er622zq: resolution: {integrity: sha512-wxA6SMH11duc9D53aeVVBwrVRemFIoxHp/dOugkkg6ZZFAb4ZmWzf/ENc3vQIZdZpfNRi7IZIZEOfoHc994cmw==} peerDependencies: @@ -10759,7 +10611,7 @@ packages: - webpack-command dev: true - /@storybook/builder-webpack4/6.4.19_b6dfd6k5wi6kl4hmm6xmva7dfu: + /@storybook/builder-webpack4/6.4.19_fukhgakaronpnxxxb7r2advxsa: resolution: {integrity: sha512-wxA6SMH11duc9D53aeVVBwrVRemFIoxHp/dOugkkg6ZZFAb4ZmWzf/ENc3vQIZdZpfNRi7IZIZEOfoHc994cmw==} peerDependencies: react: ^16.8.0 || ^17.0.0 @@ -10831,7 +10683,7 @@ packages: react-dom: 17.0.2_react@17.0.2 stable: 0.1.8 style-loader: 1.3.0_webpack@4.46.0 - terser-webpack-plugin: 4.2.3_acorn@8.8.0+webpack@4.46.0 + terser-webpack-plugin: 4.2.3_acorn@8.8.1+webpack@4.46.0 ts-dedent: 2.2.0 typescript: 4.8.4 url-loader: 4.1.1_lit45vopotvaqup7lrvlnvtxwy @@ -10852,100 +10704,7 @@ packages: - webpack-command dev: true - /@storybook/builder-webpack4/6.4.19_bwojc7ty2esajt4slmy7gzriiq: - resolution: {integrity: sha512-wxA6SMH11duc9D53aeVVBwrVRemFIoxHp/dOugkkg6ZZFAb4ZmWzf/ENc3vQIZdZpfNRi7IZIZEOfoHc994cmw==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 - react-dom: ^16.8.0 || ^17.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@babel/core': 7.17.8 - '@babel/plugin-proposal-class-properties': 7.18.6_@babel+core@7.17.8 - '@babel/plugin-proposal-decorators': 7.16.4_@babel+core@7.17.8 - '@babel/plugin-proposal-export-default-from': 7.16.7_@babel+core@7.17.8 - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6_@babel+core@7.17.8 - '@babel/plugin-proposal-object-rest-spread': 7.18.9_@babel+core@7.17.8 - '@babel/plugin-proposal-optional-chaining': 7.18.9_@babel+core@7.17.8 - '@babel/plugin-proposal-private-methods': 7.18.6_@babel+core@7.17.8 - '@babel/plugin-syntax-dynamic-import': 7.8.3_@babel+core@7.17.8 - '@babel/plugin-transform-arrow-functions': 7.18.6_@babel+core@7.17.8 - '@babel/plugin-transform-block-scoping': 7.18.9_@babel+core@7.17.8 - '@babel/plugin-transform-classes': 7.19.0_@babel+core@7.17.8 - '@babel/plugin-transform-destructuring': 7.18.13_@babel+core@7.17.8 - '@babel/plugin-transform-for-of': 7.18.8_@babel+core@7.17.8 - '@babel/plugin-transform-parameters': 7.18.8_@babel+core@7.17.8 - '@babel/plugin-transform-shorthand-properties': 7.18.6_@babel+core@7.17.8 - '@babel/plugin-transform-spread': 7.19.0_@babel+core@7.17.8 - '@babel/plugin-transform-template-literals': 7.18.9_@babel+core@7.17.8 - '@babel/preset-env': 7.19.3_@babel+core@7.17.8 - '@babel/preset-react': 7.16.7_@babel+core@7.17.8 - '@babel/preset-typescript': 7.18.6_@babel+core@7.17.8 - '@storybook/addons': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/api': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/channel-postmessage': 6.4.19 - '@storybook/channels': 6.4.19 - '@storybook/client-api': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/client-logger': 6.4.19 - '@storybook/components': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/core-common': 6.4.19_56jbash75ng5psbctf36wqywr4 - '@storybook/core-events': 6.4.19 - '@storybook/node-logger': 6.4.19 - '@storybook/preview-web': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/router': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/semver': 7.3.2 - '@storybook/store': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/theming': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/ui': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@types/node': 14.14.33 - '@types/webpack': 4.41.32 - autoprefixer: 9.8.6 - babel-loader: 8.2.3_w4x3pzrj2omidyjy5w3nzug7xy - babel-plugin-macros: 2.8.0 - babel-plugin-polyfill-corejs3: 0.1.7_@babel+core@7.17.8 - case-sensitive-paths-webpack-plugin: 2.4.0 - core-js: 3.25.5 - css-loader: 3.6.0_webpack@4.46.0 - file-loader: 6.2.0_webpack@4.46.0 - find-up: 5.0.0 - fork-ts-checker-webpack-plugin: 4.1.6_lasgyenclx45ngbljrbo537mpe - glob: 7.2.0 - glob-promise: 3.4.0_glob@7.2.0 - global: 4.4.0 - html-webpack-plugin: 4.5.2_webpack@4.46.0 - pnp-webpack-plugin: 1.6.4_typescript@4.8.4 - postcss: 7.0.39 - postcss-flexbugs-fixes: 4.2.1 - postcss-loader: 4.2.0_gzaxsinx64nntyd3vmdqwl7coe - raw-loader: 4.0.2_webpack@4.46.0 - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - stable: 0.1.8 - style-loader: 1.3.0_webpack@4.46.0 - terser-webpack-plugin: 4.2.3_acorn@8.8.0+webpack@4.46.0 - ts-dedent: 2.2.0 - typescript: 4.8.4 - url-loader: 4.1.1_lit45vopotvaqup7lrvlnvtxwy - util-deprecate: 1.0.2 - webpack: 4.46.0 - webpack-dev-middleware: 3.7.3_webpack@4.46.0 - webpack-filter-warnings-plugin: 1.2.1_webpack@4.46.0 - webpack-hot-middleware: 2.25.1 - webpack-virtual-modules: 0.2.2 - transitivePeerDependencies: - - '@types/react' - - acorn - - bluebird - - eslint - - supports-color - - vue-template-compiler - - webpack-cli - - webpack-command - dev: true - - /@storybook/builder-webpack4/6.4.19_udsk7p7oupcmsdx7ikf7zdk4sm: + /@storybook/builder-webpack4/6.4.19_kdglyhz445ek5yhe73f5yegd3m: resolution: {integrity: sha512-wxA6SMH11duc9D53aeVVBwrVRemFIoxHp/dOugkkg6ZZFAb4ZmWzf/ENc3vQIZdZpfNRi7IZIZEOfoHc994cmw==} peerDependencies: react: ^16.8.0 || ^17.0.0 @@ -11017,7 +10776,7 @@ packages: react-dom: 17.0.2_react@17.0.2 stable: 0.1.8 style-loader: 1.3.0_webpack@4.46.0 - terser-webpack-plugin: 4.2.3_acorn@8.8.0+webpack@4.46.0 + terser-webpack-plugin: 4.2.3_acorn@8.8.1+webpack@4.46.0 ts-dedent: 2.2.0 typescript: 4.8.4 url-loader: 4.1.1_lit45vopotvaqup7lrvlnvtxwy @@ -11131,7 +10890,7 @@ packages: - webpack-command dev: true - /@storybook/builder-webpack5/6.4.19_bwojc7ty2esajt4slmy7gzriiq: + /@storybook/builder-webpack5/6.4.19_3n4gsnmxucj3bywv6syggoiztm: resolution: {integrity: sha512-AWM4YMN1gPaf7jfntqZTCGpIQ1tF6YRU1JtczPG4ox28rTaO6NMfOBi9aRhBre/59pPOh9bF6u2gu/MIHmRW+w==} peerDependencies: react: ^16.8.0 || ^17.0.0 @@ -11186,14 +10945,14 @@ packages: fork-ts-checker-webpack-plugin: 6.5.0_27qmdvvfdw5s3nqwnln6yerdsa glob: 7.2.0 glob-promise: 3.4.0_glob@7.2.0 - html-webpack-plugin: 5.5.0_acorn@8.8.0+webpack@5.70.0 + html-webpack-plugin: 5.5.0_acorn@8.8.1+webpack@5.70.0 path-browserify: 1.0.1 process: 0.11.10 react: 17.0.2 react-dom: 17.0.2_react@17.0.2 stable: 0.1.8 style-loader: 2.0.0_webpack@5.70.0 - terser-webpack-plugin: 5.2.5_acorn@8.8.0+webpack@5.70.0 + terser-webpack-plugin: 5.2.5_acorn@8.8.1+webpack@5.70.0 ts-dedent: 2.2.0 typescript: 4.8.4 util-deprecate: 1.0.2 @@ -11673,14 +11432,14 @@ packages: dependencies: '@discoveryjs/json-ext': 0.5.7 '@storybook/builder-webpack4': 6.4.19_6fawffbhajw2qfspjn7er622zq - '@storybook/builder-webpack5': 6.4.19_bwojc7ty2esajt4slmy7gzriiq + '@storybook/builder-webpack5': 6.4.19_3n4gsnmxucj3bywv6syggoiztm '@storybook/core-client': 6.4.19_lb6j7tllhltqtas2n635xqdotu '@storybook/core-common': 6.4.19_56jbash75ng5psbctf36wqywr4 '@storybook/core-events': 6.4.19 '@storybook/csf': 0.0.2--canary.87bc651.0 '@storybook/csf-tools': 6.4.19 '@storybook/manager-webpack4': 6.4.19_6fawffbhajw2qfspjn7er622zq - '@storybook/manager-webpack5': 6.4.19_bwojc7ty2esajt4slmy7gzriiq + '@storybook/manager-webpack5': 6.4.19_3n4gsnmxucj3bywv6syggoiztm '@storybook/node-logger': 6.4.19 '@storybook/semver': 7.3.2 '@storybook/store': 6.4.19_sfoxds7t5ydpegc3knd667wn6m @@ -11732,7 +11491,7 @@ packages: - webpack-command dev: true - /@storybook/core-server/6.4.19_b6dfd6k5wi6kl4hmm6xmva7dfu: + /@storybook/core-server/6.4.19_fukhgakaronpnxxxb7r2advxsa: resolution: {integrity: sha512-bKsUB9f7hl5ya2JXxpIrErmbDQjoH39FVbzYZWjMo4t/b7+Xyi6vYadwyWcqlpUQmis09ZaSMv8L/Tw0TuwLAA==} peerDependencies: '@storybook/builder-webpack5': 6.4.19 @@ -11749,13 +11508,13 @@ packages: optional: true dependencies: '@discoveryjs/json-ext': 0.5.7 - '@storybook/builder-webpack4': 6.4.19_b6dfd6k5wi6kl4hmm6xmva7dfu + '@storybook/builder-webpack4': 6.4.19_fukhgakaronpnxxxb7r2advxsa '@storybook/core-client': 6.4.19_lb6j7tllhltqtas2n635xqdotu '@storybook/core-common': 6.4.19_bhvadzvbuq4c4gucumdoppg3by '@storybook/core-events': 6.4.19 '@storybook/csf': 0.0.2--canary.87bc651.0 '@storybook/csf-tools': 6.4.19 - '@storybook/manager-webpack4': 6.4.19_b6dfd6k5wi6kl4hmm6xmva7dfu + '@storybook/manager-webpack4': 6.4.19_fukhgakaronpnxxxb7r2advxsa '@storybook/node-logger': 6.4.19 '@storybook/semver': 7.3.2 '@storybook/store': 6.4.19_sfoxds7t5ydpegc3knd667wn6m @@ -11807,7 +11566,7 @@ packages: - webpack-command dev: true - /@storybook/core-server/6.4.19_udsk7p7oupcmsdx7ikf7zdk4sm: + /@storybook/core-server/6.4.19_kdglyhz445ek5yhe73f5yegd3m: resolution: {integrity: sha512-bKsUB9f7hl5ya2JXxpIrErmbDQjoH39FVbzYZWjMo4t/b7+Xyi6vYadwyWcqlpUQmis09ZaSMv8L/Tw0TuwLAA==} peerDependencies: '@storybook/builder-webpack5': 6.4.19 @@ -11824,13 +11583,13 @@ packages: optional: true dependencies: '@discoveryjs/json-ext': 0.5.7 - '@storybook/builder-webpack4': 6.4.19_udsk7p7oupcmsdx7ikf7zdk4sm + '@storybook/builder-webpack4': 6.4.19_kdglyhz445ek5yhe73f5yegd3m '@storybook/core-client': 6.4.19_4khy3msxr4lnrhwh6cbg2lwt64 '@storybook/core-common': 6.4.19_bhvadzvbuq4c4gucumdoppg3by '@storybook/core-events': 6.4.19 '@storybook/csf': 0.0.2--canary.87bc651.0 '@storybook/csf-tools': 6.4.19 - '@storybook/manager-webpack4': 6.4.19_udsk7p7oupcmsdx7ikf7zdk4sm + '@storybook/manager-webpack4': 6.4.19_kdglyhz445ek5yhe73f5yegd3m '@storybook/node-logger': 6.4.19 '@storybook/semver': 7.3.2 '@storybook/store': 6.4.19_sfoxds7t5ydpegc3knd667wn6m @@ -11957,7 +11716,7 @@ packages: - webpack-command dev: true - /@storybook/core-server/6.4.19_zfflocleqzdwelfxuvlampqgty: + /@storybook/core-server/6.4.19_zide44vnbwlw6buwpxyfzrhxya: resolution: {integrity: sha512-bKsUB9f7hl5ya2JXxpIrErmbDQjoH39FVbzYZWjMo4t/b7+Xyi6vYadwyWcqlpUQmis09ZaSMv8L/Tw0TuwLAA==} peerDependencies: '@storybook/builder-webpack5': 6.4.19 @@ -11974,15 +11733,15 @@ packages: optional: true dependencies: '@discoveryjs/json-ext': 0.5.7 - '@storybook/builder-webpack4': 6.4.19_bwojc7ty2esajt4slmy7gzriiq - '@storybook/builder-webpack5': 6.4.19_bwojc7ty2esajt4slmy7gzriiq + '@storybook/builder-webpack4': 6.4.19_3n4gsnmxucj3bywv6syggoiztm + '@storybook/builder-webpack5': 6.4.19_3n4gsnmxucj3bywv6syggoiztm '@storybook/core-client': 6.4.19_lb6j7tllhltqtas2n635xqdotu '@storybook/core-common': 6.4.19_56jbash75ng5psbctf36wqywr4 '@storybook/core-events': 6.4.19 '@storybook/csf': 0.0.2--canary.87bc651.0 '@storybook/csf-tools': 6.4.19 - '@storybook/manager-webpack4': 6.4.19_bwojc7ty2esajt4slmy7gzriiq - '@storybook/manager-webpack5': 6.4.19_bwojc7ty2esajt4slmy7gzriiq + '@storybook/manager-webpack4': 6.4.19_3n4gsnmxucj3bywv6syggoiztm + '@storybook/manager-webpack5': 6.4.19_3n4gsnmxucj3bywv6syggoiztm '@storybook/node-logger': 6.4.19 '@storybook/semver': 7.3.2 '@storybook/store': 6.4.19_sfoxds7t5ydpegc3knd667wn6m @@ -12034,7 +11793,7 @@ packages: - webpack-command dev: true - /@storybook/core/6.4.19_cwkpkezp45pc2xqqskbtjzmzb4: + /@storybook/core/6.4.19_4cb7vxhorbasgfyagprjvpaxzu: resolution: {integrity: sha512-55LOQ/h/kf1jMhjN85t/pIEdIwWEG9yV7bdwv3niVvmoypCxyyjn9/QNK0RKYAeDSUtdm6FVoJ6k5CpxWz2d8w==} peerDependencies: '@storybook/builder-webpack5': 6.4.19 @@ -12048,9 +11807,9 @@ packages: typescript: optional: true dependencies: - '@storybook/builder-webpack5': 6.4.19_bwojc7ty2esajt4slmy7gzriiq + '@storybook/builder-webpack5': 6.4.19_3n4gsnmxucj3bywv6syggoiztm '@storybook/core-client': 6.4.19_lb6j7tllhltqtas2n635xqdotu - '@storybook/core-server': 6.4.19_zfflocleqzdwelfxuvlampqgty + '@storybook/core-server': 6.4.19_zide44vnbwlw6buwpxyfzrhxya react: 17.0.2 react-dom: 17.0.2_react@17.0.2 typescript: 4.8.4 @@ -12070,7 +11829,7 @@ packages: - webpack-command dev: true - /@storybook/core/6.4.19_khiz5aumqhidkhlg2zv2fpwlya: + /@storybook/core/6.4.19_hxw5eumcvhbkoh74pcqihkovhi: resolution: {integrity: sha512-55LOQ/h/kf1jMhjN85t/pIEdIwWEG9yV7bdwv3niVvmoypCxyyjn9/QNK0RKYAeDSUtdm6FVoJ6k5CpxWz2d8w==} peerDependencies: '@storybook/builder-webpack5': 6.4.19 @@ -12085,7 +11844,42 @@ packages: optional: true dependencies: '@storybook/core-client': 6.4.19_4khy3msxr4lnrhwh6cbg2lwt64 - '@storybook/core-server': 6.4.19_udsk7p7oupcmsdx7ikf7zdk4sm + '@storybook/core-server': 6.4.19_kdglyhz445ek5yhe73f5yegd3m + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + typescript: 4.8.4 + webpack: 4.46.0_webpack-cli@3.3.12 + transitivePeerDependencies: + - '@storybook/manager-webpack5' + - '@types/react' + - acorn + - bluebird + - bufferutil + - encoding + - eslint + - supports-color + - utf-8-validate + - vue-template-compiler + - webpack-cli + - webpack-command + dev: true + + /@storybook/core/6.4.19_p3r3fihtzjpxjnglz4l5qyfmaa: + resolution: {integrity: sha512-55LOQ/h/kf1jMhjN85t/pIEdIwWEG9yV7bdwv3niVvmoypCxyyjn9/QNK0RKYAeDSUtdm6FVoJ6k5CpxWz2d8w==} + peerDependencies: + '@storybook/builder-webpack5': 6.4.19 + react: ^16.8.0 || ^17.0.0 + react-dom: ^16.8.0 || ^17.0.0 + typescript: '*' + webpack: '*' + peerDependenciesMeta: + '@storybook/builder-webpack5': + optional: true + typescript: + optional: true + dependencies: + '@storybook/core-client': 6.4.19_lb6j7tllhltqtas2n635xqdotu + '@storybook/core-server': 6.4.19_fukhgakaronpnxxxb7r2advxsa react: 17.0.2 react-dom: 17.0.2_react@17.0.2 typescript: 4.8.4 @@ -12140,41 +11934,6 @@ packages: - webpack-command dev: true - /@storybook/core/6.4.19_xzab24xk2ppqlw525pofyj44uy: - resolution: {integrity: sha512-55LOQ/h/kf1jMhjN85t/pIEdIwWEG9yV7bdwv3niVvmoypCxyyjn9/QNK0RKYAeDSUtdm6FVoJ6k5CpxWz2d8w==} - peerDependencies: - '@storybook/builder-webpack5': 6.4.19 - react: ^16.8.0 || ^17.0.0 - react-dom: ^16.8.0 || ^17.0.0 - typescript: '*' - webpack: '*' - peerDependenciesMeta: - '@storybook/builder-webpack5': - optional: true - typescript: - optional: true - dependencies: - '@storybook/core-client': 6.4.19_lb6j7tllhltqtas2n635xqdotu - '@storybook/core-server': 6.4.19_b6dfd6k5wi6kl4hmm6xmva7dfu - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - typescript: 4.8.4 - webpack: 4.46.0_webpack-cli@3.3.12 - transitivePeerDependencies: - - '@storybook/manager-webpack5' - - '@types/react' - - acorn - - bluebird - - bufferutil - - encoding - - eslint - - supports-color - - utf-8-validate - - vue-template-compiler - - webpack-cli - - webpack-command - dev: true - /@storybook/core/6.4.19_ybd46eyevy5nesjyz6rrqmwwmu: resolution: {integrity: sha512-55LOQ/h/kf1jMhjN85t/pIEdIwWEG9yV7bdwv3niVvmoypCxyyjn9/QNK0RKYAeDSUtdm6FVoJ6k5CpxWz2d8w==} peerDependencies: @@ -12189,7 +11948,7 @@ packages: typescript: optional: true dependencies: - '@storybook/builder-webpack5': 6.4.19_bwojc7ty2esajt4slmy7gzriiq + '@storybook/builder-webpack5': 6.4.19_3n4gsnmxucj3bywv6syggoiztm '@storybook/core-client': 6.4.19_i57eoi6p2gbobism6oxgcmupsa '@storybook/core-server': 6.4.19_2x3ckvxqfngstqwiutxqcrgnby react: 17.0.2 @@ -12241,6 +12000,67 @@ packages: lodash: 4.17.21 dev: true + /@storybook/manager-webpack4/6.4.19_3n4gsnmxucj3bywv6syggoiztm: + resolution: {integrity: sha512-R8ugZjTYqXvlc6gDOcw909L65sIleOmIJLZR+N6/H85MivGXHu39jOwONqB7tVACufRty4FNecn8tEiQL2SAKA==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 + react-dom: ^16.8.0 || ^17.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@babel/core': 7.17.8 + '@babel/plugin-transform-template-literals': 7.18.9_@babel+core@7.17.8 + '@babel/preset-react': 7.16.7_@babel+core@7.17.8 + '@storybook/addons': 6.4.19_sfoxds7t5ydpegc3knd667wn6m + '@storybook/core-client': 6.4.19_lb6j7tllhltqtas2n635xqdotu + '@storybook/core-common': 6.4.19_56jbash75ng5psbctf36wqywr4 + '@storybook/node-logger': 6.4.19 + '@storybook/theming': 6.4.19_sfoxds7t5ydpegc3knd667wn6m + '@storybook/ui': 6.4.19_sfoxds7t5ydpegc3knd667wn6m + '@types/node': 14.14.33 + '@types/webpack': 4.41.32 + babel-loader: 8.2.3_w4x3pzrj2omidyjy5w3nzug7xy + case-sensitive-paths-webpack-plugin: 2.4.0 + chalk: 4.1.2 + core-js: 3.25.5 + css-loader: 3.6.0_webpack@4.46.0 + express: 4.18.1 + file-loader: 6.2.0_webpack@4.46.0 + file-system-cache: 1.0.5 + find-up: 5.0.0 + fs-extra: 9.1.0 + html-webpack-plugin: 4.5.2_webpack@4.46.0 + node-fetch: 2.6.7 + pnp-webpack-plugin: 1.6.4_typescript@4.8.4 + react: 17.0.2 + react-dom: 17.0.2_react@17.0.2 + read-pkg-up: 7.0.1 + regenerator-runtime: 0.13.9 + resolve-from: 5.0.0 + style-loader: 1.3.0_webpack@4.46.0 + telejson: 5.3.3 + terser-webpack-plugin: 4.2.3_acorn@8.8.1+webpack@4.46.0 + ts-dedent: 2.2.0 + typescript: 4.8.4 + url-loader: 4.1.1_lit45vopotvaqup7lrvlnvtxwy + util-deprecate: 1.0.2 + webpack: 4.46.0 + webpack-dev-middleware: 3.7.3_webpack@4.46.0 + webpack-virtual-modules: 0.2.2 + transitivePeerDependencies: + - '@types/react' + - acorn + - bluebird + - encoding + - eslint + - supports-color + - vue-template-compiler + - webpack-cli + - webpack-command + dev: true + /@storybook/manager-webpack4/6.4.19_6fawffbhajw2qfspjn7er622zq: resolution: {integrity: sha512-R8ugZjTYqXvlc6gDOcw909L65sIleOmIJLZR+N6/H85MivGXHu39jOwONqB7tVACufRty4FNecn8tEiQL2SAKA==} peerDependencies: @@ -12302,7 +12122,7 @@ packages: - webpack-command dev: true - /@storybook/manager-webpack4/6.4.19_b6dfd6k5wi6kl4hmm6xmva7dfu: + /@storybook/manager-webpack4/6.4.19_fukhgakaronpnxxxb7r2advxsa: resolution: {integrity: sha512-R8ugZjTYqXvlc6gDOcw909L65sIleOmIJLZR+N6/H85MivGXHu39jOwONqB7tVACufRty4FNecn8tEiQL2SAKA==} peerDependencies: react: ^16.8.0 || ^17.0.0 @@ -12343,7 +12163,7 @@ packages: resolve-from: 5.0.0 style-loader: 1.3.0_webpack@4.46.0 telejson: 5.3.3 - terser-webpack-plugin: 4.2.3_acorn@8.8.0+webpack@4.46.0 + terser-webpack-plugin: 4.2.3_acorn@8.8.1+webpack@4.46.0 ts-dedent: 2.2.0 typescript: 4.8.4 url-loader: 4.1.1_lit45vopotvaqup7lrvlnvtxwy @@ -12363,68 +12183,7 @@ packages: - webpack-command dev: true - /@storybook/manager-webpack4/6.4.19_bwojc7ty2esajt4slmy7gzriiq: - resolution: {integrity: sha512-R8ugZjTYqXvlc6gDOcw909L65sIleOmIJLZR+N6/H85MivGXHu39jOwONqB7tVACufRty4FNecn8tEiQL2SAKA==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 - react-dom: ^16.8.0 || ^17.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@babel/core': 7.17.8 - '@babel/plugin-transform-template-literals': 7.18.9_@babel+core@7.17.8 - '@babel/preset-react': 7.16.7_@babel+core@7.17.8 - '@storybook/addons': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/core-client': 6.4.19_lb6j7tllhltqtas2n635xqdotu - '@storybook/core-common': 6.4.19_56jbash75ng5psbctf36wqywr4 - '@storybook/node-logger': 6.4.19 - '@storybook/theming': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/ui': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@types/node': 14.14.33 - '@types/webpack': 4.41.32 - babel-loader: 8.2.3_w4x3pzrj2omidyjy5w3nzug7xy - case-sensitive-paths-webpack-plugin: 2.4.0 - chalk: 4.1.2 - core-js: 3.25.5 - css-loader: 3.6.0_webpack@4.46.0 - express: 4.18.1 - file-loader: 6.2.0_webpack@4.46.0 - file-system-cache: 1.0.5 - find-up: 5.0.0 - fs-extra: 9.1.0 - html-webpack-plugin: 4.5.2_webpack@4.46.0 - node-fetch: 2.6.7 - pnp-webpack-plugin: 1.6.4_typescript@4.8.4 - react: 17.0.2 - react-dom: 17.0.2_react@17.0.2 - read-pkg-up: 7.0.1 - regenerator-runtime: 0.13.9 - resolve-from: 5.0.0 - style-loader: 1.3.0_webpack@4.46.0 - telejson: 5.3.3 - terser-webpack-plugin: 4.2.3_acorn@8.8.0+webpack@4.46.0 - ts-dedent: 2.2.0 - typescript: 4.8.4 - url-loader: 4.1.1_lit45vopotvaqup7lrvlnvtxwy - util-deprecate: 1.0.2 - webpack: 4.46.0 - webpack-dev-middleware: 3.7.3_webpack@4.46.0 - webpack-virtual-modules: 0.2.2 - transitivePeerDependencies: - - '@types/react' - - acorn - - bluebird - - encoding - - eslint - - supports-color - - vue-template-compiler - - webpack-cli - - webpack-command - dev: true - - /@storybook/manager-webpack4/6.4.19_udsk7p7oupcmsdx7ikf7zdk4sm: + /@storybook/manager-webpack4/6.4.19_kdglyhz445ek5yhe73f5yegd3m: resolution: {integrity: sha512-R8ugZjTYqXvlc6gDOcw909L65sIleOmIJLZR+N6/H85MivGXHu39jOwONqB7tVACufRty4FNecn8tEiQL2SAKA==} peerDependencies: react: ^16.8.0 || ^17.0.0 @@ -12465,7 +12224,7 @@ packages: resolve-from: 5.0.0 style-loader: 1.3.0_webpack@4.46.0 telejson: 5.3.3 - terser-webpack-plugin: 4.2.3_acorn@8.8.0+webpack@4.46.0 + terser-webpack-plugin: 4.2.3_acorn@8.8.1+webpack@4.46.0 ts-dedent: 2.2.0 typescript: 4.8.4 url-loader: 4.1.1_lit45vopotvaqup7lrvlnvtxwy @@ -12546,7 +12305,7 @@ packages: - webpack-command dev: true - /@storybook/manager-webpack5/6.4.19_bwojc7ty2esajt4slmy7gzriiq: + /@storybook/manager-webpack5/6.4.19_3n4gsnmxucj3bywv6syggoiztm: resolution: {integrity: sha512-hVjWhWAOgWaymBy0HeRskN+MfKLpqLP4Txfw+3Xqg1qplgexV0w2O4BQrS/SNEH4V/1qF9h8XTsk3L3oQIj3Mg==} peerDependencies: react: ^16.8.0 || ^17.0.0 @@ -12575,7 +12334,7 @@ packages: file-system-cache: 1.0.5 find-up: 5.0.0 fs-extra: 9.1.0 - html-webpack-plugin: 5.5.0_acorn@8.8.0+webpack@5.70.0 + html-webpack-plugin: 5.5.0_acorn@8.8.1+webpack@5.70.0 node-fetch: 2.6.7 process: 0.11.10 react: 17.0.2 @@ -12585,7 +12344,7 @@ packages: resolve-from: 5.0.0 style-loader: 2.0.0_webpack@5.70.0 telejson: 5.3.3 - terser-webpack-plugin: 5.2.5_acorn@8.8.0+webpack@5.70.0 + terser-webpack-plugin: 5.2.5_acorn@8.8.1+webpack@5.70.0 ts-dedent: 2.2.0 typescript: 4.8.4 util-deprecate: 1.0.2 @@ -12667,7 +12426,7 @@ packages: - supports-color dev: true - /@storybook/react/6.4.19_bgawh2hvs42ew64xztrhknnlry: + /@storybook/react/6.4.19_a55upwwpdj22rf6pemjk4qxjbi: resolution: {integrity: sha512-5b3i8jkVrjQGmcxxxXwCduHPIh+cluWkfeweKeQOe+lW4BR8fuUICo3AMLrYPAtB/UcaJyYkIYmTvF2mkfepFA==} engines: {node: '>=10.13.0'} hasBin: true @@ -12687,7 +12446,7 @@ packages: '@babel/preset-react': 7.16.7_@babel+core@7.17.8 '@pmmmwh/react-refresh-webpack-plugin': 0.5.1_a3gyllrqvxpec3fpybsrposvju '@storybook/addons': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/core': 6.4.19_cwkpkezp45pc2xqqskbtjzmzb4 + '@storybook/core': 6.4.19_4cb7vxhorbasgfyagprjvpaxzu '@storybook/core-common': 6.4.19_56jbash75ng5psbctf36wqywr4 '@storybook/csf': 0.0.2--canary.87bc651.0 '@storybook/node-logger': 6.4.19 @@ -12732,7 +12491,7 @@ packages: - webpack-plugin-serve dev: true - /@storybook/react/6.4.19_hyxuuzpmppcxva5upf6kk6zg4m: + /@storybook/react/6.4.19_glozp6fblhaty2oacwbjl7ao2i: resolution: {integrity: sha512-5b3i8jkVrjQGmcxxxXwCduHPIh+cluWkfeweKeQOe+lW4BR8fuUICo3AMLrYPAtB/UcaJyYkIYmTvF2mkfepFA==} engines: {node: '>=10.13.0'} hasBin: true @@ -12752,7 +12511,7 @@ packages: '@babel/preset-react': 7.16.7_@babel+core@7.17.8 '@pmmmwh/react-refresh-webpack-plugin': 0.5.1_a3gyllrqvxpec3fpybsrposvju '@storybook/addons': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/core': 6.4.19_khiz5aumqhidkhlg2zv2fpwlya + '@storybook/core': 6.4.19_p3r3fihtzjpxjnglz4l5qyfmaa '@storybook/core-common': 6.4.19_bhvadzvbuq4c4gucumdoppg3by '@storybook/csf': 0.0.2--canary.87bc651.0 '@storybook/node-logger': 6.4.19 @@ -12797,7 +12556,7 @@ packages: - webpack-plugin-serve dev: true - /@storybook/react/6.4.19_rs26ab2uzoae75jlo5at3ry5ie: + /@storybook/react/6.4.19_oycjqkyefi4akx2twppuux3udq: resolution: {integrity: sha512-5b3i8jkVrjQGmcxxxXwCduHPIh+cluWkfeweKeQOe+lW4BR8fuUICo3AMLrYPAtB/UcaJyYkIYmTvF2mkfepFA==} engines: {node: '>=10.13.0'} hasBin: true @@ -12817,7 +12576,7 @@ packages: '@babel/preset-react': 7.16.7_@babel+core@7.17.8 '@pmmmwh/react-refresh-webpack-plugin': 0.5.1_a3gyllrqvxpec3fpybsrposvju '@storybook/addons': 6.4.19_sfoxds7t5ydpegc3knd667wn6m - '@storybook/core': 6.4.19_xzab24xk2ppqlw525pofyj44uy + '@storybook/core': 6.4.19_hxw5eumcvhbkoh74pcqihkovhi '@storybook/core-common': 6.4.19_bhvadzvbuq4c4gucumdoppg3by '@storybook/csf': 0.0.2--canary.87bc651.0 '@storybook/node-logger': 6.4.19 @@ -13823,7 +13582,6 @@ packages: /@types/uuid/8.3.4: resolution: {integrity: sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==} - dev: false /@types/vinyl/2.0.6: resolution: {integrity: sha512-ayJ0iOCDNHnKpKTgBG6Q6JOnHTj9zFta+3j2b8Ejza0e4cvRyMn0ZoLEmbPrTHe5YYRlDYPvPWVdV4cTaRyH7g==} @@ -15294,7 +15052,7 @@ packages: '@babel/preset-typescript': 7.16.7_@babel+core@7.16.12 '@babel/runtime': 7.17.7 '@wordpress/babel-plugin-import-jsx-pragma': 3.1.0_@babel+core@7.16.12 - '@wordpress/browserslist-config': 4.1.0 + '@wordpress/browserslist-config': 4.1.3 '@wordpress/element': 4.20.0 '@wordpress/warning': 2.2.2 browserslist: 4.19.3 @@ -15314,7 +15072,7 @@ packages: '@babel/preset-typescript': 7.16.7_@babel+core@7.17.8 '@babel/runtime': 7.17.7 '@wordpress/babel-plugin-import-jsx-pragma': 3.1.2_@babel+core@7.17.8 - '@wordpress/browserslist-config': 4.1.2 + '@wordpress/browserslist-config': 4.1.3 '@wordpress/element': 4.20.0 '@wordpress/warning': 2.4.1 browserslist: 4.20.2 @@ -15334,7 +15092,7 @@ packages: '@babel/preset-typescript': 7.18.6_@babel+core@7.17.8 '@babel/runtime': 7.19.0 '@wordpress/babel-plugin-import-jsx-pragma': 4.2.0_@babel+core@7.17.8 - '@wordpress/browserslist-config': 5.2.0 + '@wordpress/browserslist-config': 5.7.0 '@wordpress/element': 4.20.0 '@wordpress/warning': 2.19.0 browserslist: 4.21.4 @@ -15613,6 +15371,7 @@ packages: /@wordpress/browserslist-config/4.1.0: resolution: {integrity: sha512-RSJhgY2xmz6yAdDNhz/NvAO6JS+91vv9cVL7VDG2CftbyjTXBef05vWt3FzZhfeF0xUrYdpZL1PVpxmJiKvbEg==} engines: {node: '>=12'} + dev: true /@wordpress/browserslist-config/4.1.2: resolution: {integrity: sha512-UH0Ifmm4tEjVPOtiqH6yxDvk2EKtqSAhnyhyfSIb0wUnEoGsWTjREZjzuhgjt/I2nTqfg+0gUSzL5D0yQH6wDQ==} @@ -15622,10 +15381,9 @@ packages: /@wordpress/browserslist-config/4.1.3: resolution: {integrity: sha512-M4WQ0C4zCfMWyCmK40git3rfPdNkRwg5boGjoTL4LSdhrY+rtchFAtfOHS9KovAZ5ZzTB0gyZsCu/QKZlPClog==} engines: {node: '>=12'} - dev: true - /@wordpress/browserslist-config/5.2.0: - resolution: {integrity: sha512-19PdasKR0tfZDitra72XFYCvTYRzeQMb0fA39lkPaM8th80s5U03RZx50mKeKFZLPMF1tVJmBG5wD367LNIoeg==} + /@wordpress/browserslist-config/5.7.0: + resolution: {integrity: sha512-d0wx5DXjGsMDurijJe006lm4FFKjbj2mM9I3MoXR0HCzMy8xk5fl6ZY2574yx4pea+f/UTKfDBi8ArUvhsjGOA==} engines: {node: '>=14'} dev: false @@ -17517,7 +17275,7 @@ packages: dependencies: '@svgr/webpack': 5.5.0 '@wordpress/babel-preset-default': 6.6.1 - '@wordpress/browserslist-config': 4.1.2 + '@wordpress/browserslist-config': 4.1.3 '@wordpress/dependency-extraction-webpack-plugin': 3.4.1_webpack@5.70.0 '@wordpress/eslint-plugin': 9.3.0_gvdiv7jt74qfcmw4bmvrh4kane '@wordpress/jest-preset-default': 7.1.3_3kt4xu3sgkhoqdvxwcvxppk7nm @@ -17924,12 +17682,12 @@ packages: acorn: 7.4.1 acorn-walk: 7.2.0 - /acorn-import-assertions/1.8.0_acorn@8.8.0: + /acorn-import-assertions/1.8.0_acorn@8.8.1: resolution: {integrity: sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==} peerDependencies: acorn: ^8 dependencies: - acorn: 8.8.0 + acorn: 8.8.1 /acorn-jsx/5.3.2_acorn@6.4.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} @@ -19069,7 +18827,7 @@ packages: dependencies: '@babel/compat-data': 7.19.3 '@babel/core': 7.12.9 - '@babel/helper-define-polyfill-provider': 0.3.1_@babel+core@7.12.9 + '@babel/helper-define-polyfill-provider': 0.3.3_@babel+core@7.12.9 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -19082,7 +18840,7 @@ packages: dependencies: '@babel/compat-data': 7.19.3 '@babel/core': 7.16.12 - '@babel/helper-define-polyfill-provider': 0.3.1_@babel+core@7.16.12 + '@babel/helper-define-polyfill-provider': 0.3.3_@babel+core@7.16.12 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -19144,7 +18902,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-define-polyfill-provider': 0.3.0_@babel+core@7.12.9 + '@babel/helper-define-polyfill-provider': 0.3.3_@babel+core@7.12.9 core-js-compat: 3.25.5 transitivePeerDependencies: - supports-color @@ -19156,7 +18914,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.16.12 - '@babel/helper-define-polyfill-provider': 0.3.0_@babel+core@7.16.12 + '@babel/helper-define-polyfill-provider': 0.3.3_@babel+core@7.16.12 core-js-compat: 3.25.5 transitivePeerDependencies: - supports-color @@ -19168,7 +18926,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.17.8 - '@babel/helper-define-polyfill-provider': 0.3.0_@babel+core@7.17.8 + '@babel/helper-define-polyfill-provider': 0.3.3_@babel+core@7.17.8 core-js-compat: 3.25.5 transitivePeerDependencies: - supports-color @@ -21019,7 +20777,7 @@ packages: resolution: {integrity: sha512-WpAmaKbMNmS3OProfHIdJiNleNJdgUrJfbKArXua28QF7+0CoZjlLn0lp6vlc+dl5r2/X9GQiQRQQU4BzSa69w==} /concat-map/0.0.1: - resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} /concat-stream/1.6.2: resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==} @@ -21186,7 +20944,7 @@ packages: /core-js-compat/3.19.1: resolution: {integrity: sha512-Q/VJ7jAF/y68+aUsQJ/afPOewdsGkDtcMb40J8MbuWKlK3Y+wtHq8bTHKPj2WKWLIqmS5JhHs4CzHtz6pT2W6g==} dependencies: - browserslist: 4.20.4 + browserslist: 4.21.4 semver: 7.0.0 dev: true @@ -21485,7 +21243,7 @@ packages: postcss-value-parser: 4.2.0 schema-utils: 2.7.1 semver: 6.3.0 - webpack: 5.70.0_webpack-cli@3.3.12 + webpack: 5.70.0 /css-loader/5.2.7_webpack@5.70.0: resolution: {integrity: sha512-Q7mOvpBNBG7YrVGMxRxcBJZFL75o+cH2abNASdibkj/fffYD8qWbInZrD0S9ccI6vZclF3DsHE7njGlLtaHbhg==} @@ -26835,7 +26593,7 @@ packages: terser: 4.8.0 dev: true - /html-minifier-terser/6.1.0_acorn@8.8.0: + /html-minifier-terser/6.1.0_acorn@8.8.1: resolution: {integrity: sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw==} engines: {node: '>=12'} hasBin: true @@ -26846,7 +26604,7 @@ packages: he: 1.2.0 param-case: 3.0.4 relateurl: 0.2.7 - terser: 5.10.0_acorn@8.8.0 + terser: 5.10.0_acorn@8.8.1 transitivePeerDependencies: - acorn dev: true @@ -26878,14 +26636,14 @@ packages: webpack: 4.46.0 dev: true - /html-webpack-plugin/5.5.0_acorn@8.8.0+webpack@5.70.0: + /html-webpack-plugin/5.5.0_acorn@8.8.1+webpack@5.70.0: resolution: {integrity: sha512-sy88PC2cRTVxvETRgUHFrL4No3UxvcH8G1NepGhqaTT+GXN2kTamqasot0inS5hXeg1cMbFDt27zzo9p35lZVw==} engines: {node: '>=10.13.0'} peerDependencies: webpack: ^5.20.0 dependencies: '@types/html-minifier-terser': 6.1.0 - html-minifier-terser: 6.1.0_acorn@8.8.0 + html-minifier-terser: 6.1.0_acorn@8.8.1 lodash: 4.17.21 pretty-error: 4.0.0 tapable: 2.2.1 @@ -36448,13 +36206,6 @@ packages: dependencies: regenerate: 1.4.2 - /regenerate-unicode-properties/9.0.0: - resolution: {integrity: sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA==} - engines: {node: '>=4'} - dependencies: - regenerate: 1.4.2 - dev: true - /regenerate/1.4.2: resolution: {integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==} @@ -36498,18 +36249,6 @@ packages: resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} engines: {node: '>=8'} - /regexpu-core/4.8.0: - resolution: {integrity: sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg==} - engines: {node: '>=4'} - dependencies: - regenerate: 1.4.2 - regenerate-unicode-properties: 9.0.0 - regjsgen: 0.5.2 - regjsparser: 0.7.0 - unicode-match-property-ecmascript: 2.0.0 - unicode-match-property-value-ecmascript: 2.0.0 - dev: true - /regexpu-core/5.2.1: resolution: {integrity: sha512-HrnlNtpvqP1Xkb28tMhBUO2EbyUHdQlsnlAhzWcwHy8WJR53UWr7/MAvqrsQKMbV4qdpv03oTMG8iIhfsPFktQ==} engines: {node: '>=4'} @@ -36544,20 +36283,9 @@ packages: rc: 1.2.8 dev: true - /regjsgen/0.5.2: - resolution: {integrity: sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==} - dev: true - /regjsgen/0.7.1: resolution: {integrity: sha512-RAt+8H2ZEzHeYWxZ3H2z6tF18zyyOnlcdaafLrm21Bguj7uZy6ULibiAFdXEtKQY4Sy7wDTwDiOazasMLc4KPA==} - /regjsparser/0.7.0: - resolution: {integrity: sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ==} - hasBin: true - dependencies: - jsesc: 0.5.0 - dev: true - /regjsparser/0.9.1: resolution: {integrity: sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==} hasBin: true @@ -37127,7 +36855,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.1.1 semver: 7.3.5 - webpack: 5.70.0_webpack-cli@3.3.12 + webpack: 5.70.0 /sass-loader/12.6.0_sass@1.49.9+webpack@5.70.0: resolution: {integrity: sha512-oLTaH0YCtX4cfnJZxKSLAyglED0naiYfNG1iXfU5w1LNZ+ukoA5DtyDIN5zmKVZwYNJP4KRc5Y3hkWga+7tYfA==} @@ -38968,7 +38696,7 @@ packages: - bluebird dev: true - /terser-webpack-plugin/4.2.3_acorn@8.8.0+webpack@4.46.0: + /terser-webpack-plugin/4.2.3_acorn@8.8.1+webpack@4.46.0: resolution: {integrity: sha512-jTgXh40RnvOrLQNgIkwEKnQ8rmHjHK4u+6UBEi+W+FPmvb+uo+chJXntKe7/3lW5mNysgSWD60KyesnhW8D6MQ==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -38981,7 +38709,7 @@ packages: schema-utils: 3.1.1 serialize-javascript: 5.0.1 source-map: 0.6.1 - terser: 5.10.0_acorn@8.8.0 + terser: 5.10.0_acorn@8.8.1 webpack: 4.46.0 webpack-sources: 1.4.3 transitivePeerDependencies: @@ -38989,6 +38717,33 @@ packages: - bluebird dev: true + /terser-webpack-plugin/5.2.5_2afcvd4rlhgtdg42ipbhcxtcri: + resolution: {integrity: sha512-3luOVHku5l0QBeYS8r4CdHYWEGMmIj3H1U64jgkdZzECcSOJAyJ9TjuqcQZvw1Y+4AOBN9SeYJPJmFn2cM4/2g==} + engines: {node: '>= 10.13.0'} + peerDependencies: + '@swc/core': '*' + esbuild: '*' + uglify-js: '*' + webpack: ^5.1.0 + peerDependenciesMeta: + '@swc/core': + optional: true + esbuild: + optional: true + uglify-js: + optional: true + dependencies: + jest-worker: 27.5.1 + schema-utils: 3.1.1 + serialize-javascript: 6.0.0 + source-map: 0.6.1 + terser: 5.10.0_acorn@8.8.1 + uglify-js: 3.14.5 + webpack: 5.70.0_bgqcrdgdviybk52kjcpjat65sa + transitivePeerDependencies: + - acorn + dev: true + /terser-webpack-plugin/5.2.5_5ksa6e7vqalagerztjs2ao5siy: resolution: {integrity: sha512-3luOVHku5l0QBeYS8r4CdHYWEGMmIj3H1U64jgkdZzECcSOJAyJ9TjuqcQZvw1Y+4AOBN9SeYJPJmFn2cM4/2g==} engines: {node: '>= 10.13.0'} @@ -39016,7 +38771,7 @@ packages: - acorn dev: true - /terser-webpack-plugin/5.2.5_acorn@8.8.0+webpack@5.70.0: + /terser-webpack-plugin/5.2.5_acorn@8.8.1+webpack@5.70.0: resolution: {integrity: sha512-3luOVHku5l0QBeYS8r4CdHYWEGMmIj3H1U64jgkdZzECcSOJAyJ9TjuqcQZvw1Y+4AOBN9SeYJPJmFn2cM4/2g==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -39036,38 +38791,11 @@ packages: schema-utils: 3.1.1 serialize-javascript: 6.0.0 source-map: 0.6.1 - terser: 5.10.0_acorn@8.8.0 + terser: 5.10.0_acorn@8.8.1 webpack: 5.70.0 transitivePeerDependencies: - acorn - /terser-webpack-plugin/5.2.5_olxr47tjskqvb6jdynqnsbbqhq: - resolution: {integrity: sha512-3luOVHku5l0QBeYS8r4CdHYWEGMmIj3H1U64jgkdZzECcSOJAyJ9TjuqcQZvw1Y+4AOBN9SeYJPJmFn2cM4/2g==} - engines: {node: '>= 10.13.0'} - peerDependencies: - '@swc/core': '*' - esbuild: '*' - uglify-js: '*' - webpack: ^5.1.0 - peerDependenciesMeta: - '@swc/core': - optional: true - esbuild: - optional: true - uglify-js: - optional: true - dependencies: - jest-worker: 27.5.1 - schema-utils: 3.1.1 - serialize-javascript: 6.0.0 - source-map: 0.6.1 - terser: 5.10.0_acorn@8.8.0 - uglify-js: 3.14.5 - webpack: 5.70.0_bgqcrdgdviybk52kjcpjat65sa - transitivePeerDependencies: - - acorn - dev: true - /terser/4.8.0: resolution: {integrity: sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==} engines: {node: '>=6.0.0'} @@ -39111,7 +38839,7 @@ packages: source-map-support: 0.5.20 dev: true - /terser/5.10.0_acorn@8.8.0: + /terser/5.10.0_acorn@8.8.1: resolution: {integrity: sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==} engines: {node: '>=10'} hasBin: true @@ -39121,7 +38849,7 @@ packages: acorn: optional: true dependencies: - acorn: 8.8.0 + acorn: 8.8.1 commander: 2.20.3 source-map: 0.7.3 source-map-support: 0.5.20 @@ -40863,7 +40591,7 @@ packages: engines: {node: '>= 10.13.0'} hasBin: true dependencies: - acorn: 8.8.0 + acorn: 8.8.1 acorn-walk: 8.2.0 chalk: 4.1.2 commander: 7.2.0 @@ -41225,8 +40953,8 @@ packages: '@webassemblyjs/ast': 1.11.1 '@webassemblyjs/wasm-edit': 1.11.1 '@webassemblyjs/wasm-parser': 1.11.1 - acorn: 8.8.0 - acorn-import-assertions: 1.8.0_acorn@8.8.0 + acorn: 8.8.1 + acorn-import-assertions: 1.8.0_acorn@8.8.1 browserslist: 4.21.4 chrome-trace-event: 1.0.3 enhanced-resolve: 5.9.2 @@ -41241,7 +40969,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.1.1 tapable: 2.2.1 - terser-webpack-plugin: 5.2.5_acorn@8.8.0+webpack@5.70.0 + terser-webpack-plugin: 5.2.5_acorn@8.8.1+webpack@5.70.0 watchpack: 2.3.1 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -41264,8 +40992,8 @@ packages: '@webassemblyjs/ast': 1.11.1 '@webassemblyjs/wasm-edit': 1.11.1 '@webassemblyjs/wasm-parser': 1.11.1 - acorn: 8.8.0 - acorn-import-assertions: 1.8.0_acorn@8.8.0 + acorn: 8.8.1 + acorn-import-assertions: 1.8.0_acorn@8.8.1 browserslist: 4.21.4 chrome-trace-event: 1.0.3 enhanced-resolve: 5.9.2 @@ -41280,7 +41008,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.1.1 tapable: 2.2.1 - terser-webpack-plugin: 5.2.5_olxr47tjskqvb6jdynqnsbbqhq + terser-webpack-plugin: 5.2.5_2afcvd4rlhgtdg42ipbhcxtcri watchpack: 2.3.1 webpack-cli: 4.9.2_webpack@5.70.0 webpack-sources: 3.2.3 @@ -41305,8 +41033,8 @@ packages: '@webassemblyjs/ast': 1.11.1 '@webassemblyjs/wasm-edit': 1.11.1 '@webassemblyjs/wasm-parser': 1.11.1 - acorn: 8.8.0 - acorn-import-assertions: 1.8.0_acorn@8.8.0 + acorn: 8.8.1 + acorn-import-assertions: 1.8.0_acorn@8.8.1 browserslist: 4.21.4 chrome-trace-event: 1.0.3 enhanced-resolve: 5.9.2 @@ -41321,7 +41049,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.1.1 tapable: 2.2.1 - terser-webpack-plugin: 5.2.5_acorn@8.8.0+webpack@5.70.0 + terser-webpack-plugin: 5.2.5_acorn@8.8.1+webpack@5.70.0 watchpack: 2.3.1 webpack-cli: 3.3.12_webpack@5.70.0 webpack-sources: 3.2.3 @@ -41345,8 +41073,8 @@ packages: '@webassemblyjs/ast': 1.11.1 '@webassemblyjs/wasm-edit': 1.11.1 '@webassemblyjs/wasm-parser': 1.11.1 - acorn: 8.8.0 - acorn-import-assertions: 1.8.0_acorn@8.8.0 + acorn: 8.8.1 + acorn-import-assertions: 1.8.0_acorn@8.8.1 browserslist: 4.21.4 chrome-trace-event: 1.0.3 enhanced-resolve: 5.9.2 @@ -41361,7 +41089,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.1.1 tapable: 2.2.1 - terser-webpack-plugin: 5.2.5_acorn@8.8.0+webpack@5.70.0 + terser-webpack-plugin: 5.2.5_acorn@8.8.1+webpack@5.70.0 watchpack: 2.3.1 webpack-cli: 4.9.2_wbg6qaiqcwsayvtung7xs6mhka webpack-sources: 3.2.3