@licklist/design 0.44.486-dev.56 → 0.44.486-dev.58

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
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),i=e(r),n=require("react-i18next"),o=require("react-bootstrap"),l=require("react-hook-form"),a=e(require("@licklist/plugins/dist/services/Form/FormErrorService")),d=require("@react-aria/utils"),u=require("luxon"),s=require("../../../../collapsible-input-group/CollapsibleInputGroup.js"),c=require("../../../../modals/dialog/Dialog.js"),m=require("../../../../modals/dialog/DialogContext.js"),p=require("@licklist/core/dist/DataMapper/Media/ImageDataMapper"),v=require("../../../../file-upload/FileUpload.js"),g=require("../../../../tiptap-editor/TipTapEditor.js"),E=require("../SelectEventProductSet/SelectEventProductSet.js"),f=require("@licklist/plugins/dist/hooks/Media/useMultipleImages"),I=require("@licklist/plugins/dist/utils/ScrollUtils"),b=require("@licklist/plugins/dist/utils/FormValues"),S=require("../SaleDeadline/SaleDeadline.js"),P=require("../../../../provider/categories-input/CategoriesInput.js"),F=require("../../../../provider/categories-input/CategoriesInputDescription.js");require("../../../../provider/location-input/LocationInput.js"),require("../../../../provider/location-input/LocationInputDescription.js"),require("../../../../provider/provider-links-input/ProviderLinksInput.js"),require("../../../../provider/provider-details-input/ProviderDetailsInput.js"),require("../../../../provider/provider-form/ProviderForm.js"),require("../../../../provider/working-hours-input/WorkingHoursInput.js"),require("../../../../provider/working-hours-input/WorkingHoursInputDescription.js"),require("../../../../provider/venue-form/VenueForm.js"),require("../../../../provider/company/user-form/UserForm.js");var q=require("../../IntervalInput.js"),A=require("../../utils/isUrlValid.js"),D={uploadImage:p.IMAGE_TYPE_MAP[p.IMAGE_TYPE_IMAGE],uploadCover:p.IMAGE_TYPE_MAP[p.IMAGE_TYPE_COVER]},h=function(e){var t,r,i,n,o,l,a,d,s,c,m,p=function(e){return e&&u.DateTime.fromISO(e).toISO({includeOffset:!1,suppressMilliseconds:!0,suppressSeconds:!0})};return{name:null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"",description:null!==(r=null==e?void 0:e.description)&&void 0!==r?r:"",start:p(null!==(i=null==e?void 0:e.startAt)&&void 0!==i?i:""),end:p(null!==(n=null==e?void 0:e.endAt)&&void 0!==n?n:""),rrule:null!==(o=null==e?void 0:e.rrule)&&void 0!==o?o:void 0,categories:null!==(l=null==e?void 0:e.categories)&&void 0!==l?l:[],termsAndConditions:null!==(a=null==e?void 0:e.termsAndConditions)&&void 0!==a?a:"",visible:null!==(d=null==e?void 0:e.visible)&&void 0!==d?d:"",externalPaymentLink:null!==(s=null==e?void 0:e.externalPaymentLink)&&void 0!==s?s:"",productSetId:null==e?void 0:e.productSetId,images:null==e?void 0:e.images,saleDeadline:null==e?void 0:e.saleDeadline,integrationUrl:null!==(c=null==e?void 0:e.integrationUrl)&&void 0!==c?c:"",recurrenceEndAt:null!==(m=null==e?void 0:e.recurrenceEndAt)&&void 0!==m?m:void 0}};exports.EditEventForm=function(e){var u,C,_,y=e.disabled,k=void 0!==y&&y,M=e.categories,L=e.title,j=e.hasPermission,w=void 0===j||j,G=e.defaultEventValues,U=e.serverErrors,x=e.onSaveEvent,T=e.productSets,V=e.createProductSet,Y=e.setEditProductSetId,O=e.isExternalPaymentLinkEnabled,B=n.useTranslation(["Design","Validation"]).t,R=d.useId(),N=d.useId(),W=d.useId(),H=d.useId(),K=d.useId(),z=t.__read(r.useState(null),2),J=z[0],Q=z[1],X=t.__read(r.useState(!1),2),Z=X[0],$=X[1],ee=m.useDialogContext(),te=ee.isShownDialog,re=ee.onBeforeUnload,ie=ee.onPopState,ne=ee.onApproveDialog,oe=ee.onDeclineDialog,le=l.useForm({defaultValues:h(G)}),ae=le.register,de=le.formState.errors,ue=le.handleSubmit,se=le.formState,ce=le.reset,me=le.watch,pe=le.setValue,ve=le.setError,ge=le.getValues,Ee=le.control,fe=me("visible"),Ie=me("editedProductSet"),be=me("productSetId"),Se=f.useMultipleImages(J),Pe=Se.images,Fe=Se.handleImageRemove,qe=Se.handleImageUploading,Ae=Se.isImagesLoading,De=Se.isCoverImagesLoading,he=r.useCallback((function(e,t){return!!A.isUrlValid(e)||B("Validation:fieldValidWebURL",{attribute:t})}),[]);return r.useEffect((function(){ce(h(G))}),[G]),r.useEffect((function(){if(G.images&&G.images.length>0){var e=ge("images");Q(e)}else Q([])}),[Q,ge,G]),r.useEffect((function(){Array.isArray(Pe)&&pe("images",Pe)}),[Pe]),r.useEffect((function(){a.handleServerErrors(U,ve)}),[U]),r.useEffect((function(){return window.history.pushState(null,"",window.location.pathname),window.addEventListener("beforeunload",re),window.addEventListener("popstate",ie),function(){window.removeEventListener("beforeunload",re),window.removeEventListener("popstate",ie)}}),[]),i.createElement(i.Fragment,null,i.createElement(c.Dialog,{isActive:te,title:B("Design:leavePage"),content:B("Design:changesNotBeSaved"),onApprove:ne,onDecline:oe}),i.createElement("h5",{className:"edit-event-modal-title highlited-primary-title"},L),i.createElement(l.FormProvider,t.__assign({},le),i.createElement(o.Modal.Body,{as:"form",noValidate:!0,onSubmit:ue(x,(function(e){I.scrollToError(b.getFirstErrorKey(e))}))},i.createElement(o.Form.Group,{controlId:"name"},i.createElement(o.Form.Label,null,B("nameOfEvent")),i.createElement(o.Form.Control,t.__assign({},ae("name",{required:B("Validation:fieldRequired",{attribute:B("name")}),maxLength:{value:255,message:B("Validation:fieldMaxLength",{attribute:B("name"),max:255})}}),{name:"name",required:!0,isInvalid:Boolean(de.name),disabled:k})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(u=de.name)||void 0===u?void 0:u.message)),Object.keys(D).map((function(e){var t=D[e];return i.createElement(v.FileUpload,{key:e,allowedExtensions:["jpg","jpeg","png"],enablePreview:!0,defaultFiles:null==Pe?void 0:Pe.filter((function(e){return p.IMAGE_TYPE_MAP[e.imageType]===t})),onFilesChange:function(e){qe(e,t)},secondSubtitle:t===p.IMAGE_TYPE_MAP[p.IMAGE_TYPE_IMAGE]?"1200x600":void 0,title:B("Design:".concat(e)),onFileRemove:function(e,r){return Fe(String(e),r,t)},isLoading:t===p.IMAGE_TYPE_MAP[p.IMAGE_TYPE_IMAGE]?Ae:De,disabled:k})})),i.createElement(o.Form.Group,{controlId:R},i.createElement(o.Form.Label,null,B("description")),i.createElement(l.Controller,{render:function(e){var t=e.field;return i.createElement(g.TipTapEditor,{withEmoji:!1,viewMode:!1,onUpdate:t.onChange,content:t.value,disabled:k})},name:"description"})),i.createElement(q.IntervalInput,{key:me("rrule"),disabled:k,productSetId:be,productSets:T,editedProductSet:Ie}),0!==M.length&&i.createElement(o.Form.Group,null,i.createElement(o.Accordion,null,i.createElement(s.CollapsibleInputGroup,{eventKey:"categories",label:B("categories"),description:i.createElement(F.CategoriesInputDescription,{categories:M})},i.createElement(P.CategoriesInput,{categories:M})))),i.createElement(S.SaleDeadline,{disabled:k}),i.createElement(o.Form.Group,{controlId:N},i.createElement(o.Form.Label,null,B("termsAndConditions")),i.createElement(l.Controller,{render:function(e){var t=e.field;return i.createElement(g.TipTapEditor,{withEmoji:!1,viewMode:!1,onUpdate:t.onChange,content:t.value,disabled:k})},name:"termsAndConditions"})),O&&i.createElement(o.Form.Group,{controlId:K},i.createElement(o.Form.Label,null,B("externalPaymentLink")),i.createElement(o.Form.Control,t.__assign({},ae("externalPaymentLink",{validate:function(e){return!e||he(e,B("Design:externalPaymentLink"))}}),{name:"externalPaymentLink",type:"url",inputMode:"url",disabled:k,isInvalid:Boolean(de.externalPaymentLink)})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(C=de.externalPaymentLink)||void 0===C?void 0:C.message)),i.createElement(o.Form.Group,{controlId:W,className:"mt-5"},i.createElement(o.Form.Label,null,B("public")," / ",B("private")),i.createElement(l.Controller,{control:Ee,name:"visible",rules:{validate:function(e){return"boolean"==typeof e||B("Validation:fieldRequired",{attribute:B("visible")})}},render:function(e){var t=e.field,r=e.fieldState,n=r.invalid,l=r.error,a=String(t.value);return i.createElement(i.Fragment,null,i.createElement(o.Form.Control,{as:"select",onChange:function(e){var r=e.target.value;t.onChange(r?"true"===r:r)},isInvalid:n,defaultValue:"",value:a,disabled:k},i.createElement("option",{value:""},B("Design:pleaseChooseOne")),i.createElement("option",{value:"false"},B("Design:private")),i.createElement("option",{value:"true"},B("Design:public"))),i.createElement(o.Form.Control.Feedback,{type:"invalid"},null==l?void 0:l.message))}})),"boolean"!=typeof fe||fe?null:i.createElement(o.Form.Group,{controlId:H},i.createElement(o.Form.Label,null,B("Design:integrationUrl")),i.createElement(o.Form.Control,t.__assign({},ae("integrationUrl",{required:B("Validation:fieldRequired",{attribute:B("Design:integrationUrl")}),validate:function(e){return he(e,B("Design:integrationUrl"))}}),{name:"integrationUrl",isInvalid:Boolean(de.integrationUrl),placeholder:B("Design:integrationUrl"),disabled:k})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(_=de.integrationUrl)||void 0===_?void 0:_.message)),i.createElement(E.SelectEventProductSet,{productSets:T||[],createProductSet:V,setEditProductSetId:Y,setShowEditProductSet:$,showEditProductSet:Z}),w&&!Z&&i.createElement(o.Button,{disabled:k||se.isSubmitting||Ae||De,className:"save-event",type:"submit"},se.isSubmitting?"".concat(B("saveAndAdd"),"..."):B("saveAndAdd")))))};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),i=e(r),n=require("react-i18next"),o=require("react-bootstrap"),l=require("react-hook-form"),a=e(require("@licklist/plugins/dist/services/Form/FormErrorService")),d=require("@react-aria/utils"),u=require("luxon"),s=require("../../../../collapsible-input-group/CollapsibleInputGroup.js"),c=require("../../../../modals/dialog/Dialog.js"),m=require("../../../../modals/dialog/DialogContext.js"),p=require("@licklist/core/dist/DataMapper/Media/ImageDataMapper"),v=require("../../../../file-upload/FileUpload.js"),g=require("../../../../tiptap-editor/TipTapEditor.js"),E=require("../SelectEventProductSet/SelectEventProductSet.js"),f=require("@licklist/plugins/dist/hooks/Media/useMultipleImages"),I=require("@licklist/plugins/dist/utils/ScrollUtils"),b=require("@licklist/plugins/dist/utils/FormValues"),S=require("../SaleDeadline/SaleDeadline.js"),P=require("../../../../provider/categories-input/CategoriesInput.js"),F=require("../../../../provider/categories-input/CategoriesInputDescription.js");require("../../../../provider/location-input/LocationInput.js"),require("../../../../provider/location-input/LocationInputDescription.js"),require("../../../../provider/provider-links-input/ProviderLinksInput.js"),require("../../../../provider/provider-details-input/ProviderDetailsInput.js"),require("../../../../provider/provider-form/ProviderForm.js"),require("../../../../provider/working-hours-input/WorkingHoursInput.js"),require("../../../../provider/working-hours-input/WorkingHoursInputDescription.js"),require("../../../../provider/venue-form/VenueForm.js"),require("../../../../provider/company/user-form/UserForm.js");var q=require("../../IntervalInput.js"),A=require("../../utils/isUrlValid.js"),D={uploadImage:p.IMAGE_TYPE_MAP[p.IMAGE_TYPE_IMAGE],uploadCover:p.IMAGE_TYPE_MAP[p.IMAGE_TYPE_COVER]},h=function(e){var t,r,i,n,o,l,a,d,s,c,m,p=function(e){return e&&u.DateTime.fromISO(e).toISO({includeOffset:!1,suppressMilliseconds:!0,suppressSeconds:!0})};return{name:null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"",description:null!==(r=null==e?void 0:e.description)&&void 0!==r?r:"",start:p(null!==(i=null==e?void 0:e.startAt)&&void 0!==i?i:""),end:p(null!==(n=null==e?void 0:e.endAt)&&void 0!==n?n:""),rrule:null!==(o=null==e?void 0:e.rrule)&&void 0!==o?o:void 0,categories:null!==(l=null==e?void 0:e.categories)&&void 0!==l?l:[],termsAndConditions:null!==(a=null==e?void 0:e.termsAndConditions)&&void 0!==a?a:"",visible:null!==(d=null==e?void 0:e.visible)&&void 0!==d?d:"",externalPaymentLink:null!==(s=null==e?void 0:e.externalPaymentLink)&&void 0!==s?s:"",productSetId:null==e?void 0:e.productSetId,images:null==e?void 0:e.images,saleDeadline:null==e?void 0:e.saleDeadline,integrationUrl:null!==(c=null==e?void 0:e.integrationUrl)&&void 0!==c?c:"",recurrenceEndAt:null!==(m=null==e?void 0:e.recurrenceEndAt)&&void 0!==m?m:void 0}};exports.EditEventForm=function(e){var u,C,_,y=e.disabled,k=void 0!==y&&y,M=e.categories,L=e.title,j=e.hasPermission,w=void 0===j||j,G=e.defaultEventValues,U=e.serverErrors,x=e.onSaveEvent,T=e.productSets,V=e.createProductSet,Y=e.setEditProductSetId,O=e.isExternalPaymentLinkEnabled,B=n.useTranslation(["Design","Validation"]).t,R=d.useId(),N=d.useId(),W=d.useId(),H=d.useId(),K=d.useId(),z=t.__read(r.useState(null),2),J=z[0],Q=z[1],X=t.__read(r.useState(!1),2),Z=X[0],$=X[1],ee=m.useDialogContext(),te=ee.isShownDialog,re=ee.onBeforeUnload,ie=ee.onPopState,ne=ee.onApproveDialog,oe=ee.onDeclineDialog,le=l.useForm({defaultValues:h(G)}),ae=le.register,de=le.formState.errors,ue=le.handleSubmit,se=le.formState,ce=le.reset,me=le.watch,pe=le.setValue,ve=le.setError,ge=le.getValues,Ee=le.control,fe=me("visible"),Ie=me("editedProductSet"),be=me("productSetId"),Se=f.useMultipleImages(J),Pe=Se.images,Fe=Se.handleImageRemove,qe=Se.handleImageUploading,Ae=Se.isImagesLoading,De=Se.isCoverImagesLoading,he=r.useCallback((function(e,t){return!!A.isUrlValid(e)||B("Validation:fieldValidWebURL",{attribute:t})}),[]);return r.useEffect((function(){ce(h(G))}),[G]),r.useEffect((function(){if(G.images&&G.images.length>0){var e=ge("images");Q(e)}else Q([])}),[Q,ge,G]),r.useEffect((function(){Array.isArray(Pe)&&pe("images",Pe)}),[Pe]),r.useEffect((function(){a.handleServerErrors(U,ve)}),[U]),r.useEffect((function(){return window.history.pushState(null,"",window.location.pathname),window.addEventListener("beforeunload",re),window.addEventListener("popstate",ie),function(){window.removeEventListener("beforeunload",re),window.removeEventListener("popstate",ie)}}),[]),i.createElement(i.Fragment,null,i.createElement(c.Dialog,{isActive:te,title:B("Design:leavePage"),content:B("Design:changesNotBeSaved"),onApprove:ne,onDecline:oe}),i.createElement("h5",{className:"edit-event-modal-title highlited-primary-title"},L),i.createElement(l.FormProvider,t.__assign({},le),i.createElement(o.Modal.Body,{as:"form",noValidate:!0,onSubmit:ue(x,(function(e){I.scrollToError(b.getFirstErrorKey(e))}))},i.createElement(o.Form.Group,{controlId:"name"},i.createElement(o.Form.Label,null,B("nameOfEvent")),i.createElement(o.Form.Control,t.__assign({},ae("name",{required:B("Validation:fieldRequired",{attribute:B("name")}),maxLength:{value:255,message:B("Validation:fieldMaxLength",{attribute:B("name"),max:255})}}),{name:"name",required:!0,isInvalid:Boolean(de.name),disabled:k})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(u=de.name)||void 0===u?void 0:u.message)),Object.keys(D).map((function(e){var t=D[e];return i.createElement(v.FileUpload,{key:e,allowedExtensions:["jpg","jpeg","png"],enablePreview:!0,defaultFiles:null==Pe?void 0:Pe.filter((function(e){return p.IMAGE_TYPE_MAP[e.imageType]===t})),onFilesChange:function(e){qe(e,t)},secondSubtitle:t===p.IMAGE_TYPE_MAP[p.IMAGE_TYPE_IMAGE]?"1200x600":void 0,title:B("Design:".concat(e)),onFileRemove:function(e,r){return Fe(String(e),r,t)},isLoading:t===p.IMAGE_TYPE_MAP[p.IMAGE_TYPE_IMAGE]?Ae:De,disabled:k})})),i.createElement(o.Form.Group,{controlId:R},i.createElement(o.Form.Label,null,B("description")),i.createElement(l.Controller,{render:function(e){var t=e.field;return i.createElement(g.TipTapEditor,{withEmoji:!1,viewMode:!1,onUpdate:t.onChange,content:t.value,disabled:k})},name:"description"})),i.createElement(q.IntervalInput,{key:me("name"),disabled:k,productSetId:be,productSets:T,editedProductSet:Ie}),0!==M.length&&i.createElement(o.Form.Group,null,i.createElement(o.Accordion,null,i.createElement(s.CollapsibleInputGroup,{eventKey:"categories",label:B("categories"),description:i.createElement(F.CategoriesInputDescription,{categories:M})},i.createElement(P.CategoriesInput,{categories:M})))),i.createElement(S.SaleDeadline,{disabled:k}),i.createElement(o.Form.Group,{controlId:N},i.createElement(o.Form.Label,null,B("termsAndConditions")),i.createElement(l.Controller,{render:function(e){var t=e.field;return i.createElement(g.TipTapEditor,{withEmoji:!1,viewMode:!1,onUpdate:t.onChange,content:t.value,disabled:k})},name:"termsAndConditions"})),O&&i.createElement(o.Form.Group,{controlId:K},i.createElement(o.Form.Label,null,B("externalPaymentLink")),i.createElement(o.Form.Control,t.__assign({},ae("externalPaymentLink",{validate:function(e){return!e||he(e,B("Design:externalPaymentLink"))}}),{name:"externalPaymentLink",type:"url",inputMode:"url",disabled:k,isInvalid:Boolean(de.externalPaymentLink)})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(C=de.externalPaymentLink)||void 0===C?void 0:C.message)),i.createElement(o.Form.Group,{controlId:W,className:"mt-5"},i.createElement(o.Form.Label,null,B("public")," / ",B("private")),i.createElement(l.Controller,{control:Ee,name:"visible",rules:{validate:function(e){return"boolean"==typeof e||B("Validation:fieldRequired",{attribute:B("visible")})}},render:function(e){var t=e.field,r=e.fieldState,n=r.invalid,l=r.error,a=String(t.value);return i.createElement(i.Fragment,null,i.createElement(o.Form.Control,{as:"select",onChange:function(e){var r=e.target.value;t.onChange(r?"true"===r:r)},isInvalid:n,defaultValue:"",value:a,disabled:k},i.createElement("option",{value:""},B("Design:pleaseChooseOne")),i.createElement("option",{value:"false"},B("Design:private")),i.createElement("option",{value:"true"},B("Design:public"))),i.createElement(o.Form.Control.Feedback,{type:"invalid"},null==l?void 0:l.message))}})),"boolean"!=typeof fe||fe?null:i.createElement(o.Form.Group,{controlId:H},i.createElement(o.Form.Label,null,B("Design:integrationUrl")),i.createElement(o.Form.Control,t.__assign({},ae("integrationUrl",{required:B("Validation:fieldRequired",{attribute:B("Design:integrationUrl")}),validate:function(e){return he(e,B("Design:integrationUrl"))}}),{name:"integrationUrl",isInvalid:Boolean(de.integrationUrl),placeholder:B("Design:integrationUrl"),disabled:k})),i.createElement(o.Form.Control.Feedback,{type:"invalid"},null===(_=de.integrationUrl)||void 0===_?void 0:_.message)),i.createElement(E.SelectEventProductSet,{productSets:T||[],createProductSet:V,setEditProductSetId:Y,setShowEditProductSet:$,showEditProductSet:Z}),w&&!Z&&i.createElement(o.Button,{disabled:k||se.isSubmitting||Ae||De,className:"save-event",type:"submit"},se.isSubmitting?"".concat(B("saveAndAdd"),"..."):B("saveAndAdd")))))};
@@ -1 +1 @@
1
- {"version":3,"file":"EventCard.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/EventCard.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAElG,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAK5C,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACvC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,EACT,MAAM,EACN,MAAM,EACN,QAAQ,EACR,aAAoB,EACpB,WAAW,EACX,cAAc,EACd,OAAO,EACP,aAAa,GACd,EAAE,cAAc,eAiIhB"}
1
+ {"version":3,"file":"EventCard.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/EventCard.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAElG,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAS5C,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACvC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,EACT,MAAM,EACN,MAAM,EACN,QAAQ,EACR,aAAoB,EACpB,WAAW,EACX,cAAc,EACd,OAAO,EACP,aAAa,GACd,EAAE,cAAc,eAiIhB"}
@@ -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=require("react"),n=e(a),r=require("@licklist/core/dist/Config"),l=require("react-i18next"),c=require("react-bootstrap"),i=require("../../static/Icon.js"),s=e(require("clsx")),m=require("react-intl"),o=require("../../tiptap-editor/TipTapEditor.js"),u=require("./utils.js"),d=require("../../assets/dashboard/chartBar.svg.js");exports.EventCard=function(e){var v=e.name,E=e.description,p=e.date,y=e.imageUrl,f=e.sales,b=e.onPreview,N=e.onEdit,k=e.onCopy,C=e.onRemove,x=e.hasPermission,g=void 0===x||x,q=e.onStatistic,w=e.eventStatistic,h=e.titleId,j=e.descriptionId,T=l.useTranslation("Design").t,I=m.useIntl(),B=I.formatNumber,P=I.formatDate,_=u.getStatisticInfo(w,p),D=_.totalViews,M=t.__rest(_,["totalViews"]),S=a.useMemo((function(){return u.formatContent(E,300)}),[E]);return n.createElement(c.Card,{className:"d-flex flex-column event-card h-100"},n.createElement("div",{className:s("event-card-image-container",!y&&"no-image")},y&&n.createElement(c.Card.Img,{variant:"top",src:y}),n.createElement(c.Badge,{className:"event-card-date",as:"time",dateTime:p,variant:"primary"},P(new Date(p),{weekday:"short",day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"numeric"}))),n.createElement(c.Card.Body,null,n.createElement(c.Card.Title,{id:h},v),n.createElement("div",{className:"flex-grow-1"},n.createElement(o.TipTapEditor,{viewMode:!0,disabled:!0,className:s("event-description",!y&&"no-image"),content:S,id:j}),n.createElement("div",{className:"mt-2 ml-2"},Object.keys(M).map((function(e){return n.createElement("div",{className:"event-card-sale",key:e},n.createElement("span",{className:"event-card-sale-name"},T(e),":"," ","totalAmount"===e?B(M[e],{style:"currency",currency:r.Currency.GBP}):M[e]))}))),f&&f.map((function(e){return n.createElement("div",{className:"event-card-sale",key:e.id},n.createElement("div",{className:"event-card-sale-text"},n.createElement("span",{className:"event-card-sale-name"},e.name)," ",n.createElement("span",{className:"event-card-sale-quantity"},[e.current,e.max].map((function(e){return B(e)})).join(" / "))),n.createElement(c.ProgressBar,{now:e.current,max:e.max}))})))),n.createElement(c.Card.Footer,null,n.createElement("div",{className:"d-flex w-100 justify-content-between"},n.createElement("div",{className:"d-flex"},n.createElement("button",{type:"button",className:"event-card-link-button ml-3 mr-4",onClick:q},n.createElement(d.ReactComponent,null)),n.createElement("div",{className:"event-card-views"},n.createElement(i.default,{type:"eye"}),n.createElement("span",null,B(D)))),n.createElement("div",null,n.createElement("button",{type:"button",className:"event-card-link-button",onClick:b},n.createElement(i.default,{type:"external-link-alt"})),g&&n.createElement(n.Fragment,null,n.createElement("button",{type:"button",className:"event-card-link-button",onClick:N},n.createElement(i.default,{type:"edit"})),n.createElement("button",{type:"button",className:"event-card-link-button",onClick:k},n.createElement(i.default,{type:"copy"})),n.createElement("button",{type:"button",className:"event-card-link-button",onClick:C},n.createElement(i.default,{type:"trash-alt"})))))))};
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=require("react"),n=e(a),r=require("@licklist/core/dist/Config"),l=require("react-i18next"),c=require("react-bootstrap"),i=require("../../static/Icon.js"),s=e(require("clsx")),m=require("react-intl"),o=require("../../tiptap-editor/TipTapEditor.js"),u=require("./utils.js"),d=require("../../assets/dashboard/chartBar.svg.js");exports.EventCard=function(e){var E=e.name,v=e.description,p=e.date,y=e.imageUrl,f=e.sales,b=e.onPreview,N=e.onEdit,C=e.onCopy,k=e.onRemove,x=e.hasPermission,g=void 0===x||x,q=e.onStatistic,w=e.eventStatistic,h=e.titleId,j=e.descriptionId,I=l.useTranslation("Design").t,T=m.useIntl(),P=T.formatNumber,_=T.formatDate,B=u.getStatisticInfo(w,p),S=B.totalViews,D=t.__rest(B,["totalViews"]),M=a.useMemo((function(){return u.formatContent(v,u.EVENT_DESCRIPTION_SIZE)}),[v]);return n.createElement(c.Card,{className:"d-flex flex-column event-card h-100"},n.createElement("div",{className:s("event-card-image-container",!y&&"no-image")},y&&n.createElement(c.Card.Img,{variant:"top",src:y}),n.createElement(c.Badge,{className:"event-card-date",as:"time",dateTime:p,variant:"primary"},_(new Date(p),{weekday:"short",day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"numeric"}))),n.createElement(c.Card.Body,null,n.createElement(c.Card.Title,{id:h},E),n.createElement("div",{className:"flex-grow-1"},n.createElement(o.TipTapEditor,{viewMode:!0,disabled:!0,className:s("event-description",!y&&"no-image"),content:M,id:j}),n.createElement("div",{className:"mt-2 ml-2"},Object.keys(D).map((function(e){return n.createElement("div",{className:"event-card-sale",key:e},n.createElement("span",{className:"event-card-sale-name"},I(e),":"," ","totalAmount"===e?P(D[e],{style:"currency",currency:r.Currency.GBP}):D[e]))}))),f&&f.map((function(e){return n.createElement("div",{className:"event-card-sale",key:e.id},n.createElement("div",{className:"event-card-sale-text"},n.createElement("span",{className:"event-card-sale-name"},e.name)," ",n.createElement("span",{className:"event-card-sale-quantity"},[e.current,e.max].map((function(e){return P(e)})).join(" / "))),n.createElement(c.ProgressBar,{now:e.current,max:e.max}))})))),n.createElement(c.Card.Footer,null,n.createElement("div",{className:"d-flex w-100 justify-content-between"},n.createElement("div",{className:"d-flex"},n.createElement("button",{type:"button",className:"event-card-link-button ml-3 mr-4",onClick:q},n.createElement(d.ReactComponent,null)),n.createElement("div",{className:"event-card-views"},n.createElement(i.default,{type:"eye"}),n.createElement("span",null,P(S)))),n.createElement("div",null,n.createElement("button",{type:"button",className:"event-card-link-button",onClick:b},n.createElement(i.default,{type:"external-link-alt"})),g&&n.createElement(n.Fragment,null,n.createElement("button",{type:"button",className:"event-card-link-button",onClick:N},n.createElement(i.default,{type:"edit"})),n.createElement("button",{type:"button",className:"event-card-link-button",onClick:C},n.createElement(i.default,{type:"copy"})),n.createElement("button",{type:"button",className:"event-card-link-button",onClick:k},n.createElement(i.default,{type:"trash-alt"})))))))};
@@ -1,5 +1,6 @@
1
1
  import { EventStatistic } from "@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper";
2
2
  export declare function formatContent(content: any, maxSymbols: any): any;
3
+ export declare const EVENT_DESCRIPTION_SIZE = 340;
3
4
  export declare const getStatisticInfo: (eventStatistic: EventStatistic | null, date: string) => {
4
5
  totalViews: number;
5
6
  totalSold: number;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAGlG,wBAAgB,aAAa,CAAC,OAAO,KAAA,EAAE,UAAU,KAAA,OAIhD;AAED,eAAO,MAAM,gBAAgB,mBACX,cAAc,GAAG,IAAI,QAC/B,MAAM;;;;CA6Bb,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAGlG,wBAAgB,aAAa,CAAC,OAAO,KAAA,EAAE,UAAU,KAAA,OAIhD;AAED,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,eAAO,MAAM,gBAAgB,mBACX,cAAc,GAAG,IAAI,QAC/B,MAAM;;;;CA6Bb,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@licklist/core/dist/Config"),o=require("luxon");exports.formatContent=function(t,o){return t?t.length>o?"".concat(t.slice(0,o),"..."):t:""},exports.getStatisticInfo=function(r,e){var i,a,l,n,u=0,c=0;if(!r)return{totalViews:0,totalSold:0,totalAmount:0};var d=o.DateTime.fromISO(e).toUTC().toFormat(t.DATE_FORMAT);n=(null===(i=r.views[d])||void 0===i?void 0:i.pageViews)||0;var s=o.DateTime.fromISO(e).toUTC().toFormat(t.DATE_TIME_FULL_FORMAT);return null===(l=null===(a=null==r?void 0:r.productCategorySummary)||void 0===a?void 0:a[s])||void 0===l||l.forEach((function(t){var o=t.totalPerCategory,r=t.productsSummary,e=void 0===r?[]:r;c+=o||0,null==e||e.forEach((function(t){var o=t.productsSold;u+=o}))})),{totalViews:n,totalSold:u,totalAmount:c}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@licklist/core/dist/Config"),o=require("luxon");exports.EVENT_DESCRIPTION_SIZE=340,exports.formatContent=function(t,o){return t?t.length>o?"".concat(t.slice(0,o),"..."):t:""},exports.getStatisticInfo=function(r,e){var i,a,l,n,u=0,c=0;if(!r)return{totalViews:0,totalSold:0,totalAmount:0};var s=o.DateTime.fromISO(e).toUTC().toFormat(t.DATE_FORMAT);n=(null===(i=r.views[s])||void 0===i?void 0:i.pageViews)||0;var d=o.DateTime.fromISO(e).toUTC().toFormat(t.DATE_TIME_FULL_FORMAT);return null===(l=null===(a=null==r?void 0:r.productCategorySummary)||void 0===a?void 0:a[d])||void 0===l||l.forEach((function(t){var o=t.totalPerCategory,r=t.productsSummary,e=void 0===r?[]:r;c+=o||0,null==e||e.forEach((function(t){var o=t.productsSold;u+=o}))})),{totalViews:n,totalSold:u,totalAmount:c}};
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ManualBookingOrder } from "@licklist/plugins/dist/context/sale/ManualBookingStepsContext";
3
+ import { RelyOnPeopleType } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
3
4
  export interface ManualBookingSummaryProps {
4
5
  eventName: string;
5
6
  orders: ManualBookingOrder[];
@@ -7,6 +8,7 @@ export interface ManualBookingSummaryProps {
7
8
  orderSumIncludingFee?: number | null;
8
9
  isFeeFetching: boolean;
9
10
  orderDate: string;
11
+ relyOnPeopleType?: RelyOnPeopleType | null;
10
12
  }
11
- export declare const ManualBookingSummary: ({ eventName, orders, ordersSum, orderSumIncludingFee, isFeeFetching, orderDate, }: ManualBookingSummaryProps) => JSX.Element;
13
+ export declare const ManualBookingSummary: ({ eventName, orders, ordersSum, orderSumIncludingFee, isFeeFetching, orderDate, relyOnPeopleType, }: ManualBookingSummaryProps) => JSX.Element;
12
14
  //# sourceMappingURL=ManualBookingSummary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ManualBookingSummary.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/summary/ManualBookingSummary.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+DAA+D,CAAC;AAUnG,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,oBAAoB,sFAO9B,yBAAyB,gBA6E3B,CAAC"}
1
+ {"version":3,"file":"ManualBookingSummary.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/summary/ManualBookingSummary.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+DAA+D,CAAC;AAQnG,OAAO,EAEL,gBAAgB,EACjB,MAAM,6DAA6D,CAAC;AAIrE,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC5C;AAED,eAAO,MAAM,oBAAoB,wGAQ9B,yBAAyB,gBAiF3B,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,a=require("@licklist/core/dist/Config");require("../../../static/loader/LoaderIndicator.js");var l=require("../../../static/loader/BlockLoader.js"),n=require("react-i18next");require("../../../static/loader/ButtonLoader.js"),require("../../../static/loader/SnippetLoader.js"),require("../../../static/loader/PaymentLoader.js");var c=require("luxon"),i=require("react-intl");exports.ManualBookingSummary=function(e){var t=e.eventName,m=e.orders,o=e.ordersSum,s=e.orderSumIncludingFee,u=e.isFeeFetching,d=e.orderDate,y=n.useTranslation(["Design","Sale"]).t,v=i.useIntl().formatNumber,E=c.DateTime.fromISO(d),p=E.toFormat(a.DATE_TIME_MANUAL_BOOKING_FORMAT),N=E.toFormat(a.TIME_FORMAT);return r.createElement("div",{className:"manual-booking-summary"},r.createElement("div",{className:"receipt-title"},y("Sale:receipt")),r.createElement("div",{className:"event-name border-summary-item"},t),r.createElement("div",{className:"border-summary-item"},p),r.createElement("div",{className:"border-summary-item"},N),m.length>0?r.createElement("div",{className:"summary-item-container"},m.map((function(e){return r.createElement("div",{key:e.id,className:"d-flex justify-content-between border-summary-item"},r.createElement("div",null,e.name),(null==e?void 0:e.relyOnPeopleMultiplier)&&r.createElement("div",null,"x ".concat(e.quantity*(null==e?void 0:e.relyOnPeopleMultiplier)," ").concat(y("people"))),r.createElement("div",null,v(e.quantity*e.price,{style:"currency",currency:a.Currency.GBP})))})),r.createElement("div",null,r.createElement("div",{className:"total-container"},r.createElement("div",null,y("Sale:total")),r.createElement("div",{className:"total-amount"},v(o,{style:"currency",currency:a.Currency.GBP}))),s&&r.createElement("div",{className:"total-container ".concat(u?"mt-6":"mt-4")},u||!s?r.createElement(l.BlockLoader,null):r.createElement(r.Fragment,null,r.createElement("div",null,y("Sale:includingOperationalCost")),r.createElement("div",{className:"total-amount"},v(s,{style:"currency",currency:a.Currency.GBP})))))):r.createElement("div",{className:"cart-items"},r.createElement("p",{className:"empty-cart"},y("Design:emptyBasket"))))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,a=require("@licklist/core/dist/Config");require("../../../static/loader/LoaderIndicator.js");var l=require("../../../static/loader/BlockLoader.js"),n=require("react-i18next");require("../../../static/loader/ButtonLoader.js"),require("../../../static/loader/SnippetLoader.js"),require("../../../static/loader/PaymentLoader.js");var c=require("luxon"),i=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),m=require("react-intl"),o=require("@licklist/plugins/dist/utils/relyOnPeople");exports.ManualBookingSummary=function(e){var t=e.eventName,s=e.orders,u=e.ordersSum,d=e.orderSumIncludingFee,y=e.isFeeFetching,p=e.orderDate,v=e.relyOnPeopleType,E=n.useTranslation(["Design","Sale"]).t,N=m.useIntl().formatNumber,q=v&&v!==i.RELY_ON_PEOPLE_QUANTITY,O=c.DateTime.fromISO(p),P=O.toFormat(a.DATE_TIME_MANUAL_BOOKING_FORMAT),g=O.toFormat(a.TIME_FORMAT);return r.createElement("div",{className:"manual-booking-summary"},r.createElement("div",{className:"receipt-title"},E("Sale:receipt")),r.createElement("div",{className:"event-name border-summary-item"},t),r.createElement("div",{className:"border-summary-item"},P),r.createElement("div",{className:"border-summary-item"},g),s.length>0?r.createElement("div",{className:"summary-item-container"},s.map((function(e){var t=o.getRelyOnPeopleMultiplier({relyOnPeopleType:v,capacity:null==e?void 0:e.capacity});return r.createElement("div",{key:e.id,className:"d-flex justify-content-between border-summary-item"},r.createElement("div",null,e.name),q&&t&&r.createElement("div",null,"x ".concat(e.quantity*t," ").concat(E("people"))),r.createElement("div",null,N(e.quantity*e.price,{style:"currency",currency:a.Currency.GBP})))})),r.createElement("div",null,r.createElement("div",{className:"total-container"},r.createElement("div",null,E("Sale:total")),r.createElement("div",{className:"total-amount"},N(u,{style:"currency",currency:a.Currency.GBP}))),d&&r.createElement("div",{className:"total-container ".concat(y?"mt-6":"mt-4")},y||!d?r.createElement(l.BlockLoader,null):r.createElement(r.Fragment,null,r.createElement("div",null,E("Sale:includingOperationalCost")),r.createElement("div",{className:"total-amount"},N(d,{style:"currency",currency:a.Currency.GBP})))))):r.createElement("div",{className:"cart-items"},r.createElement("p",{className:"empty-cart"},E("Design:emptyBasket"))))};
@@ -34,7 +34,7 @@ $event-card-views-gutter: sp(3) !default;
34
34
  transition: ease-in 0.25s;
35
35
  border-radius: $event-card-border-radius;
36
36
 
37
- > * + * {
37
+ >*+* {
38
38
  margin-top: $event-card-contents-gutter;
39
39
  }
40
40
 
@@ -43,9 +43,16 @@ $event-card-views-gutter: sp(3) !default;
43
43
 
44
44
  .event-description {
45
45
  min-height: 8rem;
46
+ max-height: 21rem;
47
+ overflow: hidden;
48
+
49
+ &:last-child {
50
+ text-overflow: ellipsis;
51
+ }
46
52
 
47
53
  &.no-image {
48
54
  min-height: 13.75rem;
55
+ max-height: 22rem;
49
56
  }
50
57
  }
51
58
  }
@@ -75,7 +82,7 @@ $event-card-views-gutter: sp(3) !default;
75
82
  }
76
83
 
77
84
  &:hover {
78
- box-shadow: 0px 0px 1rem 0px rgb(0 0 0 / 20%);
85
+ box-shadow: 0px 0px 1rem 0px rgb(0 0 0 / 20%);
79
86
  }
80
87
  }
81
88
 
@@ -168,4 +175,4 @@ $event-card-views-gutter: sp(3) !default;
168
175
  color: #504f4f;
169
176
  width: 1.7rem;
170
177
  }
171
- }
178
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.486-dev.56",
3
+ "version": "0.44.486-dev.58",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -266,7 +266,7 @@ export const EditEventForm = ({
266
266
  </Form.Group>
267
267
  {/* key is used as a hack to make sure rrule is rendered correctly */}
268
268
  <IntervalInput
269
- key={watch("rrule")}
269
+ key={watch("name")}
270
270
  disabled={disabled}
271
271
  productSetId={productSetId}
272
272
  productSets={productSets}
@@ -9,7 +9,11 @@ import { EventStatistic } from "@licklist/core/dist/DataMapper/Provider/EventSta
9
9
  import Icon from "../../static/Icon";
10
10
  import { Sale } from "../../types/bookings";
11
11
  import { TipTapEditor } from "../../tiptap-editor/TipTapEditor";
12
- import { formatContent, getStatisticInfo } from "./utils";
12
+ import {
13
+ EVENT_DESCRIPTION_SIZE,
14
+ formatContent,
15
+ getStatisticInfo,
16
+ } from "./utils";
13
17
  import { ReactComponent as ChartBarIcon } from "../../assets/dashboard/chartBar.svg";
14
18
 
15
19
  export interface EventCardProps extends HasPermissionProp {
@@ -48,7 +52,7 @@ export function EventCard({
48
52
  const { formatNumber, formatDate } = useIntl();
49
53
  const { totalViews, ...statistics } = getStatisticInfo(eventStatistic, date);
50
54
  const memoedContent = useMemo(
51
- () => formatContent(description, 300),
55
+ () => formatContent(description, EVENT_DESCRIPTION_SIZE),
52
56
  [description]
53
57
  );
54
58
 
@@ -8,6 +8,8 @@ export function formatContent(content, maxSymbols) {
8
8
  return content;
9
9
  }
10
10
 
11
+ export const EVENT_DESCRIPTION_SIZE = 340;
12
+
11
13
  export const getStatisticInfo = (
12
14
  eventStatistic: EventStatistic | null,
13
15
  date: string
@@ -8,6 +8,11 @@ import {
8
8
  } from "@licklist/core/dist/Config";
9
9
  import { useIntl } from "react-intl";
10
10
  import * as Config from "@licklist/core/dist/Config";
11
+ import {
12
+ RELY_ON_PEOPLE_QUANTITY,
13
+ RelyOnPeopleType,
14
+ } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
15
+ import { getRelyOnPeopleMultiplier } from "@licklist/plugins/dist/utils/relyOnPeople";
11
16
  import { BlockLoader } from "../../../static/loader";
12
17
 
13
18
  export interface ManualBookingSummaryProps {
@@ -17,6 +22,7 @@ export interface ManualBookingSummaryProps {
17
22
  orderSumIncludingFee?: number | null;
18
23
  isFeeFetching: boolean;
19
24
  orderDate: string;
25
+ relyOnPeopleType?: RelyOnPeopleType | null;
20
26
  }
21
27
 
22
28
  export const ManualBookingSummary = ({
@@ -26,14 +32,15 @@ export const ManualBookingSummary = ({
26
32
  orderSumIncludingFee,
27
33
  isFeeFetching,
28
34
  orderDate,
35
+ relyOnPeopleType,
29
36
  }: ManualBookingSummaryProps) => {
30
37
  const { t } = useTranslation(["Design", "Sale"]);
31
38
  const { formatNumber } = useIntl();
32
-
39
+ const showRelyOnPeople =
40
+ relyOnPeopleType && relyOnPeopleType !== RELY_ON_PEOPLE_QUANTITY;
33
41
  const currentDate = DateTime.fromISO(orderDate);
34
42
  const date = currentDate.toFormat(DATE_TIME_MANUAL_BOOKING_FORMAT);
35
43
  const time = currentDate.toFormat(TIME_FORMAT);
36
-
37
44
  return (
38
45
  <div className="manual-booking-summary">
39
46
  <div className="receipt-title">{t("Sale:receipt")}</div>
@@ -43,15 +50,19 @@ export const ManualBookingSummary = ({
43
50
  {orders.length > 0 ? (
44
51
  <div className="summary-item-container">
45
52
  {orders.map((order: ManualBookingOrder) => {
53
+ const relyOnPeopleMultiplier = getRelyOnPeopleMultiplier({
54
+ relyOnPeopleType,
55
+ capacity: order?.capacity,
56
+ });
46
57
  return (
47
58
  <div
48
59
  key={order.id}
49
60
  className="d-flex justify-content-between border-summary-item"
50
61
  >
51
62
  <div>{order.name}</div>
52
- {order?.relyOnPeopleMultiplier && (
63
+ {showRelyOnPeople && relyOnPeopleMultiplier && (
53
64
  <div>
54
- {`x ${order.quantity * order?.relyOnPeopleMultiplier} ${t(
65
+ {`x ${order.quantity * relyOnPeopleMultiplier} ${t(
55
66
  "people"
56
67
  )}`}
57
68
  </div>
@@ -34,7 +34,7 @@ $event-card-views-gutter: sp(3) !default;
34
34
  transition: ease-in 0.25s;
35
35
  border-radius: $event-card-border-radius;
36
36
 
37
- > * + * {
37
+ >*+* {
38
38
  margin-top: $event-card-contents-gutter;
39
39
  }
40
40
 
@@ -43,9 +43,16 @@ $event-card-views-gutter: sp(3) !default;
43
43
 
44
44
  .event-description {
45
45
  min-height: 8rem;
46
+ max-height: 21rem;
47
+ overflow: hidden;
48
+
49
+ &:last-child {
50
+ text-overflow: ellipsis;
51
+ }
46
52
 
47
53
  &.no-image {
48
54
  min-height: 13.75rem;
55
+ max-height: 22rem;
49
56
  }
50
57
  }
51
58
  }
@@ -75,7 +82,7 @@ $event-card-views-gutter: sp(3) !default;
75
82
  }
76
83
 
77
84
  &:hover {
78
- box-shadow: 0px 0px 1rem 0px rgb(0 0 0 / 20%);
85
+ box-shadow: 0px 0px 1rem 0px rgb(0 0 0 / 20%);
79
86
  }
80
87
  }
81
88
 
@@ -168,4 +175,4 @@ $event-card-views-gutter: sp(3) !default;
168
175
  color: #504f4f;
169
176
  width: 1.7rem;
170
177
  }
171
- }
178
+ }