@licklist/design 0.58.9 → 0.58.11-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/bitbucket-pipelines.yml +0 -8
- package/dist/assets/iframe/calendar.svg +2 -2
- package/dist/assets/iframe/calendar.svg.js +1 -1
- package/dist/assets/iframe/ticket.svg +2 -2
- package/dist/assets/iframe/ticket.svg.js +1 -1
- package/dist/calendar/Calendar.d.ts +1 -1
- package/dist/calendar/Calendar.d.ts.map +1 -1
- package/dist/calendar/Calendar.js +1 -1
- package/dist/calendar/components/CalendarButtons/CalendarButtons.js +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts +2 -2
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.js +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.js +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts +2 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
- package/dist/iframe/event/event-venue-map/IframeEventVenueMap.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts +2 -2
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.d.ts +4 -2
- package/dist/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.d.ts +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.d.ts +4 -2
- package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +4 -0
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
- package/dist/iframe/page/components/PageBody/constants.d.ts +1 -0
- package/dist/iframe/page/components/PageBody/constants.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/constants.js +1 -1
- package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.js +1 -1
- package/dist/iframe/payment/order-items-table/OrderItemsTable.js +1 -1
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
- package/dist/iframe/payment/payment-form/PaymentForm.js +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.js +1 -1
- package/dist/iframe/payment/payment-page/PaymentTimer.js +1 -1
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.js +1 -1
- package/dist/iframe/ryft/utils/ryft-form.d.ts +5 -0
- package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -0
- package/dist/iframe/ryft/utils/ryft-form.js +1 -0
- package/dist/index.js +1 -1
- package/dist/product-set/card/ProductSetCard.d.ts +2 -1
- package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
- package/dist/product-set/card/ProductSetCard.js +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.js +1 -1
- package/dist/product-set/control/DateInput.d.ts +17 -0
- package/dist/product-set/control/DateInput.d.ts.map +1 -0
- package/dist/product-set/control/DateInput.js +1 -0
- package/dist/product-set/control/ProductSetControl.d.ts +2 -1
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +1 -1
- package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts +11 -0
- package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts.map +1 -0
- package/dist/product-set/control/ProductSetRecurrenceOverridesControl.js +1 -0
- package/dist/product-set/control/TutorialGifCard.d.ts +2 -1
- package/dist/product-set/control/TutorialGifCard.d.ts.map +1 -1
- package/dist/product-set/control/TutorialGifCard.js +1 -1
- package/dist/product-set/form/ProductCategoriesControl.d.ts +2 -1
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts +7 -2
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +1 -1
- package/dist/product-set/form/ProductsControl.d.ts +2 -1
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +1 -1
- package/dist/product-set/form/StepsControl.d.ts +2 -1
- package/dist/product-set/form/StepsControl.d.ts.map +1 -1
- package/dist/product-set/form/StepsControl.js +1 -1
- package/dist/product-set/form/SubProductsControl.d.ts +2 -1
- package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/SubProductsControl.js +1 -1
- package/dist/product-set/form/VenueMapsControl.js +1 -1
- package/dist/product-set/hooks/useSortableTreeFunctions.d.ts +2 -1
- package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
- package/dist/product-set/hooks/useSortableTreeFunctions.js +1 -1
- package/dist/product-set/item/CreateProductSetItem.d.ts +2 -1
- package/dist/product-set/item/CreateProductSetItem.d.ts.map +1 -1
- package/dist/product-set/item/CreateProductSetItem.js +1 -1
- package/dist/product-set/product/ProductControl.d.ts +3 -1
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +1 -1
- package/dist/product-set/product/constants.d.ts +1 -0
- package/dist/product-set/product/constants.d.ts.map +1 -1
- package/dist/product-set/product/constants.js +1 -1
- package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts +4 -2
- package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
- package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.js +1 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.d.ts +1 -0
- package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.js +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.d.ts +3 -1
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
- package/dist/recurring-date-picker-input/DatePickerInput.d.ts +19 -0
- package/dist/recurring-date-picker-input/DatePickerInput.d.ts.map +1 -0
- package/dist/recurring-date-picker-input/DatePickerInput.js +1 -0
- package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts +15 -0
- package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +1 -0
- package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.js +1 -0
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +5 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
- package/dist/recurring-date-picker-input/utils.d.ts +9 -0
- package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/utils.js +1 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +1 -1
- package/dist/sales/notes/NotesTableRow.js +1 -1
- package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
- package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
- package/dist/setting/dashboard/snippets/card/SnippetCard.js +1 -1
- package/dist/snippet/snippet-template/control/PropertyControl.d.ts +3 -1
- package/dist/snippet/snippet-template/control/PropertyControl.d.ts.map +1 -1
- package/dist/snippet/snippet-template/control/PropertyControl.js +1 -1
- package/dist/snippet/snippet-template/preview/Preview.js +1 -1
- package/dist/sortable-list/SortableList.d.ts +2 -1
- package/dist/sortable-list/SortableList.d.ts.map +1 -1
- package/dist/sortable-list/SortableList.js +1 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts +3 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.js +1 -1
- package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
- package/dist/static/manual-date-picker/constants/index.d.ts +4 -1
- package/dist/static/manual-date-picker/constants/index.d.ts.map +1 -1
- package/dist/static/manual-date-picker/constants/index.js +1 -1
- package/dist/static/manual-date-picker/utils/index.d.ts +4 -0
- package/dist/static/manual-date-picker/utils/index.d.ts.map +1 -1
- package/dist/static/manual-date-picker/utils/index.js +1 -1
- package/dist/striped-static-table/StripedStaticTable.js +1 -1
- package/dist/styles/iframe-events/Card.scss +24 -8
- package/dist/styles/iframe-events/PoweredBy.scss +2 -2
- package/dist/styles/iframe-order-process/IframeOrderProcess.scss +57 -20
- package/dist/styles/iframe-page/Page.scss +1 -0
- package/dist/styles/iframe-page/PageBody.scss +34 -12
- package/dist/styles/iframe-page/PageHeader.scss +41 -39
- package/dist/styles/product-set/EditVenueMapSetModal.scss +1 -1
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +125 -2
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/venue-map-sets/form/components/VenueMapImageControl.js +1 -1
- package/dist/zone/form/utils/dates.d.ts.map +1 -1
- package/package.json +10 -35
- package/src/assets/iframe/calendar.svg +2 -2
- package/src/assets/iframe/ticket.svg +2 -2
- package/src/calendar/Calendar.stories.tsx +23 -0
- package/src/calendar/Calendar.tsx +5 -5
- package/src/calendar/components/CalendarDates/CalendarDates.tsx +0 -5
- package/src/iframe/event/event-card/IframeEventCard.stories.tsx +1 -0
- package/src/iframe/event/event-card/IframeEventCard.tsx +7 -8
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.stories.tsx +9 -0
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +58 -7
- package/src/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.tsx +8 -0
- package/src/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.tsx +4 -4
- package/src/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.tsx +63 -10
- package/src/iframe/order-process/components/BookingSummary/types/index.ts +4 -0
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +1 -1
- package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +3 -1
- package/src/iframe/page/components/PageBody/constants.ts +2 -0
- package/src/iframe/page/components/PageBody/hooks/useResizePageBody.ts +10 -0
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +6 -6
- package/src/iframe/payment/payment-page/PaymentPage.stories.tsx +546 -6
- package/src/iframe/payment/payment-page/PaymentPage.tsx +38 -29
- package/src/iframe/ryft/RyftPaymentForm.tsx +11 -5
- package/src/iframe/ryft/utils/ryft-form.ts +47 -0
- package/src/product-set/card/ProductSetCard.tsx +12 -1
- package/src/product-set/control/DateAndRecurrenceInput.tsx +2 -1
- package/src/product-set/control/DateInput.tsx +316 -0
- package/src/product-set/control/ProductSetControl.tsx +46 -24
- package/src/product-set/control/ProductSetRecurrenceOverridesControl.tsx +63 -0
- package/src/product-set/control/TutorialGifCard.tsx +11 -3
- package/src/product-set/form/ProductCategoriesControl.tsx +12 -1
- package/src/product-set/form/ProductSetForm.tsx +10 -1
- package/src/product-set/form/ProductsControl.tsx +10 -0
- package/src/product-set/form/StepsControl.tsx +8 -2
- package/src/product-set/form/SubProductsControl.tsx +3 -0
- package/src/product-set/hooks/useSortableTreeFunctions.ts +6 -0
- package/src/product-set/item/CreateProductSetItem.tsx +3 -0
- package/src/product-set/product/ProductControl.tsx +48 -15
- package/src/product-set/product/constants.ts +1 -0
- package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +8 -2
- package/src/product-set/product/quantity/ProductQuantityControl.tsx +4 -3
- package/src/product-set/product-category/ProductCategoryControl.tsx +116 -50
- package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +4 -18
- package/src/recurring-date-picker-input/DatePickerInput.tsx +93 -0
- package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +136 -0
- package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +15 -2
- package/src/recurring-date-picker-input/utils.ts +75 -0
- package/src/sales/booking/results/BookingResults.stories.tsx +3 -2
- package/src/sales/booking/results/components/ResultCard.tsx +2 -5
- package/src/setting/admin/AdminSettingForm.tsx +2 -2
- package/src/snippet/snippet-template/control/PropertyControl.tsx +6 -2
- package/src/sortable-list/SortableList.tsx +3 -0
- package/src/sortable-tree/SortableTreeItem.tsx +12 -4
- package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
- package/src/static/manual-date-picker/constants/index.ts +6 -2
- package/src/static/manual-date-picker/utils/index.ts +11 -0
- package/src/static/switch/BooleanSwitch.tsx +1 -1
- package/src/styles/iframe-events/Card.scss +24 -8
- package/src/styles/iframe-events/PoweredBy.scss +2 -2
- package/src/styles/iframe-order-process/IframeOrderProcess.scss +57 -20
- package/src/styles/iframe-page/Page.scss +1 -0
- package/src/styles/iframe-page/PageBody.scss +34 -12
- package/src/styles/iframe-page/PageHeader.scss +41 -39
- package/src/styles/product-set/EditVenueMapSetModal.scss +1 -1
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +125 -2
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/zone/form/utils/dates.ts +9 -10
- package/jest.config.js +0 -29
- package/tests/Auth/Authorizer.test.tsx +0 -194
- package/tests/Auth/Layout/UserNavDropDown.test.tsx +0 -43
- package/tests/Auth/Layout/UserNavDropDownToggle.test.tsx +0 -33
- package/tests/Auth/Login/LoginComponent.test.tsx +0 -246
- package/tests/Auth/Login/LoginFormComponent.test.tsx +0 -182
- package/tests/Auth/Register/RegisterComponent.test.tsx +0 -285
- package/tests/Auth/Register/RegisterFormComponent.test.tsx +0 -170
- package/tests/Auth/Settings/Dashboard/IpInput.test.tsx +0 -130
- package/tests/Auth/Social/SocialCallbackComponent.test.tsx +0 -133
- package/tests/Auth/Social/SocialFormComponent.test.tsx +0 -118
- package/tests/FileUpload/FileUpload.test.tsx +0 -42
- package/tests/Notification/EmailTemplate.test.tsx +0 -82
- package/tests/ProductSet/ProductSetPopover.test.tsx +0 -40
- package/tests/Report/Report.test.tsx +0 -48
- package/tests/Sales/Coupon.test.tsx +0 -51
- package/tests/Sales/SalesAndVIews.test.tsx +0 -63
- package/tests/SnippetTemplates/SnippetTemplates.test.tsx +0 -56
- package/tests/Table/FilterHelperComponent.test.tsx +0 -88
- package/tests/Table/PaginationHelperComponent.test.tsx +0 -109
- package/tests/Table/PerPageHelperComponent.test.tsx +0 -34
- package/tests/Table/TableHelperComponent.test.tsx +0 -295
- package/tests/TipTapEditor/TipTapEditor.test.tsx +0 -28
- package/tests/__mock__/hooks/useAuthApi.ts +0 -13
- package/tests/__mock__/hooks/useAuthMock.ts +0 -13
- package/tests/__mock__/hooks/useFormMock.ts +0 -27
- package/tests/__mock__/hooks/useNotificationMock.ts +0 -13
- package/tests/__mock__/hooks/useQueryMock.ts +0 -16
- package/tests/__mock__/hooks/useSocialApiMock.ts +0 -20
- package/tests/__mock__/hooks/useTranslationMock.ts +0 -17
- package/tests/__mock__/hooks/useUserApiMock.ts +0 -18
- package/tests/__mock__/hooks/useUserMock.ts +0 -13
- package/tests/__mock__/styleMock.js +0 -1
- package/tests/__mock__/windowMock.ts +0 -5
- package/tests/packages/react-query.tsx +0 -28
- package/tests/setupTests.ts +0 -10
|
@@ -9,10 +9,14 @@ import { Icon, Image } from "../../static";
|
|
|
9
9
|
|
|
10
10
|
export interface TutorialGifCardProps {
|
|
11
11
|
tutorialAsset?: string;
|
|
12
|
+
isOverrides?: boolean;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
// @TODO: Tutorial GIF asset should be passed as context, which is better
|
|
15
|
-
const TutorialGifCard = ({
|
|
16
|
+
const TutorialGifCard = ({
|
|
17
|
+
tutorialAsset,
|
|
18
|
+
isOverrides,
|
|
19
|
+
}: TutorialGifCardProps) => {
|
|
16
20
|
const { pathname } = useLocation();
|
|
17
21
|
const [isVisible, setIsVisible] = useState(pathname?.includes("/create"));
|
|
18
22
|
const { t } = useTranslation(["Design"]);
|
|
@@ -46,8 +50,12 @@ const TutorialGifCard = ({ tutorialAsset }: TutorialGifCardProps) => {
|
|
|
46
50
|
</button>
|
|
47
51
|
</Card.Header>
|
|
48
52
|
<Card.Body className="tutorial-card-body">
|
|
49
|
-
<p>
|
|
50
|
-
|
|
53
|
+
<p>
|
|
54
|
+
{t(isOverrides ? "buildOverrideProductSet" : "buildProductSet")}
|
|
55
|
+
</p>
|
|
56
|
+
<span>
|
|
57
|
+
{t(isOverrides ? "buildOverrideRules" : "buildProductSetDesc")}
|
|
58
|
+
</span>
|
|
51
59
|
{tutorialAsset && <Image src={tutorialAsset} alt="Tutorial Gif" />}
|
|
52
60
|
</Card.Body>
|
|
53
61
|
</Card>
|
|
@@ -35,6 +35,7 @@ import { useSortableTreeFunctions } from "../hooks/useSortableTreeFunctions";
|
|
|
35
35
|
|
|
36
36
|
interface ProductCategoriesControlProps extends WithIsLoading {
|
|
37
37
|
stepIndex: number;
|
|
38
|
+
isOverrides?: boolean;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
const getCategoryDefaultValue = (
|
|
@@ -65,6 +66,7 @@ const getCategoryDefaultValue = (
|
|
|
65
66
|
export function ProductCategoriesControl({
|
|
66
67
|
isLoading,
|
|
67
68
|
stepIndex,
|
|
69
|
+
isOverrides,
|
|
68
70
|
}: ProductCategoriesControlProps) {
|
|
69
71
|
const { t } = useTranslation("Design");
|
|
70
72
|
const {
|
|
@@ -105,6 +107,7 @@ export function ProductCategoriesControl({
|
|
|
105
107
|
const { edit, saveValidField, cancelChanges } = useSortableTreeFunctions({
|
|
106
108
|
fieldName: productCategoriesFieldName,
|
|
107
109
|
remove,
|
|
110
|
+
isOverrides,
|
|
108
111
|
});
|
|
109
112
|
|
|
110
113
|
const productCategories: ProductCategory[] = useWatch({
|
|
@@ -129,7 +132,7 @@ export function ProductCategoriesControl({
|
|
|
129
132
|
});
|
|
130
133
|
|
|
131
134
|
const handleDragEnd = (event) => {
|
|
132
|
-
|
|
135
|
+
if (isOverrides) return;
|
|
133
136
|
const { active, over } = event;
|
|
134
137
|
|
|
135
138
|
if (!active || !over || !active?.id || !over?.id) return;
|
|
@@ -266,8 +269,10 @@ export function ProductCategoriesControl({
|
|
|
266
269
|
categoryName={value}
|
|
267
270
|
stepIndex={stepIndex}
|
|
268
271
|
productCategoryIndex={index}
|
|
272
|
+
isOverride={isOverrides}
|
|
269
273
|
/>
|
|
270
274
|
}
|
|
275
|
+
isOverride={isOverrides}
|
|
271
276
|
onDelete={() => remove(index)}
|
|
272
277
|
validate={() =>
|
|
273
278
|
trigger(`steps.${stepIndex}.productCategories.${index}`)
|
|
@@ -290,6 +295,7 @@ export function ProductCategoriesControl({
|
|
|
290
295
|
zones={zones}
|
|
291
296
|
productCategoryIndex={index}
|
|
292
297
|
categoryType={productCategory.type}
|
|
298
|
+
isOverrides={isOverrides}
|
|
293
299
|
/>
|
|
294
300
|
</SortableTree.Item>
|
|
295
301
|
)}
|
|
@@ -299,7 +305,9 @@ export function ProductCategoriesControl({
|
|
|
299
305
|
</SortableTree>
|
|
300
306
|
<CreateProductSetItem
|
|
301
307
|
title={t("addCategory")}
|
|
308
|
+
isOverride={isOverrides}
|
|
302
309
|
onClick={() => {
|
|
310
|
+
if (isOverrides) return;
|
|
303
311
|
setIsSelectCategoryVisible(true);
|
|
304
312
|
}}
|
|
305
313
|
/>
|
|
@@ -308,6 +316,7 @@ export function ProductCategoriesControl({
|
|
|
308
316
|
isVisible={isSelectCategoryVisible}
|
|
309
317
|
onHide={() => setIsSelectCategoryVisible(false)}
|
|
310
318
|
onCategorySelect={(categoryType) => {
|
|
319
|
+
if (isOverrides) return;
|
|
311
320
|
append(getCategoryDefaultValue(categoryType, fields.length));
|
|
312
321
|
setShowCategoryModal(true);
|
|
313
322
|
if (
|
|
@@ -321,7 +330,9 @@ export function ProductCategoriesControl({
|
|
|
321
330
|
<>
|
|
322
331
|
<CreateProductSetItem
|
|
323
332
|
title={t("editMap")}
|
|
333
|
+
isOverride={isOverrides}
|
|
324
334
|
onClick={() => {
|
|
335
|
+
if (isOverrides) return;
|
|
325
336
|
setIsVenueMapSetModalVisible(true);
|
|
326
337
|
}}
|
|
327
338
|
className={clsx(
|
|
@@ -26,14 +26,19 @@ import { checkAvailableTimesErrors, getFilteredTemplates } from "../utils";
|
|
|
26
26
|
export interface WithIsLoading {
|
|
27
27
|
isLoading: boolean;
|
|
28
28
|
}
|
|
29
|
+
export interface WithIdOptional {
|
|
30
|
+
id?: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
29
33
|
export interface WithId {
|
|
30
34
|
id: number;
|
|
31
35
|
}
|
|
32
36
|
export interface ProductSetFormValues
|
|
33
37
|
extends FormValues,
|
|
34
|
-
|
|
38
|
+
WithIdOptional,
|
|
35
39
|
ProductSetControlValues {
|
|
36
40
|
steps: Step[];
|
|
41
|
+
isOverrides?: boolean;
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
export interface ProductSetFormProps
|
|
@@ -50,6 +55,7 @@ export interface ProductSetFormProps
|
|
|
50
55
|
providerHasBookingManagement?: ProviderBookingManagementSetting["hasBookingManagement"];
|
|
51
56
|
zones?: Zone[] | null;
|
|
52
57
|
isCreateAction?: boolean;
|
|
58
|
+
isOverrides?: boolean;
|
|
53
59
|
workHours?: WorkHour[];
|
|
54
60
|
}
|
|
55
61
|
|
|
@@ -67,6 +73,7 @@ export function ProductSetForm({
|
|
|
67
73
|
zones,
|
|
68
74
|
isCreateAction,
|
|
69
75
|
workHours,
|
|
76
|
+
isOverrides,
|
|
70
77
|
...shared
|
|
71
78
|
}: ProductSetFormProps) {
|
|
72
79
|
const { t } = useTranslation("Design");
|
|
@@ -84,6 +91,7 @@ export function ProductSetForm({
|
|
|
84
91
|
});
|
|
85
92
|
|
|
86
93
|
const { setError, reset } = form;
|
|
94
|
+
|
|
87
95
|
const formValues = form.watch();
|
|
88
96
|
|
|
89
97
|
const submitHandler = (onSubmit: (values: ProductSetFormValues) => void) => {
|
|
@@ -161,6 +169,7 @@ export function ProductSetForm({
|
|
|
161
169
|
companyName={companyName}
|
|
162
170
|
workHours={workHours}
|
|
163
171
|
providerHasBookingManagement={providerHasBookingManagement}
|
|
172
|
+
isOverrides={isOverrides}
|
|
164
173
|
/>
|
|
165
174
|
<Row>
|
|
166
175
|
<Col md={6} sm={12} />
|
|
@@ -34,6 +34,7 @@ interface ProductsControlProps extends WithIsLoading {
|
|
|
34
34
|
hasTicket?: boolean;
|
|
35
35
|
categoryType: CategoryType;
|
|
36
36
|
zones?: Zone[];
|
|
37
|
+
isOverrides?: boolean;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
const getDefaultProductValue = (sort: number): Product => ({
|
|
@@ -77,6 +78,7 @@ export function ProductsControl({
|
|
|
77
78
|
hasTicket,
|
|
78
79
|
categoryType,
|
|
79
80
|
zones,
|
|
81
|
+
isOverrides,
|
|
80
82
|
}: ProductsControlProps) {
|
|
81
83
|
const { t } = useTranslation("Design");
|
|
82
84
|
const form = useFormContext<ProductSetFormValues>();
|
|
@@ -112,6 +114,7 @@ export function ProductsControl({
|
|
|
112
114
|
const { edit, saveValidField, cancelChanges } = useSortableTreeFunctions({
|
|
113
115
|
fieldName: productControlFieldName,
|
|
114
116
|
remove,
|
|
117
|
+
isOverrides,
|
|
115
118
|
});
|
|
116
119
|
|
|
117
120
|
const allowDeposits = watch(
|
|
@@ -159,6 +162,7 @@ export function ProductsControl({
|
|
|
159
162
|
});
|
|
160
163
|
|
|
161
164
|
const handleDragEnd = (_event) => {
|
|
165
|
+
if (isOverrides) return;
|
|
162
166
|
const { active, over } = _event;
|
|
163
167
|
|
|
164
168
|
if (!active || !over || !active?.id || !over?.id) return;
|
|
@@ -176,6 +180,7 @@ export function ProductsControl({
|
|
|
176
180
|
};
|
|
177
181
|
|
|
178
182
|
const onProductRemove = (index: number) => {
|
|
183
|
+
if (isOverrides) return;
|
|
179
184
|
const currentProduct = getValues(
|
|
180
185
|
`${productControlFieldName}.${index}` as const
|
|
181
186
|
);
|
|
@@ -215,10 +220,12 @@ export function ProductsControl({
|
|
|
215
220
|
isExpanded={isFirstProductAdded}
|
|
216
221
|
isInvalid={!!categoryProductErrors}
|
|
217
222
|
title={value}
|
|
223
|
+
isOverride={isOverrides}
|
|
218
224
|
badge={<Badge className="product-badge">{t("product")}</Badge>}
|
|
219
225
|
isIconInHeader={false}
|
|
220
226
|
cancelChanges={() => cancelChanges(index)}
|
|
221
227
|
edit={() => edit(index)}
|
|
228
|
+
isProduct
|
|
222
229
|
secondaryBadge={getBadgeConfig(categoryType, t(categoryType))}
|
|
223
230
|
subTitle={
|
|
224
231
|
<div className="product-set-badges-container">
|
|
@@ -255,6 +262,7 @@ export function ProductsControl({
|
|
|
255
262
|
hasTicket={hasTicket}
|
|
256
263
|
categoryType={categoryType}
|
|
257
264
|
zoneDuration={catergoryZone?.defaultDuration}
|
|
265
|
+
isOverrides={isOverrides}
|
|
258
266
|
/>
|
|
259
267
|
}
|
|
260
268
|
onDelete={() => onProductRemove(index)}
|
|
@@ -276,7 +284,9 @@ export function ProductsControl({
|
|
|
276
284
|
</SortableTree>
|
|
277
285
|
<CreateProductSetItem
|
|
278
286
|
title={t("addProduct")}
|
|
287
|
+
isOverride={isOverrides}
|
|
279
288
|
onClick={() => {
|
|
289
|
+
if (isOverrides) return;
|
|
280
290
|
append(getDefaultProductValue(fields.length));
|
|
281
291
|
setShowProductModal(true);
|
|
282
292
|
|
|
@@ -18,9 +18,10 @@ import { ProductSetFormValues } from "./ProductSetForm";
|
|
|
18
18
|
|
|
19
19
|
interface StepsControlProps {
|
|
20
20
|
isLoading: boolean;
|
|
21
|
+
isOverrides?: boolean;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
export function StepsControl({ isLoading }: StepsControlProps) {
|
|
24
|
+
export function StepsControl({ isLoading, isOverrides }: StepsControlProps) {
|
|
24
25
|
const form = useFormContext<ProductSetFormValues>();
|
|
25
26
|
const { t } = useTranslation("Design");
|
|
26
27
|
const [showStepModal, setShowStepModal] = useState(false);
|
|
@@ -42,6 +43,7 @@ export function StepsControl({ isLoading }: StepsControlProps) {
|
|
|
42
43
|
const { edit, saveValidField, cancelChanges } = useSortableTreeFunctions({
|
|
43
44
|
fieldName: "steps",
|
|
44
45
|
remove,
|
|
46
|
+
isOverrides,
|
|
45
47
|
});
|
|
46
48
|
|
|
47
49
|
useEffect(() => {
|
|
@@ -90,8 +92,9 @@ export function StepsControl({ isLoading }: StepsControlProps) {
|
|
|
90
92
|
modalLabel={t("addNewStep")}
|
|
91
93
|
modalClass={ProductSetModalClasses.step}
|
|
92
94
|
isNewAdded={showStepModal}
|
|
93
|
-
edit={() => edit(index)}
|
|
95
|
+
edit={() => !isOverrides && edit(index)}
|
|
94
96
|
cancelChanges={() => cancelChanges(index)}
|
|
97
|
+
isOverride={isOverrides}
|
|
95
98
|
subTitle={
|
|
96
99
|
<div className="product-set-badges-container">
|
|
97
100
|
<div className="product-set-subtitle-dot product-set-subtitle-step-dot" />
|
|
@@ -136,6 +139,7 @@ export function StepsControl({ isLoading }: StepsControlProps) {
|
|
|
136
139
|
<ProductCategoriesControl
|
|
137
140
|
isLoading={isLoading}
|
|
138
141
|
stepIndex={index}
|
|
142
|
+
isOverrides={isOverrides}
|
|
139
143
|
/>
|
|
140
144
|
</SortableTree.Item>
|
|
141
145
|
)}
|
|
@@ -145,7 +149,9 @@ export function StepsControl({ isLoading }: StepsControlProps) {
|
|
|
145
149
|
|
|
146
150
|
<CreateProductSetItem
|
|
147
151
|
title={t("addStep")}
|
|
152
|
+
isOverride={isOverrides}
|
|
148
153
|
onClick={() => {
|
|
154
|
+
if (isOverrides) return;
|
|
149
155
|
append(getDefaultStepsValues());
|
|
150
156
|
setShowStepModal(true);
|
|
151
157
|
if (errors.steps?.type === HookFormService.manualErrorType) {
|
|
@@ -15,6 +15,7 @@ interface SubProductsControlProps {
|
|
|
15
15
|
productCategoryIndex: number;
|
|
16
16
|
productIndex: number;
|
|
17
17
|
isLoading: boolean;
|
|
18
|
+
isOverrides?: boolean;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export function SubProductsControl({
|
|
@@ -23,6 +24,7 @@ export function SubProductsControl({
|
|
|
23
24
|
stepIndex,
|
|
24
25
|
productCategoryIndex,
|
|
25
26
|
productIndex,
|
|
27
|
+
isOverrides,
|
|
26
28
|
}: SubProductsControlProps) {
|
|
27
29
|
const form = useFormContext<ProductSetFormValues>();
|
|
28
30
|
const { fields, append } = useFieldArray({
|
|
@@ -49,6 +51,7 @@ export function SubProductsControl({
|
|
|
49
51
|
key={`sub-product-${subProduct.id}-${index}`}
|
|
50
52
|
id={subProduct.id}
|
|
51
53
|
title={subProduct.name}
|
|
54
|
+
isOverride={isOverrides}
|
|
52
55
|
body={
|
|
53
56
|
<ProductControl<ProductSetFormValues>
|
|
54
57
|
isLoading={isLoading}
|
|
@@ -4,24 +4,30 @@ import { useFormContext } from "react-hook-form";
|
|
|
4
4
|
interface useSortableTreeFunctionsProps {
|
|
5
5
|
fieldName: string;
|
|
6
6
|
remove: (index?: number | number[]) => void;
|
|
7
|
+
isOverrides?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export const useSortableTreeFunctions = ({
|
|
9
10
|
fieldName,
|
|
10
11
|
remove,
|
|
12
|
+
isOverrides,
|
|
11
13
|
}: useSortableTreeFunctionsProps) => {
|
|
12
14
|
const { getValues, setValue } = useFormContext();
|
|
13
15
|
const [previousValue, setEditValue] = useState(null);
|
|
14
16
|
|
|
15
17
|
const edit = (index: number) => {
|
|
18
|
+
if (isOverrides) return;
|
|
16
19
|
const currentCategoryProduct = getValues(`${fieldName}.${index}` as const);
|
|
17
20
|
const cloneCategoryProduct = structuredClone(currentCategoryProduct);
|
|
18
21
|
setEditValue(cloneCategoryProduct);
|
|
19
22
|
};
|
|
20
23
|
|
|
21
24
|
const cancelChanges = (index: number) => {
|
|
25
|
+
if (isOverrides) return;
|
|
22
26
|
if (!previousValue) {
|
|
27
|
+
// eslint-disable-next-line consistent-return
|
|
23
28
|
return remove(index);
|
|
24
29
|
}
|
|
30
|
+
// eslint-disable-next-line consistent-return
|
|
25
31
|
return setValue(`${fieldName}.${index}` as const, previousValue);
|
|
26
32
|
};
|
|
27
33
|
|
|
@@ -6,18 +6,21 @@ interface CreateProductSetItemProps {
|
|
|
6
6
|
onClick: () => void;
|
|
7
7
|
title: string;
|
|
8
8
|
className?: string;
|
|
9
|
+
isOverride?: boolean;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export function CreateProductSetItem({
|
|
12
13
|
onClick,
|
|
13
14
|
title,
|
|
14
15
|
className,
|
|
16
|
+
isOverride,
|
|
15
17
|
}: CreateProductSetItemProps) {
|
|
16
18
|
return (
|
|
17
19
|
<button
|
|
18
20
|
className={clsx(
|
|
19
21
|
"product-set-item-wrapper w-100",
|
|
20
22
|
`product-set-item-wrapper-${title.toLowerCase().split(" ")[1]}`,
|
|
23
|
+
isOverride && "bg-light",
|
|
21
24
|
className
|
|
22
25
|
)}
|
|
23
26
|
onClick={onClick}
|
|
@@ -7,8 +7,12 @@ import {
|
|
|
7
7
|
QUANTITY_TYPE_LIST_DTO,
|
|
8
8
|
QUANTITY_TYPE_RECHARGING,
|
|
9
9
|
} from "@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
ProductType,
|
|
12
|
+
PRODUCT_DEfAULT_COLORS,
|
|
13
|
+
} from "@licklist/core/dist/DataMapper/Product/ProductDataMapper";
|
|
11
14
|
import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
|
|
15
|
+
import clsx from "clsx";
|
|
12
16
|
import {
|
|
13
17
|
FieldNamePrefixPath,
|
|
14
18
|
FormValues,
|
|
@@ -35,6 +39,7 @@ import {
|
|
|
35
39
|
} from "react-hook-form";
|
|
36
40
|
import { useTranslation } from "react-i18next";
|
|
37
41
|
import { useImages } from "@licklist/plugins/dist/hooks/Media/useImages";
|
|
42
|
+
|
|
38
43
|
import {
|
|
39
44
|
Image,
|
|
40
45
|
IMAGE_TYPE_IMAGE,
|
|
@@ -59,6 +64,7 @@ import {
|
|
|
59
64
|
ProductQuantityControl,
|
|
60
65
|
ProductQuantityRechargingControl,
|
|
61
66
|
} from "./quantity";
|
|
67
|
+
import { PropertyControl } from "../../snippet";
|
|
62
68
|
import { TipTapEditor } from "../../tiptap-editor";
|
|
63
69
|
import { IsDeletableEvent } from "../types";
|
|
64
70
|
import { FixedDurationOptions } from "./fixed-duration-fields";
|
|
@@ -98,6 +104,7 @@ export interface ProductControlValues
|
|
|
98
104
|
offset: number;
|
|
99
105
|
serviceTime: number;
|
|
100
106
|
sort: number | null;
|
|
107
|
+
color?: string;
|
|
101
108
|
}
|
|
102
109
|
|
|
103
110
|
export interface ProductControlProps<T>
|
|
@@ -113,6 +120,7 @@ export interface ProductControlProps<T>
|
|
|
113
120
|
productName: string;
|
|
114
121
|
hasTicket?: boolean;
|
|
115
122
|
categoryType?: CategoryType;
|
|
123
|
+
isOverrides?: boolean;
|
|
116
124
|
zoneDuration?: number;
|
|
117
125
|
}
|
|
118
126
|
|
|
@@ -128,6 +136,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
128
136
|
hasTicket,
|
|
129
137
|
categoryType,
|
|
130
138
|
zoneDuration,
|
|
139
|
+
isOverrides = false,
|
|
131
140
|
}: ProductControlProps<T>) {
|
|
132
141
|
const {
|
|
133
142
|
register,
|
|
@@ -141,7 +150,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
141
150
|
} = useFormContext<T>();
|
|
142
151
|
|
|
143
152
|
const { setLoading } = useContext(ProductSetLoadingContext);
|
|
144
|
-
const { t } = useTranslation(["Design", "Validation"]);
|
|
153
|
+
const { t } = useTranslation(["Design", "Validation", "ProductSet"]);
|
|
145
154
|
const [expanded, setExpanded] = useState(false);
|
|
146
155
|
const [initialImages, setInitialImages] = useState<Image[] | null>(null);
|
|
147
156
|
// @TODO: After checking "isUnlimited" checkbox need to reset field totalQuantity
|
|
@@ -260,7 +269,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
260
269
|
`${fieldNamePrefix}.name` as Path<T>,
|
|
261
270
|
errors
|
|
262
271
|
)}
|
|
263
|
-
disabled={isLoading}
|
|
272
|
+
disabled={isLoading || isOverrides}
|
|
264
273
|
placeholder={t("name")}
|
|
265
274
|
/>
|
|
266
275
|
<Form.Control.Feedback type="invalid">
|
|
@@ -280,7 +289,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
280
289
|
viewMode={false}
|
|
281
290
|
onUpdate={onChange}
|
|
282
291
|
content={value as string}
|
|
283
|
-
disabled={isLoading}
|
|
292
|
+
disabled={isLoading || isOverrides}
|
|
284
293
|
/>
|
|
285
294
|
)}
|
|
286
295
|
rules={{
|
|
@@ -326,6 +335,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
326
335
|
<ProductQuantityControl<T>
|
|
327
336
|
isLoading={isLoading}
|
|
328
337
|
fieldNamePrefix={fieldNamePrefix}
|
|
338
|
+
isOverrides={isOverrides}
|
|
329
339
|
onFocus={onFocus}
|
|
330
340
|
/>
|
|
331
341
|
|
|
@@ -370,7 +380,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
370
380
|
`${fieldNamePrefix}.quantitySelector` as Path<T>,
|
|
371
381
|
errors
|
|
372
382
|
)}
|
|
373
|
-
disabled={isLoading || hasTicket}
|
|
383
|
+
disabled={isLoading || hasTicket || isOverrides}
|
|
374
384
|
>
|
|
375
385
|
{quantitySelectorList.map((selector) => (
|
|
376
386
|
<option value={selector.id} key={selector.id}>
|
|
@@ -385,6 +395,14 @@ export function ProductControl<T extends FormValues>({
|
|
|
385
395
|
)}
|
|
386
396
|
</Form.Control.Feedback>
|
|
387
397
|
</Form.Group>
|
|
398
|
+
|
|
399
|
+
<PropertyControl<T>
|
|
400
|
+
item={`${fieldNamePrefix}.color` as Path<T>}
|
|
401
|
+
label={t("ProductSet:selectColor")}
|
|
402
|
+
isDisabled={isOverrides}
|
|
403
|
+
isRequired={false}
|
|
404
|
+
defaultColors={PRODUCT_DEfAULT_COLORS}
|
|
405
|
+
/>
|
|
388
406
|
</Col>
|
|
389
407
|
</Row>
|
|
390
408
|
|
|
@@ -392,13 +410,14 @@ export function ProductControl<T extends FormValues>({
|
|
|
392
410
|
<Row className="align-items-start duration-capacity-container">
|
|
393
411
|
<ProductDurationControl
|
|
394
412
|
fieldNamePrefix={fieldNamePrefix}
|
|
395
|
-
disabled={disabledDuration}
|
|
413
|
+
disabled={disabledDuration || isOverrides}
|
|
396
414
|
/>
|
|
397
415
|
|
|
398
416
|
<Col lg={4} md={4}>
|
|
399
417
|
<FormNumberInput
|
|
400
418
|
fieldName={`${fieldNamePrefix}.capacity`}
|
|
401
419
|
label={t("capacity")}
|
|
420
|
+
disabled={isOverrides}
|
|
402
421
|
rules={{
|
|
403
422
|
min: {
|
|
404
423
|
value: 0,
|
|
@@ -426,6 +445,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
426
445
|
fieldName={`${fieldNamePrefix}.capacity`}
|
|
427
446
|
label={t("capacity")}
|
|
428
447
|
onChange={onChangeGameCapacity}
|
|
448
|
+
disabled={isOverrides}
|
|
429
449
|
rules={{
|
|
430
450
|
min: {
|
|
431
451
|
value: 0,
|
|
@@ -441,7 +461,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
441
461
|
<FormNumberInput
|
|
442
462
|
fieldName={`${fieldNamePrefix}.duration`}
|
|
443
463
|
label={t("durationMinutes")}
|
|
444
|
-
disabled={disabledDuration}
|
|
464
|
+
disabled={disabledDuration || isOverrides}
|
|
445
465
|
rules={{
|
|
446
466
|
min: {
|
|
447
467
|
value: 0,
|
|
@@ -487,7 +507,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
487
507
|
`${fieldNamePrefix}.termsAndConditions` as Path<T>,
|
|
488
508
|
errors
|
|
489
509
|
)}
|
|
490
|
-
disabled={isLoading}
|
|
510
|
+
disabled={isLoading || isOverrides}
|
|
491
511
|
name={name}
|
|
492
512
|
/>
|
|
493
513
|
)}
|
|
@@ -504,7 +524,14 @@ export function ProductControl<T extends FormValues>({
|
|
|
504
524
|
</Form.Group>
|
|
505
525
|
</Col>
|
|
506
526
|
|
|
507
|
-
<Col
|
|
527
|
+
<Col
|
|
528
|
+
lg={4}
|
|
529
|
+
md={4}
|
|
530
|
+
className={clsx(
|
|
531
|
+
"licklist-file-upload-wrapper",
|
|
532
|
+
isOverrides && "opacity-50"
|
|
533
|
+
)}
|
|
534
|
+
>
|
|
508
535
|
<FileUpload
|
|
509
536
|
onFilesChange={onFilesChange}
|
|
510
537
|
allowedExtensions={["jpeg", "jpg", "png"]}
|
|
@@ -513,6 +540,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
513
540
|
onFileRemove={onImageRemove}
|
|
514
541
|
defaultFiles={images}
|
|
515
542
|
isLoading={isImageUploading}
|
|
543
|
+
disabled={isOverrides}
|
|
516
544
|
withIcon
|
|
517
545
|
title={t("addImage")}
|
|
518
546
|
/>
|
|
@@ -533,7 +561,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
533
561
|
name={name}
|
|
534
562
|
value={Boolean(value)}
|
|
535
563
|
onChange={onChange}
|
|
536
|
-
disabled={isLoading}
|
|
564
|
+
disabled={isLoading || isOverrides}
|
|
537
565
|
/>
|
|
538
566
|
);
|
|
539
567
|
}}
|
|
@@ -568,7 +596,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
568
596
|
custom
|
|
569
597
|
type="checkbox"
|
|
570
598
|
name={advancedId}
|
|
571
|
-
disabled={isLoading}
|
|
599
|
+
disabled={isLoading || isOverrides}
|
|
572
600
|
>
|
|
573
601
|
<Form.Check.Input
|
|
574
602
|
checked={expanded}
|
|
@@ -595,7 +623,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
595
623
|
name={name}
|
|
596
624
|
value={Boolean(value)}
|
|
597
625
|
onChange={onChange}
|
|
598
|
-
disabled={isLoading}
|
|
626
|
+
disabled={isLoading || isOverrides}
|
|
599
627
|
/>
|
|
600
628
|
)}
|
|
601
629
|
control={control}
|
|
@@ -615,7 +643,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
615
643
|
name={name}
|
|
616
644
|
value={Boolean(value)}
|
|
617
645
|
onChange={onChange}
|
|
618
|
-
disabled={isLoading}
|
|
646
|
+
disabled={isLoading || isOverrides}
|
|
619
647
|
/>
|
|
620
648
|
)}
|
|
621
649
|
control={control}
|
|
@@ -624,7 +652,12 @@ export function ProductControl<T extends FormValues>({
|
|
|
624
652
|
</Form.Group>
|
|
625
653
|
{[CATEGORY_TYPE_GAME, CATEGORY_TYPE_FIXED_DURATION].includes(
|
|
626
654
|
categoryType
|
|
627
|
-
) &&
|
|
655
|
+
) && (
|
|
656
|
+
<FixedDurationOptions
|
|
657
|
+
fieldNamePrefix={fieldNamePrefix}
|
|
658
|
+
isOverrides={isOverrides}
|
|
659
|
+
/>
|
|
660
|
+
)}
|
|
628
661
|
<Form.Group
|
|
629
662
|
controlId={minSpendId}
|
|
630
663
|
className="advanced-switch-container"
|
|
@@ -634,7 +667,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
634
667
|
isRequired={false}
|
|
635
668
|
isMoreThanZero
|
|
636
669
|
allowDeposits={false}
|
|
637
|
-
isLoading={isLoading}
|
|
670
|
+
isLoading={isLoading || isOverrides}
|
|
638
671
|
fieldNamePrefix={`${fieldNamePrefix}.minSpend` as Path<T>}
|
|
639
672
|
/>
|
|
640
673
|
</Form.Group>
|
|
@@ -5,10 +5,13 @@ import { FieldNamePrefixPath } from "@licklist/plugins/dist/types/services/Form/
|
|
|
5
5
|
import { useWatch } from "react-hook-form";
|
|
6
6
|
import { FormNumberInput } from "../../../static";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface FixedDurationOptionsProps<T> extends FieldNamePrefixPath<T> {
|
|
9
|
+
isOverrides?: boolean;
|
|
10
|
+
}
|
|
9
11
|
|
|
10
12
|
export const FixedDurationOptions = <T,>({
|
|
11
13
|
fieldNamePrefix,
|
|
14
|
+
isOverrides,
|
|
12
15
|
}: FixedDurationOptionsProps<T>) => {
|
|
13
16
|
const { t } = useTranslation("Design");
|
|
14
17
|
|
|
@@ -21,6 +24,7 @@ export const FixedDurationOptions = <T,>({
|
|
|
21
24
|
<FormNumberInput
|
|
22
25
|
fieldName={`${fieldNamePrefix}.subSlots`}
|
|
23
26
|
label={t("subSlotsInMin")}
|
|
27
|
+
disabled={isOverrides}
|
|
24
28
|
/>
|
|
25
29
|
</Col>
|
|
26
30
|
|
|
@@ -28,7 +32,7 @@ export const FixedDurationOptions = <T,>({
|
|
|
28
32
|
<FormNumberInput
|
|
29
33
|
fieldName={`${fieldNamePrefix}.pause`}
|
|
30
34
|
label={t("pauseInMin")}
|
|
31
|
-
disabled={!subSlotsFieldValue}
|
|
35
|
+
disabled={!subSlotsFieldValue || isOverrides}
|
|
32
36
|
/>
|
|
33
37
|
</Col>
|
|
34
38
|
</Row>
|
|
@@ -38,6 +42,7 @@ export const FixedDurationOptions = <T,>({
|
|
|
38
42
|
<FormNumberInput
|
|
39
43
|
fieldName={`${fieldNamePrefix}.offset`}
|
|
40
44
|
label={t("offsetInMin")}
|
|
45
|
+
disabled={isOverrides}
|
|
41
46
|
/>
|
|
42
47
|
</Col>
|
|
43
48
|
|
|
@@ -45,6 +50,7 @@ export const FixedDurationOptions = <T,>({
|
|
|
45
50
|
<FormNumberInput
|
|
46
51
|
fieldName={`${fieldNamePrefix}.serviceTime`}
|
|
47
52
|
label={t("serviceTimeInMin")}
|
|
53
|
+
disabled={isOverrides}
|
|
48
54
|
/>
|
|
49
55
|
</Col>
|
|
50
56
|
</Row>
|
|
@@ -22,12 +22,13 @@ export interface ProductQuantityControlValues extends FormValues {
|
|
|
22
22
|
export interface ProductQuantityControlProps<T> extends FieldNamePrefixPath<T> {
|
|
23
23
|
isLoading: boolean;
|
|
24
24
|
onFocus?: (e: React.SyntheticEvent) => void;
|
|
25
|
+
isOverrides?: boolean;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export function ProductQuantityControl<T extends FormValues>(
|
|
28
29
|
props: ProductQuantityControlProps<T>
|
|
29
30
|
) {
|
|
30
|
-
const { isLoading = false, fieldNamePrefix, onFocus } = props;
|
|
31
|
+
const { isLoading = false, fieldNamePrefix, onFocus, isOverrides } = props;
|
|
31
32
|
const {
|
|
32
33
|
control,
|
|
33
34
|
formState: { errors },
|
|
@@ -90,7 +91,7 @@ export function ProductQuantityControl<T extends FormValues>(
|
|
|
90
91
|
isInvalid={
|
|
91
92
|
Number(minQuantityValue) > Number(maxQuantityValue)
|
|
92
93
|
}
|
|
93
|
-
disabled={isLoading}
|
|
94
|
+
disabled={isLoading || isOverrides}
|
|
94
95
|
/>
|
|
95
96
|
)}
|
|
96
97
|
control={control}
|
|
@@ -148,7 +149,7 @@ export function ProductQuantityControl<T extends FormValues>(
|
|
|
148
149
|
isInvalid={
|
|
149
150
|
Number(minQuantityValue) > Number(maxQuantityValue)
|
|
150
151
|
}
|
|
151
|
-
disabled={isLoading}
|
|
152
|
+
disabled={isLoading || isOverrides}
|
|
152
153
|
/>
|
|
153
154
|
)}
|
|
154
155
|
control={control}
|