diff --git a/.github/actions/tests/run-api-tests/action.yml b/.github/actions/tests/run-api-tests/action.yml index f569e12afcc..fab3e83cca3 100644 --- a/.github/actions/tests/run-api-tests/action.yml +++ b/.github/actions/tests/run-api-tests/action.yml @@ -1,6 +1,5 @@ name: Run API tests description: Runs the WooCommerce Core API tests and generates Allure report. -permissions: {} inputs: report-name: @@ -8,6 +7,9 @@ inputs: required: true tests: description: Specific tests to run, separated by single whitespace. See https://playwright.dev/docs/test-cli + playwright-config: + description: Playwright config file to be used + default: playwright.config.js outputs: result: @@ -23,7 +25,7 @@ runs: shell: bash run: | pnpm exec playwright test \ - --config=tests/api-core-tests/playwright.config.js \ + --config=tests/api-core-tests/${{ inputs.playwright-config }} \ ${{ inputs.tests }} - name: Generate Test report. diff --git a/.github/project-pr-labeler.yml b/.github/project-pr-labeler.yml index ad5c471c0d4..87d89fa1056 100644 --- a/.github/project-pr-labeler.yml +++ b/.github/project-pr-labeler.yml @@ -67,11 +67,11 @@ 'plugin: woo-ai': - plugins/woo-ai/**/* -'focus: performance tests [team:Solaris]': +'focus: performance tests': - plugins/woocommerce/tests/performance/**/* -'focus: api tests [team:Solaris]': +'focus: api tests': - plugins/woocommerce/tests/api-core-tests/**/* -'focus: e2e tests [team:Solaris]': +'focus: e2e tests': - plugins/woocommerce/tests/e2e-pw/**/* diff --git a/.github/workflows/cherry-pick.yml b/.github/workflows/cherry-pick.yml index f96715d5dd0..c9519aeb277 100644 --- a/.github/workflows/cherry-pick.yml +++ b/.github/workflows/cherry-pick.yml @@ -294,6 +294,15 @@ jobs: core.setOutput( 'cherry-pick-pr', pr.data.html_url ) + // label PR + + const label = await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.data.number, + labels: ["metric: code freeze exception"], + }); + - name: Checkout trunk branch if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null run: git checkout trunk diff --git a/.github/workflows/cot-pr-build-and-e2e-tests.yml b/.github/workflows/non-cot-pr-build-and-e2e-tests.yml similarity index 87% rename from .github/workflows/cot-pr-build-and-e2e-tests.yml rename to .github/workflows/non-cot-pr-build-and-e2e-tests.yml index 02cfb498434..f54fc1dce89 100644 --- a/.github/workflows/cot-pr-build-and-e2e-tests.yml +++ b/.github/workflows/non-cot-pr-build-and-e2e-tests.yml @@ -1,4 +1,4 @@ -name: Run tests against PR in an environment with COT enabled +name: Run tests against PR in an environment with HPOS disabled on: pull_request: workflow_dispatch: @@ -10,8 +10,8 @@ concurrency: permissions: {} jobs: - cot-e2e-tests-run: - name: Runs E2E tests with COT enabled. + non-hpos-e2e-tests-run: + name: Runs E2E tests with HPOS disabled. runs-on: ubuntu-20.04 permissions: contents: read @@ -24,11 +24,9 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo - - name: Load docker images and start containers with COT enabled. + - name: Load docker images and start containers working-directory: plugins/woocommerce - env: - ENABLE_HPOS: 1 - run: pnpm env:test:cot --filter=woocommerce + run: pnpm env:test --filter=woocommerce - name: Download and install Chromium browser. working-directory: plugins/woocommerce @@ -39,6 +37,7 @@ jobs: id: run_playwright_e2e_tests env: USE_WP_ENV: 1 + ENABLE_HPOS: 0 working-directory: plugins/woocommerce run: pnpm exec playwright test --config=tests/e2e-pw/playwright.config.js @@ -66,8 +65,8 @@ jobs: if-no-files-found: ignore retention-days: 5 - cot-api-tests-run: - name: Runs API tests with COT enabled. + non-hpos-api-tests-run: + name: Runs API tests with HPOS disabled. runs-on: ubuntu-20.04 permissions: contents: read @@ -80,11 +79,9 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo - - name: Load docker images and start containers with COT enabled. + - name: Load docker images and start containers working-directory: plugins/woocommerce - env: - ENABLE_HPOS: 1 - run: pnpm env:test:cot --filter=woocommerce + run: pnpm env:test --filter=woocommerce - name: Run Playwright API tests. id: run_playwright_api_tests @@ -93,6 +90,7 @@ jobs: BASE_URL: http://localhost:8086 USER_KEY: admin USER_SECRET: password + ENABLE_HPOS: 0 run: pnpm exec playwright test --config=tests/api-core-tests/playwright.config.js - name: Generate Playwright API Test report. @@ -117,4 +115,4 @@ jobs: ${{ env.ALLURE_RESULTS_DIR }} ${{ env.ALLURE_REPORT_DIR }} if-no-files-found: ignore - retention-days: 5 + retention-days: 5 \ No newline at end of file diff --git a/.github/workflows/pr-build-and-e2e-tests.yml b/.github/workflows/pr-build-and-e2e-tests.yml index bcb64f055a0..0a2b8d2ae60 100644 --- a/.github/workflows/pr-build-and-e2e-tests.yml +++ b/.github/workflows/pr-build-and-e2e-tests.yml @@ -31,7 +31,6 @@ jobs: - name: Load docker images and start containers. working-directory: plugins/woocommerce env: - ENABLE_HPOS: 0 WP_ENV_PHP_VERSION: 7.4 run: pnpm run env:test @@ -265,4 +264,4 @@ jobs: -f pr_number=$PR_NUMBER \ -f commit_sha=$COMMIT_SHA \ -f s3_root=public \ - --repo woocommerce/woocommerce-test-reports + --repo woocommerce/woocommerce-test-reports \ No newline at end of file diff --git a/.github/workflows/smoke-test-release.yml b/.github/workflows/smoke-test-release.yml index e9892a9892a..554f92da5d2 100644 --- a/.github/workflows/smoke-test-release.yml +++ b/.github/workflows/smoke-test-release.yml @@ -155,16 +155,22 @@ jobs: install-filters: woocommerce build: false + - name: Download and install Chromium browser. + working-directory: plugins/woocommerce + run: pnpm exec playwright install chromium + - name: Run API tests id: run-api-composite-action uses: ./.github/actions/tests/run-api-tests with: report-name: ${{ env.API_WP_LATEST_ARTIFACT }} tests: hello + playwright-config: ci-release.playwright.config.js env: API_BASE_URL: ${{ secrets.RELEASE_TEST_URL }} USER_KEY: ${{ secrets.RELEASE_TEST_ADMIN_USER }} USER_SECRET: ${{ secrets.RELEASE_TEST_ADMIN_PASSWORD }} + UPDATE_WC: ${{ needs.get-tag.outputs.tag }} - name: Upload Allure artifacts to bucket if: success() || ( failure() && steps.run-api-composite-action.conclusion == 'failure' ) @@ -331,7 +337,7 @@ jobs: script: | const { getVersionWPLatestMinusOne } = require( './plugins/woocommerce/tests/e2e-pw/utils/wordpress' ); await getVersionWPLatestMinusOne( { core, github } ); - + - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: @@ -341,7 +347,7 @@ jobs: working-directory: plugins/woocommerce run: pnpm run env:test env: - WP_ENV_CORE: WordPress/WordPress#${{ steps.get-wp-latest-1.outputs.version }} + WP_ENV_CORE: WordPress/WordPress#${{ steps.get-wp-latest-1.outputs.version }} - name: Download release zip env: diff --git a/.github/workflows/test-assistant-api-rest-change-tracker.yml b/.github/workflows/test-assistant-api-rest-change-tracker.yml new file mode 100644 index 00000000000..4dc2796943b --- /dev/null +++ b/.github/workflows/test-assistant-api-rest-change-tracker.yml @@ -0,0 +1,88 @@ +name: Send a Slack notification when a PR contains rest api changes + +on: + pull_request_target: + types: [labeled] + +permissions: {} + +jobs: + send-slack-notification-when-pr-contains-rest-api-changes: + if: "${{ github.event.label.name == 'contains: rest api change' && (github.event.pull_request.state == 'open' || github.event.pull_request.merged) }}" + runs-on: ubuntu-20.04 + steps: + - name: Wait 2 minutes for other labelling jobs to finish + run: sleep 2m + shell: bash + + - name: Calculate test date + id: calculate_date + run: | + #!/bin/bash + + # Get the day of the week of the merged PR (0 for Sunday, 1 for Monday, etc.) + MERGE_DAY_OF_WEEK=$(date -u -d "${{ github.event.pull_request.merged_at }}" +"%u") + + # Calculate days until the next Thursday after the merge + # If the merge is on Thursday, this will give 7 (i.e., next week's Thursday) + DAYS_UNTIL_NEXT_THURSDAY=$(( (4 + 7 - MERGE_DAY_OF_WEEK) % 7 )) + + # If DAYS_UNTIL_NEXT_THURSDAY is 0, the merge was on a Thursday, so we set it to 7 to get the next Thursday + if [ $DAYS_UNTIL_NEXT_THURSDAY -eq 0 ]; then + DAYS_UNTIL_NEXT_THURSDAY=7 + fi + + # Calculate the date for the next Thursday after the merge + THURSDAY_AFTER_MERGE=$(date -u -d "${{ github.event.pull_request.merged_at }} + $DAYS_UNTIL_NEXT_THURSDAY days" +"%Y-%m-%d") + WOOAF_RELEASE_DATE=$(date -u -d "${THURSDAY_AFTER_MERGE} + 6 days" +"%Y-%m-%d") + TEST_DATE_MESSAGE="Thursday, $THURSDAY_AFTER_MERGE. (Targeting release on $WOOAF_RELEASE_DATE)" + echo "TEST_DATE_MESSAGE=${TEST_DATE_MESSAGE}" >> $GITHUB_ENV + + - name: Determine Milestone Date + id: get_milestone_date + run: | + #!/bin/bash + + MILESTONE_TITLE="${{ github.event.pull_request.milestone.title }}" + MILESTONE_DATE="Undefined" + + # Mapping of milestone titles to release dates + declare -A MILESTONE_DATES + MILESTONE_DATES=( + ["8.0.0"]="2023-08-08" + ["8.1.0"]="2023-09-12" + ["8.2.0"]="2023-10-10" + ["8.3.0"]="2023-11-14" + ["8.4.0"]="2023-12-12" + ["8.5.0"]="2024-01-09" + ["8.6.0"]="2024-02-13" + ["8.7.0"]="2024-03-12" + ["8.8.0"]="2024-04-09" + ["8.9.0"]="2024-05-14" + ["9.0.0"]="2024-06-11" + ) + + # Check if the milestone title exists in our predefined list and get the date + if [[ -v "MILESTONE_DATES[${MILESTONE_TITLE}]" ]]; then + MILESTONE_DATE=${MILESTONE_DATES[${MILESTONE_TITLE}]} + fi + + # Export for later steps + echo "MILESTONE_DATE=${MILESTONE_DATE}" >> $GITHUB_ENV + + # Notify Slack Step + - name: Notify Slack + uses: archive/github-actions-slack@d9dae40827adf93bddf939db6552d1e392259d7d + id: notify + with: + slack-bot-user-oauth-access-token: ${{ secrets.TEST_ASSISTANCE_BOT_TOKEN }} + slack-channel: ${{ secrets.WOO_CORE_REST_API_CHANGES_SLACK_CHANNEL }} + slack-text: | + <${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}> + *Labels:* ${{ join(github.event.pull_request.labels.*.name, ', ') }} + *Monthly Release Milestone:* <${{ github.event.pull_request.milestone.html_url }}|${{ github.event.pull_request.milestone.title }}> (Release Date: ${{ env.MILESTONE_DATE }}) + *WooAF (weekly) Timeline: this PR can be tested from:* ${{ env.TEST_DATE_MESSAGE }} + Please visit the <#${{ secrets.WOO_CORE_RELEASES_SLACK_CHANNEL }}> to obtain the latest WooAF build for testing. + slack-optional-unfurl_links: false + slack-optional-unfurl_media: false + diff --git a/.markdownlint.json b/.markdownlint.json index 57085409db7..5e29a079a84 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -4,6 +4,7 @@ "MD007": { "indent": 4 }, "MD013": { "line_length": 9999 }, "MD024": { "allow_different_nesting": true }, + "MD033": { "allowed_elements": ["video"] }, "no-hard-tabs": false, "whitespace": false } diff --git a/changelog.txt b/changelog.txt index a68743b594e..a850fbf287a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,134 @@ == Changelog == += 8.2.0 2023-10-13 = + +**WooCommerce** + +* Fix - Correctly set 'created_via' for HPOS orders created on the admin. [#40469](https://github.com/woocommerce/woocommerce/pull/40469) +* Fix - Fix backwards compatibility issue with `wc_get_orders()` when HPOS is active and the pagination bit is set. [#40551](https://github.com/woocommerce/woocommerce/pull/40551) +* Fix - Save hpos order data before clearing the order from cache [#40282](https://github.com/woocommerce/woocommerce/pull/40282) +* Fix - Disable WP's post lock on HPOS order edit screen. [#40355](https://github.com/woocommerce/woocommerce/pull/40355) +* Fix - Enqueue media scripts for Images block within the product editor, as is required for Images block. [#40356](https://github.com/woocommerce/woocommerce/pull/40356) +* Fix - Addressed visual tweaks for CYS in response to feedback from 12th Sept [#40155](https://github.com/woocommerce/woocommerce/pull/40155) +* Fix - Address missing order type handling in HPOS compatibility mode sync. [#40279](https://github.com/woocommerce/woocommerce/pull/40279) +* Fix - Add Variation options section back to the product blocks template [#39914](https://github.com/woocommerce/woocommerce/pull/39914) +* Fix - Avoid a fatal error on the order received page if the order ID is not for a valid order. [#39876](https://github.com/woocommerce/woocommerce/pull/39876) +* Fix - Avoid string<>int comparison in products bought query to avoid results with customer_id = 0. [#40030](https://github.com/woocommerce/woocommerce/pull/40030) +* Fix - Changed Tax task completion criteria so that it considers both boolean and stringly typed values as expected [#39983](https://github.com/woocommerce/woocommerce/pull/39983) +* Fix - Display search results subtitle in HPOS list table view. [#40270](https://github.com/woocommerce/woocommerce/pull/40270) +* Fix - Eliminate an unnecessary redirect when the geo hash isalready set to the correct value. [#39634](https://github.com/woocommerce/woocommerce/pull/39634) +* Fix - Fix a bug where updating store location doesn't update store currency. [#40142](https://github.com/woocommerce/woocommerce/pull/40142) +* Fix - Fix cached refund not deleted when the refund is deleted with HPOS active [#40197](https://github.com/woocommerce/woocommerce/pull/40197) +* Fix - Fix changes in order custom fields made from admin not being applied when using the order Update button with HPOS active. [#40278](https://github.com/woocommerce/woocommerce/pull/40278) +* Fix - Fix customize store white screen bug in WP 6.3 [#40031](https://github.com/woocommerce/woocommerce/pull/40031) +* Fix - Fix customize your store task header button [#40031](https://github.com/woocommerce/woocommerce/pull/40031) +* Fix - Fix CYS UI issues [#40269](https://github.com/woocommerce/woocommerce/pull/40269) +* Fix - Fix CYS `__experimentalReapplyBlockTypeFilters` is not a function [#40104](https://github.com/woocommerce/woocommerce/pull/40104) +* Fix - Fixed missed lint error in Assembler Hub [#39964](https://github.com/woocommerce/woocommerce/pull/39964) +* Fix - Fix minor layout shift in the core profiler. [#39898](https://github.com/woocommerce/woocommerce/pull/39898) +* Fix - Fix product e2e tests [#39823](https://github.com/woocommerce/woocommerce/pull/39823) +* Fix - Fix undismissable notice when using localization for certain messages like "Coupon management has moved" [#39913](https://github.com/woocommerce/woocommerce/pull/39913) +* Fix - FIx WC Admin pages are empty for WP 6.2 and below. [#39995](https://github.com/woocommerce/woocommerce/pull/39995) +* Fix - Properly convert local time date queries to UTC in the HPOS datastore. [#40146](https://github.com/woocommerce/woocommerce/pull/40146) +* Fix - Redirect to Jetpack connect when jetpack-boost is selected. [#40261](https://github.com/woocommerce/woocommerce/pull/40261) +* Fix - Remove COT enable requirement from sync and verify command. [#39998](https://github.com/woocommerce/woocommerce/pull/39998) +* Fix - Removed references to the un-used Purchase task item in the onboarding task list. [#40121](https://github.com/woocommerce/woocommerce/pull/40121) +* Fix - Remove use of woocommerce-page class within WooCommerce Admin pages, replaced with woocommerce-admin-page. [#40218](https://github.com/woocommerce/woocommerce/pull/40218) +* Fix - Restore moving to trash functionality within HPOS order edit screen. [#39693](https://github.com/woocommerce/woocommerce/pull/39693) +* Fix - update the SqlQuery filter prefix in data.md [#39319](https://github.com/woocommerce/woocommerce/pull/39319) +* Fix - Use correct object reference when cloning a cart [#39282](https://github.com/woocommerce/woocommerce/pull/39282) +* Fix - [HPOS]Fix duplicate meta handling by passing meta_value|unique in post calls [#40088](https://github.com/woocommerce/woocommerce/pull/40088) +* Fix - [HPOS] Modify query to have less characters before the `FROM` keyword. [#40109](https://github.com/woocommerce/woocommerce/pull/40109) +* Fix - [HPOS] Support deleting metadata just by meta id. [#40064](https://github.com/woocommerce/woocommerce/pull/40064) +* Fix - [HPOS] Use objects method instead of calling datastore directly. [#40158](https://github.com/woocommerce/woocommerce/pull/40158) +* Add - Add ability to remove blocks from templates. [#39900](https://github.com/woocommerce/woocommerce/pull/39900) +* Add - Add a filter to OrdersTableQuery to allow overriding of HPOS queries. [#39945](https://github.com/woocommerce/woocommerce/pull/39945) +* Add - Add after_add_block and after_remove block hooks to the block template API. [#40139](https://github.com/woocommerce/woocommerce/pull/40139) +* Add - Add AI wizard business info step for Customize Your Store task [#39979](https://github.com/woocommerce/woocommerce/pull/39979) +* Add - Add component to Customize Your Store task. [#40140](https://github.com/woocommerce/woocommerce/pull/40140) +* Add - Add customize store - fonts [#40082](https://github.com/woocommerce/woocommerce/pull/40082) +* Add - Add customize store AI wizard call for best colour palette suggestions. [#40295](https://github.com/woocommerce/woocommerce/pull/40295) +* Add - Add customize store AI wizard call for color palette suggestion [#40237](https://github.com/woocommerce/woocommerce/pull/40237) +* Add - Add customize store AI wizard call for font pairing suggestion [#40240](https://github.com/woocommerce/woocommerce/pull/40240) +* Add - Add customize store assembler hub onboarding tour [#39981](https://github.com/woocommerce/woocommerce/pull/39981) +* Add - Add customize store assembler hub [#39843](https://github.com/woocommerce/woocommerce/pull/39843) +* Add - Add customize store color palettes [#40051](https://github.com/woocommerce/woocommerce/pull/40051) +* Add - Add customize store transitional screen [#40122](https://github.com/woocommerce/woocommerce/pull/40122) +* Add - Added URL navigation support to customize-store feature [#40068](https://github.com/woocommerce/woocommerce/pull/40068) +* Add - Add filter woocommerce_hpos_enable_sync_on_read to disable sync on read with HPOS sync enabled. [#40039](https://github.com/woocommerce/woocommerce/pull/40039) +* Add - Add has_price param to the variations REST API query. [#40281](https://github.com/woocommerce/woocommerce/pull/40281) +* Add - Add header customization to the Assembler Hub [#40107](https://github.com/woocommerce/woocommerce/pull/40107) +* Add - Add help text to Name field in Create new category modal [#40059](https://github.com/woocommerce/woocommerce/pull/40059) +* Add - Add new e2e test for Shopper My Account Downloads section [#40100](https://github.com/woocommerce/woocommerce/pull/40100) +* Add - Add new e2e test to cover My Account Addresses section [#40114](https://github.com/woocommerce/woocommerce/pull/40114) +* Add - Add sidebar to customize your store task. [#40136](https://github.com/woocommerce/woocommerce/pull/40136) +* Add - Adds new action hook `woocommerce_pay_order_before_payment` to the `checkout/form-pay.php` template. [#37588](https://github.com/woocommerce/woocommerce/pull/37588) +* Add - Add support for slug auto generation to the create attribute endpoint [#39827](https://github.com/woocommerce/woocommerce/pull/39827) +* Add - Add tags (or general taxonomy ) block [#39966](https://github.com/woocommerce/woocommerce/pull/39966) +* Add - Add track events to customize store AI wizard [#40144](https://github.com/woocommerce/woocommerce/pull/40144) +* Add - Add track events to customize store transitional page [#40143](https://github.com/woocommerce/woocommerce/pull/40143) +* Add - Add Tracks events to Appearance > Themes screen [#40193](https://github.com/woocommerce/woocommerce/pull/40193) +* Add - Add tracks to CYS assembler-hub and hide pages sidebar screen [#40156](https://github.com/woocommerce/woocommerce/pull/40156) +* Add - Add variable product experiment [#40177](https://github.com/woocommerce/woocommerce/pull/40177) +* Add - Add woocommerce_block_template_register action. [#39915](https://github.com/woocommerce/woocommerce/pull/39915) +* Add - Create a plugin to enable Variations feature #40027 [#40027](https://github.com/woocommerce/woocommerce/pull/40027) +* Add - Implement customize store assembler hub - logo feature [#39932](https://github.com/woocommerce/woocommerce/pull/39932) +* Add - Implemented loader design for Customize your store - Design with AI [#40083](https://github.com/woocommerce/woocommerce/pull/40083) +* Add - Made ai completion for look and tone more robust and added tracks [#40052](https://github.com/woocommerce/woocommerce/pull/40052) +* Add - Records plugin API requests and installation errors to coreprofiler_install_plugin_error separately for the core profiler. [#39899](https://github.com/woocommerce/woocommerce/pull/39899) +* Update - Added Marketplace class as basis for Reactified marketplace. [#39121](https://github.com/woocommerce/woocommerce/pull/39121) +* Update - Added xstate scaffolding for AI Wizard in customize your store feature [#39863](https://github.com/woocommerce/woocommerce/pull/39863) +* Update - Display a custom WooPayments onboarding task header content, when an incentive with server based header is available. [#40034](https://github.com/woocommerce/woocommerce/pull/40034) +* Update - Implement customize your store task completion logic [#40267](https://github.com/woocommerce/woocommerce/pull/40267) +* Update - Optimize customize store preview frame resize performance [#39930](https://github.com/woocommerce/woocommerce/pull/39930) +* Update - Remove core-profiler checks from the tests -- core profiler is enabled by default now. [#40260](https://github.com/woocommerce/woocommerce/pull/40260) +* Update - Replace Personalize Your Store task with Choose Your Theme [#40239](https://github.com/woocommerce/woocommerce/pull/40239) +* Update - Track coreprofiler_store_extensions_installed_and_activated when async installation is complete [#39921](https://github.com/woocommerce/woocommerce/pull/39921) +* Update - Turn off the experimental flag for HPOS. [#39846](https://github.com/woocommerce/woocommerce/pull/39846) +* Update - Update Action Scheduler to 3.6.3 [#40147](https://github.com/woocommerce/woocommerce/pull/40147) +* Update - Update intro screen for the new Customize Your Store task [#40293](https://github.com/woocommerce/woocommerce/pull/40293) +* Update - Update Remote Inbox Notifications to add in and !in comparison operators for comparing values against arrays [#40084](https://github.com/woocommerce/woocommerce/pull/40084) +* Update - Update the simple product template implementation to use the product form template API. [#39814](https://github.com/woocommerce/woocommerce/pull/39814) +* Update - Update use of preventLeavingProductForm with new function changes. [#40225](https://github.com/woocommerce/woocommerce/pull/40225) +* Update - Update WooCommerce Blocks to 10.9.3 [#39895](https://github.com/woocommerce/woocommerce/pull/39895) +* Update - Update WooCommerce Blocks to 11.0.0 [#39971](https://github.com/woocommerce/woocommerce/pull/39971) +* Update - Update WooCommerce Blocks to 11.1.0 [#40141](https://github.com/woocommerce/woocommerce/pull/40141) +* Update - Update WooCommerce Blocks to 11.1.1 [#40300](https://github.com/woocommerce/woocommerce/pull/40300) +* Update - Update WooCommerce Blocks to 11.1.2 [#40475](https://github.com/woocommerce/woocommerce/pull/40475) +* Update - We have completely redesigned the In-app Marketplace. [#39121](https://github.com/woocommerce/woocommerce/pull/39121) +* Dev - Added documentation for the Core Profiler [#39963](https://github.com/woocommerce/woocommerce/pull/39963) +* Dev - Add job to post Slack summary of plugin test results in "Smoke test daily" workflow. [#39838](https://github.com/woocommerce/woocommerce/pull/39838) +* Dev - Add new E2E test covering shopper product page and make Product-related tests granular (separated test files) [#40132](https://github.com/woocommerce/woocommerce/pull/40132) +* Dev - Add notice to "track inventory" toggle #40011 [#40011](https://github.com/woocommerce/woocommerce/pull/40011) +* Dev - Add some basic E2E tests for Assembler Hub [#40235](https://github.com/woocommerce/woocommerce/pull/40235) +* Dev - Adds test to check required fields on checkout [#40099](https://github.com/woocommerce/woocommerce/pull/40099) +* Dev - Bump required PHP version to 7.4 [#39820](https://github.com/woocommerce/woocommerce/pull/39820) +* Dev - Cleanup: remove the unused is_feature_visible and show_feature methods. [#39931](https://github.com/woocommerce/woocommerce/pull/39931) +* Dev - Fixes and enables API test suite to run on daily CI run against alternate host [#39858](https://github.com/woocommerce/woocommerce/pull/39858) +* Dev - Fix flakiness around the `Turn off the new product form` menu item. [#39957](https://github.com/woocommerce/woocommerce/pull/39957) +* Dev - Fix for a couple of flaky API tests on daily runs [#39918](https://github.com/woocommerce/woocommerce/pull/39918) +* Dev - Improve documentation for the `is_checkout()` function. [#40258](https://github.com/woocommerce/woocommerce/pull/40258) +* Dev - Refactored core profiler loader to be more generalizable and moved to @woocommerce/onboarding [#39735](https://github.com/woocommerce/woocommerce/pull/39735) +* Dev - Remove "WP Latest-2" from release tests. [#40012](https://github.com/woocommerce/woocommerce/pull/40012) +* Dev - Remove legacy PHP version update checks [#39845](https://github.com/woocommerce/woocommerce/pull/39845) +* Dev - Run a full reset on API daily test site [#40061](https://github.com/woocommerce/woocommerce/pull/40061) +* Dev - Updates Playwright from 1.33 to 1.37.1 [#39815](https://github.com/woocommerce/woocommerce/pull/39815) +* Tweak - Add order property to every block in SimpleProductTemplate [#39946](https://github.com/woocommerce/woocommerce/pull/39946) +* Tweak - Adds an informative tooltip to the Account Details section of the Direct Bank Transfer settings. [#39860](https://github.com/woocommerce/woocommerce/pull/39860) +* Tweak - Fix a minor code typo, no change in functionality [#36402](https://github.com/woocommerce/woocommerce/pull/36402) +* Tweak - Make it easier to disable email verification checks for the order confirmation and order pay pages. [#40050](https://github.com/woocommerce/woocommerce/pull/40050) +* Tweak - Migrate category field to woocommerce/product-taxonomy-field block [#40021](https://github.com/woocommerce/woocommerce/pull/40021) +* Tweak - tweak some of the HPOS Settings UI. [#39912](https://github.com/woocommerce/woocommerce/pull/39912) +* Tweak - Tweak tasklist description color to darker [#39903](https://github.com/woocommerce/woocommerce/pull/39903) +* Enhancement - Add CLI commands to enable or disable HPOS. [#39865](https://github.com/woocommerce/woocommerce/pull/39865) +* Enhancement - Design enhancements for the Attributes tab. [#39987](https://github.com/woocommerce/woocommerce/pull/39987) +* Enhancement - Design enhancements for the Inventory tab. [#39962](https://github.com/woocommerce/woocommerce/pull/39962) +* Enhancement - Enable HPOS by default for new installs. [#40296](https://github.com/woocommerce/woocommerce/pull/40296) +* Enhancement - Improve the existing E2E test to verify one more element on each page load. [#40008](https://github.com/woocommerce/woocommerce/pull/40008) +* Enhancement - Update the default setting for the task list progress bar from 0 to 0.25, which gives the progress better visual context when no tasks have been completed. [#39369](https://github.com/woocommerce/woocommerce/pull/39369) +* Enhancement - Update Venezuelan currency: Bolívar (Bs.). [#29380](https://github.com/woocommerce/woocommerce/pull/29380) + + = 8.1.1 2023-09-18 = **WooCommerce** diff --git a/docs/docs-manifest.json b/docs/docs-manifest.json new file mode 100644 index 00000000000..690a79691bc --- /dev/null +++ b/docs/docs-manifest.json @@ -0,0 +1,449 @@ +{ + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/style-guide.md", + "hash": "e81f1f926568e1792b6814c735c0321dee1356b4f8c053b7a5ee1770440e8052", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/style-guide.md", + "id": "211490a474b1b2ce6a6fc670b159f3497d6a9054" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/README.md", + "hash": "b1a13c53d16ba2a1b089a0cf19c5c37a8181f33bdbe0c6ee106cd1c80aef9fa0", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/README.md", + "id": "2c20e49a2bfd5bfcbb318dedbec96ada77784f14", + "links": { + "extension-development/building-your-first-extension.md": "bfb30a2379ec5e7c7960192b0a9175191e39aef7", + "extension-development/how-to-design-a-simple-extension.md": "c2f4612f31cc3892bfb19c6e9859f2daccdb6fa0", + "style-guide.md": "211490a474b1b2ce6a6fc670b159f3497d6a9054", + "../plugins/woocommerce/README.md": "827066d08695e5002bf059cd2e9d4d2a0fa58df8", + "../plugins/woocommerce/i18n/languages/README.md": "826a4400174812dfabb978c87ff2742bfdf28d62", + "../plugins/woocommerce/includes/README.md": "3d07aabeb0926e4c675e5770e78a0cfa537d2f56", + "../plugins/woocommerce/lib/README.md": "7c7e05959e4e9dcde4ac0e3e2a13258d7521e731", + "../plugins/woocommerce/packages/README.md": "740c206346a48e9dcb2e70efd5a3221992c389dc", + "../plugins/woocommerce/src/README.md": "c7444c322c5bb1ff755b2bf3e961babf3a879f4e", + "../plugins/woocommerce/src/Admin/RemoteInboxNotifications/README.md": "a46d35b9e8a8c15b89082e0c2c04d83c852d545f", + "../plugins/woocommerce/src/Admin/RemoteInboxNotifications/Transformers/README.md": "bbccc83ae18c86679a3b632e7203f6c395987967", + "../plugins/woocommerce/src/Blocks/README.md": "532a6602e970797759269b4c588c724551379214", + "../plugins/woocommerce/src/Internal/README.md": "67d669be90b641e2273194796e3d9bdfdbd69a7e", + "../plugins/woocommerce/src/Internal/Admin/ProductForm/README.md": "1d691e34fd20dd268e8e9f8283f46a595758c33b", + "../plugins/woocommerce/tests/README.md": "722532b12b14b2f5c0b8efdd96cca1854bba38c4", + "../plugins/woocommerce/tests/api-core-tests/README.md": "b000db6a9a2807a49a3bb47c57bb78326a865c78", + "../plugins/woocommerce/tests/e2e/README.md": "c15296a46be7331ed23d791073cdebeb0f4c48c4", + "../plugins/woocommerce/tests/e2e-pw/README.md": "103a9a613a34a031b34ca48f0895640dc9fc2b10", + "../plugins/woocommerce/tests/performance/README.md": "8c14e3b9fac89bced565b78e96d3a3a89e0a568e", + "../plugins/woocommerce/tests/Tools/CodeHacking/README.md": "231d9fc132423f1ecc391aaf1bcb57a3cd749d24", + "../plugins/woocommerce-admin/README.md": "9ba7a7e2c4411e01c70d866f8b8b5604484368d8", + "../plugins/woocommerce-admin/client/activity-panel/README.md": "2de9812a153a9c9ed90588feacd9ece41ecff93c", + "../plugins/woocommerce-admin/client/activity-panel/activity-card/README.md": "c34672cf87665e3ff157c6df3ddf1993fd33e7a4", + "../plugins/woocommerce-admin/client/activity-panel/activity-header/README.md": "13e379fd37082d3cba36e76046acfc63ff70ab8a", + "../plugins/woocommerce-admin/client/analytics/report/README.md": "84430b89912cb95d31240cd2d00a400b2d904ec4", + "../plugins/woocommerce-admin/client/analytics/settings/README.md": "421781cef9f3d0160c1e3892488b21b3f4a2a7f5", + "../plugins/woocommerce-admin/client/dashboard/README.md": "f7d6ff3c0f18554161afaa94698fb127f098986f", + "../plugins/woocommerce-admin/client/header/README.md": "39d3152fc1be21beee488dddd3f5a90e6af2502a", + "../plugins/woocommerce-admin/client/marketing/README.md": "54f1eb4cf5ec67713ce2fdf2b2f1dc28b03e35ef", + "../plugins/woocommerce-admin/client/marketing/components/product-icon/README.md": "3fa5081872b79078ad320dd0d9e218ed4148dc4e", + "../plugins/woocommerce-admin/client/utils/README.md": "0486d6a8f01b89bf171e21678df5dae9b5791a99", + "../plugins/woocommerce-admin/client/wp-admin-scripts/README.md": "641ab0c131d812f0969631b44ed9e8fe3fdb0cba", + "../plugins/woocommerce-admin/docs/README.md": "25155a38fc7599a01bfb30eb31a1edb098b59219", + "../plugins/woocommerce-admin/docs/examples/README.md": "b5ca126b81199d9da6ae62d5d26c093f88405a06", + "../plugins/woocommerce-admin/docs/examples/extensions/README.md": "42a90d07061074d0de1b15aeaf80531f83b2a258", + "../plugins/woocommerce-admin/docs/features/README.md": "1ee849cb8dc013ffbfe8ebcb54b8cc83f39d72e4", + "../plugins/woocommerce-admin/docs/woocommerce.com/README.md": "ee127fc0f256c3ae546869c602e94b4a6e258be8", + "../plugins/woocommerce-beta-tester/README.md": "081da0cc3caba15e926b606082120c2692b71ad4", + "../plugins/woocommerce-beta-tester/src/tools/README.md": "aedc38bbe8b29e676a15d252bcb1be38acc86f3c", + "../plugins/woocommerce-beta-tester/userscripts/README.md": "d3d94172608c29c4968ee73858ee3575a2cc11ce" + } + } + ], + "categories": [ + { + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/code-snippets/unhook--remove-woocommerce-emails.md", + "hash": "a22ec5c7c7c670e97e34a438d5e13dc3709716484efbecbf49e5917b6da9079d", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/code-snippets/unhook--remove-woocommerce-emails.md", + "id": "517b5bdeb798c1832c3ba76670e728b7b922d5d1" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/code-snippets/rename-a-country.md", + "hash": "3929e2145dcaad30a83fda6d82d973028e4463eeb2f6a6ba6ff9cb70c6b52fd5", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/code-snippets/rename-a-country.md", + "id": "2197550f7fdfbce39155865ba36f1f396a35e4a6" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/code-snippets/number-of-products-per-row.md", + "hash": "507e7be407716b56fe577109b296b55cdcb48cb2b2e339a761446b4df2d730e9", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/code-snippets/number-of-products-per-row.md", + "id": "7da8ddcdbc3f427d14b040015fb1de9efde79d19" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/code-snippets/change-a-currency-symbol.md", + "hash": "4485b212ff7bdf7fd8c23dc589dbbb6263a530623b939b384297f2377b11056f", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/code-snippets/change-a-currency-symbol.md", + "id": "de0e6701b0e15a209ac6ed3c100b34f67237ea96" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/code-snippets/before-login--register-form.md", + "hash": "3435f3859ec047566696ae5474df697c99a6e1ab04168ae8f1ca831abc519d67", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/code-snippets/before-login--register-form.md", + "id": "5acf55bdb90174bc00a10816ca71a8846bd7040f" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/code-snippets/adjust-quantity-input-values.md", + "hash": "056fb597c07e0e82b92ca8a2c484166f807d3d513fa950cb5c46a8db087fe986", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/code-snippets/adjust-quantity-input-values.md", + "id": "06d0ddda56838dc22ad94716aca95a1f2a9ad67c" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/code-snippets/add-or-modify-states.md", + "hash": "d61d5051439b0cbf949be64958c8101a7c6487672a7b79dd3f528e9c1a5b408e", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/code-snippets/add-or-modify-states.md", + "id": "10568c46b0baa2f8ea01a8cd9dd6b2d65d35aafc" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/code-snippets/add-a-currency-symbol.md", + "hash": "0053a87328ee04a168c5657df26cf18f219d30669b000300ace4284ea2333186", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/code-snippets/add-a-currency-symbol.md", + "id": "6d63d431fa1d66af7b3b47861ccc940775eba397" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/code-snippets/add-a-country.md", + "hash": "9305a5ed51cc0174e19e68ebc94801c5e7d6e62e820d106f35175540b0531d10", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/code-snippets/add-a-country.md", + "id": "7c591c3bd31cb2942fdcb4f77da167bc9ec36207" + } + ], + "categories": [] + }, + { + "category_title": "Contributing", + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/contributing/deciding-pr-high-impact.md", + "hash": "6d9ddea0e44e1ab9f7b12183069c7fde51df26c9bcad15d8b6f9d3ab17ee1fe0", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/contributing/deciding-pr-high-impact.md", + "id": "cee3a746887c88f92966bb72ec1847aa5d97cebd" + } + ], + "categories": [] + }, + { + "category_title": "Data-management", + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/data-management/data-stores.md", + "hash": "7af9424c5b3fdfa5b30b658f0c3a452ac12d67390b58e9c23ef3bc71412b2a92", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/data-management/data-stores.md", + "id": "72609f6c4fecccf2881c76bb8f21fc6a2d3cfef5" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/data-management/crud-objects.md", + "hash": "9b687cd323893ed0fc012ad82e67a329ea0f41c312017bfdf3015ab7ef51a23a", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/data-management/crud-objects.md", + "id": "0214be4dc9e0ddcc6d6a175fcd2f2b9fd4c8b042" + } + ], + "categories": [] + }, + { + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/tools-for-low-code-development.md", + "hash": "5989c60346c29c019332b7e2faee0dfcddf063db2d12f22f7755525e99c8ba4a", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/tools-for-low-code-development.md", + "id": "9db13086ff88d75fc5d5cd7bd36820b2d372b288" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/readme.md", + "hash": "e22a09b0d39adf37cd19fa57263e1195646f766396a36571411c54c64c6ba5a1", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/readme.md", + "id": "4946a26f3f2ba63d5db65033a90b6dda3a43a4ee" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/how-to-design-a-simple-extension.md", + "hash": "893c9361b6a1f6cd8a83dc9a4500c9b3050d66ef6d567fddf56d68de01d182a1", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/how-to-design-a-simple-extension.md", + "id": "c2f4612f31cc3892bfb19c6e9859f2daccdb6fa0" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/how-to-add-your-own-store-management-links.md", + "hash": "59dfa1f941a2fafaccedf2dd9be5bc1ee8c34b7320c6589c860ad98403bcd273", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/how-to-add-your-own-store-management-links.md", + "id": "461423141956d0653582aa15956a7b0401301cf6" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/handling-merchant-onboarding.md", + "hash": "e4a8358de815e378beb07426fd5687a0e91792f70a697574edd5031bf073c08d", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/handling-merchant-onboarding.md", + "id": "878874b744cea792a439935c67ac833a5f7d8796" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/handling-deactivation-and-uninstallation.md", + "hash": "cfc8cdf9e9a41e69cf40dcc1548cf7b0231c51c33c504ee800dd7525afe6d483", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/handling-deactivation-and-uninstallation.md", + "id": "93a623f5b7ff808c92541941787bdc2101518f5a" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/extension-developer-handbook.md", + "hash": "ff87298651dff8672b0c0da8693b53cb19d1fe7e65f04a947029aeec9cc9896f", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/extension-developer-handbook.md", + "id": "9f22e410b1ff4f6e5c22f6b4567c1a676d037295" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/development-environment.md", + "hash": "811f43ef03b40b48ad72a9d787031cb10d5a17b5f4ef4a2d5c0fa4977b2d43df", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/development-environment.md", + "id": "188b18434a7e844978d4d25a4b1fbc74004294d5" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/building-your-first-extension.md", + "hash": "2aad1fe83142ff55197f3bc560fafbe2c1279ccf9bb727fea5257eed447ba694", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/building-your-first-extension.md", + "id": "bfb30a2379ec5e7c7960192b0a9175191e39aef7" + } + ], + "categories": [] + }, + { + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/getting-started/readme.md", + "hash": "8aa7cd66683478dff1f37c767f154d35e6b78a738b604d0bc2ae31a10f920ba6", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/getting-started/readme.md", + "id": "2145ad4acea5e37b1ff4354bf44a8af9d10c750a" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/getting-started/developer-tools.md", + "hash": "860d227350f472b610351bf416953bf9401bf0df296ee8ebe2af9c7a9d20fc57", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/getting-started/developer-tools.md", + "id": "3d8c7c1a9187dd7c96d2561bccfcfa88a8d0102a" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/getting-started/developer-resources.md", + "hash": "e5417528667f6afb2de5ed1b4f7073a63268e72e163bd67a8a1daeda1e623eb0", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/getting-started/developer-resources.md", + "id": "0923cb0175b15041bcecf8f9dbc60828052e1fec" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/getting-started/debugging.md", + "hash": "e8407732d22ffa183db83e5875e6709bdc8dd7ac47a05280590c4b5f1021fea9", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/getting-started/debugging.md", + "id": "b28ccc6fa293efebd716b510df0331fb222b8a1b", + "links": { + "../utilities/logging.md": "f673f50bdd83d5d0d7fd8d9976828f8736809510" + } + } + ], + "categories": [] + }, + { + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/high-performance-order-storage/readme.md", + "hash": "aada6bfad51c9f68ddb61e6475aae137e6b2d91839afa001aa3862ecd651093b", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/high-performance-order-storage/readme.md", + "id": "214c00235e4efed0a786fd704c4bfde25952a669" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/high-performance-order-storage/hpos-overview.md", + "hash": "a7504d828aed93aa68fbaff338406682fa6169f9401b2c4de6e750d7f51c7416", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/high-performance-order-storage/hpos-overview.md", + "id": "380a11e440eb17bc76fb606fecce4ce82fc9b0cb" + } + ], + "categories": [] + }, + { + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/product-editor-development/common-tasks.md", + "hash": "a7725479ff8b34f8069f3a8262502dc82354ea50d6ccd3760c5c7f7a9ae58fe2", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/product-editor-development/common-tasks.md", + "id": "c09542004d78254458250704f3a68cfeb9fa7a7c" + } + ], + "categories": [] + }, + { + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/quality-and-best-practices/readme.md", + "hash": "7afc464833ea0eb33127e98cb92f951bcb4a5d9006898e56db9d1f36006970cf", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/quality-and-best-practices/readme.md", + "id": "f12729345d42760bd61a4a4cfdcebf6dbf2daac4" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/quality-and-best-practices/performance-optimization.md", + "hash": "cc54a9af29f80e413536f46e70bc17512c92de536375bded23e4893a3e95e262", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/quality-and-best-practices/performance-optimization.md", + "id": "280d9d16382ef5374226629751cff7fceefbfa62" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/quality-and-best-practices/grammar-punctuation-capitalization.md", + "hash": "cea26a41342f5e67bb3313c935726da68647827a60c2fb034f3e64dd783496bd", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/quality-and-best-practices/grammar-punctuation-capitalization.md", + "id": "85d910730d1daa03c86c42f2d4cbd2e146cec83c" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/quality-and-best-practices/coding-standards.md", + "hash": "332efc3cccdde767237087abba302fcc371d510e5f287d439de49fe99a5445cc", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/quality-and-best-practices/coding-standards.md", + "id": "3a47d9e0da6c415606b7ee87bb65ed24f4630be1" + } + ], + "categories": [] + }, + { + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/reference-code/readme.md", + "hash": "49a289229235989dcb8fa990af7e5017ae37569d6103dfd044ee2d95f250f596", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/reference-code/readme.md", + "id": "1934f96989f9b62e2caf7fd0ac7deb2292f161ce" + } + ], + "categories": [] + }, + { + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/reporting/readme.md", + "hash": "117ccaf1bf931f7a98486ac0b506c48dd4834a2f2acd76f8936a9bf6ba93171b", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/reporting/readme.md", + "id": "fc4ef6d8e26fc46ef6c9da5e0d860cf051928e12" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/reporting/extending-woocommerce-admin-reports.md", + "hash": "860c37ab2d1de9744d838e6d3b11eeadb6e6cb11afffa8dfc11021240661d843", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/reporting/extending-woocommerce-admin-reports.md", + "id": "9960520d4548fd3647c5bbc7ed4d4fcc6a76cfce" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/reporting/adding-columns-to-analytics-reports-and-csv-downloads.md", + "hash": "e8265405615834b04a02f5406c38e3be8acdd01116b66f08f25f99a86a580948", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/reporting/adding-columns-to-analytics-reports-and-csv-downloads.md", + "id": "10cabd954ae223ac83f84223611f6d82361f9d9d", + "links": { + "extending-woocommerce-admin-reports.md": "9960520d4548fd3647c5bbc7ed4d4fcc6a76cfce" + } + } + ], + "categories": [] + }, + { + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/rest-api/readme.md", + "hash": "895a1986fd30f437c1bc2aaa618d6a06a98c65511cd257077302c2d1225787d9", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/rest-api/readme.md", + "id": "128b41ed5e9a0ed13a51de3196bd06c0297b2f33" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/rest-api/getting-started.md", + "hash": "b0bb28f6eed57c7d57dde75e8093771450db4666cbfab16d35387c39cd8d1e20", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/rest-api/getting-started.md", + "id": "10f52db2464ea2f373eff9a45ce9e8ff40214122", + "links": { + "_media/permalinks.webp": "5ac10f14cd0ca3ae45a9c089d659fee3ea4d9f22", + "_media/keys.png": "7a29fcb3f0b565f4f6983f1e12200d2c4d62907b", + "_media/postman.png": "b100bbf70f8889c26fcde6a6daca29be796071de", + "_media/insomnia.png": "a50683984998ab518b4b05433ffb1803f2ac135f", + "_media/sslerror.png": "5b6825fb0aba7ed55e1641880701c2afd1744ce1", + "_media/postman-ssl.png": "7e3523b0340acf908e98ac320f822d00a0710ac5", + "_media/insomnia-ssl.png": "84e6406407498b9936d6ef1df5e4c4cc78f75b00" + } + } + ], + "categories": [ + { + "category_title": "_media", + "categories": [] + } + ] + }, + { + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/security/security-best-practices.md", + "hash": "ded14bf9c1b5402c9896c795c4c4cbe6165d465de56009c32559f854446bafda", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/security/security-best-practices.md", + "id": "ee399e729785fec50b90d73b231d321b34ab5ff9" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/security/reporting-security-issues.md", + "hash": "4a748990a0e3207c9f0828c585c1d2edce14bafee9afc331d43bda0b8ee09aa6", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/security/reporting-security-issues.md", + "id": "48caba58b4e5b44fc418bb80cf03aa48f87e4cc8" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/security/readme.md", + "hash": "b484a4886068a33cd8114066262e95a2c8036f1e11d09f0dc63141cd36d85e95", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/security/readme.md", + "id": "8b4aa089616cbeeedfec301eee17b5a00f669154" + } + ], + "categories": [] + }, + { + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/theme-development/theme-design-ux-guidelines.md", + "hash": "bcab4deb86172df46ff775a23b921f8fb4aadd5b5c96085451609a3863642efc", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/theme-development/theme-design-ux-guidelines.md", + "id": "1abe0b1ff5e3990387c7da7fa5a147430b3282f7" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/theme-development/marketplace-guidelines.md", + "hash": "5ca562b2f4cabefe47b0d08334f39d56e8d3e6dc31ea347000d3bb221e51d0a1", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/theme-development/marketplace-guidelines.md", + "id": "f39a348d787fd0cf4a390e70e6f0cbd36b27a283" + } + ], + "categories": [] + }, + { + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/tutorials/readme.md", + "hash": "2ca52b9289180adad5d59865ca45c50098119b420662d727d739243e6a98131a", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/tutorials/readme.md", + "id": "0741650e7ad7567b84f776db7ddad2b8f5a598ea" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/tutorials/adding-actions-and-filters.md", + "hash": "fa6bc021c918aa168023a90e683832455dfa35abbb2561470b08002f1281356f", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/tutorials/adding-actions-and-filters.md", + "id": "3f4d6dcdbc181b11c97c438132ec13a0a8484524" + }, + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/tutorials/adding-a-custom-field-to-variable-products.md", + "hash": "a6b654234e7c7f1fc3f9be49b7d00187d6f271e2d699971bade3cf9a728a780a", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/tutorials/adding-a-custom-field-to-variable-products.md", + "id": "f0a7a4a194a6e0aee6f939791f3eaebf36aebb27" + } + ], + "categories": [] + }, + { + "category_title": "Utilities", + "posts": [ + { + "edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/utilities/logging.md", + "hash": "8912094df57a66c047fe2177be815a40024b461a10ddd61ed297c4b2c2919d64", + "url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/utilities/logging.md", + "id": "f673f50bdd83d5d0d7fd8d9976828f8736809510", + "links": { + "_media/log-critical.jpg": "cc802f94ac4cf125a66bc6bb77bf95b80bf4fbed" + } + } + ], + "categories": [ + { + "category_title": "_media", + "categories": [] + } + ] + } + ], + "hash": "fc6ee378adfa92b706b9d0813f541bf6e8029634c0dd6623000f76047316f0af" +} \ No newline at end of file diff --git a/docs/extension-development/settings-api.md b/docs/extension-development/settings-api.md new file mode 100644 index 00000000000..35f1dce1d72 --- /dev/null +++ b/docs/extension-development/settings-api.md @@ -0,0 +1,110 @@ +# Settings API + +The WooCommerce Settings API is used by extensions to display, save, and load settings. The best way to make use of the API in your extension is to create a class that extends the `WC_Settings_API` class: + +```php +class My_Extension_Settings extends WC_Settings_API { + // +} +``` + +## Defining form fields + +You can define your fields using a method called `init_form_fields` in your class constructor: + +```php +$this->init_form_fields(); +``` + +You must have your settings defined before you can load them. Setting definitions go in the `form_fields` array: + +```php +/** + * Initialise gateway settings form fields. + */ +function init_form_fields() { + $this->form_fields = array( + 'title' => array( + 'title' => __( 'Title', 'your-text-domain' ), + 'type' => 'text', + 'description' => __( 'This controls the title which the user sees during checkout.', 'your-text-domain' ), + 'default' => __( 'PayPal', 'your-text-domain' ) + ), + 'description' => array( + 'title' => __( 'Description', 'your-text-domain' ), + 'type' => 'textarea', + 'description' => __( 'This controls the description which the user sees during checkout.', 'your-text-domain' ), + 'default' => __( "Pay via PayPal; you can pay with your credit card if you don't have a PayPal account", 'your-text-domain' ) + ) + ); +} // End init_form_fields() +``` + +(Make sure your class initializes the `form_fields` property so that the "Creation of dynamic property" error is not thrown in PHP 8.2+) + +In the above example we define two settings, Title and Description. Title is a text box, whereas Description is a textarea. Notice how you can define a default value and a description for the setting itself. + +Setting definitions use the following format: + +```php +'setting_name' => array( + 'title' => 'Title for your setting shown on the settings page', + 'description' => 'Description for your setting shown on the settings page', + 'type' => 'text|password|textarea|checkbox|select|multiselect', + 'default' => 'Default value for the setting', + 'class' => 'Class for the input element', + 'css' => 'CSS rules added inline on the input element', + 'label' => 'Label', // For checkbox inputs only. + 'options' => array( // Array of options for select/multiselect inputs only. + 'key' => 'value' + ), +) +``` + +## Displaying your settings + +Create a method called `admin_options` containing the following: + +```php +function admin_options() { + ?> +
+
+ { createInterpolateElement(
+ __(
+ 'Supported file types:
+ { + uiStrings.attributeRemoveConfirmationModalMessage + } +
} onRemove={ () => handleRemove( removingAttribute ) } onCancel={ () => { diff --git a/packages/js/product-editor/src/components/attribute-control/edit-attribute-modal.tsx b/packages/js/product-editor/src/components/attribute-control/edit-attribute-modal.tsx index 6e774430d43..281a1765068 100644 --- a/packages/js/product-editor/src/components/attribute-control/edit-attribute-modal.tsx +++ b/packages/js/product-editor/src/components/attribute-control/edit-attribute-modal.tsx @@ -1,14 +1,14 @@ /** * External dependencies */ -import { __ } from '@wordpress/i18n'; +import { __, sprintf } from '@wordpress/i18n'; import { Button, Modal, CheckboxControl, TextControl, } from '@wordpress/components'; -import { useState, createElement, Fragment } from '@wordpress/element'; +import { useState, createElement, Fragment, useMemo } from '@wordpress/element'; import { __experimentalTooltip as Tooltip, __experimentalSelectControlMenuSlot as SelectControlMenuSlot, @@ -22,6 +22,8 @@ import { CustomAttributeTermInputField, } from '../attribute-term-input-field'; import { EnhancedProductAttribute } from '../../hooks/use-product-attributes'; +import { Notice } from '../notice'; +import { getAttributeId } from './utils'; type EditAttributeModalProps = { title?: string; @@ -43,6 +45,7 @@ type EditAttributeModalProps = { onCancel: () => void; onEdit: ( alteredAttribute: EnhancedProductAttribute ) => void; attribute: EnhancedProductAttribute; + attributes: EnhancedProductAttribute[]; }; export const EditAttributeModal: React.FC< EditAttributeModalProps > = ( { @@ -77,6 +80,7 @@ export const EditAttributeModal: React.FC< EditAttributeModalProps > = ( { onCancel, onEdit, attribute, + attributes, } ) => { const [ editableAttribute, setEditableAttribute ] = useState< EnhancedProductAttribute | undefined @@ -84,6 +88,71 @@ export const EditAttributeModal: React.FC< EditAttributeModalProps > = ( { const isCustomAttribute = editableAttribute?.id === 0; + const { additions, deletions } = useMemo( () => { + if ( ! attribute.variation ) { + return {}; + } + + const variationsSubTotal = attributes + .filter( + ( otherAttribute ) => + getAttributeId( otherAttribute ) !== + getAttributeId( attribute ) + ) + .reduce( + ( subTotal, { terms } ) => subTotal * ( terms?.length ?? 1 ), + 1 + ); + + const currentAttributeTermsCount = attribute.terms?.length ?? 0; + const variationsTotal = variationsSubTotal * currentAttributeTermsCount; + + const addedTermsCount = + editableAttribute?.terms?.filter( + ( editedTerm ) => + ! attribute.terms?.some( + ( currentTerm ) => currentTerm.id === editedTerm.id + ) + )?.length ?? 0; + const addedTermsTotal = + currentAttributeTermsCount + addedTermsCount || 1; + + const remainedTermsCount = + attribute.terms?.filter( ( currentTerm ) => + editableAttribute?.terms?.some( + ( editedTerm ) => currentTerm.id === editedTerm.id + ) + )?.length ?? 0; + + return { + additions: Math.abs( + variationsTotal - variationsSubTotal * addedTermsTotal + ), + deletions: Math.abs( + variationsTotal - variationsSubTotal * remainedTermsCount + ), + }; + }, [ attributes, attribute, editableAttribute ] ); + + function getNoticeMessage() { + const additionsMessage = sprintf( + // translators: %d is the amount of variations to be added + __( '%d variations will be added', 'woocommerce' ), + additions + ); + const deletionsMessage = sprintf( + // translators: %d is the amount of variations to be removed + __( '%d variations will be removed', 'woocommerce' ), + deletions + ); + if ( additions && deletions ) { + return sprintf( '%s, %s.', additionsMessage, deletionsMessage ); + } else if ( additions ) { + return sprintf( '%s.', additionsMessage ); + } + return sprintf( '%s.', deletionsMessage ); + } + return ( <>