@licklist/design 0.44.485-dev.70 → 0.44.485-dev.72
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/events/event-venue-map/EventVenueMap.d.ts +3 -3
- package/dist/events/event-venue-map/EventVenueMap.d.ts.map +1 -1
- package/dist/events/event-venue-map/components/VenueMap/VenueMap.d.ts +2 -2
- package/dist/events/event-venue-map/components/VenueMap/VenueMap.d.ts.map +1 -1
- package/dist/iframe/event/event-venue-map/IframeEventVenueMap.d.ts +1 -4
- package/dist/iframe/event/event-venue-map/IframeEventVenueMap.d.ts.map +1 -1
- package/dist/iframe/index.d.ts +1 -1
- package/dist/iframe/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts +2 -2
- package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +2 -2
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.d.ts +2 -2
- package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.js +1 -1
- package/dist/iframe/order-process/components/CalendarStepsForm/components/Category.d.ts +2 -2
- package/dist/iframe/order-process/components/CalendarStepsForm/components/Category.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.d.ts +2 -2
- package/dist/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.d.ts.map +1 -1
- package/dist/iframe/order-process/components/Category/Category.d.ts +3 -3
- package/dist/iframe/order-process/components/Category/Category.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts +3 -3
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
- package/dist/iframe/order-process/components/ErrorModal/ErrorModal.d.ts.map +1 -0
- package/dist/iframe/order-process/components/ErrorModal/ErrorModal.js +1 -0
- package/dist/iframe/order-process/components/ErrorModal/index.d.ts +2 -0
- package/dist/iframe/order-process/components/ErrorModal/index.d.ts.map +1 -0
- package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts +8 -0
- package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts.map +1 -0
- package/dist/iframe/order-process/components/utils/useCategoryVerification.js +1 -0
- package/dist/iframe/order-process/index.d.ts +3 -1
- package/dist/iframe/order-process/index.d.ts.map +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.js +1 -1
- package/dist/iframe/payment/payment-page/PaymentTimer.js +1 -1
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +1 -1
- package/dist/index.js +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
- package/dist/sales/manual-booking/category-product/CategoryProduct.d.ts +2 -2
- package/dist/sales/manual-booking/category-product/CategoryProduct.d.ts.map +1 -1
- package/dist/sales/manual-booking/category-products/CategoryProducts.d.ts +2 -2
- package/dist/sales/manual-booking/category-products/CategoryProducts.d.ts.map +1 -1
- package/dist/sales/manual-booking/controll/ManualBookingStepsControll.d.ts +2 -2
- package/dist/sales/manual-booking/controll/ManualBookingStepsControll.d.ts.map +1 -1
- package/dist/sales/manual-booking/controll/ManualBookingStepsControll.js +1 -1
- package/dist/snippet/snippet-template/preview/Preview.js +1 -1
- package/dist/types/iframe.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/events/event-venue-map/EventVenueMap.tsx +2 -2
- package/src/events/event-venue-map/components/VenueMap/VenueMap.tsx +2 -2
- package/src/iframe/index.ts +3 -1
- package/src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx +2 -2
- package/src/iframe/order-process/components/BookingSummary/types/index.ts +2 -2
- package/src/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.tsx +6 -5
- package/src/iframe/order-process/components/CalendarStepsForm/components/Category.tsx +2 -2
- package/src/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.tsx +2 -2
- package/src/iframe/order-process/components/Category/Category.tsx +3 -3
- package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +3 -3
- package/src/iframe/order-process/components/{CalendarStepsForm/components → ErrorModal}/ErrorModal.tsx +1 -1
- package/src/iframe/order-process/components/ErrorModal/index.ts +1 -0
- package/src/iframe/order-process/components/utils/{category.ts → useCategoryVerification.ts} +15 -10
- package/src/iframe/order-process/index.ts +3 -1
- package/src/product-set/product-category/ProductCategoryControl.tsx +1 -1
- package/src/sales/manual-booking/category-product/CategoryProduct.tsx +2 -2
- package/src/sales/manual-booking/category-products/CategoryProducts.tsx +2 -2
- package/src/sales/manual-booking/controll/ManualBookingStepsControll.tsx +3 -3
- package/src/types/iframe.ts +2 -0
- package/dist/iframe/order-process/components/CalendarStepsForm/components/ErrorModal.d.ts.map +0 -1
- package/dist/iframe/order-process/components/CalendarStepsForm/components/ErrorModal.js +0 -1
- package/dist/iframe/order-process/components/StepsForm/StepsForm.d.ts +0 -19
- package/dist/iframe/order-process/components/StepsForm/StepsForm.d.ts.map +0 -1
- package/dist/iframe/order-process/components/StepsForm/StepsForm.js +0 -1
- package/dist/iframe/order-process/components/StepsForm/index.d.ts +0 -2
- package/dist/iframe/order-process/components/StepsForm/index.d.ts.map +0 -1
- package/dist/iframe/order-process/components/utils/category.d.ts +0 -10
- package/dist/iframe/order-process/components/utils/category.d.ts.map +0 -1
- package/dist/iframe/order-process/components/utils/category.js +0 -1
- package/src/iframe/order-process/OrderProcess.stories.tsx +0 -363
- package/src/iframe/order-process/components/StepsForm/StepsForm.tsx +0 -176
- package/src/iframe/order-process/components/StepsForm/index.ts +0 -1
- /package/dist/iframe/order-process/components/{CalendarStepsForm/components → ErrorModal}/ErrorModal.d.ts +0 -0
|
@@ -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"),n=require("react"),a=e(n),r=require("react-i18next"),o=require("react-bootstrap"),l=require("react-hook-form"),c=e(require("@licklist/plugins/dist/services/Form/HookFormService")),m=require("@react-aria/utils"),i=require("../../static/switch/Switch.js"),u=require("../../static/switch/BooleanSwitch.js"),s=require("../../assets/dashboard/increment.svg.js");require("../../static/index.js");var d=require("../form/context.js"),E=require("@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper"),p=[E.CATEGORY_TYPE_TICKETS,E.CATEGORY_TYPE_FIXED_DURATION,E.CATEGORY_TYPE_GAME];exports.ProductCategoryControl=function(e){var v,I,C,b,f=e.isLoading,h=e.categoryName,g=e.onCategoryNameChange,F=e.productCategoryIndex,x=e.stepIndex,y=l.useFormContext(),T=y.control,S=y.formState.errors,k=y.register,G=y.clearErrors,N=y.setValue,w=y.getValues,_=y.watch,q=y.trigger,R=r.useTranslation("Design").t,P=t.__read(n.useState(!1),2),A=P[0],L=P[1],Y="steps.".concat(x,".productCategories.").concat(F),O=l.useWatch({name:Y}),B=_("".concat(Y,".maxSubItems"))||0,D=_("".concat(Y,".minSubItems"))||0,V=_("".concat(Y,".allowDeposits")),M=p.includes(O.type),j=null===(b=null===(C=null===(I=null===(v=null==S?void 0:S.steps)||void 0===v?void 0:v[x])||void 0===I?void 0:I.productCategories)||void 0===C?void 0:C[F])||void 0===b?void 0:b.products,z=m.useId(),U=m.useId(),H=m.useId(),K=m.useId(),X=m.useId(),Q=m.useId(),W=m.useId(),Z=m.useId(),J=m.useId(),$=m.useId(),ee=m.useId(),te=m.useId(),ne=n.useContext(d.ProductSetLoadingContext),ae=ne.providerHasBookingManagement,re=ne.zones,oe=n.useCallback((function(){return L((function(e){return!e}))}),[]);n.useEffect((function(){q("".concat(Y,".maxSubItems"))}),[D,Y]),n.useEffect((function(){q("".concat(Y,".minSubItems"))}),[B,Y]);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"),n=require("react"),a=e(n),r=require("react-i18next"),o=require("react-bootstrap"),l=require("react-hook-form"),c=e(require("@licklist/plugins/dist/services/Form/HookFormService")),m=require("@react-aria/utils"),i=require("../../static/switch/Switch.js"),u=require("../../static/switch/BooleanSwitch.js"),s=require("../../assets/dashboard/increment.svg.js");require("../../static/index.js");var d=require("../form/context.js"),E=require("@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper"),p=[E.CATEGORY_TYPE_TICKETS,E.CATEGORY_TYPE_FIXED_DURATION,E.CATEGORY_TYPE_GAME];exports.ProductCategoryControl=function(e){var v,I,C,b,f=e.isLoading,h=e.categoryName,g=e.onCategoryNameChange,F=e.productCategoryIndex,x=e.stepIndex,y=l.useFormContext(),T=y.control,S=y.formState.errors,k=y.register,G=y.clearErrors,N=y.setValue,w=y.getValues,_=y.watch,q=y.trigger,R=r.useTranslation("Design").t,P=t.__read(n.useState(!1),2),A=P[0],L=P[1],Y="steps.".concat(x,".productCategories.").concat(F),O=l.useWatch({name:Y}),B=_("".concat(Y,".maxSubItems"))||0,D=_("".concat(Y,".minSubItems"))||0,V=_("".concat(Y,".allowDeposits")),M=p.includes(O.type),j=null===(b=null===(C=null===(I=null===(v=null==S?void 0:S.steps)||void 0===v?void 0:v[x])||void 0===I?void 0:I.productCategories)||void 0===C?void 0:C[F])||void 0===b?void 0:b.products,z=m.useId(),U=m.useId(),H=m.useId(),K=m.useId(),X=m.useId(),Q=m.useId(),W=m.useId(),Z=m.useId(),J=m.useId(),$=m.useId(),ee=m.useId(),te=m.useId(),ne=n.useContext(d.ProductSetLoadingContext),ae=ne.providerHasBookingManagement,re=ne.zones,oe=void 0===re?[]:re,le=n.useCallback((function(){return L((function(e){return!e}))}),[]);n.useEffect((function(){q("".concat(Y,".maxSubItems"))}),[D,Y]),n.useEffect((function(){q("".concat(Y,".minSubItems"))}),[B,Y]);var ce=O.type===E.CATEGORY_TYPE_FIXED_DURATION||O.type===E.CATEGORY_TYPE_GAME;return a.createElement(a.Fragment,null,a.createElement(o.Col,{md:12,xl:!0,className:"p-0"},a.createElement(o.Form.Group,{controlId:U},a.createElement(o.Form.Label,null,R("nameOfTheCategory")),a.createElement(o.Form.Control,t.__assign({},k("".concat(Y,".name"),{required:R("Validation:fieldRequired",{attribute:R("name")}),validate:function(){return(null==j?void 0:j.type)===c.manualErrorType&&G("".concat(Y,".products")),!0}}),{value:h,onChange:g,isInvalid:c.isInvalid("".concat(Y,".name"),S),placeholder:R("name"),disabled:f})),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(Y,".name"),S))),a.createElement(o.Form.Group,{controlId:X},a.createElement(l.Controller,{control:T,name:"".concat(Y,".quantityType"),render:function(e){var t=e.field;return a.createElement(o.Form.Group,{className:"d-flex flex-column flex-grow-1 align-items-start"},a.createElement(o.Form.Label,null,R("quantityType")),a.createElement(i.Switch,{name:t.name,options:E.QUANTITY_TYPES.map((function(e){return{key:e,id:e,value:R(e)}})),value:t.value,onChange:t.onChange,disabled:f}))}})),a.createElement(o.Row,null,a.createElement(o.Col,{md:6,sm:6,xs:6},a.createElement(o.Form.Group,{controlId:H},a.createElement(o.Form.Label,null,R("minItems")),a.createElement(o.InputGroup,{hasValidation:!0},a.createElement(o.InputGroup.Prepend,{className:"arrow-up-btn",onClick:function(){var e=Number(w("".concat(Y,".minSubItems"))||0);N("".concat(Y,".minSubItems"),e+1,{shouldValidate:!0})}},a.createElement(o.InputGroup.Text,{className:"py-0 px-3"},a.createElement(s.ReactComponent,null))),a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.value,r=t.onChange,l=t.name,m=t.ref;return a.createElement(o.Form.Control,{ref:m,type:"number",min:0,step:1,value:null===n?"":n,onChange:r,isInvalid:c.isInvalid("".concat(Y,".minSubItems"),S),disabled:f,name:l})},control:T,name:"".concat(Y,".minSubItems"),rules:{min:{value:0,message:R("Validation:fieldMinNumber",{attribute:R("minItems"),min:0})},max:B?{value:Number(B),message:R("Validation:fieldMaxNumber",{attribute:R("minItems"),max:R("maxItems")})}:void 0}}),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(Y,".minSubItems"),S))))),a.createElement(o.Col,{md:6,sm:6,xs:6},a.createElement(o.Form.Group,{controlId:K},a.createElement(o.Form.Label,null,R("maxItems")),a.createElement(o.InputGroup,{hasValidation:!0},a.createElement(o.InputGroup.Prepend,{className:"arrow-up-btn",onClick:function(){var e=Number(w("".concat(Y,".maxSubItems"))||0);N("".concat(Y,".maxSubItems"),e+1,{shouldValidate:!0})}},a.createElement(o.InputGroup.Text,{className:"py-0 px-3"},a.createElement(s.ReactComponent,null))),a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.value,r=t.onChange,l=t.name,m=t.ref;return a.createElement(o.Form.Control,{ref:m,type:"number",step:1,name:l,value:null===n?"":n,onChange:r,isInvalid:c.isInvalid("".concat(Y,".maxSubItems"),S),disabled:f})},control:T,name:"".concat(Y,".maxSubItems"),rules:{min:{value:Number(D),message:R("Validation:fieldGreaterMinNumber",{attribute:R("maxItems"),min:R("minItems")})}}}),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(Y,".maxSubItems"),S)))))),ce&&a.createElement(o.Row,null,a.createElement(o.Col,null,a.createElement(o.Form.Group,{controlId:$},a.createElement(o.Form.Label,null,"Zone"),a.createElement(l.Controller,{control:T,name:"".concat(Y,".zoneId"),render:function(e){var n=e.field;return a.createElement(o.Form.Control,t.__assign({as:"select",isInvalid:c.isInvalid("".concat(Y,".zoneId"),S)},n),a.createElement("option",{value:null},R("Design:choose")),oe.map((function(e){return a.createElement("option",{key:e.id,value:e.id},e.name)})))},rules:{required:{value:ae,message:R("Validation:fieldRequired",{attribute:R("zone")})},validate:function(e){return!!e||R("Validation:fieldRequired",{attribute:R("zone")})}}}),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(Y,".zoneId"),S)))))),a.createElement(o.Col,{md:12,xl:!0,className:"p-0"},a.createElement(o.Form.Group,{controlId:z,className:"custom-checkbox"},a.createElement(o.Form.Check,{custom:!0,type:"checkbox",name:z,disabled:f,id:"check-api"},a.createElement(o.Form.Check.Input,{checked:A,onChange:le,type:"checkbox"}),a.createElement(o.Form.Check.Label,null,R("showAdvancedOptions")))),a.createElement(o.Collapse,{in:A},a.createElement("div",null,M&&a.createElement(o.Form.Group,{controlId:J,className:"advanced-switch-container"},a.createElement(o.Form.Label,null,R("hasTicket")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:O.type===E.CATEGORY_TYPE_TICKETS})},control:T,name:"".concat(Y,".hasTicket")}))),O.hasTicket&&a.createElement(o.Form.Group,{controlId:Z,className:"advanced-switch-container"},a.createElement(o.Form.Label,null,R("collectUserInfo")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:f})},control:T,name:"".concat(Y,".collectUserInfo")}))),a.createElement(o.Form.Group,{controlId:Q,className:"advanced-switch-container"},a.createElement(o.Form.Label,null,R("isRelyOnPeople")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:f||O.hasTicket})},control:T,name:"".concat(Y,".isRelyOnPeople")}))),!O.hasTicket&&a.createElement(o.Form.Group,{controlId:W,className:"advanced-switch-container"},a.createElement(a.Fragment,null,a.createElement(o.Form.Label,null,R("isTimeRelated")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:f})},control:T,name:"".concat(Y,".isTimeRelated")})))),a.createElement(o.Form.Group,{controlId:ee,className:"advanced-switch-container"},a.createElement(o.Form.Label,null,R("allowDeposits")),a.createElement("div",null,a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.name,r=t.value,o=t.onChange;return a.createElement(u.BooleanSwitch,{name:n,value:Boolean(r),onChange:o,disabled:f})},control:T,name:"".concat(Y,".allowDeposits")}))),V&&a.createElement(o.Form.Group,{controlId:te,className:"deposit-days"},a.createElement(o.Form.Label,null,R("depositDays")),a.createElement(l.Controller,{render:function(e){var t=e.field,n=t.value,r=t.onChange,l=t.name,m=t.ref;return a.createElement(o.Form.Control,{ref:m,type:"number",min:0,step:1,value:n,onChange:r,isInvalid:c.isInvalid("".concat(Y,".remainderExpireAfter"),S),disabled:f,name:l})},control:T,name:"".concat(Y,".remainderExpireAfter")}),a.createElement(o.Form.Control.Feedback,{type:"invalid"},c.getErrors("".concat(Y,".remainderExpireAfter"),S)))))))};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ProductQuantityCheckResponse } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
3
2
|
import { OrderProduct } from "@licklist/core/dist/DataMapper/Order/OrderProductDataMapper";
|
|
3
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
4
4
|
import { Product } from "../../../types";
|
|
5
5
|
interface CategoryProductProps {
|
|
6
6
|
product: Product;
|
|
7
7
|
fieldIndex: `steps.${number}.productCategories.${number}.products.${number}`;
|
|
8
|
-
productsWithErrors?:
|
|
8
|
+
productsWithErrors?: QuantityCheckProductInfo[];
|
|
9
9
|
isLoading?: boolean;
|
|
10
10
|
isEditMode?: boolean;
|
|
11
11
|
isProductSetAvailable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryProduct.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/category-product/CategoryProduct.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"CategoryProduct.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/category-product/CategoryProduct.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,6DAA6D,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAExF,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,SAAS,MAAM,sBAAsB,MAAM,aAAa,MAAM,EAAE,CAAC;IAC7E,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED,eAAO,MAAM,eAAe,8GAQzB,oBAAoB,gBA6PtB,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
3
3
|
import { OrderProduct } from "@licklist/core/dist/DataMapper/Order/OrderProductDataMapper";
|
|
4
4
|
import { Product } from "../../../types";
|
|
5
5
|
interface CategoryProductsProps {
|
|
6
6
|
stepIndex: number;
|
|
7
7
|
categoryIndex: number;
|
|
8
8
|
products?: Product[];
|
|
9
|
-
productsWithErrors?:
|
|
9
|
+
productsWithErrors?: QuantityCheckProductInfo[];
|
|
10
10
|
isLoading?: boolean;
|
|
11
11
|
isEditMode?: boolean;
|
|
12
12
|
isProductSetAvailable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryProducts.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/category-products/CategoryProducts.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"CategoryProducts.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/category-products/CategoryProducts.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,6DAA6D,CAAC;AAE3F,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC,UAAU,qBAAqB;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED,eAAO,MAAM,gBAAgB,6HAS1B,qBAAqB,gBAuCvB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
3
3
|
import { OrderProduct } from "@licklist/core/dist/DataMapper/Order/OrderProductDataMapper";
|
|
4
4
|
import { MenuStep } from "../../../types";
|
|
5
5
|
export interface ManualBookingStepsControllProps {
|
|
6
6
|
step: MenuStep;
|
|
7
7
|
stepIndex: number;
|
|
8
|
-
productsWithErrors?:
|
|
8
|
+
productsWithErrors?: QuantityCheckProductInfo[];
|
|
9
9
|
isLoading?: boolean;
|
|
10
10
|
isEditMode?: boolean;
|
|
11
11
|
isProductSetAvailable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualBookingStepsControll.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/controll/ManualBookingStepsControll.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ManualBookingStepsControll.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/controll/ManualBookingStepsControll.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,6DAA6D,CAAC;AAE3F,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED,eAAO,MAAM,0BAA0B,0GAQpC,+BAA+B,gBA2FjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),r=require("react"),o=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,a=require("react-i18next"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),r=require("react"),o=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,a=require("react-i18next"),l=require("react-bootstrap"),s=require("react-hook-form"),i=require("../../../collapsible-input-group/CollapsibleInputGroup.js"),n=require("../../../iframe/order-process/components/ErrorModal/ErrorModal.js"),c=require("../category-products/CategoryProducts.js");exports.ManualBookingStepsControll=function(e){var d=e.step,u=e.stepIndex,p=e.productsWithErrors,m=e.isLoading,v=void 0!==m&&m,g=e.isEditMode,E=void 0!==g&&g,f=e.isProductSetAvailable,y=void 0!==f&&f,C=e.orderProducts,b=s.useFormContext().formState.errors,x=a.useTranslation(["Design"]).t,q=b&&(null==b?void 0:b.steps)?null==b?void 0:b.steps[u]:void 0,P=t.__read(r.useState(!1),2),_=P[0],M=P[1];return r.useEffect((function(){p&&M(!0)}),[p]),o.createElement(l.Accordion,{key:d.id,defaultActiveKey:"step"},o.createElement(n.ErrorModal,{isOpen:_,onClose:function(){return M(!1)},messageKey:"pleaseCheckSelectedProducts"}),o.createElement(i.CollapsibleInputGroup,{alwaysOpen:!0,description:"",eventKey:"step",label:o.createElement(o.Fragment,null,o.createElement("div",{className:"step-title"},null==d?void 0:d.name),q&&o.createElement("div",{className:"d-flex mt-3 w-100"},o.createElement("p",{className:"iframe-event__message-error mb-0"},x("notValidStep"))))},d.productCategories.map((function(e,t){var r=q&&(null==q?void 0:q.productCategories)?null==q?void 0:q.productCategories[t]:void 0;return o.createElement(l.Accordion,{key:e.id,defaultActiveKey:1===d.productCategories.length?"categories":void 0},o.createElement(i.CollapsibleInputGroup,{description:"",eventKey:"categories",alwaysOpen:1===d.productCategories.length,label:o.createElement(o.Fragment,null,o.createElement("div",{className:"category-title"},null==e?void 0:e.name),r&&o.createElement("div",{className:"d-flex mt-3 w-100"},o.createElement("p",{className:"iframe-event__message-error mb-0"},x("notValidCategory"))))},o.createElement(c.CategoryProducts,{products:null==e?void 0:e.products,stepIndex:u,categoryIndex:t,productsWithErrors:p,isLoading:v,isEditMode:E,isProductSetAvailable:y,orderProducts:C})))}))))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),a=require("react"),r=(e=a)&&"object"==typeof e&&"default"in e?e.default:e,n=require("react-router-dom"),i=require("react-i18next"),o=require("react-bootstrap");require("../../../iframe/event/event-booking-form/EventBookingForm.js"),require("../../../iframe/event/event-booking-view/EventBookingView.js");var m=require("../../../iframe/event/event-card/IframeEventCard.js");require("../../../iframe/event/event-card/IframeEventCardSkeleton.js"),require("../../../iframe/event/ticket-description/TicketDescription.js");var l=require("../../../iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js");require("../../../iframe/event/event-details/EventDetails.js"),require("../../../iframe/event/event-tables/EventTables.js"),require("../../../iframe/event/event-order-summary/EventOrderSummary.js"),require("../../../iframe/event/event-booking-products/EventBookingProducts.js"),require("../../../iframe/event/event-order-short-summary/EventOrderShortSummary.js"),require("../../../iframe/order-process/components/NavigationFooter/NavigationFooter.js"),require("../../../iframe/event/event-description/EventDescription.js");var s=require("../../../iframe/event/event-product-sets/EventProductSets.js");require("../../../iframe/event/event-calendar/components/CalendarSelect/CalendarSelect.js");var c=require("../../../iframe/event/event-calendar/EventCalendar.js");require("../../../iframe/event/event-step-venue-map-zones/EventStepVenueMapZones.js");var u=require("../../../iframe/event/event-venue-map/IframeEventVenueMap.js");require("../../../iframe/payment/payment-form/PaymentForm.js"),require("../../../iframe/payment/order-items-table/OrderItemsTable.js");var d=require("../context/snippetTemplate.js"),p=require("../../../iframe/page/components/PageHeader/PageHeader.js");require("../../../iframe/payment/payment-status-header/PaymentStatusHeader.js");var v=require("../../../iframe/order-process/components/BookingSummary/BookingSummary.js"),f=require("../../../iframe/order-process/components/NavigationSteps/NavigationSteps.js");require("../../../iframe/order-process/components/StepsForm/StepsForm.js");var E=require("../../../iframe/order-process/components/Timer/Timer.js");require("../../../iframe/order-process/components/PaymentCard/PaymentCard.js");var g=require("../../../iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.js"),y=require("../../../iframe/page/components/PageBody/PageBody.js");require("../../../iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.js"),require("../../../iframe/powered-by/PoweredBy.js");var b=require("../../../iframe/page/Page.js");require("../../../iframe/payment/payment-page/PaymentPage.js"),require("../../../iframe/payment/payment-status-page/PaymentStatusPage.js"),require("../../../iframe/custom-fields/components/CustomDateField.js");var N=require("../context/snippetTemplateView.js"),S=require("@licklist/core/dist/DataMapper/Provider/SnippetDataMapper"),C=require("../settings/SettingButton.js");exports.Preview=function(e){var q=e.onSettingClick,h=e.providerHasMap,B=void 0!==h&&h,j=i.useTranslation("Design").t,P=t.__read(a.useState(0),2),k=P[0],w=P[1],x=t.__read(a.useState(0),2),I=x[0],T=x[1],A=a.useContext(N.SnippetTemplateViewContext).setView,M=a.useContext(d.SnippetTemplateContext).template.type,_=void 0===M?S.SNIPPET_TYPE_EVENT_LIST:M,F=function(e){A(e),q()};return r.createElement("div",{className:"w-100 h-100 snippet-template-preview"},r.createElement(b.Page,{headerBlock:r.createElement("div",{className:"d-flex mt-5 pt-5 p-5 iframe-page snippet-template-additional-header"},r.createElement(C.SettingButton,{view:"pageHeaderSteps",onClick:F,className:"m-0"},r.createElement(C.SettingButton,{view:"pageHeader",onClick:F,className:"m-0 snippet-template-button-left",containerClassName:"mr-5 asd"}),r.createElement("div",{className:"header-block mt-5 pt-5"},r.createElement("div",{className:"mt-5 pt-5 external-header"},r.createElement(p.PageHeader,{showCloseButton:!0,showBackButton:!0},r.createElement(E.Timer,{timer:600}),r.createElement(n.MemoryRouter,{initialEntries:["/step1","/step2"]},r.createElement(f.NavigationSteps,{steps:[{pathname:"/step1",key:"/step1",name:"Burger"},{pathname:"/step2",key:"/step2",name:"Cheese"}]})))))))},r.createElement("div",{className:"page-body pb-5 mb-5 pt-3 mt-3"},r.createElement(C.SettingButton,{view:"page",onClick:F,className:"snippet-template-body-button"})),r.createElement(y.PageBody,{className:"snippet-template",leftBlock:r.createElement(C.SettingButton,{view:"pageBodyLeftBlock",onClick:F,className:"mr-4"},r.createElement(y.PageBody.LeftBlock,{title:"About this event"},r.createElement(C.SettingButton,{view:"elements",onClick:F,className:"mt-5 m-0",containerClassName:"mt-5 pt-5"},r.createElement("div",{className:"mt-3"},r.createElement("h3",null,j("elements"))),r.createElement("div",{className:"mt-5"},r.createElement("h4",null,j("Texts")),r.createElement("p",null,"XXXX")),r.createElement("div",{className:"mt-5"},r.createElement("h4",null,j("form")),r.createElement("div",{className:"d-flex flex-column w-100"},r.createElement("div",{className:"w-100"},r.createElement("div",{className:"form-row"},r.createElement("div",{className:"form-group col-12"},r.createElement("label",{className:"form-label"},j("firstName")),r.createElement("input",{type:"text",className:"form-control",placeholder:j("firstName")}))),r.createElement("div",{className:"form-row"},r.createElement("button",{type:"button",className:"btn btn-link"},j("iHaveAccount")))))),r.createElement("div",{className:"mt-5"},r.createElement("h4",null,j("Number input")),r.createElement("div",{className:"d-flex flex-column w-100"},r.createElement(l.NumberInput,{value:k,onChange:function(e){return w(e)},onArrowDown:function(){return w((function(e){return e-1}))},onArrowUp:function(){return w((function(e){return e+1}))}}))),r.createElement("div",{className:"mt-5"},r.createElement("h4",null,j("Dropdown")),r.createElement("div",{className:"d-flex flex-column w-100"},r.createElement("div",{className:"w-100"},r.createElement("div",{className:"form-row"},r.createElement("div",{className:"form-group col-12"},r.createElement("label",{className:"form-label"},j("dayOfBirthShort")),r.createElement("select",{className:"form-control",placeholder:j("firstName")},r.createElement("option",null,"2022"),r.createElement("option",null,"2023"))))))),r.createElement("div",{className:"mt-5 snippet-template__form"},r.createElement("h4",null,j("Button")),r.createElement("div",{className:"d-flex flex-column w-100"},r.createElement(o.Button,{size:"sm"},"Submit")))),B&&_===S.SNIPPET_TYPE_VENUE_MAP&&r.createElement(r.Fragment,null,r.createElement("div",{className:"pt-4"},r.createElement("h4",null,j("Calendar")),r.createElement(C.SettingButton,{view:"calendar",onClick:F,className:"mt-3 m-0",containerClassName:"mt-5 pt-5"},r.createElement(c.EventCalendar,null))),r.createElement("div",{className:"pt-4"},r.createElement(C.SettingButton,{view:"productSet",onClick:F,className:"mt-3 m-0",containerClassName:"mt-5 pt-5"},r.createElement("h4",null,j("Product Sets")),r.createElement("div",{className:"pt-5 mt-5"},r.createElement(s.EventProductSets,{productSets:[{id:1,name:"Test 1"},{id:2,name:"Test 2"},{id:3,name:"Test 3"}],onSelectProductSet:T,selectedProductSetId:I})))),r.createElement("div",{className:"pt-4"},r.createElement("form",{className:"category-steps-form pt-4 mt-4"},r.createElement("h4",null,j("Venue Map")),r.createElement("div",{className:"position-relative pt-4 mt-4"},r.createElement(C.SettingButton,{view:"venueMap",onClick:F,className:"mt-n6 m-0",containerClassName:"mt-5 pt-5"},r.createElement(u.IframeEventVenueMap,{url:"https://fastly.picsum.photos/id/13/2500/1667.jpg?hmac=SoX9UoHhN8HyklRA4A3vcCWJMVtiBXUg0W4ljWTor7s",usedInIframe:!0,pointProducts:[{id:9,menuStepId:75,pointId:21,productUuid:"beb6393c-2fdd-40f7-bb92-8800685b203f"},{id:10,menuStepId:75,pointId:24,productUuid:"beb6393c-2fdd-40f7-bb92-8800685b203a"}],points:[{id:21,venueMapId:7,createdAt:null,updatedAt:null,deletedAt:null,xCoordinate:799.39,yCoordinate:1108.45},{id:24,venueMapId:7,createdAt:null,updatedAt:null,deletedAt:null,xCoordinate:1400.2,yCoordinate:1431.77}],choosedProductUuids:["beb6393c-2fdd-40f7-bb92-8800685b203f"],products:[{id:148,productCategoryId:57,productGroupId:null,availableQuantity:980,zoneId:null,name:"Cofee",description:"",price:15,deposit:0,minQuantity:1,maxQuantity:15,totalQuantity:980,type:"sale",capacity:0,duration:0,weight:0,isAvailable:!0,isSoldOut:!1,isRequired:!1,isUnlimited:!1,quantitySelector:1,hasSpecialNotes:!1,termsAndConditions:null,subProducts:[],images:null,productCategory:null,uuid:"beb6393c-2fdd-40f7-bb92-8800685b203f"},{id:149,productCategoryId:57,productGroupId:null,availableQuantity:980,zoneId:null,name:"Cofee 2",description:"",price:15,deposit:0,minQuantity:1,maxQuantity:15,totalQuantity:980,type:"sale",capacity:0,duration:0,weight:0,isAvailable:!0,isSoldOut:!1,isRequired:!1,isUnlimited:!1,quantitySelector:1,hasSpecialNotes:!1,termsAndConditions:null,subProducts:[],images:null,productCategory:null,uuid:"beb6393c-2fdd-40f7-bb92-8800685b203a"}]})))))))),rightBlock:r.createElement(y.PageBody.RightBlock,{bottomBlock:r.createElement(g.BookingSummaryFooter,null)},r.createElement(C.SettingButton,{view:"pageBodyRightBlock",onClick:F,containerClassName:"snippet-template-button-fixed-height",className:"m-0"}),r.createElement(v.BookingSummary.Accordion,{showTitleOnlyOnMobile:!0},r.createElement(m.IframeEventCard,{imageSrc:"https://images.unsplash.com/photo-1638988319382-90e61be77c59?ixlib=rb-1.2.1&auto=format&fit=crop&w=687&q=80",title:"XXXX",type:"Party Doors 22:00 - 03:00",cost:6,date:"Sat 2nd May",goToDetails:function(){return null},shortDate:"07/03/2023"})))})))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),a=require("react"),r=(e=a)&&"object"==typeof e&&"default"in e?e.default:e,n=require("react-router-dom"),o=require("react-i18next"),i=require("react-bootstrap");require("../../../iframe/event/event-booking-form/EventBookingForm.js"),require("../../../iframe/event/event-booking-view/EventBookingView.js");var m=require("../../../iframe/event/event-card/IframeEventCard.js");require("../../../iframe/event/event-card/IframeEventCardSkeleton.js"),require("../../../iframe/event/ticket-description/TicketDescription.js");var s=require("../../../iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js");require("../../../iframe/event/event-details/EventDetails.js"),require("../../../iframe/event/event-tables/EventTables.js"),require("../../../iframe/event/event-order-summary/EventOrderSummary.js"),require("../../../iframe/event/event-booking-products/EventBookingProducts.js"),require("../../../iframe/event/event-order-short-summary/EventOrderShortSummary.js"),require("../../../iframe/order-process/components/NavigationFooter/NavigationFooter.js"),require("../../../iframe/event/event-description/EventDescription.js");var l=require("../../../iframe/event/event-product-sets/EventProductSets.js");require("../../../iframe/event/event-calendar/components/CalendarSelect/CalendarSelect.js");var c=require("../../../iframe/event/event-calendar/EventCalendar.js");require("../../../iframe/event/event-step-venue-map-zones/EventStepVenueMapZones.js");var u=require("../../../iframe/event/event-venue-map/IframeEventVenueMap.js");require("../../../iframe/payment/payment-form/PaymentForm.js"),require("../../../iframe/payment/order-items-table/OrderItemsTable.js");var d=require("../context/snippetTemplate.js"),p=require("../../../iframe/page/components/PageHeader/PageHeader.js");require("../../../iframe/payment/payment-status-header/PaymentStatusHeader.js");var v=require("../../../iframe/order-process/components/BookingSummary/BookingSummary.js"),f=require("../../../iframe/order-process/components/NavigationSteps/NavigationSteps.js"),E=require("../../../iframe/order-process/components/Timer/Timer.js");require("../../../iframe/order-process/components/PaymentCard/PaymentCard.js");var g=require("../../../iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.js");require("../../../iframe/order-process/components/ErrorModal/ErrorModal.js");var y=require("../../../iframe/page/components/PageBody/PageBody.js");require("../../../iframe/order-process/components/utils/useCategoryVerification.js"),require("../../../iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.js"),require("../../../iframe/order-process/components/Category/Category.js"),require("../../../iframe/powered-by/PoweredBy.js");var b=require("../../../iframe/page/Page.js");require("../../../iframe/payment/payment-page/PaymentPage.js"),require("../../../iframe/payment/payment-status-page/PaymentStatusPage.js"),require("../../../iframe/custom-fields/components/CustomDateField.js");var N=require("../context/snippetTemplateView.js"),S=require("@licklist/core/dist/DataMapper/Provider/SnippetDataMapper"),C=require("../settings/SettingButton.js");exports.Preview=function(e){var q=e.onSettingClick,h=e.providerHasMap,j=void 0!==h&&h,B=o.useTranslation("Design").t,P=t.__read(a.useState(0),2),k=P[0],w=P[1],x=t.__read(a.useState(0),2),I=x[0],T=x[1],A=a.useContext(N.SnippetTemplateViewContext).setView,M=a.useContext(d.SnippetTemplateContext).template.type,_=void 0===M?S.SNIPPET_TYPE_EVENT_LIST:M,D=function(e){A(e),q()};return r.createElement("div",{className:"w-100 h-100 snippet-template-preview"},r.createElement(b.Page,{headerBlock:r.createElement("div",{className:"d-flex mt-5 pt-5 p-5 iframe-page snippet-template-additional-header"},r.createElement(C.SettingButton,{view:"pageHeaderSteps",onClick:D,className:"m-0"},r.createElement(C.SettingButton,{view:"pageHeader",onClick:D,className:"m-0 snippet-template-button-left",containerClassName:"mr-5 asd"}),r.createElement("div",{className:"header-block mt-5 pt-5"},r.createElement("div",{className:"mt-5 pt-5 external-header"},r.createElement(p.PageHeader,{showCloseButton:!0,showBackButton:!0},r.createElement(E.Timer,{timer:600}),r.createElement(n.MemoryRouter,{initialEntries:["/step1","/step2"]},r.createElement(f.NavigationSteps,{steps:[{pathname:"/step1",key:"/step1",name:"Burger"},{pathname:"/step2",key:"/step2",name:"Cheese"}]})))))))},r.createElement("div",{className:"page-body pb-5 mb-5 pt-3 mt-3"},r.createElement(C.SettingButton,{view:"page",onClick:D,className:"snippet-template-body-button"})),r.createElement(y.PageBody,{className:"snippet-template",leftBlock:r.createElement(C.SettingButton,{view:"pageBodyLeftBlock",onClick:D,className:"mr-4"},r.createElement(y.PageBody.LeftBlock,{title:"About this event"},r.createElement(C.SettingButton,{view:"elements",onClick:D,className:"mt-5 m-0",containerClassName:"mt-5 pt-5"},r.createElement("div",{className:"mt-3"},r.createElement("h3",null,B("elements"))),r.createElement("div",{className:"mt-5"},r.createElement("h4",null,B("Texts")),r.createElement("p",null,"XXXX")),r.createElement("div",{className:"mt-5"},r.createElement("h4",null,B("form")),r.createElement("div",{className:"d-flex flex-column w-100"},r.createElement("div",{className:"w-100"},r.createElement("div",{className:"form-row"},r.createElement("div",{className:"form-group col-12"},r.createElement("label",{className:"form-label"},B("firstName")),r.createElement("input",{type:"text",className:"form-control",placeholder:B("firstName")}))),r.createElement("div",{className:"form-row"},r.createElement("button",{type:"button",className:"btn btn-link"},B("iHaveAccount")))))),r.createElement("div",{className:"mt-5"},r.createElement("h4",null,B("Number input")),r.createElement("div",{className:"d-flex flex-column w-100"},r.createElement(s.NumberInput,{value:k,onChange:function(e){return w(e)},onArrowDown:function(){return w((function(e){return e-1}))},onArrowUp:function(){return w((function(e){return e+1}))}}))),r.createElement("div",{className:"mt-5"},r.createElement("h4",null,B("Dropdown")),r.createElement("div",{className:"d-flex flex-column w-100"},r.createElement("div",{className:"w-100"},r.createElement("div",{className:"form-row"},r.createElement("div",{className:"form-group col-12"},r.createElement("label",{className:"form-label"},B("dayOfBirthShort")),r.createElement("select",{className:"form-control",placeholder:B("firstName")},r.createElement("option",null,"2022"),r.createElement("option",null,"2023"))))))),r.createElement("div",{className:"mt-5 snippet-template__form"},r.createElement("h4",null,B("Button")),r.createElement("div",{className:"d-flex flex-column w-100"},r.createElement(i.Button,{size:"sm"},"Submit")))),j&&_===S.SNIPPET_TYPE_VENUE_MAP&&r.createElement(r.Fragment,null,r.createElement("div",{className:"pt-4"},r.createElement("h4",null,B("Calendar")),r.createElement(C.SettingButton,{view:"calendar",onClick:D,className:"mt-3 m-0",containerClassName:"mt-5 pt-5"},r.createElement(c.EventCalendar,null))),r.createElement("div",{className:"pt-4"},r.createElement(C.SettingButton,{view:"productSet",onClick:D,className:"mt-3 m-0",containerClassName:"mt-5 pt-5"},r.createElement("h4",null,B("Product Sets")),r.createElement("div",{className:"pt-5 mt-5"},r.createElement(l.EventProductSets,{productSets:[{id:1,name:"Test 1"},{id:2,name:"Test 2"},{id:3,name:"Test 3"}],onSelectProductSet:T,selectedProductSetId:I})))),r.createElement("div",{className:"pt-4"},r.createElement("form",{className:"category-steps-form pt-4 mt-4"},r.createElement("h4",null,B("Venue Map")),r.createElement("div",{className:"position-relative pt-4 mt-4"},r.createElement(C.SettingButton,{view:"venueMap",onClick:D,className:"mt-n6 m-0",containerClassName:"mt-5 pt-5"},r.createElement(u.IframeEventVenueMap,{url:"https://fastly.picsum.photos/id/13/2500/1667.jpg?hmac=SoX9UoHhN8HyklRA4A3vcCWJMVtiBXUg0W4ljWTor7s",usedInIframe:!0,pointProducts:[{id:9,menuStepId:75,pointId:21,productUuid:"beb6393c-2fdd-40f7-bb92-8800685b203f"},{id:10,menuStepId:75,pointId:24,productUuid:"beb6393c-2fdd-40f7-bb92-8800685b203a"}],points:[{id:21,venueMapId:7,createdAt:null,updatedAt:null,deletedAt:null,xCoordinate:799.39,yCoordinate:1108.45},{id:24,venueMapId:7,createdAt:null,updatedAt:null,deletedAt:null,xCoordinate:1400.2,yCoordinate:1431.77}],choosedProductUuids:["beb6393c-2fdd-40f7-bb92-8800685b203f"],products:[{id:148,productCategoryId:57,productGroupId:null,availableQuantity:980,zoneId:null,name:"Cofee",description:"",price:15,deposit:0,minQuantity:1,maxQuantity:15,totalQuantity:980,type:"sale",capacity:0,duration:0,weight:0,isAvailable:!0,isSoldOut:!1,isRequired:!1,isUnlimited:!1,quantitySelector:1,hasSpecialNotes:!1,termsAndConditions:null,subProducts:[],images:null,productCategory:null,uuid:"beb6393c-2fdd-40f7-bb92-8800685b203f"},{id:149,productCategoryId:57,productGroupId:null,availableQuantity:980,zoneId:null,name:"Cofee 2",description:"",price:15,deposit:0,minQuantity:1,maxQuantity:15,totalQuantity:980,type:"sale",capacity:0,duration:0,weight:0,isAvailable:!0,isSoldOut:!1,isRequired:!1,isUnlimited:!1,quantitySelector:1,hasSpecialNotes:!1,termsAndConditions:null,subProducts:[],images:null,productCategory:null,uuid:"beb6393c-2fdd-40f7-bb92-8800685b203a"}]})))))))),rightBlock:r.createElement(y.PageBody.RightBlock,{bottomBlock:r.createElement(g.BookingSummaryFooter,null)},r.createElement(C.SettingButton,{view:"pageBodyRightBlock",onClick:D,containerClassName:"snippet-template-button-fixed-height",className:"m-0"}),r.createElement(v.BookingSummary.Accordion,{showTitleOnlyOnMobile:!0},r.createElement(m.IframeEventCard,{imageSrc:"https://images.unsplash.com/photo-1638988319382-90e61be77c59?ixlib=rb-1.2.1&auto=format&fit=crop&w=687&q=80",title:"XXXX",type:"Party Doors 22:00 - 03:00",cost:6,date:"Sat 2nd May",goToDetails:function(){return null},shortDate:"07/03/2023"})))})))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframe.d.ts","sourceRoot":"","sources":["../../src/types/iframe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0DAA0D,CAAC;AAElG,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,eAAe,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"iframe.d.ts","sourceRoot":"","sources":["../../src/types/iframe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0DAA0D,CAAC;AAElG,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,eAAe,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB;AAID,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,MAAM,UAAU,GAAG,CACvB,GAAG,EACC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACrB,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,KAC5D,IAAI,CAAC;AAEV,MAAM,MAAM,gBAAgB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { EventVenueMapProvider } from "@licklist/plugins/dist/context/event/Even
|
|
|
3
3
|
import { Point } from "@licklist/plugins/dist/types/context/event/point";
|
|
4
4
|
import { PointProduct } from "@licklist/core/dist/DataMapper/Product/PointProductDataMapper";
|
|
5
5
|
import { Product } from "@licklist/core/dist/DataMapper/Product/ProductDataMapper";
|
|
6
|
-
import {
|
|
6
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
7
7
|
import { VenueMap, VenueMapRef } from "./components/VenueMap";
|
|
8
8
|
import { useCanvasSize } from "./hooks/useCanvasSize";
|
|
9
9
|
|
|
@@ -25,7 +25,7 @@ export type EventVenueMapProps = {
|
|
|
25
25
|
products?: Partial<Product>[];
|
|
26
26
|
pointProducts?: Partial<PointProduct>[];
|
|
27
27
|
onPointProductsChange?: (values: Partial<PointProduct>[]) => void;
|
|
28
|
-
soldOutProducts?:
|
|
28
|
+
soldOutProducts?: QuantityCheckProductInfo[];
|
|
29
29
|
} & EventVenueMapIframeProps;
|
|
30
30
|
|
|
31
31
|
export const EventVenueMap = forwardRef<VenueMapRef, EventVenueMapProps>(
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
EventVenueMapContext,
|
|
12
12
|
EventVenueMapContextProps,
|
|
13
13
|
} from "@licklist/plugins/dist/context/event/EventVenueMapContext";
|
|
14
|
-
import {
|
|
14
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
15
15
|
import { useImage } from "../../hooks/useImage";
|
|
16
16
|
import { useStageActions } from "../../hooks/useStageActions";
|
|
17
17
|
import { MapPoint } from "../MapPoint";
|
|
@@ -33,7 +33,7 @@ export type VenueMapProps = {
|
|
|
33
33
|
usedInIframe?: boolean;
|
|
34
34
|
choosedProductUuids?: string[];
|
|
35
35
|
errorOnChoosedProductUuids?: string[];
|
|
36
|
-
soldOutProducts?:
|
|
36
|
+
soldOutProducts?: QuantityCheckProductInfo[];
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export const VenueMap = forwardRef<VenueMapRef, VenueMapProps>(
|
package/src/iframe/index.ts
CHANGED
|
@@ -29,7 +29,6 @@ export {
|
|
|
29
29
|
export {
|
|
30
30
|
BookingSummary,
|
|
31
31
|
NavigationSteps,
|
|
32
|
-
StepsForm,
|
|
33
32
|
Timer,
|
|
34
33
|
NavigationFooter,
|
|
35
34
|
PaymentCard,
|
|
@@ -37,6 +36,9 @@ export {
|
|
|
37
36
|
BookingSummaryFooterProps,
|
|
38
37
|
CalendarStepsForm,
|
|
39
38
|
CalendarStepsFormProps,
|
|
39
|
+
Category,
|
|
40
|
+
ErrorModal,
|
|
41
|
+
useCategoryVerification,
|
|
40
42
|
} from "./order-process";
|
|
41
43
|
export { PoweredBy } from "./powered-by";
|
|
42
44
|
export * from "./page";
|
|
@@ -2,13 +2,13 @@ import React, { useMemo } from "react";
|
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
import * as Config from "@licklist/core/dist/Config";
|
|
5
|
-
import {
|
|
5
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
6
6
|
import { Order, MenuStep } from "../../../../../../types";
|
|
7
7
|
|
|
8
8
|
export type ProductsByMenuStepsProps = {
|
|
9
9
|
orderProducts: Order[];
|
|
10
10
|
step: MenuStep;
|
|
11
|
-
productsWithErrors?:
|
|
11
|
+
productsWithErrors?: QuantityCheckProductInfo[];
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
const getIdFromEntity = (entities: { id: number }[]) =>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
2
2
|
import { MenuStep, Order } from "../../../../../types";
|
|
3
3
|
|
|
4
4
|
export const MOBILE_WIDTH = 576;
|
|
@@ -16,7 +16,7 @@ export type BookingSummaryProps = {
|
|
|
16
16
|
hasPeopleInput?: boolean;
|
|
17
17
|
transactionFee?: number;
|
|
18
18
|
isFreePayment?: boolean;
|
|
19
|
-
productsWithErrors?:
|
|
19
|
+
productsWithErrors?: QuantityCheckProductInfo[];
|
|
20
20
|
isLoading?: boolean;
|
|
21
21
|
peopleAmount: number;
|
|
22
22
|
};
|
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
import { Step } from "@licklist/core/dist/DataMapper/Product/StepDataMapper";
|
|
20
20
|
import { useTranslation } from "react-i18next";
|
|
21
21
|
import { Product } from "@licklist/core/dist/DataMapper/Product/ProductDataMapper";
|
|
22
|
-
import {
|
|
22
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
23
23
|
import { Category } from "./components/Category";
|
|
24
24
|
import { MenuStep } from "../../../../types";
|
|
25
25
|
import { STEP_FORM_ID } from "../../constants";
|
|
26
|
-
import { ErrorModal } from "
|
|
26
|
+
import { ErrorModal } from "../ErrorModal/ErrorModal";
|
|
27
27
|
import { PageBody } from "../../../page/components/PageBody";
|
|
28
28
|
import {
|
|
29
29
|
CalendarSelect,
|
|
@@ -31,8 +31,9 @@ import {
|
|
|
31
31
|
} from "../../../event/event-calendar/components/CalendarSelect";
|
|
32
32
|
import { IframeEventVenueMap } from "../../../event/event-venue-map";
|
|
33
33
|
import { VenueMapRef } from "../../../../events/event-venue-map/components/VenueMap";
|
|
34
|
-
import {
|
|
34
|
+
import { useCategoryVerification } from "../utils/useCategoryVerification";
|
|
35
35
|
|
|
36
|
+
// TODO move this component into apps/iframe
|
|
36
37
|
export interface CalendarStepsFormProps {
|
|
37
38
|
step: MenuStep;
|
|
38
39
|
isLastMenuStep: boolean;
|
|
@@ -45,7 +46,7 @@ export interface CalendarStepsFormProps {
|
|
|
45
46
|
onActiveVenueMapChange?: (nextVenueMapId: string) => void;
|
|
46
47
|
title: string;
|
|
47
48
|
menuStepWithVenueMap: Step;
|
|
48
|
-
soldOutProducts?:
|
|
49
|
+
soldOutProducts?: QuantityCheckProductInfo[];
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
export type StepsFormRef = {
|
|
@@ -75,7 +76,7 @@ export const CalendarStepsForm = forwardRef<
|
|
|
75
76
|
) => {
|
|
76
77
|
const form = useForm({ defaultValues });
|
|
77
78
|
const canvasRef = useRef<VenueMapRef>(null);
|
|
78
|
-
const
|
|
79
|
+
const verifyCategoryItems = useCategoryVerification();
|
|
79
80
|
const {
|
|
80
81
|
control,
|
|
81
82
|
formState: { errors },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { PointProduct } from "@licklist/core/dist/DataMapper/Product/PointProductDataMapper";
|
|
3
|
-
import {
|
|
3
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
4
4
|
import { ProductCategory } from "../../../../../types";
|
|
5
5
|
import { CategoryProductModal } from "./CategoryProductModal";
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ export type CategoryProps = {
|
|
|
9
9
|
activePointId?: number;
|
|
10
10
|
pointProducts: PointProduct[];
|
|
11
11
|
onCloseModal: () => void;
|
|
12
|
-
soldOutProducts?:
|
|
12
|
+
soldOutProducts?: QuantityCheckProductInfo[];
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export const Category = ({
|
package/src/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useMemo } from "react";
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { Button } from "react-bootstrap";
|
|
4
4
|
import { PointProduct } from "@licklist/core/dist/DataMapper/Product/PointProductDataMapper";
|
|
5
|
-
import {
|
|
5
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
6
6
|
import { ProductCategory, Product } from "../../../../../types";
|
|
7
7
|
import { CategoryProduct } from "../../CategoryProduct";
|
|
8
8
|
import Icon from "../../../../../static/Icon";
|
|
@@ -13,7 +13,7 @@ export type CategoryProductModalProps = {
|
|
|
13
13
|
category: ProductCategory;
|
|
14
14
|
pointProducts: PointProduct[];
|
|
15
15
|
onCloseModal: () => void;
|
|
16
|
-
soldOutProducts?:
|
|
16
|
+
soldOutProducts?: QuantityCheckProductInfo[];
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const CategoryProductModal = ({
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
3
|
import { DeepMap, FieldError } from "react-hook-form";
|
|
4
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
4
5
|
import { ProductCategory } from "../../../../types";
|
|
5
6
|
import { CategoryProduct } from "../CategoryProduct";
|
|
6
|
-
import { StepsFormProps } from "../StepsForm/StepsForm";
|
|
7
7
|
|
|
8
8
|
interface CategoryProps {
|
|
9
9
|
productCategories: ProductCategory[];
|
|
10
|
-
productsWithErrors?:
|
|
11
|
-
soldOutProducts?:
|
|
10
|
+
productsWithErrors?: QuantityCheckProductInfo[];
|
|
11
|
+
soldOutProducts?: QuantityCheckProductInfo[];
|
|
12
12
|
errors?: DeepMap<Record<string, any>, FieldError>;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -5,17 +5,17 @@ import { useTranslation } from "react-i18next";
|
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
6
|
import * as Config from "@licklist/core/dist/Config";
|
|
7
7
|
import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
|
|
8
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
8
9
|
import { TicketDescription } from "../../../event/ticket-description";
|
|
9
10
|
import { ProductCategory, Product } from "../../../../types";
|
|
10
|
-
import { StepsFormProps } from "../StepsForm/StepsForm";
|
|
11
11
|
import { ProductQuantityInput } from "./components/ProductQuantityInput";
|
|
12
12
|
|
|
13
13
|
interface CategoryProductProps {
|
|
14
14
|
product: Product;
|
|
15
15
|
category: ProductCategory;
|
|
16
16
|
canExpandDescription?: boolean;
|
|
17
|
-
productsWithErrors?:
|
|
18
|
-
soldOutProducts?:
|
|
17
|
+
productsWithErrors?: QuantityCheckProductInfo[];
|
|
18
|
+
soldOutProducts?: QuantityCheckProductInfo[];
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export const CategoryProduct = ({
|
|
@@ -5,7 +5,7 @@ import ModalHeader from "react-bootstrap/ModalHeader";
|
|
|
5
5
|
import ModalTitle from "react-bootstrap/ModalTitle";
|
|
6
6
|
import ModalBody from "react-bootstrap/ModalBody";
|
|
7
7
|
import Modal from "react-bootstrap/Modal";
|
|
8
|
-
import Icon from "
|
|
8
|
+
import Icon from "../../../../static/Icon";
|
|
9
9
|
|
|
10
10
|
export interface ErrorModalProps {
|
|
11
11
|
isOpen: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ErrorModal } from "./ErrorModal";
|
package/src/iframe/order-process/components/utils/{category.ts → useCategoryVerification.ts}
RENAMED
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import { useTranslation } from "react-i18next";
|
|
2
|
-
import { MenuStep } from "
|
|
2
|
+
import { MenuStep, Order } from "src/types";
|
|
3
3
|
|
|
4
4
|
interface CategoryError {
|
|
5
5
|
message: string;
|
|
6
6
|
id: number;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
// TODO it's temporary solution, please remove it later
|
|
10
|
+
export const useCategoryVerification = () => {
|
|
9
11
|
const { t } = useTranslation("Validation");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
values: Record<Order["id"], Order>,
|
|
12
15
|
step: MenuStep
|
|
13
16
|
): CategoryError | void => {
|
|
14
17
|
let errorMessage;
|
|
18
|
+
|
|
15
19
|
const productArray = Object.values(values).filter(
|
|
16
20
|
(product) => product?.quantity > 0
|
|
17
21
|
);
|
|
22
|
+
|
|
18
23
|
step?.productCategories.forEach(
|
|
19
24
|
({ minSubItems, maxSubItems, id, name }) => {
|
|
20
|
-
if (!minSubItems && !maxSubItems)
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
25
|
+
if (!minSubItems && !maxSubItems) return;
|
|
23
26
|
|
|
24
27
|
const categoryProductsQuantity = productArray.filter(
|
|
25
|
-
(product) =>
|
|
28
|
+
(product) => product?.productsCategoryId === id
|
|
26
29
|
).length;
|
|
27
|
-
|
|
30
|
+
|
|
31
|
+
if (minSubItems && categoryProductsQuantity < minSubItems) {
|
|
28
32
|
const message = t("Validation:fieldMinNumber", {
|
|
29
33
|
min: minSubItems,
|
|
30
34
|
attribute: `number of products in the ${name} category`,
|
|
@@ -33,6 +37,7 @@ export const useCategory = () => {
|
|
|
33
37
|
|
|
34
38
|
return;
|
|
35
39
|
}
|
|
40
|
+
|
|
36
41
|
if (maxSubItems && categoryProductsQuantity > maxSubItems) {
|
|
37
42
|
const message = t("Validation:fieldMaxNumber", {
|
|
38
43
|
max: maxSubItems,
|
|
@@ -42,7 +47,7 @@ export const useCategory = () => {
|
|
|
42
47
|
}
|
|
43
48
|
}
|
|
44
49
|
);
|
|
50
|
+
|
|
45
51
|
return errorMessage;
|
|
46
52
|
};
|
|
47
|
-
return { verifyCategoryItems };
|
|
48
53
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { BookingSummary } from "./components/BookingSummary";
|
|
2
2
|
export { NavigationSteps } from "./components/NavigationSteps";
|
|
3
|
-
export { StepsForm } from "./components/StepsForm";
|
|
4
3
|
export { Timer } from "./components/Timer";
|
|
5
4
|
export { NavigationFooter } from "./components/NavigationFooter";
|
|
6
5
|
export { PaymentCard } from "./components/PaymentCard";
|
|
@@ -8,3 +7,6 @@ export { BookingSummaryFooter } from "./components/BookingSummaryFooter";
|
|
|
8
7
|
export type { BookingSummaryFooterProps } from "./components/BookingSummaryFooter";
|
|
9
8
|
export { CalendarStepsForm } from "./components/CalendarStepsForm";
|
|
10
9
|
export type { CalendarStepsFormProps } from "./components/CalendarStepsForm";
|
|
10
|
+
export { useCategoryVerification } from "./components/utils/useCategoryVerification";
|
|
11
|
+
export { Category } from "./components/Category";
|
|
12
|
+
export { ErrorModal } from "./components/ErrorModal";
|
|
@@ -105,7 +105,7 @@ export function ProductCategoryControl({
|
|
|
105
105
|
|
|
106
106
|
const allowDepositsId = useId();
|
|
107
107
|
const remainderExpireAfterId = useId();
|
|
108
|
-
const { providerHasBookingManagement, zones } = useContext(
|
|
108
|
+
const { providerHasBookingManagement, zones = [] } = useContext(
|
|
109
109
|
ProductSetLoadingContext
|
|
110
110
|
);
|
|
111
111
|
|
|
@@ -5,8 +5,8 @@ import clsx from "clsx";
|
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
6
|
import { OverlayTrigger, Tooltip } from "react-bootstrap";
|
|
7
7
|
import MediaService from "@licklist/plugins/dist/services/Media/MediaService";
|
|
8
|
-
import { ProductQuantityCheckResponse } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
9
8
|
import { OrderProduct } from "@licklist/core/dist/DataMapper/Order/OrderProductDataMapper";
|
|
9
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
10
10
|
import { NumberInputHorizontal } from "../number-input-horizontal";
|
|
11
11
|
import { Product } from "../../../types";
|
|
12
12
|
import { TipTapEditor } from "../../../tiptap-editor";
|
|
@@ -14,7 +14,7 @@ import { TipTapEditor } from "../../../tiptap-editor";
|
|
|
14
14
|
interface CategoryProductProps {
|
|
15
15
|
product: Product;
|
|
16
16
|
fieldIndex: `steps.${number}.productCategories.${number}.products.${number}`;
|
|
17
|
-
productsWithErrors?:
|
|
17
|
+
productsWithErrors?: QuantityCheckProductInfo[];
|
|
18
18
|
isLoading?: boolean;
|
|
19
19
|
isEditMode?: boolean;
|
|
20
20
|
isProductSetAvailable?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
3
|
import { Accordion } from "react-bootstrap";
|
|
4
|
-
import {
|
|
4
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
5
5
|
import { OrderProduct } from "@licklist/core/dist/DataMapper/Order/OrderProductDataMapper";
|
|
6
6
|
import { CollapsibleInputGroup } from "../../../collapsible-input-group";
|
|
7
7
|
import { Product } from "../../../types";
|
|
@@ -11,7 +11,7 @@ interface CategoryProductsProps {
|
|
|
11
11
|
stepIndex: number;
|
|
12
12
|
categoryIndex: number;
|
|
13
13
|
products?: Product[];
|
|
14
|
-
productsWithErrors?:
|
|
14
|
+
productsWithErrors?: QuantityCheckProductInfo[];
|
|
15
15
|
isLoading?: boolean;
|
|
16
16
|
isEditMode?: boolean;
|
|
17
17
|
isProductSetAvailable?: boolean;
|
|
@@ -2,9 +2,9 @@ import React, { useEffect, useState } from "react";
|
|
|
2
2
|
import { Accordion } from "react-bootstrap";
|
|
3
3
|
import { useFormContext } from "react-hook-form";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
|
-
import {
|
|
5
|
+
import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
|
|
6
6
|
import { OrderProduct } from "@licklist/core/dist/DataMapper/Order/OrderProductDataMapper";
|
|
7
|
-
import { ErrorModal } from "../../../iframe/order-process/components/
|
|
7
|
+
import { ErrorModal } from "../../../iframe/order-process/components/ErrorModal/ErrorModal";
|
|
8
8
|
import { MenuStep } from "../../../types";
|
|
9
9
|
import { CollapsibleInputGroup } from "../../../collapsible-input-group";
|
|
10
10
|
import { CategoryProducts } from "../category-products/CategoryProducts";
|
|
@@ -12,7 +12,7 @@ import { CategoryProducts } from "../category-products/CategoryProducts";
|
|
|
12
12
|
export interface ManualBookingStepsControllProps {
|
|
13
13
|
step: MenuStep;
|
|
14
14
|
stepIndex: number;
|
|
15
|
-
productsWithErrors?:
|
|
15
|
+
productsWithErrors?: QuantityCheckProductInfo[];
|
|
16
16
|
isLoading?: boolean;
|
|
17
17
|
isEditMode?: boolean;
|
|
18
18
|
isProductSetAvailable?: boolean;
|
package/src/types/iframe.ts
CHANGED
package/dist/iframe/order-process/components/CalendarStepsForm/components/ErrorModal.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorModal.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/CalendarStepsForm/components/ErrorModal.tsx"],"names":[],"mappings":";AASA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,qCAIpB,eAAe,gBA2CjB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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=e(require("react")),r=require("react-i18next"),a=require("react-bootstrap"),o=require("../../../../../static/Icon.js"),n=e(require("react-bootstrap/ModalHeader")),s=e(require("react-bootstrap/ModalTitle")),i=e(require("react-bootstrap/ModalBody")),c=e(require("react-bootstrap/Modal"));exports.ErrorModal=function(e){var l=e.isOpen,m=void 0!==l&&l,u=e.onClose,d=e.messageKey,f=r.useTranslation("Design").t,p=function(){u&&u()};return t.createElement(c,{show:m,onHide:p,animation:!1,centered:!0,contentClassName:"rounded"},t.createElement(n,{className:"align-items-center border-0"},t.createElement(s,{as:"h6"},f("formHasErrors")),t.createElement(a.Button,{variant:"danger",className:"btn-sm rounded",onClick:p},t.createElement(o.default,{type:"times",height:"1rem"}))),t.createElement(i,{className:"confirmation-modal-body"},t.createElement("div",{className:"d-flex m-5 justify-content-center manual-form-error"},d?f(d):t.createElement(r.Trans,{t:f,i18nKey:"pleaseSelectAtLeastFrom",values:{min:1,type:"item",from:"those categories"}}))))};
|