@licklist/design 0.44.486-dev.18 → 0.44.486-dev.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
- package/package.json +1 -1
- package/src/iframe/order-process/components/BookingSummary/utils/index.ts +2 -0
- package/src/iframe/payment/payment-page/PaymentPage.tsx +4 -4
- package/src/typings.d.ts +11 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,eAAO,MAAM,sBAAsB,mBAAoB,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,eAAO,MAAM,sBAAsB,mBAAoB,KAAK,EAAE,WAW7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.cartSumByOrderProducts=function(e){return e&&e.length?e.reduce((function(e,t){return e+((null==t?void 0:t.deposit)||(null==t?void 0:t.price))*t.quantity}),0):0};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.cartSumByOrderProducts=function(e){return e&&e.length?e.reduce((function(e,t){return t?e+((null==t?void 0:t.deposit)||(null==t?void 0:t.price))*t.quantity:0}),0):0};
|
package/package.json
CHANGED
|
@@ -5,6 +5,8 @@ export const cartSumByOrderProducts = (orderProducts?: Order[]) => {
|
|
|
5
5
|
return 0;
|
|
6
6
|
}
|
|
7
7
|
return orderProducts.reduce((prevSumValue: number, product) => {
|
|
8
|
+
if (!product) return 0;
|
|
9
|
+
|
|
8
10
|
return (
|
|
9
11
|
prevSumValue + (product?.deposit || product?.price) * product.quantity
|
|
10
12
|
);
|
|
@@ -100,18 +100,18 @@ export const PaymentPage = ({
|
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
const
|
|
103
|
+
const orderTotalAmountByFormValues = cartSumByOrderProducts(
|
|
104
104
|
bookingSummaryProps && bookingSummaryProps?.formValues
|
|
105
105
|
? Object.values(bookingSummaryProps?.formValues)
|
|
106
106
|
: undefined
|
|
107
107
|
);
|
|
108
108
|
|
|
109
|
-
// User can fill
|
|
109
|
+
// User can fill promo code only in iframe application.
|
|
110
110
|
// It didn't possible via payment link. This check will
|
|
111
111
|
// be applied when there are no metadata and in case when
|
|
112
112
|
// orderValues sum is greater than amount in order.
|
|
113
113
|
const isCalculatedAmountGreaterThanOrderAmount =
|
|
114
|
-
|
|
114
|
+
orderTotalAmountByFormValues > data?.amount;
|
|
115
115
|
|
|
116
116
|
return (
|
|
117
117
|
<Page
|
|
@@ -164,7 +164,7 @@ export const PaymentPage = ({
|
|
|
164
164
|
<SummaryTotalBlock
|
|
165
165
|
label={t("total")}
|
|
166
166
|
amount={
|
|
167
|
-
|
|
167
|
+
orderTotalAmountByFormValues +
|
|
168
168
|
(bookingSummaryProps?.transactionFee || 0)
|
|
169
169
|
}
|
|
170
170
|
/>
|
package/src/typings.d.ts
CHANGED
|
@@ -28,3 +28,14 @@ declare module "*.json" {
|
|
|
28
28
|
|
|
29
29
|
declare module "react-phone-number-input/input";
|
|
30
30
|
declare module "react-phone-number-input/commonjs/Flag";
|
|
31
|
+
|
|
32
|
+
// @TODO: this is a hofix for the following issue:
|
|
33
|
+
// licklist_workspace_frontend/packages/design/src/product-set/hooks/useSortableTreeFunctions.ts(17,34):
|
|
34
|
+
// semantic error TS2304: Cannot find name 'structuredClone'.
|
|
35
|
+
interface WindowOrWorkerGlobalScope {
|
|
36
|
+
structuredClone(value: any, options?: StructuredSerializeOptions): any;
|
|
37
|
+
}
|
|
38
|
+
declare function structuredClone(
|
|
39
|
+
value: any,
|
|
40
|
+
options?: StructuredSerializeOptions
|
|
41
|
+
): any;
|