woocommerce/plugins/woocommerce-blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-b.../block.json

33 lines
711 B
JSON
Raw Normal View History

{
"name": "woocommerce/checkout-shipping-methods-block",
"version": "1.0.0",
"title": "Shipping Options",
"description": "Display shipping options and rates for your store.",
"category": "woocommerce",
"supports": {
"align": false,
"html": false,
"multiple": false,
"reusable": false,
"inserter": false,
"lock": false
},
"attributes": {
"lock": {
"type": "object",
"default": {
"remove": true,
"move": true
}
Remove WC Core shipping settings if Cart/Checkout blocks are in use (https://github.com/woocommerce/woocommerce-blocks/pull/8679) * Add CartCheckoutUtils class This class will store reusable methods relating to Cart/Checkout Blocks, i.e. whether they are used on the Cart/Checkout page. * Update ShippingController to use the new CartCheckoutUtils function This will reduce code duplication when checking if the Cart/Checkout blocks are in use on the Cart/Checkout page. * Add filter to remove shipping settings when Cart/Checkout are default * Ensure setting displays correctly if cart is default but not checkout * Add tests to ensure core shipping settings update correctly * Add setCartCheckoutPages function to update set the cart/checkout page * Force shipping to be enabled if the Checkout block is in use. * Add filter to override cost requires address option * Add shippingCostRequiresAddress option * Check if the address is required before showing rates * Show shipping rates in editor * Add shippingCostRequiresAddress attribute to shipping methods block * Update frontend type to show shippingCostRequiresAddress is a prop * Add control to toggle shippingCostRequiresAddress option * Show address notice in the correct scenario * Send shippingCostRequiresAddress to Block in front end context * Add e2e test for editor control * Add e2e tests for shipping options on the front end * Add updateAttributeInSiblingBlock function * Add shippingCostRequiresAddress to shipping method block * Ensure attribute is updated in both blocks when editing * In Shipping Methods Block, show correct component based on block setting * Show correct block in editor * Remove broken test from PR * Clean up updateAttributeInSiblingBlock * Add setCartCheckoutPages function to update set the cart/checkout page * Add tests to ensure core shipping settings update correctly * Add isAddressComplete function Borrowed from woocommerce/woocommerce-blocks#8141 * Check if the address is required before showing rates * Show shipping rates in editor * Show address notice in the correct scenario * Add e2e tests for shipping options on the front end * Ensure errorId is passed to StateInput * Add fullShippingAddressPushed action to wc/store/cart * Add fullShippingAddressPushed case to reducer * Ensure fullShippingAddressPushed is set when initialising cart store * Add fullShippingAddressPushed selector and default state entry * Add shippingAddressHasValidationErrors util function * Do not overwrite addresses when selecting a rate * Set whether full address has been pushed when saving address changes * In Shipping Methods Block, show correct component based on block setting * Don't show from price if rates should be hidden until address entered * Check city validation errors to assert if shipping address is valid * Rename merchant.js to merchant.ts * Move local pickup functions to common merchant util * Update local pickup tests to use common merchant utils * Add test to ensure setting toggles in both blocks * Add navigating to settings and saving in merchant util * Create addPickupLocation merchant util * Add test for local pickup and require full address * Make sure correct conditions are met to show shipping options * Ensure checkbox is checked during local pickup tests * Unset the checkbox when tests are finished running * Update checkout block fixture * Prevent error in unit tests * Import validation store key from constants Required because importing from the index causes the validation data store to register twice * Update checkout terms test to wait for button not to be disabled * Revert "Add isAddressComplete function" This reverts commit 9967dc0d4f10cf638859ae085e6f4cc2901dd299.
2023-03-13 11:49:28 +00:00
},
"shippingCostRequiresAddress": {
"type": "boolean",
"default": false
}
},
"parent": [ "woocommerce/checkout-fields-block" ],
"textdomain": "woo-gutenberg-products-block",
Fix missing translations in inspector (https://github.com/woocommerce/woocommerce-blocks/pull/6737) * Try registering the "cart taxes" inner block Registering server side. This example isn't working, but I'm pushing to share it and see what's wrong with this implementation. * Fix registering the cart taxes inner block issue * Update translation script loading * Remove unnecessary JS translation The translation should work fine by getting the title & description from the `block.json` file * Put back the initial code in the 'Cart Taxes' inner block We didn't provide the correct `block.json` file path server side, that's why the `metadata` wasn't correctly registered * Generate `block.json`files for inner blocks This is the first step on fixing the missing translations of `metadata` in `block.json` files * Set the folder name exactly the same as the inner block name We are doing this first test for the `Cart taxes` inner block. The `Block` & its containing folder need to have the same name for: - Consistency - We use the `Block` name to get the file Path * Update imports after folder renaming * Get block name directly from the JSON metadata Getting the block name from the JSON metadata is less error prone than extracting it from the file path. And no need to rename all our `inner-blocks` to get the correct `block.json` path * Revert folder naming change of `Cart taxes` inner block Since we are getting the `block` name directly from the `block.json` metadata instead of extracting it from the file path, there is no need to keep their names in sync anymore * Fix missing translations for the `Cart Subtotal` Block * Register only the client-side settings on the client When the block is registered on the server, you only need to register the client-side settings on the client using the same block’s name. See [docs](https://github.com/WordPress/gutenberg/blob/trunk/docs/reference-guides/block-api/block-metadata.md#javascript-client-side). * Add schema validation to `block.json` Development is improved by using a defined schema definition file. Supported editors can provide help like tooltips, autocomplete, and schema validation. * Use the same `editor_script` as the parent block This prevents WordPress from generating script tags to inexistant inner blocks JS files * Add C&C inner blocks in Cart.php & Checkout.php This is a refactoring to keep the block types controller file less overloaded * Fix all Cart inner blocks missing translations * Create the "AbstractInnerBlock" class The "Inner Blocks" will use their parent's script, so no need to create new scripts for each one of them And, our "Inner Blocks" should always be registered using the metadata file * Update the "Inner Blocks" PHP classes * Fix PHP lint erros & update function description * Fix missing translations bug for all Checkout Inner Blocks * Update src/BlockTypes/Checkout.php Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com> * skip lazy loaded scripts Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
2022-08-01 14:57:33 +00:00
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}