@licklist/design 0.44.485-dev.11 → 0.44.485-dev.13
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/BookingSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +3 -3
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts +5 -4
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts.map +1 -1
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +1 -1
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +1 -1
- package/package.json +1 -1
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +4 -1
- package/src/iframe/order-process/components/BookingSummary/types/index.ts +3 -3
- package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +25 -18
- package/src/product-set/form/ProductsControl.tsx +20 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingSummary.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/BookingSummary/BookingSummary.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,cAAc;uJAWxB,KAAK,mBAAmB,EAAE,oBAAoB,CAAC;;;
|
|
1
|
+
{"version":3,"file":"BookingSummary.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/BookingSummary/BookingSummary.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,cAAc;uJAWxB,KAAK,mBAAmB,EAAE,oBAAoB,CAAC;;;CA4EjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,a=require("@licklist/core/dist/Config"),n=require("../../../../static/loader/LoaderIndicator.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,a=require("@licklist/core/dist/Config"),n=require("../../../../static/loader/LoaderIndicator.js"),o=require("react-i18next");require("../../../../static/index.js");var m=require("react-intl");require("./components/SummaryTotal/components/SummaryTotalBlock.js");var c=require("./components/ProductsByMenuStep/ProductsByMenuStep.js"),l=require("./components/SummaryTotal/SummaryTotal.js"),s=require("./components/BookingSummaryAccordion/BookingSummaryAccordion.js"),i=function(e){var l=e.date,i=e.menuSteps,u=e.formValues,d=e.isNotShownPeopleAmount,p=e.eventName,y=e.transactionFee,E=void 0===y?0:y,v=e.productsWithErrors,f=e.isLoading,N=e.hasPeopleInput,S=e.peopleAmount,g=o.useTranslation("Design").t,B=m.useIntl().formatNumber,j=t.useMemo((function(){if(u){var e=Object.values(u).filter(Boolean);return null==e?void 0:e.filter((function(e){return 0!==(null==e?void 0:e.quantity)}))}}),[u]);return f?r.createElement("div",{className:"payment-booking-summary"},r.createElement(n.LoaderIndicator,{isLoaded:!1})):r.createElement("div",{className:"payment-booking-summary"},r.createElement(s.BookingSummaryAccordion,{hasPeopleInput:N},r.createElement("div",{className:"event-info"},r.createElement("p",{className:"m-0 title event-name"},p),r.createElement("p",{className:"m-0"},l)),r.createElement("hr",null),(null==j?void 0:j.length)>0?r.createElement("div",null,r.createElement("div",{className:"cart-items"},i.map((function(e){return r.createElement(c.ProductsByMenuStep,{key:e.id,orderProducts:j,step:e,productsWithErrors:v})})),!d&&S>0&&r.createElement(r.Fragment,null,r.createElement("hr",null),r.createElement("div",{className:"d-flex justify-content-between mt-3"},r.createElement("p",{className:"m-0"},g("people"),":"),r.createElement("p",{className:"price"},S))),!!E&&r.createElement(r.Fragment,null,r.createElement("hr",null),r.createElement("div",{className:"d-flex justify-content-between mt-3"},r.createElement("p",{className:"m-0"},g("transactionFee"),":"),r.createElement("p",{className:"price"},B(E,{style:"currency",currency:a.Currency.GBP})))))):r.createElement("div",{className:"cart-items"},r.createElement("p",{className:"empty-cart"},g("emptyBasket")))))};i.SummaryTotal=l.SummaryTotal,i.Accordion=s.BookingSummaryAccordion,exports.BookingSummary=i;
|
|
@@ -4,13 +4,13 @@ export declare const MOBILE_WIDTH = 576;
|
|
|
4
4
|
export declare const ACCORDION_KEY = "booking-summary";
|
|
5
5
|
export declare type BookingSummaryProps = {
|
|
6
6
|
date: string;
|
|
7
|
-
menuSteps
|
|
8
|
-
formValues
|
|
7
|
+
menuSteps?: MenuStep[];
|
|
8
|
+
formValues?: {
|
|
9
9
|
[key: string]: Order;
|
|
10
10
|
};
|
|
11
11
|
totalWithDiscount?: number;
|
|
12
12
|
isNotShownPeopleAmount?: boolean;
|
|
13
|
-
eventName
|
|
13
|
+
eventName?: string;
|
|
14
14
|
hasPeopleInput?: boolean;
|
|
15
15
|
transactionFee?: number;
|
|
16
16
|
isFreePayment?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEvD,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C,oBAAY,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,QAAQ,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEvD,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C,oBAAY,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC;KACtB,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,4BAA4B,CAAC,UAAU,CAAC,CAAC;IAC9D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { BookingSummaryProps } from "../../order-process/components/BookingSummary/types";
|
|
3
|
+
import { PaymentMetadata } from "../payment-page/PaymentPage";
|
|
3
4
|
export declare const ORDER_STATUS_FAILED = "failed";
|
|
4
5
|
export declare const ORDER_STATUS_SUCCESS = "success";
|
|
5
6
|
export declare const ORDER_STATUS_PENDING = "pending";
|
|
@@ -8,16 +9,16 @@ interface PaymentStatusComponentProps {
|
|
|
8
9
|
onCloseWindow: () => void;
|
|
9
10
|
onBack?: () => void;
|
|
10
11
|
onTryAgain?: () => void;
|
|
11
|
-
totalAmount?: number;
|
|
12
12
|
isLoading?: boolean;
|
|
13
13
|
status: OrderStatusPrefix;
|
|
14
14
|
isAppUsingInIframe?: boolean;
|
|
15
|
-
|
|
16
|
-
bookingSummaryProps?: Omit<BookingSummaryProps, "transactionFee">;
|
|
15
|
+
bookingSummaryProps?: BookingSummaryProps;
|
|
17
16
|
EventCardComponent?: ReactNode;
|
|
18
17
|
showCloseButton?: boolean;
|
|
19
18
|
email?: string;
|
|
19
|
+
totalAmount?: number;
|
|
20
|
+
paymentMetadata?: PaymentMetadata;
|
|
20
21
|
}
|
|
21
|
-
export declare const PaymentStatusPage: ({ onCloseWindow, onBack, onTryAgain,
|
|
22
|
+
export declare const PaymentStatusPage: ({ onCloseWindow, onBack, onTryAgain, isLoading, status, isAppUsingInIframe, bookingSummaryProps, EventCardComponent, showCloseButton, email, totalAmount, paymentMetadata, }: PaymentStatusComponentProps) => JSX.Element;
|
|
22
23
|
export {};
|
|
23
24
|
//# sourceMappingURL=PaymentStatusPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentStatusPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-status-page/PaymentStatusPage.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;
|
|
1
|
+
{"version":3,"file":"PaymentStatusPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-status-page/PaymentStatusPage.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAC5C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,oBAAY,iBAAiB,GACzB,OAAO,oBAAoB,GAC3B,OAAO,mBAAmB,GAC1B,OAAO,oBAAoB,CAAC;AAEhC,UAAU,2BAA2B;IACnC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAGD,eAAO,MAAM,iBAAiB,iLAa3B,2BAA2B,gBAqF7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),o=require("react"),r=(e=o)&&"object"==typeof e&&"default"in e?e.default:e,a=require("../../../static/loader/LoaderIndicator.js"),n=require("react-i18next");require("../../order-process/components/NavigationFooter/NavigationFooter.js"),require("../../page/components/PageHeader/PageHeader.js");var s=require("../payment-status-header/PaymentStatusHeader.js"),m=require("../../order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.js");require("../../order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.js");var i=require("../../order-process/components/BookingSummary/BookingSummary.js");require("../../order-process/components/NavigationSteps/NavigationSteps.js"),require("../../order-process/components/StepsForm/StepsForm.js"),require("../../order-process/components/Timer/Timer.js"),require("../../order-process/components/PaymentCard/PaymentCard.js");var c=require("../../order-process/components/BookingSummaryFooter/BookingSummaryFooter.js"),l=require("../../page/components/PageBody/PageBody.js");require("../../order-process/components/CalendarStepsForm/CalendarStepsForm.js");var u=require("../../page/Page.js"),p=require("./component/PaymentStatusBody.js"),d="failed",g="success",y="pending";exports.ORDER_STATUS_FAILED=d,exports.ORDER_STATUS_PENDING=y,exports.ORDER_STATUS_SUCCESS=g,exports.PaymentStatusPage=function(e){var o=e.onCloseWindow,S=e.onBack,B=e.onTryAgain,E=e.isLoading,k=e.status,P=e.isAppUsingInIframe,j=e.bookingSummaryProps,q=e.EventCardComponent,v=e.showCloseButton,T=void 0!==v&&v,f=e.email,C=e.totalAmount,F=void 0===C?0:C,h=e.paymentMetadata,_=n.useTranslation("Design").t,b=function(){switch(k){case g:return _("purchaseSuccessful");case y:return _("pendingPayment");default:return _("purchaseFailed")}}();return E?r.createElement(a.LoaderIndicator,{isLoaded:!1}):r.createElement(u.Page,{className:"payment-status-page",headerBlock:r.createElement(s.PaymentStatusHeader,{success:k!==d,showCloseButton:T,onCloseButtonClick:o,title:k===y?_("pendingPayment"):void 0}),isAppUsingInIframe:P},r.createElement(l.PageBody,{leftBlock:r.createElement(l.PageBody.LeftBlock,{title:b},r.createElement("div",null,q,r.createElement(p.PaymentStatusBody,{status:k,onBack:S||o,onTryAgain:B,email:f}))),rightBlock:r.createElement(l.PageBody.RightBlock,{bottomBlock:r.createElement(c.BookingSummaryFooter,{showButton:!1},r.createElement("div",{className:"d-flex flex-column justify-content-between"},h&&r.createElement(r.Fragment,null,r.createElement(m.SummaryTotalBlock,{label:_("total"),amount:h.total||0}),r.createElement(m.SummaryTotalBlock,{label:_("paidSum"),amount:h.paid||0})),r.createElement(m.SummaryTotalBlock,{label:_(h?"remaining":"total"),amount:F+((null==j?void 0:j.transactionFee)||0)})))},j?r.createElement(i.BookingSummary,t.__assign({},j)):r.createElement("h6",null,b))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/ProductsControl.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,YAAY,EAAE,MAAM,kEAAkE,CAAC;AAChG,OAAO,EAAkB,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAI/E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOjD,UAAU,oBAAqB,SAAQ,aAAa;IAClD,YAAY,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC,cAAc,CAAC,CAAC;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,YAAY,CAAC;CAC5B;AAmCD,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,SAAS,EACT,YAAY,GACb,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ProductsControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/ProductsControl.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,YAAY,EAAE,MAAM,kEAAkE,CAAC;AAChG,OAAO,EAAkB,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAI/E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOjD,UAAU,oBAAqB,SAAQ,aAAa;IAClD,YAAY,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC,cAAc,CAAC,CAAC;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,YAAY,CAAC;CAC5B;AAmCD,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,SAAS,EACT,YAAY,GACb,EAAE,oBAAoB,eAqMtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),o=e(r),n=require("react-i18next"),a=require("react-bootstrap"),i=require("react-hook-form"),c=e(require("@licklist/plugins/dist/services/Form/HookFormService")),u=require("@dnd-kit/core"),d=require("lodash");require("../elements/DeleteFieldButton.js");var s=require("../../sortable-tree/SortableTreeItem.js"),l=require("../../sortable-tree/SortableTree.js");require("../card/ProductSetCard.js");var p=require("../item/CreateProductSetItem.js");require("../step/StepControl.js"),require("../product-category/ProductCategoryControl.js");var m=require("@licklist/core/dist/DataMapper/Product/ProductDataMapper"),g=require("@licklist/core/dist/Services");require("../product/booking-management/ProductBookingManagementControl.js"),require("../product/deposit/ProductDepositControl.js"),require("../product/quantity/ProductQuantityControl.js"),require("../product/quantity/ProductQuantityConstantControl.js"),require("../product/quantity/ProductQuantityRechargingControl.js");var
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),o=e(r),n=require("react-i18next"),a=require("react-bootstrap"),i=require("react-hook-form"),c=e(require("@licklist/plugins/dist/services/Form/HookFormService")),u=require("@dnd-kit/core"),d=require("lodash");require("../elements/DeleteFieldButton.js");var s=require("../../sortable-tree/SortableTreeItem.js"),l=require("../../sortable-tree/SortableTree.js");require("../card/ProductSetCard.js");var p=require("../item/CreateProductSetItem.js");require("../step/StepControl.js"),require("../product-category/ProductCategoryControl.js");var m=require("@licklist/core/dist/DataMapper/Product/ProductDataMapper"),g=require("@licklist/core/dist/Services");require("../product/booking-management/ProductBookingManagementControl.js"),require("../product/deposit/ProductDepositControl.js"),require("../product/quantity/ProductQuantityControl.js"),require("../product/quantity/ProductQuantityConstantControl.js"),require("../product/quantity/ProductQuantityRechargingControl.js");var v=require("../product/ProductControl.js"),q=require("./SubProductsControl.js"),y=require("./ProductCategoriesControl.js");require("../control/ProductSetControl.js"),require("../deposit-paid/ProductSetDepositPaidControl.js"),require("./ProductSetForm.js"),require("../popover/ProductSetPopover.js"),require("../tabs/ProductSetTab.js"),require("../tabs/ProductSetTabs.js");exports.ProductsControl=function(e){var f,C,P,b,S=e.isLoading,_=e.quantityType,j=e.stepIndex,T=e.productCategoryIndex,E=e.hasTicket,h=e.categoryType,I=n.useTranslation("Design").t,k=i.useFormContext(),x=t.__read(r.useState(!1),2),D=x[0],N=x[1],A=k.control,F=k.formState.errors,M=k.clearErrors,Q=k.trigger,w=k.setValue,B=k.watch,U=k.getValues,L="steps.".concat(j,".productCategories.").concat(T,".products"),R="steps.".concat(j,".pointProducts"),O=i.useFieldArray({name:L,control:A,keyName:"_id"}),V=O.fields,W=O.append,H=O.remove,z=O.move,G=B("steps.".concat(j,".productCategories.").concat(T,".allowDeposits")),Y=i.useWatch({control:A,name:t.__spreadArray([],t.__read(V.map((function(e,t){return"".concat(L,".").concat(t,".price")}))),!1)}),J=i.useWatch({control:A,name:t.__spreadArray([],t.__read(V.map((function(e,t){return"".concat(L,".").concat(t,".totalQuantity")}))),!1)}),K=i.useWatch({control:A,name:t.__spreadArray([],t.__read(V.map((function(e,t){return"".concat(L,".").concat(t,".isUnlimited")}))),!1)}),X=null===(b=null===(P=null===(C=null===(f=null==F?void 0:F.steps)||void 0===f?void 0:f[j])||void 0===C?void 0:C.productCategories)||void 0===P?void 0:P[T])||void 0===b?void 0:b.products,Z=1===V.length,$=u.useSensor(u.MouseSensor,{activationConstraint:{distance:10}});return o.createElement(o.Fragment,null,o.createElement(l.SortableTree,{items:V.map((function(e){return String(e._id)})),onDragEnd:function(e){var t=e.active,r=e.over;if(t&&r&&(null==t?void 0:t.id)&&(null==r?void 0:r.id)){var o=V.findIndex((function(e){return e._id===t.id})),n=V.findIndex((function(e){return e._id===r.id}));o!==n&&(z(o,n),V.forEach((function(e,t){w("".concat(L,".").concat(t,".sort"),t)})))}},sensors:[$]},V.map((function(e,t){return o.createElement(i.Controller,{key:e._id,control:A,name:"".concat(L,".").concat(t,".name"),rules:{required:I("Validation:fieldRequired",{attribute:I("name")})},render:function(r){var n=r.field,i=n.value,c=n.onChange;return o.createElement(l.SortableTree.Item,{key:"product-".concat(e._id),id:String(e._id),isExpanded:Z,isInvalid:!!X,title:i,badge:o.createElement(a.Badge,{className:"product-badge"},I("product")),isIconInHeader:!1,secondaryBadge:y.getBadgeConfig(h,I(h)),subTitle:o.createElement("div",{className:"product-set-badges-container"},o.createElement("div",{className:"product-set-subtitle-dot product-set-subtitle-product-dot"}),o.createElement("span",null,"£".concat(Y[t]," ").concat(I("each")," - ").concat(I("qty"),":").concat(K[t]?I(" unlimited"):" ".concat(J[t])," ").concat(K[t]?"":" - ".concat(I("possibleRevenue")," £").concat(Y[t]*J[t])," "))),modalLabel:I("addNewProduct"),modalClass:s.ProductSetModalClasses.product,isNewAdded:D,body:o.createElement(v.ProductControl,{isLoading:S,quantityType:_,allowDeposits:G,hasBookingManagement:!1,fieldNamePrefix:"".concat(L,".").concat(t),productName:i,onProductNameChange:c,hasTicket:E,categoryType:h}),onDelete:function(){return function(e){var t=U("".concat(L,".").concat(e)),r=U(R);w(R,(null==r?void 0:r.filter((function(e){return e.productUuid!==t.uuid})))||[]),H(e)}(t)},validate:function(){return Q("".concat(L,".").concat(t))}},o.createElement(q.SubProductsControl,{isLoading:S,quantityType:_,stepIndex:j,productCategoryIndex:T,productIndex:t}))}})}))),o.createElement(p.CreateProductSetItem,{title:I("addProduct"),onClick:function(){var e;W((e=V.length,{id:null,name:"",termsAndConditions:"",productGroupId:null,description:"",price:0,deposit:0,minQuantity:null,maxQuantity:null,totalQuantity:0,capacity:0,duration:0,isAvailable:!0,isSoldOut:!1,isRequired:!1,isUnlimited:!1,quantitySelector:1,hasSpecialNotes:!1,weight:0,type:m.DEFAULT_PRODUCT_TYPE,tierId:Number(d.uniqueId()),zoneId:null,subProducts:[],images:[],uuid:g.generateUuid(),subSlots:null,offset:null,pause:null,serviceTime:null,sort:e})),N(!0),(null==X?void 0:X.type)===c.manualErrorType&&M(L)}}),o.createElement("div",{className:"manual-form-error"},X&&X.message))};
|
package/package.json
CHANGED
|
@@ -25,6 +25,9 @@ export const BookingSummary = ({
|
|
|
25
25
|
const { formatNumber } = useIntl();
|
|
26
26
|
|
|
27
27
|
const orderProducts = useMemo(() => {
|
|
28
|
+
if (!formValues) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
28
31
|
const products = Object.values(formValues).filter(Boolean) as Order[];
|
|
29
32
|
|
|
30
33
|
return products?.filter((prod) => prod?.quantity !== 0);
|
|
@@ -47,7 +50,7 @@ export const BookingSummary = ({
|
|
|
47
50
|
</div>
|
|
48
51
|
<hr />
|
|
49
52
|
|
|
50
|
-
{orderProducts
|
|
53
|
+
{orderProducts?.length > 0 ? (
|
|
51
54
|
<div>
|
|
52
55
|
<div className="cart-items">
|
|
53
56
|
{menuSteps.map((menuStep: MenuStep) => {
|
|
@@ -6,13 +6,13 @@ export const ACCORDION_KEY = "booking-summary";
|
|
|
6
6
|
|
|
7
7
|
export type BookingSummaryProps = {
|
|
8
8
|
date: string;
|
|
9
|
-
menuSteps
|
|
10
|
-
formValues
|
|
9
|
+
menuSteps?: MenuStep[];
|
|
10
|
+
formValues?: {
|
|
11
11
|
[key: string]: Order;
|
|
12
12
|
};
|
|
13
13
|
totalWithDiscount?: number;
|
|
14
14
|
isNotShownPeopleAmount?: boolean;
|
|
15
|
-
eventName
|
|
15
|
+
eventName?: string;
|
|
16
16
|
hasPeopleInput?: boolean;
|
|
17
17
|
transactionFee?: number;
|
|
18
18
|
isFreePayment?: boolean;
|
|
@@ -9,6 +9,7 @@ import { BookingSummary, BookingSummaryFooter } from "../../order-process";
|
|
|
9
9
|
import { PaymentStatusHeader } from "../payment-status-header/PaymentStatusHeader";
|
|
10
10
|
import { SummaryTotalBlock } from "../../order-process/components/BookingSummary/components/SummaryTotal";
|
|
11
11
|
import { BookingSummaryProps } from "../../order-process/components/BookingSummary/types";
|
|
12
|
+
import { PaymentMetadata } from "../payment-page/PaymentPage";
|
|
12
13
|
|
|
13
14
|
export const ORDER_STATUS_FAILED = "failed";
|
|
14
15
|
export const ORDER_STATUS_SUCCESS = "success";
|
|
@@ -23,15 +24,15 @@ interface PaymentStatusComponentProps {
|
|
|
23
24
|
onCloseWindow: () => void;
|
|
24
25
|
onBack?: () => void;
|
|
25
26
|
onTryAgain?: () => void;
|
|
26
|
-
totalAmount?: number;
|
|
27
27
|
isLoading?: boolean;
|
|
28
28
|
status: OrderStatusPrefix;
|
|
29
29
|
isAppUsingInIframe?: boolean;
|
|
30
|
-
|
|
31
|
-
bookingSummaryProps?: Omit<BookingSummaryProps, "transactionFee">;
|
|
30
|
+
bookingSummaryProps?: BookingSummaryProps;
|
|
32
31
|
EventCardComponent?: ReactNode;
|
|
33
32
|
showCloseButton?: boolean;
|
|
34
33
|
email?: string;
|
|
34
|
+
totalAmount?: number;
|
|
35
|
+
paymentMetadata?: PaymentMetadata;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
// @TODO In future think, how to reuse this component in Iframe Pending, Success and Failed Pages
|
|
@@ -39,15 +40,15 @@ export const PaymentStatusPage = ({
|
|
|
39
40
|
onCloseWindow,
|
|
40
41
|
onBack,
|
|
41
42
|
onTryAgain,
|
|
42
|
-
totalAmount,
|
|
43
43
|
isLoading,
|
|
44
44
|
status,
|
|
45
|
-
transactionFee = 0,
|
|
46
45
|
isAppUsingInIframe,
|
|
47
46
|
bookingSummaryProps,
|
|
48
47
|
EventCardComponent,
|
|
49
48
|
showCloseButton = false,
|
|
50
49
|
email,
|
|
50
|
+
totalAmount = 0,
|
|
51
|
+
paymentMetadata,
|
|
51
52
|
}: PaymentStatusComponentProps) => {
|
|
52
53
|
const { t } = useTranslation("Design");
|
|
53
54
|
|
|
@@ -100,25 +101,31 @@ export const PaymentStatusPage = ({
|
|
|
100
101
|
<PageBody.RightBlock
|
|
101
102
|
bottomBlock={
|
|
102
103
|
<BookingSummaryFooter showButton={false}>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
<div className="d-flex flex-column justify-content-between">
|
|
105
|
+
{paymentMetadata && (
|
|
106
|
+
<>
|
|
107
|
+
<SummaryTotalBlock
|
|
108
|
+
label={t("total")}
|
|
109
|
+
amount={paymentMetadata.total || 0}
|
|
110
|
+
/>
|
|
111
|
+
<SummaryTotalBlock
|
|
112
|
+
label={t("paidSum")}
|
|
113
|
+
amount={paymentMetadata.paid || 0}
|
|
114
|
+
/>
|
|
115
|
+
</>
|
|
116
|
+
)}
|
|
109
117
|
<SummaryTotalBlock
|
|
110
|
-
label={t("total")}
|
|
111
|
-
amount={
|
|
118
|
+
label={t(paymentMetadata ? "remaining" : "total")}
|
|
119
|
+
amount={
|
|
120
|
+
totalAmount + (bookingSummaryProps?.transactionFee || 0)
|
|
121
|
+
}
|
|
112
122
|
/>
|
|
113
|
-
|
|
123
|
+
</div>
|
|
114
124
|
</BookingSummaryFooter>
|
|
115
125
|
}
|
|
116
126
|
>
|
|
117
127
|
{bookingSummaryProps ? (
|
|
118
|
-
<BookingSummary
|
|
119
|
-
{...bookingSummaryProps}
|
|
120
|
-
transactionFee={transactionFee}
|
|
121
|
-
/>
|
|
128
|
+
<BookingSummary {...bookingSummaryProps} />
|
|
122
129
|
) : (
|
|
123
130
|
<h6>{title}</h6>
|
|
124
131
|
)}
|
|
@@ -85,11 +85,14 @@ export function ProductsControl({
|
|
|
85
85
|
trigger,
|
|
86
86
|
setValue,
|
|
87
87
|
watch,
|
|
88
|
+
getValues,
|
|
88
89
|
} = form;
|
|
89
90
|
|
|
90
91
|
const productControlFieldName =
|
|
91
92
|
`steps.${stepIndex}.productCategories.${productCategoryIndex}.products` as const;
|
|
92
93
|
|
|
94
|
+
const productPointsKey = `steps.${stepIndex}.pointProducts` as const;
|
|
95
|
+
|
|
93
96
|
const { fields, append, remove, move } = useFieldArray({
|
|
94
97
|
name: productControlFieldName,
|
|
95
98
|
control,
|
|
@@ -156,6 +159,22 @@ export function ProductsControl({
|
|
|
156
159
|
});
|
|
157
160
|
};
|
|
158
161
|
|
|
162
|
+
const onProductRemove = (index: number) => {
|
|
163
|
+
const currentProduct = getValues(
|
|
164
|
+
`${productControlFieldName}.${index}` as const
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
const currentPointProducts = getValues(productPointsKey);
|
|
168
|
+
|
|
169
|
+
setValue(
|
|
170
|
+
productPointsKey,
|
|
171
|
+
currentPointProducts?.filter(
|
|
172
|
+
(product) => product.productUuid !== currentProduct.uuid
|
|
173
|
+
) || []
|
|
174
|
+
);
|
|
175
|
+
remove(index);
|
|
176
|
+
};
|
|
177
|
+
|
|
159
178
|
return (
|
|
160
179
|
<>
|
|
161
180
|
<SortableTree
|
|
@@ -219,7 +238,7 @@ export function ProductsControl({
|
|
|
219
238
|
categoryType={categoryType}
|
|
220
239
|
/>
|
|
221
240
|
}
|
|
222
|
-
onDelete={() =>
|
|
241
|
+
onDelete={() => onProductRemove(index)}
|
|
223
242
|
validate={() => trigger(`${productControlFieldName}.${index}`)}
|
|
224
243
|
// preItem={<Popover className="d-none d-sm-block" />}
|
|
225
244
|
>
|