@licklist/design 0.44.545 → 0.44.547-dev.0
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/availability-indicator/AvailabilityIndicator.js +1 -1
- package/dist/events/event-statistic-modal/utils/index.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/utils/index.js +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +1 -1
- package/dist/sales/booking/results/BookingResults.d.ts +3 -1
- package/dist/sales/booking/results/BookingResults.d.ts.map +1 -1
- package/dist/sales/booking/results/BookingResults.js +1 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts +3 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +1 -1
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/package.json +3 -3
- package/src/availability-indicator/AvailabilityIndicator.tsx +11 -11
- package/src/events/event-statistic-modal/utils/index.ts +47 -37
- package/src/product-set/control/ProductSetControl.tsx +23 -1
- package/src/sales/booking/results/BookingResults.tsx +7 -0
- package/src/sales/booking/results/components/ResultCard.tsx +41 -6
- package/src/styles/sales/BookingResults.scss +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),a=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,l=require("react-i18next"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),a=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,l=require("react-i18next"),n=require("../assets/iframe/available.svg.js"),r=require("../assets/iframe/limited.svg.js"),o=require("../assets/iframe/soldOut.svg.js"),i=function(e){var t=e.Icon,l=e.label;return a.createElement("div",{className:"availability-indicator"},a.createElement(t,null),a.createElement("div",null,l))};exports.AvailabilityIndicator=function(e){var t=e.resources,s=e.isUnavailable,c=e.isSoldOut,u=l.useTranslation("Design").t;if(s)return a.createElement(i,{Icon:o.ReactComponent,label:u("notAvailable")});if(c)return a.createElement(i,{Icon:o.ReactComponent,label:u("soldOut")});var b=function(e){var t=e.bookedResources,a=e.totalResources;return t===a?{label:"soldOut",Icon:o.ReactComponent}:t/a<=.2?{label:"lotsOfSpace",Icon:n.ReactComponent}:t/a>=.8?{label:"limited",Icon:r.ReactComponent}:{label:"available",Icon:n.ReactComponent}}(t),m=b.Icon,v=b.label;return a.createElement(i,{Icon:m,label:u(v)})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/events/event-statistic-modal/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAIlG,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AAEF,eAAO,MAAM,gCAAgC,SACrC,MAAM,kBACI,cAAc;UAUtB,MAAM;SACP,MAAM;eACA,OAAO;aACT,OAAO;cACN,MAAM,GAAG,MAAM;WAClB,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/events/event-statistic-modal/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAIlG,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AAEF,eAAO,MAAM,gCAAgC,SACrC,MAAM,kBACI,cAAc;UAUtB,MAAM;SACP,MAAM;eACA,OAAO;aACT,OAAO;cACN,MAAM,GAAG,MAAM;WAClB,MAAM,GAAG,MAAM;GAsEzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@licklist/core/dist/Config"),o=require("luxon"),a={shortQuantity:"shortQuantity",total:"total",totalPerCategory:"totalPerCategory"};exports.TRANSLATION_KEYS=a,exports.convertEventStatisticToTableData=function(e
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@licklist/core/dist/Config"),o=require("luxon"),a={shortQuantity:"shortQuantity",total:"total",totalPerCategory:"totalPerCategory"};exports.TRANSLATION_KEYS=a,exports.convertEventStatisticToTableData=function(r,e){var n,c,i=0,u=0;if(!e)return[];var l=[],y=o.DateTime.fromISO(r).toUTC().toFormat(t.DATE_FORMAT),s=null!==(c=null===(n=Object.keys(null==e?void 0:e.productCategorySummary))||void 0===n?void 0:n.filter((function(a){return o.DateTime.fromFormat(a,t.DATE_TIME_FULL_FORMAT).toFormat(t.DATE_FORMAT)===y})))&&void 0!==c?c:[];return s.map((function(t){return null==e?void 0:e.productCategorySummary[t]})).forEach((function(t){t.forEach((function(t){var o=t.totalPerCategory,r=t.productsSummary,e=void 0===r?[]:r,n=t.categoryName,c=t.eventId,y=0;i+=o||0,l.push({name:n,key:"".concat(c,".").concat(n),isBold:!0,isHeader:!0,quantity:a.shortQuantity,total:a.total}),null==e||e.forEach((function(t){var o=t.productsSold,a=t.name,r=t.totalQuantity,e=t.total;y+=o,l.push({name:a,key:"".concat(c,".").concat(n,".").concat(a),quantity:r?"".concat(o," / ").concat(r):String(o),total:String(e)})})),l.push({name:a.totalPerCategory,key:"".concat(c,".").concat(n,".").concat(a.totalPerCategory),quantity:y,total:o,isBold:!0}),u+=y}))})),l.push({name:a.total,key:"".concat(a.total,".").concat(i),quantity:u,total:i,isBold:!0}),l};
|
|
@@ -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,
|
|
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"),
|
|
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;
|
|
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"),
|
|
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,
|
|
1
|
+
{"version":3,"file":"ResultCard.d.ts","sourceRoot":"","sources":["../../../../../src/sales/booking/results/components/ResultCard.tsx"],"names":[],"mappings":";AAKA,OAAO,EACL,KAAK,EAEN,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAC;AAQ1E,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,gBA2FjB,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"),
|
|
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,y=e.onCardClick,N=l.useTranslation("Design").t,q=c.useIntl().formatNumber,D=E.id,g=E.people,C=E.user,O=E.status,M=E.startDate,T=E.products,b=E.source,k=E.totalAmount,x=E.event,A=E.menu,h=E.remainingToPay,I=(null===(m=T.map((function(e){return e.name})))||void 0===m?void 0:m.join(", "))||"",R=(null==x?void 0:x.name)||(null==A?void 0:A.name)||"",_=function(){y&&y(D)};return t.createElement("div",{className:n("result-card",f),onClick:_,onKeyUp:_,role:"button",tabIndex:0},t.createElement("div",{className:"card-content"},t.createElement("div",{className:"order-id"},D),t.createElement("div",{className:"order-people"},t.createElement(a.default,{type:"user",width:"10",height:"11"}),g),t.createElement("div",{className:"order-description"},t.createElement("p",{className:"name"},C.firstName," ",C.lastName),C.email&&t.createElement("p",null,C.email),(null===(d=C.userDetail)||void 0===d?void 0:d.phone)&&t.createElement("p",null,null===(p=C.userDetail)||void 0===p?void 0:p.phone),t.createElement("p",null,"------"),t.createElement("p",null,N("activity"),": ",R," "),b===u.ORDER_SOURCE_MANUAL&&v&&t.createElement("p",null,N("staff"),": ","".concat(v.firstName," ").concat(v.lastName)),t.createElement("p",null,N("status"),": ",N(O)),t.createElement("p",null,N("date"),": ",s.formatDateStringForEvent(M,!1)),t.createElement("p",null,N("time"),": ",i.DateTime.fromISO(M).toFormat(r.TIME_FORMAT)),t.createElement("p",{className:"products",title:I},N("products"),": ",I),!!h&&t.createElement("p",null,N("remainingAmount"),":"," ",q(h,{style:"currency",currency:r.Currency.GBP})),t.createElement("p",null,N("paidAmount"),":"," ",q(k,{style:"currency",currency:r.Currency.GBP})),t.createElement("p",null,N("source"),": ",N(o.getOrderSourceTitle(b))))))};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.44.
|
|
3
|
+
"version": "0.44.547-dev.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"@fortawesome/free-brands-svg-icons": "5.15.2",
|
|
54
54
|
"@fortawesome/free-solid-svg-icons": "5.15.2",
|
|
55
55
|
"@fortawesome/react-fontawesome": "0.1.9",
|
|
56
|
-
"@licklist/core": "0.15.
|
|
56
|
+
"@licklist/core": ">=0.15.41-dev.0 < 0.15.41",
|
|
57
57
|
"@licklist/eslint-config": "0.3.4",
|
|
58
|
-
"@licklist/plugins": "0.20.
|
|
58
|
+
"@licklist/plugins": ">=0.20.133-dev.5 < 0.20.133",
|
|
59
59
|
"@mdx-js/react": "1.6.22",
|
|
60
60
|
"@popperjs/core": "2.11.8",
|
|
61
61
|
"@react-aria/utils": "3.9.0",
|
|
@@ -10,7 +10,7 @@ const LIMITED_LIMIT = 0.8;
|
|
|
10
10
|
|
|
11
11
|
type Config = {
|
|
12
12
|
label: string;
|
|
13
|
-
|
|
13
|
+
Icon: FunctionComponent<SVGProps<SVGSVGElement>>;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const getIconsAndLabels = ({
|
|
@@ -18,19 +18,19 @@ const getIconsAndLabels = ({
|
|
|
18
18
|
totalResources,
|
|
19
19
|
}: ZoneResourcesAvailability): Config => {
|
|
20
20
|
if (bookedResources === totalResources) {
|
|
21
|
-
return { label: "soldOut",
|
|
21
|
+
return { label: "soldOut", Icon: SoldOutIcon };
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// lots of space if less than 80% booked
|
|
25
25
|
if (bookedResources / totalResources <= LOTS_OF_SPACE_LIMIT) {
|
|
26
|
-
return { label: "lotsOfSpace",
|
|
26
|
+
return { label: "lotsOfSpace", Icon: AvailableIcon };
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
if (bookedResources / totalResources >= LIMITED_LIMIT) {
|
|
30
|
-
return { label: "limited",
|
|
30
|
+
return { label: "limited", Icon: LimitedIcon };
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
return { label: "available",
|
|
33
|
+
return { label: "available", Icon: AvailableIcon };
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
type AvailabilityIndicatorProps = {
|
|
@@ -47,21 +47,21 @@ export const AvailabilityIndicator = ({
|
|
|
47
47
|
const { t } = useTranslation("Design");
|
|
48
48
|
|
|
49
49
|
if (isUnavailable) {
|
|
50
|
-
return <Indicator
|
|
50
|
+
return <Indicator Icon={SoldOutIcon} label={t("notAvailable")} />;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (isSoldOut) {
|
|
54
|
-
return <Indicator
|
|
54
|
+
return <Indicator Icon={SoldOutIcon} label={t("soldOut")} />;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
const {
|
|
57
|
+
const { Icon, label } = getIconsAndLabels(resources);
|
|
58
58
|
|
|
59
|
-
return <Indicator
|
|
59
|
+
return <Indicator Icon={Icon} label={t(label)} />;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
const Indicator = ({
|
|
62
|
+
const Indicator = ({ Icon, label }: Config) => (
|
|
63
63
|
<div className="availability-indicator">
|
|
64
|
-
|
|
64
|
+
<Icon />
|
|
65
65
|
<div>{label}</div>
|
|
66
66
|
</div>
|
|
67
67
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventStatistic } from "@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper";
|
|
2
2
|
import { DateTime } from "luxon";
|
|
3
|
-
import { DATE_TIME_FULL_FORMAT } from "@licklist/core/dist/Config";
|
|
3
|
+
import { DATE_FORMAT, DATE_TIME_FULL_FORMAT } from "@licklist/core/dist/Config";
|
|
4
4
|
|
|
5
5
|
export const TRANSLATION_KEYS = {
|
|
6
6
|
shortQuantity: "shortQuantity",
|
|
@@ -30,51 +30,61 @@ export const convertEventStatisticToTableData = (
|
|
|
30
30
|
|
|
31
31
|
const summaryFormattedDate = DateTime.fromISO(date)
|
|
32
32
|
.toUTC()
|
|
33
|
-
.toFormat(
|
|
33
|
+
.toFormat(DATE_FORMAT);
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
eventStatistic?.productCategorySummary
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
const summaryDays =
|
|
36
|
+
Object.keys(eventStatistic?.productCategorySummary)?.filter(
|
|
37
|
+
(date) =>
|
|
38
|
+
DateTime.fromFormat(date, DATE_TIME_FULL_FORMAT).toFormat(
|
|
39
|
+
DATE_FORMAT
|
|
40
|
+
) === summaryFormattedDate
|
|
41
|
+
) ?? [];
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
summaryDays
|
|
44
|
+
.map((day) => eventStatistic?.productCategorySummary[day])
|
|
45
|
+
.forEach((summaries) => {
|
|
46
|
+
summaries.forEach(
|
|
47
|
+
({ totalPerCategory, productsSummary = [], categoryName, eventId }) => {
|
|
48
|
+
let quantity = 0;
|
|
42
49
|
|
|
43
|
-
|
|
44
|
-
name: categoryName,
|
|
45
|
-
key: `${eventId}.${categoryName}`,
|
|
46
|
-
isBold: true,
|
|
47
|
-
isHeader: true,
|
|
48
|
-
quantity: TRANSLATION_KEYS.shortQuantity,
|
|
49
|
-
total: TRANSLATION_KEYS.total,
|
|
50
|
-
});
|
|
50
|
+
totalAmount += totalPerCategory || 0;
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
tableDataArray.push({
|
|
53
|
+
name: categoryName,
|
|
54
|
+
key: `${eventId}.${categoryName}`,
|
|
55
|
+
isBold: true,
|
|
56
|
+
isHeader: true,
|
|
57
|
+
quantity: TRANSLATION_KEYS.shortQuantity,
|
|
58
|
+
total: TRANSLATION_KEYS.total,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
productsSummary?.forEach(
|
|
62
|
+
({ productsSold, name, totalQuantity, total }) => {
|
|
63
|
+
quantity += productsSold;
|
|
64
|
+
|
|
65
|
+
tableDataArray.push({
|
|
66
|
+
name,
|
|
67
|
+
key: `${eventId}.${categoryName}.${name}`,
|
|
68
|
+
quantity: totalQuantity
|
|
69
|
+
? `${productsSold} / ${totalQuantity}`
|
|
70
|
+
: String(productsSold),
|
|
71
|
+
total: String(total),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
);
|
|
55
75
|
|
|
56
76
|
tableDataArray.push({
|
|
57
|
-
name,
|
|
58
|
-
key: `${eventId}.${categoryName}.${
|
|
59
|
-
quantity
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
total: String(total),
|
|
77
|
+
name: TRANSLATION_KEYS.totalPerCategory,
|
|
78
|
+
key: `${eventId}.${categoryName}.${TRANSLATION_KEYS.totalPerCategory}`,
|
|
79
|
+
quantity,
|
|
80
|
+
total: totalPerCategory,
|
|
81
|
+
isBold: true,
|
|
63
82
|
});
|
|
83
|
+
|
|
84
|
+
totalQuantity += quantity;
|
|
64
85
|
}
|
|
65
86
|
);
|
|
66
|
-
|
|
67
|
-
tableDataArray.push({
|
|
68
|
-
name: TRANSLATION_KEYS.totalPerCategory,
|
|
69
|
-
key: `${eventId}.${categoryName}.${TRANSLATION_KEYS.totalPerCategory}`,
|
|
70
|
-
quantity,
|
|
71
|
-
total: totalPerCategory,
|
|
72
|
-
isBold: true,
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
totalQuantity += quantity;
|
|
76
|
-
}
|
|
77
|
-
);
|
|
87
|
+
});
|
|
78
88
|
|
|
79
89
|
tableDataArray.push({
|
|
80
90
|
name: TRANSLATION_KEYS.total,
|
|
@@ -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
|
|
@@ -3,16 +3,22 @@ import clsx from "clsx";
|
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import { DateTime } from "luxon";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
Order,
|
|
8
|
+
ORDER_SOURCE_MANUAL,
|
|
9
|
+
} from "@licklist/core/dist/DataMapper/Order/OrderDataMapper";
|
|
10
|
+
import { User } from "@licklist/core/dist/DataMapper/User/UserDataMapper";
|
|
7
11
|
import { TIME_FORMAT } from "@licklist/core/dist/Config";
|
|
8
12
|
import * as Config from "@licklist/core/dist/Config";
|
|
9
13
|
import { formatDateStringForEvent } from "@licklist/plugins/dist/utils/formatDate";
|
|
10
14
|
import { getOrderSourceTitle } from "@licklist/plugins/dist/utils/sourceTitle";
|
|
15
|
+
|
|
11
16
|
import Icon from "../../../../static/Icon";
|
|
12
17
|
|
|
13
18
|
export type ResultCardProps = {
|
|
14
19
|
className: string;
|
|
15
20
|
order: Order;
|
|
21
|
+
staffMember?: User;
|
|
16
22
|
onCardClick?: (id: number) => void;
|
|
17
23
|
};
|
|
18
24
|
|
|
@@ -21,14 +27,28 @@ export type ResultCardProps = {
|
|
|
21
27
|
export const ResultCard = ({
|
|
22
28
|
order,
|
|
23
29
|
className,
|
|
30
|
+
staffMember,
|
|
24
31
|
onCardClick,
|
|
25
32
|
}: ResultCardProps) => {
|
|
26
33
|
const { t } = useTranslation("Design");
|
|
27
34
|
const { formatNumber } = useIntl();
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
|
|
36
|
+
const {
|
|
37
|
+
id,
|
|
38
|
+
people,
|
|
39
|
+
user,
|
|
40
|
+
status,
|
|
41
|
+
startDate,
|
|
42
|
+
products,
|
|
43
|
+
source,
|
|
44
|
+
totalAmount,
|
|
45
|
+
event,
|
|
46
|
+
menu,
|
|
47
|
+
remainingToPay,
|
|
48
|
+
} = order;
|
|
30
49
|
|
|
31
50
|
const productList = products.map((product) => product.name)?.join(", ") || "";
|
|
51
|
+
const activityName = event?.name || menu?.name || "";
|
|
32
52
|
|
|
33
53
|
const onClick = () => {
|
|
34
54
|
if (!onCardClick) return;
|
|
@@ -57,8 +77,14 @@ export const ResultCard = ({
|
|
|
57
77
|
{user.email && <p>{user.email}</p>}
|
|
58
78
|
{user.userDetail?.phone && <p>{user.userDetail?.phone}</p>}
|
|
59
79
|
<p>------</p>
|
|
60
|
-
<p>
|
|
61
|
-
|
|
80
|
+
<p>
|
|
81
|
+
{t("activity")}: {activityName}{" "}
|
|
82
|
+
</p>
|
|
83
|
+
{source === ORDER_SOURCE_MANUAL && staffMember && (
|
|
84
|
+
<p>
|
|
85
|
+
{t("staff")}: {`${staffMember.firstName} ${staffMember.lastName}`}
|
|
86
|
+
</p>
|
|
87
|
+
)}
|
|
62
88
|
<p>
|
|
63
89
|
{t("status")}: {t(status)}
|
|
64
90
|
</p>
|
|
@@ -71,8 +97,17 @@ export const ResultCard = ({
|
|
|
71
97
|
<p className="products" title={productList}>
|
|
72
98
|
{t("products")}: {productList}
|
|
73
99
|
</p>
|
|
100
|
+
{!!remainingToPay && (
|
|
101
|
+
<p>
|
|
102
|
+
{t("remainingAmount")}:{" "}
|
|
103
|
+
{formatNumber(remainingToPay, {
|
|
104
|
+
style: "currency",
|
|
105
|
+
currency: Config.Currency.GBP,
|
|
106
|
+
})}
|
|
107
|
+
</p>
|
|
108
|
+
)}
|
|
74
109
|
<p>
|
|
75
|
-
{t("
|
|
110
|
+
{t("paidAmount")}:{" "}
|
|
76
111
|
{formatNumber(totalAmount, {
|
|
77
112
|
style: "currency",
|
|
78
113
|
currency: Config.Currency.GBP,
|