@licklist/design 0.67.3 → 0.67.4-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.cjs +15 -12
- package/dist/auth/Login/LoginComponent.js +2 -1
- package/dist/calendar/Calendar.d.ts +1 -1
- 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 +35 -40
- 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 +20 -4
- package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
- package/dist/date-time-button/DateTimeButton.js +1 -4
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +2 -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 +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 +27 -26
- 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 +0 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.js +9 -3
- 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 +2 -0
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/layout/DropDown.d.ts +2 -1
- package/dist/layout/DropDown.d.ts.map +1 -1
- package/dist/layout/DropDownToggle.d.ts.map +1 -1
- package/dist/layout/DropDownToggle.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/DateAndRecurrenceInput.d.ts +3 -2
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.js +3 -1
- 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 +4 -16
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +48 -2
- package/dist/product-set/form/ProductSetForm.d.ts +6 -2
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +65 -5
- 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/ProductZonesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductZonesControl.js +0 -2
- package/dist/product-set/form/SelectCategoryModal.d.ts +12 -0
- 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 +0 -3
- package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
- package/dist/product-set/form/VenueMapsControl.js +0 -3
- 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/provider/location-input/LocationInput.d.ts +4 -1
- package/dist/provider/location-input/LocationInput.d.ts.map +1 -1
- package/dist/provider/location-input/LocationInput.js +41 -2
- package/dist/provider/location-input/LocationInputDescription.d.ts +4 -1
- package/dist/provider/location-input/LocationInputDescription.d.ts.map +1 -1
- package/dist/provider/location-input/LocationInputDescription.js +27 -12
- package/dist/provider/location-input/index.d.ts +1 -0
- package/dist/provider/location-input/index.d.ts.map +1 -1
- package/dist/provider/provider-form/ProviderForm.d.ts +3 -1
- package/dist/provider/provider-form/ProviderForm.d.ts.map +1 -1
- package/dist/provider/provider-form/ProviderForm.js +7 -3
- package/dist/provider/venue-form/VenueForm.d.ts +3 -1
- package/dist/provider/venue-form/VenueForm.d.ts.map +1 -1
- package/dist/provider/venue-form/VenueForm.js +7 -3
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +4 -8
- package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.d.ts +2 -1
- package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.js +7 -13
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +4 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +7 -3
- package/dist/recurring-date-picker-input/utils.d.ts +5 -0
- package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/utils.js +72 -3
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +4 -7
- 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 +3 -4
- 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 +6 -0
- package/dist/sortable-tree/SortableTreeItem.d.ts +2 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.js +10 -4
- package/dist/styles/auth/AccessDenied.scss +1 -1
- package/dist/styles/back-button/BackButton.scss +25 -24
- package/dist/styles/back-button/_index.scss +1 -1
- package/dist/styles/company-user-form/UserForm.scss +4 -7
- package/dist/styles/company-user-form/_index.scss +1 -1
- package/dist/styles/custom-fields/CreateSortableListItem.scss +2 -1
- package/dist/styles/custom-fields/_index.scss +1 -1
- package/dist/styles/customers/Filter.scss +5 -5
- package/dist/styles/events/EditEventModal.scss +1 -3
- 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 +0 -1
- package/dist/styles/iframe-events/CalendarSelect.scss +1 -1
- package/dist/styles/iframe-events/CategoryStepsForm.scss +6 -7
- package/dist/styles/iframe-events/Event.scss +2 -4
- package/dist/styles/iframe-events/EventForm.scss +54 -54
- package/dist/styles/iframe-events/EventNavigationFooter.scss +1 -0
- 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 +1 -2
- package/dist/styles/product-set/CreateProductSetItem.scss +15 -13
- package/dist/styles/product-set/DateAndRecurrenceInput.scss +6 -8
- 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 +25 -2
- package/dist/styles/product-set/TutorialGifCard.scss +1 -1
- package/dist/styles/product-set/_index.scss +2 -2
- package/dist/styles/report/ReportCard.scss +1 -0
- package/dist/styles/report/_index.scss +1 -1
- package/dist/styles/resources-blocking/_index.scss +4 -0
- package/dist/styles/sales/BookingFilter.scss +2 -2
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/styles/sales/BookingTabs.scss +7 -5
- package/dist/styles/sales/Filters.scss +5 -4
- package/dist/styles/sales/GuestProfile.scss +170 -175
- package/dist/styles/sales/LifeTimeSales.scss +1 -1
- package/dist/styles/sales/ManualBooking.scss +4 -2
- package/dist/styles/snippet-templates/_snippetVariables.scss +63 -244
- 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 +10 -32
- package/dist/styles/themes/licklist/_variables.scss +1 -1
- package/dist/styles/tiptap-editor/TiptapEditor.scss +9 -10
- package/dist/styles/tiptap-editor/_index.scss +1 -1
- package/dist/styles/venue-map-sets/VenueMapSetForm.scss +5 -4
- package/dist/styles/virtualized/_index.scss +1 -1
- package/dist/styles/zones/ZoneForm.scss +1 -0
- package/dist/styles/zones/ZoneRecurrencesControl.scss +6 -8
- 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/dist/zone/form/ZoneForm.d.ts +3 -2
- package/dist/zone/form/ZoneForm.d.ts.map +1 -1
- package/dist/zone/form/ZoneForm.js +4 -2
- package/dist/zone/form/components/ZoneControl.d.ts +3 -2
- package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneControl.js +5 -2
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +5 -4
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.js +5 -2
- package/dist/zone/form/utils/dates.d.ts.map +1 -1
- package/package.json +10 -10
- 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/components/CalendarButtons/CalendarButtons.tsx +31 -28
- package/src/calendar/utils/index.ts +26 -4
- package/src/date-time-button/DateTimeButton.tsx +1 -9
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +3 -2
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +35 -37
- package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +3 -3
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +0 -1
- package/src/header/elements/Elements.stories.tsx +1 -1
- package/src/help/popover/Popover.stories.tsx +1 -1
- package/src/iframe/event/event-card/IframeEventCard.tsx +16 -2
- package/src/iframe/event/event-venue-map/IframeEventVenueMap.stories.tsx +3 -3
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +1 -0
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -0
- package/src/layout/DropDown.tsx +2 -1
- package/src/layout/DropDownToggle.tsx +2 -0
- package/src/modals/confirmation/ConfirmModal.tsx +19 -3
- package/src/product-set/card/ProductSetCard.stories.tsx +3 -1
- package/src/product-set/card/ProductSetCard.tsx +47 -8
- package/src/product-set/control/DateAndRecurrenceInput.tsx +6 -4
- package/src/product-set/control/DateInput.tsx +2 -1
- package/src/product-set/control/ProductSetControl.tsx +4 -15
- package/src/product-set/control/ProductSetRecurrenceControl.stories.tsx +2 -2
- package/src/product-set/form/ProductCategoriesControl.tsx +37 -1
- package/src/product-set/form/ProductSetForm.tsx +25 -3
- package/src/product-set/form/ProductSetNameControl.tsx +27 -0
- package/src/product-set/form/ProductZonesControl.tsx +4 -7
- 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 +0 -3
- package/src/product-set/form/VenueMapsControl.tsx +0 -3
- package/src/product-set/form/index.ts +1 -0
- 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 +11 -0
- package/src/provider/location-input/LocationInput.tsx +36 -1
- package/src/provider/location-input/LocationInputDescription.tsx +23 -11
- package/src/provider/location-input/index.ts +1 -0
- package/src/provider/provider-form/ProviderForm.tsx +7 -2
- package/src/provider/venue-form/VenueForm.tsx +5 -2
- package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +4 -18
- package/src/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.tsx +8 -22
- package/src/recurring-date-picker-input/RecurringDatePickerInput.stories.tsx +11 -4
- package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +17 -3
- package/src/recurring-date-picker-input/utils.ts +86 -1
- package/src/sales/booking/results/components/ResultCard.tsx +4 -10
- 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 +1 -0
- 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 +6 -0
- package/src/sortable-tree/SortableTreeItem.tsx +6 -0
- package/src/styles/auth/AccessDenied.scss +1 -1
- package/src/styles/back-button/BackButton.scss +25 -24
- package/src/styles/back-button/_index.scss +1 -1
- package/src/styles/company-user-form/UserForm.scss +4 -7
- package/src/styles/company-user-form/_index.scss +1 -1
- package/src/styles/custom-fields/CreateSortableListItem.scss +2 -1
- package/src/styles/custom-fields/_index.scss +1 -1
- package/src/styles/customers/Filter.scss +5 -5
- package/src/styles/events/EditEventModal.scss +1 -3
- 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 +0 -1
- package/src/styles/iframe-events/CalendarSelect.scss +1 -1
- package/src/styles/iframe-events/CategoryStepsForm.scss +6 -7
- package/src/styles/iframe-events/Event.scss +2 -4
- package/src/styles/iframe-events/EventForm.scss +54 -54
- package/src/styles/iframe-events/EventNavigationFooter.scss +1 -0
- 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 +1 -2
- package/src/styles/product-set/CreateProductSetItem.scss +15 -13
- package/src/styles/product-set/DateAndRecurrenceInput.scss +6 -8
- 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 +25 -2
- package/src/styles/product-set/TutorialGifCard.scss +1 -1
- package/src/styles/product-set/_index.scss +2 -2
- package/src/styles/report/ReportCard.scss +1 -0
- package/src/styles/report/_index.scss +1 -1
- package/src/styles/resources-blocking/_index.scss +4 -0
- package/src/styles/sales/BookingFilter.scss +2 -2
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/styles/sales/BookingTabs.scss +7 -5
- package/src/styles/sales/Filters.scss +5 -4
- package/src/styles/sales/GuestProfile.scss +170 -175
- package/src/styles/sales/LifeTimeSales.scss +1 -1
- package/src/styles/sales/ManualBooking.scss +4 -2
- package/src/styles/snippet-templates/_snippetVariables.scss +63 -244
- 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 +10 -32
- package/src/styles/themes/licklist/_variables.scss +1 -1
- package/src/styles/tiptap-editor/TiptapEditor.scss +9 -10
- package/src/styles/tiptap-editor/_index.scss +1 -1
- package/src/styles/venue-map-sets/VenueMapSetForm.scss +5 -4
- package/src/styles/virtualized/_index.scss +1 -1
- package/src/styles/zones/ZoneForm.scss +1 -0
- package/src/styles/zones/ZoneRecurrencesControl.scss +6 -8
- package/src/tiptap-editor/TipTapEditor.stories.tsx +6 -4
- package/src/tiptap-editor/TipTapMenu/TipTapMenu.stories.tsx +5 -2
- package/src/typeahead/Typeahead.tsx +15 -1
- package/src/zone/form/ZoneForm.tsx +9 -2
- package/src/zone/form/components/ZoneControl.tsx +8 -3
- package/src/zone/form/components/ZoneRecurrencesControl.tsx +10 -5
- package/src/zone/form/utils/dates.ts +9 -10
- package/yarn.lock +202 -196
- package/dist/assets/iframe/selectArrow.svg.js +0 -17
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Card } from "react-bootstrap";
|
|
1
|
+
import { Button, Card } from "react-bootstrap";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
import clsx from "clsx";
|
|
@@ -47,6 +47,7 @@ export function IframeEventCard({
|
|
|
47
47
|
descriptionId,
|
|
48
48
|
imageClassName,
|
|
49
49
|
showMoreInfo,
|
|
50
|
+
snippetSetting,
|
|
50
51
|
}: IframeEventCardProps) {
|
|
51
52
|
const { formatNumber } = useIntl();
|
|
52
53
|
const { t } = useTranslation("Design");
|
|
@@ -69,7 +70,11 @@ export function IframeEventCard({
|
|
|
69
70
|
{ "list-view": isListView },
|
|
70
71
|
className,
|
|
71
72
|
)}
|
|
72
|
-
onClick={
|
|
73
|
+
onClick={
|
|
74
|
+
goToDetails || !snippetSetting.displayBookingButtonOnEventList
|
|
75
|
+
? onClick
|
|
76
|
+
: undefined
|
|
77
|
+
}
|
|
73
78
|
>
|
|
74
79
|
{showMoreInfo && <div className="iframe-event-card__info-icon">i</div>}
|
|
75
80
|
{imageSrc && (
|
|
@@ -133,6 +138,15 @@ export function IframeEventCard({
|
|
|
133
138
|
/>
|
|
134
139
|
</Card.Text>
|
|
135
140
|
)}
|
|
141
|
+
{!!snippetSetting.displayBookingButtonOnEventList && showMoreInfo && (
|
|
142
|
+
<Button
|
|
143
|
+
className="step-save-btn w-25 mt-4"
|
|
144
|
+
type="button"
|
|
145
|
+
onClick={onClick}
|
|
146
|
+
>
|
|
147
|
+
{t("book")}
|
|
148
|
+
</Button>
|
|
149
|
+
)}
|
|
136
150
|
</div>
|
|
137
151
|
</Card.Body>
|
|
138
152
|
</Card>
|
|
@@ -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 { forwardRef } from "react";
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
|
|
3
3
|
interface Props {
|
|
4
4
|
children?: React.ReactNode | React.ReactNode[];
|
|
@@ -24,4 +24,5 @@ const DropDown = forwardRef((props: Props, ref: any) => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
DropDown.displayName = "DropDown";
|
|
27
|
+
|
|
27
28
|
export default DropDown;
|
|
@@ -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,7 +9,8 @@ export default {
|
|
|
9
9
|
|
|
10
10
|
export const Default: Story<ProductSetCardProps> = (args) => (
|
|
11
11
|
<ProductSetCard {...args} />
|
|
12
|
-
)
|
|
12
|
+
)
|
|
13
|
+
|
|
13
14
|
|
|
14
15
|
Default.args = {
|
|
15
16
|
href: "#",
|
|
@@ -17,3 +18,4 @@ Default.args = {
|
|
|
17
18
|
rrule: "FREQ=WEEKLY;BYDAY=WE",
|
|
18
19
|
hasPermission: true,
|
|
19
20
|
};
|
|
21
|
+
|
|
@@ -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) => (
|
|
@@ -28,17 +28,16 @@ import {
|
|
|
28
28
|
AvailableTimesControlRef,
|
|
29
29
|
} from "../../zone/form/components/AvailableTimesControl";
|
|
30
30
|
|
|
31
|
-
// eslint-disable-next-line max-len
|
|
32
|
-
|
|
33
31
|
export interface DateAndRecurrenceInputValues {
|
|
34
32
|
menuRecurrences?: Partial<ProductSetRecurrence>[];
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
interface DateAndRecurrenceInputProps {
|
|
38
36
|
isEventEditProductSet?: boolean;
|
|
39
|
-
workHours
|
|
37
|
+
workHours: WorkHour[] | undefined;
|
|
40
38
|
providerHasBookingManagement: boolean;
|
|
41
39
|
isLoading?: boolean;
|
|
40
|
+
timeZone: string;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
export const DateAndRecurrenceInput = ({
|
|
@@ -46,6 +45,7 @@ export const DateAndRecurrenceInput = ({
|
|
|
46
45
|
providerHasBookingManagement,
|
|
47
46
|
workHours,
|
|
48
47
|
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,6 +228,8 @@ export const DateAndRecurrenceInput = ({
|
|
|
228
228
|
defaultValues={editState.values}
|
|
229
229
|
onChange={handleRecurringDateChange}
|
|
230
230
|
onDelete={handleDelete}
|
|
231
|
+
workHours={workHours}
|
|
232
|
+
timeZone={timeZone}
|
|
231
233
|
>
|
|
232
234
|
{providerHasBookingManagement && (
|
|
233
235
|
<AvailableTimesControl
|
|
@@ -247,7 +247,8 @@ export const DateInput = ({
|
|
|
247
247
|
menuRecurrence={menuRecurrence}
|
|
248
248
|
onEdit={() => handleOnEdit(menuRecurrence, index)}
|
|
249
249
|
errorMessage={
|
|
250
|
-
errors?.menuRecurrences?.[`${index}`]?.availableTimes
|
|
250
|
+
errors?.menuRecurrences?.[`${index}`]?.availableTimes
|
|
251
|
+
?.message || errors?.menuRecurrences?.[`${index}`]?.message
|
|
251
252
|
}
|
|
252
253
|
/>
|
|
253
254
|
))}
|
|
@@ -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";
|
|
@@ -88,11 +85,11 @@ export interface ProductSetControlProps {
|
|
|
88
85
|
fieldSets?: FieldSet[];
|
|
89
86
|
showEmailTemplate?: boolean;
|
|
90
87
|
showSmsTemplate?: boolean;
|
|
91
|
-
workHours
|
|
88
|
+
workHours: WorkHour[] | undefined;
|
|
92
89
|
providerHasBookingManagement?: boolean;
|
|
93
90
|
isOverrides?: boolean;
|
|
94
|
-
occurrenceStartAtDate?: string;
|
|
95
91
|
isCreateNewOverrides?: boolean;
|
|
92
|
+
timeZone: string;
|
|
96
93
|
}
|
|
97
94
|
|
|
98
95
|
export function ProductSetControl({
|
|
@@ -109,8 +106,8 @@ export function ProductSetControl({
|
|
|
109
106
|
workHours,
|
|
110
107
|
providerHasBookingManagement = false,
|
|
111
108
|
isOverrides = false,
|
|
112
|
-
occurrenceStartAtDate,
|
|
113
109
|
isCreateNewOverrides = false,
|
|
110
|
+
timeZone,
|
|
114
111
|
}: ProductSetControlProps) {
|
|
115
112
|
const { t } = useTranslation(["Design", "Validation", "Notification"]);
|
|
116
113
|
const {
|
|
@@ -119,12 +116,10 @@ export function ProductSetControl({
|
|
|
119
116
|
formState: { errors },
|
|
120
117
|
watch,
|
|
121
118
|
setError,
|
|
122
|
-
setValue,
|
|
123
119
|
clearErrors,
|
|
124
120
|
} = useFormContext<ProductSetControlValues>();
|
|
125
121
|
|
|
126
122
|
const steps = watch("steps");
|
|
127
|
-
const productSetName = watch("name");
|
|
128
123
|
|
|
129
124
|
const nameId = useId();
|
|
130
125
|
const termsAndConditionsId = useId();
|
|
@@ -138,13 +133,6 @@ export function ProductSetControl({
|
|
|
138
133
|
productCategories?.some((category) => checkIfZoneCategory(category?.type)),
|
|
139
134
|
);
|
|
140
135
|
|
|
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
|
-
|
|
148
136
|
return (
|
|
149
137
|
<Row
|
|
150
138
|
className={`product-set-form ${
|
|
@@ -200,6 +188,7 @@ export function ProductSetControl({
|
|
|
200
188
|
workHours={isZoneAdded ? workHours : undefined}
|
|
201
189
|
isLoading={isLoading}
|
|
202
190
|
providerHasBookingManagement={providerHasBookingManagement}
|
|
191
|
+
timeZone={timeZone}
|
|
203
192
|
/>
|
|
204
193
|
)}
|
|
205
194
|
</>
|
|
@@ -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,6 +8,7 @@ import {
|
|
|
8
8
|
useFormContext,
|
|
9
9
|
useWatch,
|
|
10
10
|
} from "react-hook-form";
|
|
11
|
+
import { FaBars, FaBowlingBall, FaCalendar, FaTicketAlt } from "react-icons/fa";
|
|
11
12
|
import { useTranslation } from "react-i18next";
|
|
12
13
|
import { useSensor, MouseSensor } from "@dnd-kit/core";
|
|
13
14
|
import {
|
|
@@ -25,7 +26,11 @@ import { ProductCategoryControl } from "../product-category";
|
|
|
25
26
|
import { ProductCategory } from "../types";
|
|
26
27
|
import { ProductsControl } from "./ProductsControl";
|
|
27
28
|
import { ProductSetFormValues, WithIsLoading } from "./ProductSetForm";
|
|
28
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
SelectCategoryModal,
|
|
31
|
+
CATEGORY_TYPES_NAMES,
|
|
32
|
+
CategoryConfig,
|
|
33
|
+
} from "./SelectCategoryModal";
|
|
29
34
|
import { ProductSetLoadingContext } from "./context";
|
|
30
35
|
import { VenueMapSetModal } from "./VenueMapSetModal";
|
|
31
36
|
import { moveArrayElements, sortArrayByIndex } from "../utils";
|
|
@@ -33,6 +38,29 @@ import { useSortableTreeFunctions } from "../hooks/useSortableTreeFunctions";
|
|
|
33
38
|
// @TODO not for first release
|
|
34
39
|
// import Popover from "./ProductSetFormPopover";
|
|
35
40
|
|
|
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
|
+
|
|
36
64
|
interface ProductCategoriesControlProps extends WithIsLoading {
|
|
37
65
|
stepIndex: number;
|
|
38
66
|
isOverrides?: boolean;
|
|
@@ -228,6 +256,8 @@ export function ProductCategoriesControl({
|
|
|
228
256
|
setIsExpanded(productCategoryId);
|
|
229
257
|
};
|
|
230
258
|
|
|
259
|
+
const categoryType = CATEGORIES_TYPE[productCategory.type];
|
|
260
|
+
|
|
231
261
|
return (
|
|
232
262
|
<Controller
|
|
233
263
|
key={`product-category-${productCategory._id}`}
|
|
@@ -272,6 +302,12 @@ export function ProductCategoriesControl({
|
|
|
272
302
|
)}
|
|
273
303
|
modalClass={ProductSetModalClasses.category}
|
|
274
304
|
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
|
+
}
|
|
275
311
|
body={
|
|
276
312
|
<ProductCategoryControl
|
|
277
313
|
isLoading={isLoading}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
1
|
+
import { useEffect, useState } 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,16 +22,21 @@ 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";
|
|
25
26
|
|
|
26
27
|
export interface WithIsLoading {
|
|
27
28
|
isLoading: boolean;
|
|
28
29
|
}
|
|
30
|
+
export interface WithIdOptional {
|
|
31
|
+
id?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
29
34
|
export interface WithId {
|
|
30
35
|
id: number;
|
|
31
36
|
}
|
|
32
37
|
export interface ProductSetFormValues
|
|
33
38
|
extends FormValues,
|
|
34
|
-
|
|
39
|
+
WithIdOptional,
|
|
35
40
|
ProductSetControlValues {
|
|
36
41
|
steps: Step[];
|
|
37
42
|
isOverrides?: boolean;
|
|
@@ -54,6 +59,7 @@ export interface ProductSetFormProps
|
|
|
54
59
|
isOverrides?: boolean;
|
|
55
60
|
workHours?: WorkHour[];
|
|
56
61
|
isCreateNewOverrides?: boolean;
|
|
62
|
+
timeZone: string;
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
export function ProductSetForm({
|
|
@@ -72,6 +78,7 @@ export function ProductSetForm({
|
|
|
72
78
|
workHours,
|
|
73
79
|
isOverrides,
|
|
74
80
|
isCreateNewOverrides,
|
|
81
|
+
timeZone,
|
|
75
82
|
...shared
|
|
76
83
|
}: ProductSetFormProps) {
|
|
77
84
|
const { t } = useTranslation("Design");
|
|
@@ -82,6 +89,7 @@ export function ProductSetForm({
|
|
|
82
89
|
onApproveDialog,
|
|
83
90
|
onDeclineDialog,
|
|
84
91
|
} = useDialogContext();
|
|
92
|
+
const [errorMessage, setErrorMessage] = useState("");
|
|
85
93
|
|
|
86
94
|
const form = useForm<ProductSetFormValues>({
|
|
87
95
|
defaultValues,
|
|
@@ -119,11 +127,18 @@ export function ProductSetForm({
|
|
|
119
127
|
if (!serverErrors) {
|
|
120
128
|
return;
|
|
121
129
|
}
|
|
130
|
+
if (Array.isArray(serverErrors) && serverErrors[0]) {
|
|
131
|
+
setErrorMessage(serverErrors[0]);
|
|
132
|
+
}
|
|
122
133
|
FormErrorService.handleServerErrors(serverErrors, setError);
|
|
123
134
|
}, [serverErrors, setError]);
|
|
124
135
|
|
|
125
136
|
useEffect(() => {
|
|
126
|
-
window.history.pushState(
|
|
137
|
+
window.history.pushState(
|
|
138
|
+
null,
|
|
139
|
+
"",
|
|
140
|
+
window.location.pathname + window.location.search,
|
|
141
|
+
);
|
|
127
142
|
window.addEventListener("beforeunload", onBeforeUnload);
|
|
128
143
|
window.addEventListener("popstate", onPopState);
|
|
129
144
|
|
|
@@ -150,6 +165,12 @@ export function ProductSetForm({
|
|
|
150
165
|
onDecline={onDeclineDialog}
|
|
151
166
|
/>
|
|
152
167
|
|
|
168
|
+
<ErrorModal
|
|
169
|
+
message={errorMessage}
|
|
170
|
+
isOpen={!!errorMessage}
|
|
171
|
+
onClose={() => setErrorMessage("")}
|
|
172
|
+
/>
|
|
173
|
+
|
|
153
174
|
<FormProvider {...form}>
|
|
154
175
|
<Form onSubmit={form.handleSubmit(submitHandler(onSubmitAndRedirect))}>
|
|
155
176
|
<ProductSetLoadingContext.Consumer>
|
|
@@ -175,6 +196,7 @@ export function ProductSetForm({
|
|
|
175
196
|
providerHasBookingManagement={providerHasBookingManagement}
|
|
176
197
|
isOverrides={isOverrides}
|
|
177
198
|
isCreateNewOverrides={isCreateNewOverrides}
|
|
199
|
+
timeZone={timeZone}
|
|
178
200
|
/>
|
|
179
201
|
<Row>
|
|
180
202
|
<Col md={6} sm={12} />
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Form } from "react-bootstrap";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
|
|
4
|
+
export const ProductSetNameControl = ({
|
|
5
|
+
value,
|
|
6
|
+
onChange,
|
|
7
|
+
error,
|
|
8
|
+
}: {
|
|
9
|
+
value: string;
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
error?: string;
|
|
12
|
+
}) => {
|
|
13
|
+
const { t } = useTranslation(["Design"]);
|
|
14
|
+
return (
|
|
15
|
+
<Form.Group>
|
|
16
|
+
<Form.Label>{t("Design:ProductSetName")}*</Form.Label>
|
|
17
|
+
<Form.Control
|
|
18
|
+
value={value}
|
|
19
|
+
maxLength={255}
|
|
20
|
+
onChange={(e) => onChange(e.target.value)}
|
|
21
|
+
placeholder={t("Design:placeholderProductSetName")}
|
|
22
|
+
isInvalid={Boolean(error)}
|
|
23
|
+
/>
|
|
24
|
+
<Form.Control.Feedback type="invalid">{error}</Form.Control.Feedback>
|
|
25
|
+
</Form.Group>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import React, { useContext, useState } from "react";
|
|
4
|
-
|
|
1
|
+
import { useContext, useState } from "react";
|
|
5
2
|
import {
|
|
6
3
|
ArrayPath,
|
|
7
4
|
Controller,
|
|
@@ -82,14 +79,14 @@ export const ProductZonesControl = <T extends FormValues>({
|
|
|
82
79
|
|
|
83
80
|
const productZonesError = HookFormService.getErrors<T>(
|
|
84
81
|
`${productZonesFieldName}.root` as Path<T>,
|
|
85
|
-
errors
|
|
82
|
+
errors,
|
|
86
83
|
);
|
|
87
84
|
|
|
88
85
|
const zoneCapacity = useWatch({
|
|
89
86
|
control,
|
|
90
87
|
name: [
|
|
91
88
|
...fields.map(
|
|
92
|
-
(_, index) => `${productZonesFieldName}.${index}.capacity` as const
|
|
89
|
+
(_, index) => `${productZonesFieldName}.${index}.capacity` as const,
|
|
93
90
|
),
|
|
94
91
|
],
|
|
95
92
|
});
|
|
@@ -98,7 +95,7 @@ export const ProductZonesControl = <T extends FormValues>({
|
|
|
98
95
|
control,
|
|
99
96
|
name: [
|
|
100
97
|
...fields.map(
|
|
101
|
-
(_, index) => `${productZonesFieldName}.${index}.duration` as const
|
|
98
|
+
(_, index) => `${productZonesFieldName}.${index}.duration` as const,
|
|
102
99
|
),
|
|
103
100
|
],
|
|
104
101
|
});
|