@licklist/design 0.72.1 → 0.72.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/IntervalInput.d.ts +3 -1
- package/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
- package/dist/events/edit-event-modal/IntervalInput.js +11 -4
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +3 -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 +20 -6
- package/dist/events/edit-recurrent-event-modal/EditRecurrentEventModal.d.ts +5 -1
- package/dist/events/edit-recurrent-event-modal/EditRecurrentEventModal.d.ts.map +1 -1
- package/dist/events/edit-recurrent-event-modal/EditRecurrentEventModal.js +5 -3
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.js +2 -2
- package/dist/index.js +1 -1
- package/dist/recurrence-input/RecurrenceInput.d.ts.map +1 -1
- package/dist/recurrence-input/RecurrenceInput.js +7 -3
- package/package.json +3 -3
- package/src/events/edit-event-modal/IntervalInput.tsx +13 -3
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +24 -2
- package/src/events/edit-recurrent-event-modal/EditRecurrentEventModal.tsx +9 -1
- package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +2 -3
- package/src/recurrence-input/RecurrenceInput.tsx +10 -6
- package/yarn.lock +194 -166
|
@@ -5,12 +5,14 @@ interface IntervalInputProps {
|
|
|
5
5
|
productSets?: ProductSet[];
|
|
6
6
|
productSetId?: number;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
disabledRecurrent?: boolean;
|
|
9
|
+
isCopyCreate?: boolean;
|
|
8
10
|
}
|
|
9
11
|
export interface IntervalInputValues {
|
|
10
12
|
start: string;
|
|
11
13
|
end: string;
|
|
12
14
|
rrule: string | null;
|
|
13
15
|
}
|
|
14
|
-
export declare function IntervalInput({ disabled, editedProductSet, productSetId, productSets, }: IntervalInputProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function IntervalInput({ disabled, editedProductSet, productSetId, productSets, disabledRecurrent, isCopyCreate }: IntervalInputProps): import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
export {};
|
|
16
18
|
//# sourceMappingURL=IntervalInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntervalInput.d.ts","sourceRoot":"","sources":["../../../src/events/edit-event-modal/IntervalInput.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAA;AAIxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAG7D,UAAU,kBAAkB;IAC1B,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"IntervalInput.d.ts","sourceRoot":"","sources":["../../../src/events/edit-event-modal/IntervalInput.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAA;AAIxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAG7D,UAAU,kBAAkB;IAC1B,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,iBAAyB,EACzB,YAAoB,EACrB,EAAE,kBAAkB,2CAkKpB"}
|
|
@@ -110,7 +110,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
110
110
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
111
111
|
}
|
|
112
112
|
function IntervalInput(param) {
|
|
113
|
-
var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, editedProductSet = param.editedProductSet, productSetId = param.productSetId, productSets = param.productSets;
|
|
113
|
+
var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, editedProductSet = param.editedProductSet, productSetId = param.productSetId, productSets = param.productSets, _param_disabledRecurrent = param.disabledRecurrent, disabledRecurrent = _param_disabledRecurrent === void 0 ? false : _param_disabledRecurrent, _param_isCopyCreate = param.isCopyCreate, isCopyCreate = _param_isCopyCreate === void 0 ? false : _param_isCopyCreate;
|
|
114
114
|
var _errors_start, _errors_end;
|
|
115
115
|
var t = useTranslation([
|
|
116
116
|
'Design',
|
|
@@ -138,7 +138,6 @@ function IntervalInput(param) {
|
|
|
138
138
|
var endDateInput = useRef(null);
|
|
139
139
|
var updateEndDate = function(param) {
|
|
140
140
|
var _param_target = param.target, nextStartDate = _param_target.value;
|
|
141
|
-
setRecurrent(false);
|
|
142
141
|
setValue('start', nextStartDate);
|
|
143
142
|
if (DateTime.fromISO(end).diff(DateTime.fromISO(nextStartDate)).toMillis() < 0) {
|
|
144
143
|
setValue('end', nextStartDate);
|
|
@@ -153,6 +152,14 @@ function IntervalInput(param) {
|
|
|
153
152
|
}, [
|
|
154
153
|
editedProductSet
|
|
155
154
|
]);
|
|
155
|
+
useEffect(function() {
|
|
156
|
+
if (!isCopyCreate) return;
|
|
157
|
+
setRecurrent(false);
|
|
158
|
+
setValue('rrule', null);
|
|
159
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
160
|
+
}, [
|
|
161
|
+
isCopyCreate
|
|
162
|
+
]);
|
|
156
163
|
useEffect(function() {
|
|
157
164
|
if (!productSets) return;
|
|
158
165
|
var isOverridenProductSet = productSets.find(function(productSet) {
|
|
@@ -257,7 +264,7 @@ function IntervalInput(param) {
|
|
|
257
264
|
var checked = param.target.checked;
|
|
258
265
|
onChangeRecurrent(checked);
|
|
259
266
|
},
|
|
260
|
-
disabled: disabled || Boolean(editedProductSet)
|
|
267
|
+
disabled: disabled || Boolean(editedProductSet) || disabledRecurrent
|
|
261
268
|
}),
|
|
262
269
|
!recurrent && /*#__PURE__*/ jsx(Form.Text, {
|
|
263
270
|
muted: true,
|
|
@@ -283,7 +290,7 @@ function IntervalInput(param) {
|
|
|
283
290
|
minDate: DateTime.fromISO(start).plus({
|
|
284
291
|
day: 1
|
|
285
292
|
}).toFormat('yyyy-MM-dd'),
|
|
286
|
-
disabled: disabled
|
|
293
|
+
disabled: disabled || disabledRecurrent
|
|
287
294
|
});
|
|
288
295
|
}
|
|
289
296
|
})
|
|
@@ -36,6 +36,8 @@ export interface EditEventFormProps extends HasPermissionProp {
|
|
|
36
36
|
timeZone: string;
|
|
37
37
|
eventProductSet?: ProductSet;
|
|
38
38
|
overrideNameError?: string;
|
|
39
|
+
disabledRecurrent?: boolean;
|
|
40
|
+
isCopyCreate?: boolean;
|
|
39
41
|
}
|
|
40
|
-
export declare const EditEventForm: ({ disabled, categories, title, hasPermission, defaultEventValues, serverErrors, onSaveEvent, productSets, createProductSet, setEditProductSetId, isExternalPaymentLinkEnabled, timeZone, eventProductSet, overrideNameError, }: EditEventFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare const EditEventForm: ({ disabled, categories, title, hasPermission, defaultEventValues, serverErrors, onSaveEvent, productSets, createProductSet, setEditProductSetId, isExternalPaymentLinkEnabled, timeZone, eventProductSet, overrideNameError, disabledRecurrent, isCopyCreate, }: EditEventFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
43
|
//# sourceMappingURL=EditEventForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditEventForm.d.ts","sourceRoot":"","sources":["../../../../../src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,EACN,MAAM,sDAAsD,CAAA;
|
|
1
|
+
{"version":3,"file":"EditEventForm.d.ts","sourceRoot":"","sources":["../../../../../src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,EACN,MAAM,sDAAsD,CAAA;AAO7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AAGtF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAG3E,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAA;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAS5D,OAAO,EAAiB,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAGxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAA;AAGlF,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAA;IACzB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;IACtB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;CACxC;AAED,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,kBAAkB,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACjD,YAAY,CAAC,EAAE,WAAW,CAAA;IAC1B,WAAW,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAA;IAClD,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,gBAAgB,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAA;IACtD,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,4BAA4B,CAAC,EAAE,OAAO,CAAA;IACtC,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,UAAU,CAAA;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAOD,eAAO,MAAM,aAAa,oQAiBvB,kBAAkB,4CAyWpB,CAAA"}
|
|
@@ -3,6 +3,7 @@ import { useState, useCallback, useEffect } from 'react';
|
|
|
3
3
|
import { IMAGE_TYPE_MAP, IMAGE_TYPE_IMAGE, IMAGE_TYPE_COVER } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper';
|
|
4
4
|
import { useId } from '@react-aria/utils';
|
|
5
5
|
import { Modal, Form, Accordion, Button } from 'react-bootstrap';
|
|
6
|
+
import { isEqual } from 'lodash';
|
|
6
7
|
import { useForm, FormProvider, Controller } from 'react-hook-form';
|
|
7
8
|
import { DateTime } from 'luxon';
|
|
8
9
|
import { useTranslation } from 'react-i18next';
|
|
@@ -139,8 +140,8 @@ var eventImageTypes = {
|
|
|
139
140
|
uploadCover: IMAGE_TYPE_MAP[IMAGE_TYPE_COVER]
|
|
140
141
|
};
|
|
141
142
|
var EditEventForm = function(param) {
|
|
142
|
-
var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, categories = param.categories, title = param.title, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? true : _param_hasPermission, defaultEventValues = param.defaultEventValues, serverErrors = param.serverErrors, onSaveEvent = param.onSaveEvent, productSets = param.productSets, createProductSet = param.createProductSet, setEditProductSetId = param.setEditProductSetId, isExternalPaymentLinkEnabled = param.isExternalPaymentLinkEnabled, timeZone = param.timeZone, eventProductSet = param.eventProductSet, overrideNameError = param.overrideNameError;
|
|
143
|
-
var _errors_name, _errors_externalPaymentLink, _errors_integrationUrl;
|
|
143
|
+
var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, categories = param.categories, title = param.title, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? true : _param_hasPermission, defaultEventValues = param.defaultEventValues, serverErrors = param.serverErrors, onSaveEvent = param.onSaveEvent, productSets = param.productSets, createProductSet = param.createProductSet, setEditProductSetId = param.setEditProductSetId, isExternalPaymentLinkEnabled = param.isExternalPaymentLinkEnabled, timeZone = param.timeZone, eventProductSet = param.eventProductSet, overrideNameError = param.overrideNameError, _param_disabledRecurrent = param.disabledRecurrent, disabledRecurrent = _param_disabledRecurrent === void 0 ? false : _param_disabledRecurrent, _param_isCopyCreate = param.isCopyCreate, isCopyCreate = _param_isCopyCreate === void 0 ? false : _param_isCopyCreate;
|
|
144
|
+
var _defaultEventValues_rrule, _defaultEventValues_rrule1, _errors_name, _errors_externalPaymentLink, _errors_integrationUrl;
|
|
144
145
|
var t = useTranslation([
|
|
145
146
|
'Design',
|
|
146
147
|
'Validation'
|
|
@@ -160,7 +161,9 @@ var EditEventForm = function(param) {
|
|
|
160
161
|
var visible = watch('visible');
|
|
161
162
|
var editedProductSet = watch('editedProductSet');
|
|
162
163
|
var productSetId = watch('productSetId');
|
|
164
|
+
var rrule = watch('rrule');
|
|
163
165
|
var _useMultipleImages = useMultipleImages(initialImages), images = _useMultipleImages.images, handleImageRemove = _useMultipleImages.handleImageRemove, handleImageUploading = _useMultipleImages.handleImageUploading, isImagesLoading = _useMultipleImages.isImagesLoading, isCoverImagesLoading = _useMultipleImages.isCoverImagesLoading;
|
|
166
|
+
var watchedValues = watch();
|
|
164
167
|
var onErrorSubmit = function(submitErrors) {
|
|
165
168
|
scrollToError(getFirstErrorKey(submitErrors));
|
|
166
169
|
};
|
|
@@ -209,6 +212,15 @@ var EditEventForm = function(param) {
|
|
|
209
212
|
};
|
|
210
213
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
211
214
|
}, []);
|
|
215
|
+
var defaultExDate = (defaultEventValues === null || defaultEventValues === void 0 ? void 0 : (_defaultEventValues_rrule = defaultEventValues.rrule) === null || _defaultEventValues_rrule === void 0 ? void 0 : _defaultEventValues_rrule.includes('EXDATE')) ? defaultEventValues === null || defaultEventValues === void 0 ? void 0 : (_defaultEventValues_rrule1 = defaultEventValues.rrule) === null || _defaultEventValues_rrule1 === void 0 ? void 0 : _defaultEventValues_rrule1.split(';EXDATE=')[1] : '';
|
|
216
|
+
useEffect(function() {
|
|
217
|
+
if (!defaultExDate || (rrule === null || rrule === void 0 ? void 0 : rrule.includes('EXDATE'))) return;
|
|
218
|
+
rrule && setValue('rrule', rrule === null || rrule === void 0 ? void 0 : rrule.concat(";EXDATE=".concat(defaultExDate)));
|
|
219
|
+
}, [
|
|
220
|
+
defaultExDate,
|
|
221
|
+
rrule
|
|
222
|
+
]);
|
|
223
|
+
var isChanged = !isEqual(watchedValues, sanitizeDefaultValues(defaultEventValues));
|
|
212
224
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
213
225
|
children: [
|
|
214
226
|
/*#__PURE__*/ jsx(Dialog, {
|
|
@@ -305,7 +317,9 @@ var EditEventForm = function(param) {
|
|
|
305
317
|
disabled: disabled,
|
|
306
318
|
productSetId: productSetId,
|
|
307
319
|
productSets: productSets,
|
|
308
|
-
|
|
320
|
+
disabledRecurrent: disabledRecurrent,
|
|
321
|
+
editedProductSet: editedProductSet,
|
|
322
|
+
isCopyCreate: isCopyCreate
|
|
309
323
|
}, watch('name')),
|
|
310
324
|
categories.length !== 0 && /*#__PURE__*/ jsx(Form.Group, {
|
|
311
325
|
children: /*#__PURE__*/ jsx(Accordion, {
|
|
@@ -471,7 +485,7 @@ var EditEventForm = function(param) {
|
|
|
471
485
|
overrideNameError: overrideNameError
|
|
472
486
|
}),
|
|
473
487
|
hasPermission && !showEditProductSet && /*#__PURE__*/ jsx(Button, {
|
|
474
|
-
disabled: disabled || formState.isSubmitting || isImagesLoading || isCoverImagesLoading,
|
|
488
|
+
disabled: disabled || formState.isSubmitting || !isChanged || isImagesLoading || isCoverImagesLoading,
|
|
475
489
|
className: "save-event",
|
|
476
490
|
type: "submit",
|
|
477
491
|
children: formState.isSubmitting ? "".concat(t('saveAndAdd'), "...") : t('saveAndAdd')
|
|
@@ -496,7 +510,7 @@ var sanitizeDefaultValues = function(values) {
|
|
|
496
510
|
suppressSeconds: true
|
|
497
511
|
});
|
|
498
512
|
};
|
|
499
|
-
var _values_name, _values_description, _values_startAt, _values_endAt, _values_rrule, _values_categories, _values_termsAndConditions, _values_visible, _values_externalPaymentLink, _values_integrationUrl, _values_recurrenceEndAt;
|
|
513
|
+
var _values_name, _values_description, _values_startAt, _values_endAt, _values_rrule, _values_categories, _values_termsAndConditions, _values_visible, _values_externalPaymentLink, _values_images, _values_integrationUrl, _values_recurrenceEndAt;
|
|
500
514
|
return {
|
|
501
515
|
name: (_values_name = values === null || values === void 0 ? void 0 : values.name) !== null && _values_name !== void 0 ? _values_name : '',
|
|
502
516
|
description: (_values_description = values === null || values === void 0 ? void 0 : values.description) !== null && _values_description !== void 0 ? _values_description : '',
|
|
@@ -508,7 +522,7 @@ var sanitizeDefaultValues = function(values) {
|
|
|
508
522
|
visible: (_values_visible = values === null || values === void 0 ? void 0 : values.visible) !== null && _values_visible !== void 0 ? _values_visible : '',
|
|
509
523
|
externalPaymentLink: (_values_externalPaymentLink = values === null || values === void 0 ? void 0 : values.externalPaymentLink) !== null && _values_externalPaymentLink !== void 0 ? _values_externalPaymentLink : '',
|
|
510
524
|
productSetId: values === null || values === void 0 ? void 0 : values.productSetId,
|
|
511
|
-
images: values === null || values === void 0 ? void 0 : values.images,
|
|
525
|
+
images: (_values_images = values === null || values === void 0 ? void 0 : values.images) !== null && _values_images !== void 0 ? _values_images : [],
|
|
512
526
|
saleDeadline: values === null || values === void 0 ? void 0 : values.saleDeadline,
|
|
513
527
|
integrationUrl: (_values_integrationUrl = values === null || values === void 0 ? void 0 : values.integrationUrl) !== null && _values_integrationUrl !== void 0 ? _values_integrationUrl : '',
|
|
514
528
|
recurrenceEndAt: (_values_recurrenceEndAt = values === null || values === void 0 ? void 0 : values.recurrenceEndAt) !== null && _values_recurrenceEndAt !== void 0 ? _values_recurrenceEndAt : undefined
|
|
@@ -8,6 +8,9 @@ export declare const RECURRENT_MODE_TYPES_LIST: {
|
|
|
8
8
|
thisAndFollowingEvents: number;
|
|
9
9
|
allEvents: number;
|
|
10
10
|
};
|
|
11
|
+
export declare const RECURRENT_MODE_TYPES_WITHOUT_ALL: {
|
|
12
|
+
thisEvent: number;
|
|
13
|
+
};
|
|
11
14
|
export type RecurrentEventMode = (typeof MODES)[number];
|
|
12
15
|
export type EditRecurrentEventModalValues = {
|
|
13
16
|
mode: RecurrentEventMode;
|
|
@@ -18,7 +21,8 @@ export type EditRecurrentEventModalProps = {
|
|
|
18
21
|
onHide: () => void;
|
|
19
22
|
title: string;
|
|
20
23
|
onSubmit: (values: EditRecurrentEventModalValues) => void;
|
|
24
|
+
isDateWasChanged?: boolean;
|
|
21
25
|
};
|
|
22
|
-
export declare const EditRecurrentEventModal: ({ disabled, isOpen, onHide, title, onSubmit, }: EditRecurrentEventModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const EditRecurrentEventModal: ({ disabled, isOpen, onHide, title, onSubmit, isDateWasChanged }: EditRecurrentEventModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
27
|
export {};
|
|
24
28
|
//# sourceMappingURL=EditRecurrentEventModal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditRecurrentEventModal.d.ts","sourceRoot":"","sources":["../../../src/events/edit-recurrent-event-modal/EditRecurrentEventModal.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,cAAc,CAAA;AAC1C,eAAO,MAAM,8BAA8B,2BAA2B,CAAA;AACtE,eAAO,MAAM,eAAe,cAAc,CAAA;AAE1C,QAAA,MAAM,KAAK,+DAID,CAAA;AAEV,eAAO,MAAM,2BAA2B,cAAkB,CAAA;AAE1D,eAAO,MAAM,yBAAyB;;;;CAIrC,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,kBAAkB,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,MAAM,EAAE,6BAA6B,KAAK,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"EditRecurrentEventModal.d.ts","sourceRoot":"","sources":["../../../src/events/edit-recurrent-event-modal/EditRecurrentEventModal.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,cAAc,CAAA;AAC1C,eAAO,MAAM,8BAA8B,2BAA2B,CAAA;AACtE,eAAO,MAAM,eAAe,cAAc,CAAA;AAE1C,QAAA,MAAM,KAAK,+DAID,CAAA;AAEV,eAAO,MAAM,2BAA2B,cAAkB,CAAA;AAE1D,eAAO,MAAM,yBAAyB;;;;CAIrC,CAAA;AAED,eAAO,MAAM,gCAAgC;;CAE5C,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,kBAAkB,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,MAAM,EAAE,6BAA6B,KAAK,IAAI,CAAA;IACzD,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,uBAAuB,oEAOjC,4BAA4B,4CAkF9B,CAAA"}
|
|
@@ -23,14 +23,16 @@ var MODE_ALL_EVENTS = 'allEvents';
|
|
|
23
23
|
var DEFAULT_RECURRENT_MODE_TYPE = MODE_THIS_EVENT;
|
|
24
24
|
var _obj;
|
|
25
25
|
var RECURRENT_MODE_TYPES_LIST = (_obj = {}, _define_property(_obj, MODE_THIS_EVENT, 1), _define_property(_obj, MODE_THIS_AND_FOLLOWING_EVENTS, 2), _define_property(_obj, MODE_ALL_EVENTS, 3), _obj);
|
|
26
|
+
var RECURRENT_MODE_TYPES_WITHOUT_ALL = _define_property({}, MODE_THIS_EVENT, 1);
|
|
26
27
|
var EditRecurrentEventModal = function(param) {
|
|
27
|
-
var disabled = param.disabled, isOpen = param.isOpen, onHide = param.onHide, title = param.title, onSubmit = param.onSubmit;
|
|
28
|
+
var disabled = param.disabled, isOpen = param.isOpen, onHide = param.onHide, title = param.title, onSubmit = param.onSubmit, _param_isDateWasChanged = param.isDateWasChanged, isDateWasChanged = _param_isDateWasChanged === void 0 ? false : _param_isDateWasChanged;
|
|
28
29
|
var t = useTranslation('Design').t;
|
|
29
30
|
var _useForm = useForm({
|
|
30
31
|
defaultValues: {
|
|
31
32
|
mode: DEFAULT_RECURRENT_MODE_TYPE
|
|
32
33
|
}
|
|
33
34
|
}), control = _useForm.control, handleSubmit = _useForm.handleSubmit;
|
|
35
|
+
var recurrentListMode = isDateWasChanged ? RECURRENT_MODE_TYPES_WITHOUT_ALL : RECURRENT_MODE_TYPES_LIST;
|
|
34
36
|
return /*#__PURE__*/ jsx(Modal, {
|
|
35
37
|
show: isOpen,
|
|
36
38
|
onHide: onHide,
|
|
@@ -67,7 +69,7 @@ var EditRecurrentEventModal = function(param) {
|
|
|
67
69
|
render: function(param) {
|
|
68
70
|
var _param_field = param.field, value = _param_field.value, onChange = _param_field.onChange;
|
|
69
71
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
70
|
-
children: Object.keys(
|
|
72
|
+
children: Object.keys(recurrentListMode).map(function(option) {
|
|
71
73
|
return /*#__PURE__*/ jsxs(Form.Check, {
|
|
72
74
|
type: "radio",
|
|
73
75
|
id: option,
|
|
@@ -120,4 +122,4 @@ var EditRecurrentEventModal = function(param) {
|
|
|
120
122
|
});
|
|
121
123
|
};
|
|
122
124
|
|
|
123
|
-
export { DEFAULT_RECURRENT_MODE_TYPE, EditRecurrentEventModal, MODE_ALL_EVENTS, MODE_THIS_AND_FOLLOWING_EVENTS, MODE_THIS_EVENT, RECURRENT_MODE_TYPES_LIST };
|
|
125
|
+
export { DEFAULT_RECURRENT_MODE_TYPE, EditRecurrentEventModal, MODE_ALL_EVENTS, MODE_THIS_AND_FOLLOWING_EVENTS, MODE_THIS_EVENT, RECURRENT_MODE_TYPES_LIST, RECURRENT_MODE_TYPES_WITHOUT_ALL };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAA;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAA;
|
|
1
|
+
{"version":3,"file":"ProductSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAA;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAA;AAIrG,UAAU,aAAc,SAAQ,SAAS;IACvC,qBAAqB,CAAC,EAAG,sBAAsB,EAAE,GAAG,IAAI,CAAC;CAC1D;AAED,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,YAAY,EAAE,aAAa,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,cAAc,kDAIxB,mBAAmB,4CAyCrB,CAAA"}
|
|
@@ -9,7 +9,7 @@ var ProductSummary = function(param) {
|
|
|
9
9
|
var t = useTranslation('Design').t;
|
|
10
10
|
var formatNumber = useIntl().formatNumber;
|
|
11
11
|
var priceForOneProduct = orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.price;
|
|
12
|
-
var modifiersSets = (orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.orderModifiersSets) || (orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.orderProductModifiers);
|
|
12
|
+
var modifiersSets = (orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.orderModifiersSets) || (orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.orderProductModifiers) || [];
|
|
13
13
|
var fullPrice = formatNumber(priceForOneProduct * (orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.quantity), {
|
|
14
14
|
style: 'currency',
|
|
15
15
|
currency: Config.Currency.GBP
|
|
@@ -38,7 +38,7 @@ var ProductSummary = function(param) {
|
|
|
38
38
|
})
|
|
39
39
|
]
|
|
40
40
|
}),
|
|
41
|
-
!!modifiersSets.length && /*#__PURE__*/ jsx(Fragment, {
|
|
41
|
+
!!(modifiersSets === null || modifiersSets === void 0 ? void 0 : modifiersSets.length) && /*#__PURE__*/ jsx(Fragment, {
|
|
42
42
|
children: modifiersSets.map(function(modifier, index) {
|
|
43
43
|
return /*#__PURE__*/ jsx(ProductWithModifier, {
|
|
44
44
|
modifier: modifier,
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ export { ErrorFallback } from './error/ErrorFallback.js';
|
|
|
23
23
|
export { ProductSetShortForm } from './events/edit-event-modal/component/ProductSetShortForm/ProductSetShortForm.js';
|
|
24
24
|
export { SelectEventProductSet } from './events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js';
|
|
25
25
|
export { EditEventForm } from './events/edit-event-modal/component/EditEventForm/EditEventForm.js';
|
|
26
|
-
export { DEFAULT_RECURRENT_MODE_TYPE, EditRecurrentEventModal, MODE_ALL_EVENTS, MODE_THIS_AND_FOLLOWING_EVENTS, MODE_THIS_EVENT, RECURRENT_MODE_TYPES_LIST } from './events/edit-recurrent-event-modal/EditRecurrentEventModal.js';
|
|
26
|
+
export { DEFAULT_RECURRENT_MODE_TYPE, EditRecurrentEventModal, MODE_ALL_EVENTS, MODE_THIS_AND_FOLLOWING_EVENTS, MODE_THIS_EVENT, RECURRENT_MODE_TYPES_LIST, RECURRENT_MODE_TYPES_WITHOUT_ALL } from './events/edit-recurrent-event-modal/EditRecurrentEventModal.js';
|
|
27
27
|
export { EventCard } from './events/event-card/EventCard.js';
|
|
28
28
|
export { EventCardSkeleton } from './events/event-card/EventCardSkeleton.js';
|
|
29
29
|
export { EventStatisticModal } from './events/event-statistic-modal/EventStatisticModal.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecurrenceInput.d.ts","sourceRoot":"","sources":["../../src/recurrence-input/RecurrenceInput.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,SAAS,EAAW,MAAM,OAAO,CAAA;AAWjD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,gBAAgB,CAAC,EAAE,SAAS,CAAA;CAC7B;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAAgB,EAChB,IAAI,EACJ,OAAO,EACP,KAAK,EACL,QAAQ,EACR,gBAAmC,GACpC,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"RecurrenceInput.d.ts","sourceRoot":"","sources":["../../src/recurrence-input/RecurrenceInput.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,SAAS,EAAW,MAAM,OAAO,CAAA;AAWjD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,gBAAgB,CAAC,EAAE,SAAS,CAAA;CAC7B;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAAgB,EAChB,IAAI,EACJ,OAAO,EACP,KAAK,EACL,QAAQ,EACR,gBAAmC,GACpC,EAAE,oBAAoB,2CAyEtB"}
|
|
@@ -117,9 +117,13 @@ function RecurrenceInput(param) {
|
|
|
117
117
|
})), 2), state = _useReducer[0], updateState = _useReducer[1];
|
|
118
118
|
useEffect(// TODO: unhardcode timezone
|
|
119
119
|
function() {
|
|
120
|
-
return onChange(RRule.optionsToString(
|
|
120
|
+
return onChange(RRule.optionsToString(_object_spread({
|
|
121
|
+
freq: state.freq,
|
|
122
|
+
count: state.count,
|
|
123
|
+
interval: state.interval,
|
|
124
|
+
byweekday: state.byweekday,
|
|
121
125
|
tzid: 'Europe/London'
|
|
122
|
-
})).replace('RRULE:', ''));
|
|
126
|
+
}, state)).replace('RRULE:', ''));
|
|
123
127
|
}, [
|
|
124
128
|
state
|
|
125
129
|
]);
|
|
@@ -131,8 +135,8 @@ function RecurrenceInput(param) {
|
|
|
131
135
|
onChange: function(param) {
|
|
132
136
|
var interval = param.interval, frequency = param.frequency;
|
|
133
137
|
updateState({
|
|
134
|
-
interval: interval,
|
|
135
138
|
freq: frequency,
|
|
139
|
+
interval: interval,
|
|
136
140
|
byweekday: frequency === state.freq ? state.byweekday : frequency === RRule.WEEKLY ? [
|
|
137
141
|
getWeekdayForFrequency({
|
|
138
142
|
date: date,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.72.
|
|
3
|
+
"version": "0.72.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@licklist/core": "0.32.
|
|
45
|
+
"@licklist/core": "0.32.11",
|
|
46
46
|
"@licklist/eslint-config": "0.5.6",
|
|
47
47
|
"@licklist/plugins": "0.35.9",
|
|
48
48
|
"lodash": "4.17.21",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@dnd-kit/utilities": "2.0.0",
|
|
62
62
|
"@fortawesome/fontawesome-svg-core": "1.2.34",
|
|
63
63
|
"@fortawesome/free-solid-svg-icons": "5.15.2",
|
|
64
|
-
"@licklist/core": "0.32.
|
|
64
|
+
"@licklist/core": "0.32.11",
|
|
65
65
|
"@licklist/eslint-config": "0.5.6",
|
|
66
66
|
"@licklist/plugins": "0.35.9",
|
|
67
67
|
"@mantine/core": "6.0.22",
|
|
@@ -17,6 +17,8 @@ interface IntervalInputProps {
|
|
|
17
17
|
productSets?: ProductSet[]
|
|
18
18
|
productSetId?: number
|
|
19
19
|
disabled?: boolean
|
|
20
|
+
disabledRecurrent?: boolean
|
|
21
|
+
isCopyCreate?: boolean
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
export interface IntervalInputValues {
|
|
@@ -30,6 +32,8 @@ export function IntervalInput({
|
|
|
30
32
|
editedProductSet,
|
|
31
33
|
productSetId,
|
|
32
34
|
productSets,
|
|
35
|
+
disabledRecurrent = false,
|
|
36
|
+
isCopyCreate = false
|
|
33
37
|
}: IntervalInputProps) {
|
|
34
38
|
const { t } = useTranslation(['Design', 'Validation'])
|
|
35
39
|
const {
|
|
@@ -54,7 +58,6 @@ export function IntervalInput({
|
|
|
54
58
|
const endDateInput = useRef<HTMLInputDateElement | null>(null)
|
|
55
59
|
|
|
56
60
|
const updateEndDate = ({ target: { value: nextStartDate } }) => {
|
|
57
|
-
setRecurrent(false)
|
|
58
61
|
setValue('start', nextStartDate)
|
|
59
62
|
|
|
60
63
|
if (
|
|
@@ -72,6 +75,13 @@ export function IntervalInput({
|
|
|
72
75
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
76
|
}, [editedProductSet])
|
|
74
77
|
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
if (!isCopyCreate) return
|
|
80
|
+
setRecurrent(false)
|
|
81
|
+
setValue('rrule', null)
|
|
82
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
83
|
+
}, [isCopyCreate])
|
|
84
|
+
|
|
75
85
|
useEffect(() => {
|
|
76
86
|
if (!productSets) return
|
|
77
87
|
|
|
@@ -153,7 +163,7 @@ export function IntervalInput({
|
|
|
153
163
|
onChange={({ target: { checked } }) => {
|
|
154
164
|
onChangeRecurrent(checked)
|
|
155
165
|
}}
|
|
156
|
-
disabled={disabled || Boolean(editedProductSet)}
|
|
166
|
+
disabled={disabled || Boolean(editedProductSet) || disabledRecurrent}
|
|
157
167
|
/>
|
|
158
168
|
{!recurrent && (
|
|
159
169
|
<Form.Text muted>
|
|
@@ -178,7 +188,7 @@ export function IntervalInput({
|
|
|
178
188
|
minDate={DateTime.fromISO(start)
|
|
179
189
|
.plus({ day: 1 })
|
|
180
190
|
.toFormat('yyyy-MM-dd')}
|
|
181
|
-
disabled={disabled}
|
|
191
|
+
disabled={disabled || disabledRecurrent}
|
|
182
192
|
/>
|
|
183
193
|
)}
|
|
184
194
|
/>
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
|
|
9
9
|
import { useId } from '@react-aria/utils'
|
|
10
10
|
import { Accordion, Button, Form, Modal } from 'react-bootstrap'
|
|
11
|
+
import { isEqual } from 'lodash'
|
|
11
12
|
import { FormProvider, useForm, Controller } from 'react-hook-form'
|
|
12
13
|
import { DateTime } from 'luxon'
|
|
13
14
|
import { useTranslation } from 'react-i18next'
|
|
@@ -65,6 +66,8 @@ export interface EditEventFormProps extends HasPermissionProp {
|
|
|
65
66
|
timeZone: string
|
|
66
67
|
eventProductSet?: ProductSet
|
|
67
68
|
overrideNameError?: string
|
|
69
|
+
disabledRecurrent?: boolean
|
|
70
|
+
isCopyCreate?: boolean
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
const eventImageTypes = {
|
|
@@ -87,6 +90,8 @@ export const EditEventForm = ({
|
|
|
87
90
|
timeZone,
|
|
88
91
|
eventProductSet,
|
|
89
92
|
overrideNameError,
|
|
93
|
+
disabledRecurrent = false,
|
|
94
|
+
isCopyCreate = false,
|
|
90
95
|
}: EditEventFormProps) => {
|
|
91
96
|
const { t } = useTranslation(['Design', 'Validation'])
|
|
92
97
|
|
|
@@ -126,7 +131,7 @@ export const EditEventForm = ({
|
|
|
126
131
|
const visible = watch('visible')
|
|
127
132
|
const editedProductSet = watch('editedProductSet')
|
|
128
133
|
const productSetId = watch('productSetId')
|
|
129
|
-
|
|
134
|
+
const rrule = watch('rrule')
|
|
130
135
|
const {
|
|
131
136
|
images,
|
|
132
137
|
handleImageRemove,
|
|
@@ -135,6 +140,8 @@ export const EditEventForm = ({
|
|
|
135
140
|
isCoverImagesLoading,
|
|
136
141
|
} = useMultipleImages(initialImages)
|
|
137
142
|
|
|
143
|
+
const watchedValues = watch()
|
|
144
|
+
|
|
138
145
|
const onErrorSubmit = (submitErrors) => {
|
|
139
146
|
scrollToError(getFirstErrorKey(submitErrors))
|
|
140
147
|
}
|
|
@@ -179,6 +186,18 @@ export const EditEventForm = ({
|
|
|
179
186
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
180
187
|
}, [])
|
|
181
188
|
|
|
189
|
+
const defaultExDate = defaultEventValues?.rrule?.includes('EXDATE')
|
|
190
|
+
? defaultEventValues?.rrule?.split(';EXDATE=')[1]
|
|
191
|
+
: ''
|
|
192
|
+
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
if (!defaultExDate || rrule?.includes('EXDATE')) return
|
|
195
|
+
rrule && setValue('rrule', rrule?.concat(`;EXDATE=${defaultExDate}`))
|
|
196
|
+
}, [defaultExDate, rrule])
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
const isChanged = !isEqual(watchedValues, sanitizeDefaultValues(defaultEventValues));
|
|
200
|
+
|
|
182
201
|
return (
|
|
183
202
|
<>
|
|
184
203
|
<Dialog
|
|
@@ -273,7 +292,9 @@ export const EditEventForm = ({
|
|
|
273
292
|
disabled={disabled}
|
|
274
293
|
productSetId={productSetId}
|
|
275
294
|
productSets={productSets}
|
|
295
|
+
disabledRecurrent={disabledRecurrent}
|
|
276
296
|
editedProductSet={editedProductSet}
|
|
297
|
+
isCopyCreate={isCopyCreate}
|
|
277
298
|
/>
|
|
278
299
|
{categories.length !== 0 && (
|
|
279
300
|
<Form.Group>
|
|
@@ -416,6 +437,7 @@ export const EditEventForm = ({
|
|
|
416
437
|
disabled={
|
|
417
438
|
disabled ||
|
|
418
439
|
formState.isSubmitting ||
|
|
440
|
+
!isChanged ||
|
|
419
441
|
isImagesLoading ||
|
|
420
442
|
isCoverImagesLoading
|
|
421
443
|
}
|
|
@@ -462,7 +484,7 @@ const sanitizeDefaultValues = (
|
|
|
462
484
|
visible: values?.visible ?? '',
|
|
463
485
|
externalPaymentLink: values?.externalPaymentLink ?? '',
|
|
464
486
|
productSetId: values?.productSetId,
|
|
465
|
-
images: values?.images,
|
|
487
|
+
images: values?.images ?? [],
|
|
466
488
|
saleDeadline: values?.saleDeadline,
|
|
467
489
|
integrationUrl: values?.integrationUrl ?? '',
|
|
468
490
|
recurrenceEndAt: values?.recurrenceEndAt ?? undefined,
|
|
@@ -21,6 +21,10 @@ export const RECURRENT_MODE_TYPES_LIST = {
|
|
|
21
21
|
[MODE_ALL_EVENTS]: 3,
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
export const RECURRENT_MODE_TYPES_WITHOUT_ALL = {
|
|
25
|
+
[MODE_THIS_EVENT]: 1,
|
|
26
|
+
}
|
|
27
|
+
|
|
24
28
|
export type RecurrentEventMode = (typeof MODES)[number]
|
|
25
29
|
|
|
26
30
|
export type EditRecurrentEventModalValues = {
|
|
@@ -33,6 +37,7 @@ export type EditRecurrentEventModalProps = {
|
|
|
33
37
|
onHide: () => void
|
|
34
38
|
title: string
|
|
35
39
|
onSubmit: (values: EditRecurrentEventModalValues) => void
|
|
40
|
+
isDateWasChanged?: boolean
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
export const EditRecurrentEventModal = ({
|
|
@@ -41,6 +46,7 @@ export const EditRecurrentEventModal = ({
|
|
|
41
46
|
onHide,
|
|
42
47
|
title,
|
|
43
48
|
onSubmit,
|
|
49
|
+
isDateWasChanged = false
|
|
44
50
|
}: EditRecurrentEventModalProps) => {
|
|
45
51
|
const { t } = useTranslation('Design')
|
|
46
52
|
|
|
@@ -50,6 +56,8 @@ export const EditRecurrentEventModal = ({
|
|
|
50
56
|
},
|
|
51
57
|
})
|
|
52
58
|
|
|
59
|
+
const recurrentListMode = isDateWasChanged? RECURRENT_MODE_TYPES_WITHOUT_ALL : RECURRENT_MODE_TYPES_LIST
|
|
60
|
+
|
|
53
61
|
return (
|
|
54
62
|
<Modal
|
|
55
63
|
show={isOpen}
|
|
@@ -75,7 +83,7 @@ export const EditRecurrentEventModal = ({
|
|
|
75
83
|
<Controller
|
|
76
84
|
render={({ field: { value, onChange } }) => (
|
|
77
85
|
<>
|
|
78
|
-
{Object.keys(
|
|
86
|
+
{Object.keys(recurrentListMode).map((option) => (
|
|
79
87
|
<Form.Check
|
|
80
88
|
type='radio'
|
|
81
89
|
id={option}
|
|
@@ -3,7 +3,6 @@ import { useIntl } from 'react-intl'
|
|
|
3
3
|
import * as Config from '@licklist/core/dist/Config'
|
|
4
4
|
import { OrderItem } from '@licklist/plugins/dist/types/context/Iframe/orderItems'
|
|
5
5
|
import { OrderModifierByProduct } from '@licklist/core/dist/DataMapper/Order/OrderModifiierByProduct'
|
|
6
|
-
import { calculateTotalModifiersPrice } from '../../utils'
|
|
7
6
|
import { ProductWithModifier } from '../../../CategoryProduct/components/ProductWithModifier/ProductWithModifier'
|
|
8
7
|
|
|
9
8
|
|
|
@@ -26,7 +25,7 @@ export const ProductSummary = ({
|
|
|
26
25
|
const { formatNumber } = useIntl()
|
|
27
26
|
const priceForOneProduct = orderProduct?.price
|
|
28
27
|
|
|
29
|
-
const modifiersSets = orderProduct?.orderModifiersSets || orderProduct?.orderProductModifiers
|
|
28
|
+
const modifiersSets = orderProduct?.orderModifiersSets || orderProduct?.orderProductModifiers || []
|
|
30
29
|
|
|
31
30
|
const fullPrice = formatNumber(priceForOneProduct * orderProduct?.quantity, {
|
|
32
31
|
style: 'currency',
|
|
@@ -44,7 +43,7 @@ export const ProductSummary = ({
|
|
|
44
43
|
<p className='price'>{fullPrice}</p>
|
|
45
44
|
</div>
|
|
46
45
|
|
|
47
|
-
{!!modifiersSets
|
|
46
|
+
{!!modifiersSets?.length && (
|
|
48
47
|
<>
|
|
49
48
|
{modifiersSets.map((modifier, index) => (
|
|
50
49
|
<ProductWithModifier
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable prefer-destructuring */
|
|
2
2
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
3
3
|
import { DateTime } from 'luxon'
|
|
4
|
-
import { useEffect, useReducer } from 'react'
|
|
4
|
+
import { useEffect, useReducer, useState } from 'react'
|
|
5
5
|
import RRule, { Frequency, Weekday } from 'rrule'
|
|
6
6
|
import RecurrenceEndInput, { defaultOccurrences } from './RecurrenceEndInput'
|
|
7
7
|
import RecurrenceIntervalAndFrequencyInput from './RecurrenceIntervalAndFrequencyInput'
|
|
@@ -39,10 +39,14 @@ export function RecurrenceInput({
|
|
|
39
39
|
// TODO: unhardcode timezone
|
|
40
40
|
() =>
|
|
41
41
|
onChange(
|
|
42
|
-
RRule.optionsToString({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
RRule.optionsToString({
|
|
43
|
+
freq: state.freq,
|
|
44
|
+
count: state.count,
|
|
45
|
+
interval: state.interval,
|
|
46
|
+
byweekday: state.byweekday,
|
|
47
|
+
tzid: 'Europe/London',
|
|
48
|
+
...state,
|
|
49
|
+
}).replace('RRULE:', ''),
|
|
46
50
|
),
|
|
47
51
|
[state],
|
|
48
52
|
)
|
|
@@ -54,8 +58,8 @@ export function RecurrenceInput({
|
|
|
54
58
|
frequency={state.freq}
|
|
55
59
|
onChange={({ interval, frequency }) => {
|
|
56
60
|
updateState({
|
|
57
|
-
interval,
|
|
58
61
|
freq: frequency,
|
|
62
|
+
interval,
|
|
59
63
|
byweekday:
|
|
60
64
|
frequency === state.freq
|
|
61
65
|
? state.byweekday
|