@licklist/design 0.58.4-dev.1 → 0.58.4

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.
Files changed (135) hide show
  1. package/dist/iframe/event/event-card/IframeEventCard.d.ts +1 -2
  2. package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
  3. package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
  4. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
  5. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
  6. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  7. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +1 -1
  8. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
  9. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
  10. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
  11. package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/product-set/card/ProductSetCard.d.ts +1 -2
  14. package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
  15. package/dist/product-set/card/ProductSetCard.js +1 -1
  16. package/dist/product-set/control/ProductSetControl.d.ts +1 -2
  17. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  18. package/dist/product-set/control/ProductSetControl.js +1 -1
  19. package/dist/product-set/control/TutorialGifCard.d.ts +1 -2
  20. package/dist/product-set/control/TutorialGifCard.d.ts.map +1 -1
  21. package/dist/product-set/control/TutorialGifCard.js +1 -1
  22. package/dist/product-set/form/ProductCategoriesControl.d.ts +1 -2
  23. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  24. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  25. package/dist/product-set/form/ProductSetForm.d.ts +2 -7
  26. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  27. package/dist/product-set/form/ProductSetForm.js +1 -1
  28. package/dist/product-set/form/ProductsControl.d.ts +1 -2
  29. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  30. package/dist/product-set/form/ProductsControl.js +1 -1
  31. package/dist/product-set/form/StepsControl.d.ts +1 -2
  32. package/dist/product-set/form/StepsControl.d.ts.map +1 -1
  33. package/dist/product-set/form/StepsControl.js +1 -1
  34. package/dist/product-set/form/SubProductsControl.d.ts +1 -2
  35. package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
  36. package/dist/product-set/form/SubProductsControl.js +1 -1
  37. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts +1 -2
  38. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
  39. package/dist/product-set/hooks/useSortableTreeFunctions.js +1 -1
  40. package/dist/product-set/item/CreateProductSetItem.d.ts +1 -2
  41. package/dist/product-set/item/CreateProductSetItem.d.ts.map +1 -1
  42. package/dist/product-set/item/CreateProductSetItem.js +1 -1
  43. package/dist/product-set/product/ProductControl.d.ts +1 -2
  44. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  45. package/dist/product-set/product/ProductControl.js +1 -1
  46. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts +2 -4
  47. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
  48. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.js +1 -1
  49. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts +0 -1
  50. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
  51. package/dist/product-set/product/quantity/ProductQuantityControl.js +1 -1
  52. package/dist/product-set/product-category/ProductCategoryControl.d.ts +1 -2
  53. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  54. package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
  55. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +0 -2
  56. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
  57. package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
  58. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  59. package/dist/sortable-list/SortableList.d.ts +1 -2
  60. package/dist/sortable-list/SortableList.d.ts.map +1 -1
  61. package/dist/sortable-list/SortableList.js +1 -1
  62. package/dist/sortable-tree/SortableTreeItem.d.ts +1 -3
  63. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  64. package/dist/sortable-tree/SortableTreeItem.js +1 -1
  65. package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
  66. package/dist/static/manual-date-picker/constants/index.d.ts +1 -4
  67. package/dist/static/manual-date-picker/constants/index.d.ts.map +1 -1
  68. package/dist/static/manual-date-picker/constants/index.js +1 -1
  69. package/dist/static/manual-date-picker/utils/index.d.ts +0 -4
  70. package/dist/static/manual-date-picker/utils/index.d.ts.map +1 -1
  71. package/dist/static/manual-date-picker/utils/index.js +1 -1
  72. package/dist/styles/availability-indicator/AvailabilityIndicator.scss +0 -10
  73. package/dist/styles/iframe-events/Card.scss +8 -24
  74. package/dist/styles/iframe-events/PoweredBy.scss +2 -2
  75. package/dist/styles/iframe-order-process/IframeOrderProcess.scss +2 -0
  76. package/dist/styles/iframe-page/Page.scss +0 -1
  77. package/dist/styles/iframe-page/PageBody.scss +11 -32
  78. package/dist/styles/iframe-page/PageHeader.scss +39 -41
  79. package/dist/styles/product-set/EditVenueMapSetModal.scss +1 -1
  80. package/dist/styles/sales/BookingResults.scss +1 -1
  81. package/package.json +3 -3
  82. package/src/calendar/Calendar.stories.tsx +2 -9
  83. package/src/iframe/event/event-card/IframeEventCard.stories.tsx +0 -1
  84. package/src/iframe/event/event-card/IframeEventCard.tsx +8 -7
  85. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +10 -30
  86. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +12 -8
  87. package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +1 -3
  88. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -6
  89. package/src/product-set/card/ProductSetCard.tsx +1 -10
  90. package/src/product-set/control/ProductSetControl.tsx +24 -46
  91. package/src/product-set/control/TutorialGifCard.tsx +3 -11
  92. package/src/product-set/form/ProductCategoriesControl.tsx +1 -12
  93. package/src/product-set/form/ProductSetForm.tsx +1 -10
  94. package/src/product-set/form/ProductsControl.tsx +0 -10
  95. package/src/product-set/form/StepsControl.tsx +2 -8
  96. package/src/product-set/form/SubProductsControl.tsx +0 -3
  97. package/src/product-set/hooks/useSortableTreeFunctions.ts +0 -4
  98. package/src/product-set/item/CreateProductSetItem.tsx +0 -3
  99. package/src/product-set/product/ProductControl.tsx +12 -23
  100. package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +2 -10
  101. package/src/product-set/product/quantity/ProductQuantityControl.tsx +3 -4
  102. package/src/product-set/product-category/ProductCategoryControl.tsx +8 -12
  103. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +1 -4
  104. package/src/sales/booking/results/components/ResultCard.tsx +3 -0
  105. package/src/sortable-list/SortableList.tsx +0 -3
  106. package/src/sortable-tree/SortableTreeItem.tsx +1 -7
  107. package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
  108. package/src/static/manual-date-picker/constants/index.ts +2 -6
  109. package/src/static/manual-date-picker/utils/index.ts +0 -11
  110. package/src/static/switch/BooleanSwitch.tsx +1 -1
  111. package/src/styles/availability-indicator/AvailabilityIndicator.scss +0 -10
  112. package/src/styles/iframe-events/Card.scss +8 -24
  113. package/src/styles/iframe-events/PoweredBy.scss +2 -2
  114. package/src/styles/iframe-order-process/IframeOrderProcess.scss +2 -0
  115. package/src/styles/iframe-page/Page.scss +0 -1
  116. package/src/styles/iframe-page/PageBody.scss +11 -32
  117. package/src/styles/iframe-page/PageHeader.scss +39 -41
  118. package/src/styles/product-set/EditVenueMapSetModal.scss +1 -1
  119. package/src/styles/sales/BookingResults.scss +1 -1
  120. package/dist/product-set/control/DateInput.d.ts +0 -17
  121. package/dist/product-set/control/DateInput.d.ts.map +0 -1
  122. package/dist/product-set/control/DateInput.js +0 -1
  123. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts +0 -11
  124. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts.map +0 -1
  125. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.js +0 -1
  126. package/dist/recurring-date-picker-input/DatePickerInput.d.ts +0 -19
  127. package/dist/recurring-date-picker-input/DatePickerInput.d.ts.map +0 -1
  128. package/dist/recurring-date-picker-input/DatePickerInput.js +0 -1
  129. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts +0 -15
  130. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +0 -1
  131. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.js +0 -1
  132. package/src/product-set/control/DateInput.tsx +0 -311
  133. package/src/product-set/control/ProductSetRecurrenceOverridesControl.tsx +0 -63
  134. package/src/recurring-date-picker-input/DatePickerInput.tsx +0 -93
  135. package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +0 -137
@@ -34,7 +34,6 @@ import TutorialGifCard from "./TutorialGifCard";
34
34
  import { Step } from "../types";
35
35
  import { StepsControl } from "../form/StepsControl";
36
36
  import { Typeahead } from "../../typeahead";
37
- import { DateInput } from "./DateInput";
38
37
 
39
38
  const OPERATIONAL_COST_TITLES = {
40
39
  [OPERATIONAL_COST_PROVIDER]: "operationalCostProvider",
@@ -87,7 +86,6 @@ export interface ProductSetControlProps {
87
86
  showSmsTemplate?: boolean;
88
87
  workHours?: WorkHour[];
89
88
  providerHasBookingManagement?: boolean;
90
- isOverrides?: boolean;
91
89
  }
92
90
 
93
91
  export function ProductSetControl({
@@ -103,7 +101,6 @@ export function ProductSetControl({
103
101
  showSmsTemplate,
104
102
  workHours,
105
103
  providerHasBookingManagement = false,
106
- isOverrides = false,
107
104
  }: ProductSetControlProps) {
108
105
  const { t } = useTranslation(["Design", "Validation", "Notification"]);
109
106
  const {
@@ -121,9 +118,6 @@ export function ProductSetControl({
121
118
  const termsAndConditionsId = useId();
122
119
  const relyOnPeopleTypeId = useId();
123
120
 
124
- const showSmsTemplateSelector = showSmsTemplate && !isOverrides;
125
- const showEmailTemplateSelector = showEmailTemplate && !isOverrides;
126
-
127
121
  return (
128
122
  <Row
129
123
  className={`product-set-form ${
@@ -165,30 +159,20 @@ export function ProductSetControl({
165
159
  </Form.Control.Feedback>
166
160
  </Form.Group>
167
161
 
168
- {isOverrides ? (
169
- <DateInput
162
+ {isCreateAction && (
163
+ <DateAndRecurrenceInput
164
+ isEventEditProductSet={isEventEditProductSet}
170
165
  workHours={workHours}
171
166
  isLoading={isLoading}
172
167
  providerHasBookingManagement={providerHasBookingManagement}
173
168
  />
174
- ) : (
175
- <>
176
- {isCreateAction && (
177
- <DateAndRecurrenceInput
178
- isEventEditProductSet={isEventEditProductSet}
179
- workHours={workHours}
180
- isLoading={isLoading}
181
- providerHasBookingManagement={providerHasBookingManagement}
182
- />
183
- )}
184
- </>
185
169
  )}
186
170
 
187
171
  <div className="divider" />
188
172
 
189
- <TutorialGifCard isOverrides={isOverrides} />
173
+ <TutorialGifCard />
190
174
 
191
- <StepsControl isLoading={isLoading} isOverrides={isOverrides} />
175
+ <StepsControl isLoading={isLoading} />
192
176
  </Col>
193
177
  <Col md={6} sm={12}>
194
178
  <div className="second-column">
@@ -228,7 +212,6 @@ export function ProductSetControl({
228
212
  {...register("operationalCost", { required: true })}
229
213
  as="select"
230
214
  defaultValue={OPERATIONAL_COST_PROVIDER}
231
- disabled={isOverrides}
232
215
  isInvalid={HookFormService.isInvalid("operationalCost", errors)}
233
216
  >
234
217
  {Object.keys(OPERATIONAL_COST_TYPES).map((operationalCost) => (
@@ -258,7 +241,6 @@ export function ProductSetControl({
258
241
  {...register("relyOnPeopleType")}
259
242
  as="select"
260
243
  defaultValue={null}
261
- disabled={isOverrides}
262
244
  isInvalid={HookFormService.isInvalid("relyOnPeopleType", errors)}
263
245
  >
264
246
  <option value="">{t("notRequired")} </option>
@@ -286,7 +268,7 @@ export function ProductSetControl({
286
268
  {...register("termsAndConditions")}
287
269
  as="textarea"
288
270
  rows={2}
289
- disabled={isLoading || isOverrides}
271
+ disabled={isLoading}
290
272
  isInvalid={HookFormService.isInvalid(
291
273
  "termsAndConditions",
292
274
  errors
@@ -301,32 +283,30 @@ export function ProductSetControl({
301
283
  <Form.Label className="mt-4">
302
284
  {t("Design:emailTemplate")}
303
285
  </Form.Label>
304
- <>
305
- {showEmailTemplateSelector ? (
306
- <Typeahead
307
- name="emailTemplates"
308
- options={emailTemplates}
309
- isMultipleChoise
310
- placeholder={t("Design:choose")}
311
- noOptionsMessage={t("Design:noActiveTemplates", {
312
- notification: t("Design:email"),
313
- })}
314
- />
315
- ) : (
316
- <WarningMessage
317
- message={t("Design:noActiveTemplates", {
318
- notification: t("Design:email"),
319
- })}
320
- />
321
- )}
322
- </>
286
+ {showEmailTemplate ? (
287
+ <Typeahead
288
+ name="emailTemplates"
289
+ options={emailTemplates}
290
+ isMultipleChoise
291
+ placeholder={t("Design:choose")}
292
+ noOptionsMessage={t("Design:noActiveTemplates", {
293
+ notification: t("Design:email"),
294
+ })}
295
+ />
296
+ ) : (
297
+ <WarningMessage
298
+ message={t("Design:noActiveTemplates", {
299
+ notification: t("Design:email"),
300
+ })}
301
+ />
302
+ )}
323
303
 
324
304
  <Form.Label
325
305
  className={clsx(emailTemplates.length > 0 ? "mt-4" : "mt-1")}
326
306
  >
327
307
  {t("Design:smsTemplate")}
328
308
  </Form.Label>
329
- {showSmsTemplateSelector ? (
309
+ {showSmsTemplate ? (
330
310
  <Typeahead
331
311
  name="smsTemplates"
332
312
  options={smsTemplates}
@@ -359,7 +339,6 @@ export function ProductSetControl({
359
339
  onChange={field.onChange}
360
340
  value={fieldValue}
361
341
  as="select"
362
- disabled={isOverrides}
363
342
  isInvalid={HookFormService.isInvalid(
364
343
  "fieldSetId",
365
344
  errors
@@ -396,7 +375,6 @@ export function ProductSetControl({
396
375
  }) as string;
397
376
  },
398
377
  })}
399
- disabled={isOverrides}
400
378
  isInvalid={HookFormService.isInvalid("thankYouPageUrl", errors)}
401
379
  />
402
380
 
@@ -9,14 +9,10 @@ import { Icon, Image } from "../../static";
9
9
 
10
10
  export interface TutorialGifCardProps {
11
11
  tutorialAsset?: string;
12
- isOverrides?: boolean;
13
12
  }
14
13
 
15
14
  // @TODO: Tutorial GIF asset should be passed as context, which is better
16
- const TutorialGifCard = ({
17
- tutorialAsset,
18
- isOverrides,
19
- }: TutorialGifCardProps) => {
15
+ const TutorialGifCard = ({ tutorialAsset }: TutorialGifCardProps) => {
20
16
  const { pathname } = useLocation();
21
17
  const [isVisible, setIsVisible] = useState(pathname?.includes("/create"));
22
18
  const { t } = useTranslation(["Design"]);
@@ -50,12 +46,8 @@ const TutorialGifCard = ({
50
46
  </button>
51
47
  </Card.Header>
52
48
  <Card.Body className="tutorial-card-body">
53
- <p>
54
- {t(isOverrides ? "buildOverrideProductSet" : "buildProductSet")}
55
- </p>
56
- <span>
57
- {t(isOverrides ? "buildOverrideRules" : "buildProductSetDesc")}
58
- </span>
49
+ <p>{t("buildProductSet")}</p>
50
+ <span>{t("buildProductSetDesc")}</span>
59
51
  {tutorialAsset && <Image src={tutorialAsset} alt="Tutorial Gif" />}
60
52
  </Card.Body>
61
53
  </Card>
@@ -35,7 +35,6 @@ import { useSortableTreeFunctions } from "../hooks/useSortableTreeFunctions";
35
35
 
36
36
  interface ProductCategoriesControlProps extends WithIsLoading {
37
37
  stepIndex: number;
38
- isOverrides?: boolean;
39
38
  }
40
39
 
41
40
  const getCategoryDefaultValue = (
@@ -66,7 +65,6 @@ const getCategoryDefaultValue = (
66
65
  export function ProductCategoriesControl({
67
66
  isLoading,
68
67
  stepIndex,
69
- isOverrides,
70
68
  }: ProductCategoriesControlProps) {
71
69
  const { t } = useTranslation("Design");
72
70
  const {
@@ -107,7 +105,6 @@ export function ProductCategoriesControl({
107
105
  const { edit, saveValidField, cancelChanges } = useSortableTreeFunctions({
108
106
  fieldName: productCategoriesFieldName,
109
107
  remove,
110
- isOverrides,
111
108
  });
112
109
 
113
110
  const productCategories: ProductCategory[] = useWatch({
@@ -132,7 +129,7 @@ export function ProductCategoriesControl({
132
129
  });
133
130
 
134
131
  const handleDragEnd = (event) => {
135
- if (isOverrides) return;
132
+ // @TODO uncomment when will be fix for change sort index
136
133
  const { active, over } = event;
137
134
 
138
135
  if (!active || !over || !active?.id || !over?.id) return;
@@ -269,10 +266,8 @@ export function ProductCategoriesControl({
269
266
  categoryName={value}
270
267
  stepIndex={stepIndex}
271
268
  productCategoryIndex={index}
272
- isOverride={isOverrides}
273
269
  />
274
270
  }
275
- isOverride={isOverrides}
276
271
  onDelete={() => remove(index)}
277
272
  validate={() =>
278
273
  trigger(`steps.${stepIndex}.productCategories.${index}`)
@@ -295,7 +290,6 @@ export function ProductCategoriesControl({
295
290
  zones={zones}
296
291
  productCategoryIndex={index}
297
292
  categoryType={productCategory.type}
298
- isOverrides={isOverrides}
299
293
  />
300
294
  </SortableTree.Item>
301
295
  )}
@@ -305,9 +299,7 @@ export function ProductCategoriesControl({
305
299
  </SortableTree>
306
300
  <CreateProductSetItem
307
301
  title={t("addCategory")}
308
- isOverride={isOverrides}
309
302
  onClick={() => {
310
- if (isOverrides) return;
311
303
  setIsSelectCategoryVisible(true);
312
304
  }}
313
305
  />
@@ -316,7 +308,6 @@ export function ProductCategoriesControl({
316
308
  isVisible={isSelectCategoryVisible}
317
309
  onHide={() => setIsSelectCategoryVisible(false)}
318
310
  onCategorySelect={(categoryType) => {
319
- if (isOverrides) return;
320
311
  append(getCategoryDefaultValue(categoryType, fields.length));
321
312
  setShowCategoryModal(true);
322
313
  if (
@@ -330,9 +321,7 @@ export function ProductCategoriesControl({
330
321
  <>
331
322
  <CreateProductSetItem
332
323
  title={t("editMap")}
333
- isOverride={isOverrides}
334
324
  onClick={() => {
335
- if (isOverrides) return;
336
325
  setIsVenueMapSetModalVisible(true);
337
326
  }}
338
327
  className={clsx(
@@ -26,19 +26,14 @@ 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
-
33
29
  export interface WithId {
34
30
  id: number;
35
31
  }
36
32
  export interface ProductSetFormValues
37
33
  extends FormValues,
38
- WithIdOptional,
34
+ WithId,
39
35
  ProductSetControlValues {
40
36
  steps: Step[];
41
- isOverrides?: boolean;
42
37
  }
43
38
 
44
39
  export interface ProductSetFormProps
@@ -55,7 +50,6 @@ export interface ProductSetFormProps
55
50
  providerHasBookingManagement?: ProviderBookingManagementSetting["hasBookingManagement"];
56
51
  zones?: Zone[] | null;
57
52
  isCreateAction?: boolean;
58
- isOverrides?: boolean;
59
53
  workHours?: WorkHour[];
60
54
  }
61
55
 
@@ -73,7 +67,6 @@ export function ProductSetForm({
73
67
  zones,
74
68
  isCreateAction,
75
69
  workHours,
76
- isOverrides,
77
70
  ...shared
78
71
  }: ProductSetFormProps) {
79
72
  const { t } = useTranslation("Design");
@@ -91,7 +84,6 @@ export function ProductSetForm({
91
84
  });
92
85
 
93
86
  const { setError, reset } = form;
94
-
95
87
  const formValues = form.watch();
96
88
 
97
89
  const submitHandler = (onSubmit: (values: ProductSetFormValues) => void) => {
@@ -169,7 +161,6 @@ export function ProductSetForm({
169
161
  companyName={companyName}
170
162
  workHours={workHours}
171
163
  providerHasBookingManagement={providerHasBookingManagement}
172
- isOverrides={isOverrides}
173
164
  />
174
165
  <Row>
175
166
  <Col md={6} sm={12} />
@@ -34,7 +34,6 @@ interface ProductsControlProps extends WithIsLoading {
34
34
  hasTicket?: boolean;
35
35
  categoryType: CategoryType;
36
36
  zones?: Zone[];
37
- isOverrides?: boolean;
38
37
  }
39
38
 
40
39
  const getDefaultProductValue = (sort: number): Product => ({
@@ -78,7 +77,6 @@ export function ProductsControl({
78
77
  hasTicket,
79
78
  categoryType,
80
79
  zones,
81
- isOverrides,
82
80
  }: ProductsControlProps) {
83
81
  const { t } = useTranslation("Design");
84
82
  const form = useFormContext<ProductSetFormValues>();
@@ -114,7 +112,6 @@ export function ProductsControl({
114
112
  const { edit, saveValidField, cancelChanges } = useSortableTreeFunctions({
115
113
  fieldName: productControlFieldName,
116
114
  remove,
117
- isOverrides,
118
115
  });
119
116
 
120
117
  const allowDeposits = watch(
@@ -162,7 +159,6 @@ export function ProductsControl({
162
159
  });
163
160
 
164
161
  const handleDragEnd = (_event) => {
165
- if (isOverrides) return;
166
162
  const { active, over } = _event;
167
163
 
168
164
  if (!active || !over || !active?.id || !over?.id) return;
@@ -180,7 +176,6 @@ export function ProductsControl({
180
176
  };
181
177
 
182
178
  const onProductRemove = (index: number) => {
183
- if (isOverrides) return;
184
179
  const currentProduct = getValues(
185
180
  `${productControlFieldName}.${index}` as const
186
181
  );
@@ -220,12 +215,10 @@ export function ProductsControl({
220
215
  isExpanded={isFirstProductAdded}
221
216
  isInvalid={!!categoryProductErrors}
222
217
  title={value}
223
- isOverride={isOverrides}
224
218
  badge={<Badge className="product-badge">{t("product")}</Badge>}
225
219
  isIconInHeader={false}
226
220
  cancelChanges={() => cancelChanges(index)}
227
221
  edit={() => edit(index)}
228
- isProduct
229
222
  secondaryBadge={getBadgeConfig(categoryType, t(categoryType))}
230
223
  subTitle={
231
224
  <div className="product-set-badges-container">
@@ -262,7 +255,6 @@ export function ProductsControl({
262
255
  hasTicket={hasTicket}
263
256
  categoryType={categoryType}
264
257
  zoneDuration={catergoryZone?.defaultDuration}
265
- isOverrides={isOverrides}
266
258
  />
267
259
  }
268
260
  onDelete={() => onProductRemove(index)}
@@ -284,9 +276,7 @@ export function ProductsControl({
284
276
  </SortableTree>
285
277
  <CreateProductSetItem
286
278
  title={t("addProduct")}
287
- isOverride={isOverrides}
288
279
  onClick={() => {
289
- if (isOverrides) return;
290
280
  append(getDefaultProductValue(fields.length));
291
281
  setShowProductModal(true);
292
282
 
@@ -18,10 +18,9 @@ import { ProductSetFormValues } from "./ProductSetForm";
18
18
 
19
19
  interface StepsControlProps {
20
20
  isLoading: boolean;
21
- isOverrides?: boolean;
22
21
  }
23
22
 
24
- export function StepsControl({ isLoading, isOverrides }: StepsControlProps) {
23
+ export function StepsControl({ isLoading }: StepsControlProps) {
25
24
  const form = useFormContext<ProductSetFormValues>();
26
25
  const { t } = useTranslation("Design");
27
26
  const [showStepModal, setShowStepModal] = useState(false);
@@ -43,7 +42,6 @@ export function StepsControl({ isLoading, isOverrides }: StepsControlProps) {
43
42
  const { edit, saveValidField, cancelChanges } = useSortableTreeFunctions({
44
43
  fieldName: "steps",
45
44
  remove,
46
- isOverrides,
47
45
  });
48
46
 
49
47
  useEffect(() => {
@@ -92,9 +90,8 @@ export function StepsControl({ isLoading, isOverrides }: StepsControlProps) {
92
90
  modalLabel={t("addNewStep")}
93
91
  modalClass={ProductSetModalClasses.step}
94
92
  isNewAdded={showStepModal}
95
- edit={() => !isOverrides && edit(index)}
93
+ edit={() => edit(index)}
96
94
  cancelChanges={() => cancelChanges(index)}
97
- isOverride={isOverrides}
98
95
  subTitle={
99
96
  <div className="product-set-badges-container">
100
97
  <div className="product-set-subtitle-dot product-set-subtitle-step-dot" />
@@ -139,7 +136,6 @@ export function StepsControl({ isLoading, isOverrides }: StepsControlProps) {
139
136
  <ProductCategoriesControl
140
137
  isLoading={isLoading}
141
138
  stepIndex={index}
142
- isOverrides={isOverrides}
143
139
  />
144
140
  </SortableTree.Item>
145
141
  )}
@@ -149,9 +145,7 @@ export function StepsControl({ isLoading, isOverrides }: StepsControlProps) {
149
145
 
150
146
  <CreateProductSetItem
151
147
  title={t("addStep")}
152
- isOverride={isOverrides}
153
148
  onClick={() => {
154
- if (isOverrides) return;
155
149
  append(getDefaultStepsValues());
156
150
  setShowStepModal(true);
157
151
  if (errors.steps?.type === HookFormService.manualErrorType) {
@@ -15,7 +15,6 @@ interface SubProductsControlProps {
15
15
  productCategoryIndex: number;
16
16
  productIndex: number;
17
17
  isLoading: boolean;
18
- isOverrides?: boolean;
19
18
  }
20
19
 
21
20
  export function SubProductsControl({
@@ -24,7 +23,6 @@ export function SubProductsControl({
24
23
  stepIndex,
25
24
  productCategoryIndex,
26
25
  productIndex,
27
- isOverrides,
28
26
  }: SubProductsControlProps) {
29
27
  const form = useFormContext<ProductSetFormValues>();
30
28
  const { fields, append } = useFieldArray({
@@ -51,7 +49,6 @@ export function SubProductsControl({
51
49
  key={`sub-product-${subProduct.id}-${index}`}
52
50
  id={subProduct.id}
53
51
  title={subProduct.name}
54
- isOverride={isOverrides}
55
52
  body={
56
53
  <ProductControl<ProductSetFormValues>
57
54
  isLoading={isLoading}
@@ -4,25 +4,21 @@ import { useFormContext } from "react-hook-form";
4
4
  interface useSortableTreeFunctionsProps {
5
5
  fieldName: string;
6
6
  remove: (index?: number | number[]) => void;
7
- isOverrides?: boolean;
8
7
  }
9
8
  export const useSortableTreeFunctions = ({
10
9
  fieldName,
11
10
  remove,
12
- isOverrides,
13
11
  }: useSortableTreeFunctionsProps) => {
14
12
  const { getValues, setValue } = useFormContext();
15
13
  const [previousValue, setEditValue] = useState(null);
16
14
 
17
15
  const edit = (index: number) => {
18
- if (isOverrides) return;
19
16
  const currentCategoryProduct = getValues(`${fieldName}.${index}` as const);
20
17
  const cloneCategoryProduct = structuredClone(currentCategoryProduct);
21
18
  setEditValue(cloneCategoryProduct);
22
19
  };
23
20
 
24
21
  const cancelChanges = (index: number) => {
25
- if (isOverrides) return;
26
22
  if (!previousValue) {
27
23
  return remove(index);
28
24
  }
@@ -6,21 +6,18 @@ interface CreateProductSetItemProps {
6
6
  onClick: () => void;
7
7
  title: string;
8
8
  className?: string;
9
- isOverride?: boolean;
10
9
  }
11
10
 
12
11
  export function CreateProductSetItem({
13
12
  onClick,
14
13
  title,
15
14
  className,
16
- isOverride,
17
15
  }: CreateProductSetItemProps) {
18
16
  return (
19
17
  <button
20
18
  className={clsx(
21
19
  "product-set-item-wrapper w-100",
22
20
  `product-set-item-wrapper-${title.toLowerCase().split(" ")[1]}`,
23
- isOverride && "bg-light",
24
21
  className
25
22
  )}
26
23
  onClick={onClick}
@@ -113,7 +113,6 @@ export interface ProductControlProps<T>
113
113
  productName: string;
114
114
  hasTicket?: boolean;
115
115
  categoryType?: CategoryType;
116
- isOverrides?: boolean;
117
116
  zoneDuration?: number;
118
117
  }
119
118
 
@@ -129,7 +128,6 @@ export function ProductControl<T extends FormValues>({
129
128
  hasTicket,
130
129
  categoryType,
131
130
  zoneDuration,
132
- isOverrides = false,
133
131
  }: ProductControlProps<T>) {
134
132
  const {
135
133
  register,
@@ -262,7 +260,7 @@ export function ProductControl<T extends FormValues>({
262
260
  `${fieldNamePrefix}.name` as Path<T>,
263
261
  errors
264
262
  )}
265
- disabled={isLoading || isOverrides}
263
+ disabled={isLoading}
266
264
  placeholder={t("name")}
267
265
  />
268
266
  <Form.Control.Feedback type="invalid">
@@ -282,7 +280,7 @@ export function ProductControl<T extends FormValues>({
282
280
  viewMode={false}
283
281
  onUpdate={onChange}
284
282
  content={value as string}
285
- disabled={isLoading || isOverrides}
283
+ disabled={isLoading}
286
284
  />
287
285
  )}
288
286
  rules={{
@@ -328,7 +326,6 @@ export function ProductControl<T extends FormValues>({
328
326
  <ProductQuantityControl<T>
329
327
  isLoading={isLoading}
330
328
  fieldNamePrefix={fieldNamePrefix}
331
- isOverrides={isOverrides}
332
329
  onFocus={onFocus}
333
330
  />
334
331
 
@@ -373,7 +370,7 @@ export function ProductControl<T extends FormValues>({
373
370
  `${fieldNamePrefix}.quantitySelector` as Path<T>,
374
371
  errors
375
372
  )}
376
- disabled={isLoading || hasTicket || isOverrides}
373
+ disabled={isLoading || hasTicket}
377
374
  >
378
375
  {quantitySelectorList.map((selector) => (
379
376
  <option value={selector.id} key={selector.id}>
@@ -395,14 +392,13 @@ export function ProductControl<T extends FormValues>({
395
392
  <Row className="align-items-start duration-capacity-container">
396
393
  <ProductDurationControl
397
394
  fieldNamePrefix={fieldNamePrefix}
398
- disabled={disabledDuration || isOverrides}
395
+ disabled={disabledDuration}
399
396
  />
400
397
 
401
398
  <Col lg={4} md={4}>
402
399
  <FormNumberInput
403
400
  fieldName={`${fieldNamePrefix}.capacity`}
404
401
  label={t("capacity")}
405
- disabled={isOverrides}
406
402
  rules={{
407
403
  min: {
408
404
  value: 0,
@@ -430,7 +426,6 @@ export function ProductControl<T extends FormValues>({
430
426
  fieldName={`${fieldNamePrefix}.capacity`}
431
427
  label={t("capacity")}
432
428
  onChange={onChangeGameCapacity}
433
- disabled={isOverrides}
434
429
  rules={{
435
430
  min: {
436
431
  value: 0,
@@ -446,7 +441,7 @@ export function ProductControl<T extends FormValues>({
446
441
  <FormNumberInput
447
442
  fieldName={`${fieldNamePrefix}.duration`}
448
443
  label={t("durationMinutes")}
449
- disabled={disabledDuration || isOverrides}
444
+ disabled={disabledDuration}
450
445
  rules={{
451
446
  min: {
452
447
  value: 0,
@@ -492,7 +487,7 @@ export function ProductControl<T extends FormValues>({
492
487
  `${fieldNamePrefix}.termsAndConditions` as Path<T>,
493
488
  errors
494
489
  )}
495
- disabled={isLoading || isOverrides}
490
+ disabled={isLoading}
496
491
  name={name}
497
492
  />
498
493
  )}
@@ -518,7 +513,6 @@ export function ProductControl<T extends FormValues>({
518
513
  onFileRemove={onImageRemove}
519
514
  defaultFiles={images}
520
515
  isLoading={isImageUploading}
521
- disabled={isOverrides}
522
516
  withIcon
523
517
  title={t("addImage")}
524
518
  />
@@ -539,7 +533,7 @@ export function ProductControl<T extends FormValues>({
539
533
  name={name}
540
534
  value={Boolean(value)}
541
535
  onChange={onChange}
542
- disabled={isLoading || isOverrides}
536
+ disabled={isLoading}
543
537
  />
544
538
  );
545
539
  }}
@@ -574,7 +568,7 @@ export function ProductControl<T extends FormValues>({
574
568
  custom
575
569
  type="checkbox"
576
570
  name={advancedId}
577
- disabled={isLoading || isOverrides}
571
+ disabled={isLoading}
578
572
  >
579
573
  <Form.Check.Input
580
574
  checked={expanded}
@@ -601,7 +595,7 @@ export function ProductControl<T extends FormValues>({
601
595
  name={name}
602
596
  value={Boolean(value)}
603
597
  onChange={onChange}
604
- disabled={isLoading || isOverrides}
598
+ disabled={isLoading}
605
599
  />
606
600
  )}
607
601
  control={control}
@@ -621,7 +615,7 @@ export function ProductControl<T extends FormValues>({
621
615
  name={name}
622
616
  value={Boolean(value)}
623
617
  onChange={onChange}
624
- disabled={isLoading || isOverrides}
618
+ disabled={isLoading}
625
619
  />
626
620
  )}
627
621
  control={control}
@@ -630,12 +624,7 @@ export function ProductControl<T extends FormValues>({
630
624
  </Form.Group>
631
625
  {[CATEGORY_TYPE_GAME, CATEGORY_TYPE_FIXED_DURATION].includes(
632
626
  categoryType
633
- ) && (
634
- <FixedDurationOptions
635
- fieldNamePrefix={fieldNamePrefix}
636
- isOverrides={isOverrides}
637
- />
638
- )}
627
+ ) && <FixedDurationOptions fieldNamePrefix={fieldNamePrefix} />}
639
628
  <Form.Group
640
629
  controlId={minSpendId}
641
630
  className="advanced-switch-container"
@@ -645,7 +634,7 @@ export function ProductControl<T extends FormValues>({
645
634
  isRequired={false}
646
635
  isMoreThanZero
647
636
  allowDeposits={false}
648
- isLoading={isLoading || isOverrides}
637
+ isLoading={isLoading}
649
638
  fieldNamePrefix={`${fieldNamePrefix}.minSpend` as Path<T>}
650
639
  />
651
640
  </Form.Group>