Commit Graph

248 Commits

Author SHA1 Message Date
Chi-Hsuan Huang 2cbb9d59bc
Deprecate unsupported Inbox note banner layout (#51275)
* Deprecate note banner layout

* Update doc

* Add changelog
2024-09-13 01:11:11 +00:00
Tomek Wytrębowicz 0322426dce
Reduce duplicated code in Analytics classes (#49425)
- Add code docs to the Analytics classes and make get_order_statuses non-internal.
   Document analytics classes and some methods. Add simple examples of how to use it. Give a brief "why?" and "when?" answers. Add links between related classes.
- Replace `Automattic\WooCommerce\Admin\API\Reports\*\Query` classes with a single `GenericQuery` class.
- Reduce the amount of duplicated code in Analytics `DataStore`s.
- Reduce duplicated code in Analytics controllers
- Add `FilteredGetDataTrait`, `OrderAwareControllerTrait`, and `StatsDataStoreTrait` for extension developers to reuse while creating custom Analytics
- Add a `GenericQuery` to reduce duplicated code in Query classes.
   Also, to expose it to community extensions for reuse.
- Use `GenericQuery` instead of duplicated `Query` classes
- Move caching code to shared `DataStore::get_data`
- Move intervals specific `initialize_queries` to shared Trait
- Move intervals checking logic to shared `StatsDataStoreTrait`
- Reuse `GenericController::prepare_item_for_response` for `Reports\Controller` subclasses
- Reuse `GenericController::get_collection_params` for `Reports\Controller` subclasses.
- Move `get_items` code to shared `GenericStatsController`
- Move shared paginable controllers `get_items` code to the generic class
- Move fields param to `GenericStatsController`
- Separate `OrderAwareControllerTrait` from `ReportController`
   to allow specific Analytics Controllers to extend the `Generic(Stats)Controller` directly, without extending the `ReportController`, which is used to list reports.


It's meant not to change any behavior. However, due to unification, it did tweak a few things mostly from the developer perspective:
- Previously, only some controllers threw an error from `get_items` when the data was missing; some did not. Now controllers the following Controllers changed behavior to also for such an error:
	- Coupons
	- Customers
	- Downloads
	- Orders
	- Products
	- Taxes
- the error has one error code from all controllers:`woocommerce_rest_reports_invalid_response` (previously there were report-specific)
   - `woocommerce_rest_reports_categories_invalid_response` -> `woocommerce_rest_reports_invalid_response`
- In Orders Controller, the `$orders_data['order_number'], $orders_data['total_formatted']` are set in the `prepare_item_for_response` method, not in the `get_items`So `prepare_item_for_response` function is expected to be called with bare data from Query
- In Products Controller extended-info is now sanitized in the `prepare_item_for_response` method, not in the `get_items`
- ⚠️ (breaking) Previosly some Controlers' `prepare_item_for_response` function was getting and expecting first argument to be casted to `object`, while the rest of controllers used data as returned from the Store. This PR unifies this behavior  for
   -  `Coupons\Stats\Controller`
   -  `Taxes\Controller`
   -  `Taxes\Stats\Controller`
   So, if you extend those classes and override `prepare_item_for_response` in a way that expects `object`, you will get an error. (I have not found such cases in the `all-plugins` repo.)
   All `woocommerce_rest_prepare_report_*` filters remain intact and inconsistent for backward compatibility.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Mik <mikkamp@users.noreply.github.com>
2024-08-21 19:23:51 +02:00
Paul Sealock 9d12459c44
[Navigation] Prepare to remove feature (#50190) 2024-08-09 14:18:39 +12:00
DAnn2012 ef85173041
Fixed typo WooCommmerce (#50247)
* Update README.md.mustache

* Update README.md

* Update page-controller.md

* Update README.md

* Add changefile(s) from automation for the following project(s): @woocommerce/create-woo-extension, woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2024-08-02 03:14:15 +00:00
Chi-Hsuan Huang ab1789afd2
Remove onboarding welcome modals (#48346) 2024-06-13 10:39:21 +08:00
RJ 52e2e9f864
dev: core profiler xstate v5 migration (#48135)
* updated core profiler to xstate v5
2024-06-07 15:06:40 +08:00
Adrian Duffell 8cbc799067
Update Core Profiler Industries (#47605)
* Update indistries list order

* Add arts and crafts

* Add sports and recreation

* Tweak size of dropdown to allow 9 items

* Add small screen size height restriction

* Add changelogs

* Update documentation

* Fix lint issues
2024-05-20 23:10:53 +08:00
Leif Singer 8ee74ede0e
Update Woo.com references to WooCommerce.com (#46259)
* replace capitalized Woo.com with WooCommerce.com

* replace http URLs

* replace https URLs

* replace developer.woo.com

* add missing version in `@since` tag

* unslash the HTTP_REFERER

* WordPress.Security.ValidatedSanitizedInput.InputNotSanitized

* add changelog file

* add more changelog files

* address linter errors

* address more linter errors

* fix test

* more linter errors
2024-04-09 09:50:15 +01:00
Paul Sealock 172bbac661
Remote Specs: Update endpoints to 2.0 (#45298) 2024-03-12 15:53:59 +13:00
And Finally 2789f39bc7
Update example plugin in Activity Notes docs to correct further issues (#45158)
* Improves documentation of example plugins for WooCommerce Admin Notes.

- Adds namespacing for `Automattic\WooCommerce\Admin\Notes\Notes`.
- Uses namespacing in `class_exists` checks.
- Deletes duplicate code.

* Changelog.
2024-03-04 10:03:34 +00:00
And Finally 0a3c285b08
Update example plugin for Activity Notes to include namespacing (#44504)
* Updates example plugin for Activity Notes to include namespacing of `Automattic\WooCommerce\Admin\Notes\Note` and `Automattic\WooCommerce\Admin\Notes\Notes`. Without this, the example doesn't work in `wp-content/plugins`.

* Added changelog.
2024-02-22 14:16:03 +00:00
Alexandre Lara a3c9f56874
[DOCS] Fix incorrect link pointing to the WP Calypso repo (#44865)
* Fix incorrect link in docs

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-02-22 10:40:57 -03:00
Chi-Hsuan Huang 6832a4b249
Update onboarding task documentation & add back `example` command (#44026) 2024-01-30 12:05:46 +08:00
Christopher Allford 6d685e5185 Renamed `woocommerce/client/admin` Package
NPM package names _must_ either be single-word or have
a scope. The current structure is unsupported and has been
changed. The new package name is `@woocommerce/admin-library`.
2023-12-09 12:59:24 -08:00
Christopher Allford 8c6b414fe0
Revert "Refactoring Task Infrastructure" (#41928)
Revert "Refactored Task Infrastructure (#41202)"

This reverts commit 96a973b9fa.
2023-12-06 11:36:12 -08:00
Christopher Allford 96a973b9fa
Refactored Task Infrastructure (#41202)
* Fixed NPM packages with invalid names.
* Renamed plugin packages.
* Standardized package NPM scripts.
* Replaced Turborepo with Wireit.
2023-12-06 09:32:32 -08:00
Leif Singer 5944fdcdff replace developer.woocommerce.com with developer.woo.com 2023-11-10 16:09:27 +01:00
Leif Singer 9edad5270d appease the linter 2023-11-10 15:49:08 +01:00
Leif Singer 0d7a833056 exclude `woocommerce.com/wp-json` 2023-11-10 15:49:08 +01:00
Leif Singer 808a0fc54f update references to woocommerce.com to now reference woo.com 2023-11-10 15:49:08 +01:00
Wacław Jacek 3d5b58b7d6
Remove dependency on Jetpack from Shipping and Tax task list items (#39992)
* Remove dependency on Jetpack from WCS&T's task list item

- Remove installing Jetpack-the-plugin from WooCommerce Shipping &
Tax WC Home task list and recommended extensions area.

- Update Jetpack auth link generation to use getJetpackAuthUrl().

- Remove references of Jetpack-the-plugin from WCS&T onboarding
as the extension will now use the Jetpack Connection package
for establishing a connection between WPCOM infrastructure
and a Woo site.

* Update WooCommerce Tax flow in WC Home task list

* Inline the agreementText variable

* Add missing pluginSlugs prop to <Plugins> instance for WC Tax

* Fix WC Tax extension name in API response

* Remove Jetpack from copy in Tax task header

* Fix MD034/no-bare-urls MD linting violation

* Fix experimental shipping recommendation tests

* Add changelogs requested by linter

* Add changefile(s) from automation for the following project(s): @woocommerce/components, woocommerce

* Remove mention of Jetpack from ExperimentalShippingRecommendation

* Fix text wrapping bug in WC Tax onboarding task

* Add changefile(s) from automation for the following project(s): @woocommerce/components, woocommerce

* Use isResolving() to detect pending auth URL fetch

* Replace unused hasErrors with ref to error

* Fix lint

* Jetpack auth URL prefetching

* Revert "Jetpack auth URL prefetching"

This reverts commit 2b79000e20.

* Add PrefetchJetpackAuthUrl component to remove Connect button load time

* Replace URL prefetching in component with useEffect

* Fix: Accept redirect URL as param instead of prop

* Fix lint

* Remove prefetching. Make Connect button always available

* Fix ExperimentalShippingRecommendation incompatibility with new Connect behavior

* Handle empty object errors in Connect

* Display TOS above WooCommerce Shipping & Tax installation buttons (#40863)

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-10-25 22:39:43 +08:00
louwie17 9ea83d6382
Fix description styling and remove use of `woocommerce-page` in admin pages (#40218)
* Move the header data to the body as the header prop does not exist anymore

* Remove explicit setting of __unstableResolvedAssets given get_block_editor_settings already does this

* Remove use of woocommerce-page class in admin to avoid theme conflicts

* Add changelogs

* Revert change for quick test

* Two additional tweaks for admin related styling
2023-09-15 17:06:42 -03:00
Ron Rennick ca6b152755
update the SqlQuery filter prefix in data.md (#39319)
* update the SqlQuery filter prefix in data.md

* fix md linting

---------

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
2023-08-31 15:23:20 -03:00
RJ 3f3f032ed5
dev: added docs for core profiler (#39963)
* dev: added docs for core profiler

* lint

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2023-08-31 16:27:40 +08:00
Tomek Wytrębowicz 463d91c16c Remove non-existing method from TaskList docs. 2023-07-27 15:46:56 +02:00
Oleksandr Aratovskyi aeaaac9505
Change WooCommerce Payments to WooPayments across the WC Core (#39188)
* Change WooCommerce Payments to WooPayments across the WC Core

* Change WooCommerce Payments to WooPayments across the WC Core

* Add more changelogs

* Add changelog for data package

* Change banner image and task description

* Fix lint error

* Change one more banner image

* Fix to the banner image

* Roll back changelog.txt and fix one condition for backwards compatibility

* Fix in changelog.txt

* Small fix in changelog.txt
2023-07-13 12:58:17 +03:00
Chi-Hsuan Huang b8aa7eb1fe
Update task list documentation and example (#38245)
* Update woocommerce task list examples

* Update onboarding-tasks.md

* Add changelog

* Update changelog

* Update task list doc

* Update onboarding-tasks.md

* Update examples readme

* Fix lint

* Update onboarding-tasks.md

* Fix build wca example cmd

* Update plugins/woocommerce-admin/docs/features/onboarding-tasks.md

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Update plugins/woocommerce-admin/docs/features/onboarding-tasks.md

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Update plugins/woocommerce-admin/docs/features/onboarding-tasks.md

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Update plugins/woocommerce-admin/docs/features/onboarding-tasks.md

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

* Update task list image

---------

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
2023-05-18 11:21:53 +08:00
Jeffrey Paul df0583f9b8
Fix/37502: Correct spelling errors. (#37887)
* change reference of Catpure to Capture

Co-Authored-By: Vikram  <93216400+vikrampm1@users.noreply.github.com>

* change reference of expicitly to explicitly

Co-Authored-By: Vikram  <93216400+vikrampm1@users.noreply.github.com>

* change reference 'cutted' to 'cut'

* change reference 'determening' to 'determining'

* change reference 'retreive' to 'retrieve'

* change reference 'neccessary' to 'necessary'

* change reference 'Fitler' to 'Filter'

* change reference of "seperate" to "separate"

Co-Authored-By: Ankit K Gupta <ankit.himcs@gmail.com>

* change reference of "wether" to "whether"

Co-Authored-By: Sumit Bagthariya <67687255+qasumitbagthariya@users.noreply.github.com>

* change reference of "staus" to "status"

* change reference of "retrive" to "retrieve"

* change references of "gatways" to "gateways"

* change references of "existant" to "existent"

* change reference of "requries" to "requires"

* change reference of "configuation" to "configuration"

* change reference of "processsing" to "processing"

* change reference of "represenation" to "representation"

* change reference of "dimentions" to "dimensions"

* change references of "reigster" to "register"

* change reference of "colum" to "column"

* change reference of "transtions" to "transitions"

* change references of "intially" to "initially"

* change references of "orignal" to "original"

* change references of "deprected" to "deprecated"

* change references of "paramter" to "parameter"

* change reference of "intance" to "instance"

* change reference of "elemets" to "elements"

* change references of "funcitons" to "functions"

* change reference of "specificed" to "specified"

* change references of "atributes" to "attributes"

* change reference of "tast" to "task"

* change reference of "chaning" to "changing"

* change reference of "retreiving" to "retrieving"

* change reference of "caluclation" to "calculation"

* change references of "Invaid" to "Invalid"

* change references of "paramaters" to "parameters"

* change reference of "Additonal" to "Additional"

* change reference of "teh" to "the"

* change reference of "evalutes" to "evaluates"

* change reference of "addedd" to "added"

* change reference of "excempt" to "exempt"

* change reference of "sequencially" to "sequentially"

* change reference of "previos" to "previous"

* change reference of "elegible" to "eligible"

* change references of "Boostrap" to "Bootstrap"

* change references of "compability" to "compatibility"

* change reference of "heirarchy" to "hierarchy"

* change references of "visibilty" to "visibility"

* change reference of "comparsion" to "comparison"

* change reference of "capabilties" to "capabilities"

* change reference of "datatores" to "datastores"

* change reference of "occured" to "occurred"

* change reference of "coresponding" to "corresponding"

* change references of "thier" to "their"

* change reference of "sucessfully" to "successfully"

* change reference of "insde" to "inside"

* change reference of "nagivation" to "navigation"

* change references of "visiblity" to "visibility"

* change reference of "documentaiton" to "documentation"

* change reference of "anayltics" to "analytics"

* change reference of "intalling" to "installing"

* change reference of "mininum" to "minimum"

* change references of "intial" to "initial"

* change reference of "Feld" to "Field"

* change reference of "taks" to "task"

* change reference of "trasnfer" to "transfer"

* change reference of "respone" to "response"

* change reference of "Extenstions" to "Extensions"

* change reference of "detault" to "default"

* change reference of "simultanious" to "simultaneous"

* change reference of "overides" to "overrides"

* change references of "Indvidual" to "Individual"

* change reference of "refering" to "referring"

* change reference of "aginst" to "against"

* change reference of "execuatable" to "executable"

* change reference of "repsonse" to "response"

* change reference of "documention" to "documentation"

* change reference of "asumed" to "assumed"

* change reference of "Minium" to "Minimum"

* change reference of "unqiue" to "unique"

* change references of "existance" to "existence"

* change reference of "compatability" to "compatibility"

* change reference of "Taxnomy" to "Taxonomy"

* change reference of "quering" to "querying"

* change reference of "retrun" to "return"

* change reference of "informations" to "information"

Co-Authored-By: Viktor Szépe <viktor@szepe.net>

* Add changelog

* Add changelog

* Fix typo

---------

Co-authored-by: Vikram  <93216400+vikrampm1@users.noreply.github.com>
Co-authored-by: Ankit K Gupta <ankit.himcs@gmail.com>
Co-authored-by: Sumit Bagthariya <67687255+qasumitbagthariya@users.noreply.github.com>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2023-05-08 15:55:09 +08:00
Christopher Allford c0b76f70cc
Rename @woocommerce/admin-library (#33460)
This commit changes it to woocommerce/client/admin. This is an invalid NPM package name and an invalid Composer package name. This will prevent conflicts but also identify it as a component of Core.
2022-06-17 13:28:34 -07:00
Christopher Allford b7931409f2
Migrate From Nx to Turborepo (#33079)
This replaces all `nx` commands with `turbo` commands and removes Nx from the repository. All of the `project.json` files have been removed and any commands that broke with Turborepo have been adjusted.
2022-06-09 14:40:07 -07:00
Chi-Hsuan Huang 3ead227cdc
Merge branch 'trunk' into update/admin-docs 2022-04-15 11:53:08 +08:00
Chi-Hsuan Huang b936e3243f Update feature-flags.md 2022-04-14 17:15:12 +08:00
Chi-Hsuan Huang c813c3bc5f Remove "plugin" environment from admin feature plugin 2022-04-14 16:40:35 +08:00
Chi-Hsuan Huang 20736a5280 Remove docsify-cli and releated files 2022-04-14 13:50:29 +08:00
Chi-Hsuan Huang dfa51ac747 Update docs 2022-04-14 13:50:27 +08:00
Chi-Hsuan Huang 96a5a7b75d Remove building ./docs storybook 2022-04-14 13:49:51 +08:00
Chi-Hsuan Huang ed8885f0b7 Fix admin extensions webpack config 2022-04-14 13:49:51 +08:00
Chi-Hsuan Huang 0ed8911875 Update admin docs README.md 2022-04-14 13:49:51 +08:00
Chi-Hsuan Huang 3fc88f0a71 Update links of woocommerce-admin to https://github.com/woocommerce/woocommerce 2022-04-07 17:02:43 +08:00
RJChow 26ec889111 Manually change i18n text domain from 'woocommerce-admin' to 'woocommerce' in WCA Client .md files 2022-04-01 11:41:32 +08:00
Joshua T Flowers 611903ef5d Separate onboarding concerns into separate classes (https://github.com/woocommerce/woocommerce-admin/pull/8280)
* Separate onboarding concerns into separate classes

* Fix up onboarding product types

* Fix up references to profile data option

* Fix up call to allowed themes

* Move onboarding features to internal namespace

* Remove old onboarding redirect

* Fix failing tests

* Add changelog entry

* Move inernal classes to the new src-internal folder

* Fix lint error

* Add deprecated class for Onboarding

* Add empty construct method

* Remove some of the unnecessary static functions and make sure OnboardingTasks still gets initialized

* Fix missed changes during rebase

* Fix tests

Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2022-03-17 17:10:43 -03:00
louwie17 c65d43a35e Cleanup Loader.php and move it to Internal namespace (https://github.com/woocommerce/woocommerce-admin/pull/8416)
* Seperated Asset, page, and translation logic into seperate classes out of Loader.php

* Move user, and assets logic out of Loader.php

* Move Loader to Internal and move page helper functions to PageController

* Fix unit tests

* Add changelog
2022-03-09 10:04:34 -04:00
Chi-Hsuan Huang 86fc8b62e5 Switch to pnpm (https://github.com/woocommerce/woocommerce-admin/pull/8349)
* Add pnpm-workspace.yaml

* Add missing dependencies & replace file: with workspace:* in
package.json

* Replace "npm" with "pnpm"

* Replace "npx" with "pnpx"

* Remove package-lock.json

* Add pnpm setup action to github workflows

* Update webpack babel exclude path

* Upgrade woo e2e and fix e2e test command

Update e2e.yml

Use pnpm run e2e:docker-up in e2e.yml

* Remove unused docker-compose.yaml

* Replace lerna with pnpm commands

Update publish commands

* Exclude _locutus_shared_bc.js in babel.config.js

* Add .npmrc to set enable-pre-post-scripts=true by default

* Fix storybook babel config

Update babel.config.js

* Add changelog

* Update pnpm-lock.yaml

* Replace pnpx with pnpm exec

* Update pnpm-lock.yaml

* Remove js-tests/package-lock.json

* Fix @woocommerce/tracks -> workspace:*

* Update pnpm-lock.yaml

* Add @woocommerce/experimental to onboarding/package.json

* Add "@woocommerce/component" to onboarding/package.json

* Update pnpm-lock.yaml

* Use || instead of && for "test:watch"

Co-authored-by: RJ <27843274+rjchow@users.noreply.github.com>

* Fix packages/number "clean" command

* Add root: true to .eslintrc.js to enforce it to use the root config file

* Exclude packages/**/node_modules from babel transpiling

* Fix js-tests build config

Co-authored-by: RJ <27843274+rjchow@users.noreply.github.com>
2022-03-04 12:01:16 +08:00
Chi-Hsuan Huang bfa445f600 Add Spain to Square suggestion country list (https://github.com/woocommerce/woocommerce-admin/pull/8210)
* Add Spain to square_credit_card suggestion country list

* Fix payment-gateway-suggestions.md data source polling url

* Add changelog
2022-01-26 17:37:05 +08:00
louwie17 3998f88597 Remove unpublished wc-admin-settings package and update getSetting usage (https://github.com/woocommerce/woocommerce-admin/pull/8057)
* Remove use of wc-admin-settings from packages

* Move getSetting to getAdminSetting and remove wc-admin-settings package

* Add changelog

* Update package.json and remove last use of wc-admin-settings
2022-01-06 08:53:30 -04:00
Chi-Hsuan Huang f838727546 Replace all docs.woocommerce.com links with woocommerce.com's (https://github.com/woocommerce/woocommerce-admin/pull/8105)
* Replace all docs.woocommerce.com links with woocommerce.com/documentation
* Add changelogs

Update changelogs

* Update woocommerce-amazon-ebay-integration doc url
2022-01-04 17:03:58 +08:00
Ilyas Foo fd396d018d Add Inbox Note example code to docs (https://github.com/woocommerce/woocommerce-admin/pull/8019)
* Add Inbox Note example extension

* Typo

* Put into class

* Fix premature class import, moved note check logic to its own method
2021-12-10 12:52:03 +08:00
Joshua T Flowers 5f8db47c16 Add payment gateway suggestion docs and example extensions (https://github.com/woocommerce/woocommerce-admin/pull/7966)
* Remove dated doc references

* Clean up slotfill and install script docs

* Add filter to suggestion specs

* Register example gateways

* Mock gateway installation and activation

* Add simple gateway

* Update gateway IDs

* Add slot filled gateway

* Add slot fill for slot filled gateway

* Allow gateway to be enabled and marked as configured if already enabled

* Add changelog entry

* Add quick start blurb to markdown file

* Remove duplicate JS registration and add default export

* Add payment settings save hook
2021-12-03 15:13:05 -05:00
Joshua T Flowers 126707eeab Replace old task list option calls with data store selectors (https://github.com/woocommerce/woocommerce-admin/pull/7820)
* Add endpoint to unhide task list

* Rename show method to unhide

* Replace requests for hidden task list options

* Replace unhide task list requests

* Replace task list complete checks

* Replace dismiss option requests

* Remove complete task option check

* Fix up panel buttons

* Update finished setup to wait for task list resolution

* Create selector for getting a single task list

* Add selector for single task

* Fix task list panel visibility

* Add changelog entry

* Fix empty product types in profiler data

* Revert to checking for hidden task list
2021-11-15 15:57:13 -05:00
Joshua T Flowers 91473959c8 Update add task extension example (https://github.com/woocommerce/woocommerce-admin/pull/7809)
* Update task extension example

* Fix up namespaced classes

* Register task on init hook for REST usage
2021-10-27 15:03:27 -04:00