Merge branch 'trunk' into feature/34548-multichannel-marketing-backend
This commit is contained in:
commit
b82421fa48
|
@ -1,5 +1,6 @@
|
||||||
name: Setup WooCommerce Monorepo
|
name: Setup WooCommerce Monorepo
|
||||||
description: Handles the installation, building, and caching of the projects within the monorepo.
|
description: Handles the installation, building, and caching of the projects within the monorepo.
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
install-filters:
|
install-filters:
|
||||||
|
|
|
@ -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.'
|
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
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build release zip file
|
name: Build release zip file
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,15 @@ name: Build release asset
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build release asset
|
name: Build release asset
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|
|
@ -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 ]
|
||||||
|
} );
|
|
@ -30,6 +30,8 @@ env:
|
||||||
GIT_AUTHOR_NAME: 'WooCommerce Bot'
|
GIT_AUTHOR_NAME: 'WooCommerce Bot'
|
||||||
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
|
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
verify:
|
verify:
|
||||||
name: Verify
|
name: Verify
|
||||||
|
@ -122,6 +124,10 @@ jobs:
|
||||||
cherry-pick-run:
|
cherry-pick-run:
|
||||||
name: Run cherry pick tool
|
name: Run cherry pick tool
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
actions: write
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
needs: [prep, check-release-branch-exists]
|
needs: [prep, check-release-branch-exists]
|
||||||
if: success()
|
if: success()
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -12,11 +12,16 @@ defaults:
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }}
|
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }}
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
continue-on-error: ${{ matrix.wp == 'nightly' }}
|
continue-on-error: ${{ matrix.wp == 'nightly' }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
|
@ -10,10 +10,16 @@ concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
verify:
|
verify:
|
||||||
name: Verify
|
name: Verify
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
issues: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,14 @@ concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cot-e2e-tests-run:
|
cot-e2e-tests-run:
|
||||||
name: Runs E2E tests with COT enabled.
|
name: Runs E2E tests with COT enabled.
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
env:
|
env:
|
||||||
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
|
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
|
||||||
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-report
|
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-report
|
||||||
|
@ -66,6 +70,8 @@ jobs:
|
||||||
cot-api-tests-run:
|
cot-api-tests-run:
|
||||||
name: Runs API tests with COT enabled.
|
name: Runs API tests with COT enabled.
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
env:
|
env:
|
||||||
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-results
|
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
|
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' )
|
contains( needs.*.result, 'failure' )
|
||||||
)
|
)
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
needs: [cot-api-tests-run, cot-e2e-tests-run]
|
needs: [cot-api-tests-run, cot-e2e-tests-run]
|
||||||
steps:
|
steps:
|
||||||
- name: Create dirs
|
- name: Create dirs
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
name: Run tests against PR in an environment with COT enabled
|
name: Run tests against PR in an environment with COT enabled
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [labeled]
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cot-e2e-tests-run:
|
cot-e2e-tests-run:
|
||||||
name: Runs E2E tests with COT enabled.
|
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
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
env:
|
env:
|
||||||
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
|
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
|
||||||
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-report
|
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-report
|
||||||
|
@ -66,8 +68,9 @@ jobs:
|
||||||
|
|
||||||
cot-api-tests-run:
|
cot-api-tests-run:
|
||||||
name: Runs API tests with COT enabled.
|
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
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
env:
|
env:
|
||||||
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-results
|
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
|
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
|
if-no-files-found: ignore
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
|
|
||||||
test-summary:
|
# test-summary:
|
||||||
name: Post test results
|
# name: Post test results
|
||||||
if: |
|
# if: |
|
||||||
always() &&
|
# always() &&
|
||||||
! github.event.pull_request.head.repo.fork &&
|
# ! github.event.pull_request.head.repo.fork &&
|
||||||
(
|
# (
|
||||||
contains( needs.*.result, 'success' ) ||
|
# contains( needs.*.result, 'success' ) ||
|
||||||
contains( needs.*.result, 'failure' )
|
# contains( needs.*.result, 'failure' )
|
||||||
)
|
# )
|
||||||
runs-on: ubuntu-20.04
|
# runs-on: ubuntu-20.04
|
||||||
needs: [cot-api-tests-run, cot-e2e-tests-run]
|
# permissions:
|
||||||
steps:
|
# contents: read
|
||||||
- name: Create dirs
|
# needs: [cot-api-tests-run, cot-e2e-tests-run]
|
||||||
run: |
|
# steps:
|
||||||
mkdir -p repo
|
# - name: Create dirs
|
||||||
mkdir -p artifacts/api
|
# run: |
|
||||||
mkdir -p artifacts/e2e
|
# mkdir -p repo
|
||||||
mkdir -p output
|
# mkdir -p artifacts/api
|
||||||
|
# mkdir -p artifacts/e2e
|
||||||
- name: Checkout code
|
# mkdir -p output
|
||||||
uses: actions/checkout@v3
|
#
|
||||||
with:
|
# - name: Checkout code
|
||||||
path: repo
|
# uses: actions/checkout@v3
|
||||||
|
# with:
|
||||||
- name: Download API test report artifact
|
# path: repo
|
||||||
uses: actions/download-artifact@v3
|
#
|
||||||
with:
|
# - name: Download API test report artifact
|
||||||
name: api-test-report---pr-${{ github.event.number }}
|
# uses: actions/download-artifact@v3
|
||||||
path: artifacts/api
|
# with:
|
||||||
|
# name: api-test-report---pr-${{ github.event.number }}
|
||||||
- name: Download Playwright E2E test report artifact
|
# path: artifacts/api
|
||||||
uses: actions/download-artifact@v3
|
#
|
||||||
with:
|
# - name: Download Playwright E2E test report artifact
|
||||||
name: e2e-test-report---pr-${{ github.event.number }}
|
# uses: actions/download-artifact@v3
|
||||||
path: artifacts/e2e
|
# with:
|
||||||
|
# name: e2e-test-report---pr-${{ github.event.number }}
|
||||||
- name: Prepare test summary
|
# path: artifacts/e2e
|
||||||
id: prepare-test-summary
|
#
|
||||||
uses: actions/github-script@v6
|
# - name: Prepare test summary
|
||||||
env:
|
# id: prepare-test-summary
|
||||||
API_SUMMARY_PATH: ${{ github.workspace }}/artifacts/api/allure-report/widgets/summary.json
|
# uses: actions/github-script@v6
|
||||||
E2E_PW_SUMMARY_PATH: ${{ github.workspace }}/artifacts/e2e/allure-report/widgets/summary.json
|
# env:
|
||||||
PR_NUMBER: ${{ github.event.number }}
|
# API_SUMMARY_PATH: ${{ github.workspace }}/artifacts/api/allure-report/widgets/summary.json
|
||||||
SHA: ${{ github.event.pull_request.head.sha }}
|
# E2E_PW_SUMMARY_PATH: ${{ github.workspace }}/artifacts/e2e/allure-report/widgets/summary.json
|
||||||
with:
|
# PR_NUMBER: ${{ github.event.number }}
|
||||||
result-encoding: string
|
# SHA: ${{ github.event.pull_request.head.sha }}
|
||||||
script: |
|
# with:
|
||||||
const script = require( './repo/.github/workflows/scripts/prepare-test-summary.js' )
|
# result-encoding: string
|
||||||
return await script( { core } )
|
# script: |
|
||||||
|
# const script = require( './repo/.github/workflows/scripts/prepare-test-summary.js' )
|
||||||
- name: Find PR comment by github-actions[bot]
|
# return await script( { core } )
|
||||||
uses: peter-evans/find-comment@v2
|
#
|
||||||
id: find-comment
|
# - name: Find PR comment by github-actions[bot]
|
||||||
with:
|
# uses: peter-evans/find-comment@v2
|
||||||
issue-number: ${{ github.event.pull_request.number }}
|
# id: find-comment
|
||||||
comment-author: 'github-actions[bot]'
|
# with:
|
||||||
body-includes: Test Results Summary
|
# issue-number: ${{ github.event.pull_request.number }}
|
||||||
|
# comment-author: 'github-actions[bot]'
|
||||||
- name: Create or update PR comment
|
# body-includes: Test Results Summary
|
||||||
uses: peter-evans/create-or-update-comment@v2
|
#
|
||||||
with:
|
# - name: Create or update PR comment
|
||||||
comment-id: ${{ steps.find-comment.outputs.comment-id }}
|
# uses: peter-evans/create-or-update-comment@v2
|
||||||
issue-number: ${{ github.event.pull_request.number }}
|
# with:
|
||||||
body: ${{ steps.prepare-test-summary.outputs.result }}
|
# comment-id: ${{ steps.find-comment.outputs.comment-id }}
|
||||||
edit-mode: replace
|
# issue-number: ${{ github.event.pull_request.number }}
|
||||||
|
# body: ${{ steps.prepare-test-summary.outputs.result }}
|
||||||
publish-test-reports:
|
# edit-mode: replace
|
||||||
name: Publish test reports
|
#
|
||||||
if: |
|
# publish-test-reports:
|
||||||
always() &&
|
# name: Publish test reports
|
||||||
! github.event.pull_request.head.repo.fork &&
|
# if: |
|
||||||
(
|
# always() &&
|
||||||
contains( needs.*.result, 'success' ) ||
|
# ! github.event.pull_request.head.repo.fork &&
|
||||||
contains( needs.*.result, 'failure' )
|
# (
|
||||||
)
|
# contains( needs.*.result, 'success' ) ||
|
||||||
runs-on: ubuntu-20.04
|
# contains( needs.*.result, 'failure' )
|
||||||
needs: [cot-api-tests-run, cot-e2e-tests-run]
|
# )
|
||||||
env:
|
# runs-on: ubuntu-20.04
|
||||||
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
|
# needs: [cot-api-tests-run, cot-e2e-tests-run]
|
||||||
PR_NUMBER: ${{ github.event.number }}
|
# env:
|
||||||
RUN_ID: ${{ github.run_id }}
|
# GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
|
||||||
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
# PR_NUMBER: ${{ github.event.number }}
|
||||||
steps:
|
# RUN_ID: ${{ github.run_id }}
|
||||||
- name: Publish test reports
|
# COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||||
env:
|
# steps:
|
||||||
API_ARTIFACT: api-test-report---pr-${{ github.event.number }}
|
# - name: Publish test reports
|
||||||
E2E_ARTIFACT: e2e-test-report---pr-${{ github.event.number }}
|
# env:
|
||||||
run: |
|
# API_ARTIFACT: api-test-report---pr-${{ github.event.number }}
|
||||||
gh workflow run publish-test-reports-pr.yml \
|
# E2E_ARTIFACT: e2e-test-report---pr-${{ github.event.number }}
|
||||||
-f run_id=$RUN_ID \
|
# run: |
|
||||||
-f api_artifact=$API_ARTIFACT \
|
# gh workflow run publish-test-reports-pr.yml \
|
||||||
-f e2e_artifact=$E2E_ARTIFACT \
|
# -f run_id=$RUN_ID \
|
||||||
-f pr_number=$PR_NUMBER \
|
# -f api_artifact=$API_ARTIFACT \
|
||||||
-f commit_sha=$COMMIT_SHA \
|
# -f e2e_artifact=$E2E_ARTIFACT \
|
||||||
-f s3_root=public \
|
# -f pr_number=$PR_NUMBER \
|
||||||
--repo woocommerce/woocommerce-test-reports
|
# -f commit_sha=$COMMIT_SHA \
|
||||||
|
# -f s3_root=public \
|
||||||
|
# --repo woocommerce/woocommerce-test-reports
|
||||||
|
|
|
@ -4,11 +4,15 @@ on:
|
||||||
branches: ["trunk", "release/**"]
|
branches: ["trunk", "release/**"]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: github.repository == 'woocommerce/woocommerce'
|
if: github.repository == 'woocommerce/woocommerce'
|
||||||
name: Build WooCommerce zip
|
name: Build WooCommerce zip
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
@ -35,6 +39,8 @@ jobs:
|
||||||
name: Push to Mirror
|
name: Push to Mirror
|
||||||
needs: [build]
|
needs: [build]
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- name: Create directories
|
- name: Create directories
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -3,6 +3,9 @@ on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * *' # Run at 12 AM UTC.
|
- cron: '0 0 * * *' # Run at 12 AM UTC.
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: github.repository_owner == 'woocommerce'
|
if: github.repository_owner == 'woocommerce'
|
||||||
|
@ -12,6 +15,8 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
build: [trunk]
|
build: [trunk]
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
@ -40,6 +45,8 @@ jobs:
|
||||||
update:
|
update:
|
||||||
name: Update nightly tag commit ref
|
name: Update nightly tag commit ref
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- name: Update nightly tag
|
- name: Update nightly tag
|
||||||
uses: richardsimko/github-tag-action@v1.0.5
|
uses: richardsimko/github-tag-action@v1.0.5
|
||||||
|
|
|
@ -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.'
|
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
|
required: false
|
||||||
default: '-a'
|
default: '-a'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Run packages release script
|
name: Run packages release script
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,15 @@ env:
|
||||||
GIT_AUTHOR_NAME: 'WooCommerce Bot'
|
GIT_AUTHOR_NAME: 'WooCommerce Bot'
|
||||||
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
|
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
changelog-version-update:
|
changelog-version-update:
|
||||||
name: Update changelog and version
|
name: Update changelog and version
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|
|
@ -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"'
|
|
@ -1,16 +1,22 @@
|
||||||
name: Run tests against PR
|
name: Run tests against PR
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**/changelog/**'
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
e2e-tests-run:
|
e2e-tests-run:
|
||||||
name: Runs E2E tests.
|
name: Runs E2E tests.
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
env:
|
env:
|
||||||
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-results
|
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
|
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-report
|
||||||
|
@ -79,6 +85,8 @@ jobs:
|
||||||
api-tests-run:
|
api-tests-run:
|
||||||
name: Runs API tests.
|
name: Runs API tests.
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
env:
|
env:
|
||||||
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-results
|
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
|
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-report
|
||||||
|
@ -129,6 +137,8 @@ jobs:
|
||||||
k6-tests-run:
|
k6-tests-run:
|
||||||
name: Runs k6 Performance tests
|
name: Runs k6 Performance tests
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
@ -162,6 +172,10 @@ jobs:
|
||||||
)
|
)
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
needs: [api-tests-run, e2e-tests-run]
|
needs: [api-tests-run, e2e-tests-run]
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
env:
|
env:
|
||||||
E2E_GRAND_TOTAL: ${{needs.e2e-tests-run.outputs.E2E_GRAND_TOTAL}}
|
E2E_GRAND_TOTAL: ${{needs.e2e-tests-run.outputs.E2E_GRAND_TOTAL}}
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -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"'
|
|
@ -1,16 +1,22 @@
|
||||||
name: Build Live Branch
|
name: Build Live Branch
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**/changelog/**'
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
# Cancel concurrent jobs on pull_request but not push, by including the run_id in the concurrency group for the latter.
|
# 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 }}
|
group: build-${{ github.event_name == 'push' && github.run_id || 'pr' }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: github.repository_owner == 'woocommerce'
|
if: github.repository_owner == 'woocommerce'
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|
|
@ -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"'
|
|
@ -1,6 +1,8 @@
|
||||||
name: Run code coverage on PR
|
name: Run code coverage on PR
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**/changelog/**'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
|
@ -8,11 +10,16 @@ defaults:
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Code coverage (PHP 7.4, WP Latest)
|
name: Code coverage (PHP 7.4, WP Latest)
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
services:
|
services:
|
||||||
database:
|
database:
|
||||||
image: mysql:5.6
|
image: mysql:5.6
|
||||||
|
@ -36,8 +43,7 @@ jobs:
|
||||||
|
|
||||||
- name: Build Admin feature config
|
- name: Build Admin feature config
|
||||||
working-directory: plugins/woocommerce
|
working-directory: plugins/woocommerce
|
||||||
run:
|
run: pnpm run build:feature-config
|
||||||
pnpm run build:feature-config
|
|
||||||
|
|
||||||
- name: Init DB and WP
|
- name: Init DB and WP
|
||||||
working-directory: plugins/woocommerce
|
working-directory: plugins/woocommerce
|
||||||
|
|
|
@ -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"'
|
|
@ -1,5 +1,8 @@
|
||||||
name: Run code sniff on PR
|
name: Run code sniff on PR
|
||||||
on: pull_request
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**/changelog/**'
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -8,11 +11,16 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
env:
|
env:
|
||||||
PHPCS: ./plugins/woocommerce/vendor/bin/phpcs # Run WooCommerce phpcs setup in phpcs-changed instead of default
|
PHPCS: ./plugins/woocommerce/vendor/bin/phpcs # Run WooCommerce phpcs setup in phpcs-changed instead of default
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Code sniff (PHP 7.4, WP Latest)
|
name: Code sniff (PHP 7.4, WP Latest)
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -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"'
|
|
@ -1,9 +1,17 @@
|
||||||
name: Highlight templates changes
|
name: Highlight templates changes
|
||||||
on: pull_request
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**/changelog/**'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
name: Check pull request changes to highlight
|
name: Check pull request changes to highlight
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
outputs:
|
outputs:
|
||||||
results: ${{ steps.results.outputs.results }}
|
results: ${{ steps.results.outputs.results }}
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -6,10 +6,15 @@ on:
|
||||||
concurrency:
|
concurrency:
|
||||||
group: changelogger-${{ github.event_name }}-${{ github.ref }}
|
group: changelogger-${{ github.event_name }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
changelogger_used:
|
changelogger_used:
|
||||||
name: Changelogger use
|
name: Changelogger use
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
|
@ -1,14 +1,21 @@
|
||||||
name: Lint and tests for JS packages and woocommerce-admin/client
|
name: Lint and tests for JS packages and woocommerce-admin/client
|
||||||
|
|
||||||
on: pull_request
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**/changelog/**'
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-test-js:
|
lint-test-js:
|
||||||
name: Lint and Test JS
|
name: Lint and Test JS
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|
|
@ -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"'
|
|
@ -8,11 +8,16 @@ concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
label_project:
|
label_project:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/labeler@v3
|
- uses: actions/labeler@v3
|
||||||
with:
|
with:
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
configuration-path: .github/project-pr-labeler.yml
|
configuration-path: .github/project-pr-labeler.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"'
|
|
@ -1,6 +1,8 @@
|
||||||
name: Run smoke tests against pull request.
|
name: Run smoke tests against pull request.
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**/changelog/**'
|
||||||
branches:
|
branches:
|
||||||
- trunk
|
- trunk
|
||||||
types:
|
types:
|
||||||
|
@ -9,11 +11,16 @@ concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prcheck:
|
prcheck:
|
||||||
name: Smoke test a pull request.
|
name: Smoke test a pull request.
|
||||||
if: "${{ contains(github.event.label.name, 'run: smoke tests') }}"
|
if: "${{ contains(github.event.label.name, 'run: smoke tests') }}"
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|
|
@ -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"'
|
|
@ -1,6 +1,8 @@
|
||||||
name: Run unit tests on PR
|
name: Run unit tests on PR
|
||||||
on:
|
on:
|
||||||
pull_request
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**/changelog/**'
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -8,11 +10,15 @@ concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }}
|
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }}
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
continue-on-error: ${{ matrix.wp == 'nightly' }}
|
continue-on-error: ${{ matrix.wp == 'nightly' }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
@ -22,9 +28,9 @@ jobs:
|
||||||
include:
|
include:
|
||||||
- wp: nightly
|
- wp: nightly
|
||||||
php: '7.4'
|
php: '7.4'
|
||||||
- wp: '5.9'
|
- wp: '6.0'
|
||||||
php: 7.4
|
php: 7.4
|
||||||
- wp: '5.8'
|
- wp: '5.9'
|
||||||
php: 7.4
|
php: 7.4
|
||||||
services:
|
services:
|
||||||
database:
|
database:
|
||||||
|
@ -47,19 +53,6 @@ jobs:
|
||||||
php --version
|
php --version
|
||||||
composer --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
|
|
||||||
|
|
||||||
- name: Init DB and WP
|
- name: Init DB and WP
|
||||||
working-directory: plugins/woocommerce
|
working-directory: plugins/woocommerce
|
||||||
run: ./tests/bin/install.sh woo_test root root 127.0.0.1 ${{ matrix.wp }}
|
run: ./tests/bin/install.sh woo_test root root 127.0.0.1 ${{ matrix.wp }}
|
||||||
|
|
|
@ -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.'
|
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
|
required: false
|
||||||
default: '-a'
|
default: '-a'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare:
|
prepare:
|
||||||
name: Run prepare script
|
name: Run prepare script
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,14 @@ concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prime:
|
prime:
|
||||||
name: Prime cache
|
name: Prime cache
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,15 @@ on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [closed]
|
types: [closed]
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
process-pull-request-after-merge:
|
process-pull-request-after-merge:
|
||||||
name: "Process a pull request after it's merged"
|
name: "Process a pull request after it's merged"
|
||||||
if: github.event.pull_request.merged == true
|
if: github.event.pull_request.merged == true
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: "Get the action scripts"
|
- name: "Get the action scripts"
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -15,9 +15,14 @@ env:
|
||||||
GIT_AUTHOR_NAME: 'WooCommerce Bot'
|
GIT_AUTHOR_NAME: 'WooCommerce Bot'
|
||||||
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
|
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-changelog-prs:
|
create-changelog-prs:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
|
@ -20,6 +20,8 @@ env:
|
||||||
GIT_AUTHOR_NAME: 'WooCommerce Bot'
|
GIT_AUTHOR_NAME: 'WooCommerce Bot'
|
||||||
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
|
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
verify-code-freeze:
|
verify-code-freeze:
|
||||||
name: 'Verify that today is the day of the 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:
|
maybe-create-next-milestone-and-release-branch:
|
||||||
name: 'Maybe create next milestone and release branch'
|
name: 'Maybe create next milestone and release branch'
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
needs: verify-code-freeze
|
needs: verify-code-freeze
|
||||||
if: needs.verify-code-freeze.outputs.freeze == 0
|
if: needs.verify-code-freeze.outputs.freeze == 0
|
||||||
outputs:
|
outputs:
|
||||||
|
@ -84,6 +88,9 @@ jobs:
|
||||||
prep-trunk:
|
prep-trunk:
|
||||||
name: Preps trunk for next development cycle
|
name: Preps trunk for next development cycle
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
needs: maybe-create-next-milestone-and-release-branch
|
needs: maybe-create-next-milestone-and-release-branch
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
|
@ -151,6 +158,8 @@ jobs:
|
||||||
trigger-changelog-action:
|
trigger-changelog-action:
|
||||||
name: 'Trigger changelog action'
|
name: 'Trigger changelog action'
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
actions: write
|
||||||
needs: maybe-create-next-milestone-and-release-branch
|
needs: maybe-create-next-milestone-and-release-branch
|
||||||
steps:
|
steps:
|
||||||
- name: 'Trigger changelog action'
|
- name: 'Trigger changelog action'
|
||||||
|
|
|
@ -3,6 +3,8 @@ on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '25 7 * * *'
|
- cron: '25 7 * * *'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ping_site:
|
ping_site:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
|
@ -14,10 +14,14 @@ concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
e2e-tests:
|
e2e-tests:
|
||||||
name: E2E tests on nightly build
|
name: E2E tests on nightly build
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
env:
|
env:
|
||||||
ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }}
|
ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }}
|
||||||
ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }}
|
ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }}
|
||||||
|
@ -77,6 +81,8 @@ jobs:
|
||||||
api-tests:
|
api-tests:
|
||||||
name: API tests on nightly build
|
name: API tests on nightly build
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
needs: [e2e-tests]
|
needs: [e2e-tests]
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
env:
|
env:
|
||||||
|
@ -121,6 +127,8 @@ jobs:
|
||||||
k6-tests:
|
k6-tests:
|
||||||
name: k6 tests on nightly build
|
name: k6 tests on nightly build
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
needs: [api-tests]
|
needs: [api-tests]
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
steps:
|
steps:
|
||||||
|
@ -171,6 +179,8 @@ jobs:
|
||||||
test-plugins:
|
test-plugins:
|
||||||
name: Smoke tests on trunk with ${{ matrix.plugin }} plugin installed
|
name: Smoke tests on trunk with ${{ matrix.plugin }} plugin installed
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
env:
|
env:
|
||||||
USE_WP_ENV: 1
|
USE_WP_ENV: 1
|
||||||
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
|
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
|
||||||
|
@ -244,6 +254,8 @@ jobs:
|
||||||
( success() || failure() ) &&
|
( success() || failure() ) &&
|
||||||
! github.event.pull_request.head.repo.fork
|
! github.event.pull_request.head.repo.fork
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
needs: [test-plugins, k6-tests]
|
needs: [test-plugins, k6-tests]
|
||||||
steps:
|
steps:
|
||||||
- name: Create dirs
|
- name: Create dirs
|
||||||
|
|
|
@ -5,10 +5,15 @@ on:
|
||||||
release_id:
|
release_id:
|
||||||
description: 'WooCommerce Release Id'
|
description: 'WooCommerce Release Id'
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
login-run:
|
login-run:
|
||||||
name: Daily smoke test on release.
|
name: Daily smoke test on release.
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
@ -49,6 +54,8 @@ jobs:
|
||||||
test-wp-version:
|
test-wp-version:
|
||||||
name: Smoke test on L-${{ matrix.wp }} WordPress version
|
name: Smoke test on L-${{ matrix.wp }} WordPress version
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
wp: ['1', '2']
|
wp: ['1', '2']
|
||||||
|
@ -104,6 +111,8 @@ jobs:
|
||||||
test-plugins:
|
test-plugins:
|
||||||
name: Smoke tests with ${{ matrix.plugin }} plugin installed
|
name: Smoke tests with ${{ matrix.plugin }} plugin installed
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|
|
@ -3,11 +3,17 @@ on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '21 0 * * *'
|
- cron: '21 0 * * *'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stale:
|
stale:
|
||||||
if: |
|
if: |
|
||||||
! contains(github.event.issue.labels.*.name, 'type: enhancement')
|
! contains(github.event.issue.labels.*.name, 'type: enhancement')
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@v3
|
- uses: actions/stale@v3
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -6,9 +6,14 @@ on:
|
||||||
- trunk
|
- trunk
|
||||||
paths:
|
paths:
|
||||||
- '**/package.json'
|
- '**/package.json'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
syncpack:
|
syncpack:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
name: syncpack
|
name: syncpack
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout'
|
- name: 'Checkout'
|
||||||
|
|
|
@ -4,9 +4,14 @@ on:
|
||||||
issues:
|
issues:
|
||||||
types: opened
|
types: opened
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
add_label:
|
add_label:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions-ecosystem/action-add-labels@v1
|
- uses: actions-ecosystem/action-add-labels@v1
|
||||||
|
|
|
@ -3,6 +3,9 @@ on:
|
||||||
issues:
|
issues:
|
||||||
types:
|
types:
|
||||||
- labeled
|
- labeled
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
add-dev-comment:
|
add-dev-comment:
|
||||||
if: "github.event.label.name == 'needs: developer feedback'"
|
if: "github.event.label.name == 'needs: developer feedback'"
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
name: 'Update contributor feedback labels on comment'
|
name: 'Update contributor feedback labels on comment'
|
||||||
on: 'issue_comment'
|
on: 'issue_comment'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
feedback:
|
feedback:
|
||||||
if: |
|
if: |
|
||||||
|
@ -10,6 +12,8 @@ jobs:
|
||||||
github.event.issue.state == 'open' &&
|
github.event.issue.state == 'open' &&
|
||||||
contains(github.event.issue.labels.*.name, 'needs: author feedback')
|
contains(github.event.issue.labels.*.name, 'needs: author feedback')
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
steps:
|
steps:
|
||||||
- name: Add has feedback
|
- name: Add has feedback
|
||||||
uses: actions-ecosystem/action-add-labels@v1
|
uses: actions-ecosystem/action-add-labels@v1
|
||||||
|
|
|
@ -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).
|
* [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/).
|
* 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
|
## 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.
|
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.
|
||||||
|
|
105
changelog.txt
105
changelog.txt
|
@ -1,5 +1,110 @@
|
||||||
== Changelog ==
|
== 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 =
|
= 7.2.2 2022-12-21 =
|
||||||
|
|
||||||
** WooCommerce**
|
** WooCommerce**
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "pnpm exec turbo run turbo:build",
|
"build": "pnpm exec turbo run turbo:build",
|
||||||
"test": "pnpm exec turbo run turbo:test",
|
"test": "pnpm exec turbo run turbo:test",
|
||||||
|
"clean": "pnpm store prune && git clean -fx **/node_modules && pnpm i",
|
||||||
"preinstall": "npx only-allow pnpm",
|
"preinstall": "npx only-allow pnpm",
|
||||||
"postinstall": "pnpm git:update-hooks",
|
"postinstall": "pnpm git:update-hooks",
|
||||||
"git:update-hooks": "rm -r .git/hooks && mkdir -p .git/hooks && husky install",
|
"git:update-hooks": "rm -r .git/hooks && mkdir -p .git/hooks && husky install",
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
Comment: Dev dependency update.
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"automattic/jetpack-changelogger": "3.1.3"
|
"automattic/jetpack-changelogger": "3.3.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"platform": {
|
"platform": {
|
||||||
|
|
|
@ -4,32 +4,32 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "cae17ca18e2a2a6cefe200df88081346",
|
"content-hash": "959b38edbc3ae0c3853c02e86852f583",
|
||||||
"packages": [],
|
"packages": [],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
{
|
{
|
||||||
"name": "automattic/jetpack-changelogger",
|
"name": "automattic/jetpack-changelogger",
|
||||||
"version": "v3.1.3",
|
"version": "v3.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Automattic/jetpack-changelogger.git",
|
"url": "https://github.com/Automattic/jetpack-changelogger.git",
|
||||||
"reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
|
"reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
|
"url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
|
||||||
"reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
|
"reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.6",
|
"php": ">=5.6",
|
||||||
"symfony/console": "^3.4 || ^5.2",
|
"symfony/console": "^3.4 || ^5.2 || ^6.0",
|
||||||
"symfony/process": "^3.4 || ^5.2",
|
"symfony/process": "^3.4 || ^5.2 || ^6.0",
|
||||||
"wikimedia/at-ease": "^1.2 || ^2.0"
|
"wikimedia/at-ease": "^1.2 || ^2.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
|
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
|
||||||
"yoast/phpunit-polyfills": "1.0.3"
|
"yoast/phpunit-polyfills": "1.0.4"
|
||||||
},
|
},
|
||||||
"bin": [
|
"bin": [
|
||||||
"bin/changelogger"
|
"bin/changelogger"
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
"extra": {
|
"extra": {
|
||||||
"autotagger": true,
|
"autotagger": true,
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-trunk": "3.1.x-dev"
|
"dev-trunk": "3.3.x-dev"
|
||||||
},
|
},
|
||||||
"mirror-repo": "Automattic/jetpack-changelogger",
|
"mirror-repo": "Automattic/jetpack-changelogger",
|
||||||
"version-constants": {
|
"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.",
|
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
|
||||||
"support": {
|
"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",
|
"name": "psr/log",
|
||||||
|
@ -204,12 +204,12 @@
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/debug.git",
|
"url": "https://github.com/symfony/debug.git",
|
||||||
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
|
"reference": "1a692492190773c5310bc7877cb590c04c2f05be"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
|
"url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
|
||||||
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
|
"reference": "1a692492190773c5310bc7877cb590c04c2f05be",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -249,7 +249,7 @@
|
||||||
"description": "Provides tools to ease debugging PHP code",
|
"description": "Provides tools to ease debugging PHP code",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/debug/tree/v4.4.41"
|
"source": "https://github.com/symfony/debug/tree/v4.4.44"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -266,7 +266,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"abandoned": "symfony/error-handler",
|
"abandoned": "symfony/error-handler",
|
||||||
"time": "2022-04-12T15:19:55+00:00"
|
"time": "2022-07-28T16:29:46+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-mbstring",
|
"name": "symfony/polyfill-mbstring",
|
||||||
|
@ -274,12 +274,12 @@
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
|
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -295,7 +295,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "1.26-dev"
|
"dev-main": "1.27-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
|
@ -334,7 +334,7 @@
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
|
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -350,7 +350,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-05-24T11:49:31+00:00"
|
"time": "2022-11-03T14:55:06+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/process",
|
"name": "symfony/process",
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
Comment: Dev dependency update.
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"automattic/jetpack-changelogger": "3.1.3"
|
"automattic/jetpack-changelogger": "3.3.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"platform": {
|
"platform": {
|
||||||
|
|
|
@ -4,32 +4,32 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "2ac4a9ea3ab4687cb26b0075128628de",
|
"content-hash": "8cdc2ba8c2e8669b3d48cf7e4cb3c379",
|
||||||
"packages": [],
|
"packages": [],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
{
|
{
|
||||||
"name": "automattic/jetpack-changelogger",
|
"name": "automattic/jetpack-changelogger",
|
||||||
"version": "v3.1.3",
|
"version": "v3.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Automattic/jetpack-changelogger.git",
|
"url": "https://github.com/Automattic/jetpack-changelogger.git",
|
||||||
"reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
|
"reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
|
"url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
|
||||||
"reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
|
"reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.6",
|
"php": ">=5.6",
|
||||||
"symfony/console": "^3.4 || ^5.2",
|
"symfony/console": "^3.4 || ^5.2 || ^6.0",
|
||||||
"symfony/process": "^3.4 || ^5.2",
|
"symfony/process": "^3.4 || ^5.2 || ^6.0",
|
||||||
"wikimedia/at-ease": "^1.2 || ^2.0"
|
"wikimedia/at-ease": "^1.2 || ^2.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
|
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
|
||||||
"yoast/phpunit-polyfills": "1.0.3"
|
"yoast/phpunit-polyfills": "1.0.4"
|
||||||
},
|
},
|
||||||
"bin": [
|
"bin": [
|
||||||
"bin/changelogger"
|
"bin/changelogger"
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
"extra": {
|
"extra": {
|
||||||
"autotagger": true,
|
"autotagger": true,
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-trunk": "3.1.x-dev"
|
"dev-trunk": "3.3.x-dev"
|
||||||
},
|
},
|
||||||
"mirror-repo": "Automattic/jetpack-changelogger",
|
"mirror-repo": "Automattic/jetpack-changelogger",
|
||||||
"version-constants": {
|
"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.",
|
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
|
||||||
"support": {
|
"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",
|
"name": "psr/log",
|
||||||
|
@ -204,12 +204,12 @@
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/debug.git",
|
"url": "https://github.com/symfony/debug.git",
|
||||||
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
|
"reference": "1a692492190773c5310bc7877cb590c04c2f05be"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
|
"url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
|
||||||
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
|
"reference": "1a692492190773c5310bc7877cb590c04c2f05be",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -249,7 +249,7 @@
|
||||||
"description": "Provides tools to ease debugging PHP code",
|
"description": "Provides tools to ease debugging PHP code",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/debug/tree/v4.4.41"
|
"source": "https://github.com/symfony/debug/tree/v4.4.44"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -266,7 +266,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"abandoned": "symfony/error-handler",
|
"abandoned": "symfony/error-handler",
|
||||||
"time": "2022-04-12T15:19:55+00:00"
|
"time": "2022-07-28T16:29:46+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-mbstring",
|
"name": "symfony/polyfill-mbstring",
|
||||||
|
@ -274,12 +274,12 @@
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
|
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -295,7 +295,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "1.26-dev"
|
"dev-main": "1.27-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
|
@ -334,7 +334,7 @@
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
|
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -350,7 +350,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-05-24T11:49:31+00:00"
|
"time": "2022-11-03T14:55:06+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/process",
|
"name": "symfony/process",
|
||||||
|
|
|
@ -2,6 +2,41 @@
|
||||||
|
|
||||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
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
|
## [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]
|
- Minor - Allow passing of additional props to form inputs [#35160]
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: update
|
|
||||||
|
|
||||||
Updating downshift to 6.1.12.
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: minor
|
|
||||||
Type: update
|
|
||||||
|
|
||||||
Move classname down in SelectControl Menu so it is on the actual Menu element.
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: minor
|
|
||||||
Type: add
|
|
||||||
|
|
||||||
Add experimental ConditionalWrapper component
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: add
|
|
||||||
|
|
||||||
Add async filtering support to the `__experimentalSelectControl` component
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: add
|
|
||||||
|
|
||||||
Add experimental open menu when user focus the select control input element
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: minor
|
|
||||||
Type: dev
|
|
||||||
|
|
||||||
Allow the user to select multiple images in the Media Library
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: minor
|
|
||||||
Type: add
|
|
||||||
|
|
||||||
Adding isHidden option for primary button in TourKit component.
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: fix
|
|
||||||
|
|
||||||
Fix pagination label text from uppercase to normal and font styles
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: add
|
||||||
|
|
||||||
|
Adding WooProductFieldItem slotfill.
|
|
@ -1,4 +1,4 @@
|
||||||
Significance: minor
|
Significance: minor
|
||||||
Type: enhancement
|
Type: add
|
||||||
|
|
||||||
Add noDataLabel property into table.js component to allow No Data label customization.
|
Adding the WooProductSectionItem slotfill component.
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: add
|
||||||
|
|
||||||
|
Add product field store and helper functions for rendering fields from config.
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: minor
|
|
||||||
Type: add
|
|
||||||
|
|
||||||
Add support for custom suffix prop on SelectControl.
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: tweak
|
||||||
|
|
||||||
|
Update spelling of Cancelled to Canceled for US English.
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: minor
|
|
||||||
Type: dev
|
|
||||||
|
|
||||||
Move file picker by clicking card into the MediaUploader component
|
|
|
@ -1,5 +1,4 @@
|
||||||
Significance: patch
|
Significance: patch
|
||||||
Type: dev
|
Type: dev
|
||||||
Comment: Dev dependency bump
|
|
||||||
|
|
||||||
|
|
||||||
|
Migrate Link component to TS
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: dev
|
||||||
|
|
||||||
|
Migrate ProductImage component to TS
|
|
@ -1,4 +1,4 @@
|
||||||
Significance: patch
|
Significance: patch
|
||||||
Type: dev
|
Type: dev
|
||||||
|
|
||||||
Migrate search component to TS
|
Migrate Section component to TS
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: dev
|
||||||
|
|
||||||
|
Migrate Tag component to TS
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: enhancement
|
|
||||||
|
|
||||||
Update font size and spacing in the tooltip component
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: enhancement
|
|
||||||
|
|
||||||
Align the field height across the whole form
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: enhancement
|
|
||||||
|
|
||||||
Fade the value selection field in the Attributes modal when no attribute is added
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: minor
|
|
||||||
Type: fix
|
|
||||||
|
|
||||||
Set editor mode on initialization to prevent initial text editor focus
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: minor
|
|
||||||
Type: add
|
|
||||||
|
|
||||||
Make Table component accept className prop.
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Fix SortableItem duplicated id
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: fix
|
|
||||||
|
|
||||||
Include react-dates styles (no longer in WP 6.1+).
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: fix
|
|
||||||
|
|
||||||
Close DateTimePickerControl's dropdown when blurring from input.
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: fix
|
|
||||||
|
|
||||||
DateTimePickerControl's onChange now only fires when there is an actual change to the datetime.
|
|
|
@ -1,5 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: fix
|
|
||||||
Comment: Just a minor tweak to the CSS for the DateTimePickerControl suffix.
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: fix
|
|
||||||
|
|
||||||
Fixed DatePicker to work in WordPress 6.1 when currentDate is set to a moment instance.
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: tweak
|
|
||||||
|
|
||||||
Update variable name within useFormContext.
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: tweak
|
|
||||||
|
|
||||||
Updated image gallery toolbar position and tooltips.
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: minor
|
|
||||||
Type: tweak
|
|
||||||
|
|
||||||
Fix up initial block selection in RichTextEditor and add media blocks
|
|
|
@ -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.
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: fix
|
|
||||||
|
|
||||||
Set initial values prop from reset form function as optional
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: minor
|
|
||||||
Type: add
|
|
||||||
|
|
||||||
Add className prop to ListItem.
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: add
|
|
||||||
|
|
||||||
Add aria-label for simple select dropdown
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
Comment: Dev dependency update.
|
||||||
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: minor
|
|
||||||
Type: add
|
|
||||||
|
|
||||||
Added ability to force time when DateTimePickerControl is date-only (timeForDateOnly prop).
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: major
|
|
||||||
Type: update
|
|
||||||
|
|
||||||
Switch DateTimePickerControl formatting to PHP style, for WP compatibility.
|
|
|
@ -1,4 +0,0 @@
|
||||||
Significance: patch
|
|
||||||
Type: fix
|
|
||||||
|
|
||||||
Fix DateTimePickerControl's popover styling when slot-fill is used.
|
|
|
@ -5,7 +5,7 @@
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"automattic/jetpack-changelogger": "3.1.3"
|
"automattic/jetpack-changelogger": "3.3.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"platform": {
|
"platform": {
|
||||||
|
|
|
@ -4,32 +4,32 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "75af54f4e83b1e2c7c96371c3288e355",
|
"content-hash": "0e715b7322bdb353060f76a3279195e1",
|
||||||
"packages": [],
|
"packages": [],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
{
|
{
|
||||||
"name": "automattic/jetpack-changelogger",
|
"name": "automattic/jetpack-changelogger",
|
||||||
"version": "v3.1.3",
|
"version": "v3.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Automattic/jetpack-changelogger.git",
|
"url": "https://github.com/Automattic/jetpack-changelogger.git",
|
||||||
"reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
|
"reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
|
"url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
|
||||||
"reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
|
"reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.6",
|
"php": ">=5.6",
|
||||||
"symfony/console": "^3.4 || ^5.2",
|
"symfony/console": "^3.4 || ^5.2 || ^6.0",
|
||||||
"symfony/process": "^3.4 || ^5.2",
|
"symfony/process": "^3.4 || ^5.2 || ^6.0",
|
||||||
"wikimedia/at-ease": "^1.2 || ^2.0"
|
"wikimedia/at-ease": "^1.2 || ^2.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
|
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
|
||||||
"yoast/phpunit-polyfills": "1.0.3"
|
"yoast/phpunit-polyfills": "1.0.4"
|
||||||
},
|
},
|
||||||
"bin": [
|
"bin": [
|
||||||
"bin/changelogger"
|
"bin/changelogger"
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
"extra": {
|
"extra": {
|
||||||
"autotagger": true,
|
"autotagger": true,
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-trunk": "3.1.x-dev"
|
"dev-trunk": "3.3.x-dev"
|
||||||
},
|
},
|
||||||
"mirror-repo": "Automattic/jetpack-changelogger",
|
"mirror-repo": "Automattic/jetpack-changelogger",
|
||||||
"version-constants": {
|
"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.",
|
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
|
||||||
"support": {
|
"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",
|
"name": "psr/log",
|
||||||
|
@ -204,12 +204,12 @@
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/debug.git",
|
"url": "https://github.com/symfony/debug.git",
|
||||||
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
|
"reference": "1a692492190773c5310bc7877cb590c04c2f05be"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
|
"url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
|
||||||
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
|
"reference": "1a692492190773c5310bc7877cb590c04c2f05be",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -249,7 +249,7 @@
|
||||||
"description": "Provides tools to ease debugging PHP code",
|
"description": "Provides tools to ease debugging PHP code",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/debug/tree/v4.4.41"
|
"source": "https://github.com/symfony/debug/tree/v4.4.44"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -266,7 +266,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"abandoned": "symfony/error-handler",
|
"abandoned": "symfony/error-handler",
|
||||||
"time": "2022-04-12T15:19:55+00:00"
|
"time": "2022-07-28T16:29:46+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-mbstring",
|
"name": "symfony/polyfill-mbstring",
|
||||||
|
@ -274,12 +274,12 @@
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
|
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -295,7 +295,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "1.26-dev"
|
"dev-main": "1.27-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
|
@ -334,7 +334,7 @@
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
|
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -350,7 +350,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-05-24T11:49:31+00:00"
|
"time": "2022-11-03T14:55:06+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/process",
|
"name": "symfony/process",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@woocommerce/components",
|
"name": "@woocommerce/components",
|
||||||
"version": "11.1.0",
|
"version": "12.0.0",
|
||||||
"description": "UI components for WooCommerce.",
|
"description": "UI components for WooCommerce.",
|
||||||
"author": "Automattic",
|
"author": "Automattic",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
|
@ -118,6 +118,7 @@
|
||||||
"@types/prop-types": "^15.7.4",
|
"@types/prop-types": "^15.7.4",
|
||||||
"@types/react": "^17.0.2",
|
"@types/react": "^17.0.2",
|
||||||
"@types/testing-library__jest-dom": "^5.14.3",
|
"@types/testing-library__jest-dom": "^5.14.3",
|
||||||
|
"@types/uuid": "^8.3.0",
|
||||||
"@types/wordpress__components": "^19.10.1",
|
"@types/wordpress__components": "^19.10.1",
|
||||||
"@types/wordpress__data": "^6.0.0",
|
"@types/wordpress__data": "^6.0.0",
|
||||||
"@types/wordpress__media-utils": "^3.0.0",
|
"@types/wordpress__media-utils": "^3.0.0",
|
||||||
|
@ -137,6 +138,7 @@
|
||||||
"sass-loader": "^10.2.1",
|
"sass-loader": "^10.2.1",
|
||||||
"ts-jest": "^27.1.3",
|
"ts-jest": "^27.1.3",
|
||||||
"typescript": "^4.8.3",
|
"typescript": "^4.8.3",
|
||||||
|
"uuid": "^8.3.0",
|
||||||
"webpack": "^5.70.0",
|
"webpack": "^5.70.0",
|
||||||
"webpack-cli": "^3.3.12"
|
"webpack-cli": "^3.3.12"
|
||||||
},
|
},
|
||||||
|
|
|
@ -21,7 +21,7 @@ export { default as FilterPicker } from './filter-picker';
|
||||||
export { H, Section } from './section';
|
export { H, Section } from './section';
|
||||||
export { ImageGallery, ImageGalleryItem } from './image-gallery';
|
export { ImageGallery, ImageGalleryItem } from './image-gallery';
|
||||||
export { default as ImageUpload } from './image-upload';
|
export { default as ImageUpload } from './image-upload';
|
||||||
export { default as Link } from './link';
|
export { Link } from './link';
|
||||||
export { default as List } from './list';
|
export { default as List } from './list';
|
||||||
export { MediaUploader } from './media-uploader';
|
export { MediaUploader } from './media-uploader';
|
||||||
export { default as MenuItem } from './ellipsis-menu/menu-item';
|
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 { default as TourKit } from './tour-kit';
|
||||||
export * as TourKitTypes from './tour-kit/types';
|
export * as TourKitTypes from './tour-kit/types';
|
||||||
export { CollapsibleContent } from './collapsible-content';
|
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';
|
||||||
|
|
|
@ -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 <Link /> directly.
|
|
||||||
// With React Router 5+, <RouterLink /> cannot be used outside of the main <Router /> 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 (
|
|
||||||
<a href={ href } { ...passProps }>
|
|
||||||
{ children }
|
|
||||||
</a>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
|
@ -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 <Link /> directly.
|
||||||
|
// With React Router 5+, <RouterLink /> cannot be used outside of the main <Router /> 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 <a> below
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const passProps = {
|
||||||
|
...props,
|
||||||
|
'data-link-type': type,
|
||||||
|
};
|
||||||
|
|
||||||
|
if ( type === 'wc-admin' ) {
|
||||||
|
passProps.onClick = partial( wcAdminLinkHandler, passProps.onClick );
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<a href={ href } { ...passProps }>
|
||||||
|
{ children }
|
||||||
|
</a>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
Link.contextTypes = {
|
||||||
|
router: PropTypes.object,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Link;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue