@licklist/design 0.66.5 → 0.66.7-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.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/iframe/page/components/PageBody/PageBody.d.ts +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts +2 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
- package/dist/notification/email-template/card/EmailTemplateCard.d.ts +2 -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.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.js +1 -1
- package/dist/notification/sms-template/card/SmsTemplateCard.d.ts +2 -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/product-set/control/DateAndRecurrenceInput.d.ts +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.js +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts +1 -1
- 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/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts +4 -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/hooks/useSortableTreeFunctions.d.ts.map +1 -1
- package/dist/product-set/hooks/useSortableTreeFunctions.js +1 -1
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +3 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
- package/dist/recurring-date-picker-input/utils.d.ts +5 -0
- package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/utils.js +1 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
- package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/styles/snippet-templates/SnippetTemplateCard.scss +3 -0
- package/dist/styles/zones/ZoneForm.scss +2 -1
- package/dist/zone/form/ZoneForm.d.ts +2 -2
- package/dist/zone/form/ZoneForm.d.ts.map +1 -1
- package/dist/zone/form/ZoneForm.js +1 -1
- package/dist/zone/form/components/ZoneControl.d.ts +2 -2
- package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneControl.js +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -4
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
- package/dist/zone/form/utils/dates.d.ts.map +1 -1
- package/package.json +5 -6
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +6 -8
- package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +1 -0
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +0 -1
- package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +8 -2
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -0
- package/src/notification/email-template/card/EmailTemplateCard.tsx +43 -36
- package/src/notification/email-template/control/EmailTemplateControl.tsx +1 -0
- package/src/notification/sms-template/card/SmsTemplateCard.tsx +9 -0
- package/src/product-set/control/DateAndRecurrenceInput.tsx +3 -4
- package/src/product-set/control/ProductSetControl.tsx +8 -3
- package/src/product-set/form/ProductCategoriesControl.tsx +3 -2
- package/src/product-set/form/ProductSetForm.tsx +10 -2
- package/src/product-set/hooks/useSortableTreeFunctions.ts +0 -1
- package/src/product-set/product/ProductControl.tsx +1 -1
- package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +4 -18
- package/src/recurring-date-picker-input/RecurringDatePickerInput.stories.tsx +13 -7
- package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +12 -1
- package/src/recurring-date-picker-input/utils.ts +90 -1
- package/src/sales/booking/results/components/ResultCard.tsx +0 -3
- package/src/setting/admin/AdminSettingForm.tsx +2 -2
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/styles/snippet-templates/SnippetTemplateCard.scss +3 -0
- package/src/styles/zones/ZoneForm.scss +2 -1
- package/src/zone/form/ZoneForm.tsx +3 -2
- package/src/zone/form/components/ZoneControl.tsx +3 -3
- package/src/zone/form/components/ZoneRecurrencesControl.tsx +7 -5
- package/src/zone/form/utils/dates.ts +9 -10
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
|
|
2
|
+
import { Validate } from "react-hook-form";
|
|
1
3
|
import { Frequency, Weekday } from "rrule";
|
|
2
4
|
export declare const getWeekdayForFrequency: ({ date, frequency, }: {
|
|
3
5
|
date: string;
|
|
@@ -15,4 +17,7 @@ export declare const parseAndValidateRRule: ({ rrule, date, }: {
|
|
|
15
17
|
rrule: string;
|
|
16
18
|
date: string;
|
|
17
19
|
}) => ParsedRRuleOptions;
|
|
20
|
+
export declare const useWorkHoursValidation: (byWeekDay: Weekday[], workHours: WorkHour[] | undefined) => {
|
|
21
|
+
validate?: Validate<string>;
|
|
22
|
+
};
|
|
18
23
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/utils.ts"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAElD,eAAO,MAAM,sBAAsB;UAI3B,MAAM;eACD,SAAS;MAClB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAGtF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAElD,eAAO,MAAM,sBAAsB;UAI3B,MAAM;eACD,SAAS;MAClB,OAWH,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B,SAAS,CAAC,KAAK,GACf,SAAS,CAAC,MAAM,GAChB,SAAS,CAAC,OAAO,GACjB,SAAS,CAAC,MAAM,CAAC;AAErB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,qBAAqB;WAIzB,MAAM;UACP,MAAM;wBAsEb,CAAC;AAEF,eAAO,MAAM,sBAAsB,cACtB,OAAO,EAAE,aACT,QAAQ,EAAE,GAAG,SAAS,KAChC;IACD,QAAQ,CAAC,EAAE,SAAS,MAAM,CAAC,CAAC;CA6E7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("@licklist/core/dist/Config"),t=require("react-i18next"),n=require("luxon"),i=require("rrule"),u=(e=i)&&"object"==typeof e&&"default"in e?e.default:e,o=require("@licklist/plugins/dist/utils/dateTime"),a=function(e){var r=e.date,t=e.frequency,u=n.DateTime.fromISO(r);return new i.Weekday(u.weekday-1,t!==i.Frequency.MONTHLY?void 0:u.day+7>u.daysInMonth?-1:Math.floor(u.day/7)+1)};exports.getWeekdayForFrequency=a,exports.parseAndValidateRRule=function(e){var r,t,n=e.rrule,o=e.date,d="Unsupported RRule",f=new Set(["interval","freq","byweekday","until","count"]),l=new Set([i.Frequency.DAILY,i.Frequency.WEEKLY,i.Frequency.MONTHLY,i.Frequency.YEARLY]),s=u.parseString(n.includes("EXDATE")?n.split(";EXDATE=")[0]:n);if(Object.keys(s).some((function(e){return!f.has(e)}))||void 0===s.freq||!l.has(s.freq)||s.until&&s.count)throw new Error(d);if(s.byweekday){var c=s.byweekday;if(s.freq===i.Frequency.WEEKLY){if(c.some((function(e){return void 0!==e.n})))throw new Error(d)}else{if(s.freq!==i.Frequency.MONTHLY)throw new Error(d);var y=a({date:o,frequency:i.Frequency.MONTHLY});if(c.length>1||(null===(r=c[0])||void 0===r?void 0:r.weekday)!==y.weekday||(null===(t=c[0])||void 0===t?void 0:t.n)!==y.n)throw new Error(d)}}return{interval:s.interval,freq:s.freq,byweekday:s.byweekday,count:s.count,until:s.until}},exports.useWorkHoursValidation=function(e,i){void 0===e&&(e=[]);var u=t.useTranslation("Validation").t;if(!i)return{};var a=o.fromFormat(r.TIME_FORMAT),d=o.fromFormat(r.TIME_FULL_FORMAT),f=i.map((function(e,r,t){var i=[],u=a(e.start),o=a(e.end);o>u?i.push(n.Interval.fromDateTimes(u,o)):i.push(n.Interval.fromDateTimes(u,u.endOf("day")));var d=0===r?t.length-1:r-1,f=a(t[d].start),l=a(t[d].end);return f>l&&i.push(n.Interval.fromDateTimes(l.startOf("day"),l)),i}));return[0,7].includes(e.length)||(f=f.filter((function(r,t){return e.find((function(e){return e.weekday===t}))}))),{validate:function(e){var r=a(e).isValid?a(e):d(e),t=f.reduce((function(e,t){return t.some((function(e){return e.contains(r)}))||e.push(t),e}),[]),n=t.flat().filter((function(e){return!e.contains(r)})).map((function(e){return e.toFormat("HH:mm")})).join(", ");return 0===t.length||u("outsideWorkingHours",{attribute:n})}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultCard.d.ts","sourceRoot":"","sources":["../../../../../src/sales/booking/results/components/ResultCard.tsx"],"names":[],"mappings":";AAKA,OAAO,EACL,KAAK,EAEN,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAC;
|
|
1
|
+
{"version":3,"file":"ResultCard.d.ts","sourceRoot":"","sources":["../../../../../src/sales/booking/results/components/ResultCard.tsx"],"names":[],"mappings":";AAKA,OAAO,EACL,KAAK,EAEN,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAC;AAO1E,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,UAAU,oDAKpB,eAAe,gBA2FjB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { HasPermissionProp } from "@licklist/plugins/dist/types/permission/Permission";
|
|
3
|
-
import {
|
|
3
|
+
import { ProvidableType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
|
|
4
4
|
import { PaymentFeeFormFieldValues } from "./PaymentFeeForm";
|
|
5
5
|
import { Currency } from "../../types/currency";
|
|
6
6
|
export type AdminSettingFormFieldValues = {
|
|
@@ -19,7 +19,7 @@ export interface AdminSettingFormProps extends HasPermissionProp {
|
|
|
19
19
|
providerMetadata: {
|
|
20
20
|
country?: string;
|
|
21
21
|
providableId?: number;
|
|
22
|
-
providerType?:
|
|
22
|
+
providerType?: ProvidableType;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
export declare const AdminSettingForm: ({ isLoading, defaultValues, onSubmit, currencies, hasPermission, providerMetadata, }: AdminSettingFormProps) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminSettingForm.d.ts","sourceRoot":"","sources":["../../../src/setting/admin/AdminSettingForm.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AAOvF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AdminSettingForm.d.ts","sourceRoot":"","sources":["../../../src/setting/admin/AdminSettingForm.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AAOvF,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAE9F,OAAO,EAAkB,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,MAAM,2BAA2B,GAAG;IACxC,uBAAuB,EAAE,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,IAAI,GAAG,OAAO,CAAC;IAC/B,oBAAoB,EAAE,IAAI,GAAG,OAAO,CAAC;IACrC,+BAA+B,EAAE,IAAI,GAAG,OAAO,CAAC;IAChD,0BAA0B,EAAE,IAAI,GAAG,OAAO,CAAC;CAC5C,GAAG,yBAAyB,CAAC;AAE9B,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,IAAI,CAAC;IACvD,aAAa,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACrD,UAAU,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7B,gBAAgB,EAAE;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,cAAc,CAAC;KAC/B,CAAC;CACH;AAED,eAAO,MAAM,gBAAgB,yFAO1B,qBAAqB,gBAwJvB,CAAC"}
|
|
@@ -7,10 +7,10 @@ export type ZoneFormProps = {
|
|
|
7
7
|
onSubmit: (values: Partial<Zone>) => void;
|
|
8
8
|
serverErrors?: ServerError;
|
|
9
9
|
isLoading?: boolean;
|
|
10
|
-
workHours
|
|
10
|
+
workHours: WorkHour[] | undefined;
|
|
11
11
|
};
|
|
12
12
|
export type ZoneFormValues = Partial<Zone> & {
|
|
13
13
|
localImageBlobURL?: string;
|
|
14
14
|
};
|
|
15
|
-
export declare const ZoneForm: ({ defaultValues, onSubmit, serverErrors, isLoading, }: ZoneFormProps) => JSX.Element;
|
|
15
|
+
export declare const ZoneForm: ({ defaultValues, onSubmit, serverErrors, isLoading, workHours, }: ZoneFormProps) => JSX.Element;
|
|
16
16
|
//# sourceMappingURL=ZoneForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoneForm.d.ts","sourceRoot":"","sources":["../../../src/zone/form/ZoneForm.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAGtF,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,
|
|
1
|
+
{"version":3,"file":"ZoneForm.d.ts","sourceRoot":"","sources":["../../../src/zone/form/ZoneForm.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAGtF,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,QAAQ,qEAMlB,aAAa,gBAiDf,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"),o=e(t),n=require("react-i18next"),s=require("react-bootstrap"),a=require("react-hook-form"),l=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 r=require("tslib"),t=require("react"),o=e(t),n=require("react-i18next"),s=require("react-bootstrap"),a=require("react-hook-form"),l=e(require("@licklist/plugins/dist/services/Form/FormErrorService")),u=require("./components/ZoneControl.js");exports.ZoneForm=function(e){var i=e.defaultValues,c=e.onSubmit,m=e.serverErrors,d=e.isLoading,f=void 0!==d&&d,b=e.workHours,p=n.useTranslation("Design").t,v=a.useForm({mode:"onChange",defaultValues:{zoneRecurrences:[]}}),E=v.reset,g=v.setError,q=v.handleSubmit,w=(0,v.watch)();return t.useEffect((function(){i&&E(i)}),[i,E]),t.useEffect((function(){m&&l.handleServerErrors(m,g)}),[m,g]),o.createElement(a.FormProvider,r.__assign({},v),o.createElement(s.Form,{onSubmit:q((function(e){e.localImageBlobURL;var t=r.__rest(e,["localImageBlobURL"]);c(t)}))},o.createElement(u.ZoneControl,{isLoading:f,workHours:b}),o.createElement(s.Row,null,o.createElement(s.Col,{md:6,sm:12}),o.createElement(s.Col,{className:"product-set-save-btn-wrapper p-0 pl-4 d-flex mw-100",md:6,sm:12},o.createElement(s.Button,{className:"product-set-save-btn mt-5 ml-5 d-no dne d-md-block",type:"submit",disabled:f||!w.name},p("saveAndClose"))))))};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
|
|
3
3
|
export type ZoneControlProps = {
|
|
4
4
|
isLoading: boolean;
|
|
5
|
-
workHours
|
|
5
|
+
workHours: WorkHour[] | undefined;
|
|
6
6
|
};
|
|
7
|
-
export declare const ZoneControl: ({ isLoading }: ZoneControlProps) => JSX.Element;
|
|
7
|
+
export declare const ZoneControl: ({ isLoading, workHours }: ZoneControlProps) => JSX.Element;
|
|
8
8
|
//# sourceMappingURL=ZoneControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoneControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneControl.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAStF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,
|
|
1
|
+
{"version":3,"file":"ZoneControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneControl.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAStF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,WAAW,6BAA8B,gBAAgB,gBA0BrE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),o=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,t=require("react-bootstrap"),n=require("./NameControl.js"),l=require("./ZoneTypeControl.js"),a=require("./SortControl.js"),i=require("./ZoneRecurrencesControl.js"),s=require("./DescriptionControl.js"),m=require("./ZoneImageControl.js"),c=require("./GameDurationControl.js");exports.ZoneControl=function(e){var r=e.isLoading,u=e.workHours;return o.createElement(t.Row,null,o.createElement(t.Col,{md:6,sm:12,className:"pr-5"},o.createElement(n.NameControl,{isLoading:r}),o.createElement(i.ZoneRecurrencesControl,{workHours:u}),o.createElement("hr",null),o.createElement(t.Row,null,o.createElement(t.Col,{md:6,sm:6},o.createElement(l.ZoneTypeControl,{isLoading:r}),o.createElement(a.SortControl,{isLoading:r}),o.createElement(c.GameDurationControl,{isLoading:r})),o.createElement(t.Col,{md:6,sm:6},o.createElement(m.ZoneImageControl,{isLoading:r}))),o.createElement("hr",null),o.createElement(t.Row,null,o.createElement(t.Col,{md:12,sm:12},o.createElement(s.DescriptionControl,{isLoading:r})))))};
|
|
@@ -4,9 +4,9 @@ import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMa
|
|
|
4
4
|
export interface DateAndRecurrenceInputValues {
|
|
5
5
|
zoneRecurrences?: Partial<ZoneRecurrence>[];
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
workHours
|
|
9
|
-
isLoading?: boolean;
|
|
7
|
+
type ZoneRecurrenceControlProps = {
|
|
8
|
+
workHours: WorkHour[] | undefined;
|
|
10
9
|
};
|
|
11
|
-
export declare const ZoneRecurrencesControl: () => JSX.Element;
|
|
10
|
+
export declare const ZoneRecurrencesControl: ({ workHours, }: ZoneRecurrenceControlProps) => JSX.Element;
|
|
11
|
+
export {};
|
|
12
12
|
//# sourceMappingURL=ZoneRecurrencesControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoneRecurrencesControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneRecurrencesControl.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAMlG,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAWtF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;CAC7C;AAED,
|
|
1
|
+
{"version":3,"file":"ZoneRecurrencesControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneRecurrencesControl.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAMlG,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAWtF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;CAC7C;AAED,KAAK,0BAA0B,GAAG;IAChC,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,mBAEhC,0BAA0B,gBAuM5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("tslib"),t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-bootstrap"),a=require("../../../static/Icon.js"),u=require("react-hook-form"),l=require("@react-aria/utils"),c=require("react-use");require("../../../static/index.js");var d=require("@dnd-kit/core"),s=require("@dnd-kit/sortable"),m=require("../../../modals/confirmation/ConfirmModal.js"),v=require("../../../recurring-date-picker-input/RecurringDatePickerInput.js"),f=require("../../../product-set/control/DateAndRecurrenceInput.js"),p=require("./ZoneRecurrenceControl.js");exports.ZoneRecurrencesControl=function(){var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("tslib"),t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-bootstrap"),a=require("../../../static/Icon.js"),u=require("react-hook-form"),l=require("@react-aria/utils"),c=require("react-use");require("../../../static/index.js");var d=require("@dnd-kit/core"),s=require("@dnd-kit/sortable"),m=require("../../../modals/confirmation/ConfirmModal.js"),v=require("../../../recurring-date-picker-input/RecurringDatePickerInput.js"),f=require("../../../product-set/control/DateAndRecurrenceInput.js"),p=require("./ZoneRecurrenceControl.js");exports.ZoneRecurrencesControl=function(e){var g,_,E=e.workHours,q=u.useFormContext(),x=q.control,C=q.register,D=q.formState.errors,R=q.getValues,b=q.setValue,k=q.clearErrors,y=u.useFieldArray({name:"zoneRecurrences",control:x,keyName:"_id"}),I=y.fields,S=y.append,z=y.update,N=y.move,h=r.__read(t.useState(!1),2),j=h[0],w=h[1],T=r.__read(t.useState({index:null,values:null}),2),A=T[0],F=T[1],M=function(){return F({index:null,values:null})},P=t.useRef();c.useClickAway(P,(function(e){var r,t,n;m.CONFIRM_MODAL_ACTIONS.includes(null===(n=null===(t=null===(r=e.target)||void 0===r?void 0:r.attributes)||void 0===t?void 0:t.getNamedItem("data-id"))||void 0===n?void 0:n.value)||(w(!1),M())}));var O=l.useId(),V=i.useTranslation(["Design","Validation"]).t,L=function(){M(),w((function(e){return!e}))};return t.useEffect((function(){I.length&&k("zoneRecurrences")}),[I,k]),n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,V("zoneAvailable")),n.createElement(o.OverlayTrigger,{show:j,overlay:n.createElement(o.Popover,{id:O,className:"rounded"},n.createElement(o.Popover.Content,{className:"shadow-lg rounded",ref:P},n.createElement(v.RecurringDatePickerInput,{defaultValues:A.values,onChange:function(e){return r.__awaiter(void 0,void 0,void 0,(function(){var t,n,i;return r.__generator(this,(function(r){return t={rrule:e.rrule,startDate:e.startDate,endDate:e.endDate,startTime:e.startTime,endTime:e.endTime},(null===(n=A.values)||void 0===n?void 0:n.id)&&(t.id=null===(i=A.values)||void 0===i?void 0:i.id),null!==A.index?z(A.index,t):S(t),w((function(){return!1})),M(),[2]}))}))},onDelete:function(){var e=A.index;w(!1),M(),setTimeout((function(){var r=R().zoneRecurrences;b("zoneRecurrences",(void 0===r?[]:r).filter((function(r,t){return t!==e})))}),100)},setInitialStartDateAfterSelect:!0,workHours:E}))),trigger:"click",placement:"bottom",popperConfig:{modifiers:[f.sameWidthPopperModifier]}},n.createElement("div",{className:"zone-recurrences"},n.createElement(d.DndContext,{onDragEnd:function(e){var r=e.over,t=e.active;if(r.id!==t.id){var n=I.findIndex((function(e){return String(e._id)===t.id})),i=I.findIndex((function(e){return String(e._id)===r.id}));N(n,i)}}},n.createElement(s.SortableContext,{items:null!==(g=null==I?void 0:I.map((function(e){return String(e._id)})))&&void 0!==g?g:[],strategy:s.verticalListSortingStrategy},null==I?void 0:I.map((function(e,r){return n.createElement(p.ZoneRecurrenceControl,{key:e._id,zoneRecurrence:e,onEdit:function(){return function(e,r){M(),F({index:r,values:e}),w((function(){return!0}))}(e,r)}})})))),n.createElement("div",{className:"zone-recurrence-icon-wrapper",role:"button",tabIndex:0,onClick:L,onKeyDown:L},n.createElement(a.default,{type:"plus-circle",height:"1rem",className:"zone-recurrence-icon-add mr-2"}),V("addDates")),n.createElement(o.Form.Control,r.__assign({type:"hidden"},C("zoneRecurrences",{required:{value:!0,message:V("Validation:fieldMinNumber",{attribute:V("dates"),min:1})}}))),n.createElement("div",{className:"manual-form-error"},null===(_=D.zoneRecurrences)||void 0===_?void 0:_.message))))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/utils/dates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAOtF,eAAO,MAAM,qBAAqB,cACrB,MAAM,WACR,MAAM,6BAuChB,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/utils/dates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAOtF,eAAO,MAAM,qBAAqB,cACrB,MAAM,WACR,MAAM,6BAuChB,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,QAAQ,EAAE,aAyC9D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.66.
|
|
3
|
+
"version": "0.66.7-dev.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"@fortawesome/free-brands-svg-icons": "5.15.2",
|
|
51
51
|
"@fortawesome/free-solid-svg-icons": "5.15.2",
|
|
52
52
|
"@fortawesome/react-fontawesome": "0.1.9",
|
|
53
|
-
"@licklist/core": "0.28.
|
|
53
|
+
"@licklist/core": ">=0.28.0-dev.0 < 0.28.0",
|
|
54
54
|
"@licklist/eslint-config": "0.4.5",
|
|
55
|
-
"@licklist/plugins": "0.30.
|
|
55
|
+
"@licklist/plugins": ">=0.30.0-dev.1 < 0.30.0",
|
|
56
56
|
"@mdx-js/react": "1.6.22",
|
|
57
57
|
"@popperjs/core": "2.11.8",
|
|
58
58
|
"@react-aria/utils": "3.9.0",
|
|
@@ -116,7 +116,6 @@
|
|
|
116
116
|
"emojibase": "6.1.0",
|
|
117
117
|
"emojibase-data": "7.0.1",
|
|
118
118
|
"emojibase-regex": "6.0.1",
|
|
119
|
-
"enzyme": "3.11.0",
|
|
120
119
|
"eslint": "7.32.0",
|
|
121
120
|
"eslint-config-airbnb": "18.2.1",
|
|
122
121
|
"eslint-config-prettier": "8.3.0",
|
|
@@ -177,7 +176,8 @@
|
|
|
177
176
|
},
|
|
178
177
|
"resolutions": {
|
|
179
178
|
"@types/react": "17.0.2",
|
|
180
|
-
"@types/react-dom": "17.0.2"
|
|
179
|
+
"@types/react-dom": "17.0.2",
|
|
180
|
+
"cheerio": "0.22.0"
|
|
181
181
|
},
|
|
182
182
|
"lint-staged": {
|
|
183
183
|
"*.{ts,tsx}": [
|
|
@@ -188,7 +188,6 @@
|
|
|
188
188
|
"devDependencies": {
|
|
189
189
|
"@types/react": "17.0.2",
|
|
190
190
|
"@types/react-dom": "17.0.2",
|
|
191
|
-
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
|
|
192
191
|
"identity-obj-proxy": "^3.0.0"
|
|
193
192
|
},
|
|
194
193
|
"volta": {
|
package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx
CHANGED
|
@@ -206,14 +206,12 @@ export const SelectEventProductSet = ({
|
|
|
206
206
|
</Form.Group>
|
|
207
207
|
</div>
|
|
208
208
|
{showEditProductSet && productSetId && (
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
/>
|
|
216
|
-
</>
|
|
209
|
+
<EditEventProductSet
|
|
210
|
+
onSubmit={onSubmit}
|
|
211
|
+
defaultValues={
|
|
212
|
+
productSetId === editedProductSet?.id && editedProductSet
|
|
213
|
+
}
|
|
214
|
+
/>
|
|
217
215
|
)}
|
|
218
216
|
</>
|
|
219
217
|
);
|
|
@@ -9,6 +9,7 @@ export type LeftBlockProps = PropsWithChildren<
|
|
|
9
9
|
pageTitle?: ReactNode;
|
|
10
10
|
component?: ReactNode;
|
|
11
11
|
childrenClassName?: string;
|
|
12
|
+
hasScroll?: boolean;
|
|
12
13
|
} & HTMLAttributes<HTMLDivElement>
|
|
13
14
|
>;
|
|
14
15
|
|
|
@@ -17,6 +18,7 @@ export const LeftBlock = ({
|
|
|
17
18
|
children,
|
|
18
19
|
className,
|
|
19
20
|
component,
|
|
21
|
+
hasScroll = true,
|
|
20
22
|
childrenClassName,
|
|
21
23
|
...props
|
|
22
24
|
}: LeftBlockProps) => {
|
|
@@ -41,10 +43,14 @@ export const LeftBlock = ({
|
|
|
41
43
|
</div>
|
|
42
44
|
<div
|
|
43
45
|
className={clsx("left-block-container", childrenClassName)}
|
|
44
|
-
style={leftBlockStyles}
|
|
46
|
+
style={hasScroll ? leftBlockStyles : undefined}
|
|
45
47
|
id={PAGE_LEFT_BLOCK_CONTAINER_ID}
|
|
46
48
|
>
|
|
47
|
-
<PageContextProvider
|
|
49
|
+
<PageContextProvider
|
|
50
|
+
leftBlockContainerSizes={
|
|
51
|
+
hasScroll ? leftBlockContainerSizes : undefined
|
|
52
|
+
}
|
|
53
|
+
>
|
|
48
54
|
{children}
|
|
49
55
|
</PageContextProvider>
|
|
50
56
|
</div>
|
|
@@ -14,6 +14,7 @@ export interface EmailTemplateCardProps extends HasPermissionProp {
|
|
|
14
14
|
isDefault: boolean;
|
|
15
15
|
isActive: boolean;
|
|
16
16
|
onRemove: () => void;
|
|
17
|
+
onDuplicate: () => void;
|
|
17
18
|
type: NotificationType;
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -22,6 +23,7 @@ export function EmailTemplateCard({
|
|
|
22
23
|
href,
|
|
23
24
|
subject,
|
|
24
25
|
onRemove,
|
|
26
|
+
onDuplicate,
|
|
25
27
|
isDefault = false,
|
|
26
28
|
isActive = false,
|
|
27
29
|
hasPermission = true,
|
|
@@ -32,43 +34,48 @@ export function EmailTemplateCard({
|
|
|
32
34
|
const texts = useTranslatedParameters({ isDefault, isActive });
|
|
33
35
|
|
|
34
36
|
return (
|
|
35
|
-
|
|
36
|
-
<div className="snippet-template-card">
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
37
|
+
<div className="snippet-template-card">
|
|
38
|
+
<div className="snippet-template-card-header">
|
|
39
|
+
<Link to={href}>{name}</Link>
|
|
40
|
+
{hasPermission && Boolean(onRemove) && (
|
|
41
|
+
<ConfirmModal
|
|
42
|
+
type={ConfirmModalType.remove}
|
|
43
|
+
content={t("areUSureYouWantToDelete", {
|
|
44
|
+
name,
|
|
45
|
+
type: t("emailTemplate").toLowerCase(),
|
|
46
|
+
})}
|
|
47
|
+
>
|
|
48
|
+
{(confirm) => (
|
|
49
|
+
<button
|
|
50
|
+
type="button"
|
|
51
|
+
className="snippet-template-card-button"
|
|
52
|
+
onClick={(e) => {
|
|
53
|
+
e.stopPropagation();
|
|
54
|
+
confirm(onRemove);
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
<Icon type="trash-alt" />
|
|
58
|
+
</button>
|
|
59
|
+
)}
|
|
60
|
+
</ConfirmModal>
|
|
61
|
+
)}
|
|
62
|
+
<button
|
|
63
|
+
type="button"
|
|
64
|
+
className="snippet-template-card-button"
|
|
65
|
+
onClick={onDuplicate}
|
|
66
|
+
>
|
|
67
|
+
<Icon type="copy" />
|
|
68
|
+
</button>
|
|
69
|
+
</div>
|
|
70
|
+
<div className={`mt-${isDefault ? "3" : "4"}`}>
|
|
71
|
+
{!!texts.length && <p className="mb-1">{texts}</p>}
|
|
72
|
+
<div className="d-flex flex-column">
|
|
73
|
+
<span className="snippet-template-card-subject">{subject}</span>
|
|
74
|
+
<p className="mb-0">
|
|
75
|
+
{t(`Design:type`)}: {t(`Design:${type}`)}
|
|
76
|
+
</p>
|
|
70
77
|
</div>
|
|
71
78
|
</div>
|
|
72
|
-
|
|
79
|
+
</div>
|
|
73
80
|
);
|
|
74
81
|
}
|
|
@@ -11,6 +11,7 @@ export interface SmsTemplateCardProps extends HasPermissionProp {
|
|
|
11
11
|
name: string;
|
|
12
12
|
href: string;
|
|
13
13
|
onRemove: () => void;
|
|
14
|
+
onDuplicate: () => void;
|
|
14
15
|
isDefault: boolean;
|
|
15
16
|
isActive: boolean;
|
|
16
17
|
type: NotificationType;
|
|
@@ -20,6 +21,7 @@ export function SmsTemplateCard({
|
|
|
20
21
|
name,
|
|
21
22
|
href,
|
|
22
23
|
onRemove,
|
|
24
|
+
onDuplicate,
|
|
23
25
|
hasPermission = true,
|
|
24
26
|
isDefault = false,
|
|
25
27
|
isActive = false,
|
|
@@ -55,6 +57,13 @@ export function SmsTemplateCard({
|
|
|
55
57
|
)}
|
|
56
58
|
</ConfirmModal>
|
|
57
59
|
)}
|
|
60
|
+
<button
|
|
61
|
+
type="button"
|
|
62
|
+
className="snippet-template-card-button"
|
|
63
|
+
onClick={onDuplicate}
|
|
64
|
+
>
|
|
65
|
+
<Icon type="copy" />
|
|
66
|
+
</button>
|
|
58
67
|
</div>
|
|
59
68
|
<div className="mt-2">
|
|
60
69
|
{!!texts.length && <p className="mb-1">{texts}</p>}
|
|
@@ -28,15 +28,13 @@ import {
|
|
|
28
28
|
AvailableTimesControlRef,
|
|
29
29
|
} from "../../zone/form/components/AvailableTimesControl";
|
|
30
30
|
|
|
31
|
-
// eslint-disable-next-line max-len
|
|
32
|
-
|
|
33
31
|
export interface DateAndRecurrenceInputValues {
|
|
34
32
|
menuRecurrences?: Partial<ProductSetRecurrence>[];
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
interface DateAndRecurrenceInputProps {
|
|
38
36
|
isEventEditProductSet?: boolean;
|
|
39
|
-
workHours
|
|
37
|
+
workHours: WorkHour[] | undefined;
|
|
40
38
|
providerHasBookingManagement: boolean;
|
|
41
39
|
isLoading?: boolean;
|
|
42
40
|
}
|
|
@@ -90,7 +88,7 @@ export const DateAndRecurrenceInput = ({
|
|
|
90
88
|
clearEditState();
|
|
91
89
|
});
|
|
92
90
|
|
|
93
|
-
const popoverId = useId()
|
|
91
|
+
const popoverId = useId();
|
|
94
92
|
|
|
95
93
|
const { t } = useTranslation("Design");
|
|
96
94
|
|
|
@@ -228,6 +226,7 @@ export const DateAndRecurrenceInput = ({
|
|
|
228
226
|
defaultValues={editState.values}
|
|
229
227
|
onChange={handleRecurringDateChange}
|
|
230
228
|
onDelete={handleDelete}
|
|
229
|
+
workHours={workHours}
|
|
231
230
|
>
|
|
232
231
|
{providerHasBookingManagement && (
|
|
233
232
|
<AvailableTimesControl
|
|
@@ -85,7 +85,7 @@ export interface ProductSetControlProps {
|
|
|
85
85
|
fieldSets?: FieldSet[];
|
|
86
86
|
showEmailTemplate?: boolean;
|
|
87
87
|
showSmsTemplate?: boolean;
|
|
88
|
-
workHours
|
|
88
|
+
workHours: WorkHour[] | undefined;
|
|
89
89
|
providerHasBookingManagement?: boolean;
|
|
90
90
|
isOverrides?: boolean;
|
|
91
91
|
isCreateNewOverrides?: boolean;
|
|
@@ -126,6 +126,11 @@ export function ProductSetControl({
|
|
|
126
126
|
const showSmsTemplateSelector = showSmsTemplate && !isOverrides;
|
|
127
127
|
const showEmailTemplateSelector = showEmailTemplate && !isOverrides;
|
|
128
128
|
const showDateSelector = !isEventEditProductSet && isOverrides;
|
|
129
|
+
|
|
130
|
+
const isZoneAdded = steps?.some(({ productCategories }) =>
|
|
131
|
+
productCategories?.some(({ zoneId }) => zoneId)
|
|
132
|
+
);
|
|
133
|
+
|
|
129
134
|
return (
|
|
130
135
|
<Row
|
|
131
136
|
className={`product-set-form ${
|
|
@@ -169,7 +174,7 @@ export function ProductSetControl({
|
|
|
169
174
|
|
|
170
175
|
{showDateSelector ? (
|
|
171
176
|
<DateInput
|
|
172
|
-
workHours={workHours}
|
|
177
|
+
workHours={isZoneAdded ? workHours : undefined}
|
|
173
178
|
isLoading={isLoading}
|
|
174
179
|
providerHasBookingManagement={providerHasBookingManagement}
|
|
175
180
|
/>
|
|
@@ -178,7 +183,7 @@ export function ProductSetControl({
|
|
|
178
183
|
{isCreateAction && (
|
|
179
184
|
<DateAndRecurrenceInput
|
|
180
185
|
isEventEditProductSet={isEventEditProductSet}
|
|
181
|
-
workHours={workHours}
|
|
186
|
+
workHours={isZoneAdded ? workHours : undefined}
|
|
182
187
|
isLoading={isLoading}
|
|
183
188
|
providerHasBookingManagement={providerHasBookingManagement}
|
|
184
189
|
/>
|
|
@@ -218,8 +218,9 @@ export function ProductCategoriesControl({
|
|
|
218
218
|
? String(productCategory.id)
|
|
219
219
|
: productCategory.uniqueId;
|
|
220
220
|
|
|
221
|
-
const isOverridesCategory = productCategory.products
|
|
222
|
-
|
|
221
|
+
const isOverridesCategory = productCategory.products?.some(
|
|
222
|
+
(product) =>
|
|
223
|
+
isEventEditProductSet ? !!product.id : !!product.originalProductId
|
|
223
224
|
);
|
|
224
225
|
const isNewOverridesCategory =
|
|
225
226
|
isCreateNewOverrides && !!productCategory.id;
|
|
@@ -26,12 +26,16 @@ import { checkAvailableTimesErrors, getFilteredTemplates } from "../utils";
|
|
|
26
26
|
export interface WithIsLoading {
|
|
27
27
|
isLoading: boolean;
|
|
28
28
|
}
|
|
29
|
+
export interface WithIdOptional {
|
|
30
|
+
id?: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
29
33
|
export interface WithId {
|
|
30
34
|
id: number;
|
|
31
35
|
}
|
|
32
36
|
export interface ProductSetFormValues
|
|
33
37
|
extends FormValues,
|
|
34
|
-
|
|
38
|
+
WithIdOptional,
|
|
35
39
|
ProductSetControlValues {
|
|
36
40
|
steps: Step[];
|
|
37
41
|
isOverrides?: boolean;
|
|
@@ -117,7 +121,11 @@ export function ProductSetForm({
|
|
|
117
121
|
}, [serverErrors, setError]);
|
|
118
122
|
|
|
119
123
|
useEffect(() => {
|
|
120
|
-
window.history.pushState(
|
|
124
|
+
window.history.pushState(
|
|
125
|
+
null,
|
|
126
|
+
"",
|
|
127
|
+
window.location.pathname + window.location.search
|
|
128
|
+
);
|
|
121
129
|
window.addEventListener("beforeunload", onBeforeUnload);
|
|
122
130
|
window.addEventListener("popstate", onPopState);
|
|
123
131
|
|
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
PRODUCT_DEfAULT_COLORS,
|
|
13
13
|
} from "@licklist/core/dist/DataMapper/Product/ProductDataMapper";
|
|
14
14
|
import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
|
|
15
|
+
import clsx from "clsx";
|
|
15
16
|
import {
|
|
16
17
|
FieldNamePrefixPath,
|
|
17
18
|
FormValues,
|
|
18
19
|
} from "@licklist/plugins/dist/types/services/Form/hook-form-service";
|
|
19
20
|
import { useId } from "@react-aria/utils";
|
|
20
|
-
import clsx from "clsx";
|
|
21
21
|
import React, {
|
|
22
22
|
ChangeEvent,
|
|
23
23
|
useCallback,
|