@licklist/design 0.68.0-dev.1 → 0.68.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 +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/IntervalInput.d.ts.map +1 -1
- package/dist/events/edit-event-modal/IntervalInput.js +1 -7
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +23 -24
- 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/DateInput.d.ts.map +1 -1
- package/dist/product-set/control/DateInput.js +2 -2
- 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 +1 -59
- 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/product/ProductControl.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/working-hours-input/WorkingHoursInputDescription.js +2 -3
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +2 -0
- 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/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/package.json +6 -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/IntervalInput.tsx +1 -8
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +34 -32
- 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/DateInput.tsx +1 -2
- 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 -18
- 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/ProductControl.tsx +5 -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/working-hours-input/WorkingHoursInputDescription.tsx +2 -2
- package/src/sales/booking/results/components/ResultCard.tsx +2 -0
- package/src/setting/admin/AdminSetting.stories.tsx +0 -1
- 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/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/yarn.lock +14 -40
- 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
|
@@ -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;
|
|
@@ -89,7 +84,6 @@ export function ProductSetForm({
|
|
|
89
84
|
onApproveDialog,
|
|
90
85
|
onDeclineDialog,
|
|
91
86
|
} = useDialogContext();
|
|
92
|
-
const [errorMessage, setErrorMessage] = useState("");
|
|
93
87
|
|
|
94
88
|
const form = useForm<ProductSetFormValues>({
|
|
95
89
|
defaultValues,
|
|
@@ -127,9 +121,6 @@ export function ProductSetForm({
|
|
|
127
121
|
if (!serverErrors) {
|
|
128
122
|
return;
|
|
129
123
|
}
|
|
130
|
-
if (Array.isArray(serverErrors) && serverErrors[0]) {
|
|
131
|
-
setErrorMessage(serverErrors[0]);
|
|
132
|
-
}
|
|
133
124
|
FormErrorService.handleServerErrors(serverErrors, setError);
|
|
134
125
|
}, [serverErrors, setError]);
|
|
135
126
|
|
|
@@ -137,7 +128,7 @@ export function ProductSetForm({
|
|
|
137
128
|
window.history.pushState(
|
|
138
129
|
null,
|
|
139
130
|
"",
|
|
140
|
-
window.location.pathname + window.location.search
|
|
131
|
+
window.location.pathname + window.location.search
|
|
141
132
|
);
|
|
142
133
|
window.addEventListener("beforeunload", onBeforeUnload);
|
|
143
134
|
window.addEventListener("popstate", onPopState);
|
|
@@ -165,12 +156,6 @@ export function ProductSetForm({
|
|
|
165
156
|
onDecline={onDeclineDialog}
|
|
166
157
|
/>
|
|
167
158
|
|
|
168
|
-
<ErrorModal
|
|
169
|
-
message={errorMessage}
|
|
170
|
-
isOpen={!!errorMessage}
|
|
171
|
-
onClose={() => setErrorMessage("")}
|
|
172
|
-
/>
|
|
173
|
-
|
|
174
159
|
<FormProvider {...form}>
|
|
175
160
|
<Form onSubmit={form.handleSubmit(submitHandler(onSubmitAndRedirect))}>
|
|
176
161
|
<ProductSetLoadingContext.Consumer>
|
|
@@ -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
|
});
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from "react-icons/fa";
|
|
26
26
|
import { ProductSetLoadingContext } from "./context";
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
const CATEGORY_TYPES_NAMES = {
|
|
29
29
|
menuItems: CATEGORY_TYPE_MENU_ITEMS,
|
|
30
30
|
tickets: CATEGORY_TYPE_TICKETS,
|
|
31
31
|
bookings: CATEGORY_TYPE_BOOKINGS,
|
|
@@ -33,7 +33,7 @@ export const CATEGORY_TYPES_NAMES = {
|
|
|
33
33
|
fixedDuration: CATEGORY_TYPE_FIXED_DURATION,
|
|
34
34
|
} as const;
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
type CategoryConfig = { label: string; icon: ReactElement };
|
|
37
37
|
|
|
38
38
|
const MAIN_CATEGORIES: Partial<Record<CategoryType, CategoryConfig>> = {
|
|
39
39
|
[CATEGORY_TYPES_NAMES.tickets]: {
|
|
@@ -71,6 +71,9 @@ export function SubProductsControl({
|
|
|
71
71
|
images: subProducts[index]?.images as Image[],
|
|
72
72
|
};
|
|
73
73
|
// @ts-expect-error TS2345
|
|
74
|
+
// @TODO fix prod type error
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
76
|
+
// @ts-ignore
|
|
74
77
|
append(subProductCopy);
|
|
75
78
|
}}
|
|
76
79
|
/>
|
|
@@ -47,6 +47,9 @@ export const VenueMapsControl = ({
|
|
|
47
47
|
url={image.url}
|
|
48
48
|
name={name}
|
|
49
49
|
points={points}
|
|
50
|
+
// @TODO fix prod type error
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
52
|
+
// @ts-ignore
|
|
50
53
|
products={products}
|
|
51
54
|
pointProducts={pointProducts}
|
|
52
55
|
onPointProductsChange={onPointProductsChange}
|
|
@@ -5,7 +5,10 @@ import {
|
|
|
5
5
|
QUANTITY_TYPE_LIST_DTO,
|
|
6
6
|
QUANTITY_TYPE_RECHARGING,
|
|
7
7
|
} from "@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
ProductType,
|
|
10
|
+
PRODUCT_DEfAULT_COLORS,
|
|
11
|
+
} from "@licklist/core/dist/DataMapper/Product/ProductDataMapper";
|
|
9
12
|
import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
|
|
10
13
|
import clsx from "clsx";
|
|
11
14
|
import {
|
|
@@ -34,6 +37,7 @@ import {
|
|
|
34
37
|
} from "react-hook-form";
|
|
35
38
|
import { useTranslation } from "react-i18next";
|
|
36
39
|
import { useImages } from "@licklist/plugins/dist/hooks/Media/useImages";
|
|
40
|
+
|
|
37
41
|
import {
|
|
38
42
|
Image,
|
|
39
43
|
IMAGE_TYPE_IMAGE,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useContext } from "react";
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
2
|
import { Col, Form } from "react-bootstrap";
|
|
3
3
|
import { Controller, Path, useFormContext } from "react-hook-form";
|
|
4
4
|
import { HookFormService } from "@licklist/plugins";
|
|
@@ -98,7 +98,7 @@ export const AdvancedOptions = <T extends FormValues>({
|
|
|
98
98
|
{...register(`${fieldNamePrefix}.productGroupId` as Path<T>)}
|
|
99
99
|
isInvalid={HookFormService.isInvalid<T>(
|
|
100
100
|
`${fieldNamePrefix}.productGroupId` as Path<T>,
|
|
101
|
-
errors
|
|
101
|
+
errors
|
|
102
102
|
)}
|
|
103
103
|
disabled={isLoading || isOverrides}
|
|
104
104
|
defaultValue=""
|
|
@@ -115,7 +115,7 @@ export const AdvancedOptions = <T extends FormValues>({
|
|
|
115
115
|
<Form.Control.Feedback type="invalid">
|
|
116
116
|
{HookFormService.getErrors<T>(
|
|
117
117
|
`${fieldNamePrefix}.productGroupId` as Path<T>,
|
|
118
|
-
errors
|
|
118
|
+
errors
|
|
119
119
|
)}
|
|
120
120
|
</Form.Control.Feedback>
|
|
121
121
|
</Form.Group>
|
|
@@ -134,7 +134,7 @@ export const AdvancedOptions = <T extends FormValues>({
|
|
|
134
134
|
onChange={onChange}
|
|
135
135
|
isInvalid={HookFormService.isInvalid<T>(
|
|
136
136
|
`${fieldNamePrefix}.termsAndConditions` as Path<T>,
|
|
137
|
-
errors
|
|
137
|
+
errors
|
|
138
138
|
)}
|
|
139
139
|
disabled={isLoading || isOverrides}
|
|
140
140
|
name={name}
|
|
@@ -147,7 +147,7 @@ export const AdvancedOptions = <T extends FormValues>({
|
|
|
147
147
|
<Form.Control.Feedback type="invalid">
|
|
148
148
|
{HookFormService.getErrors<T>(
|
|
149
149
|
`${fieldNamePrefix}.termsAndConditions` as Path<T>,
|
|
150
|
-
errors
|
|
150
|
+
errors
|
|
151
151
|
)}
|
|
152
152
|
</Form.Control.Feedback>
|
|
153
153
|
</Form.Group>
|
|
@@ -42,7 +42,7 @@ export const Default: Story<ProductQuantityControlProps<{}>> = (args) => {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
export const ConstantForm: Story<ProductQuantityConstantControlProps<{}>> = (
|
|
45
|
-
args
|
|
45
|
+
args,
|
|
46
46
|
) => {
|
|
47
47
|
const form = useForm<ProductQuantityConstantControlValues>({
|
|
48
48
|
mode: "onChange",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useContext, useEffect, useMemo } from "react";
|
|
1
|
+
import React, { useContext, useEffect, useMemo } from "react";
|
|
2
2
|
import { Col, Form, Row } from "react-bootstrap";
|
|
3
3
|
import {
|
|
4
4
|
ArrayPath,
|
|
@@ -63,7 +63,7 @@ export const ProductZoneControl = <T extends FormValues>({
|
|
|
63
63
|
const disabledDuration = capacity === "0" || !capacity;
|
|
64
64
|
|
|
65
65
|
const { providerHasBookingManagement, zones = [] } = useContext(
|
|
66
|
-
ProductSetLoadingContext
|
|
66
|
+
ProductSetLoadingContext
|
|
67
67
|
);
|
|
68
68
|
|
|
69
69
|
const currentZoneData = zones.find((zone) => zone.id === Number(zoneId));
|
|
@@ -75,10 +75,10 @@ export const ProductZoneControl = <T extends FormValues>({
|
|
|
75
75
|
!productZones.find(
|
|
76
76
|
(productZone) =>
|
|
77
77
|
Number(productZone.zoneId) === zone.id &&
|
|
78
|
-
productZone.zoneId !== zoneId
|
|
79
|
-
)
|
|
78
|
+
productZone.zoneId !== zoneId
|
|
79
|
+
)
|
|
80
80
|
),
|
|
81
|
-
[zones, productZones, zoneId]
|
|
81
|
+
[zones, productZones, zoneId]
|
|
82
82
|
);
|
|
83
83
|
|
|
84
84
|
useEffect(() => {
|
|
@@ -89,7 +89,7 @@ export const ProductZoneControl = <T extends FormValues>({
|
|
|
89
89
|
setValue(
|
|
90
90
|
`${fieldNamePrefix}.duration` as Path<T>,
|
|
91
91
|
/* @ts-expect-error 6385 */
|
|
92
|
-
0 as UnpackNestedValue<PathValue<T, Path<T
|
|
92
|
+
0 as UnpackNestedValue<PathValue<T, Path<T>>>
|
|
93
93
|
);
|
|
94
94
|
clearErrors(`${fieldNamePrefix}.duration` as Path<T>);
|
|
95
95
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -104,7 +104,7 @@ export const ProductZoneControl = <T extends FormValues>({
|
|
|
104
104
|
/* @ts-expect-error 6385 */
|
|
105
105
|
(value * currentZoneData?.defaultDuration) as UnpackNestedValue<
|
|
106
106
|
PathValue<T, Path<T>>
|
|
107
|
-
|
|
107
|
+
>
|
|
108
108
|
);
|
|
109
109
|
};
|
|
110
110
|
return (
|
|
@@ -123,7 +123,7 @@ export const ProductZoneControl = <T extends FormValues>({
|
|
|
123
123
|
disabled={isOverrides}
|
|
124
124
|
isInvalid={HookFormService.isInvalid(
|
|
125
125
|
`${fieldNamePrefix}.zoneId`,
|
|
126
|
-
errors
|
|
126
|
+
errors
|
|
127
127
|
)}
|
|
128
128
|
{...field}
|
|
129
129
|
>
|
|
@@ -147,7 +147,7 @@ export const ProductZoneControl = <T extends FormValues>({
|
|
|
147
147
|
<Form.Control.Feedback type="invalid">
|
|
148
148
|
{HookFormService.getErrors(
|
|
149
149
|
`${fieldNamePrefix}.zoneId` as Path<T>,
|
|
150
|
-
errors
|
|
150
|
+
errors
|
|
151
151
|
)}
|
|
152
152
|
</Form.Control.Feedback>
|
|
153
153
|
</Form.Group>
|
|
@@ -3,7 +3,6 @@ import { SmsTemplate } from "@licklist/core/dist/DataMapper/Notification/SmsTemp
|
|
|
3
3
|
import { TFunction } from "react-i18next";
|
|
4
4
|
import { UseFormSetError } from "react-hook-form";
|
|
5
5
|
import { checkIfZoneCategory } from "@licklist/plugins";
|
|
6
|
-
import { ProductSet } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
|
|
7
6
|
import { TemplateItem } from "../control/ProductSetControl";
|
|
8
7
|
import { ProductSetFormValues } from "../form/ProductSetForm";
|
|
9
8
|
|
|
@@ -13,11 +12,6 @@ interface CheckAvailableTimesErrors {
|
|
|
13
12
|
t: TFunction;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
export interface MenuTypeheadItem {
|
|
17
|
-
id: number;
|
|
18
|
-
label: string;
|
|
19
|
-
value: number;
|
|
20
|
-
}
|
|
21
15
|
export const moveArrayElements = <T>(
|
|
22
16
|
array: T[],
|
|
23
17
|
prevIndex: number,
|
|
@@ -90,8 +84,3 @@ export const checkAvailableTimesErrors = ({
|
|
|
90
84
|
});
|
|
91
85
|
return hasError;
|
|
92
86
|
};
|
|
93
|
-
|
|
94
|
-
export const getTypeHeadItemsFromMenus = (
|
|
95
|
-
menus?: (ProductSet | ProductSetFormValues)[],
|
|
96
|
-
): MenuTypeheadItem[] =>
|
|
97
|
-
menus?.map((menu) => ({ id: menu.id, value: menu.id, label: menu.name }));
|
|
@@ -19,8 +19,8 @@ export function WorkingHoursInputDescription() {
|
|
|
19
19
|
<Col xs="auto">{weekdays[i]}:</Col>
|
|
20
20
|
<Col>
|
|
21
21
|
{t("timeInterval", {
|
|
22
|
-
start: values?.[i]
|
|
23
|
-
end: values?.[i]
|
|
22
|
+
start: values?.[i].start ?? "00:00",
|
|
23
|
+
end: values?.[i].end ?? "23:59",
|
|
24
24
|
})}
|
|
25
25
|
</Col>
|
|
26
26
|
</Row>
|
|
@@ -19,7 +19,6 @@ export const SettingFormComponent: Story<AdminSettingFormProps> = (args) => (
|
|
|
19
19
|
</Container>
|
|
20
20
|
);
|
|
21
21
|
|
|
22
|
-
|
|
23
22
|
export const PaymentFeeFormComponent: Story<PaymentFeeFormProps> = (args) => {
|
|
24
23
|
const form = useForm<PaymentFeeFormFieldValues>({
|
|
25
24
|
defaultValues: args.defaultValues,
|
|
@@ -307,7 +307,6 @@ export function Preview({
|
|
|
307
307
|
productCategoryId: 57,
|
|
308
308
|
productGroupId: null,
|
|
309
309
|
availableQuantity: 980,
|
|
310
|
-
zoneId: null,
|
|
311
310
|
name: "Cofee",
|
|
312
311
|
description: "",
|
|
313
312
|
price: 15,
|
|
@@ -316,8 +315,6 @@ export function Preview({
|
|
|
316
315
|
maxQuantity: 15,
|
|
317
316
|
totalQuantity: 980,
|
|
318
317
|
type: "sale" as const,
|
|
319
|
-
capacity: 0,
|
|
320
|
-
duration: 0,
|
|
321
318
|
weight: 0,
|
|
322
319
|
isAvailable: true,
|
|
323
320
|
isSoldOut: false,
|
|
@@ -336,7 +333,6 @@ export function Preview({
|
|
|
336
333
|
productCategoryId: 57,
|
|
337
334
|
productGroupId: null,
|
|
338
335
|
availableQuantity: 980,
|
|
339
|
-
zoneId: null,
|
|
340
336
|
name: "Cofee 2",
|
|
341
337
|
description: "",
|
|
342
338
|
price: 15,
|
|
@@ -345,8 +341,6 @@ export function Preview({
|
|
|
345
341
|
maxQuantity: 15,
|
|
346
342
|
totalQuantity: 980,
|
|
347
343
|
type: "sale" as const,
|
|
348
|
-
capacity: 0,
|
|
349
|
-
duration: 0,
|
|
350
344
|
weight: 0,
|
|
351
345
|
isAvailable: true,
|
|
352
346
|
isSoldOut: false,
|
|
@@ -33,7 +33,6 @@ export interface SortableTreeItemProps {
|
|
|
33
33
|
body: ReactNode;
|
|
34
34
|
children?: ReactNode;
|
|
35
35
|
preItem?: ReactNode;
|
|
36
|
-
itemButton?: ReactNode;
|
|
37
36
|
postItem?: ReactNode;
|
|
38
37
|
sortableItems?: string[];
|
|
39
38
|
isExpanded?: boolean;
|
|
@@ -83,7 +82,6 @@ export function SortableTreeItem({
|
|
|
83
82
|
secondaryBadge,
|
|
84
83
|
setIsExpanded,
|
|
85
84
|
isOverride,
|
|
86
|
-
itemButton,
|
|
87
85
|
}: SortableTreeItemProps) {
|
|
88
86
|
const [expanded, setExpanded] = useState(isExpanded);
|
|
89
87
|
const [isModalVisible, setIsModalVisible] = useState(isNewAdded);
|
|
@@ -289,13 +287,9 @@ export function SortableTreeItem({
|
|
|
289
287
|
className={clsx(
|
|
290
288
|
"sortable-tree-item-title",
|
|
291
289
|
modalLabel && "sortable-tree-product-set-element-title",
|
|
292
|
-
"d-flex justify-content-between",
|
|
293
290
|
)}
|
|
294
291
|
>
|
|
295
292
|
{title}
|
|
296
|
-
<div className="sortable-tree-item-subtitle">
|
|
297
|
-
{itemButton}
|
|
298
|
-
</div>
|
|
299
293
|
</span>
|
|
300
294
|
{!expanded && (
|
|
301
295
|
<span className="sortable-tree-item-subtitle">
|
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
$base-height: 2.5rem;
|
|
2
2
|
|
|
3
3
|
.button-wrapper {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
background-color: $snippet-page-header-steps-close-button-background-color;
|
|
5
|
+
height: $base-height;
|
|
6
|
+
width: $base-height;
|
|
7
|
+
border-radius: $base-height;
|
|
8
|
+
transition: $color-transition;
|
|
9
|
+
|
|
10
|
+
.back-button {
|
|
11
|
+
font-size: 2rem;
|
|
6
12
|
width: $base-height;
|
|
7
|
-
|
|
13
|
+
height: $base-height;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
font-weight: lighter;
|
|
18
|
+
color: $snippet-page-header-steps-close-button-border-color;
|
|
8
19
|
transition: $color-transition;
|
|
9
20
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
font-size: 2rem;
|
|
13
|
-
width: $base-height;
|
|
14
|
-
height: $base-height;
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
font-weight: lighter;
|
|
19
|
-
color: $snippet-page-header-steps-close-button-border-color;
|
|
20
|
-
transition: $color-transition;
|
|
21
|
-
|
|
22
|
-
&:hover {
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
}
|
|
21
|
+
&:hover {
|
|
22
|
+
cursor: pointer;
|
|
25
23
|
}
|
|
24
|
+
}
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
&.back-button {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
margin-right: 1rem;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "./BackButton.scss";
|
|
1
|
+
@import "./BackButton.scss";
|
|
@@ -33,11 +33,15 @@
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
&.active {
|
|
36
|
-
color: #
|
|
37
|
-
background: linear-gradient(
|
|
36
|
+
color: #0e8ce2;
|
|
37
|
+
background: linear-gradient(
|
|
38
|
+
149.72deg,
|
|
39
|
+
#d9efff 50.04%,
|
|
40
|
+
#e9f4fe 107.75%
|
|
41
|
+
);
|
|
38
42
|
|
|
39
43
|
svg path {
|
|
40
|
-
stroke: #
|
|
44
|
+
stroke: #0e8ce2;
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
}
|
|
@@ -62,4 +66,3 @@
|
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
}
|
|
65
|
-
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "./UserForm.scss";
|
|
1
|
+
@import "./UserForm.scss";
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
font-size: 0.8rem;
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
@include media-breakpoint-up(md) {
|
|
9
9
|
label {
|
|
10
10
|
font-size: 0.9rem;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
@include media-breakpoint-up(lg) {
|
|
15
15
|
label {
|
|
16
16
|
font-size: 1rem;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
flex: 0 0 33.33%;
|
|
29
29
|
max-width: 33.33%;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
@include media-breakpoint-down(xs) {
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
&:first-child {
|
|
44
44
|
padding-left: 0;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
&:last-child {
|
|
48
48
|
padding-right: 0;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
53
|
}
|