Commit 40dc84368c for woocommerce
commit 40dc84368c627b519820b2b6aa927751701c5671
Author: Tung Du <dinhtungdu@gmail.com>
Date: Mon Jun 30 16:26:07 2025 +0700
Remove unused Product Filters files (#59261)
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/price-slider/utils.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/price-slider/utils.ts
deleted file mode 100644
index dd1b608699..0000000000
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/price-slider/utils.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * External dependencies
- */
-import {
- formatPrice,
- getCurrency,
- getCurrencyFromPriceResponse,
-} from '@woocommerce/price-format';
-import {
- objectHasProp,
- CurrencyResponse,
- Currency,
- isString,
-} from '@woocommerce/types';
-
-function formatPriceInt( price: string | number, currency: Currency ) {
- const priceInt = typeof price === 'number' ? price : parseInt( price, 10 );
- return priceInt / 10 ** currency.minorUnit;
-}
-
-export function getFormattedPrice( results: unknown[] ) {
- const currencyWithoutDecimal = getCurrency( { minorUnit: 0 } );
-
- if ( ! objectHasProp( results, 'price_range' ) ) {
- return {
- minPrice: 0,
- maxPrice: 0,
- minRange: 0,
- maxRange: 0,
- formattedMinPrice: formatPrice( 0, currencyWithoutDecimal ),
- formattedMaxPrice: formatPrice( 0, currencyWithoutDecimal ),
- };
- }
-
- const currency = getCurrencyFromPriceResponse(
- results.price_range as CurrencyResponse
- );
-
- const minPrice =
- objectHasProp( results.price_range, 'min_price' ) &&
- isString( results.price_range.min_price )
- ? formatPriceInt( results.price_range.min_price, currency )
- : 0;
- const maxPrice =
- objectHasProp( results.price_range, 'max_price' ) &&
- isString( results.price_range.max_price )
- ? formatPriceInt( results.price_range.max_price, currency )
- : 0;
-
- return {
- minPrice,
- maxPrice,
- minRange: minPrice,
- maxRange: maxPrice,
- formattedMinPrice: formatPrice( minPrice, currencyWithoutDecimal ),
- formattedMaxPrice: formatPrice( maxPrice, currencyWithoutDecimal ),
- };
-}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/status-filter/preview.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/status-filter/preview.tsx
deleted file mode 100644
index ea7735516e..0000000000
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/status-filter/preview.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * External dependencies
- */
-import Label from '@woocommerce/base-components/filter-element-label';
-
-export const previewOptions = [
- {
- value: 'preview-1',
- name: 'In Stock',
- label: <Label name="In Stock" count={ 3 } />,
- textLabel: 'In Stock (3)',
- },
- {
- value: 'preview-2',
- name: 'Out of stock',
- label: <Label name="Out of stock" count={ 3 } />,
- textLabel: 'Out of stock (3)',
- },
- {
- value: 'preview-3',
- name: 'On backorder',
- label: <Label name="On backorder" count={ 2 } />,
- textLabel: 'On backorder (2)',
- },
-];