Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow configuration based on shipping classes #1145

Merged
merged 4 commits into from
Sep 27, 2024

Conversation

FlorianSDV
Copy link
Contributor

@FlorianSDV FlorianSDV commented Aug 14, 2024

INT-567

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 65.67797% with 81 lines in your changes missing coverage. Please review.

Project coverage is 59.88%. Comparing base (24d68e3) to head (e5419cc).
Report is 18 commits behind head on beta.

Files with missing lines Patch % Lines
...s/frontend/checkout-core/src/utils/useCartStore.ts 0.00% 15 Missing and 1 partial ⚠️
views/frontend/checkout-core/src/main.ts 0.00% 11 Missing and 1 partial ⚠️
...ews/frontend/checkout-delivery-options/src/main.ts 0.00% 10 Missing ⚠️
...heckout-core/src/blocks/getBlocksCheckoutConfig.ts 0.00% 9 Missing ⚠️
...rontend/checkout-core/src/utils/getShippingRate.ts 0.00% 8 Missing and 1 partial ⚠️
...ivery-options/src/utils/getHighestShippingClass.ts 0.00% 7 Missing and 1 partial ⚠️
views/frontend/checkout-core/src/types.ts 0.00% 7 Missing ⚠️
views/frontend/checkout-core/src/blocks/index.ts 0.00% 5 Missing and 1 partial ⚠️
views/frontend/checkout-core/src/utils/index.ts 0.00% 3 Missing ⚠️
...ntend/checkout-delivery-options/src/utils/index.ts 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               beta    #1145      +/-   ##
============================================
- Coverage     61.66%   59.88%   -1.79%     
+ Complexity      671      619      -52     
============================================
  Files           108      106       -2     
  Lines          3524     3233     -291     
  Branches         25       23       -2     
============================================
- Hits           2173     1936     -237     
+ Misses         1326     1274      -52     
+ Partials         25       23       -2     
Flag Coverage Δ
backend 67.78% <100.00%> (-2.02%) ⬇️
checkout 0.00% <0.00%> (ø)
frontend 0.00% <0.00%> (ø)
unit 59.88% <65.67%> (-1.79%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@myparcel-bot
Copy link
Contributor

myparcel-bot bot commented Aug 16, 2024

PDK upgrade summary

The following packages were upgraded:

Package Old version New version
myparcelnl/pdk 2.43.2 2.43.3

@myparcel-bot
Copy link
Contributor

myparcel-bot bot commented Aug 16, 2024

✅ Build successful!

You can find a link to the downloadable artifact below.

Name Link
Commit e5419cc
Logs https://github.com/myparcelnl/woocommerce/actions/runs/11066826729
Download https://github.com/myparcelnl/woocommerce/suites/28920421293/artifacts/1986299222

@joerivanveen joerivanveen changed the title Feat/use shipping classes florian feat: migrate shipping classes package types settings Aug 20, 2024
@joerivanveen joerivanveen changed the title feat: migrate shipping classes package types settings feat: use shipping classes Aug 20, 2024
@joerivanveen joerivanveen marked this pull request as ready for review August 29, 2024 07:42
@joerivanveen joerivanveen requested a review from a team as a code owner August 29, 2024 07:42
@EdieLemoine EdieLemoine force-pushed the feat/use-shipping-classes-florian branch 2 times, most recently from 343dd9a to 01740bf Compare September 4, 2024 14:28
@EdieLemoine EdieLemoine force-pushed the feat/use-shipping-classes-florian branch from 01740bf to 9da979f Compare September 4, 2024 14:31
@EdieLemoine EdieLemoine changed the title feat: use shipping classes feat: allow configuration based on shipping classes Sep 4, 2024
@FlorianSDV FlorianSDV force-pushed the feat/use-shipping-classes-florian branch from ccd6c17 to 6a6f570 Compare September 13, 2024 07:49
src/Migration/Pdk/SettingsMigration.php Outdated Show resolved Hide resolved
src/Migration/Pdk/SettingsMigration.php Outdated Show resolved Hide resolved
src/Pdk/Context/Service/WcContextService.php Show resolved Hide resolved
src/Pdk/Plugin/WcShippingMethodRepository.php Outdated Show resolved Hide resolved
src/Pdk/Plugin/WcShippingMethodRepository.php Show resolved Hide resolved
src/Pdk/Plugin/WcShippingMethodRepository.php Outdated Show resolved Hide resolved
tests/mock_wp_functions.php Show resolved Hide resolved
@FreekVR
Copy link
Collaborator

FreekVR commented Sep 16, 2024

Vind het lastig op te bepalen in hoeverre dit breaking changes zijn. Op zich kun je tussen twee beta versies zoveel breaking changes hebben als je wil, maar volgens mij zijn er best wel wat klanten al doorverwezen om de beta te installeren?

Ik denk goed om de impact van deze changes/release te bepalen en waar nodig dan ook duidelijk te documenteren & communiceren.

@myparcel-bot myparcel-bot bot force-pushed the feat/use-shipping-classes-florian branch from fca4da8 to a386799 Compare September 20, 2024 14:47
@myparcel-bot myparcel-bot bot force-pushed the feat/use-shipping-classes-florian branch from a386799 to 1a87fc0 Compare September 20, 2024 14:56
@EdieLemoine EdieLemoine force-pushed the feat/use-shipping-classes-florian branch from 1a87fc0 to 1a1cdc8 Compare September 20, 2024 14:56
@myparcel-bot myparcel-bot bot force-pushed the feat/use-shipping-classes-florian branch 2 times, most recently from 2ed71db to 14e8007 Compare September 20, 2024 15:18
EdieLemoine and others added 2 commits September 20, 2024 18:09
fix: fix the shipping things

refactor: remove log statements

test: rework to single test maintaining same values

test: improve coverage

style: add comment and change layout

wip: increase test coverage

refactor: implement more codacy suggestions

refactor: implement codacy suggestions

chore: update phpstan baseline

style: clean upp code

test: add mock wc shipping zones and methods

test: remove unnecessary class

test: remove unnecessary factory

test: remove snapshot

test: finalize wc context service test

test: implement mock wp cache

wip: update mock cart and retrieve wp_term

feat: remove cart from product settings migration

wip: continue with mock classes

wip: start with mock classes

wip

wip: migrate old shipping classes

wip: use shipping classes in shipping method logic
@myparcel-bot myparcel-bot bot force-pushed the feat/use-shipping-classes-florian branch from 14e8007 to 12dae8a Compare September 20, 2024 18:09
@myparcel-bot myparcel-bot bot added the approved (Auto) label Sep 23, 2024
@EdieLemoine EdieLemoine merged commit ff282a1 into beta Sep 27, 2024
8 of 10 checks passed
@EdieLemoine EdieLemoine deleted the feat/use-shipping-classes-florian branch September 27, 2024 11:49
myparcel-bot bot added a commit that referenced this pull request Oct 31, 2024
## [5.0.0](v4.24.1...v5.0.0) (2024-10-31)

### ⚠ BREAKING CHANGES

* rebuild entire plugin with pdk

### 🐛 Bug Fixes

* add default value for delivery options position filter ([97600e6](97600e6))
* add missing entry to container ([f4cb71b](f4cb71b))
* **admin:** add missing animations ([132da45](132da45))
* **admin:** add multi select input ([20e71a5](20e71a5))
* **admin:** change shipment label row transition ([c2d7cad](c2d7cad))
* **admin:** do not render untranslated subtext ([fb0ccce](fb0ccce))
* **admin:** fix button dropdowns not expanding correctly ([#1129](#1129)) ([6445513](6445513))
* **admin:** fix code editor not being used ([60f6014](60f6014))
* **admin:** fix console warning on modal open ([8040268](8040268))
* **admin:** fix cutoff time option throwing error ([8e84af9](8e84af9))
* **admin:** fix cutoff time translation ([87faab8](87faab8))
* **admin:** fix disabled and readonly logic on all inputs ([77a5492](77a5492))
* **admin:** fix dropoff input not showing ([#1110](#1110)) ([e2da027](e2da027))
* **admin:** fix import of shipment label wrapper ([69dc9fa](69dc9fa))
* **admin:** fix input widths exceeding containers ([e3381db](e3381db))
* **admin:** fix label description notice in order grid ([63b631e](63b631e))
* **admin:** fix rendering on elements with undefined as ref value ([5332974](5332974))
* **admin:** fix select boxes duplicating and options not being preselected ([2afaf62](2afaf62))
* **admin:** fix select inputs not showing initial value ([85ceb13](85ceb13))
* **admin:** fix tooltips not being initialized ([43cfc49](43cfc49))
* **admin:** improve accessibility ([be58218](be58218))
* **admin:** improve dropdown button ([578dadb](578dadb))
* **admin:** improve select inputs ([7aab3b1](7aab3b1))
* **admin:** initialize tooltips properly ([2f46db0](2f46db0))
* **admin:** make button groups responsive ([#1003](#1003)) ([654b8b9](654b8b9))
* **admin:** make the boxes and modals match wordpress better ([#1001](#1001)) ([e95b663](e95b663))
* **admin:** show correct styling in settings page ([#1036](#1036)) ([dbb4be1](dbb4be1))
* **admin:** translate form group text correctly ([e0ba9c0](e0ba9c0))
* **admin:** update button style ([184b4b4](184b4b4))
* **admin:** update components ([ba5f874](ba5f874))
* **admin:** update form group ([8a2e5ee](8a2e5ee))
* **admin:** use different log level in production mode ([d2538f0](d2538f0))
* **admin:** use the correct versions of js dependencies ([2eefa0e](2eefa0e))
* **build:** fix plugin not being seen as new version of 4.x ([f832abb](f832abb))
* **cart:** fix incorrect reference to delivery options fees service ([27b0776](27b0776))
* **checkout:** disable eori field warnings when they don't exist ([adc7527](adc7527))
* **checkout:** fix delivery options not being passed to backend ([33288e8](33288e8))
* **checkout:** fix delivery options not being saved to order ([e69766e](e69766e))
* **checkout:** fix empty billing address 1 ([#1005](#1005)) ([b6ac3cc](b6ac3cc))
* **checkout:** fix error on submitting order ([dae7a45](dae7a45))
* **checkout:** fix javascript error on order received page ([c0477cc](c0477cc))
* **checkout:** fix third party shipping methods not working with delivery options ([80357fc](80357fc))
* **checkout:** have delivery options show in classic checkout ([#1094](#1094)) ([4812cca](4812cca))
* **checkout:** improve checkout logic ([26e3ee1](26e3ee1))
* **checkout:** prevent orders without incomplete address ([e416558](e416558))
* **checkout:** use show delivery options on backorders setting ([#1136](#1136)) ([9495554](9495554))
* **compatibility:** reduce conflicts with other plugins ([#1025](#1025)) ([4b90766](4b90766))
* **components:** improve components ([942f0f3](942f0f3))
* correctly show track & trace in account page ([ecb4fd8](ecb4fd8))
* create audits table on installation ([#1068](#1068)) ([7cc0b25](7cc0b25))
* **cronservice:** make callable usable ([#1052](#1052)) ([11882b0](11882b0))
* **customs-declaration:** pass correct package contents ([#1012](#1012)) ([dde84e6](dde84e6))
* **customs-declarations:** fix items amount ([#1010](#1010)) ([545a8f1](545a8f1))
* disable plugin peacefully when prerequisites are not met ([d891414](d891414))
* disable selectwoo for now because it won't work ([d20972e](d20972e))
* do not show product settings in custom fields ([c21f951](c21f951))
* ensure numeric values at physical properties ([44e96f8](44e96f8))
* **export:** export label description ([ced065d](ced065d))
* **export:** fix multiple automatic exports ([#1034](#1034)) ([bc610ad](bc610ad))
* fill settings that didnt't exist before migration ([bab3a36](bab3a36))
* **filters:** allow not having a default value ([c580358](c580358))
* fix changes in settings and account not being updated correctly ([514d990](514d990))
* fix custom fields not showing when they should ([8b1a3e1](8b1a3e1))
* fix fatal error caused by wrongly prefixed file ([96fe2b7](96fe2b7))
* fix imports ([d8a49ce](d8a49ce))
* fix myparcelbe version not working ([c9eaba5](c9eaba5))
* fix naming error in bulk actions order mode ([4a7c17b](4a7c17b))
* fix number error on "add order" page ([adadd92](adadd92))
* fix ts imports ([#1030](#1030)) ([c6c2afc](c6c2afc))
* fix undefined index warning ([7b82dd4](7b82dd4))
* fix width of carrier settings not matching other tabs ([#1000](#1000)) ([2f52c19](2f52c19))
* **hooks:** fix error on getting pdk frontend routes ([e0973e8](e0973e8))
* **hpos:** fix order grid bulk actions not working ([d1eef35](d1eef35))
* implement bootstrapper ([26feee5](26feee5))
* improve components ([3a276a9](3a276a9))
* improve prerequisites logic ([60b65f7](60b65f7))
* increase order list column width ([73b8980](73b8980))
* **meta:** fix settings link not showing on plugins page ([1ea10bc](1ea10bc))
* **migration:** allow shipping method without colon ([#1024](#1024)) ([6c47f56](6c47f56))
* **migration:** finish migration even when api key is faulty ([#1023](#1023)) ([7ce87d0](7ce87d0))
* **migration:** fix allow pickup locations setting not being migrated ([44e29d1](44e29d1))
* **migration:** fix existing settings ([e7f6d11](e7f6d11))
* **migration:** fix inverted product settings search query ([e76028e](e76028e))
* **migration:** fix product settings migration failing ([2c32dd7](2c32dd7))
* **migration:** have weightservice work with all units ([f6e2614](f6e2614))
* **migration:** improve migration logic ([5364a02](5364a02))
* **migration:** improve migrations ([e340e9d](e340e9d))
* **migration:** improve order migration ([bb8e7ef](bb8e7ef))
* **migration:** improve pdk migrations ([a970919](a970919))
* **migration:** improve settings migration ([43e0c69](43e0c69))
* **migration:** improve shipping methods migration ([b9383d3](b9383d3))
* **migration:** migrate shipments to proper address fields ([f5db010](f5db010))
* **migration:** prevent removing current version on uninstall ([#1022](#1022)) ([df21c29](df21c29))
* **migration:** set delivery options date to null if it's empty ([#1020](#1020)) ([58fc7a0](58fc7a0))
* **migration:** transform existing carrier settings ([7a9788b](7a9788b))
* **modal:** fix modal actions ([840f4ad](840f4ad))
* **notes:** get api identifier from order meta data ([91d87b3](91d87b3))
* **orders:** always return items array from WcOrderRepository ([#1055](#1055)) ([6fce81c](6fce81c))
* **orders:** convert weight to grams ([#1021](#1021)) ([bd38290](bd38290))
* **orders:** do not add return barcodes to order notes ([#998](#998)) ([34ca572](34ca572))
* **orders:** fix error when getting order via non-object ([0d39b5c](0d39b5c))
* **orders:** fix error when state does not match XX-XX format ([#1038](#1038)) ([1c7023f](1c7023f))
* **orders:** fix meta keys being saved multiple times ([98a4a3e](98a4a3e))
* **orders:** fix some errors when creating orders ([de47001](de47001))
* **orders:** fix state and missing address fields errors ([#1019](#1019)) ([8ef3e53](8ef3e53))
* **orders:** fix storing data in hpos ([#1037](#1037)) ([f2e09dd](f2e09dd))
* **orders:** fix type error when country is missing ([f016b91](f016b91))
* **orders:** improve order note author mapping ([03e0a75](03e0a75))
* **permissions:** check all user roles ([#1048](#1048)) ([260ad2e](260ad2e))
* **plugin:** fix plugin being deactivated on upgrade ([3be182a](3be182a))
* prefix bulk actions with "MyParcel" ([#999](#999)) ([011376f](011376f))
* prevent array to string conversion warning ([90c587d](90c587d))
* **product-settings:** fix updating without hpos ([#1040](#1040)) ([e179184](e179184))
* **product:** fix product settings not working ([756369e](756369e))
* render settings page ([14e449d](14e449d))
* **request:** pass $_COOKIE and $_SERVER to converted requests ([0861ba3](0861ba3))
* **requests:** send correct user agent to myparcel api ([12e6afb](12e6afb))
* **request:** update guzzle adapter ([02cd681](02cd681))
* save shipment even when updated is not null ([e1e1849](e1e1849))
* set label description on order ([f7593f3](f7593f3))
* set physical properties on pdkorder ([9056140](9056140))
* **settings:** correct keys for webhook settings ([902d7d5](902d7d5))
* **settings:** fix correct shipping methods not showing up ([1528585](1528585))
* **settings:** make drop off toggle reactive again ([#1008](#1008)) ([ecb0cf0](ecb0cf0))
* **settings:** prevent array to string conversion notice ([16227b1](16227b1))
* show notices through all_admin_notices hook ([613fb73](613fb73))
* update account settings after migration ([c4cffdd](c4cffdd))
* update fields ([1180fdf](1180fdf))
* update frontend routes ([67b5aa1](67b5aa1))
* update product settings ([f1f2fa3](f1f2fa3))
* use correct option for automatic export ([4cc4959](4cc4959))
* **webhooks:** fix webhooks not running ([#1056](#1056)) ([e9cc97c](e9cc97c))
* **webhooks:** fix webhooks not working ([#1137](#1137)) ([fcbd7d2](fcbd7d2))
* **webhooks:** use json params ([#1046](#1046)) ([0f2f075](0f2f075))
* **webhook:** use correct class to execute webhooks ([#1029](#1029)) ([9cd29ab](9cd29ab))
* wrap pdk admin init in window.onload ([899d14d](899d14d))

### ⚡ Performance Improvements

* **orders:** fix audits table being queried for each order in overview ([#1156](#1156)) ([dd22902](dd22902))
* reduce amount of checks for account ([9b83be8](9b83be8))

### ✨ New Features

* **account:** show delivery options in account ([9d515ad](9d515ad))
* add bulk actions ([c2ba715](c2ba715))
* add dhleuroplus and dhlparcelconnect ([643d297](643d297))
* add legacy delivery options meta ([#1097](#1097)) ([9545c3a](9545c3a))
* **admin:** add subtext option to field ([5190f08](5190f08))
* **admin:** add text area and code editor component ([5adf95e](5adf95e))
* **admin:** improve button styles ([ba59c53](ba59c53))
* **admin:** improve radio component ([7d1faf3](7d1faf3))
* **admin:** make select2 component work properly ([a42cadf](a42cadf))
* **admin:** use native pdk product settings view ([da3b936](da3b936))
* allow configuration based on shipping classes ([#1145](#1145)) ([ff282a1](ff282a1))
* allow picking package type per shipping method ([#1104](#1104)) ([3cd31f6](3cd31f6))
* allow shop manager to operate plugin ([#1028](#1028)) ([be28524](be28524))
* **checkout:** add blocks compatibility ([#1065](#1065)) ([7b69aaa](7b69aaa))
* **checkout:** improve checkout logic ([cdfd72a](cdfd72a))
* **checkout:** include address line 2 in full street ([#1032](#1032)) ([31aa6f2](31aa6f2))
* **checkout:** upgrade to delivery options v6.x ([9c23b4f](9c23b4f))
* **deps:** update [@myparcel-pdk](https://github.com/myparcel-pdk) packages ([82986b9](82986b9))
* **deps:** update @myparcel-pdk/admin ([4b19ca2](4b19ca2))
* **deps:** update myparcelnl/pdk from 2.4.1 to 2.5.2 ([f09fabb](f09fabb))
* **deps:** update myparcelnl/pdk to from 2.3.0 to 2.4.1 ([a9e294e](a9e294e)), closes [#98](#98) [#105](#105)
* **deps:** update myparcelnl/pdk to v2.6.2 ([c9d367f](c9d367f))
* **deps:** upgrade @myparcel-pdk/* ([2eafb96](2eafb96))
* **deps:** upgrade @myparcel-pdk/* ([dcb2153](dcb2153))
* **deps:** upgrade @myparcel-pdk/* ([1271aac](1271aac))
* **deps:** upgrade @myparcel-pdk/* ([f30713f](f30713f))
* **deps:** upgrade @myparcel-pdk/* ([324a24e](324a24e))
* **deps:** upgrade @myparcel-pdk/* ([813bfb0](813bfb0))
* **deps:** upgrade @myparcel-pdk/* ([d673174](d673174))
* **deps:** upgrade @myparcel-pdk/* ([0717e2d](0717e2d))
* **deps:** upgrade @myparcel-pdk/* ([012f0dc](012f0dc))
* **deps:** upgrade myparcelnl/pdk to v2.19.0 ([a305f11](a305f11))
* **deps:** upgrade myparcelnl/pdk to v2.25.2 ([42b3fb0](42b3fb0))
* **deps:** upgrade myparcelnl/pdk to v2.28.0 ([3d944b3](3d944b3))
* **deps:** upgrade myparcelnl/pdk to v2.28.2 ([e3a7c47](e3a7c47))
* **deps:** upgrade myparcelnl/pdk to v2.31.3 ([083be23](083be23))
* **deps:** upgrade myparcelnl/pdk to v2.34.0 ([e5f9a0a](e5f9a0a))
* **deps:** upgrade myparcelnl/pdk to v2.36.1 ([7a32728](7a32728))
* **deps:** upgrade myparcelnl/pdk to v2.36.3 ([36ecd12](36ecd12))
* **deps:** upgrade myparcelnl/pdk to v2.39.2 ([663a31b](663a31b))
* **deps:** upgrade myparcelnl/pdk to v2.42.0 ([c1b1220](c1b1220))
* **deps:** upgrade myparcelnl/pdk to v2.43.2 ([d011b93](d011b93))
* **deps:** upgrade myparcelnl/pdk to v2.45.0 ([1569918](1569918))
* **deps:** upgrade myparcelnl/pdk to v2.8.0 ([0c6385e](0c6385e))
* **dhl:** add vat and eori fields for europlus ([#974](#974)) ([0517dac](0517dac))
* **endpoints:** improve endpoint logic ([6e24a68](6e24a68))
* improve automatic export ([#1053](#1053)) ([40e239f](40e239f))
* **migration:** add package type to product settings ([#1006](#1006)) ([847552a](847552a))
* move frontend checkout logic to pdk ([d64e053](d64e053))
* move showing/hiding logic to app config ([4fc8a25](4fc8a25))
* **notes:** add hook to post note after adding to order ([0588f17](0588f17))
* **order:** add reference identifier ([#1033](#1033)) ([a8df194](a8df194))
* **order:** get order notes ([a009cf7](a009cf7))
* **orders:** change order status on label print ([#1016](#1016)) ([fa5f5b6](fa5f5b6))
* **order:** support digital stamp weight range option ([#1035](#1035)) ([9750ff4](9750ff4))
* **plugin:** add links to plugin meta ([7065195](7065195))
* prepend order note with text from settings ([68f6fe2](68f6fe2))
* **product:** support variation product settings ([#996](#996)) ([d4ae5b3](d4ae5b3))
* rebuild entire plugin with pdk ([bbab1af](bbab1af))
* retrieve shipping methods ([cd5f5d3](cd5f5d3))
* **settings:** improve settings views ([106f09c](106f09c))
* **shipments:** add barcode as order note ([#1004](#1004)) ([7155cb8](7155cb8))
* support woocommerce hpos ([74c9ccf](74c9ccf))
* **translations:** migrate to pdk builder translation logic ([542f25c](542f25c))
* update dependencies ([d13568d](d13568d))
* update to latest delivery options ([#1085](#1085)) ([69b24b9](69b24b9))
@myparcel-bot
Copy link
Contributor

myparcel-bot bot commented Oct 31, 2024

🎉 This PR is included in version 5.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants