@licklist/design 0.66.0-dev.0 → 0.66.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.
Files changed (96) hide show
  1. package/dist/date-time-button/DateTimeButton.js +1 -1
  2. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
  3. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +1 -1
  4. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
  5. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
  6. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
  7. package/dist/product-set/control/DateAndRecurrenceInput.d.ts +1 -1
  8. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  9. package/dist/product-set/control/DateAndRecurrenceInput.js +1 -1
  10. package/dist/product-set/control/DateInput.js +1 -1
  11. package/dist/product-set/control/ProductSetControl.d.ts +2 -3
  12. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  13. package/dist/product-set/control/ProductSetControl.js +1 -1
  14. package/dist/product-set/form/ProductCategoriesControl.d.ts +1 -3
  15. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  16. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  17. package/dist/product-set/form/ProductSetForm.d.ts +2 -6
  18. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  19. package/dist/product-set/form/ProductSetForm.js +1 -1
  20. package/dist/product-set/form/ProductsControl.d.ts +1 -3
  21. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  22. package/dist/product-set/form/ProductsControl.js +1 -1
  23. package/dist/product-set/form/StepsControl.d.ts +1 -3
  24. package/dist/product-set/form/StepsControl.d.ts.map +1 -1
  25. package/dist/product-set/form/StepsControl.js +1 -1
  26. package/dist/product-set/product/ProductControl.d.ts +0 -1
  27. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  28. package/dist/product-set/product/ProductControl.js +1 -1
  29. package/dist/product-set/step/StepControl.d.ts +1 -2
  30. package/dist/product-set/step/StepControl.d.ts.map +1 -1
  31. package/dist/product-set/step/StepControl.js +1 -1
  32. package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
  33. package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
  34. package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.d.ts.map +1 -1
  35. package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.js +1 -1
  36. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +1 -3
  37. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
  38. package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
  39. package/dist/recurring-date-picker-input/utils.d.ts +0 -5
  40. package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
  41. package/dist/recurring-date-picker-input/utils.js +1 -1
  42. package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts +1 -1
  43. package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts.map +1 -1
  44. package/dist/report/ReportRunnerModal/ReportRunnerModal.js +1 -1
  45. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  46. package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
  47. package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
  48. package/dist/sortable-tree/SortableTreeItem.d.ts +2 -1
  49. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  50. package/dist/sortable-tree/SortableTreeItem.js +1 -1
  51. package/dist/styles/date-time-button/DateTimeButton.scss +0 -1
  52. package/dist/styles/sales/BookingResults.scss +1 -1
  53. package/dist/styles/zones/ZoneForm.scss +1 -2
  54. package/dist/zone/form/ZoneForm.d.ts +2 -2
  55. package/dist/zone/form/ZoneForm.d.ts.map +1 -1
  56. package/dist/zone/form/ZoneForm.js +1 -1
  57. package/dist/zone/form/components/ZoneControl.d.ts +2 -2
  58. package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
  59. package/dist/zone/form/components/ZoneControl.js +1 -1
  60. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -4
  61. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
  62. package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
  63. package/dist/zone/form/utils/dates.d.ts.map +1 -1
  64. package/package.json +5 -3
  65. package/src/date-time-button/DateTimeButton.stories.tsx +1 -2
  66. package/src/date-time-button/DateTimeButton.tsx +5 -7
  67. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +9 -14
  68. package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +0 -2
  69. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +0 -1
  70. package/src/product-set/control/DateAndRecurrenceInput.tsx +4 -3
  71. package/src/product-set/control/DateInput.tsx +2 -2
  72. package/src/product-set/control/ProductSetControl.tsx +5 -17
  73. package/src/product-set/form/ProductCategoriesControl.tsx +4 -15
  74. package/src/product-set/form/ProductSetForm.tsx +2 -13
  75. package/src/product-set/form/ProductsControl.tsx +77 -93
  76. package/src/product-set/form/StepsControl.tsx +7 -15
  77. package/src/product-set/product/ProductControl.tsx +5 -8
  78. package/src/product-set/step/StepControl.tsx +3 -4
  79. package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +18 -4
  80. package/src/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.tsx +21 -49
  81. package/src/recurring-date-picker-input/RecurringDatePickerInput.stories.tsx +7 -13
  82. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +1 -12
  83. package/src/recurring-date-picker-input/utils.ts +1 -90
  84. package/src/report/ReportRunnerModal/ReportRunnerModal.tsx +14 -24
  85. package/src/sales/booking/results/components/ResultCard.tsx +3 -0
  86. package/src/setting/admin/AdminSettingForm.tsx +2 -2
  87. package/src/sortable-tree/SortableTreeItem.tsx +3 -0
  88. package/src/static/switch/BooleanSwitch.tsx +1 -1
  89. package/src/styles/date-time-button/DateTimeButton.scss +0 -1
  90. package/src/styles/sales/BookingResults.scss +1 -1
  91. package/src/styles/zones/ZoneForm.scss +1 -2
  92. package/src/zone/form/ZoneForm.tsx +2 -3
  93. package/src/zone/form/components/ZoneControl.tsx +3 -3
  94. package/src/zone/form/components/ZoneRecurrencesControl.tsx +5 -7
  95. package/src/zone/form/utils/dates.ts +10 -9
  96. package/src/report/ReportRunnerModal/ReportRunnerModal.stories.tsx +0 -307
@@ -1,7 +1,9 @@
1
+ import { DateTime } from "luxon";
1
2
  import React from "react";
2
3
  import { Col, Row } from "react-bootstrap";
3
4
  import { useFormContext } from "react-hook-form";
4
5
  import { useTranslation } from "react-i18next";
6
+ import { TIME_FORMAT } from "@licklist/core/dist/Config";
5
7
  import { WorkingHoursInputValues } from ".";
6
8
  import { useWeekdays } from "./utils";
7
9
 
@@ -23,10 +25,22 @@ export function WorkingHoursInputDescription() {
23
25
  <Row key={i}>
24
26
  <Col xs="auto">{weekdays[i]}:</Col>
25
27
  <Col>
26
- {t("timeInterval", {
27
- start: weekday.start,
28
- end: weekday.end,
29
- })}
28
+ {weekday?.end
29
+ ? weekday.start
30
+ ? t("timeInterval", {
31
+ start: DateTime.fromISO(weekday.start).toFormat(
32
+ TIME_FORMAT
33
+ ),
34
+ end: DateTime.fromISO(weekday.start).toFormat(
35
+ TIME_FORMAT
36
+ ),
37
+ })
38
+ : t("timeFrom", {
39
+ start: DateTime.fromISO(weekday.start).toFormat(
40
+ TIME_FORMAT
41
+ ),
42
+ })
43
+ : null}
30
44
  </Col>
31
45
  </Row>
32
46
  );
@@ -2,18 +2,8 @@ import React, { useEffect } from "react";
2
2
  import { DateTime } from "luxon";
3
3
  import { Col, Form, Row } from "react-bootstrap";
4
4
  import { useTranslation } from "react-i18next";
5
- import {
6
- RegisterOptions,
7
- useFormContext,
8
- useWatch,
9
- Validate,
10
- } from "react-hook-form";
11
- import {
12
- DATE_FORMAT,
13
- TIME_FORMAT,
14
- TIME_FULL_FORMAT,
15
- } from "@licklist/core/dist/Config";
16
- import { fromFormat } from "@licklist/plugins/dist/utils/dateTime";
5
+ import { RegisterOptions, useFormContext } from "react-hook-form";
6
+ import { DATE_FORMAT } from "@licklist/core/dist/Config";
17
7
  import { RecurringDatePickerInputValues } from "./RecurringDatePickerInput";
18
8
 
19
9
  interface RecurrenceIntervalAndFrequencyInputProps {
@@ -33,15 +23,6 @@ interface RecurrenceIntervalAndFrequencyInputProps {
33
23
  >;
34
24
  }
35
25
 
36
- const fromTimeFormat = fromFormat(TIME_FORMAT);
37
- const fromTimeFullFormat = fromFormat(TIME_FULL_FORMAT);
38
-
39
- // default values and entered values are in different formats
40
- const fromTimeFormats = (time: string) =>
41
- fromTimeFormat(time).isValid
42
- ? fromTimeFormat(time)
43
- : fromTimeFullFormat(time);
44
-
45
26
  function RecurrenceIntervalAndFrequencyInput({
46
27
  disabled = false,
47
28
  minDate,
@@ -55,20 +36,16 @@ function RecurrenceIntervalAndFrequencyInput({
55
36
  const { t } = useTranslation(["Design", "Notification", "App"]);
56
37
 
57
38
  const {
39
+ getValues,
58
40
  formState: { errors },
59
41
  register,
60
42
  trigger,
61
- control,
62
43
  } = useFormContext<RecurringDatePickerInputValues>();
63
44
 
64
- const startDate = useWatch({ control, name: "startDate" });
65
- const endDate = useWatch({ control, name: "endDate" });
66
-
67
- const _startTime = useWatch({ control, name: "startTime" });
68
- const startTime = fromTimeFormats(_startTime).toFormat(TIME_FORMAT);
69
-
70
- const _endTime = useWatch({ control, name: "endTime" });
71
- const endTime = fromTimeFormats(_endTime).toFormat(TIME_FORMAT);
45
+ const startDate = getValues("startDate");
46
+ const endDate = getValues("endDate");
47
+ const startTime = getValues("startTime");
48
+ const endTime = getValues("endTime");
72
49
 
73
50
  useEffect(() => {
74
51
  if (!startDate || !endDate) {
@@ -172,27 +149,22 @@ function RecurrenceIntervalAndFrequencyInput({
172
149
  type="time"
173
150
  {...register("endTime", {
174
151
  required: false,
175
- ...endTimeRules,
176
- validate: {
177
- external: endTimeRules?.validate
178
- ? (endTimeRules?.validate as Validate<string>)
179
- : () => true,
180
- time: (time) => {
181
- if (!startTime || !time) {
182
- return true;
183
- }
184
- const currentStartTime = DateTime.fromISO(startTime);
185
- const currentEndTime = DateTime.fromISO(time);
152
+ validate: (time) => {
153
+ if (!startTime || !time) {
154
+ return true;
155
+ }
156
+ const currentStartTime = DateTime.fromISO(startTime);
157
+ const currentEndTime = DateTime.fromISO(time);
186
158
 
187
- return currentEndTime?.diff(currentStartTime, ["minutes"])
188
- ?.minutes >= 0
189
- ? true
190
- : `${t(`Validation:fieldLaterDate`, {
191
- attribute: t("Design:endTimeSmall"),
192
- min: t("Design:startTimeSmall"),
193
- })}`;
194
- },
159
+ return currentEndTime?.diff(currentStartTime, ["minutes"])
160
+ ?.minutes >= 0
161
+ ? true
162
+ : `${t(`Validation:fieldLaterDate`, {
163
+ attribute: t("Design:endTimeSmall"),
164
+ min: t("Design:startTimeSmall"),
165
+ })}`;
195
166
  },
167
+ ...endTimeRules,
196
168
  })}
197
169
  placeholder="hh:mm"
198
170
  defaultValue={endTime}
@@ -1,19 +1,22 @@
1
1
  import React from "react";
2
2
  import { Meta, Story } from "@storybook/react";
3
3
  import { Card } from "react-bootstrap";
4
- import { DateTime } from "luxon";
5
- import { DATE_FORMAT, TIME_FORMAT } from "@licklist/core/dist/Config/Date";
6
4
  import {
7
5
  RecurringDatePickerInput,
8
6
  RecurringDatePickerInputProps,
9
7
  } from "./RecurringDatePickerInput";
8
+ import { DateTime } from "luxon";
9
+ import { DATE_FORMAT, TIME_FORMAT } from "@licklist/core/dist/Config/Date";
10
10
 
11
11
  export default {
12
12
  title: "RecurringDatePickerInput",
13
13
  component: RecurringDatePickerInput,
14
14
  } as Meta;
15
15
 
16
- export const Default: Story<RecurringDatePickerInputProps> = (args) => {
16
+ interface DefaultRecurringDatePickerInputProps
17
+ extends RecurringDatePickerInputProps {}
18
+
19
+ export const Default: Story<DefaultRecurringDatePickerInputProps> = (args) => {
17
20
  return (
18
21
  <Card style={{ maxWidth: "max-content" }}>
19
22
  <Card.Body>
@@ -22,7 +25,7 @@ export const Default: Story<RecurringDatePickerInputProps> = (args) => {
22
25
  </Card>
23
26
  );
24
27
  };
25
- export const Valid: Story<RecurringDatePickerInputProps> = (args) => {
28
+ export const Valid: Story<DefaultRecurringDatePickerInputProps> = (args) => {
26
29
  return (
27
30
  <Card style={{ maxWidth: "max-content" }}>
28
31
  <Card.Body>
@@ -33,15 +36,6 @@ export const Valid: Story<RecurringDatePickerInputProps> = (args) => {
33
36
  };
34
37
  Default.args = {
35
38
  onChange: (data) => console.log("onSubmit", data),
36
- workHours: [
37
- { start: "20:00", end: "04:00", day: 0, description: "" },
38
- { start: "20:00", end: "04:00", day: 1, description: "" },
39
- { start: "20:00", end: "04:00", day: 2, description: "" },
40
- { start: "20:00", end: "12:00", day: 3, description: "" },
41
- { start: "20:00", end: "23:00", day: 4, description: "" },
42
- { start: "08:00", end: "12:00", day: 5, description: "" },
43
- { start: "10:00", end: "16:00", day: 6, description: "" },
44
- ],
45
39
  };
46
40
  Valid.args = {
47
41
  onChange: (data) => console.log("onSubmit", data),
@@ -12,14 +12,9 @@ import {
12
12
  import { usePreviousValue } from "@licklist/plugins/dist/hooks/Value/usePreviousValue";
13
13
  import { FormProvider, useForm } from "react-hook-form";
14
14
  import { Form } from "react-bootstrap";
15
- import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
16
15
  import RecurrenceIntervalAndFrequencyInput from "./RecurrenceIntervalAndFrequencyInput";
17
16
  import RecurrenceWeekdaysInput from "./RecurrenceWeekdaysInput";
18
- import {
19
- parseAndValidateRRule,
20
- SupportedFrequency,
21
- useWorkHoursValidation,
22
- } from "./utils";
17
+ import { parseAndValidateRRule, SupportedFrequency } from "./utils";
23
18
  import { ConfirmModal } from "../modals";
24
19
  import { DeleteFieldButton } from "../product-set/elements";
25
20
 
@@ -31,7 +26,6 @@ export interface RecurringDatePickerInputProps {
31
26
  initialFrequency?: Frequency;
32
27
  setInitialStartDateAfterSelect?: boolean;
33
28
  minDate?: string;
34
- workHours: WorkHour[] | undefined;
35
29
  }
36
30
 
37
31
  export interface RecurringDatePickerInputValues {
@@ -57,7 +51,6 @@ export function RecurringDatePickerInput({
57
51
  setInitialStartDateAfterSelect = false,
58
52
  children,
59
53
  minDate,
60
- workHours,
61
54
  }: PropsWithChildren<RecurringDatePickerInputProps>) {
62
55
  const { t } = useTranslation(["Design"]);
63
56
 
@@ -91,8 +84,6 @@ export function RecurringDatePickerInput({
91
84
  byWeekDay,
92
85
  });
93
86
 
94
- const validator = useWorkHoursValidation(byWeekDay, workHours);
95
-
96
87
  const onSubmit = (nextState: RecurringDatePickerInputValues) => {
97
88
  const end = getDateTimeObject(endDate, endTime || "23:59:59");
98
89
 
@@ -197,8 +188,6 @@ export function RecurringDatePickerInput({
197
188
  <RecurrenceIntervalAndFrequencyInput
198
189
  disabled={disabled}
199
190
  minDate={minDate}
200
- startTimeRules={validator}
201
- endTimeRules={validator}
202
191
  />
203
192
 
204
193
  {children}
@@ -1,9 +1,4 @@
1
- import { TIME_FORMAT, TIME_FULL_FORMAT } from "@licklist/core/dist/Config";
2
- import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
3
- import { fromFormat } from "@licklist/plugins/dist/utils/dateTime";
4
- import { DateTime, Interval } from "luxon";
5
- import { Validate } from "react-hook-form";
6
- import { useTranslation } from "react-i18next";
1
+ import { DateTime } from "luxon";
7
2
  import RRule, { Frequency, Weekday } from "rrule";
8
3
 
9
4
  export const getWeekdayForFrequency = ({
@@ -16,7 +11,6 @@ export const getWeekdayForFrequency = ({
16
11
  const parsedDate = DateTime.fromISO(date);
17
12
  return new Weekday(
18
13
  parsedDate.weekday - 1,
19
- // eslint-disable-next-line no-nested-ternary
20
14
  frequency !== Frequency.MONTHLY
21
15
  ? undefined
22
16
  : parsedDate.day + 7 > parsedDate.daysInMonth
@@ -115,86 +109,3 @@ export const parseAndValidateRRule = ({
115
109
  until: options.until,
116
110
  } as ParsedRRuleOptions;
117
111
  };
118
-
119
- export const useWorkHoursValidation = (
120
- byWeekDay: Weekday[] = [],
121
- workHours: WorkHour[] | undefined
122
- ): {
123
- validate?: Validate<string>;
124
- } => {
125
- const { t } = useTranslation("Validation");
126
- if (!workHours) return {};
127
-
128
- const fromTimeFormat = fromFormat(TIME_FORMAT);
129
- const fromTimeFullFormat = fromFormat(TIME_FULL_FORMAT);
130
-
131
- // map every day to array of intervals describing workhours for that day
132
- let intervalsByDay = workHours.map((workhour, index, self) => {
133
- const res: Interval[] = [];
134
-
135
- const startTime = fromTimeFormat(workhour.start);
136
- const endTime = fromTimeFormat(workhour.end);
137
-
138
- if (endTime > startTime) {
139
- res.push(Interval.fromDateTimes(startTime, endTime));
140
- } else {
141
- // if end is before start, then it means that end is on the next day
142
- // so count only to the end of current day
143
- res.push(Interval.fromDateTimes(startTime, startTime.endOf("day")));
144
- }
145
-
146
- const prevIndex = index === 0 ? self.length - 1 : index - 1;
147
-
148
- const prevStartTime = fromTimeFormat(self[prevIndex].start);
149
- const prevEndTime = fromTimeFormat(self[prevIndex].end);
150
-
151
- // if prevStartTime > prevEndTime then it means that prevEndTime is on the current day
152
- // so we need to add interval from start of current day to prevEndTime
153
- if (prevStartTime > prevEndTime) {
154
- res.push(Interval.fromDateTimes(prevEndTime.startOf("day"), prevEndTime));
155
- }
156
-
157
- return res;
158
- });
159
-
160
- // if length === 0 or length === 7 then all workhours are selected, no need to filter
161
- if (![0, 7].includes(byWeekDay.length)) {
162
- intervalsByDay = intervalsByDay.filter((_, index) =>
163
- byWeekDay.find(({ weekday }) => weekday === index)
164
- );
165
- }
166
-
167
- return {
168
- validate: (_time: string) => {
169
- // workaround for issue with form values
170
- // default values and entered values have different formats
171
- const time = fromTimeFormat(_time).isValid
172
- ? fromTimeFormat(_time)
173
- : fromTimeFullFormat(_time);
174
-
175
- const notFittingIntervalsByDay = intervalsByDay.reduce<Interval[][]>(
176
- (acc, intervalsByDay) => {
177
- if (!intervalsByDay.some((interval) => interval.contains(time))) {
178
- acc.push(intervalsByDay);
179
- }
180
- return acc;
181
- },
182
- []
183
- );
184
-
185
- const notFittingIntervals = notFittingIntervalsByDay
186
- .flat()
187
- .filter((interval) => !interval.contains(time));
188
-
189
- const attribute = notFittingIntervals
190
- .map((interval) => interval.toFormat("HH:mm"))
191
- .join(", ");
192
-
193
- if (notFittingIntervalsByDay.length !== 0) {
194
- return t("outsideWorkingHours", { attribute }) as string;
195
- }
196
-
197
- return true;
198
- },
199
- };
200
- };
@@ -23,7 +23,7 @@ interface ReportField {
23
23
  title: string;
24
24
  }
25
25
 
26
- export type ReportRunnerModalProps = {
26
+ type ReportRunnerModalProps = {
27
27
  reportId: Report["id"] | null;
28
28
  show: boolean;
29
29
  useShowReportFields: (
@@ -136,38 +136,28 @@ export const ReportRunnerModal = ({
136
136
  </Button>
137
137
 
138
138
  <form noValidate>
139
- <div
140
- className={`pl-1 ${
141
- errors.periodBy?.message && "border-danger border rounded"
142
- }`}
143
- >
144
- <div className="period-by">
145
- {PERIOD_BY_TYPES.map((type) => (
146
- <div key={type}>
139
+ <div className="period-by">
140
+ {PERIOD_BY_TYPES.map((type) => (
141
+ <div key={type}>
142
+ <Form.Group>
147
143
  <Form.Check
148
144
  inline
145
+ isInvalid={!!errors.periodBy}
149
146
  label={t(labelByPeriodType[type])}
150
147
  type="radio"
151
148
  id={type}
152
- required
153
149
  value={type}
154
- {...register("periodBy", {
155
- required: `${t("Validation:fieldRequired", {
156
- attribute: t("Design:period"),
157
- })}`,
158
- })}
150
+ {...register("periodBy")}
159
151
  />
160
- </div>
161
- ))}
162
- </div>
163
- {errors.periodBy?.message && (
164
- <div className="iframe-event__message-error justify-content-start mb-1">
165
- {errors.periodBy?.message}
152
+ <Form.Control.Feedback type="invalid">
153
+ {errors.periodBy?.message}
154
+ </Form.Control.Feedback>
155
+ </Form.Group>
166
156
  </div>
167
- )}
157
+ ))}
168
158
  </div>
169
159
 
170
- <div className="controls mt-4">
160
+ <div className="controls">
171
161
  <Form.Group controlId="from-input">
172
162
  <Form.Label>{t("Design:from")}</Form.Label>
173
163
  <Form.Control
@@ -178,7 +168,7 @@ export const ReportRunnerModal = ({
178
168
  required: {
179
169
  value: true,
180
170
  message: `${t("Validation:fieldRequired", {
181
- attribute: t("Design:from"),
171
+ attribute: t("Design:to"),
182
172
  })}`,
183
173
  },
184
174
  })}
@@ -12,6 +12,7 @@ import { TIME_FORMAT } from "@licklist/core/dist/Config";
12
12
  import * as Config from "@licklist/core/dist/Config";
13
13
  import { formatDateStringForEvent } from "@licklist/plugins/dist/utils/formatDate";
14
14
  import { getOrderSourceTitle } from "@licklist/plugins/dist/utils/sourceTitle";
15
+
15
16
  import Icon from "../../../../static/Icon";
16
17
 
17
18
  export type ResultCardProps = {
@@ -21,6 +22,8 @@ export type ResultCardProps = {
21
22
  onCardClick?: (id: number) => void;
22
23
  };
23
24
 
25
+ // @TODO integrate when API will be available
26
+ // activity and staff keys
24
27
  export const ResultCard = ({
25
28
  order,
26
29
  className,
@@ -11,7 +11,7 @@ import Row from "react-bootstrap/Row";
11
11
  import Col from "react-bootstrap/Col";
12
12
  import { Link } from "react-router-dom";
13
13
  import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
14
- import { ProvidableType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
14
+ import { ProviderType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
15
15
  import Icon from "../../static/Icon";
16
16
  import { PaymentFeeForm, PaymentFeeFormFieldValues } from "./PaymentFeeForm";
17
17
  import { Currency } from "../../types/currency";
@@ -33,7 +33,7 @@ export interface AdminSettingFormProps extends HasPermissionProp {
33
33
  providerMetadata: {
34
34
  country?: string;
35
35
  providableId?: number;
36
- providerType?: ProvidableType;
36
+ providerType?: ProviderType;
37
37
  };
38
38
  }
39
39
 
@@ -53,6 +53,7 @@ export interface SortableTreeItemProps {
53
53
  };
54
54
  setIsExpanded?: () => void;
55
55
  isOverride?: boolean;
56
+ isProduct?: boolean;
56
57
  }
57
58
 
58
59
  export function SortableTreeItem({
@@ -80,6 +81,7 @@ export function SortableTreeItem({
80
81
  secondaryBadge,
81
82
  setIsExpanded,
82
83
  isOverride,
84
+ isProduct = false,
83
85
  }: SortableTreeItemProps) {
84
86
  const [expanded, setExpanded] = useState(isExpanded);
85
87
  const [isModalVisible, setIsModalVisible] = useState(isNewAdded);
@@ -150,6 +152,7 @@ export function SortableTreeItem({
150
152
  };
151
153
 
152
154
  const onEdit = (e) => {
155
+ if (isOverride && !isProduct) return;
153
156
  e.stopPropagation();
154
157
  if (edit && !isModalVisible) edit();
155
158
  setIsModalVisible(true);
@@ -23,7 +23,7 @@ export function BooleanSwitch({
23
23
  const { t } = useTranslation("Design");
24
24
 
25
25
  const options: SelectItem[] = [
26
- { id: 1, value: firstValueTitle ?? t("yes") },
26
+ { id: 1, value: firstValueTitle ?? t("yes") },
27
27
  { id: 0, value: secondValueTitle ?? t("no") },
28
28
  ];
29
29
 
@@ -81,7 +81,6 @@
81
81
  min-width: 5.3rem;
82
82
  max-width: 5.3rem;
83
83
  min-height: 2.75rem;
84
- border: 2px solid $snippet-calendar-disabled-button-border-color;
85
84
  }
86
85
 
87
86
  &.calendar-view {
@@ -5,7 +5,7 @@
5
5
  flex-wrap: wrap;
6
6
 
7
7
  .result-card {
8
- height: 14rem;
8
+ height: 14.25rem;
9
9
  border: 1px solid $gray-400;
10
10
  max-width: calc(50% - 0.75rem);
11
11
  flex: 0 0 calc(50% - 0.75rem);
@@ -1,5 +1,4 @@
1
1
  .zone-available-times {
2
- overscroll-behavior: contain;
3
2
  display: flex;
4
3
  flex-wrap: wrap;
5
4
  gap: 1.5rem;
@@ -8,4 +7,4 @@
8
7
  justify-content: start;
9
8
  width: 95%;
10
9
  overflow: scroll;
11
- }
10
+ }
@@ -13,7 +13,7 @@ export type ZoneFormProps = {
13
13
  onSubmit: (values: Partial<Zone>) => void;
14
14
  serverErrors?: ServerError;
15
15
  isLoading?: boolean;
16
- workHours: WorkHour[] | undefined;
16
+ workHours?: WorkHour[];
17
17
  };
18
18
 
19
19
  export type ZoneFormValues = Partial<Zone> & {
@@ -25,7 +25,6 @@ export const ZoneForm = ({
25
25
  onSubmit,
26
26
  serverErrors,
27
27
  isLoading = false,
28
- workHours,
29
28
  }: ZoneFormProps) => {
30
29
  const { t } = useTranslation("Design");
31
30
  const form = useForm<ZoneFormValues>({
@@ -55,7 +54,7 @@ export const ZoneForm = ({
55
54
  return (
56
55
  <FormProvider {...form}>
57
56
  <Form onSubmit={handleSubmit(onFormSubmit)}>
58
- <ZoneControl isLoading={isLoading} workHours={workHours} />
57
+ <ZoneControl isLoading={isLoading} />
59
58
  <Row>
60
59
  <Col md={6} sm={12} />
61
60
  <Col
@@ -11,15 +11,15 @@ import { GameDurationControl } from "./GameDurationControl";
11
11
 
12
12
  export type ZoneControlProps = {
13
13
  isLoading: boolean;
14
- workHours: WorkHour[] | undefined;
14
+ workHours?: WorkHour[];
15
15
  };
16
16
 
17
- export const ZoneControl = ({ isLoading, workHours }: ZoneControlProps) => {
17
+ export const ZoneControl = ({ isLoading }: ZoneControlProps) => {
18
18
  return (
19
19
  <Row>
20
20
  <Col md={6} sm={12} className="pr-5">
21
21
  <NameControl isLoading={isLoading} />
22
- <ZoneRecurrencesControl workHours={workHours} />
22
+ <ZoneRecurrencesControl />
23
23
  <hr />
24
24
  <Row>
25
25
  <Col md={6} sm={6}>
@@ -25,13 +25,12 @@ export interface DateAndRecurrenceInputValues {
25
25
  zoneRecurrences?: Partial<ZoneRecurrence>[];
26
26
  }
27
27
 
28
- type ZoneRecurrenceControlProps = {
29
- workHours: WorkHour[] | undefined;
28
+ export type ZoneRecurrenceControlProps = {
29
+ workHours?: WorkHour[];
30
+ isLoading?: boolean;
30
31
  };
31
32
 
32
- export const ZoneRecurrencesControl = ({
33
- workHours,
34
- }: ZoneRecurrenceControlProps) => {
33
+ export const ZoneRecurrencesControl = () => {
35
34
  const {
36
35
  control,
37
36
  register,
@@ -70,7 +69,7 @@ export const ZoneRecurrencesControl = ({
70
69
  clearEditState();
71
70
  });
72
71
 
73
- const popoverId = useId();
72
+ const popoverId = useId()!;
74
73
 
75
74
  const { t } = useTranslation(["Design", "Validation"]);
76
75
 
@@ -167,7 +166,6 @@ export const ZoneRecurrencesControl = ({
167
166
  onChange={handleRecurringDateChange}
168
167
  onDelete={handleDelete}
169
168
  setInitialStartDateAfterSelect
170
- workHours={workHours}
171
169
  />
172
170
  </Popover.Content>
173
171
  </Popover>
@@ -53,17 +53,18 @@ export const getCheckboxesByWorkHours = (workHours?: WorkHour[]) => {
53
53
  if (!workHours || !workHours.length)
54
54
  return getTimeCheckboxRanges(DEFAULT_START_DAY_TIME, DEFAULT_END_DAY_TIME);
55
55
 
56
- const providerWorkHoursByWeek = workHours.reduce<
57
- { start: string; end: string }[]
58
- >((workHoursNextArray, currentWorkHour) => {
59
- const { start, end } = currentWorkHour;
56
+ const providerWorkHoursByWeek = workHours.reduce(
57
+ (workHoursNextArray: { start: string; end: string }[], currentWorkHour) => {
58
+ const { start, end } = currentWorkHour;
60
59
 
61
- if (start && end) {
62
- return [...workHoursNextArray, { start, end }];
63
- }
60
+ if (start && end) {
61
+ return [...workHoursNextArray, { start, end }];
62
+ }
64
63
 
65
- return workHoursNextArray;
66
- }, []);
64
+ return workHoursNextArray;
65
+ },
66
+ []
67
+ );
67
68
 
68
69
  // If venue has filled only 1 work day from wee
69
70
  // For another days we use default 00:00 and 23:59