@licklist/design 0.59.0-dev.8 → 0.59.0-dev.9
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.
|
@@ -10,6 +10,7 @@ export type DashboardSettingFormFieldValues = {
|
|
|
10
10
|
isEnquiryOnly: boolean;
|
|
11
11
|
hasUserVerification: boolean;
|
|
12
12
|
metaPixelId?: number;
|
|
13
|
+
eventDeadlineErrorMessage?: string;
|
|
13
14
|
} & EventSettingFormFieldValues & ProviderSettingFormFieldValues;
|
|
14
15
|
export interface DashboardSettingFormProps extends HasPermissionProp {
|
|
15
16
|
isLoading: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardSettingForm.d.ts","sourceRoot":"","sources":["../../../src/setting/dashboard/DashboardSettingForm.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAM5E,OAAO,EAEL,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,+BAA+B,GAAG;IAC5C,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"DashboardSettingForm.d.ts","sourceRoot":"","sources":["../../../src/setting/dashboard/DashboardSettingForm.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAM5E,OAAO,EAEL,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,+BAA+B,GAAG;IAC5C,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,GAAG,2BAA2B,GAC7B,8BAA8B,CAAC;AAYjC,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,+BAA+B,KAAK,IAAI,CAAC;IAC3D,aAAa,CAAC,EAAE,OAAO,CAAC,+BAA+B,CAAC,CAAC;IACzD,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED,eAAO,MAAM,oBAAoB,yEAM9B,yBAAyB,gBAkN3B,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 r=require("tslib"),t=require("react"),
|
|
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"),n=e(t),a=require("react-i18next"),o=e(require("react-bootstrap/Row")),l=e(require("react-bootstrap/Col")),i=require("react-bootstrap"),s=require("react-hook-form"),d=e(require("@licklist/plugins/dist/services/Form/HookFormService")),m=e(require("@licklist/plugins/dist/services/Form/FormErrorService")),c=e(require("react-bootstrap/Form")),u=require("@react-aria/utils"),v=require("../../static/switch/BooleanSwitch.js");require("../../static/index.js");var E=require("../../help/popover/HelpPopover.js"),p=require("./EventSettingForm.js"),b=require("./ProviderSettingForm.js");exports.DashboardSettingForm=function(e){var g,f,h,F=e.isLoading,I=void 0!==F&&F,S=e.defaultValues,q=void 0===S?{}:S,C=e.onSubmit,x=e.hasPermission,P=void 0===x||x,B=e.serverErrors,_=s.useForm({mode:"onChange",defaultValues:r.__assign({},q)}),L=_.register,O=_.handleSubmit,R=_.formState,y=R.errors,V=R.isValid,k=R.isDirty,j=_.setError,D=a.useTranslation(["Design","Validation"]).t;t.useEffect((function(){m.handleServerErrors(B,j)}),[B,j]);var w=u.useId(),G=u.useId(),H=u.useId(),M=u.useId(),N=u.useId(),A=u.useId(),U=[{id:1,value:D("groupItemsByOrder")}];return n.createElement(c,{className:"d-flex flex-column",noValidate:!0,onSubmit:O(C)},n.createElement(s.FormProvider,r.__assign({},_),n.createElement(o,null,n.createElement(l,{xs:12,sm:6},n.createElement(c.Group,{controlId:w},n.createElement(c.Label,null,D("notificationOnEachOrder")," ",n.createElement(E.HelpPopover,{variant:"info"},D("notificationOnEachOrderHelp"))),n.createElement(s.Controller,{render:function(e){var r=e.field,t=r.name,a=r.value,o=r.onChange;return n.createElement(v.BooleanSwitch,{name:t,value:Boolean(a),onChange:d.booleanAsNumber(o),disabled:I})},name:"notificationOnEachOrder",control:_.control})),n.createElement(c.Group,{controlId:G},n.createElement(c.Label,null,D("orderReportOnEventStart")," ",n.createElement(E.HelpPopover,{variant:"info"},D("orderReportOnEventStartHelp"))),n.createElement(s.Controller,{render:function(e){var r=e.field,t=r.name,a=r.value,o=r.onChange;return n.createElement(v.BooleanSwitch,{name:t,value:Boolean(a),onChange:d.booleanAsNumber(o),disabled:I})},name:"orderReportOnEventStart",control:_.control})),n.createElement(c.Group,{controlId:M},n.createElement(c.Label,null,D("hasUserVerification")),n.createElement(s.Controller,{render:function(e){var r=e.field,t=r.name,a=r.value,o=r.onChange;return n.createElement(v.BooleanSwitch,{name:t,value:Boolean(a),onChange:o,disabled:I})},name:"hasUserVerification",control:_.control})),n.createElement(c.Group,{controlId:N},n.createElement(c.Label,null,D("metaPixelId")),n.createElement(c.Control,r.__assign({type:"number"},L("metaPixelId",{minLength:{value:15,message:D("Validation:fieldMinLength",{attribute:D("metaPixelId"),min:15})}}),{isInvalid:Boolean(y.metaPixelId),disabled:I})),n.createElement(c.Control.Feedback,{type:"invalid"},null===(g=y.metaPixelId)||void 0===g?void 0:g.message))),n.createElement(l,{xs:12,sm:6},n.createElement(c.Group,{controlId:H},n.createElement(c.Label,null,D("orderReportFormat")),n.createElement(c.Control,r.__assign({as:"select"},L("orderReportFormat",{required:D("Validation:fieldRequired",{attribute:D("orderReportFormat")}),valueAsNumber:!0}),{name:"orderReportFormat",isInvalid:Boolean(y.orderReportFormat),disabled:I}),U.map((function(e){return n.createElement("option",{value:e.id,key:e.id},e.value)}))),n.createElement(c.Control.Feedback,{type:"invalid"},null===(f=y.orderReportFormat)||void 0===f?void 0:f.message)))),n.createElement(p.EventSettingForm,{isLoading:I}),n.createElement(b.ProviderSettingForm,{isLoading:I}),n.createElement(c.Group,{controlId:A},n.createElement(c.Label,null,D("eventDeadlineErrorMessage")),n.createElement(c.Control,r.__assign({},L("eventDeadlineErrorMessage"),{isInvalid:Boolean(y.eventDeadlineErrorMessage),disabled:I})),n.createElement(c.Control.Feedback,{type:"invalid"},null===(h=y.eventDeadlineErrorMessage)||void 0===h?void 0:h.message))),P&&n.createElement(i.Button,{type:"submit",disabled:I||!V||!k,className:"d-flex align-items-center align-self-end"},I&&n.createElement(i.Spinner,{animation:"border",size:"sm",role:"status","aria-hidden":"true",className:"mr-2"}),D("update")))};
|
package/package.json
CHANGED
|
@@ -31,6 +31,7 @@ export type DashboardSettingFormFieldValues = {
|
|
|
31
31
|
isEnquiryOnly: boolean;
|
|
32
32
|
hasUserVerification: boolean;
|
|
33
33
|
metaPixelId?: number;
|
|
34
|
+
eventDeadlineErrorMessage?: string;
|
|
34
35
|
} & EventSettingFormFieldValues &
|
|
35
36
|
ProviderSettingFormFieldValues;
|
|
36
37
|
|
|
@@ -81,6 +82,7 @@ export const DashboardSettingForm = ({
|
|
|
81
82
|
const orderReportFormatId = useId();
|
|
82
83
|
const userVerificationId = useId();
|
|
83
84
|
const metaPixelId = useId();
|
|
85
|
+
const eventDeadlineErrorMessageId = useId();
|
|
84
86
|
|
|
85
87
|
const orderReportFormatList: SelectItem[] = [
|
|
86
88
|
{ id: 1, value: t("groupItemsByOrder") },
|
|
@@ -234,6 +236,17 @@ export const DashboardSettingForm = ({
|
|
|
234
236
|
<EventSettingForm isLoading={isLoading} />
|
|
235
237
|
|
|
236
238
|
<ProviderSettingForm isLoading={isLoading} />
|
|
239
|
+
<Form.Group controlId={eventDeadlineErrorMessageId}>
|
|
240
|
+
<Form.Label>{t("eventDeadlineErrorMessage")}</Form.Label>
|
|
241
|
+
<Form.Control
|
|
242
|
+
{...register("eventDeadlineErrorMessage")}
|
|
243
|
+
isInvalid={Boolean(errors.eventDeadlineErrorMessage)}
|
|
244
|
+
disabled={isLoading}
|
|
245
|
+
/>
|
|
246
|
+
<Form.Control.Feedback type="invalid">
|
|
247
|
+
{errors.eventDeadlineErrorMessage?.message}
|
|
248
|
+
</Form.Control.Feedback>
|
|
249
|
+
</Form.Group>
|
|
237
250
|
</FormProvider>
|
|
238
251
|
{hasPermission && (
|
|
239
252
|
<Button
|