@licklist/design 0.44.504 → 0.44.506
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/events/edit-event-modal/IntervalInput.d.ts +4 -1
- package/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
- package/dist/events/edit-event-modal/IntervalInput.js +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -1
- package/dist/index.js +1 -1
- package/dist/notification/email-template/card/EmailTemplateCard.d.ts +4 -1
- package/dist/notification/email-template/card/EmailTemplateCard.d.ts.map +1 -1
- package/dist/notification/email-template/card/EmailTemplateCard.js +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts +3 -0
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.js +1 -1
- package/dist/notification/email-template/form/EmailTemplateForm.d.ts +7 -1
- package/dist/notification/email-template/form/EmailTemplateForm.d.ts.map +1 -1
- package/dist/notification/email-template/form/EmailTemplateForm.js +1 -1
- package/dist/notification/hooks/useTranslatedParameters.d.ts +7 -0
- package/dist/notification/hooks/useTranslatedParameters.d.ts.map +1 -0
- package/dist/notification/hooks/useTranslatedParameters.js +1 -0
- package/dist/notification/sms-template/card/SmsTemplateCard.d.ts +4 -1
- package/dist/notification/sms-template/card/SmsTemplateCard.d.ts.map +1 -1
- package/dist/notification/sms-template/card/SmsTemplateCard.js +1 -1
- package/dist/notification/sms-template/control/SmsTemplateControl.d.ts +6 -1
- package/dist/notification/sms-template/control/SmsTemplateControl.d.ts.map +1 -1
- package/dist/notification/sms-template/control/SmsTemplateControl.js +1 -1
- package/dist/notification/sms-template/form/SmsTemplateForm.d.ts +5 -1
- package/dist/notification/sms-template/form/SmsTemplateForm.d.ts.map +1 -1
- package/dist/notification/sms-template/form/SmsTemplateForm.js +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts +15 -4
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +1 -1
- package/dist/product-set/utils/index.d.ts +4 -0
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.js +1 -1
- package/dist/provider/provider-details-input/ProviderDetailsInput.d.ts.map +1 -1
- package/dist/provider/provider-details-input/ProviderDetailsInput.js +1 -1
- package/dist/sales/manual-booking/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/styles/snippet-templates/SnippetTemplateCard.scss +16 -0
- package/dist/typeahead/Typeahead.d.ts +4 -11
- package/dist/typeahead/Typeahead.d.ts.map +1 -1
- package/dist/typeahead/Typeahead.js +1 -1
- package/package.json +1 -1
- package/src/events/edit-event-modal/IntervalInput.tsx +21 -1
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +3 -0
- package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +11 -2
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +5 -4
- package/src/notification/email-template/card/EmailTemplateCard.stories.tsx +4 -2
- package/src/notification/email-template/card/EmailTemplateCard.tsx +15 -3
- package/src/notification/email-template/control/EmailTemplateControl.tsx +90 -6
- package/src/notification/email-template/form/EmailTemplateForm.stories.tsx +34 -0
- package/src/notification/email-template/form/EmailTemplateForm.tsx +23 -5
- package/src/notification/hooks/useTranslatedParameters.ts +27 -0
- package/src/notification/sms-template/card/SmsTemplateCard.stories.tsx +3 -1
- package/src/notification/sms-template/card/SmsTemplateCard.tsx +13 -3
- package/src/notification/sms-template/control/SmsTemplateControl.tsx +40 -2
- package/src/notification/sms-template/form/SmsTemplateForm.stories.tsx +28 -0
- package/src/notification/sms-template/form/SmsTemplateForm.tsx +6 -1
- package/src/product-set/control/ProductSetControl.tsx +38 -33
- package/src/product-set/form/ProductSetForm.stories.tsx +41 -2
- package/src/product-set/form/ProductSetForm.tsx +11 -0
- package/src/product-set/utils/index.ts +28 -0
- package/src/provider/provider-details-input/ProviderDetailsInput.tsx +0 -2
- package/src/sales/manual-booking/select-menu/SelectMenu.tsx +3 -1
- package/src/styles/snippet-templates/SnippetTemplateCard.scss +16 -0
- package/src/typeahead/Typeahead.stories.tsx +9 -6
- package/src/typeahead/Typeahead.tsx +9 -12
|
@@ -3,11 +3,14 @@ import { FormValues } from "@licklist/plugins/dist/types/services/Form/hook-form
|
|
|
3
3
|
import { HasPermissionProp } from "@licklist/plugins/dist/types/permission/Permission";
|
|
4
4
|
import { NotificationPlaceholder } from "@licklist/core/dist/DataMapper/Notification/NotificationPlaceholderDataMapper";
|
|
5
5
|
import { ServerError } from "@licklist/plugins/dist/hooks/Api/useHttpQuery";
|
|
6
|
+
import { NotificationType } from "@licklist/core/dist/DataMapper/Notification/NotificationTypeDataMapper";
|
|
6
7
|
export interface SmsTemplateValues extends FormValues {
|
|
7
8
|
name: string;
|
|
8
9
|
isActive: boolean;
|
|
9
10
|
isDefault: boolean;
|
|
10
11
|
body: string;
|
|
12
|
+
type?: NotificationType;
|
|
13
|
+
id?: number | string;
|
|
11
14
|
}
|
|
12
15
|
export interface SmsTemplateProps extends HasPermissionProp {
|
|
13
16
|
isLoading: boolean;
|
|
@@ -15,6 +18,7 @@ export interface SmsTemplateProps extends HasPermissionProp {
|
|
|
15
18
|
defaultValues?: SmsTemplateValues;
|
|
16
19
|
placeholders?: NotificationPlaceholder[];
|
|
17
20
|
serverErrors?: ServerError;
|
|
21
|
+
notificationTypes?: NotificationType[];
|
|
18
22
|
}
|
|
19
|
-
export declare function SmsTemplateForm({ defaultValues, onSubmit, hasPermission, placeholders, serverErrors, }: SmsTemplateProps): JSX.Element;
|
|
23
|
+
export declare function SmsTemplateForm({ defaultValues, onSubmit, hasPermission, placeholders, serverErrors, notificationTypes, }: SmsTemplateProps): JSX.Element;
|
|
20
24
|
//# sourceMappingURL=SmsTemplateForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmsTemplateForm.d.ts","sourceRoot":"","sources":["../../../../src/notification/sms-template/form/SmsTemplateForm.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAI1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,+EAA+E,CAAC;AACxH,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"SmsTemplateForm.d.ts","sourceRoot":"","sources":["../../../../src/notification/sms-template/form/SmsTemplateForm.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAI1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,+EAA+E,CAAC;AACxH,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAG5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wEAAwE,CAAC;AAI1G,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9C,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,YAAY,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACzC,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACxC;AAED,wBAAgB,eAAe,CAAC,EAC9B,aAAa,EACb,QAAQ,EACR,aAAoB,EACpB,YAAiB,EACjB,YAAY,EACZ,iBAAsB,GACvB,EAAE,gBAAgB,eAyBlB"}
|
|
@@ -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 r=require("tslib"),t=require("react"),o=e(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 r=require("tslib"),t=require("react"),o=e(t),i=require("react-i18next"),s=require("react-bootstrap"),n=require("react-hook-form"),a=e(require("@licklist/plugins/dist/services/Form/FormErrorService")),l=require("../../components/NotificationPlaceholders.js"),c=require("../control/SmsTemplateControl.js");exports.SmsTemplateForm=function(e){var u=e.defaultValues,m=e.onSubmit,d=e.hasPermission,f=void 0===d||d,p=e.placeholders,v=void 0===p?[]:p,E=e.serverErrors,b=e.notificationTypes,h=void 0===b?[]:b,q=i.useTranslation("Design").t,S=n.useForm({defaultValues:u}),F=S.setError;return t.useEffect((function(){a.handleServerErrors(E,F)}),[E,F]),o.createElement(n.FormProvider,r.__assign({},S),o.createElement(s.Form,{onSubmit:S.handleSubmit(m)},o.createElement(c.SmsTemplateControl,{notificationTypes:h}),o.createElement(l.NotificationPlaceholders,{placeholders:v}),f&&o.createElement(s.Button,{className:"mt-5 d-no dne d-md-block",type:"submit"},q("save"))))};
|
|
@@ -6,6 +6,11 @@ import { SmsTemplate } from "@licklist/core/dist/DataMapper/Notification/SmsTemp
|
|
|
6
6
|
import { SelectItem } from "../../types/generic/SelectItem";
|
|
7
7
|
import { DateAndRecurrenceInputValues } from "./DateAndRecurrenceInput";
|
|
8
8
|
import { Step } from "../types";
|
|
9
|
+
export interface TemplateItem {
|
|
10
|
+
id: string;
|
|
11
|
+
value: EmailTemplate | SmsTemplate;
|
|
12
|
+
label: string;
|
|
13
|
+
}
|
|
9
14
|
export interface ProductSetControlValues extends DateAndRecurrenceInputValues {
|
|
10
15
|
name: string;
|
|
11
16
|
type: ProductSetType;
|
|
@@ -16,8 +21,8 @@ export interface ProductSetControlValues extends DateAndRecurrenceInputValues {
|
|
|
16
21
|
productGroups?: SelectItem[];
|
|
17
22
|
fieldSetId?: number;
|
|
18
23
|
steps?: Step[];
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
emailTemplates?: TemplateItem[];
|
|
25
|
+
smsTemplates?: TemplateItem[];
|
|
21
26
|
}
|
|
22
27
|
export interface ProductSetControlShared {
|
|
23
28
|
fee?: string;
|
|
@@ -25,11 +30,17 @@ export interface ProductSetControlShared {
|
|
|
25
30
|
emailTemplates?: EmailTemplate[];
|
|
26
31
|
smsTemplates?: SmsTemplate[];
|
|
27
32
|
}
|
|
28
|
-
export interface ProductSetControlProps
|
|
33
|
+
export interface ProductSetControlProps {
|
|
29
34
|
companyName: string;
|
|
30
35
|
isLoading: boolean;
|
|
31
36
|
isEventEditProductSet?: boolean;
|
|
32
37
|
isCreateAction?: boolean;
|
|
38
|
+
emailTemplates?: TemplateItem[];
|
|
39
|
+
smsTemplates?: TemplateItem[];
|
|
40
|
+
fee?: string;
|
|
41
|
+
fieldSets?: FieldSet[];
|
|
42
|
+
showEmailTemplate?: boolean;
|
|
43
|
+
showSmsTemplate?: boolean;
|
|
33
44
|
}
|
|
34
|
-
export declare function ProductSetControl({ companyName, isLoading, fee, fieldSets, emailTemplates, smsTemplates, isEventEditProductSet, isCreateAction, }: ProductSetControlProps): JSX.Element;
|
|
45
|
+
export declare function ProductSetControl({ companyName, isLoading, fee, fieldSets, emailTemplates, smsTemplates, isEventEditProductSet, isCreateAction, showEmailTemplate, showSmsTemplate, }: ProductSetControlProps): JSX.Element;
|
|
35
46
|
//# sourceMappingURL=ProductSetControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSetControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/ProductSetControl.tsx"],"names":[],"mappings":";AAKA,OAAO,EAIL,mBAAmB,EACnB,cAAc,EACf,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,mEAAmE,CAAC;AAIhG,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAIL,4BAA4B,EAC7B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductSetControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/ProductSetControl.tsx"],"names":[],"mappings":";AAKA,OAAO,EAIL,mBAAmB,EACnB,cAAc,EACf,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,mEAAmE,CAAC;AAIhG,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAIL,4BAA4B,EAC7B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAShC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,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,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,mBAAmB,CAAC;IACrC,aAAa,CAAC,EAAE,UAAU,EAAE,CAAC;IAC7B,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;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,SAAS,EACT,GAAU,EACV,SAAc,EACd,cAAmB,EACnB,YAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,EAAE,sBAAsB,eAyPxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=e(require("react")),a=require("react-i18next"),n=require("react-bootstrap"),o=require("react-hook-form"),l=e(require("@licklist/plugins/dist/services/Form/HookFormService")),i=require("@react-aria/utils"),s=e(require("clsx")),m=require("../../static/WarningMessage.js");require("../../static/index.js");var c,u=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),d=require("@licklist/plugins/dist/validation/Rules/urlRule"),
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=e(require("react")),a=require("react-i18next"),n=require("react-bootstrap"),o=require("react-hook-form"),l=e(require("@licklist/plugins/dist/services/Form/HookFormService")),i=require("@react-aria/utils"),s=e(require("clsx")),m=require("../../static/WarningMessage.js");require("../../static/index.js");var c,u=require("@licklist/core/dist/DataMapper/Product/ProductSetDataMapper"),d=require("@licklist/plugins/dist/validation/Rules/urlRule"),p=(e(d),require("./DateAndRecurrenceInput.js")),E=require("./TutorialGifCard.js"),g=require("../form/StepsControl.js"),v=require("../../typeahead/Typeahead.js"),T=((c={})[u.OPERATIONAL_COST_PROVIDER]="operationalCostProvider",c[u.OPERATIONAL_COST_CUSTOMER]="operationalCostCustomer",c);exports.ProductSetControl=function(e){var c,f=e.companyName,C=e.isLoading,h=e.fee,F=void 0===h?"5%":h,P=e.fieldSets,O=void 0===P?[]:P,S=e.emailTemplates,D=void 0===S?[]:S,_=e.smsTemplates,b=void 0===_?[]:_,A=e.isEventEditProductSet,I=e.isCreateAction,N=e.showEmailTemplate,q=e.showSmsTemplate,R=a.useTranslation(["Design","Validation","Notification"]).t,k=o.useFormContext(),L=k.register,y=k.control,x=k.formState.errors,M=k.watch,Y=k.setError,j=k.clearErrors,U=M("steps"),V=i.useId(),G=i.useId();return r.createElement(n.Row,{className:"product-set-form ".concat(A&&"event-edit-product-set")},r.createElement(n.Col,{md:6,sm:12,className:"pr-5"},r.createElement(n.Form.Group,{controlId:V},r.createElement(n.Form.Label,null,R("Design:name"),"*"),r.createElement(n.Form.Control,t.__assign({},L("name",{required:R("Validation:fieldRequired",{attribute:R("name")}),maxLength:255,validate:function(){var e;return U.length?(null===(e=x.steps)||void 0===e?void 0:e.type)===l.manualErrorType&&j("steps"):Y("steps",{type:l.manualErrorType,message:R("Validation:fieldMinNumber",{attribute:R("steps"),min:1})}),!0}}),{placeholder:R("Design:placeholderProductSetName"),isInvalid:Boolean(x.name)})),r.createElement(n.Form.Control.Feedback,{type:"invalid"},null===(c=x.name)||void 0===c?void 0:c.message)),I&&r.createElement(p.DateAndRecurrenceInput,{isEventEditProductSet:A}),r.createElement("div",{className:"divider"}),r.createElement(E.default,null),r.createElement(g.StepsControl,{isLoading:C})),r.createElement(n.Col,{md:6,sm:12},r.createElement("div",{className:"second-column"},r.createElement(n.Form.Group,null,r.createElement(n.Form.Label,{className:"mb-0"},R("Design:operationalCost")),r.createElement("div",{className:"d-flex"},r.createElement("span",{className:"booking-fee-text"},R("bookingFeePaid",{fee:F}))),r.createElement(n.Form.Control,t.__assign({},L("operationalCost",{required:!0}),{as:"select",defaultValue:u.OPERATIONAL_COST_PROVIDER}),Object.keys(u.OPERATIONAL_COST_TYPES).map((function(e){return r.createElement("option",{value:u.OPERATIONAL_COST_TYPES[e],key:u.OPERATIONAL_COST_TYPES[e]},R(T[u.OPERATIONAL_COST_TYPES[e]],{companyName:f}))})))),r.createElement(n.Form.Group,{controlId:G},r.createElement(n.Form.Label,null,R("Design:termsAndConditions")),r.createElement(n.Form.Control,t.__assign({},L("termsAndConditions"),{as:"textarea",rows:2,disabled:C}))),r.createElement(n.Form.Group,null,r.createElement(n.Form.Label,{className:"mt-4"},R("Design:emailTemplate")),N?r.createElement(v.Typeahead,{name:"emailTemplates",options:D,isMultipleChoise:!0,placeholder:R("Design:choose"),noOptionsMessage:R("Design:noActiveTemplates",{notification:R("Design:email")})}):r.createElement(m.default,{message:R("Design:noActiveTemplates",{notification:R("Design:email")})}),r.createElement(n.Form.Label,{className:s(D.length>0?"mt-4":"mt-1")},R("Design:smsTemplate")),q?r.createElement(v.Typeahead,{name:"smsTemplates",options:b,isMultipleChoise:!0,placeholder:R("Design:choose"),noOptionsMessage:R("Design:noActiveTemplates",{notification:R("Design:sms")})}):r.createElement(m.default,{message:R("Design:noActiveTemplates",{notification:R("Design:sms")})})),r.createElement(n.Form.Group,null,r.createElement(o.Controller,{control:y,name:"fieldSetId",render:function(e){var t=e.field,a=String(t.value);return r.createElement(r.Fragment,null,r.createElement(n.Form.Label,null,R("Design:customFields")),r.createElement(n.Form.Control,{onChange:t.onChange,as:"select"},r.createElement("option",{value:"",selected:""===a},R("Design:choose")),null==O?void 0:O.map((function(e){var t=String(e.id);return r.createElement("option",{value:e.id,key:e.id,selected:a===t},e.name)}))))}})),r.createElement(n.Form.Group,{controlId:"thankYouPageUrlId"},r.createElement(n.Form.Label,null,R("thankYouPageUrl")),r.createElement(n.Form.Control,t.__assign({},L("thankYouPageUrl",{validate:function(e){return!e||(!!d.ruleForUrlWithProtocol.test(e)||R("Validation:fieldValidWebURL",{attribute:R("thankYouPageUrl")}))}}),{isInvalid:l.isInvalid("thankYouPageUrl",x)})),r.createElement(n.Form.Control.Feedback,{type:"invalid"},l.getErrors("thankYouPageUrl",x))))))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSetForm.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/ProductSetForm.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAI1F,OAAO,EAAE,WAAW,EAAE,MAAM,8DAA8D,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAK5E,OAAO,EAAE,gCAAgC,EAAE,MAAM,oFAAoF,CAAC;AACtI,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAE9E,OAAO,EAEL,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductSetForm.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/ProductSetForm.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAI1F,OAAO,EAAE,WAAW,EAAE,MAAM,8DAA8D,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAK5E,OAAO,EAAE,gCAAgC,EAAE,MAAM,oFAAoF,CAAC;AACtI,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAE9E,OAAO,EAEL,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAG5D,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,OAAO,CAAC;CACpB;AACD,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;CACZ;AACD,MAAM,WAAW,oBACf,SAAQ,UAAU,EAChB,MAAM,EACN,uBAAuB;IACzB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,mBACf,SAAQ,aAAa,EACnB,uBAAuB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,mBAAmB,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC5D,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC5D,gBAAgB,CAAC,EAAE,UAAU,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,4BAA4B,CAAC,EAAE,gCAAgC,CAAC,sBAAsB,CAAC,CAAC;IACxF,KAAK,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAC7B,WAAW,EACX,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,cAAsB,EACtB,YAAiB,EACjB,4BAA4B,EAC5B,KAAK,EACL,cAAc,EACd,GAAG,MAAM,EACV,EAAE,mBAAmB,eAwHrB"}
|
|
@@ -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"),o=require("react"),r=e(o),n=require("react-i18next"),a=require("react-bootstrap"),i=require("react-hook-form"),s=e(require("@licklist/plugins/dist/services/Form/FormErrorService")),
|
|
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"),o=require("react"),r=e(o),n=require("react-i18next"),a=require("react-bootstrap"),i=require("react-hook-form"),s=e(require("@licklist/plugins/dist/services/Form/FormErrorService")),l=require("lodash"),d=require("../../modals/dialog/Dialog.js"),u=require("../../modals/dialog/DialogContext.js"),m=require("./context.js"),c=require("../utils/index.js"),p=require("../control/ProductSetControl.js");exports.ProductSetForm=function(e){var v=e.companyName,g=e.isLoading,E=e.defaultValues,f=e.onSubmitAndRedirect,S=e.onSubmitNoRedirect,b=e.productGroupList,w=e.serverErrors,C=e.providerHasMap,h=void 0!==C&&C,q=e.venueMapSets,T=void 0===q?[]:q,D=e.providerHasBookingManagement,L=e.zones,x=e.isCreateAction,M=t.__rest(e,["companyName","isLoading","defaultValues","onSubmitAndRedirect","onSubmitNoRedirect","productGroupList","serverErrors","providerHasMap","venueMapSets","providerHasBookingManagement","zones","isCreateAction"]),P=n.useTranslation("Design").t,A=u.useDialogContext(),F=A.isShownDialog,N=A.onBeforeUnload,k=A.onPopState,_=A.onApproveDialog,j=A.onDeclineDialog,y=i.useForm({defaultValues:E,mode:"onChange"}),B=y.setError,H=y.reset,R=y.watch();return o.useEffect((function(){E&&!l.isEqual(E,R)&&H(E)}),[E]),o.useEffect((function(){w&&s.handleServerErrors(w,B)}),[w,B]),o.useEffect((function(){return window.history.pushState(null,"",window.location.pathname),window.addEventListener("beforeunload",N),window.addEventListener("popstate",k),function(){window.removeEventListener("beforeunload",N),window.removeEventListener("popstate",k)}}),[]),r.createElement(m.ProductSetContextProvider,{productGroupList:b,providerHasMap:h,venueMapSets:T,providerHasBookingManagement:D,zones:L},r.createElement(d.Dialog,{isActive:F,title:P("Design:leavePage"),content:P("Design:changesNotBeSaved"),onApprove:_,onDecline:j}),r.createElement(i.FormProvider,t.__assign({},y),r.createElement(a.Form,{onSubmit:y.handleSubmit(f)},r.createElement(m.ProductSetLoadingContext.Consumer,null,(function(e){var o=e.isLoading;return r.createElement(r.Fragment,null,r.createElement(p.ProductSetControl,t.__assign({},M,{smsTemplates:c.getFilteredTemplates(null==M?void 0:M.smsTemplates,null==R?void 0:R.smsTemplates),emailTemplates:c.getFilteredTemplates(null==M?void 0:M.emailTemplates,null==R?void 0:R.emailTemplates),showEmailTemplate:!!(null==M?void 0:M.emailTemplates),showSmsTemplate:!!(null==M?void 0:M.smsTemplates),isLoading:g,isCreateAction:x,companyName:v})),r.createElement(a.Row,null,r.createElement(a.Col,{md:6,sm:12}),r.createElement(a.Col,{className:"product-set-save-btn-wrapper p-0 pl-4 d-flex mw-100",md:6,sm:12},S&&r.createElement(a.Button,{className:"product-set-save-btn mt-5 ml-5 d-no dne d-md-block",onClick:y.handleSubmit(S),disabled:g||o||!R.name},P("save")),r.createElement(a.Button,{className:"product-set-save-btn mt-5 ml-5 d-no dne d-md-block",type:"submit",disabled:g||o||!R.name},P("saveAndClose")))))})))))};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { EmailTemplate } from "@licklist/core/dist/DataMapper/Notification/EmailTemplateDataMapper";
|
|
2
|
+
import { SmsTemplate } from "@licklist/core/dist/DataMapper/Notification/SmsTemplateDataMapper";
|
|
3
|
+
import { TemplateItem } from "../control/ProductSetControl";
|
|
1
4
|
export declare const moveArrayElements: <T>(array: T[], prevIndex: number, nextIndex: number) => T[];
|
|
2
5
|
export declare const sortArrayByIndex: <T>(array: T[]) => (T & {
|
|
3
6
|
sort: number;
|
|
4
7
|
})[];
|
|
8
|
+
export declare const getFilteredTemplates: (templates?: EmailTemplate[] | SmsTemplate[], formTemplates?: TemplateItem[]) => TemplateItem[] | undefined;
|
|
5
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/product-set/utils/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,6BAEjB,MAAM,aACN,MAAM,QAQlB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;IAE5B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/product-set/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,mEAAmE,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,eAAO,MAAM,iBAAiB,6BAEjB,MAAM,aACN,MAAM,QAQlB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;IAE5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,eACnB,aAAa,EAAE,GAAG,WAAW,EAAE,kBAC3B,YAAY,EAAE,KAC7B,YAAY,EAAE,GAAG,SAmBnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib");exports.getFilteredTemplates=function(i,e){var n;if(i)return null===(n=null==i?void 0:i.filter((function(i){return i.notification.isActive&&!(null==e?void 0:e.find((function(e){return e.value.notification.type===i.notification.type})))})))||void 0===n?void 0:n.map((function(i){var e;return{id:null==i?void 0:i.id,value:i,label:null===(e=null==i?void 0:i.notification)||void 0===e?void 0:e.name}}))},exports.moveArrayElements=function(e,n,t){var r=i.__spreadArray([],i.__read(e),!1);return r.splice(t,0,r.splice(n,1)[0]),r},exports.sortArrayByIndex=function(e){return e.map((function(e,n){return i.__assign(i.__assign({},e),{sort:n})}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderDetailsInput.d.ts","sourceRoot":"","sources":["../../../src/provider/provider-details-input/ProviderDetailsInput.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAE7E,OAAO,EAAa,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAEL,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,yBAAyB,CAAC;AAEjC,oBAAY,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;CACxB,GAAG,wBAAwB,CAAC;AAE7B,oBAAY,yBAAyB,GAAG;IACtC,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACtC,SAAS,CAAC,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAClD,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,gBAAqB,EACrB,SAAc,GACf,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"ProviderDetailsInput.d.ts","sourceRoot":"","sources":["../../../src/provider/provider-details-input/ProviderDetailsInput.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAE7E,OAAO,EAAa,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAEL,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,yBAAyB,CAAC;AAEjC,oBAAY,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;CACxB,GAAG,wBAAwB,CAAC;AAE7B,oBAAY,yBAAyB,GAAG;IACtC,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACtC,SAAS,CAAC,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAClD,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACnC,gBAAqB,EACrB,SAAc,GACf,EAAE,yBAAyB,eA+H3B"}
|
|
@@ -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 r=require("tslib"),t=e(require("react")),n=require("react-i18next"),
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("tslib"),t=e(require("react")),n=require("react-i18next"),i=require("react-bootstrap"),a=require("react-hook-form"),o=e(require("@licklist/plugins/dist/services/Form/HookFormService")),l=require("@react-aria/utils"),s=require("../../typeahead/Typeahead.js"),m=require("../provider-links-input/ProviderLinksInput.js");exports.ProviderDetailsInput=function(e){var d,u,p,c,v,g=e.companiesOptions,E=void 0===g?[]:g,F=e.linkTypes,b=void 0===F?[]:F,h=a.useFormContext(),I=h.register,q=h.formState.errors,y=n.useTranslation(["App","Design","Validation"]).t,f=l.useId(),D=l.useId(),k=l.useId(),_=l.useId(),C=l.useId(),w=l.useId();return t.createElement(t.Fragment,null,t.createElement(i.Form.Group,{controlId:f},t.createElement(i.Form.Label,null,y("Design:name")),t.createElement(i.Form.Control,r.__assign({},I("name",{required:y("Validation:fieldRequired",{attribute:y("Design:name")})}),{name:"name",required:!0,isInvalid:Boolean(q.name)})),t.createElement(i.Form.Control.Feedback,{type:"invalid"},o.hasError(q.name,"required")&&(null===(d=q.name)||void 0===d?void 0:d.message))),t.createElement(i.Form.Group,{controlId:D},t.createElement(i.Form.Label,null,y("Design:description")),t.createElement(i.Form.Control,r.__assign({},I("description"),{as:"textarea",name:"description",rows:6}))),t.createElement(i.Form.Group,{controlId:k},t.createElement(i.Form.Label,null,y("Design:email")),t.createElement(i.Form.Control,r.__assign({},I("email",{required:y("Validation:fieldRequired",{attribute:y("Design:email")}),pattern:{value:/^\S+@\S+$/,message:y("Validation:fieldValidEmail",{attribute:y("Design:email")})}}),{name:"email",type:"email",inputMode:"email",isInvalid:Boolean(q.email)})),t.createElement(i.Form.Control.Feedback,{type:"invalid"},o.hasError(q.email,"required")&&(null===(u=q.email)||void 0===u?void 0:u.message),o.hasError(q.email,"pattern")&&(null===(p=q.email)||void 0===p?void 0:p.message))),t.createElement(i.Form.Group,{controlId:_},t.createElement(i.Form.Label,null,y("Design:phone")),t.createElement(i.Form.Control,r.__assign({},I("phone",{required:y("Validation:fieldRequired",{attribute:y("Design:phone")})}),{name:"phone",type:"tel",inputMode:"tel",isInvalid:Boolean(q.phone)})),t.createElement(i.Form.Control.Feedback,{type:"invalid"},o.hasError(q.phone,"required")&&(null===(c=q.phone)||void 0===c?void 0:c.message))),t.createElement(i.Form.Group,{controlId:C},t.createElement(i.Form.Label,null,y("Design:website")),t.createElement(i.Form.Control,r.__assign({},I("website",{pattern:{value:/\S+\.\S+/,message:y("Validation:fieldInvalid",{attribute:y("Design:website")})}}),{name:"website",type:"url",inputMode:"url",isInvalid:Boolean(q.website)})),t.createElement(i.Form.Control.Feedback,{type:"invalid"},o.hasError(q.website,"pattern")&&(null===(v=q.website)||void 0===v?void 0:v.message))),E.length>1&&t.createElement(i.Form.Group,{controlId:w},t.createElement(i.Form.Label,null,y("Design:company")),t.createElement(s.Typeahead,{name:"company",options:E,placeholder:y("App:select"),noOptionsMessage:y("App:noMatchesFound")})),b.length>0&&t.createElement(m.ProviderLinksInput,{linkTypes:b}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMenu.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/select-menu/SelectMenu.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AAItF,oBAAY,eAAe,GAAG;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,UAAU,wCAIpB,eAAe,
|
|
1
|
+
{"version":3,"file":"SelectMenu.d.ts","sourceRoot":"","sources":["../../../../src/sales/manual-booking/select-menu/SelectMenu.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AAItF,oBAAY,eAAe,GAAG;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,UAAU,wCAIpB,eAAe,gBA4CjB,CAAC"}
|
|
@@ -45,6 +45,22 @@ $snippet-template-card-button-transition: $product-set-card-transition !default;
|
|
|
45
45
|
display: flex;
|
|
46
46
|
justify-content: space-between;
|
|
47
47
|
align-items: center;
|
|
48
|
+
|
|
49
|
+
a {
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
display: inline-block;
|
|
52
|
+
text-overflow: ellipsis;
|
|
53
|
+
width: 85%;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.snippet-template-card-subject {
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
display: inline-block;
|
|
61
|
+
text-overflow: ellipsis;
|
|
62
|
+
width: 100%;
|
|
63
|
+
overflow: hidden;
|
|
48
64
|
}
|
|
49
65
|
|
|
50
66
|
.snippet-template-card-button {
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare type TypeaheadOptions = {
|
|
3
|
-
id: number;
|
|
4
|
-
value:
|
|
3
|
+
id: number | string;
|
|
4
|
+
value: any;
|
|
5
5
|
label: string;
|
|
6
6
|
};
|
|
7
7
|
export interface TypeaheadProps {
|
|
8
8
|
options: TypeaheadOptions[];
|
|
9
|
-
setValue: (value: string | any) => void;
|
|
10
9
|
placeholder: string;
|
|
11
10
|
isRequired?: boolean;
|
|
12
11
|
name: string;
|
|
12
|
+
isMultipleChoise?: boolean;
|
|
13
13
|
noOptionsMessage: string;
|
|
14
14
|
}
|
|
15
|
-
declare function Typeahead({ options,
|
|
16
|
-
options: any;
|
|
17
|
-
setValue: any;
|
|
18
|
-
placeholder: any;
|
|
19
|
-
isRequired?: boolean;
|
|
20
|
-
name?: string;
|
|
21
|
-
noOptionsMessage?: string;
|
|
22
|
-
}): JSX.Element;
|
|
15
|
+
declare function Typeahead({ options, placeholder, isRequired, isMultipleChoise, name, noOptionsMessage, }: TypeaheadProps): JSX.Element;
|
|
23
16
|
export { Typeahead };
|
|
24
17
|
//# sourceMappingURL=Typeahead.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../src/typeahead/Typeahead.tsx"],"names":[],"mappings":";AAIA,oBAAY,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../src/typeahead/Typeahead.tsx"],"names":[],"mappings":";AAIA,oBAAY,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,iBAAS,SAAS,CAAC,EACjB,OAAO,EACP,WAAW,EACX,UAAkB,EAClB,gBAAgB,EAChB,IAAS,EACT,gBAAqB,GACtB,EAAE,cAAc,eAwBhB;AAED,OAAO,EAAE,SAAS,EAAE,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
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=e(require("react")),t=require("react-hook-form"),n=e(require("react-select"));exports.Typeahead=function(e){var o=e.options,l=e.placeholder,a=e.isRequired,i=void 0!==a&&a,u=e.isMultipleChoise,s=e.name,c=void 0===s?"":s,d=e.noOptionsMessage,p=void 0===d?"":d,f=t.useFormContext().control;return r.createElement(r.Fragment,null,r.createElement(t.Controller,{name:c,control:f,rules:{required:i},render:function(e){var t=e.field;return r.createElement(n,{placeholder:l,value:t.value,isMulti:u,onChange:function(e){t.onChange(e)},options:o,noOptionsMessage:function(){return r.createElement("span",null,p)}})}}))};
|
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next";
|
|
|
6
6
|
import { useIntl } from "react-intl";
|
|
7
7
|
|
|
8
8
|
import { useId } from "@react-aria/utils";
|
|
9
|
+
import { ProductSet } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
|
|
9
10
|
import HTMLInputDateElement from "../../types/static/HTMLInputDateElement";
|
|
10
11
|
import { RecurrenceInput } from "../../recurrence-input";
|
|
11
12
|
import { WarningMessage } from "../../static";
|
|
@@ -13,6 +14,8 @@ import { ProductSetFormValues } from "../../product-set/form";
|
|
|
13
14
|
|
|
14
15
|
interface IntervalInputProps {
|
|
15
16
|
editedProductSet?: ProductSetFormValues;
|
|
17
|
+
productSets?: ProductSet[];
|
|
18
|
+
productSetId?: number;
|
|
16
19
|
disabled?: boolean;
|
|
17
20
|
}
|
|
18
21
|
|
|
@@ -25,6 +28,8 @@ export interface IntervalInputValues {
|
|
|
25
28
|
export function IntervalInput({
|
|
26
29
|
disabled = false,
|
|
27
30
|
editedProductSet,
|
|
31
|
+
productSetId,
|
|
32
|
+
productSets,
|
|
28
33
|
}: IntervalInputProps) {
|
|
29
34
|
const { t } = useTranslation(["Design", "Validation"]);
|
|
30
35
|
const {
|
|
@@ -42,6 +47,7 @@ export function IntervalInput({
|
|
|
42
47
|
const start = watch("start");
|
|
43
48
|
const end = watch("end");
|
|
44
49
|
const [recurrent, setRecurrent] = useState(Boolean(rrule));
|
|
50
|
+
const [isOverriden, setIsOverriden] = useState(false);
|
|
45
51
|
const recurrentId = useId();
|
|
46
52
|
|
|
47
53
|
const startDateInput = useRef<HTMLInputDateElement | null>(null);
|
|
@@ -66,6 +72,18 @@ export function IntervalInput({
|
|
|
66
72
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
67
73
|
}, [editedProductSet]);
|
|
68
74
|
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (!productSets) return;
|
|
77
|
+
|
|
78
|
+
const isOverridenProductSet = productSets.find(
|
|
79
|
+
(productSet) =>
|
|
80
|
+
(editedProductSet && productSet?.id === editedProductSet?.id) ||
|
|
81
|
+
(Boolean(productSet?.parentMenuId) && productSet?.id === productSetId)
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
setIsOverriden(Boolean(isOverridenProductSet));
|
|
85
|
+
}, [productSets, productSetId, setIsOverriden, editedProductSet]);
|
|
86
|
+
|
|
69
87
|
return (
|
|
70
88
|
<>
|
|
71
89
|
<Form.Row className="interval-container">
|
|
@@ -129,9 +147,11 @@ export function IntervalInput({
|
|
|
129
147
|
{t("reccurentDescription", { item: t("event") })}
|
|
130
148
|
</Form.Text>
|
|
131
149
|
)}
|
|
132
|
-
<WarningMessage message={t("recurrentOverridesWarining")} />
|
|
133
150
|
</Form.Group>
|
|
134
151
|
)}
|
|
152
|
+
{isOverriden && (
|
|
153
|
+
<WarningMessage message={t("recurrentOverridesWarining")} />
|
|
154
|
+
)}
|
|
135
155
|
{recurrent && start && (
|
|
136
156
|
<Form.Group>
|
|
137
157
|
<Controller
|
|
@@ -121,6 +121,7 @@ export const EditEventForm = ({
|
|
|
121
121
|
|
|
122
122
|
const visible = watch("visible");
|
|
123
123
|
const editedProductSet = watch("editedProductSet");
|
|
124
|
+
const productSetId = watch("productSetId");
|
|
124
125
|
|
|
125
126
|
const {
|
|
126
127
|
images,
|
|
@@ -267,6 +268,8 @@ export const EditEventForm = ({
|
|
|
267
268
|
<IntervalInput
|
|
268
269
|
key={watch("rrule")}
|
|
269
270
|
disabled={disabled}
|
|
271
|
+
productSetId={productSetId}
|
|
272
|
+
productSets={productSets}
|
|
270
273
|
editedProductSet={editedProductSet}
|
|
271
274
|
/>
|
|
272
275
|
{categories.length !== 0 && (
|
|
@@ -11,6 +11,7 @@ import { ProductSetControl } from "../../../../../product-set";
|
|
|
11
11
|
import { ProductSetContextProvider } from "../../../../../product-set/form/context";
|
|
12
12
|
import { getDefaultValues } from "../../../utils/getDefaultProductSet";
|
|
13
13
|
import { EditEventFormValues } from "../../EditEventForm";
|
|
14
|
+
import { getFilteredTemplates } from "../../../../../product-set/utils/index";
|
|
14
15
|
|
|
15
16
|
export const DEFAULT_FEE = 5;
|
|
16
17
|
|
|
@@ -109,8 +110,16 @@ export const EditEventProductSet = ({
|
|
|
109
110
|
<FormProvider {...form}>
|
|
110
111
|
<Form className="mt-6">
|
|
111
112
|
<ProductSetControl
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
smsTemplates={getFilteredTemplates(
|
|
114
|
+
smsTemplates,
|
|
115
|
+
formValues?.smsTemplates
|
|
116
|
+
)}
|
|
117
|
+
emailTemplates={getFilteredTemplates(
|
|
118
|
+
emailTemplates,
|
|
119
|
+
formValues?.emailTemplates
|
|
120
|
+
)}
|
|
121
|
+
showEmailTemplate={!!emailTemplates}
|
|
122
|
+
showSmsTemplate={!!smsTemplates}
|
|
114
123
|
fieldSets={fieldSetsData}
|
|
115
124
|
isLoading={isLoading}
|
|
116
125
|
companyName={selectedCompany?.title}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
DEFAULT_PRODUCT_SET_TYPE,
|
|
4
4
|
ProductSet,
|
|
5
5
|
} from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
|
|
6
|
+
import { getFilteredTemplates } from "../../../product-set/utils/index";
|
|
6
7
|
import { ProductSetFormValues } from "../../../product-set/form/ProductSetForm";
|
|
7
8
|
|
|
8
9
|
export const getDefaultValues = (
|
|
@@ -17,13 +18,13 @@ export const getDefaultValues = (
|
|
|
17
18
|
thankYouPageUrl: productSet?.thankYouPageUrl ?? "",
|
|
18
19
|
isDefault: productSet?.isDefault ?? false,
|
|
19
20
|
fieldSetId: productSet?.fieldSetId,
|
|
20
|
-
|
|
21
|
+
emailTemplates:
|
|
21
22
|
productSet?.mailTemplates && productSet?.mailTemplates?.length > 0
|
|
22
|
-
? productSet?.mailTemplates
|
|
23
|
+
? getFilteredTemplates(productSet?.mailTemplates)
|
|
23
24
|
: undefined,
|
|
24
|
-
|
|
25
|
+
smsTemplates:
|
|
25
26
|
productSet?.smsTemplates && productSet?.smsTemplates?.length > 0
|
|
26
|
-
? productSet?.
|
|
27
|
+
? getFilteredTemplates(productSet?.mailTemplates)
|
|
27
28
|
: undefined,
|
|
28
29
|
steps:
|
|
29
30
|
productSet?.steps?.map(({ productCategories, ...step }) => ({
|
|
@@ -14,8 +14,10 @@ export const Default: Story<EmailTemplateCardProps> = (args) => (
|
|
|
14
14
|
|
|
15
15
|
Default.args = {
|
|
16
16
|
href: "#",
|
|
17
|
-
name: "Default Email Template",
|
|
18
|
-
subject: "Confirmation",
|
|
17
|
+
name: "Default Email Template with very long name",
|
|
18
|
+
subject: "Confirmation with looong subject text",
|
|
19
19
|
hasPermission: true,
|
|
20
20
|
isDefault: true,
|
|
21
|
+
templateType: "confirmation",
|
|
22
|
+
isActive: true,
|
|
21
23
|
};
|
|
@@ -2,16 +2,19 @@ import React from "react";
|
|
|
2
2
|
import { Link } from "react-router-dom";
|
|
3
3
|
import { HasPermissionProp } from "@licklist/plugins/dist/types/permission/Permission";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
|
-
|
|
5
|
+
import { NotificationType } from "@licklist/core/dist/DataMapper/Notification/NotificationTypeDataMapper";
|
|
6
6
|
import { ConfirmModal, ConfirmModalType } from "../../../modals";
|
|
7
7
|
import { Icon } from "../../../static";
|
|
8
|
+
import { useTranslatedParameters } from "../../hooks/useTranslatedParameters";
|
|
8
9
|
|
|
9
10
|
export interface EmailTemplateCardProps extends HasPermissionProp {
|
|
10
11
|
name: string;
|
|
11
12
|
subject: string;
|
|
12
13
|
href: string;
|
|
13
14
|
isDefault: boolean;
|
|
15
|
+
isActive: boolean;
|
|
14
16
|
onRemove: () => void;
|
|
17
|
+
type: NotificationType;
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
export function EmailTemplateCard({
|
|
@@ -20,10 +23,14 @@ export function EmailTemplateCard({
|
|
|
20
23
|
subject,
|
|
21
24
|
onRemove,
|
|
22
25
|
isDefault = false,
|
|
26
|
+
isActive = false,
|
|
23
27
|
hasPermission = true,
|
|
28
|
+
type,
|
|
24
29
|
}: EmailTemplateCardProps) {
|
|
25
30
|
const { t } = useTranslation(["Design"]);
|
|
26
31
|
|
|
32
|
+
const texts = useTranslatedParameters({ isDefault, isActive });
|
|
33
|
+
|
|
27
34
|
return (
|
|
28
35
|
<>
|
|
29
36
|
<div className="snippet-template-card">
|
|
@@ -53,8 +60,13 @@ export function EmailTemplateCard({
|
|
|
53
60
|
)}
|
|
54
61
|
</div>
|
|
55
62
|
<div className={`mt-${isDefault ? "3" : "4"}`}>
|
|
56
|
-
{
|
|
57
|
-
<
|
|
63
|
+
{!!texts.length && <p className="mb-1">{texts}</p>}
|
|
64
|
+
<div className="d-flex flex-column">
|
|
65
|
+
<span className="snippet-template-card-subject">{subject}</span>
|
|
66
|
+
<p className="mb-0">
|
|
67
|
+
{t(`Design:type`)}: {t(`Design:${type}`)}
|
|
68
|
+
</p>
|
|
69
|
+
</div>
|
|
58
70
|
</div>
|
|
59
71
|
</div>
|
|
60
72
|
</>
|