@licklist/design 0.44.486-dev.80 → 0.44.486-dev.82

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ProductSetControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/ProductSetControl.tsx"],"names":[],"mappings":";AAKA,OAAO,EAOL,mBAAmB,EACnB,cAAc,EAEd,gBAAgB,EACjB,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;AAGhG,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAEtF,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAIL,4BAA4B,EAC7B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAehC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,aAAa,GAAG,WAAW,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAwB,SAAQ,4BAA4B;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,cAAc,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,mBAAmB,CAAC;IACrC,aAAa,CAAC,EAAE,UAAU,EAAE,CAAC;IAC7B,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,4BAA4B,CAAC,EAAE,OAAO,CAAC;CACxC;AAED,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,SAAS,EACT,GAAU,EACV,SAAc,EACd,cAAmB,EACnB,YAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,4BAAoC,GACrC,EAAE,sBAAsB,eAuQxB"}
1
+ {"version":3,"file":"ProductSetControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/ProductSetControl.tsx"],"names":[],"mappings":";AAKA,OAAO,EAOL,mBAAmB,EACnB,cAAc,EAEd,gBAAgB,EACjB,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;AAGhG,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAEtF,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAIL,4BAA4B,EAC7B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAehC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,aAAa,GAAG,WAAW,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAwB,SAAQ,4BAA4B;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,cAAc,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,mBAAmB,CAAC;IACrC,aAAa,CAAC,EAAE,UAAU,EAAE,CAAC;IAC7B,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,4BAA4B,CAAC,EAAE,OAAO,CAAC;CACxC;AAED,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,SAAS,EACT,GAAU,EACV,SAAc,EACd,cAAmB,EACnB,YAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,4BAAoC,GACrC,EAAE,sBAAsB,eA6RxB"}
@@ -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"),a=e(require("react")),r=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,d=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),E=require("@licklist/plugins/dist/validation/Rules/urlRule"),p=(e(E),require("./DateAndRecurrenceInput.js")),g=require("./TutorialGifCard.js"),P=require("../form/StepsControl.js"),T=require("../../typeahead/Typeahead.js"),_=((c={})[d.OPERATIONAL_COST_PROVIDER]="operationalCostProvider",c[d.OPERATIONAL_COST_CUSTOMER]="operationalCostCustomer",c),v=((u={})[d.RELY_ON_PEOPLE_PRODUCT_CAPACITY_QUANTITY]="peopleProductCapacityQuantity",u[d.RELY_ON_PEOPLE_PRODUCT_QUANTITY]="peopleProductQuantity",u[d.RELY_ON_PEOPLE_QUANTITY]="peopleQuantity",u);exports.ProductSetControl=function(e){var c,u=e.companyName,O=e.isLoading,C=e.fee,f=void 0===C?"5%":C,L=e.fieldSets,F=void 0===L?[]:L,N=e.emailTemplates,h=void 0===N?[]:N,R=e.smsTemplates,A=void 0===R?[]:R,S=e.isEventEditProductSet,y=e.isCreateAction,D=e.showEmailTemplate,I=e.showSmsTemplate,b=e.workHours,Y=e.providerHasBookingManagement,k=void 0!==Y&&Y,q=r.useTranslation(["Design","Validation","Notification"]).t,U=o.useFormContext(),M=U.register,j=U.control,x=U.formState.errors,V=U.watch,G=U.setError,w=U.clearErrors,Q=V("steps"),H=i.useId(),B=i.useId(),W=i.useId();return a.createElement(n.Row,{className:"product-set-form ".concat(S&&"event-edit-product-set")},a.createElement(n.Col,{md:6,sm:12,className:"pr-5"},a.createElement(n.Form.Group,{controlId:H},a.createElement(n.Form.Label,null,q("Design:name"),"*"),a.createElement(n.Form.Control,t.__assign({},M("name",{required:q("Validation:fieldRequired",{attribute:q("name")}),maxLength:255,validate:function(){var e;return Q.length?(null===(e=x.steps)||void 0===e?void 0:e.type)===l.manualErrorType&&w("steps"):G("steps",{type:l.manualErrorType,message:q("Validation:fieldMinNumber",{attribute:q("steps"),min:1})}),!0}}),{placeholder:q("Design:placeholderProductSetName"),isInvalid:Boolean(x.name)})),a.createElement(n.Form.Control.Feedback,{type:"invalid"},null===(c=x.name)||void 0===c?void 0:c.message)),y&&a.createElement(p.DateAndRecurrenceInput,{isEventEditProductSet:S,workHours:b,isLoading:O,providerHasBookingManagement:k}),a.createElement("div",{className:"divider"}),a.createElement(g.default,null),a.createElement(P.StepsControl,{isLoading:O})),a.createElement(n.Col,{md:6,sm:12},a.createElement("div",{className:"second-column"},a.createElement(n.Form.Group,null,a.createElement(n.Form.Label,{className:"mb-0"},q("Design:operationalCost")),a.createElement("div",{className:"d-flex"},a.createElement("span",{className:"booking-fee-text"},q("bookingFeePaid",{fee:f}))),a.createElement(n.Form.Control,t.__assign({},M("operationalCost",{required:!0}),{as:"select",defaultValue:d.OPERATIONAL_COST_PROVIDER}),Object.keys(d.OPERATIONAL_COST_TYPES).map((function(e){return a.createElement("option",{value:d.OPERATIONAL_COST_TYPES[e],key:d.OPERATIONAL_COST_TYPES[e]},q(_[d.OPERATIONAL_COST_TYPES[e]],{companyName:u}))})))),a.createElement(n.Form.Group,{controlId:W},a.createElement(n.Form.Label,null,q("peopleQuantityType")),a.createElement(n.Form.Control,t.__assign({},M("relyOnPeopleType"),{as:"select",defaultValue:null}),a.createElement("option",{value:""},q("notRequired")),Object.keys(d.RELY_ON_PEOPLE_TYPES).map((function(e){return a.createElement("option",{value:d.RELY_ON_PEOPLE_TYPES[e],key:d.RELY_ON_PEOPLE_TYPES[e]},q(v[d.RELY_ON_PEOPLE_TYPES[e]]))})))),a.createElement(n.Form.Group,{controlId:B},a.createElement(n.Form.Label,null,q("Design:termsAndConditions")),a.createElement(n.Form.Control,t.__assign({},M("termsAndConditions"),{as:"textarea",rows:2,disabled:O}))),a.createElement(n.Form.Group,null,a.createElement(n.Form.Label,{className:"mt-4"},q("Design:emailTemplate")),D?a.createElement(T.Typeahead,{name:"emailTemplates",options:h,isMultipleChoise:!0,placeholder:q("Design:choose"),noOptionsMessage:q("Design:noActiveTemplates",{notification:q("Design:email")})}):a.createElement(m.default,{message:q("Design:noActiveTemplates",{notification:q("Design:email")})}),a.createElement(n.Form.Label,{className:s(h.length>0?"mt-4":"mt-1")},q("Design:smsTemplate")),I?a.createElement(T.Typeahead,{name:"smsTemplates",options:A,isMultipleChoise:!0,placeholder:q("Design:choose"),noOptionsMessage:q("Design:noActiveTemplates",{notification:q("Design:sms")})}):a.createElement(m.default,{message:q("Design:noActiveTemplates",{notification:q("Design:sms")})})),a.createElement(n.Form.Group,null,a.createElement(o.Controller,{control:j,name:"fieldSetId",render:function(e){var t=e.field,r=Number(t.value);return a.createElement(a.Fragment,null,a.createElement(n.Form.Label,null,q("Design:customFields")),a.createElement(n.Form.Control,{onChange:t.onChange,value:r,as:"select"},a.createElement("option",{value:""},q("Design:choose")),null==F?void 0:F.map((function(e){return a.createElement("option",{value:e.id,key:e.id},e.name)}))))}})),a.createElement(n.Form.Group,{controlId:"thankYouPageUrlId"},a.createElement(n.Form.Label,null,q("thankYouPageUrl")),a.createElement(n.Form.Control,t.__assign({},M("thankYouPageUrl",{validate:function(e){return!e||(!!E.ruleForUrlWithProtocol.test(e)||q("Validation:fieldValidWebURL",{attribute:q("thankYouPageUrl")}))}}),{isInvalid:l.isInvalid("thankYouPageUrl",x)})),a.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("thankYouPageUrl",x))))))};
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,d,u=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),p=require("@licklist/plugins/dist/validation/Rules/urlRule"),E=(e(p),require("./DateAndRecurrenceInput.js")),g=require("./TutorialGifCard.js"),v=require("../form/StepsControl.js"),P=require("../../typeahead/Typeahead.js"),T=((c={})[u.OPERATIONAL_COST_PROVIDER]="operationalCostProvider",c[u.OPERATIONAL_COST_CUSTOMER]="operationalCostCustomer",c),_=((d={})[u.RELY_ON_PEOPLE_PRODUCT_CAPACITY_QUANTITY]="peopleProductCapacityQuantity",d[u.RELY_ON_PEOPLE_PRODUCT_QUANTITY]="peopleProductQuantity",d[u.RELY_ON_PEOPLE_QUANTITY]="peopleQuantity",d);exports.ProductSetControl=function(e){var c,d=e.companyName,C=e.isLoading,O=e.fee,F=void 0===O?"5%":O,f=e.fieldSets,I=void 0===f?[]:f,y=e.emailTemplates,L=void 0===y?[]:y,N=e.smsTemplates,b=void 0===N?[]:N,A=e.isEventEditProductSet,S=e.isCreateAction,h=e.showEmailTemplate,R=e.showSmsTemplate,k=e.workHours,D=e.providerHasBookingManagement,Y=void 0!==D&&D,q=a.useTranslation(["Design","Validation","Notification"]).t,U=o.useFormContext(),M=U.register,j=U.control,x=U.formState.errors,V=U.watch,G=U.setError,w=U.clearErrors,Q=V("steps"),H=i.useId(),B=i.useId(),W=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:H},r.createElement(n.Form.Label,null,q("Design:name"),"*"),r.createElement(n.Form.Control,t.__assign({},M("name",{required:q("Validation:fieldRequired",{attribute:q("name")}),maxLength:255,validate:function(){var e;return Q.length?(null===(e=x.steps)||void 0===e?void 0:e.type)===l.manualErrorType&&w("steps"):G("steps",{type:l.manualErrorType,message:q("Validation:fieldMinNumber",{attribute:q("steps"),min:1})}),!0}}),{placeholder:q("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)),S&&r.createElement(E.DateAndRecurrenceInput,{isEventEditProductSet:A,workHours:k,isLoading:C,providerHasBookingManagement:Y}),r.createElement("div",{className:"divider"}),r.createElement(g.default,null),r.createElement(v.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"},q("Design:operationalCost")),r.createElement("div",{className:"d-flex"},r.createElement("span",{className:"booking-fee-text"},q("bookingFeePaid",{fee:F}))),r.createElement(n.Form.Control,t.__assign({},M("operationalCost",{required:!0}),{as:"select",defaultValue:u.OPERATIONAL_COST_PROVIDER,isInvalid:l.isInvalid("operationalCost",x)}),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]},q(T[u.OPERATIONAL_COST_TYPES[e]],{companyName:d}))}))),r.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("operationalCost",x))),r.createElement(n.Form.Group,{controlId:W},r.createElement(n.Form.Label,null,q("peopleQuantityType")),r.createElement(n.Form.Control,t.__assign({},M("relyOnPeopleType"),{as:"select",defaultValue:null,isInvalid:l.isInvalid("relyOnPeopleType",x)}),r.createElement("option",{value:""},q("notRequired")," "),Object.keys(u.RELY_ON_PEOPLE_TYPES).map((function(e){return r.createElement("option",{value:u.RELY_ON_PEOPLE_TYPES[e],key:u.RELY_ON_PEOPLE_TYPES[e]},q(_[u.RELY_ON_PEOPLE_TYPES[e]]))}))),r.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("relyOnPeopleType",x))),r.createElement(n.Form.Group,{controlId:B},r.createElement(n.Form.Label,null,q("Design:termsAndConditions")),r.createElement(n.Form.Control,t.__assign({},M("termsAndConditions"),{as:"textarea",rows:2,disabled:C,isInvalid:l.isInvalid("termsAndConditions",x)})),r.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("termsAndConditions",x))),r.createElement(n.Form.Group,null,r.createElement(n.Form.Label,{className:"mt-4"},q("Design:emailTemplate")),h?r.createElement(P.Typeahead,{name:"emailTemplates",options:L,isMultipleChoise:!0,placeholder:q("Design:choose"),noOptionsMessage:q("Design:noActiveTemplates",{notification:q("Design:email")})}):r.createElement(m.default,{message:q("Design:noActiveTemplates",{notification:q("Design:email")})}),r.createElement(n.Form.Label,{className:s(L.length>0?"mt-4":"mt-1")},q("Design:smsTemplate")),R?r.createElement(P.Typeahead,{name:"smsTemplates",options:b,isMultipleChoise:!0,placeholder:q("Design:choose"),noOptionsMessage:q("Design:noActiveTemplates",{notification:q("Design:sms")})}):r.createElement(m.default,{message:q("Design:noActiveTemplates",{notification:q("Design:sms")})})),r.createElement(n.Form.Group,null,r.createElement(o.Controller,{control:j,name:"fieldSetId",render:function(e){var t=e.field,a=Number(t.value);return r.createElement(r.Fragment,null,r.createElement(n.Form.Label,null,q("Design:customFields")),r.createElement(n.Form.Control,{onChange:t.onChange,value:a,as:"select",isInvalid:l.isInvalid("fieldSetId",x)},r.createElement("option",{value:""},q("Design:choose")),null==I?void 0:I.map((function(e){return r.createElement("option",{value:e.id,key:e.id},e.name)}))),r.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("fieldSetId",x)))}})),r.createElement(n.Form.Group,{controlId:"thankYouPageUrlId"},r.createElement(n.Form.Label,null,q("thankYouPageUrl")),r.createElement(n.Form.Control,t.__assign({},M("thankYouPageUrl",{validate:function(e){return!e||(!!p.ruleForUrlWithProtocol.test(e)||q("Validation:fieldValidWebURL",{attribute:q("thankYouPageUrl")}))}}),{isInvalid:l.isInvalid("thankYouPageUrl",x)})),r.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("thankYouPageUrl",x))))))};
@@ -1,8 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { Order } from "@licklist/core/dist/DataMapper/Order/OrderDataMapper";
3
+ import { User } from "@licklist/core/dist/DataMapper/User/UserDataMapper";
3
4
  export type BookingResultsProps = {
4
5
  orders?: Order[] | null;
5
6
  onCardClick?: (id: number) => void;
7
+ staffMembers?: User[] | null;
6
8
  };
7
- export declare const BookingResults: ({ orders, onCardClick, }: BookingResultsProps) => JSX.Element;
9
+ export declare const BookingResults: ({ orders, onCardClick, staffMembers, }: BookingResultsProps) => JSX.Element;
8
10
  //# sourceMappingURL=BookingResults.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BookingResults.d.ts","sourceRoot":"","sources":["../../../../src/sales/booking/results/BookingResults.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAI7E,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,cAAc,6BAGxB,mBAAmB,gBA2BrB,CAAC"}
1
+ {"version":3,"file":"BookingResults.d.ts","sourceRoot":"","sources":["../../../../src/sales/booking/results/BookingResults.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAC;AAI1E,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,cAAc,2CAIxB,mBAAmB,gBA+BrB,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),t=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,n=require("react-i18next"),s=require("./components/ResultCard.js"),o=require("./constants.js");exports.BookingResults=function(e){var r=e.orders,l=e.onCardClick,a=n.useTranslation("Design").t;return t.createElement("div",{className:"booking-results"},0===(null==r?void 0:r.length)?t.createElement("p",null,a("noBookingOrdersWereFound")):t.createElement("div",{className:"booking-results-wrapper"},null==r?void 0:r.map((function(e,r){return t.createElement(s.ResultCard,{key:e.id,order:e,className:o.BACKGROUND_COLOR_CLASSNAMES[r%o.BACKGROUND_COLOR_CLASSNAMES.length],onCardClick:l})}))))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),t=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,n=require("react-i18next"),a=require("./components/ResultCard.js"),o=require("./constants.js");exports.BookingResults=function(e){var r=e.orders,l=e.onCardClick,s=e.staffMembers,i=n.useTranslation("Design").t;return t.createElement("div",{className:"booking-results"},0===(null==r?void 0:r.length)?t.createElement("p",null,i("noBookingOrdersWereFound")):t.createElement("div",{className:"booking-results-wrapper"},null==r?void 0:r.map((function(e,r){var n=null==s?void 0:s.find((function(r){var t;return r.id===(null===(t=null==e?void 0:e.orderMetadata)||void 0===t?void 0:t.created_by)}));return t.createElement(a.ResultCard,{key:e.id,order:e,staffMember:n,className:o.BACKGROUND_COLOR_CLASSNAMES[r%o.BACKGROUND_COLOR_CLASSNAMES.length],onCardClick:l})}))))};
@@ -1,9 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { Order } from "@licklist/core/dist/DataMapper/Order/OrderDataMapper";
3
+ import { User } from "@licklist/core/dist/DataMapper/User/UserDataMapper";
3
4
  export type ResultCardProps = {
4
5
  className: string;
5
6
  order: Order;
7
+ staffMember?: User;
6
8
  onCardClick?: (id: number) => void;
7
9
  };
8
- export declare const ResultCard: ({ order, className, onCardClick, }: ResultCardProps) => JSX.Element;
10
+ export declare const ResultCard: ({ order, className, staffMember, onCardClick, }: ResultCardProps) => JSX.Element;
9
11
  //# sourceMappingURL=ResultCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResultCard.d.ts","sourceRoot":"","sources":["../../../../../src/sales/booking/results/components/ResultCard.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAO7E,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAIF,eAAO,MAAM,UAAU,uCAIpB,eAAe,gBA+DjB,CAAC"}
1
+ {"version":3,"file":"ResultCard.d.ts","sourceRoot":"","sources":["../../../../../src/sales/booking/results/components/ResultCard.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAC;AAS1E,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAIF,eAAO,MAAM,UAAU,oDAKpB,eAAe,gBAkFjB,CAAC"}
@@ -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=e(require("react")),r=require("@licklist/core/dist/Config"),l=require("react-i18next"),a=require("../../../../static/Icon.js"),n=e(require("clsx")),i=require("luxon"),u=require("react-intl"),c=require("@licklist/plugins/dist/utils/formatDate"),s=require("@licklist/plugins/dist/utils/sourceTitle");exports.ResultCard=function(e){var o,m,d,p=e.order,E=e.className,f=e.onCardClick,v=l.useTranslation("Design").t,N=u.useIntl().formatNumber,q=p.id,y=p.people,g=p.user,D=p.status,x=p.startDate,C=p.products,T=p.source,b=p.totalAmount,h=(null===(o=C.map((function(e){return e.name})))||void 0===o?void 0:o.join(", "))||"",k=function(){f&&f(q)};return t.createElement("div",{className:n("result-card",E),onClick:k,onKeyUp:k,role:"button",tabIndex:0},t.createElement("div",{className:"card-content"},t.createElement("div",{className:"order-id"},q),t.createElement("div",{className:"order-people"},t.createElement(a.default,{type:"user",width:"10",height:"11"}),y),t.createElement("div",{className:"order-description"},t.createElement("p",{className:"name"},g.firstName," ",g.lastName),g.email&&t.createElement("p",null,g.email),(null===(m=g.userDetail)||void 0===m?void 0:m.phone)&&t.createElement("p",null,null===(d=g.userDetail)||void 0===d?void 0:d.phone),t.createElement("p",null,"------"),t.createElement("p",null,v("activity"),": "),t.createElement("p",null,v("staff"),": "),t.createElement("p",null,v("status"),": ",v(D)),t.createElement("p",null,v("date"),": ",c.formatDateStringForEvent(x,!1)),t.createElement("p",null,v("time"),": ",i.DateTime.fromISO(x).toFormat(r.TIME_FORMAT)),t.createElement("p",{className:"products",title:h},v("products"),": ",h),t.createElement("p",null,v("totalAmount"),":"," ",N(b,{style:"currency",currency:r.Currency.GBP})),t.createElement("p",null,v("source"),": ",v(s.getOrderSourceTitle(T))))))};
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("@licklist/core/dist/Config"),l=require("react-i18next"),a=require("../../../../static/Icon.js"),n=e(require("clsx")),i=require("luxon"),c=require("react-intl"),u=require("@licklist/core/dist/DataMapper/Order/OrderDataMapper"),s=require("@licklist/plugins/dist/utils/formatDate"),o=require("@licklist/plugins/dist/utils/sourceTitle");exports.ResultCard=function(e){var m,d,p,E=e.order,f=e.className,v=e.staffMember,N=e.onCardClick,q=l.useTranslation("Design").t,D=c.useIntl().formatNumber,y=E.id,O=E.people,g=E.user,C=E.status,M=E.startDate,b=E.products,k=E.source,x=E.totalAmount,T=E.event,h=E.menu,A=(null===(m=b.map((function(e){return e.name})))||void 0===m?void 0:m.join(", "))||"",I=(null==T?void 0:T.name)||(null==h?void 0:h.name)||"",R=function(){N&&N(y)};return t.createElement("div",{className:n("result-card",f),onClick:R,onKeyUp:R,role:"button",tabIndex:0},t.createElement("div",{className:"card-content"},t.createElement("div",{className:"order-id"},y),t.createElement("div",{className:"order-people"},t.createElement(a.default,{type:"user",width:"10",height:"11"}),O),t.createElement("div",{className:"order-description"},t.createElement("p",{className:"name"},g.firstName," ",g.lastName),g.email&&t.createElement("p",null,g.email),(null===(d=g.userDetail)||void 0===d?void 0:d.phone)&&t.createElement("p",null,null===(p=g.userDetail)||void 0===p?void 0:p.phone),t.createElement("p",null,"------"),t.createElement("p",null,q("activity"),": ",I," "),k===u.ORDER_SOURCE_MANUAL&&v&&t.createElement("p",null,q("staff"),": ","".concat(v.firstName," ").concat(v.lastName)),t.createElement("p",null,q("status"),": ",q(C)),t.createElement("p",null,q("date"),": ",s.formatDateStringForEvent(M,!1)),t.createElement("p",null,q("time"),": ",i.DateTime.fromISO(M).toFormat(r.TIME_FORMAT)),t.createElement("p",{className:"products",title:A},q("products"),": ",A),t.createElement("p",null,q("totalAmount"),":"," ",D(x,{style:"currency",currency:r.Currency.GBP})),t.createElement("p",null,q("source"),": ",q(o.getOrderSourceTitle(k))))))};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.486-dev.80",
3
+ "version": "0.44.486-dev.82",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -212,6 +212,7 @@ export function ProductSetControl({
212
212
  {...register("operationalCost", { required: true })}
213
213
  as="select"
214
214
  defaultValue={OPERATIONAL_COST_PROVIDER}
215
+ isInvalid={HookFormService.isInvalid("operationalCost", errors)}
215
216
  >
216
217
  {Object.keys(OPERATIONAL_COST_TYPES).map((operationalCost) => (
217
218
  <option
@@ -229,6 +230,9 @@ export function ProductSetControl({
229
230
  </option>
230
231
  ))}
231
232
  </Form.Control>
233
+ <Form.Control.Feedback type="invalid">
234
+ {HookFormService.getErrors("operationalCost", errors)}
235
+ </Form.Control.Feedback>
232
236
  </Form.Group>
233
237
 
234
238
  <Form.Group controlId={relyOnPeopleTypeId}>
@@ -237,8 +241,9 @@ export function ProductSetControl({
237
241
  {...register("relyOnPeopleType")}
238
242
  as="select"
239
243
  defaultValue={null}
244
+ isInvalid={HookFormService.isInvalid("relyOnPeopleType", errors)}
240
245
  >
241
- <option value="">{t("notRequired")}</option>
246
+ <option value="">{t("notRequired")} </option>
242
247
  {Object.keys(RELY_ON_PEOPLE_TYPES).map((relyOnPeopleType) => (
243
248
  <option
244
249
  value={RELY_ON_PEOPLE_TYPES[relyOnPeopleType]}
@@ -252,6 +257,9 @@ export function ProductSetControl({
252
257
  </option>
253
258
  ))}
254
259
  </Form.Control>
260
+ <Form.Control.Feedback type="invalid">
261
+ {HookFormService.getErrors("relyOnPeopleType", errors)}
262
+ </Form.Control.Feedback>
255
263
  </Form.Group>
256
264
 
257
265
  <Form.Group controlId={termsAndConditionsId}>
@@ -261,7 +269,14 @@ export function ProductSetControl({
261
269
  as="textarea"
262
270
  rows={2}
263
271
  disabled={isLoading}
272
+ isInvalid={HookFormService.isInvalid(
273
+ "termsAndConditions",
274
+ errors
275
+ )}
264
276
  />
277
+ <Form.Control.Feedback type="invalid">
278
+ {HookFormService.getErrors("termsAndConditions", errors)}
279
+ </Form.Control.Feedback>
265
280
  </Form.Group>
266
281
 
267
282
  <Form.Group>
@@ -324,6 +339,10 @@ export function ProductSetControl({
324
339
  onChange={field.onChange}
325
340
  value={fieldValue}
326
341
  as="select"
342
+ isInvalid={HookFormService.isInvalid(
343
+ "fieldSetId",
344
+ errors
345
+ )}
327
346
  >
328
347
  <option value="">{t("Design:choose")}</option>
329
348
  {fieldSets?.map((fieldSet) => {
@@ -334,6 +353,9 @@ export function ProductSetControl({
334
353
  );
335
354
  })}
336
355
  </Form.Control>
356
+ <Form.Control.Feedback type="invalid">
357
+ {HookFormService.getErrors("fieldSetId", errors)}
358
+ </Form.Control.Feedback>
337
359
  </>
338
360
  );
339
361
  }}
@@ -1,17 +1,20 @@
1
1
  import React from "react";
2
2
  import { useTranslation } from "react-i18next";
3
3
  import { Order } from "@licklist/core/dist/DataMapper/Order/OrderDataMapper";
4
+ import { User } from "@licklist/core/dist/DataMapper/User/UserDataMapper";
4
5
  import { ResultCard } from "./components/ResultCard";
5
6
  import { BACKGROUND_COLOR_CLASSNAMES } from "./constants";
6
7
 
7
8
  export type BookingResultsProps = {
8
9
  orders?: Order[] | null;
9
10
  onCardClick?: (id: number) => void;
11
+ staffMembers?: User[] | null;
10
12
  };
11
13
 
12
14
  export const BookingResults = ({
13
15
  orders,
14
16
  onCardClick,
17
+ staffMembers,
15
18
  }: BookingResultsProps) => {
16
19
  const { t } = useTranslation("Design");
17
20
 
@@ -22,10 +25,14 @@ export const BookingResults = ({
22
25
  ) : (
23
26
  <div className="booking-results-wrapper">
24
27
  {orders?.map((order, index) => {
28
+ const staffMember = staffMembers?.find(
29
+ (staff) => staff.id === order?.orderMetadata?.created_by
30
+ );
25
31
  return (
26
32
  <ResultCard
27
33
  key={order.id}
28
34
  order={order}
35
+ staffMember={staffMember}
29
36
  className={
30
37
  BACKGROUND_COLOR_CLASSNAMES[
31
38
  index % BACKGROUND_COLOR_CLASSNAMES.length
@@ -4,15 +4,19 @@ import { useTranslation } from "react-i18next";
4
4
  import { DateTime } from "luxon";
5
5
  import { useIntl } from "react-intl";
6
6
  import { Order } from "@licklist/core/dist/DataMapper/Order/OrderDataMapper";
7
+ import { User } from "@licklist/core/dist/DataMapper/User/UserDataMapper";
7
8
  import { TIME_FORMAT } from "@licklist/core/dist/Config";
8
9
  import * as Config from "@licklist/core/dist/Config";
10
+ import { ORDER_SOURCE_MANUAL } from "@licklist/core/dist/DataMapper/Order/OrderDataMapper";
9
11
  import { formatDateStringForEvent } from "@licklist/plugins/dist/utils/formatDate";
10
12
  import { getOrderSourceTitle } from "@licklist/plugins/dist/utils/sourceTitle";
13
+
11
14
  import Icon from "../../../../static/Icon";
12
15
 
13
16
  export type ResultCardProps = {
14
17
  className: string;
15
18
  order: Order;
19
+ staffMember?: User;
16
20
  onCardClick?: (id: number) => void;
17
21
  };
18
22
 
@@ -21,15 +25,29 @@ export type ResultCardProps = {
21
25
  export const ResultCard = ({
22
26
  order,
23
27
  className,
28
+ staffMember,
24
29
  onCardClick,
25
30
  }: ResultCardProps) => {
26
31
  const { t } = useTranslation("Design");
27
32
  const { formatNumber } = useIntl();
28
- const { id, people, user, status, startDate, products, source, totalAmount } =
29
- order;
33
+
34
+ const {
35
+ id,
36
+ people,
37
+ user,
38
+ status,
39
+ startDate,
40
+ products,
41
+ source,
42
+ totalAmount,
43
+ event,
44
+ menu,
45
+ } = order;
30
46
 
31
47
  const productList = products.map((product) => product.name)?.join(", ") || "";
32
48
 
49
+ const activityName = event?.name || menu?.name || "";
50
+
33
51
  const onClick = () => {
34
52
  if (!onCardClick) return;
35
53
 
@@ -57,8 +75,14 @@ export const ResultCard = ({
57
75
  {user.email && <p>{user.email}</p>}
58
76
  {user.userDetail?.phone && <p>{user.userDetail?.phone}</p>}
59
77
  <p>------</p>
60
- <p>{t("activity")}: </p>
61
- <p>{t("staff")}: </p>
78
+ <p>
79
+ {t("activity")}: {activityName}{" "}
80
+ </p>
81
+ {source === ORDER_SOURCE_MANUAL && staffMember && (
82
+ <p>
83
+ {t("staff")}: {`${staffMember.firstName} ${staffMember.lastName}`}
84
+ </p>
85
+ )}
62
86
  <p>
63
87
  {t("status")}: {t(status)}
64
88
  </p>