@licklist/design 0.67.2-dev.5 → 0.67.2
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/components/CalendarButtons/CalendarButtons.d.ts.map +1 -1
- package/dist/calendar/components/CalendarButtons/CalendarButtons.js +40 -35
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +1 -2
- package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.js +3 -5
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +6 -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/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 +3 -9
- 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/layout/DropDown.d.ts +1 -2
- package/dist/layout/DropDown.d.ts.map +1 -1
- package/dist/layout/DropDownToggle.d.ts.map +1 -1
- package/dist/layout/DropDownToggle.js +0 -1
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.js +0 -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 +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- 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 +1 -4
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +2 -60
- 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/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/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 +2 -4
- 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 +2 -4
- 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/RecurringDatePickerInput.d.ts +1 -3
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +3 -6
- 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 -75
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +2 -0
- 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/zone/form/ZoneForm.d.ts +2 -2
- package/dist/zone/form/ZoneForm.d.ts.map +1 -1
- package/dist/zone/form/ZoneForm.js +2 -3
- package/dist/zone/form/components/ZoneControl.d.ts +2 -2
- package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneControl.js +2 -4
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -4
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.js +2 -4
- package/dist/zone/form/utils/dates.d.ts.map +1 -1
- package/package.json +8 -8
- 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 +28 -31
- package/src/events/edit-event-modal/component/SaleDeadline/SaleDeadline.tsx +5 -3
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +4 -0
- 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-card/IframeEventCard.tsx +2 -16
- 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/layout/DropDownToggle.tsx +0 -2
- package/src/product-set/card/ProductSetCard.stories.tsx +1 -3
- package/src/product-set/control/DateAndRecurrenceInput.tsx +4 -3
- package/src/product-set/control/DateInput.tsx +1 -2
- package/src/product-set/control/ProductSetControl.tsx +1 -1
- 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 -22
- 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/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/provider/location-input/LocationInput.tsx +1 -36
- package/src/provider/location-input/index.ts +0 -1
- package/src/provider/provider-form/ProviderForm.tsx +1 -6
- package/src/provider/venue-form/VenueForm.tsx +1 -4
- package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +18 -4
- package/src/recurring-date-picker-input/RecurringDatePickerInput.stories.tsx +4 -11
- package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +1 -12
- package/src/recurring-date-picker-input/utils.ts +1 -91
- package/src/sales/booking/results/components/ResultCard.tsx +2 -0
- 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/zone/form/ZoneForm.tsx +2 -3
- package/src/zone/form/components/ZoneControl.tsx +3 -3
- package/src/zone/form/components/ZoneRecurrencesControl.tsx +5 -7
- package/src/zone/form/utils/dates.ts +10 -9
- package/yarn.lock +141 -128
|
@@ -86,7 +86,7 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
86
86
|
return target;
|
|
87
87
|
}
|
|
88
88
|
var ZoneForm = function(param) {
|
|
89
|
-
var defaultValues = param.defaultValues, onSubmit = param.onSubmit, serverErrors = param.serverErrors, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading
|
|
89
|
+
var defaultValues = param.defaultValues, onSubmit = param.onSubmit, serverErrors = param.serverErrors, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading;
|
|
90
90
|
var t = useTranslation("Design").t;
|
|
91
91
|
var form = useForm({
|
|
92
92
|
mode: "onChange",
|
|
@@ -121,8 +121,7 @@ var ZoneForm = function(param) {
|
|
|
121
121
|
onSubmit: handleSubmit(onFormSubmit),
|
|
122
122
|
children: [
|
|
123
123
|
/*#__PURE__*/ jsx(ZoneControl, {
|
|
124
|
-
isLoading: isLoading
|
|
125
|
-
workHours: workHours
|
|
124
|
+
isLoading: isLoading
|
|
126
125
|
}),
|
|
127
126
|
/*#__PURE__*/ jsxs(Row, {
|
|
128
127
|
children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
|
|
2
2
|
export type ZoneControlProps = {
|
|
3
3
|
isLoading: boolean;
|
|
4
|
-
workHours
|
|
4
|
+
workHours?: WorkHour[];
|
|
5
5
|
};
|
|
6
|
-
export declare const ZoneControl: ({ isLoading
|
|
6
|
+
export declare const ZoneControl: ({ isLoading }: ZoneControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
//# sourceMappingURL=ZoneControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoneControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneControl.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAStF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"ZoneControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneControl.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAStF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,WAAW,kBAAmB,gBAAgB,4CA0B1D,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { ZoneImageControl } from './ZoneImageControl.js';
|
|
|
9
9
|
import { GameDurationControl } from './GameDurationControl.js';
|
|
10
10
|
|
|
11
11
|
var ZoneControl = function(param) {
|
|
12
|
-
var isLoading = param.isLoading
|
|
12
|
+
var isLoading = param.isLoading;
|
|
13
13
|
return /*#__PURE__*/ jsx(Row, {
|
|
14
14
|
children: /*#__PURE__*/ jsxs(Col, {
|
|
15
15
|
md: 6,
|
|
@@ -19,9 +19,7 @@ var ZoneControl = function(param) {
|
|
|
19
19
|
/*#__PURE__*/ jsx(NameControl, {
|
|
20
20
|
isLoading: isLoading
|
|
21
21
|
}),
|
|
22
|
-
/*#__PURE__*/ jsx(ZoneRecurrencesControl, {
|
|
23
|
-
workHours: workHours
|
|
24
|
-
}),
|
|
22
|
+
/*#__PURE__*/ jsx(ZoneRecurrencesControl, {}),
|
|
25
23
|
/*#__PURE__*/ jsx("hr", {}),
|
|
26
24
|
/*#__PURE__*/ jsxs(Row, {
|
|
27
25
|
children: [
|
|
@@ -3,9 +3,9 @@ import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMa
|
|
|
3
3
|
export interface DateAndRecurrenceInputValues {
|
|
4
4
|
zoneRecurrences?: Partial<ZoneRecurrence>[];
|
|
5
5
|
}
|
|
6
|
-
type ZoneRecurrenceControlProps = {
|
|
7
|
-
workHours
|
|
6
|
+
export type ZoneRecurrenceControlProps = {
|
|
7
|
+
workHours?: WorkHour[];
|
|
8
|
+
isLoading?: boolean;
|
|
8
9
|
};
|
|
9
|
-
export declare const ZoneRecurrencesControl: (
|
|
10
|
-
export {};
|
|
10
|
+
export declare const ZoneRecurrencesControl: () => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
//# sourceMappingURL=ZoneRecurrencesControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoneRecurrencesControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneRecurrencesControl.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAMlG,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAWtF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;CAC7C;AAED,
|
|
1
|
+
{"version":3,"file":"ZoneRecurrencesControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneRecurrencesControl.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAMlG,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAWtF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;CAC7C;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,sBAAsB,+CAkMlC,CAAC"}
|
|
@@ -211,8 +211,7 @@ function _ts_generator(thisArg, body) {
|
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
var ZoneRecurrencesControl = function(
|
|
215
|
-
var workHours = param.workHours;
|
|
214
|
+
var ZoneRecurrencesControl = function() {
|
|
216
215
|
var _errors_zoneRecurrences;
|
|
217
216
|
var _useFormContext = useFormContext(), control = _useFormContext.control, register = _useFormContext.register, errors = _useFormContext.formState.errors, getValues = _useFormContext.getValues, setValue = _useFormContext.setValue, clearErrors = _useFormContext.clearErrors;
|
|
218
217
|
var _useFieldArray = useFieldArray({
|
|
@@ -349,8 +348,7 @@ var ZoneRecurrencesControl = function(param) {
|
|
|
349
348
|
defaultValues: editState.values,
|
|
350
349
|
onChange: handleRecurringDateChange,
|
|
351
350
|
onDelete: handleDelete,
|
|
352
|
-
setInitialStartDateAfterSelect: true
|
|
353
|
-
workHours: workHours
|
|
351
|
+
setInitialStartDateAfterSelect: true
|
|
354
352
|
})
|
|
355
353
|
})
|
|
356
354
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/utils/dates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAOtF,eAAO,MAAM,qBAAqB,cACrB,MAAM,WACR,MAAM,6BAuChB,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/utils/dates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAOtF,eAAO,MAAM,qBAAqB,cACrB,MAAM,WACR,MAAM,6BAuChB,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,QAAQ,EAAE,aA0C9D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.67.2
|
|
3
|
+
"version": "0.67.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@licklist/core": "0.
|
|
45
|
+
"@licklist/core": "0.29.1",
|
|
46
46
|
"@licklist/eslint-config": "0.5.5",
|
|
47
|
-
"@licklist/plugins": "0.32.0
|
|
47
|
+
"@licklist/plugins": "0.32.0",
|
|
48
48
|
"lodash": "4.17.21",
|
|
49
49
|
"luxon": "1.26.0",
|
|
50
50
|
"react": "17.0.2",
|
|
@@ -61,9 +61,10 @@
|
|
|
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
|
-
"@
|
|
64
|
+
"@fortawesome/react-fontawesome": "0.1.9",
|
|
65
|
+
"@licklist/core": "0.29.1",
|
|
65
66
|
"@licklist/eslint-config": "0.5.5",
|
|
66
|
-
"@licklist/plugins": "0.
|
|
67
|
+
"@licklist/plugins": "0.32.0",
|
|
67
68
|
"@mdx-js/react": "1.6.22",
|
|
68
69
|
"@popperjs/core": "2.11.8",
|
|
69
70
|
"@react-aria/utils": "3.9.0",
|
|
@@ -199,6 +200,5 @@
|
|
|
199
200
|
"volta": {
|
|
200
201
|
"node": "20.9.0",
|
|
201
202
|
"yarn": "4.4.0"
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -2,7 +2,7 @@ import { useCallback, useMemo } from "react";
|
|
|
2
2
|
import { Button } from "react-bootstrap";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import { range } from "lodash";
|
|
5
|
-
import {
|
|
5
|
+
import { ReactComponent as SelectArrow } from "../../../assets/iframe/selectArrow.svg";
|
|
6
6
|
import { CalendarSelect } from "../CalendarSelect";
|
|
7
7
|
import { CalendarProps } from "../../Calendar";
|
|
8
8
|
|
|
@@ -26,21 +26,15 @@ export const CalendarButtons = ({
|
|
|
26
26
|
}: CalendarButtonsProps) => {
|
|
27
27
|
const { t } = useTranslation("Design");
|
|
28
28
|
|
|
29
|
-
const
|
|
30
|
-
(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (nextDateTime <= initialDate) {
|
|
35
|
-
setCurrentDate(initialDate);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
29
|
+
const onSelectNextMonth = useCallback(() => {
|
|
30
|
+
setCurrentDate((prevDate) => prevDate.plus({ months: 1 }));
|
|
31
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
|
+
}, []);
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
}
|
|
34
|
+
const onSelectPreviousMonth = useCallback(() => {
|
|
35
|
+
setCurrentDate((prevDate) => prevDate.minus({ month: 1 }));
|
|
41
36
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
-
|
|
43
|
-
);
|
|
37
|
+
}, []);
|
|
44
38
|
|
|
45
39
|
const yearOptions = useMemo(() => {
|
|
46
40
|
return range(initialDate.year, initialDate.year + 5, 1).map((year) => {
|
|
@@ -48,18 +42,10 @@ export const CalendarButtons = ({
|
|
|
48
42
|
});
|
|
49
43
|
}, [initialDate]);
|
|
50
44
|
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return {
|
|
56
|
-
label: DateTime.fromObject({ month: monthNumber }).toLocaleString({
|
|
57
|
-
month: "long",
|
|
58
|
-
}),
|
|
59
|
-
value: monthNumber,
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
}, [initialDate, currentDate]);
|
|
45
|
+
const canMoveBack = useMemo(
|
|
46
|
+
() => currentDate > initialDate,
|
|
47
|
+
[currentDate, initialDate],
|
|
48
|
+
);
|
|
63
49
|
|
|
64
50
|
const onSelectYear = (value: string) => {
|
|
65
51
|
const selectedYear = Number(value);
|
|
@@ -121,11 +107,22 @@ export const CalendarButtons = ({
|
|
|
121
107
|
<hr />
|
|
122
108
|
<div className="calendar-buttons">
|
|
123
109
|
<div className="buttons-wrapper">
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
110
|
+
<Button
|
|
111
|
+
className="calendar-button left-button"
|
|
112
|
+
onClick={onSelectPreviousMonth}
|
|
113
|
+
disabled={!canMoveBack}
|
|
114
|
+
variant="link"
|
|
115
|
+
>
|
|
116
|
+
<SelectArrow />
|
|
117
|
+
</Button>
|
|
118
|
+
<div className="month-title">{currentDate.toFormat("MMMM")}</div>
|
|
119
|
+
<Button
|
|
120
|
+
className="calendar-button"
|
|
121
|
+
onClick={onSelectNextMonth}
|
|
122
|
+
variant="link"
|
|
123
|
+
>
|
|
124
|
+
<SelectArrow />
|
|
125
|
+
</Button>
|
|
129
126
|
</div>
|
|
130
127
|
<CalendarSelect
|
|
131
128
|
options={yearOptions}
|
|
@@ -35,11 +35,13 @@ export const SaleDeadline = ({ disabled = false }: { disabled?: boolean }) => {
|
|
|
35
35
|
const saleDeadline = watch("saleDeadline");
|
|
36
36
|
|
|
37
37
|
useEffect(() => {
|
|
38
|
-
if (saleDeadline
|
|
39
|
-
setDeadlineType(
|
|
38
|
+
if (saleDeadline) {
|
|
39
|
+
setDeadlineType(
|
|
40
|
+
saleDeadline < 0 ? SALE_DEADLINE_BEFORE_TYPE : SALE_DEADLINE_AFTER_TYPE,
|
|
41
|
+
);
|
|
40
42
|
}
|
|
41
43
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
-
}, [
|
|
44
|
+
}, []);
|
|
43
45
|
|
|
44
46
|
return (
|
|
45
47
|
<Form.Group className="sales-deadline">
|
package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx
CHANGED
|
@@ -42,6 +42,10 @@ export const SelectEventProductSet = ({
|
|
|
42
42
|
const productSetId = watch("productSetId");
|
|
43
43
|
const editedProductSet = watch("editedProductSet");
|
|
44
44
|
|
|
45
|
+
const selectedProductSet = productSets.find(
|
|
46
|
+
(productSet) => productSet.id === productSetId,
|
|
47
|
+
)?.parentMenuId;
|
|
48
|
+
|
|
45
49
|
const onEditProductSet = useCallback(
|
|
46
50
|
() => {
|
|
47
51
|
setEditProductSetId(String(productSetId));
|
|
@@ -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 = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { 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,7 +47,6 @@ export function IframeEventCard({
|
|
|
47
47
|
descriptionId,
|
|
48
48
|
imageClassName,
|
|
49
49
|
showMoreInfo,
|
|
50
|
-
snippetSetting,
|
|
51
50
|
}: IframeEventCardProps) {
|
|
52
51
|
const { formatNumber } = useIntl();
|
|
53
52
|
const { t } = useTranslation("Design");
|
|
@@ -70,11 +69,7 @@ export function IframeEventCard({
|
|
|
70
69
|
{ "list-view": isListView },
|
|
71
70
|
className,
|
|
72
71
|
)}
|
|
73
|
-
onClick={
|
|
74
|
-
goToDetails || !snippetSetting.displayBookingButtonOnEventList
|
|
75
|
-
? onClick
|
|
76
|
-
: undefined
|
|
77
|
-
}
|
|
72
|
+
onClick={goToDetails ? onClick : undefined}
|
|
78
73
|
>
|
|
79
74
|
{showMoreInfo && <div className="iframe-event-card__info-icon">i</div>}
|
|
80
75
|
{imageSrc && (
|
|
@@ -138,15 +133,6 @@ export function IframeEventCard({
|
|
|
138
133
|
/>
|
|
139
134
|
</Card.Text>
|
|
140
135
|
)}
|
|
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
|
-
)}
|
|
150
136
|
</div>
|
|
151
137
|
</Card.Body>
|
|
152
138
|
</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
|
|
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;
|
|
@@ -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
|
-
|
|
@@ -28,13 +28,15 @@ 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
42
|
}
|
|
@@ -88,7 +90,7 @@ export const DateAndRecurrenceInput = ({
|
|
|
88
90
|
clearEditState();
|
|
89
91
|
});
|
|
90
92
|
|
|
91
|
-
const popoverId = useId()
|
|
93
|
+
const popoverId = useId()!;
|
|
92
94
|
|
|
93
95
|
const { t } = useTranslation("Design");
|
|
94
96
|
|
|
@@ -226,7 +228,6 @@ export const DateAndRecurrenceInput = ({
|
|
|
226
228
|
defaultValues={editState.values}
|
|
227
229
|
onChange={handleRecurringDateChange}
|
|
228
230
|
onDelete={handleDelete}
|
|
229
|
-
workHours={workHours}
|
|
230
231
|
>
|
|
231
232
|
{providerHasBookingManagement && (
|
|
232
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
|
))}
|
|
@@ -88,7 +88,7 @@ export interface ProductSetControlProps {
|
|
|
88
88
|
fieldSets?: FieldSet[];
|
|
89
89
|
showEmailTemplate?: boolean;
|
|
90
90
|
showSmsTemplate?: boolean;
|
|
91
|
-
workHours
|
|
91
|
+
workHours?: WorkHour[];
|
|
92
92
|
providerHasBookingManagement?: boolean;
|
|
93
93
|
isOverrides?: boolean;
|
|
94
94
|
occurrenceStartAtDate?: string;
|
|
@@ -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;
|
|
@@ -87,7 +82,6 @@ export function ProductSetForm({
|
|
|
87
82
|
onApproveDialog,
|
|
88
83
|
onDeclineDialog,
|
|
89
84
|
} = useDialogContext();
|
|
90
|
-
const [errorMessage, setErrorMessage] = useState("");
|
|
91
85
|
|
|
92
86
|
const form = useForm<ProductSetFormValues>({
|
|
93
87
|
defaultValues,
|
|
@@ -125,18 +119,11 @@ export function ProductSetForm({
|
|
|
125
119
|
if (!serverErrors) {
|
|
126
120
|
return;
|
|
127
121
|
}
|
|
128
|
-
if (Array.isArray(serverErrors) && serverErrors[0]) {
|
|
129
|
-
setErrorMessage(serverErrors[0]);
|
|
130
|
-
}
|
|
131
122
|
FormErrorService.handleServerErrors(serverErrors, setError);
|
|
132
123
|
}, [serverErrors, setError]);
|
|
133
124
|
|
|
134
125
|
useEffect(() => {
|
|
135
|
-
window.history.pushState(
|
|
136
|
-
null,
|
|
137
|
-
"",
|
|
138
|
-
window.location.pathname + window.location.search,
|
|
139
|
-
);
|
|
126
|
+
window.history.pushState(null, "", window.location.pathname);
|
|
140
127
|
window.addEventListener("beforeunload", onBeforeUnload);
|
|
141
128
|
window.addEventListener("popstate", onPopState);
|
|
142
129
|
|
|
@@ -163,12 +150,6 @@ export function ProductSetForm({
|
|
|
163
150
|
onDecline={onDeclineDialog}
|
|
164
151
|
/>
|
|
165
152
|
|
|
166
|
-
<ErrorModal
|
|
167
|
-
message={errorMessage}
|
|
168
|
-
isOpen={!!errorMessage}
|
|
169
|
-
onClose={() => setErrorMessage("")}
|
|
170
|
-
/>
|
|
171
|
-
|
|
172
153
|
<FormProvider {...form}>
|
|
173
154
|
<Form onSubmit={form.handleSubmit(submitHandler(onSubmitAndRedirect))}>
|
|
174
155
|
<ProductSetLoadingContext.Consumer>
|