@licklist/design 0.67.3-dev.1 → 0.67.3-dev.3
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/EditEventForm/EditEventForm.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +0 -2
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts +1 -2
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +25 -25
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts +1 -2
- 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 -2
- package/dist/index.js +1 -0
- package/dist/modals/confirmation/ConfirmModal.d.ts +3 -1
- package/dist/modals/confirmation/ConfirmModal.d.ts.map +1 -1
- package/dist/modals/confirmation/ConfirmModal.js +172 -8
- package/dist/product-set/card/ProductSetCard.d.ts +6 -2
- package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
- package/dist/product-set/card/ProductSetCard.js +30 -11
- package/dist/product-set/control/ProductSetControl.d.ts +1 -2
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +2 -16
- package/dist/product-set/form/ProductSetNameControl.d.ts +6 -0
- package/dist/product-set/form/ProductSetNameControl.d.ts.map +1 -0
- package/dist/product-set/form/ProductSetNameControl.js +35 -0
- package/dist/product-set/form/index.d.ts +1 -0
- package/dist/product-set/form/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.d.ts +7 -0
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.js +10 -1
- package/dist/typeahead/Typeahead.d.ts +5 -1
- package/dist/typeahead/Typeahead.d.ts.map +1 -1
- package/dist/typeahead/Typeahead.js +9 -2
- package/package.json +2 -2
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +0 -2
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +32 -37
- package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +0 -3
- package/src/modals/confirmation/ConfirmModal.tsx +19 -3
- package/src/product-set/card/ProductSetCard.tsx +47 -8
- package/src/product-set/control/ProductSetControl.tsx +0 -15
- package/src/product-set/form/ProductSetNameControl.tsx +27 -0
- package/src/product-set/form/index.ts +1 -0
- package/src/product-set/utils/index.ts +11 -0
- package/src/typeahead/Typeahead.tsx +15 -1
- package/yarn.lock +103 -110
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
2
|
import { Row, Col, Form } from 'react-bootstrap';
|
|
4
3
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
5
4
|
import { useTranslation } from 'react-i18next';
|
|
6
5
|
import clsx from 'clsx';
|
|
7
|
-
import { DateTime } from 'luxon';
|
|
8
6
|
import { OPERATIONAL_COST_PROVIDER, OPERATIONAL_COST_CUSTOMER, RELY_ON_PEOPLE_PRODUCT_CAPACITY_QUANTITY, RELY_ON_PEOPLE_PRODUCT_QUANTITY, RELY_ON_PEOPLE_QUANTITY, OPERATIONAL_COST_TYPES, RELY_ON_PEOPLE_TYPES } from '@licklist/core/dist/DataMapper/Product/ProductSetDataMapper';
|
|
9
|
-
import { DATE_MONTH_LOCALE_FORMAT } from '@licklist/core/dist/Config';
|
|
10
7
|
import { useId } from '@react-aria/utils';
|
|
11
8
|
import HookFormService from '@licklist/plugins/dist/services/Form/HookFormService';
|
|
12
9
|
import { ruleForUrlWithProtocol } from '@licklist/plugins/dist/validation/Rules/urlRule';
|
|
@@ -76,16 +73,15 @@ var OPERATIONAL_COST_TITLES = (_obj = {}, _define_property(_obj, OPERATIONAL_COS
|
|
|
76
73
|
var _obj1;
|
|
77
74
|
var RELY_ON_PEOPLE_TYPE_TITLES = (_obj1 = {}, _define_property(_obj1, RELY_ON_PEOPLE_PRODUCT_CAPACITY_QUANTITY, "peopleProductCapacityQuantity"), _define_property(_obj1, RELY_ON_PEOPLE_PRODUCT_QUANTITY, "peopleProductQuantity"), _define_property(_obj1, RELY_ON_PEOPLE_QUANTITY, "peopleQuantity"), _obj1);
|
|
78
75
|
function ProductSetControl(param) {
|
|
79
|
-
var companyName = param.companyName, isLoading = param.isLoading, _param_fee = param.fee, fee = _param_fee === void 0 ? "5%" : _param_fee, _param_fieldSets = param.fieldSets, fieldSets = _param_fieldSets === void 0 ? [] : _param_fieldSets, _param_emailTemplates = param.emailTemplates, emailTemplates = _param_emailTemplates === void 0 ? [] : _param_emailTemplates, _param_smsTemplates = param.smsTemplates, smsTemplates = _param_smsTemplates === void 0 ? [] : _param_smsTemplates, isEventEditProductSet = param.isEventEditProductSet, isCreateAction = param.isCreateAction, showEmailTemplate = param.showEmailTemplate, showSmsTemplate = param.showSmsTemplate, workHours = param.workHours, _param_providerHasBookingManagement = param.providerHasBookingManagement, providerHasBookingManagement = _param_providerHasBookingManagement === void 0 ? false : _param_providerHasBookingManagement, _param_isOverrides = param.isOverrides, isOverrides = _param_isOverrides === void 0 ? false : _param_isOverrides,
|
|
76
|
+
var companyName = param.companyName, isLoading = param.isLoading, _param_fee = param.fee, fee = _param_fee === void 0 ? "5%" : _param_fee, _param_fieldSets = param.fieldSets, fieldSets = _param_fieldSets === void 0 ? [] : _param_fieldSets, _param_emailTemplates = param.emailTemplates, emailTemplates = _param_emailTemplates === void 0 ? [] : _param_emailTemplates, _param_smsTemplates = param.smsTemplates, smsTemplates = _param_smsTemplates === void 0 ? [] : _param_smsTemplates, isEventEditProductSet = param.isEventEditProductSet, isCreateAction = param.isCreateAction, showEmailTemplate = param.showEmailTemplate, showSmsTemplate = param.showSmsTemplate, workHours = param.workHours, _param_providerHasBookingManagement = param.providerHasBookingManagement, providerHasBookingManagement = _param_providerHasBookingManagement === void 0 ? false : _param_providerHasBookingManagement, _param_isOverrides = param.isOverrides, isOverrides = _param_isOverrides === void 0 ? false : _param_isOverrides, _param_isCreateNewOverrides = param.isCreateNewOverrides, isCreateNewOverrides = _param_isCreateNewOverrides === void 0 ? false : _param_isCreateNewOverrides, timeZone = param.timeZone;
|
|
80
77
|
var _errors_name;
|
|
81
78
|
var t = useTranslation([
|
|
82
79
|
"Design",
|
|
83
80
|
"Validation",
|
|
84
81
|
"Notification"
|
|
85
82
|
]).t;
|
|
86
|
-
var _useFormContext = useFormContext(), register = _useFormContext.register, control = _useFormContext.control, errors = _useFormContext.formState.errors, watch = _useFormContext.watch, setError = _useFormContext.setError,
|
|
83
|
+
var _useFormContext = useFormContext(), register = _useFormContext.register, control = _useFormContext.control, errors = _useFormContext.formState.errors, watch = _useFormContext.watch, setError = _useFormContext.setError, clearErrors = _useFormContext.clearErrors;
|
|
87
84
|
var steps = watch("steps");
|
|
88
|
-
var productSetName = watch("name");
|
|
89
85
|
var nameId = useId();
|
|
90
86
|
var termsAndConditionsId = useId();
|
|
91
87
|
var relyOnPeopleTypeId = useId();
|
|
@@ -98,16 +94,6 @@ function ProductSetControl(param) {
|
|
|
98
94
|
return checkIfZoneCategory(category === null || category === void 0 ? void 0 : category.type);
|
|
99
95
|
});
|
|
100
96
|
});
|
|
101
|
-
useEffect(function() {
|
|
102
|
-
if (!occurrenceStartAtDate) return;
|
|
103
|
-
var eventStartDate = DateTime.fromISO(occurrenceStartAtDate);
|
|
104
|
-
var eventStart = eventStartDate.toFormat(DATE_MONTH_LOCALE_FORMAT);
|
|
105
|
-
setValue("name", "".concat(productSetName, " (").concat(eventStart, ")"));
|
|
106
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
107
|
-
}, [
|
|
108
|
-
setValue,
|
|
109
|
-
occurrenceStartAtDate
|
|
110
|
-
]);
|
|
111
97
|
return /*#__PURE__*/ jsxs(Row, {
|
|
112
98
|
className: "product-set-form ".concat(isEventEditProductSet && "event-edit-product-set"),
|
|
113
99
|
children: [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductSetNameControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/ProductSetNameControl.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,gCAI/B;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,4CAeA,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Form } from 'react-bootstrap';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
|
|
5
|
+
var ProductSetNameControl = function(param) {
|
|
6
|
+
var value = param.value, onChange = param.onChange, error = param.error;
|
|
7
|
+
var t = useTranslation([
|
|
8
|
+
"Design"
|
|
9
|
+
]).t;
|
|
10
|
+
return /*#__PURE__*/ jsxs(Form.Group, {
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ jsxs(Form.Label, {
|
|
13
|
+
children: [
|
|
14
|
+
t("Design:ProductSetName"),
|
|
15
|
+
"*"
|
|
16
|
+
]
|
|
17
|
+
}),
|
|
18
|
+
/*#__PURE__*/ jsx(Form.Control, {
|
|
19
|
+
value: value,
|
|
20
|
+
maxLength: 255,
|
|
21
|
+
onChange: function(e) {
|
|
22
|
+
return onChange(e.target.value);
|
|
23
|
+
},
|
|
24
|
+
placeholder: t("Design:placeholderProductSetName"),
|
|
25
|
+
isInvalid: Boolean(error)
|
|
26
|
+
}),
|
|
27
|
+
/*#__PURE__*/ jsx(Form.Control.Feedback, {
|
|
28
|
+
type: "invalid",
|
|
29
|
+
children: error
|
|
30
|
+
})
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { ProductSetNameControl };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { EmailTemplate } from "@licklist/core/dist/DataMapper/Notification/Email
|
|
|
2
2
|
import { SmsTemplate } from "@licklist/core/dist/DataMapper/Notification/SmsTemplateDataMapper";
|
|
3
3
|
import { TFunction } from "react-i18next";
|
|
4
4
|
import { UseFormSetError } from "react-hook-form";
|
|
5
|
+
import { ProductSet } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
|
|
5
6
|
import { TemplateItem } from "../control/ProductSetControl";
|
|
6
7
|
import { ProductSetFormValues } from "../form/ProductSetForm";
|
|
7
8
|
interface CheckAvailableTimesErrors {
|
|
@@ -9,11 +10,17 @@ interface CheckAvailableTimesErrors {
|
|
|
9
10
|
setError: UseFormSetError<ProductSetFormValues>;
|
|
10
11
|
t: TFunction;
|
|
11
12
|
}
|
|
13
|
+
export interface MenuTypeheadItem {
|
|
14
|
+
id: number;
|
|
15
|
+
label: string;
|
|
16
|
+
value: number;
|
|
17
|
+
}
|
|
12
18
|
export declare const moveArrayElements: <T>(array: T[], prevIndex: number, nextIndex: number) => T[];
|
|
13
19
|
export declare const sortArrayByIndex: <T>(array: T[]) => (T & {
|
|
14
20
|
sort: number;
|
|
15
21
|
})[];
|
|
16
22
|
export declare const getFilteredTemplates: (templates?: EmailTemplate[] | SmsTemplate[], formTemplates?: TemplateItem[]) => TemplateItem[] | undefined;
|
|
17
23
|
export declare const checkAvailableTimesErrors: ({ values, setError, t, }: CheckAvailableTimesErrors) => boolean;
|
|
24
|
+
export declare const getTypeHeadItemsFromMenus: (menus?: (ProductSet | ProductSetFormValues)[]) => MenuTypeheadItem[];
|
|
18
25
|
export {};
|
|
19
26
|
//# 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,OAAO,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,mEAAmE,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,UAAU,yBAAyB;IACjC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,QAAQ,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC;IAChD,CAAC,EAAE,SAAS,CAAC;CACd;AAED,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAC1B,CAAC,EAAE,aACC,MAAM,aACN,MAAM,QAQlB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,CAAC,EAAE;;IAE7C,CAAC;AAEF,eAAO,MAAM,oBAAoB,eACnB,aAAa,EAAE,GAAG,WAAW,EAAE,kBAC3B,YAAY,EAAE,KAC7B,YAAY,EAAE,GAAG,SAmBnB,CAAC;AAEF,eAAO,MAAM,yBAAyB,6BAInC,yBAAyB,YA0B3B,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,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,UAAU,yBAAyB;IACjC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,QAAQ,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAC;IAChD,CAAC,EAAE,SAAS,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AACD,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAC1B,CAAC,EAAE,aACC,MAAM,aACN,MAAM,QAQlB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,CAAC,EAAE;;IAE7C,CAAC;AAEF,eAAO,MAAM,oBAAoB,eACnB,aAAa,EAAE,GAAG,WAAW,EAAE,kBAC3B,YAAY,EAAE,KAC7B,YAAY,EAAE,GAAG,SAmBnB,CAAC;AAEF,eAAO,MAAM,yBAAyB,6BAInC,yBAAyB,YA0B3B,CAAC;AAEF,eAAO,MAAM,yBAAyB,WAC5B,CAAC,UAAU,GAAG,oBAAoB,CAAC,EAAE,KAC5C,gBAAgB,EACwD,CAAC"}
|
|
@@ -136,5 +136,14 @@ var checkAvailableTimesErrors = function(param) {
|
|
|
136
136
|
});
|
|
137
137
|
return hasError;
|
|
138
138
|
};
|
|
139
|
+
var getTypeHeadItemsFromMenus = function(menus) {
|
|
140
|
+
return menus === null || menus === void 0 ? void 0 : menus.map(function(menu) {
|
|
141
|
+
return {
|
|
142
|
+
id: menu.id,
|
|
143
|
+
value: menu.id,
|
|
144
|
+
label: menu.name
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
};
|
|
139
148
|
|
|
140
|
-
export { checkAvailableTimesErrors, getFilteredTemplates, moveArrayElements, sortArrayByIndex };
|
|
149
|
+
export { checkAvailableTimesErrors, getFilteredTemplates, getTypeHeadItemsFromMenus, moveArrayElements, sortArrayByIndex };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CSSObjectWithLabel } from "react-select";
|
|
1
2
|
export type TypeaheadOptions = {
|
|
2
3
|
id: number | string;
|
|
3
4
|
value: any;
|
|
@@ -8,11 +9,14 @@ export interface TypeaheadProps {
|
|
|
8
9
|
placeholder: string;
|
|
9
10
|
isRequired?: boolean;
|
|
10
11
|
name: string;
|
|
12
|
+
value?: TypeaheadOptions;
|
|
11
13
|
isMultipleChoise?: boolean;
|
|
12
14
|
noOptionsMessage: string;
|
|
13
15
|
isInvalid?: boolean;
|
|
14
16
|
isCouponForm?: boolean;
|
|
17
|
+
containerStyles?: CSSObjectWithLabel;
|
|
18
|
+
onChangeValue?: (value: TypeaheadOptions) => void;
|
|
15
19
|
}
|
|
16
|
-
declare function Typeahead({ options, placeholder, isRequired, isMultipleChoise, name, isCouponForm, noOptionsMessage, isInvalid, }: TypeaheadProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function Typeahead({ options, placeholder, isRequired, isMultipleChoise, name, value, onChangeValue, containerStyles, isCouponForm, noOptionsMessage, isInvalid, }: TypeaheadProps): import("react/jsx-runtime").JSX.Element;
|
|
17
21
|
export { Typeahead };
|
|
18
22
|
//# sourceMappingURL=Typeahead.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../src/typeahead/Typeahead.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../src/typeahead/Typeahead.tsx"],"names":[],"mappings":"AAAA,OAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAG1D,MAAM,MAAM,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,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACnD;AAED,iBAAS,SAAS,CAAC,EACjB,OAAO,EACP,WAAW,EACX,UAAkB,EAClB,gBAAgB,EAChB,IAAS,EACT,KAAK,EACL,aAAa,EACb,eAAe,EACf,YAAoB,EACpB,gBAAqB,EACrB,SAAS,GACV,EAAE,cAAc,2CAoDhB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -31,7 +31,7 @@ function _object_spread(target) {
|
|
|
31
31
|
return target;
|
|
32
32
|
}
|
|
33
33
|
function Typeahead(param) {
|
|
34
|
-
var options = param.options, placeholder = param.placeholder, _param_isRequired = param.isRequired, isRequired = _param_isRequired === void 0 ? false : _param_isRequired, isMultipleChoise = param.isMultipleChoise, _param_name = param.name, name = _param_name === void 0 ? "" : _param_name, _param_isCouponForm = param.isCouponForm, isCouponForm = _param_isCouponForm === void 0 ? false : _param_isCouponForm, _param_noOptionsMessage = param.noOptionsMessage, noOptionsMessage = _param_noOptionsMessage === void 0 ? "" : _param_noOptionsMessage, isInvalid = param.isInvalid;
|
|
34
|
+
var options = param.options, placeholder = param.placeholder, _param_isRequired = param.isRequired, isRequired = _param_isRequired === void 0 ? false : _param_isRequired, isMultipleChoise = param.isMultipleChoise, _param_name = param.name, name = _param_name === void 0 ? "" : _param_name, value = param.value, onChangeValue = param.onChangeValue, containerStyles = param.containerStyles, _param_isCouponForm = param.isCouponForm, isCouponForm = _param_isCouponForm === void 0 ? false : _param_isCouponForm, _param_noOptionsMessage = param.noOptionsMessage, noOptionsMessage = _param_noOptionsMessage === void 0 ? "" : _param_noOptionsMessage, isInvalid = param.isInvalid;
|
|
35
35
|
var control = useFormContext().control;
|
|
36
36
|
var getStyle = function() {
|
|
37
37
|
var couponFormStyle = isCouponForm ? {
|
|
@@ -53,14 +53,21 @@ function Typeahead(param) {
|
|
|
53
53
|
var field = param.field;
|
|
54
54
|
return /*#__PURE__*/ jsx(Select, {
|
|
55
55
|
placeholder: placeholder,
|
|
56
|
-
value: field.value,
|
|
56
|
+
value: value !== null && value !== void 0 ? value : field.value,
|
|
57
57
|
isMulti: isMultipleChoise,
|
|
58
58
|
styles: {
|
|
59
|
+
container: function(base) {
|
|
60
|
+
return _object_spread({}, base, containerStyles);
|
|
61
|
+
},
|
|
59
62
|
control: function(base) {
|
|
60
63
|
return _object_spread({}, base, getStyle());
|
|
61
64
|
}
|
|
62
65
|
},
|
|
63
66
|
onChange: function(value) {
|
|
67
|
+
if (onChangeValue) {
|
|
68
|
+
onChangeValue(value);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
64
71
|
field.onChange(value);
|
|
65
72
|
},
|
|
66
73
|
options: options,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.67.3-dev.
|
|
3
|
+
"version": "0.67.3-dev.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -201,4 +201,4 @@
|
|
|
201
201
|
"yarn": "4.4.0"
|
|
202
202
|
},
|
|
203
203
|
"stableVersion": "0.66.7-dev.5"
|
|
204
|
-
}
|
|
204
|
+
}
|
|
@@ -124,7 +124,6 @@ export const EditEventForm = ({
|
|
|
124
124
|
const visible = watch("visible");
|
|
125
125
|
const editedProductSet = watch("editedProductSet");
|
|
126
126
|
const productSetId = watch("productSetId");
|
|
127
|
-
const occurrenceStartAtDate = watch("start");
|
|
128
127
|
|
|
129
128
|
const {
|
|
130
129
|
images,
|
|
@@ -406,7 +405,6 @@ export const EditEventForm = ({
|
|
|
406
405
|
setEditProductSetId={setEditProductSetId}
|
|
407
406
|
setShowEditProductSet={setShowEditProductSet}
|
|
408
407
|
showEditProductSet={showEditProductSet}
|
|
409
|
-
occurrenceStartAtDate={occurrenceStartAtDate}
|
|
410
408
|
timeZone={timeZone}
|
|
411
409
|
/>
|
|
412
410
|
|
package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx
CHANGED
|
@@ -5,9 +5,11 @@ import { useId } from "@react-aria/utils";
|
|
|
5
5
|
import { Controller, useFormContext } from "react-hook-form";
|
|
6
6
|
import { HasPermissionProp } from "@licklist/plugins/dist/types/permission/Permission";
|
|
7
7
|
import { ProductSet } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
|
|
8
|
+
import { getTypeHeadItemsFromMenus } from "../../../../product-set/utils";
|
|
8
9
|
import { ConfirmModal } from "../../../../modals/confirmation/ConfirmModal";
|
|
9
10
|
import { EditEventFormValues } from "../EditEventForm/EditEventForm";
|
|
10
11
|
import { EditEventProductSet } from "./component/EditEventProductSet";
|
|
12
|
+
import { Typeahead } from "../../../../typeahead";
|
|
11
13
|
|
|
12
14
|
interface SelectEventProductSetProps extends HasPermissionProp {
|
|
13
15
|
productSets?: ProductSet[];
|
|
@@ -15,7 +17,6 @@ interface SelectEventProductSetProps extends HasPermissionProp {
|
|
|
15
17
|
setShowEditProductSet: (value: boolean) => void;
|
|
16
18
|
createProductSet: (props: EditEventFormValues) => void;
|
|
17
19
|
setEditProductSetId: (value: string) => void;
|
|
18
|
-
occurrenceStartAtDate: string;
|
|
19
20
|
timeZone: string;
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -25,7 +26,6 @@ export const SelectEventProductSet = ({
|
|
|
25
26
|
setEditProductSetId,
|
|
26
27
|
showEditProductSet,
|
|
27
28
|
setShowEditProductSet,
|
|
28
|
-
occurrenceStartAtDate,
|
|
29
29
|
timeZone,
|
|
30
30
|
}: SelectEventProductSetProps) => {
|
|
31
31
|
const { t } = useTranslation(["Design"]);
|
|
@@ -44,6 +44,21 @@ export const SelectEventProductSet = ({
|
|
|
44
44
|
const productSetId = watch("productSetId");
|
|
45
45
|
const editedProductSet = watch("editedProductSet");
|
|
46
46
|
|
|
47
|
+
const typeheadValues = getTypeHeadItemsFromMenus(
|
|
48
|
+
editedProductSet
|
|
49
|
+
? productSets.map((productSet) => {
|
|
50
|
+
if (productSet.id === editedProductSet.id) {
|
|
51
|
+
return editedProductSet;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return productSet;
|
|
55
|
+
})
|
|
56
|
+
: productSets,
|
|
57
|
+
);
|
|
58
|
+
const selectedProductSetTypeheadValue = productSetId
|
|
59
|
+
? typeheadValues?.find((typeheadValue) => typeheadValue.id === productSetId)
|
|
60
|
+
: undefined;
|
|
61
|
+
|
|
47
62
|
const onEditProductSet = useCallback(
|
|
48
63
|
() => {
|
|
49
64
|
setEditProductSetId(String(productSetId));
|
|
@@ -97,6 +112,7 @@ export const SelectEventProductSet = ({
|
|
|
97
112
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
113
|
const onSubmit = (value: EditEventFormValues["editedProductSet"]) => {
|
|
99
114
|
setShowEditProductSet(false);
|
|
115
|
+
setValue("productSetId", value.id);
|
|
100
116
|
setValue("editedProductSet", value);
|
|
101
117
|
};
|
|
102
118
|
|
|
@@ -112,49 +128,29 @@ export const SelectEventProductSet = ({
|
|
|
112
128
|
<Controller
|
|
113
129
|
control={control}
|
|
114
130
|
name="productSetId"
|
|
115
|
-
render={(
|
|
116
|
-
const fieldValue = String(field.value);
|
|
131
|
+
render={() => {
|
|
117
132
|
return (
|
|
118
133
|
<>
|
|
119
134
|
<div className="d-flex align-items-center flex-row w-100">
|
|
120
135
|
<ConfirmModal>
|
|
121
136
|
{(confirm) => {
|
|
122
137
|
return (
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
138
|
+
<Typeahead
|
|
139
|
+
name="productSetId"
|
|
140
|
+
value={selectedProductSetTypeheadValue}
|
|
141
|
+
containerStyles={{ width: "100%" }}
|
|
142
|
+
onChangeValue={(typeheadValue) => {
|
|
126
143
|
onChangeProductSet(
|
|
127
|
-
Number(
|
|
144
|
+
Number(typeheadValue.id),
|
|
128
145
|
confirm,
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
isInvalid={Boolean(errors.productSetId)}
|
|
132
|
-
value={fieldValue}
|
|
133
|
-
>
|
|
134
|
-
<option value="" hidden>
|
|
135
|
-
{t("Design:chooseProductSet")}
|
|
136
|
-
</option>
|
|
137
|
-
{productSets?.map((productSet) => {
|
|
138
|
-
const isCurrentEditedProductSet =
|
|
139
|
-
editedProductSet &&
|
|
140
|
-
editedProductSet?.id === productSet?.id;
|
|
141
|
-
return (
|
|
142
|
-
<option
|
|
143
|
-
key={productSet.id}
|
|
144
|
-
value={productSet.id}
|
|
145
|
-
>
|
|
146
|
-
{isCurrentEditedProductSet ||
|
|
147
|
-
productSet.isOverride
|
|
148
|
-
? `[${t("edited")}] ${
|
|
149
|
-
isCurrentEditedProductSet
|
|
150
|
-
? editedProductSet?.name
|
|
151
|
-
: productSet.name
|
|
152
|
-
}`
|
|
153
|
-
: productSet.name}
|
|
154
|
-
</option>
|
|
155
146
|
);
|
|
156
|
-
}
|
|
157
|
-
|
|
147
|
+
}}
|
|
148
|
+
options={typeheadValues}
|
|
149
|
+
placeholder={t("Design:choose")}
|
|
150
|
+
noOptionsMessage={t(
|
|
151
|
+
"Design:noAvailableProductSets",
|
|
152
|
+
)}
|
|
153
|
+
/>
|
|
158
154
|
);
|
|
159
155
|
}}
|
|
160
156
|
</ConfirmModal>
|
|
@@ -213,7 +209,6 @@ export const SelectEventProductSet = ({
|
|
|
213
209
|
{showEditProductSet && productSetId && (
|
|
214
210
|
<EditEventProductSet
|
|
215
211
|
onSubmit={onSubmit}
|
|
216
|
-
occurrenceStartAtDate={occurrenceStartAtDate}
|
|
217
212
|
defaultValues={
|
|
218
213
|
productSetId === editedProductSet?.id && editedProductSet
|
|
219
214
|
}
|
|
@@ -22,14 +22,12 @@ export interface EventDates {
|
|
|
22
22
|
interface EditEventProductSetProps {
|
|
23
23
|
onSubmit: (value: EditEventFormValues["editedProductSet"]) => void;
|
|
24
24
|
defaultValues?: EditEventFormValues["editedProductSet"];
|
|
25
|
-
occurrenceStartAtDate: string;
|
|
26
25
|
timeZone: string;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
export const EditEventProductSet = ({
|
|
30
29
|
onSubmit,
|
|
31
30
|
defaultValues,
|
|
32
|
-
occurrenceStartAtDate,
|
|
33
31
|
timeZone,
|
|
34
32
|
}: EditEventProductSetProps) => {
|
|
35
33
|
const { companyId } = useParams<{
|
|
@@ -129,7 +127,6 @@ export const EditEventProductSet = ({
|
|
|
129
127
|
fee={feeInPercent}
|
|
130
128
|
isEventEditProductSet
|
|
131
129
|
isOverrides
|
|
132
|
-
occurrenceStartAtDate={occurrenceStartAtDate}
|
|
133
130
|
workHours={undefined}
|
|
134
131
|
timeZone={timeZone}
|
|
135
132
|
/>
|
|
@@ -20,6 +20,9 @@ export type ConfirmModalTypes =
|
|
|
20
20
|
export interface ConfirmModalProps {
|
|
21
21
|
type?: ConfirmModalTypes;
|
|
22
22
|
children?: (confirm: (action: ConfirmAction) => void) => ReactNode;
|
|
23
|
+
// confirm function memoize the callback function. It's an alternative function
|
|
24
|
+
confirmationHandler?: () => Promise<boolean | undefined>;
|
|
25
|
+
disabledButtons?: boolean;
|
|
23
26
|
title?: string;
|
|
24
27
|
content?: string | ReactNode;
|
|
25
28
|
onClose?: () => void;
|
|
@@ -37,7 +40,9 @@ export function ConfirmModal({
|
|
|
37
40
|
type = "default",
|
|
38
41
|
children,
|
|
39
42
|
onClose,
|
|
43
|
+
confirmationHandler,
|
|
40
44
|
title,
|
|
45
|
+
disabledButtons,
|
|
41
46
|
content,
|
|
42
47
|
hideButtons = false,
|
|
43
48
|
}: ConfirmModalProps) {
|
|
@@ -52,10 +57,16 @@ export function ConfirmModal({
|
|
|
52
57
|
setIsOpen(() => true);
|
|
53
58
|
};
|
|
54
59
|
|
|
55
|
-
const handleConfirmation = (e) => {
|
|
60
|
+
const handleConfirmation = async (e) => {
|
|
56
61
|
e.stopPropagation();
|
|
57
|
-
if (!actionRef.current) return;
|
|
58
|
-
|
|
62
|
+
if (!actionRef.current && !confirmationHandler) return;
|
|
63
|
+
if (confirmationHandler) {
|
|
64
|
+
const res = await confirmationHandler();
|
|
65
|
+
if (res) {
|
|
66
|
+
setIsOpen(() => false);
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
59
70
|
actionRef.current();
|
|
60
71
|
setIsOpen(() => false);
|
|
61
72
|
};
|
|
@@ -88,6 +99,7 @@ export function ConfirmModal({
|
|
|
88
99
|
<Button
|
|
89
100
|
variant="danger"
|
|
90
101
|
className="btn-sm rounded"
|
|
102
|
+
disabled={disabledButtons}
|
|
91
103
|
onClick={handleClose}
|
|
92
104
|
data-id={CONFIRM_MODAL_ACTION_DECLINE}
|
|
93
105
|
>
|
|
@@ -105,12 +117,14 @@ export function ConfirmModal({
|
|
|
105
117
|
variant="outline"
|
|
106
118
|
className="cancel-button"
|
|
107
119
|
onClick={handleClose}
|
|
120
|
+
disabled={disabledButtons}
|
|
108
121
|
data-id={CONFIRM_MODAL_ACTION_DECLINE}
|
|
109
122
|
>
|
|
110
123
|
{t("cancel")}
|
|
111
124
|
</Button>
|
|
112
125
|
<Button
|
|
113
126
|
variant="danger"
|
|
127
|
+
disabled={disabledButtons}
|
|
114
128
|
onClick={handleConfirmation}
|
|
115
129
|
data-id={CONFIRM_MODAL_ACTION_CONFIRM}
|
|
116
130
|
>
|
|
@@ -121,6 +135,7 @@ export function ConfirmModal({
|
|
|
121
135
|
<>
|
|
122
136
|
<Button
|
|
123
137
|
variant="danger"
|
|
138
|
+
disabled={disabledButtons}
|
|
124
139
|
onClick={handleClose}
|
|
125
140
|
data-id={CONFIRM_MODAL_ACTION_DECLINE}
|
|
126
141
|
>
|
|
@@ -128,6 +143,7 @@ export function ConfirmModal({
|
|
|
128
143
|
</Button>
|
|
129
144
|
<Button
|
|
130
145
|
variant="success"
|
|
146
|
+
disabled={disabledButtons}
|
|
131
147
|
onClick={handleConfirmation}
|
|
132
148
|
data-id={CONFIRM_MODAL_ACTION_CONFIRM}
|
|
133
149
|
>
|
|
@@ -9,15 +9,20 @@ import RouteService from "@licklist/plugins/dist/services/Route/RouteService";
|
|
|
9
9
|
import { FaEllipsisH, FaEye, FaTrashAlt } from "react-icons/fa";
|
|
10
10
|
import { ConfirmModal } from "../../modals";
|
|
11
11
|
import { MenuButton } from "../../table/MenuButton";
|
|
12
|
+
import { ProductSetNameControl } from "../form/ProductSetNameControl";
|
|
12
13
|
|
|
13
14
|
export interface ProductSetCardProps extends HasPermissionProp {
|
|
14
15
|
name: string;
|
|
15
16
|
rrule?: string;
|
|
16
17
|
href: string;
|
|
17
|
-
|
|
18
|
+
duplicateProductSetName: string;
|
|
19
|
+
onChangeDuplicateProductSetName: (value: string) => void;
|
|
20
|
+
onCopy: () => Promise<boolean | undefined>;
|
|
18
21
|
onRemove: () => void;
|
|
22
|
+
isLoading?: boolean;
|
|
19
23
|
className?: string;
|
|
20
24
|
override?: number;
|
|
25
|
+
duplicateProductSetError?: string;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
export function ProductSetCard({
|
|
@@ -26,6 +31,10 @@ export function ProductSetCard({
|
|
|
26
31
|
href,
|
|
27
32
|
onCopy,
|
|
28
33
|
onRemove,
|
|
34
|
+
onChangeDuplicateProductSetName,
|
|
35
|
+
duplicateProductSetName,
|
|
36
|
+
duplicateProductSetError,
|
|
37
|
+
isLoading,
|
|
29
38
|
className = "",
|
|
30
39
|
hasPermission = true,
|
|
31
40
|
override = 0,
|
|
@@ -35,19 +44,23 @@ export function ProductSetCard({
|
|
|
35
44
|
const productSetCardClasses = `product-set-card ${className}`;
|
|
36
45
|
const [isOverlayVisibile, setIsOverlayVisible] = useState(false);
|
|
37
46
|
|
|
47
|
+
const onCardClick = () => {
|
|
48
|
+
RouteService.redirectTo(href);
|
|
49
|
+
};
|
|
38
50
|
return (
|
|
51
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
39
52
|
<div
|
|
40
53
|
role="button"
|
|
41
54
|
tabIndex={0}
|
|
42
55
|
className="border-0 product-set-card-wrapper w-100 pb-0"
|
|
43
|
-
onClick={
|
|
44
|
-
onKeyUp={() => RouteService.redirectTo(href)}
|
|
56
|
+
onClick={onCardClick}
|
|
45
57
|
>
|
|
46
58
|
<div className={productSetCardClasses}>
|
|
47
59
|
<div className="product-set-card-link">
|
|
48
60
|
<div className="d-flex flex-column">
|
|
49
61
|
<div>
|
|
50
|
-
{name}
|
|
62
|
+
{name}
|
|
63
|
+
{rrule && `(${RRule.fromString(rrule).toText()})`}
|
|
51
64
|
</div>
|
|
52
65
|
{!!override && (
|
|
53
66
|
<div className="h6 bold ml-1">
|
|
@@ -79,14 +92,33 @@ export function ProductSetCard({
|
|
|
79
92
|
>
|
|
80
93
|
{hasPermission && (
|
|
81
94
|
<>
|
|
82
|
-
<ListGroup.Item
|
|
95
|
+
<ListGroup.Item
|
|
96
|
+
action
|
|
97
|
+
as="div"
|
|
98
|
+
role="button"
|
|
99
|
+
tabIndex={0}
|
|
100
|
+
onClick={(e) => e.stopPropagation()}
|
|
101
|
+
>
|
|
83
102
|
{Boolean(onCopy) && (
|
|
84
|
-
<ConfirmModal
|
|
103
|
+
<ConfirmModal
|
|
104
|
+
// confirm function memoize the callback function and it leads to bugs
|
|
105
|
+
confirmationHandler={onCopy}
|
|
106
|
+
disabledButtons={isLoading}
|
|
107
|
+
content={
|
|
108
|
+
<ProductSetNameControl
|
|
109
|
+
value={duplicateProductSetName}
|
|
110
|
+
onChange={onChangeDuplicateProductSetName}
|
|
111
|
+
error={duplicateProductSetError}
|
|
112
|
+
/>
|
|
113
|
+
}
|
|
114
|
+
>
|
|
85
115
|
{(confirm) => (
|
|
86
116
|
<MenuButton
|
|
87
117
|
onClick={() => {
|
|
88
118
|
setIsOverlayVisible(false);
|
|
89
|
-
|
|
119
|
+
onChangeDuplicateProductSetName(name);
|
|
120
|
+
// confirm function memoize the callback function and it leads to bugs
|
|
121
|
+
confirm(() => {});
|
|
90
122
|
}}
|
|
91
123
|
name={t("duplicate")}
|
|
92
124
|
className="product-set-card-menu-item-text"
|
|
@@ -95,7 +127,14 @@ export function ProductSetCard({
|
|
|
95
127
|
</ConfirmModal>
|
|
96
128
|
)}
|
|
97
129
|
</ListGroup.Item>
|
|
98
|
-
<ListGroup.Item
|
|
130
|
+
<ListGroup.Item
|
|
131
|
+
action
|
|
132
|
+
className="text-danger"
|
|
133
|
+
as="div"
|
|
134
|
+
role="button"
|
|
135
|
+
tabIndex={0}
|
|
136
|
+
onClick={(e) => e.stopPropagation()}
|
|
137
|
+
>
|
|
99
138
|
{Boolean(onRemove) && (
|
|
100
139
|
<ConfirmModal>
|
|
101
140
|
{(confirm) => (
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
1
|
import { Col, Form, Row } from "react-bootstrap";
|
|
3
2
|
import { Controller, useFormContext } from "react-hook-form";
|
|
4
3
|
import { useTranslation } from "react-i18next";
|
|
5
4
|
import clsx from "clsx";
|
|
6
|
-
import { DateTime } from "luxon";
|
|
7
5
|
import {
|
|
8
6
|
OPERATIONAL_COST_CUSTOMER,
|
|
9
7
|
OPERATIONAL_COST_PROVIDER,
|
|
@@ -16,7 +14,6 @@ import {
|
|
|
16
14
|
RELY_ON_PEOPLE_TYPES,
|
|
17
15
|
RelyOnPeopleType,
|
|
18
16
|
} from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
|
|
19
|
-
import { DATE_MONTH_LOCALE_FORMAT } from "@licklist/core/dist/Config";
|
|
20
17
|
import { useId } from "@react-aria/utils";
|
|
21
18
|
import { FieldSet } from "@licklist/core/dist/DataMapper/Order/FieldSetDataMapper";
|
|
22
19
|
import { EmailTemplate } from "@licklist/core/dist/DataMapper/Notification/EmailTemplateDataMapper";
|
|
@@ -91,7 +88,6 @@ export interface ProductSetControlProps {
|
|
|
91
88
|
workHours: WorkHour[] | undefined;
|
|
92
89
|
providerHasBookingManagement?: boolean;
|
|
93
90
|
isOverrides?: boolean;
|
|
94
|
-
occurrenceStartAtDate?: string;
|
|
95
91
|
isCreateNewOverrides?: boolean;
|
|
96
92
|
timeZone: string;
|
|
97
93
|
}
|
|
@@ -110,7 +106,6 @@ export function ProductSetControl({
|
|
|
110
106
|
workHours,
|
|
111
107
|
providerHasBookingManagement = false,
|
|
112
108
|
isOverrides = false,
|
|
113
|
-
occurrenceStartAtDate,
|
|
114
109
|
isCreateNewOverrides = false,
|
|
115
110
|
timeZone,
|
|
116
111
|
}: ProductSetControlProps) {
|
|
@@ -121,12 +116,10 @@ export function ProductSetControl({
|
|
|
121
116
|
formState: { errors },
|
|
122
117
|
watch,
|
|
123
118
|
setError,
|
|
124
|
-
setValue,
|
|
125
119
|
clearErrors,
|
|
126
120
|
} = useFormContext<ProductSetControlValues>();
|
|
127
121
|
|
|
128
122
|
const steps = watch("steps");
|
|
129
|
-
const productSetName = watch("name");
|
|
130
123
|
|
|
131
124
|
const nameId = useId();
|
|
132
125
|
const termsAndConditionsId = useId();
|
|
@@ -140,14 +133,6 @@ export function ProductSetControl({
|
|
|
140
133
|
productCategories?.some((category) => checkIfZoneCategory(category?.type)),
|
|
141
134
|
);
|
|
142
135
|
|
|
143
|
-
useEffect(() => {
|
|
144
|
-
if (!occurrenceStartAtDate) return;
|
|
145
|
-
const eventStartDate = DateTime.fromISO(occurrenceStartAtDate);
|
|
146
|
-
const eventStart = eventStartDate.toFormat(DATE_MONTH_LOCALE_FORMAT);
|
|
147
|
-
setValue("name", `${productSetName} (${eventStart})`);
|
|
148
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
149
|
-
}, [setValue, occurrenceStartAtDate]);
|
|
150
|
-
|
|
151
136
|
return (
|
|
152
137
|
<Row
|
|
153
138
|
className={`product-set-form ${
|