@licklist/design 0.44.485-dev.31 → 0.44.485-dev.32
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/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts +1 -0
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +1 -1
- package/package.json +1 -1
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -0
- package/src/product-set/control/ProductSetControl.tsx +23 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultProductSet.d.ts","sourceRoot":"","sources":["../../../../src/events/edit-event-modal/utils/getDefaultProductSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACX,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,eAAO,MAAM,gBAAgB,gBACd,UAAU,GAAG,IAAI,qBACX,OAAO,KACzB,
|
|
1
|
+
{"version":3,"file":"getDefaultProductSet.d.ts","sourceRoot":"","sources":["../../../../src/events/edit-event-modal/utils/getDefaultProductSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACX,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,eAAO,MAAM,gBAAgB,gBACd,UAAU,GAAG,IAAI,qBACX,OAAO,KACzB,oBAsCD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),i=require("../../../product-set/utils/index.js");exports.getDefaultValues=function(o,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),i=require("../../../product-set/utils/index.js");exports.getDefaultValues=function(o,n){var t,d,u,s,r,a,v,p,_,m,c,g;return{id:null!==(t=null==o?void 0:o.id)&&void 0!==t?t:0,name:null!==(d=null==o?void 0:o.name)&&void 0!==d?d:"",type:null!==(u=null==o?void 0:o.type)&&void 0!==u?u:l.DEFAULT_PRODUCT_SET_TYPE,termsAndConditions:null!==(s=null==o?void 0:o.termsAndConditions)&&void 0!==s?s:"",operationalCost:null!==(r=null==o?void 0:o.operationalCost)&&void 0!==r?r:l.DEFAULT_OPERATIONAL_COST_TYPE,thankYouPageUrl:null!==(a=null==o?void 0:o.thankYouPageUrl)&&void 0!==a?a:"",isDefault:null!==(v=null==o?void 0:o.isDefault)&&void 0!==v&&v,fieldSetId:null==o?void 0:o.fieldSetId,emailTemplates:(null==o?void 0:o.mailTemplates)&&(null===(p=null==o?void 0:o.mailTemplates)||void 0===p?void 0:p.length)>0?i.getFilteredTemplates(null==o?void 0:o.mailTemplates):void 0,smsTemplates:(null==o?void 0:o.smsTemplates)&&(null===(_=null==o?void 0:o.smsTemplates)||void 0===_?void 0:_.length)>0?i.getFilteredTemplates(null==o?void 0:o.mailTemplates):void 0,steps:null!==(c=null===(m=null==o?void 0:o.steps)||void 0===m?void 0:m.map((function(l){var i,o=l.productCategories,n=e.__rest(l,["productCategories"]);return e.__assign(e.__assign({},n),{productCategories:null==o?void 0:o.map((function(l){var i=l.products,o=e.__rest(l,["products"]);return e.__assign(e.__assign({},o),{products:null==i?void 0:i.map((function(l){var i=l.zoneId,o=l.subProducts,n=e.__rest(l,["zoneId","subProducts"]);return e.__assign(e.__assign({},n),{subProducts:null==o?void 0:o.map((function(l){var i=l.zoneId,o=e.__rest(l,["zoneId"]);return e.__assign(e.__assign({},o),{productCategoryId:void 0,zoneId:i})})),productCategoryId:void 0,zoneId:i})}))})})),venueMapSetId:(null==n?void 0:n.venueMapSet)?null===(i=null==n?void 0:n.venueMapSet)||void 0===i?void 0:i.id:null})})))&&void 0!==c?c:void 0,menuRecurrences:n?[]:null!==(g=null==o?void 0:o.menuRecurrences)&&void 0!==g?g:[]}};
|
|
@@ -15,6 +15,7 @@ export interface ProductSetControlValues extends DateAndRecurrenceInputValues {
|
|
|
15
15
|
name: string;
|
|
16
16
|
type: ProductSetType;
|
|
17
17
|
termsAndConditions: string;
|
|
18
|
+
thankYouPageUrl: string;
|
|
18
19
|
isDefault: boolean;
|
|
19
20
|
operationalCost: OperationalCostType;
|
|
20
21
|
productGroups?: SelectItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSetControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/ProductSetControl.tsx"],"names":[],"mappings":";AAKA,OAAO,EAIL,mBAAmB,EACnB,cAAc,EACf,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,mEAAmE,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductSetControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/ProductSetControl.tsx"],"names":[],"mappings":";AAKA,OAAO,EAIL,mBAAmB,EACnB,cAAc,EACf,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,mEAAmE,CAAC;AAIhG,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAIL,4BAA4B,EAC7B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAShC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAA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BAAiB,EACjB,eAAe,GAChB,EAAE,sBAAsB,eAyPxB"}
|
|
@@ -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=e(require("react")),a=require("react-i18next"),n=require("react-bootstrap"),o=require("react-hook-form"),
|
|
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=e(require("react")),a=require("react-i18next"),n=require("react-bootstrap"),o=require("react-hook-form"),l=e(require("@licklist/plugins/dist/services/Form/HookFormService")),i=require("@react-aria/utils"),s=e(require("clsx")),m=require("../../static/WarningMessage.js");require("../../static/index.js");var c,u=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),d=require("@licklist/plugins/dist/validation/Rules/urlRule"),p=(e(d),require("./DateAndRecurrenceInput.js")),E=require("./TutorialGifCard.js"),g=require("../form/StepsControl.js"),v=require("../../typeahead/Typeahead.js"),T=((c={})[u.OPERATIONAL_COST_PROVIDER]="operationalCostProvider",c[u.OPERATIONAL_COST_CUSTOMER]="operationalCostCustomer",c);exports.ProductSetControl=function(e){var c,f=e.companyName,C=e.isLoading,h=e.fee,F=void 0===h?"5%":h,P=e.fieldSets,O=void 0===P?[]:P,S=e.emailTemplates,D=void 0===S?[]:S,_=e.smsTemplates,b=void 0===_?[]:_,A=e.isEventEditProductSet,I=e.isCreateAction,N=e.showEmailTemplate,q=e.showSmsTemplate,R=a.useTranslation(["Design","Validation","Notification"]).t,k=o.useFormContext(),L=k.register,y=k.control,x=k.formState.errors,M=k.watch,Y=k.setError,j=k.clearErrors,U=M("steps"),V=i.useId(),G=i.useId();return r.createElement(n.Row,{className:"product-set-form ".concat(A&&"event-edit-product-set")},r.createElement(n.Col,{md:6,sm:12,className:"pr-5"},r.createElement(n.Form.Group,{controlId:V},r.createElement(n.Form.Label,null,R("Design:name"),"*"),r.createElement(n.Form.Control,t.__assign({},L("name",{required:R("Validation:fieldRequired",{attribute:R("name")}),maxLength:255,validate:function(){var e;return U.length?(null===(e=x.steps)||void 0===e?void 0:e.type)===l.manualErrorType&&j("steps"):Y("steps",{type:l.manualErrorType,message:R("Validation:fieldMinNumber",{attribute:R("steps"),min:1})}),!0}}),{placeholder:R("Design:placeholderProductSetName"),isInvalid:Boolean(x.name)})),r.createElement(n.Form.Control.Feedback,{type:"invalid"},null===(c=x.name)||void 0===c?void 0:c.message)),I&&r.createElement(p.DateAndRecurrenceInput,{isEventEditProductSet:A}),r.createElement("div",{className:"divider"}),r.createElement(E.default,null),r.createElement(g.StepsControl,{isLoading:C})),r.createElement(n.Col,{md:6,sm:12},r.createElement("div",{className:"second-column"},r.createElement(n.Form.Group,null,r.createElement(n.Form.Label,{className:"mb-0"},R("Design:operationalCost")),r.createElement("div",{className:"d-flex"},r.createElement("span",{className:"booking-fee-text"},R("bookingFeePaid",{fee:F}))),r.createElement(n.Form.Control,t.__assign({},L("operationalCost",{required:!0}),{as:"select",defaultValue:u.OPERATIONAL_COST_PROVIDER}),Object.keys(u.OPERATIONAL_COST_TYPES).map((function(e){return r.createElement("option",{value:u.OPERATIONAL_COST_TYPES[e],key:u.OPERATIONAL_COST_TYPES[e]},R(T[u.OPERATIONAL_COST_TYPES[e]],{companyName:f}))})))),r.createElement(n.Form.Group,{controlId:G},r.createElement(n.Form.Label,null,R("Design:termsAndConditions")),r.createElement(n.Form.Control,t.__assign({},L("termsAndConditions"),{as:"textarea",rows:2,disabled:C}))),r.createElement(n.Form.Group,null,r.createElement(n.Form.Label,{className:"mt-4"},R("Design:emailTemplate")),N?r.createElement(v.Typeahead,{name:"emailTemplates",options:D,isMultipleChoise:!0,placeholder:R("Design:choose"),noOptionsMessage:R("Design:noActiveTemplates",{notification:R("Design:email")})}):r.createElement(m.default,{message:R("Design:noActiveTemplates",{notification:R("Design:email")})}),r.createElement(n.Form.Label,{className:s(D.length>0?"mt-4":"mt-1")},R("Design:smsTemplate")),q?r.createElement(v.Typeahead,{name:"smsTemplates",options:b,isMultipleChoise:!0,placeholder:R("Design:choose"),noOptionsMessage:R("Design:noActiveTemplates",{notification:R("Design:sms")})}):r.createElement(m.default,{message:R("Design:noActiveTemplates",{notification:R("Design:sms")})})),r.createElement(n.Form.Group,null,r.createElement(o.Controller,{control:y,name:"fieldSetId",render:function(e){var t=e.field,a=String(t.value);return r.createElement(r.Fragment,null,r.createElement(n.Form.Label,null,R("Design:customFields")),r.createElement(n.Form.Control,{onChange:t.onChange,as:"select"},r.createElement("option",{value:"",selected:""===a},R("Design:choose")),null==O?void 0:O.map((function(e){var t=String(e.id);return r.createElement("option",{value:e.id,key:e.id,selected:a===t},e.name)}))))}})),r.createElement(n.Form.Group,{controlId:"thankYouPageUrlId"},r.createElement(n.Form.Label,null,R("thankYouPageUrl")),r.createElement(n.Form.Control,t.__assign({},L("thankYouPageUrl",{validate:function(e){return!e||(!!d.ruleForUrlWithProtocol.test(e)||R("Validation:fieldValidWebURL",{attribute:R("thankYouPageUrl")}))}}),{isInvalid:l.isInvalid("thankYouPageUrl",x)})),r.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("thankYouPageUrl",x))))))};
|
package/package.json
CHANGED
|
@@ -15,6 +15,7 @@ export const getDefaultValues = (
|
|
|
15
15
|
type: productSet?.type ?? DEFAULT_PRODUCT_SET_TYPE,
|
|
16
16
|
termsAndConditions: productSet?.termsAndConditions ?? "",
|
|
17
17
|
operationalCost: productSet?.operationalCost ?? DEFAULT_OPERATIONAL_COST_TYPE,
|
|
18
|
+
thankYouPageUrl: productSet?.thankYouPageUrl ?? "",
|
|
18
19
|
isDefault: productSet?.isDefault ?? false,
|
|
19
20
|
fieldSetId: productSet?.fieldSetId,
|
|
20
21
|
emailTemplates:
|
|
@@ -15,6 +15,7 @@ import { FieldSet } from "@licklist/core/dist/DataMapper/Order/FieldSetDataMappe
|
|
|
15
15
|
import { EmailTemplate } from "@licklist/core/dist/DataMapper/Notification/EmailTemplateDataMapper";
|
|
16
16
|
import { SmsTemplate } from "@licklist/core/dist/DataMapper/Notification/SmsTemplateDataMapper";
|
|
17
17
|
import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
|
|
18
|
+
import { ruleForUrlWithProtocol } from "@licklist/plugins/dist/validation/Rules/urlRule";
|
|
18
19
|
import { WarningMessage } from "../../static";
|
|
19
20
|
import { SelectItem } from "../../types/generic/SelectItem";
|
|
20
21
|
import {
|
|
@@ -43,6 +44,7 @@ export interface ProductSetControlValues extends DateAndRecurrenceInputValues {
|
|
|
43
44
|
name: string;
|
|
44
45
|
type: ProductSetType;
|
|
45
46
|
termsAndConditions: string;
|
|
47
|
+
thankYouPageUrl: string;
|
|
46
48
|
isDefault: boolean;
|
|
47
49
|
operationalCost: OperationalCostType;
|
|
48
50
|
productGroups?: SelectItem[];
|
|
@@ -307,6 +309,27 @@ export function ProductSetControl({
|
|
|
307
309
|
}}
|
|
308
310
|
/>
|
|
309
311
|
</Form.Group>
|
|
312
|
+
|
|
313
|
+
<Form.Group controlId="thankYouPageUrlId">
|
|
314
|
+
<Form.Label>{t("thankYouPageUrl")}</Form.Label>
|
|
315
|
+
|
|
316
|
+
<Form.Control
|
|
317
|
+
{...register("thankYouPageUrl", {
|
|
318
|
+
validate: (url) => {
|
|
319
|
+
if (!url) return true;
|
|
320
|
+
if (ruleForUrlWithProtocol.test(url as string)) return true;
|
|
321
|
+
return t("Validation:fieldValidWebURL", {
|
|
322
|
+
attribute: t("thankYouPageUrl"),
|
|
323
|
+
}) as string;
|
|
324
|
+
},
|
|
325
|
+
})}
|
|
326
|
+
isInvalid={HookFormService.isInvalid("thankYouPageUrl", errors)}
|
|
327
|
+
/>
|
|
328
|
+
|
|
329
|
+
<Form.Control.Feedback type="invalid">
|
|
330
|
+
{HookFormService.getErrors("thankYouPageUrl", errors)}
|
|
331
|
+
</Form.Control.Feedback>
|
|
332
|
+
</Form.Group>
|
|
310
333
|
</div>
|
|
311
334
|
</Col>
|
|
312
335
|
</Row>
|