@licklist/design 0.67.5-dev.0 → 0.67.5
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/.storybook/main.cjs +12 -15
- package/dist/assets/iframe/selectArrow.svg.js +17 -0
- package/dist/auth/Login/LoginComponent.js +1 -2
- package/dist/calendar/Calendar.d.ts +2 -2
- package/dist/calendar/Calendar.d.ts.map +1 -1
- package/dist/calendar/components/CalendarButtons/CalendarButtons.d.ts.map +1 -1
- package/dist/calendar/components/CalendarButtons/CalendarButtons.js +40 -35
- package/dist/calendar/utils/index.d.ts +2 -2
- package/dist/calendar/utils/index.d.ts.map +1 -1
- package/dist/calendar/utils/index.js +4 -20
- package/dist/date-time-button/DateTimeButton.d.ts +2 -1
- package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
- package/dist/date-time-button/DateTimeButton.js +3 -2
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +1 -2
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +4 -4
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts +2 -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 +26 -27
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts +2 -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 +3 -3
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -0
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +0 -2
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/layout/DropDown.d.ts +1 -2
- package/dist/layout/DropDown.d.ts.map +1 -1
- package/dist/modals/confirmation/ConfirmModal.d.ts +1 -3
- package/dist/modals/confirmation/ConfirmModal.d.ts.map +1 -1
- package/dist/modals/confirmation/ConfirmModal.js +8 -172
- package/dist/product-set/card/ProductSetCard.d.ts +2 -6
- package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
- package/dist/product-set/card/ProductSetCard.js +11 -30
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts +2 -3
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.js +1 -3
- package/dist/product-set/control/DateInput.d.ts.map +1 -1
- package/dist/product-set/control/DateInput.js +2 -2
- package/dist/product-set/control/ProductSetControl.d.ts +3 -3
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +16 -4
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +2 -48
- package/dist/product-set/form/ProductSetForm.d.ts +2 -6
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +5 -65
- package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductZonesControl.js +2 -0
- package/dist/product-set/form/SelectCategoryModal.d.ts +0 -12
- package/dist/product-set/form/SelectCategoryModal.d.ts.map +1 -1
- package/dist/product-set/form/SelectCategoryModal.js +1 -1
- package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/SubProductsControl.js +3 -0
- package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
- package/dist/product-set/form/VenueMapsControl.js +3 -0
- package/dist/product-set/form/index.d.ts +0 -1
- package/dist/product-set/form/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.d.ts +0 -7
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.js +1 -10
- package/dist/provider/location-input/LocationInput.d.ts +1 -4
- package/dist/provider/location-input/LocationInput.d.ts.map +1 -1
- package/dist/provider/location-input/LocationInput.js +2 -41
- package/dist/provider/location-input/LocationInputDescription.d.ts +1 -4
- package/dist/provider/location-input/LocationInputDescription.d.ts.map +1 -1
- package/dist/provider/location-input/LocationInputDescription.js +12 -27
- package/dist/provider/location-input/index.d.ts +0 -1
- package/dist/provider/location-input/index.d.ts.map +1 -1
- package/dist/provider/provider-form/ProviderForm.d.ts +1 -3
- package/dist/provider/provider-form/ProviderForm.d.ts.map +1 -1
- package/dist/provider/provider-form/ProviderForm.js +3 -7
- package/dist/provider/venue-form/VenueForm.d.ts +1 -3
- package/dist/provider/venue-form/VenueForm.d.ts.map +1 -1
- package/dist/provider/venue-form/VenueForm.js +3 -7
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +8 -4
- package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.d.ts +1 -2
- package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.js +13 -7
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +1 -4
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +3 -7
- package/dist/recurring-date-picker-input/utils.d.ts +0 -5
- package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/utils.js +3 -72
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +7 -4
- package/dist/sales/guest-profile/previous-bookings/PreviousBookings.js +1 -1
- package/dist/sales/manual-booking/formatDays.js +3 -3
- package/dist/sales/manual-booking/select-event/SelectEvent.d.ts.map +1 -1
- package/dist/sales/manual-booking/select-event/SelectEvent.js +3 -3
- package/dist/sales/manual-booking/summary/ManualBookingSummary.d.ts.map +1 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.js +2 -2
- package/dist/sales/notes/NotesTableRow.js +4 -3
- package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
- package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.js +0 -6
- package/dist/sortable-tree/SortableTreeItem.d.ts +1 -2
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.js +4 -10
- package/dist/styles/auth/AccessDenied.scss +1 -1
- package/dist/styles/back-button/BackButton.scss +24 -25
- package/dist/styles/back-button/_index.scss +1 -1
- package/dist/styles/company-user-form/UserForm.scss +7 -4
- package/dist/styles/company-user-form/_index.scss +1 -1
- package/dist/styles/custom-fields/CreateSortableListItem.scss +1 -2
- package/dist/styles/custom-fields/_index.scss +1 -1
- package/dist/styles/customers/Filter.scss +5 -5
- package/dist/styles/events/EditEventModal.scss +3 -1
- package/dist/styles/events/EventVenueMap.scss +7 -7
- package/dist/styles/form/Input.scss +1 -1
- package/dist/styles/header/Header.scss +1 -1
- package/dist/styles/header/elements/CompanySelector.scss +2 -2
- package/dist/styles/iframe-events/Calendar.scss +1 -0
- package/dist/styles/iframe-events/CalendarSelect.scss +1 -1
- package/dist/styles/iframe-events/CategoryStepsForm.scss +7 -6
- package/dist/styles/iframe-events/Event.scss +4 -2
- package/dist/styles/iframe-events/EventForm.scss +54 -54
- package/dist/styles/iframe-events/EventNavigationFooter.scss +0 -1
- package/dist/styles/iframe-events/TicketDescription.scss +1 -1
- package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/dist/styles/iframe-payments/PaymentForm.scss +1 -1
- package/dist/styles/layout/BackgroundVideoContainer.scss +2 -2
- package/dist/styles/notification/Notification.scss +1 -1
- package/dist/styles/order-items-table/OrderItemsTable.scss +2 -1
- package/dist/styles/product-set/CreateProductSetItem.scss +13 -15
- package/dist/styles/product-set/DateAndRecurrenceInput.scss +8 -6
- package/dist/styles/product-set/EditCategoryModal.scss +4 -4
- package/dist/styles/product-set/EditProductModal.scss +3 -3
- package/dist/styles/product-set/EditStepModal.scss +4 -4
- package/dist/styles/product-set/EditVenueMapSetModal.scss +6 -6
- package/dist/styles/product-set/ProductSetForm.scss +2 -25
- package/dist/styles/product-set/TutorialGifCard.scss +1 -1
- package/dist/styles/product-set/_index.scss +2 -2
- package/dist/styles/report/ReportCard.scss +0 -1
- package/dist/styles/report/_index.scss +1 -1
- package/dist/styles/resources-blocking/_index.scss +0 -4
- package/dist/styles/sales/BookingFilter.scss +2 -2
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/styles/sales/BookingTabs.scss +5 -7
- package/dist/styles/sales/Filters.scss +4 -5
- package/dist/styles/sales/GuestProfile.scss +175 -170
- package/dist/styles/sales/LifeTimeSales.scss +1 -1
- package/dist/styles/sales/ManualBooking.scss +2 -4
- package/dist/styles/snippet-templates/_snippetVariables.scss +244 -63
- package/dist/styles/sortable-field/SortableField.scss +16 -16
- package/dist/styles/sortable-field/_index.scss +1 -1
- package/dist/styles/sortable-tree/Item.scss +4 -4
- package/dist/styles/table/Table.scss +1 -1
- package/dist/styles/themes/bookedit/_variables.scss +32 -10
- package/dist/styles/themes/licklist/_variables.scss +1 -1
- package/dist/styles/tiptap-editor/TiptapEditor.scss +10 -9
- package/dist/styles/tiptap-editor/_index.scss +1 -1
- package/dist/styles/venue-map-sets/VenueMapSetForm.scss +4 -5
- package/dist/styles/virtualized/_index.scss +1 -1
- package/dist/styles/zones/ZoneForm.scss +0 -1
- package/dist/styles/zones/ZoneRecurrencesControl.scss +8 -6
- package/dist/typeahead/Typeahead.d.ts +1 -5
- package/dist/typeahead/Typeahead.d.ts.map +1 -1
- package/dist/typeahead/Typeahead.js +2 -9
- package/dist/zone/form/ZoneForm.d.ts +2 -3
- package/dist/zone/form/ZoneForm.d.ts.map +1 -1
- package/dist/zone/form/ZoneForm.js +2 -4
- package/dist/zone/form/components/ZoneControl.d.ts +2 -3
- package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneControl.js +2 -5
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -5
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.js +2 -5
- package/dist/zone/form/utils/dates.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/auth/ChangePassword/ChangePassword.stories.tsx +1 -1
- package/src/auth/Login/LoginComponent.tsx +1 -1
- package/src/auth/ResetPassword/ResetPassword.stories.tsx +1 -1
- package/src/calendar/Calendar.stories.tsx +2 -0
- package/src/calendar/Calendar.tsx +4 -1
- package/src/calendar/components/CalendarButtons/CalendarButtons.tsx +28 -31
- package/src/calendar/utils/index.ts +4 -26
- package/src/date-time-button/DateTimeButton.stories.tsx +1 -0
- package/src/date-time-button/DateTimeButton.tsx +6 -1
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +2 -3
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +37 -35
- package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +3 -3
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -0
- package/src/header/elements/Elements.stories.tsx +1 -1
- package/src/help/popover/Popover.stories.tsx +1 -1
- package/src/iframe/event/event-venue-map/IframeEventVenueMap.stories.tsx +3 -3
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +0 -1
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +0 -1
- package/src/layout/DropDown.tsx +1 -2
- package/src/modals/confirmation/ConfirmModal.tsx +3 -19
- package/src/product-set/card/ProductSetCard.stories.tsx +1 -3
- package/src/product-set/card/ProductSetCard.tsx +8 -47
- package/src/product-set/control/DateAndRecurrenceInput.tsx +4 -6
- package/src/product-set/control/DateInput.tsx +1 -2
- package/src/product-set/control/ProductSetControl.tsx +15 -4
- package/src/product-set/control/ProductSetRecurrenceControl.stories.tsx +2 -2
- package/src/product-set/form/ProductCategoriesControl.tsx +1 -37
- package/src/product-set/form/ProductSetForm.tsx +3 -25
- package/src/product-set/form/ProductZonesControl.tsx +7 -4
- package/src/product-set/form/SelectCategoryModal.stories.tsx +1 -1
- package/src/product-set/form/SelectCategoryModal.tsx +2 -2
- package/src/product-set/form/SubProductsControl.tsx +3 -0
- package/src/product-set/form/VenueMapsControl.tsx +3 -0
- package/src/product-set/form/index.ts +0 -1
- package/src/product-set/product/advanced-options/AdvancedOptions.tsx +5 -5
- package/src/product-set/product/booking-management/ProductBookingManagement.stories.tsx +1 -1
- package/src/product-set/product/quantity/ProductQuantity.stories.tsx +1 -1
- package/src/product-set/product-zone/ProductZoneControl.tsx +9 -9
- package/src/product-set/utils/index.ts +0 -11
- package/src/provider/location-input/LocationInput.tsx +1 -36
- package/src/provider/location-input/LocationInputDescription.tsx +11 -23
- package/src/provider/location-input/index.ts +0 -1
- package/src/provider/provider-form/ProviderForm.tsx +2 -7
- package/src/provider/venue-form/VenueForm.tsx +2 -5
- package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +18 -4
- package/src/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.tsx +22 -8
- package/src/recurring-date-picker-input/RecurringDatePickerInput.stories.tsx +4 -11
- package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +3 -17
- package/src/recurring-date-picker-input/utils.ts +1 -86
- package/src/sales/booking/results/components/ResultCard.tsx +10 -4
- package/src/sales/guest-profile/previous-bookings/PreviousBookings.tsx +1 -1
- package/src/sales/manual-booking/formatDays.ts +3 -3
- package/src/sales/manual-booking/select-event/SelectEvent.tsx +2 -2
- package/src/sales/manual-booking/summary/ManualBookingSummary.tsx +2 -2
- package/src/sales/notes/NotesTableRow.tsx +3 -3
- package/src/setting/admin/AdminSetting.stories.tsx +0 -1
- package/src/setting/admin/AdminSettingForm.tsx +2 -2
- package/src/setting/system/SystemSetting.stories.tsx +1 -1
- package/src/snippet/snippet-template/preview/Preview.tsx +0 -6
- package/src/sortable-tree/SortableTreeItem.tsx +0 -6
- package/src/styles/auth/AccessDenied.scss +1 -1
- package/src/styles/back-button/BackButton.scss +24 -25
- package/src/styles/back-button/_index.scss +1 -1
- package/src/styles/company-user-form/UserForm.scss +7 -4
- package/src/styles/company-user-form/_index.scss +1 -1
- package/src/styles/custom-fields/CreateSortableListItem.scss +1 -2
- package/src/styles/custom-fields/_index.scss +1 -1
- package/src/styles/customers/Filter.scss +5 -5
- package/src/styles/events/EditEventModal.scss +3 -1
- package/src/styles/events/EventVenueMap.scss +7 -7
- package/src/styles/form/Input.scss +1 -1
- package/src/styles/header/Header.scss +1 -1
- package/src/styles/header/elements/CompanySelector.scss +2 -2
- package/src/styles/iframe-events/Calendar.scss +1 -0
- package/src/styles/iframe-events/CalendarSelect.scss +1 -1
- package/src/styles/iframe-events/CategoryStepsForm.scss +7 -6
- package/src/styles/iframe-events/Event.scss +4 -2
- package/src/styles/iframe-events/EventForm.scss +54 -54
- package/src/styles/iframe-events/EventNavigationFooter.scss +0 -1
- package/src/styles/iframe-events/TicketDescription.scss +1 -1
- package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/src/styles/iframe-payments/PaymentForm.scss +1 -1
- package/src/styles/layout/BackgroundVideoContainer.scss +2 -2
- package/src/styles/notification/Notification.scss +1 -1
- package/src/styles/order-items-table/OrderItemsTable.scss +2 -1
- package/src/styles/product-set/CreateProductSetItem.scss +13 -15
- package/src/styles/product-set/DateAndRecurrenceInput.scss +8 -6
- package/src/styles/product-set/EditCategoryModal.scss +4 -4
- package/src/styles/product-set/EditProductModal.scss +3 -3
- package/src/styles/product-set/EditStepModal.scss +4 -4
- package/src/styles/product-set/EditVenueMapSetModal.scss +6 -6
- package/src/styles/product-set/ProductSetForm.scss +2 -25
- package/src/styles/product-set/TutorialGifCard.scss +1 -1
- package/src/styles/product-set/_index.scss +2 -2
- package/src/styles/report/ReportCard.scss +0 -1
- package/src/styles/report/_index.scss +1 -1
- package/src/styles/resources-blocking/_index.scss +0 -4
- package/src/styles/sales/BookingFilter.scss +2 -2
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/styles/sales/BookingTabs.scss +5 -7
- package/src/styles/sales/Filters.scss +4 -5
- package/src/styles/sales/GuestProfile.scss +175 -170
- package/src/styles/sales/LifeTimeSales.scss +1 -1
- package/src/styles/sales/ManualBooking.scss +2 -4
- package/src/styles/snippet-templates/_snippetVariables.scss +244 -63
- package/src/styles/sortable-field/SortableField.scss +16 -16
- package/src/styles/sortable-field/_index.scss +1 -1
- package/src/styles/sortable-tree/Item.scss +4 -4
- package/src/styles/table/Table.scss +1 -1
- package/src/styles/themes/bookedit/_variables.scss +32 -10
- package/src/styles/themes/licklist/_variables.scss +1 -1
- package/src/styles/tiptap-editor/TiptapEditor.scss +10 -9
- package/src/styles/tiptap-editor/_index.scss +1 -1
- package/src/styles/venue-map-sets/VenueMapSetForm.scss +4 -5
- package/src/styles/virtualized/_index.scss +1 -1
- package/src/styles/zones/ZoneForm.scss +0 -1
- package/src/styles/zones/ZoneRecurrencesControl.scss +8 -6
- package/src/tiptap-editor/TipTapEditor.stories.tsx +4 -6
- package/src/tiptap-editor/TipTapMenu/TipTapMenu.stories.tsx +2 -5
- package/src/typeahead/Typeahead.tsx +1 -15
- package/src/zone/form/ZoneForm.tsx +2 -9
- package/src/zone/form/components/ZoneControl.tsx +3 -8
- package/src/zone/form/components/ZoneRecurrencesControl.tsx +5 -10
- package/src/zone/form/utils/dates.ts +10 -9
- package/yarn.lock +116 -103
- package/dist/product-set/form/ProductSetNameControl.d.ts +0 -6
- package/dist/product-set/form/ProductSetNameControl.d.ts.map +0 -1
- package/dist/product-set/form/ProductSetNameControl.js +0 -35
- package/src/product-set/form/ProductSetNameControl.tsx +0 -27
|
@@ -22,13 +22,13 @@ export interface EventDates {
|
|
|
22
22
|
interface EditEventProductSetProps {
|
|
23
23
|
onSubmit: (value: EditEventFormValues["editedProductSet"]) => void;
|
|
24
24
|
defaultValues?: EditEventFormValues["editedProductSet"];
|
|
25
|
-
|
|
25
|
+
occurrenceStartAtDate: string;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const EditEventProductSet = ({
|
|
29
29
|
onSubmit,
|
|
30
30
|
defaultValues,
|
|
31
|
-
|
|
31
|
+
occurrenceStartAtDate,
|
|
32
32
|
}: EditEventProductSetProps) => {
|
|
33
33
|
const { companyId } = useParams<{
|
|
34
34
|
companyId: string;
|
|
@@ -127,8 +127,8 @@ export const EditEventProductSet = ({
|
|
|
127
127
|
fee={feeInPercent}
|
|
128
128
|
isEventEditProductSet
|
|
129
129
|
isOverrides
|
|
130
|
+
occurrenceStartAtDate={occurrenceStartAtDate}
|
|
130
131
|
workHours={undefined}
|
|
131
|
-
timeZone={timeZone}
|
|
132
132
|
/>
|
|
133
133
|
<Button
|
|
134
134
|
disabled={isLoading}
|
|
@@ -17,7 +17,7 @@ export const HelpPopoverPrimaryVariant: Story<HelpPopoverProps> = (args) => (
|
|
|
17
17
|
<HelpPopover {...args} />
|
|
18
18
|
);
|
|
19
19
|
export const HelpPopoverOutlinedInfoVariant: Story<HelpPopoverProps> = (
|
|
20
|
-
args
|
|
20
|
+
args,
|
|
21
21
|
) => <HelpPopover {...args} />;
|
|
22
22
|
|
|
23
23
|
DefaultHelpPopover.args = {
|
|
@@ -260,9 +260,9 @@ export function Default() {
|
|
|
260
260
|
(point) =>
|
|
261
261
|
Boolean(
|
|
262
262
|
MENU_STEPS[0].pointProducts.find(
|
|
263
|
-
(pointProduct) => pointProduct.pointId === point.id
|
|
264
|
-
)
|
|
265
|
-
)
|
|
263
|
+
(pointProduct) => pointProduct.pointId === point.id,
|
|
264
|
+
),
|
|
265
|
+
),
|
|
266
266
|
)}
|
|
267
267
|
pointProducts={MENU_STEPS[0].pointProducts}
|
|
268
268
|
usedInIframe={usedInIframe}
|
package/src/layout/DropDown.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
2
|
|
|
3
3
|
interface Props {
|
|
4
4
|
children?: React.ReactNode | React.ReactNode[];
|
|
@@ -24,5 +24,4 @@ const DropDown = forwardRef((props: Props, ref: any) => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
DropDown.displayName = "DropDown";
|
|
27
|
-
|
|
28
27
|
export default DropDown;
|
|
@@ -20,9 +20,6 @@ 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;
|
|
26
23
|
title?: string;
|
|
27
24
|
content?: string | ReactNode;
|
|
28
25
|
onClose?: () => void;
|
|
@@ -40,9 +37,7 @@ export function ConfirmModal({
|
|
|
40
37
|
type = "default",
|
|
41
38
|
children,
|
|
42
39
|
onClose,
|
|
43
|
-
confirmationHandler,
|
|
44
40
|
title,
|
|
45
|
-
disabledButtons,
|
|
46
41
|
content,
|
|
47
42
|
hideButtons = false,
|
|
48
43
|
}: ConfirmModalProps) {
|
|
@@ -57,16 +52,10 @@ export function ConfirmModal({
|
|
|
57
52
|
setIsOpen(() => true);
|
|
58
53
|
};
|
|
59
54
|
|
|
60
|
-
const handleConfirmation =
|
|
55
|
+
const handleConfirmation = (e) => {
|
|
61
56
|
e.stopPropagation();
|
|
62
|
-
if (!actionRef.current
|
|
63
|
-
|
|
64
|
-
const res = await confirmationHandler();
|
|
65
|
-
if (res) {
|
|
66
|
-
setIsOpen(() => false);
|
|
67
|
-
}
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
57
|
+
if (!actionRef.current) return;
|
|
58
|
+
|
|
70
59
|
actionRef.current();
|
|
71
60
|
setIsOpen(() => false);
|
|
72
61
|
};
|
|
@@ -99,7 +88,6 @@ export function ConfirmModal({
|
|
|
99
88
|
<Button
|
|
100
89
|
variant="danger"
|
|
101
90
|
className="btn-sm rounded"
|
|
102
|
-
disabled={disabledButtons}
|
|
103
91
|
onClick={handleClose}
|
|
104
92
|
data-id={CONFIRM_MODAL_ACTION_DECLINE}
|
|
105
93
|
>
|
|
@@ -117,14 +105,12 @@ export function ConfirmModal({
|
|
|
117
105
|
variant="outline"
|
|
118
106
|
className="cancel-button"
|
|
119
107
|
onClick={handleClose}
|
|
120
|
-
disabled={disabledButtons}
|
|
121
108
|
data-id={CONFIRM_MODAL_ACTION_DECLINE}
|
|
122
109
|
>
|
|
123
110
|
{t("cancel")}
|
|
124
111
|
</Button>
|
|
125
112
|
<Button
|
|
126
113
|
variant="danger"
|
|
127
|
-
disabled={disabledButtons}
|
|
128
114
|
onClick={handleConfirmation}
|
|
129
115
|
data-id={CONFIRM_MODAL_ACTION_CONFIRM}
|
|
130
116
|
>
|
|
@@ -135,7 +121,6 @@ export function ConfirmModal({
|
|
|
135
121
|
<>
|
|
136
122
|
<Button
|
|
137
123
|
variant="danger"
|
|
138
|
-
disabled={disabledButtons}
|
|
139
124
|
onClick={handleClose}
|
|
140
125
|
data-id={CONFIRM_MODAL_ACTION_DECLINE}
|
|
141
126
|
>
|
|
@@ -143,7 +128,6 @@ export function ConfirmModal({
|
|
|
143
128
|
</Button>
|
|
144
129
|
<Button
|
|
145
130
|
variant="success"
|
|
146
|
-
disabled={disabledButtons}
|
|
147
131
|
onClick={handleConfirmation}
|
|
148
132
|
data-id={CONFIRM_MODAL_ACTION_CONFIRM}
|
|
149
133
|
>
|
|
@@ -9,8 +9,7 @@ export default {
|
|
|
9
9
|
|
|
10
10
|
export const Default: Story<ProductSetCardProps> = (args) => (
|
|
11
11
|
<ProductSetCard {...args} />
|
|
12
|
-
)
|
|
13
|
-
|
|
12
|
+
);
|
|
14
13
|
|
|
15
14
|
Default.args = {
|
|
16
15
|
href: "#",
|
|
@@ -18,4 +17,3 @@ Default.args = {
|
|
|
18
17
|
rrule: "FREQ=WEEKLY;BYDAY=WE",
|
|
19
18
|
hasPermission: true,
|
|
20
19
|
};
|
|
21
|
-
|
|
@@ -9,20 +9,15 @@ 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";
|
|
13
12
|
|
|
14
13
|
export interface ProductSetCardProps extends HasPermissionProp {
|
|
15
14
|
name: string;
|
|
16
15
|
rrule?: string;
|
|
17
16
|
href: string;
|
|
18
|
-
|
|
19
|
-
onChangeDuplicateProductSetName: (value: string) => void;
|
|
20
|
-
onCopy: () => Promise<boolean | undefined>;
|
|
17
|
+
onCopy: () => void;
|
|
21
18
|
onRemove: () => void;
|
|
22
|
-
isLoading?: boolean;
|
|
23
19
|
className?: string;
|
|
24
20
|
override?: number;
|
|
25
|
-
duplicateProductSetError?: string;
|
|
26
21
|
}
|
|
27
22
|
|
|
28
23
|
export function ProductSetCard({
|
|
@@ -31,10 +26,6 @@ export function ProductSetCard({
|
|
|
31
26
|
href,
|
|
32
27
|
onCopy,
|
|
33
28
|
onRemove,
|
|
34
|
-
onChangeDuplicateProductSetName,
|
|
35
|
-
duplicateProductSetName,
|
|
36
|
-
duplicateProductSetError,
|
|
37
|
-
isLoading,
|
|
38
29
|
className = "",
|
|
39
30
|
hasPermission = true,
|
|
40
31
|
override = 0,
|
|
@@ -44,23 +35,19 @@ export function ProductSetCard({
|
|
|
44
35
|
const productSetCardClasses = `product-set-card ${className}`;
|
|
45
36
|
const [isOverlayVisibile, setIsOverlayVisible] = useState(false);
|
|
46
37
|
|
|
47
|
-
const onCardClick = () => {
|
|
48
|
-
RouteService.redirectTo(href);
|
|
49
|
-
};
|
|
50
38
|
return (
|
|
51
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
52
39
|
<div
|
|
53
40
|
role="button"
|
|
54
41
|
tabIndex={0}
|
|
55
42
|
className="border-0 product-set-card-wrapper w-100 pb-0"
|
|
56
|
-
onClick={
|
|
43
|
+
onClick={() => RouteService.redirectTo(href)}
|
|
44
|
+
onKeyUp={() => RouteService.redirectTo(href)}
|
|
57
45
|
>
|
|
58
46
|
<div className={productSetCardClasses}>
|
|
59
47
|
<div className="product-set-card-link">
|
|
60
48
|
<div className="d-flex flex-column">
|
|
61
49
|
<div>
|
|
62
|
-
{name}
|
|
63
|
-
{rrule && `(${RRule.fromString(rrule).toText()})`}
|
|
50
|
+
{name} {rrule && `(${RRule.fromString(rrule).toText()})`}
|
|
64
51
|
</div>
|
|
65
52
|
{!!override && (
|
|
66
53
|
<div className="h6 bold ml-1">
|
|
@@ -92,33 +79,14 @@ export function ProductSetCard({
|
|
|
92
79
|
>
|
|
93
80
|
{hasPermission && (
|
|
94
81
|
<>
|
|
95
|
-
<ListGroup.Item
|
|
96
|
-
action
|
|
97
|
-
as="div"
|
|
98
|
-
role="button"
|
|
99
|
-
tabIndex={0}
|
|
100
|
-
onClick={(e) => e.stopPropagation()}
|
|
101
|
-
>
|
|
82
|
+
<ListGroup.Item action as="div">
|
|
102
83
|
{Boolean(onCopy) && (
|
|
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
|
-
>
|
|
84
|
+
<ConfirmModal>
|
|
115
85
|
{(confirm) => (
|
|
116
86
|
<MenuButton
|
|
117
87
|
onClick={() => {
|
|
118
88
|
setIsOverlayVisible(false);
|
|
119
|
-
|
|
120
|
-
// confirm function memoize the callback function and it leads to bugs
|
|
121
|
-
confirm(() => {});
|
|
89
|
+
confirm(onCopy);
|
|
122
90
|
}}
|
|
123
91
|
name={t("duplicate")}
|
|
124
92
|
className="product-set-card-menu-item-text"
|
|
@@ -127,14 +95,7 @@ export function ProductSetCard({
|
|
|
127
95
|
</ConfirmModal>
|
|
128
96
|
)}
|
|
129
97
|
</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
|
-
>
|
|
98
|
+
<ListGroup.Item action className="text-danger" as="div">
|
|
138
99
|
{Boolean(onRemove) && (
|
|
139
100
|
<ConfirmModal>
|
|
140
101
|
{(confirm) => (
|
|
@@ -28,16 +28,17 @@ import {
|
|
|
28
28
|
AvailableTimesControlRef,
|
|
29
29
|
} from "../../zone/form/components/AvailableTimesControl";
|
|
30
30
|
|
|
31
|
+
// eslint-disable-next-line max-len
|
|
32
|
+
|
|
31
33
|
export interface DateAndRecurrenceInputValues {
|
|
32
34
|
menuRecurrences?: Partial<ProductSetRecurrence>[];
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
interface DateAndRecurrenceInputProps {
|
|
36
38
|
isEventEditProductSet?: boolean;
|
|
37
|
-
workHours
|
|
39
|
+
workHours?: WorkHour[];
|
|
38
40
|
providerHasBookingManagement: boolean;
|
|
39
41
|
isLoading?: boolean;
|
|
40
|
-
timeZone: string;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
export const DateAndRecurrenceInput = ({
|
|
@@ -45,7 +46,6 @@ export const DateAndRecurrenceInput = ({
|
|
|
45
46
|
providerHasBookingManagement,
|
|
46
47
|
workHours,
|
|
47
48
|
isLoading,
|
|
48
|
-
timeZone,
|
|
49
49
|
}: DateAndRecurrenceInputProps) => {
|
|
50
50
|
const {
|
|
51
51
|
control,
|
|
@@ -90,7 +90,7 @@ export const DateAndRecurrenceInput = ({
|
|
|
90
90
|
clearEditState();
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
const popoverId = useId()
|
|
93
|
+
const popoverId = useId()!;
|
|
94
94
|
|
|
95
95
|
const { t } = useTranslation("Design");
|
|
96
96
|
|
|
@@ -228,8 +228,6 @@ export const DateAndRecurrenceInput = ({
|
|
|
228
228
|
defaultValues={editState.values}
|
|
229
229
|
onChange={handleRecurringDateChange}
|
|
230
230
|
onDelete={handleDelete}
|
|
231
|
-
workHours={workHours}
|
|
232
|
-
timeZone={timeZone}
|
|
233
231
|
>
|
|
234
232
|
{providerHasBookingManagement && (
|
|
235
233
|
<AvailableTimesControl
|
|
@@ -247,8 +247,7 @@ export const DateInput = ({
|
|
|
247
247
|
menuRecurrence={menuRecurrence}
|
|
248
248
|
onEdit={() => handleOnEdit(menuRecurrence, index)}
|
|
249
249
|
errorMessage={
|
|
250
|
-
errors?.menuRecurrences?.[`${index}`]?.availableTimes
|
|
251
|
-
?.message || errors?.menuRecurrences?.[`${index}`]?.message
|
|
250
|
+
errors?.menuRecurrences?.[`${index}`]?.availableTimes?.message
|
|
252
251
|
}
|
|
253
252
|
/>
|
|
254
253
|
))}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
1
2
|
import { Col, Form, Row } from "react-bootstrap";
|
|
2
3
|
import { Controller, useFormContext } from "react-hook-form";
|
|
3
4
|
import { useTranslation } from "react-i18next";
|
|
4
5
|
import clsx from "clsx";
|
|
6
|
+
import { DateTime } from "luxon";
|
|
5
7
|
import {
|
|
6
8
|
OPERATIONAL_COST_CUSTOMER,
|
|
7
9
|
OPERATIONAL_COST_PROVIDER,
|
|
@@ -14,6 +16,7 @@ import {
|
|
|
14
16
|
RELY_ON_PEOPLE_TYPES,
|
|
15
17
|
RelyOnPeopleType,
|
|
16
18
|
} from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
|
|
19
|
+
import { DATE_MONTH_LOCALE_FORMAT } from "@licklist/core/dist/Config";
|
|
17
20
|
import { useId } from "@react-aria/utils";
|
|
18
21
|
import { FieldSet } from "@licklist/core/dist/DataMapper/Order/FieldSetDataMapper";
|
|
19
22
|
import { EmailTemplate } from "@licklist/core/dist/DataMapper/Notification/EmailTemplateDataMapper";
|
|
@@ -85,11 +88,11 @@ export interface ProductSetControlProps {
|
|
|
85
88
|
fieldSets?: FieldSet[];
|
|
86
89
|
showEmailTemplate?: boolean;
|
|
87
90
|
showSmsTemplate?: boolean;
|
|
88
|
-
workHours
|
|
91
|
+
workHours?: WorkHour[];
|
|
89
92
|
providerHasBookingManagement?: boolean;
|
|
90
93
|
isOverrides?: boolean;
|
|
94
|
+
occurrenceStartAtDate?: string;
|
|
91
95
|
isCreateNewOverrides?: boolean;
|
|
92
|
-
timeZone: string;
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
export function ProductSetControl({
|
|
@@ -106,8 +109,8 @@ export function ProductSetControl({
|
|
|
106
109
|
workHours,
|
|
107
110
|
providerHasBookingManagement = false,
|
|
108
111
|
isOverrides = false,
|
|
112
|
+
occurrenceStartAtDate,
|
|
109
113
|
isCreateNewOverrides = false,
|
|
110
|
-
timeZone,
|
|
111
114
|
}: ProductSetControlProps) {
|
|
112
115
|
const { t } = useTranslation(["Design", "Validation", "Notification"]);
|
|
113
116
|
const {
|
|
@@ -116,10 +119,12 @@ export function ProductSetControl({
|
|
|
116
119
|
formState: { errors },
|
|
117
120
|
watch,
|
|
118
121
|
setError,
|
|
122
|
+
setValue,
|
|
119
123
|
clearErrors,
|
|
120
124
|
} = useFormContext<ProductSetControlValues>();
|
|
121
125
|
|
|
122
126
|
const steps = watch("steps");
|
|
127
|
+
const productSetName = watch("name");
|
|
123
128
|
|
|
124
129
|
const nameId = useId();
|
|
125
130
|
const termsAndConditionsId = useId();
|
|
@@ -133,6 +138,13 @@ export function ProductSetControl({
|
|
|
133
138
|
productCategories?.some((category) => checkIfZoneCategory(category?.type)),
|
|
134
139
|
);
|
|
135
140
|
|
|
141
|
+
useEffect(() => {
|
|
142
|
+
if (!occurrenceStartAtDate) return;
|
|
143
|
+
const eventStartDate = DateTime.fromISO(occurrenceStartAtDate);
|
|
144
|
+
const eventStart = eventStartDate.toFormat(DATE_MONTH_LOCALE_FORMAT);
|
|
145
|
+
setValue("name", `${productSetName} (${eventStart})`);
|
|
146
|
+
}, [setValue, occurrenceStartAtDate]);
|
|
147
|
+
|
|
136
148
|
return (
|
|
137
149
|
<Row
|
|
138
150
|
className={`product-set-form ${
|
|
@@ -188,7 +200,6 @@ export function ProductSetControl({
|
|
|
188
200
|
workHours={isZoneAdded ? workHours : undefined}
|
|
189
201
|
isLoading={isLoading}
|
|
190
202
|
providerHasBookingManagement={providerHasBookingManagement}
|
|
191
|
-
timeZone={timeZone}
|
|
192
203
|
/>
|
|
193
204
|
)}
|
|
194
205
|
</>
|
|
@@ -23,7 +23,7 @@ interface ProductSetRecurrences {
|
|
|
23
23
|
|
|
24
24
|
export const Default: Story<ProductSetRecurrences> = (args) => {
|
|
25
25
|
const [items, setItems] = useState(
|
|
26
|
-
args.menuRecurrences?.sort((a, b) => a.sort - b.sort) ?? []
|
|
26
|
+
args.menuRecurrences?.sort((a, b) => a.sort - b.sort) ?? [],
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
const onDragEnd = ({ over, active }) => {
|
|
@@ -31,7 +31,7 @@ export const Default: Story<ProductSetRecurrences> = (args) => {
|
|
|
31
31
|
|
|
32
32
|
setItems((items) => {
|
|
33
33
|
const prevIndex = items.findIndex(
|
|
34
|
-
(item) => String(item.id) === active.id
|
|
34
|
+
(item) => String(item.id) === active.id,
|
|
35
35
|
);
|
|
36
36
|
const nextIndex = items.findIndex((item) => String(item.id) === over.id);
|
|
37
37
|
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
useFormContext,
|
|
9
9
|
useWatch,
|
|
10
10
|
} from "react-hook-form";
|
|
11
|
-
import { FaBars, FaBowlingBall, FaCalendar, FaTicketAlt } from "react-icons/fa";
|
|
12
11
|
import { useTranslation } from "react-i18next";
|
|
13
12
|
import { useSensor, MouseSensor } from "@dnd-kit/core";
|
|
14
13
|
import {
|
|
@@ -26,11 +25,7 @@ import { ProductCategoryControl } from "../product-category";
|
|
|
26
25
|
import { ProductCategory } from "../types";
|
|
27
26
|
import { ProductsControl } from "./ProductsControl";
|
|
28
27
|
import { ProductSetFormValues, WithIsLoading } from "./ProductSetForm";
|
|
29
|
-
import {
|
|
30
|
-
SelectCategoryModal,
|
|
31
|
-
CATEGORY_TYPES_NAMES,
|
|
32
|
-
CategoryConfig,
|
|
33
|
-
} from "./SelectCategoryModal";
|
|
28
|
+
import { SelectCategoryModal } from "./SelectCategoryModal";
|
|
34
29
|
import { ProductSetLoadingContext } from "./context";
|
|
35
30
|
import { VenueMapSetModal } from "./VenueMapSetModal";
|
|
36
31
|
import { moveArrayElements, sortArrayByIndex } from "../utils";
|
|
@@ -38,29 +33,6 @@ import { useSortableTreeFunctions } from "../hooks/useSortableTreeFunctions";
|
|
|
38
33
|
// @TODO not for first release
|
|
39
34
|
// import Popover from "./ProductSetFormPopover";
|
|
40
35
|
|
|
41
|
-
const CATEGORIES_TYPE: Partial<Record<CategoryType, CategoryConfig>> = {
|
|
42
|
-
[CATEGORY_TYPES_NAMES.tickets]: {
|
|
43
|
-
label: "tickets",
|
|
44
|
-
icon: <FaTicketAlt color="#0e8ce2" size={10} />,
|
|
45
|
-
},
|
|
46
|
-
[CATEGORY_TYPES_NAMES.bookings]: {
|
|
47
|
-
label: "bookings",
|
|
48
|
-
icon: <FaCalendar color="#0e8ce2" size={10} />,
|
|
49
|
-
},
|
|
50
|
-
[CATEGORY_TYPES_NAMES.menuItems]: {
|
|
51
|
-
label: "menuItems",
|
|
52
|
-
icon: <FaBars color="#0e8ce2" size={10} />,
|
|
53
|
-
},
|
|
54
|
-
[CATEGORY_TYPES_NAMES.game]: {
|
|
55
|
-
label: "game",
|
|
56
|
-
icon: <FaBowlingBall color="#0e8ce2" size={10} />,
|
|
57
|
-
},
|
|
58
|
-
[CATEGORY_TYPES_NAMES.fixedDuration]: {
|
|
59
|
-
label: "fixedDuration",
|
|
60
|
-
icon: <FaCalendar color="#0e8ce2" size={10} />,
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
|
|
64
36
|
interface ProductCategoriesControlProps extends WithIsLoading {
|
|
65
37
|
stepIndex: number;
|
|
66
38
|
isOverrides?: boolean;
|
|
@@ -256,8 +228,6 @@ export function ProductCategoriesControl({
|
|
|
256
228
|
setIsExpanded(productCategoryId);
|
|
257
229
|
};
|
|
258
230
|
|
|
259
|
-
const categoryType = CATEGORIES_TYPE[productCategory.type];
|
|
260
|
-
|
|
261
231
|
return (
|
|
262
232
|
<Controller
|
|
263
233
|
key={`product-category-${productCategory._id}`}
|
|
@@ -302,12 +272,6 @@ export function ProductCategoriesControl({
|
|
|
302
272
|
)}
|
|
303
273
|
modalClass={ProductSetModalClasses.category}
|
|
304
274
|
isNewAdded={showCategoryModal}
|
|
305
|
-
itemButton={
|
|
306
|
-
<div className="btn-outline-primary item-icon sm border border-primary rounded-sm">
|
|
307
|
-
{categoryType.icon}
|
|
308
|
-
<span className="ml-2">{t(categoryType.label)}</span>
|
|
309
|
-
</div>
|
|
310
|
-
}
|
|
311
275
|
body={
|
|
312
276
|
<ProductCategoryControl
|
|
313
277
|
isLoading={isLoading}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect
|
|
1
|
+
import { useEffect } from "react";
|
|
2
2
|
import { FormValues } from "@licklist/plugins/dist/types/services/Form/hook-form-service";
|
|
3
3
|
import { Button, Form, Col, Row } from "react-bootstrap";
|
|
4
4
|
import { FormProvider, useForm } from "react-hook-form";
|
|
@@ -22,21 +22,16 @@ import { Step } from "../types";
|
|
|
22
22
|
import { ProductSetContextProvider, ProductSetLoadingContext } from "./context";
|
|
23
23
|
import { SelectItem } from "../../types/generic/SelectItem";
|
|
24
24
|
import { checkAvailableTimesErrors, getFilteredTemplates } from "../utils";
|
|
25
|
-
import { ErrorModal } from "../../iframe/order-process/components/ErrorModal";
|
|
26
25
|
|
|
27
26
|
export interface WithIsLoading {
|
|
28
27
|
isLoading: boolean;
|
|
29
28
|
}
|
|
30
|
-
export interface WithIdOptional {
|
|
31
|
-
id?: number;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
29
|
export interface WithId {
|
|
35
30
|
id: number;
|
|
36
31
|
}
|
|
37
32
|
export interface ProductSetFormValues
|
|
38
33
|
extends FormValues,
|
|
39
|
-
|
|
34
|
+
WithId,
|
|
40
35
|
ProductSetControlValues {
|
|
41
36
|
steps: Step[];
|
|
42
37
|
isOverrides?: boolean;
|
|
@@ -59,7 +54,6 @@ export interface ProductSetFormProps
|
|
|
59
54
|
isOverrides?: boolean;
|
|
60
55
|
workHours?: WorkHour[];
|
|
61
56
|
isCreateNewOverrides?: boolean;
|
|
62
|
-
timeZone: string;
|
|
63
57
|
}
|
|
64
58
|
|
|
65
59
|
export function ProductSetForm({
|
|
@@ -78,7 +72,6 @@ export function ProductSetForm({
|
|
|
78
72
|
workHours,
|
|
79
73
|
isOverrides,
|
|
80
74
|
isCreateNewOverrides,
|
|
81
|
-
timeZone,
|
|
82
75
|
...shared
|
|
83
76
|
}: ProductSetFormProps) {
|
|
84
77
|
const { t } = useTranslation("Design");
|
|
@@ -89,7 +82,6 @@ export function ProductSetForm({
|
|
|
89
82
|
onApproveDialog,
|
|
90
83
|
onDeclineDialog,
|
|
91
84
|
} = useDialogContext();
|
|
92
|
-
const [errorMessage, setErrorMessage] = useState("");
|
|
93
85
|
|
|
94
86
|
const form = useForm<ProductSetFormValues>({
|
|
95
87
|
defaultValues,
|
|
@@ -127,18 +119,11 @@ export function ProductSetForm({
|
|
|
127
119
|
if (!serverErrors) {
|
|
128
120
|
return;
|
|
129
121
|
}
|
|
130
|
-
if (Array.isArray(serverErrors) && serverErrors[0]) {
|
|
131
|
-
setErrorMessage(serverErrors[0]);
|
|
132
|
-
}
|
|
133
122
|
FormErrorService.handleServerErrors(serverErrors, setError);
|
|
134
123
|
}, [serverErrors, setError]);
|
|
135
124
|
|
|
136
125
|
useEffect(() => {
|
|
137
|
-
window.history.pushState(
|
|
138
|
-
null,
|
|
139
|
-
"",
|
|
140
|
-
window.location.pathname + window.location.search,
|
|
141
|
-
);
|
|
126
|
+
window.history.pushState(null, "", window.location.pathname);
|
|
142
127
|
window.addEventListener("beforeunload", onBeforeUnload);
|
|
143
128
|
window.addEventListener("popstate", onPopState);
|
|
144
129
|
|
|
@@ -165,12 +150,6 @@ export function ProductSetForm({
|
|
|
165
150
|
onDecline={onDeclineDialog}
|
|
166
151
|
/>
|
|
167
152
|
|
|
168
|
-
<ErrorModal
|
|
169
|
-
message={errorMessage}
|
|
170
|
-
isOpen={!!errorMessage}
|
|
171
|
-
onClose={() => setErrorMessage("")}
|
|
172
|
-
/>
|
|
173
|
-
|
|
174
153
|
<FormProvider {...form}>
|
|
175
154
|
<Form onSubmit={form.handleSubmit(submitHandler(onSubmitAndRedirect))}>
|
|
176
155
|
<ProductSetLoadingContext.Consumer>
|
|
@@ -196,7 +175,6 @@ export function ProductSetForm({
|
|
|
196
175
|
providerHasBookingManagement={providerHasBookingManagement}
|
|
197
176
|
isOverrides={isOverrides}
|
|
198
177
|
isCreateNewOverrides={isCreateNewOverrides}
|
|
199
|
-
timeZone={timeZone}
|
|
200
178
|
/>
|
|
201
179
|
<Row>
|
|
202
180
|
<Col md={6} sm={12} />
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import React, { useContext, useState } from "react";
|
|
4
|
+
|
|
2
5
|
import {
|
|
3
6
|
ArrayPath,
|
|
4
7
|
Controller,
|
|
@@ -79,14 +82,14 @@ export const ProductZonesControl = <T extends FormValues>({
|
|
|
79
82
|
|
|
80
83
|
const productZonesError = HookFormService.getErrors<T>(
|
|
81
84
|
`${productZonesFieldName}.root` as Path<T>,
|
|
82
|
-
errors
|
|
85
|
+
errors
|
|
83
86
|
);
|
|
84
87
|
|
|
85
88
|
const zoneCapacity = useWatch({
|
|
86
89
|
control,
|
|
87
90
|
name: [
|
|
88
91
|
...fields.map(
|
|
89
|
-
(_, index) => `${productZonesFieldName}.${index}.capacity` as const
|
|
92
|
+
(_, index) => `${productZonesFieldName}.${index}.capacity` as const
|
|
90
93
|
),
|
|
91
94
|
],
|
|
92
95
|
});
|
|
@@ -95,7 +98,7 @@ export const ProductZonesControl = <T extends FormValues>({
|
|
|
95
98
|
control,
|
|
96
99
|
name: [
|
|
97
100
|
...fields.map(
|
|
98
|
-
(_, index) => `${productZonesFieldName}.${index}.duration` as const
|
|
101
|
+
(_, index) => `${productZonesFieldName}.${index}.duration` as const
|
|
99
102
|
),
|
|
100
103
|
],
|
|
101
104
|
});
|