@licklist/design 0.66.3 → 0.66.5

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 (47) hide show
  1. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
  2. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +1 -1
  3. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
  4. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
  5. package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
  6. package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -1
  7. package/dist/product-set/control/ProductSetControl.d.ts +2 -1
  8. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  9. package/dist/product-set/control/ProductSetControl.js +1 -1
  10. package/dist/product-set/form/ProductCategoriesControl.d.ts +3 -1
  11. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  12. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  13. package/dist/product-set/form/ProductSetForm.d.ts +2 -1
  14. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  15. package/dist/product-set/form/ProductSetForm.js +1 -1
  16. package/dist/product-set/form/ProductsControl.d.ts +3 -1
  17. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  18. package/dist/product-set/form/ProductsControl.js +1 -1
  19. package/dist/product-set/form/StepsControl.d.ts +3 -1
  20. package/dist/product-set/form/StepsControl.d.ts.map +1 -1
  21. package/dist/product-set/form/StepsControl.js +1 -1
  22. package/dist/product-set/product/ProductControl.d.ts +1 -0
  23. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  24. package/dist/product-set/product/ProductControl.js +1 -1
  25. package/dist/product-set/step/StepControl.d.ts +2 -1
  26. package/dist/product-set/step/StepControl.d.ts.map +1 -1
  27. package/dist/product-set/step/StepControl.js +1 -1
  28. package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts +1 -1
  29. package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts.map +1 -1
  30. package/dist/report/ReportRunnerModal/ReportRunnerModal.js +1 -1
  31. package/dist/sortable-tree/SortableTreeItem.d.ts +1 -2
  32. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  33. package/dist/sortable-tree/SortableTreeItem.js +1 -1
  34. package/package.json +3 -3
  35. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +8 -1
  36. package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +1 -0
  37. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -0
  38. package/src/product-set/control/ProductSetControl.tsx +10 -3
  39. package/src/product-set/form/ProductCategoriesControl.tsx +15 -4
  40. package/src/product-set/form/ProductSetForm.tsx +3 -0
  41. package/src/product-set/form/ProductsControl.tsx +93 -77
  42. package/src/product-set/form/StepsControl.tsx +15 -7
  43. package/src/product-set/product/ProductControl.tsx +2 -2
  44. package/src/product-set/step/StepControl.tsx +4 -3
  45. package/src/report/ReportRunnerModal/ReportRunnerModal.stories.tsx +307 -0
  46. package/src/report/ReportRunnerModal/ReportRunnerModal.tsx +24 -14
  47. package/src/sortable-tree/SortableTreeItem.tsx +0 -3
@@ -0,0 +1,307 @@
1
+ import { Meta, Story } from "@storybook/react";
2
+ import React from "react";
3
+ import { Card } from "react-bootstrap";
4
+ import { ReportRunnerModal, ReportRunnerModalProps } from "./ReportRunnerModal";
5
+
6
+ export default {
7
+ title: "Report/ReportRunnerModal",
8
+ component: ReportRunnerModal,
9
+ } as Meta;
10
+
11
+ export const Default: Story<ReportRunnerModalProps> = (args) => (
12
+ <Card style={{ maxWidth: "max-content" }}>
13
+ <Card.Body>
14
+ <ReportRunnerModal {...args} />
15
+ </Card.Body>
16
+ </Card>
17
+ );
18
+
19
+ Default.args = {
20
+ reportId: 47,
21
+ show: true,
22
+ generate: { isLoading: false },
23
+ download: { isLoading: false },
24
+ useShowReportFields: (type) => ({ data: [], isLoading: false }),
25
+ onHide: () => {},
26
+ onEdit: () => {},
27
+ reports: [
28
+ {
29
+ id: 47,
30
+ providerId: null,
31
+ type: "payments",
32
+ name: "Test 1",
33
+ createdAt: "2024-04-26 08:16:59",
34
+ updatedAt: "2024-04-26 08:16:59",
35
+ deletedAt: null,
36
+ reportFieldValues: [
37
+ {
38
+ id: 580,
39
+ reportId: 47,
40
+ reportFieldId: 16,
41
+ },
42
+ {
43
+ id: 581,
44
+ reportId: 47,
45
+ reportFieldId: 17,
46
+ },
47
+ {
48
+ id: 582,
49
+ reportId: 47,
50
+ reportFieldId: 18,
51
+ },
52
+ {
53
+ id: 583,
54
+ reportId: 47,
55
+ reportFieldId: 19,
56
+ },
57
+ {
58
+ id: 584,
59
+ reportId: 47,
60
+ reportFieldId: 20,
61
+ },
62
+ {
63
+ id: 585,
64
+ reportId: 47,
65
+ reportFieldId: 21,
66
+ },
67
+ {
68
+ id: 586,
69
+ reportId: 47,
70
+ reportFieldId: 22,
71
+ },
72
+ {
73
+ id: 587,
74
+ reportId: 47,
75
+ reportFieldId: 23,
76
+ },
77
+ {
78
+ id: 588,
79
+ reportId: 47,
80
+ reportFieldId: 24,
81
+ },
82
+ {
83
+ id: 589,
84
+ reportId: 47,
85
+ reportFieldId: 26,
86
+ },
87
+ {
88
+ id: 590,
89
+ reportId: 47,
90
+ reportFieldId: 27,
91
+ },
92
+ {
93
+ id: 591,
94
+ reportId: 47,
95
+ reportFieldId: 28,
96
+ },
97
+ {
98
+ id: 592,
99
+ reportId: 47,
100
+ reportFieldId: 40,
101
+ },
102
+ {
103
+ id: 593,
104
+ reportId: 47,
105
+ reportFieldId: 41,
106
+ },
107
+ {
108
+ id: 594,
109
+ reportId: 47,
110
+ reportFieldId: 42,
111
+ },
112
+ ],
113
+ },
114
+ {
115
+ id: 52,
116
+ providerId: null,
117
+ type: "bookings",
118
+ name: "new report",
119
+ createdAt: "2024-04-29 16:05:51",
120
+ updatedAt: "2024-04-29 16:08:39",
121
+ deletedAt: null,
122
+ reportFieldValues: [
123
+ {
124
+ id: 635,
125
+ reportId: 52,
126
+ reportFieldId: 1,
127
+ },
128
+ {
129
+ id: 636,
130
+ reportId: 52,
131
+ reportFieldId: 2,
132
+ },
133
+ {
134
+ id: 637,
135
+ reportId: 52,
136
+ reportFieldId: 3,
137
+ },
138
+ {
139
+ id: 638,
140
+ reportId: 52,
141
+ reportFieldId: 4,
142
+ },
143
+ {
144
+ id: 639,
145
+ reportId: 52,
146
+ reportFieldId: 5,
147
+ },
148
+ {
149
+ id: 640,
150
+ reportId: 52,
151
+ reportFieldId: 6,
152
+ },
153
+ {
154
+ id: 641,
155
+ reportId: 52,
156
+ reportFieldId: 7,
157
+ },
158
+ {
159
+ id: 642,
160
+ reportId: 52,
161
+ reportFieldId: 8,
162
+ },
163
+ {
164
+ id: 643,
165
+ reportId: 52,
166
+ reportFieldId: 9,
167
+ },
168
+ {
169
+ id: 644,
170
+ reportId: 52,
171
+ reportFieldId: 10,
172
+ },
173
+ {
174
+ id: 645,
175
+ reportId: 52,
176
+ reportFieldId: 11,
177
+ },
178
+ {
179
+ id: 646,
180
+ reportId: 52,
181
+ reportFieldId: 12,
182
+ },
183
+ {
184
+ id: 647,
185
+ reportId: 52,
186
+ reportFieldId: 13,
187
+ },
188
+ {
189
+ id: 648,
190
+ reportId: 52,
191
+ reportFieldId: 14,
192
+ },
193
+ {
194
+ id: 649,
195
+ reportId: 52,
196
+ reportFieldId: 15,
197
+ },
198
+ {
199
+ id: 650,
200
+ reportId: 52,
201
+ reportFieldId: 36,
202
+ },
203
+ {
204
+ id: 651,
205
+ reportId: 52,
206
+ reportFieldId: 37,
207
+ },
208
+ {
209
+ id: 652,
210
+ reportId: 52,
211
+ reportFieldId: 38,
212
+ },
213
+ {
214
+ id: 653,
215
+ reportId: 52,
216
+ reportFieldId: 39,
217
+ },
218
+ {
219
+ id: 654,
220
+ reportId: 52,
221
+ reportFieldId: 47,
222
+ },
223
+ {
224
+ id: 655,
225
+ reportId: 52,
226
+ reportFieldId: 48,
227
+ },
228
+ ],
229
+ },
230
+ {
231
+ id: 53,
232
+ providerId: null,
233
+ type: "tickets",
234
+ name: "tickets",
235
+ createdAt: "2024-04-29 16:12:36",
236
+ updatedAt: "2024-04-29 16:12:36",
237
+ deletedAt: null,
238
+ reportFieldValues: [
239
+ {
240
+ id: 656,
241
+ reportId: 53,
242
+ reportFieldId: 29,
243
+ },
244
+ {
245
+ id: 657,
246
+ reportId: 53,
247
+ reportFieldId: 30,
248
+ },
249
+ {
250
+ id: 658,
251
+ reportId: 53,
252
+ reportFieldId: 31,
253
+ },
254
+ {
255
+ id: 659,
256
+ reportId: 53,
257
+ reportFieldId: 32,
258
+ },
259
+ {
260
+ id: 660,
261
+ reportId: 53,
262
+ reportFieldId: 33,
263
+ },
264
+ {
265
+ id: 661,
266
+ reportId: 53,
267
+ reportFieldId: 34,
268
+ },
269
+ {
270
+ id: 662,
271
+ reportId: 53,
272
+ reportFieldId: 35,
273
+ },
274
+ {
275
+ id: 663,
276
+ reportId: 53,
277
+ reportFieldId: 43,
278
+ },
279
+ {
280
+ id: 664,
281
+ reportId: 53,
282
+ reportFieldId: 44,
283
+ },
284
+ {
285
+ id: 665,
286
+ reportId: 53,
287
+ reportFieldId: 45,
288
+ },
289
+ {
290
+ id: 666,
291
+ reportId: 53,
292
+ reportFieldId: 46,
293
+ },
294
+ {
295
+ id: 667,
296
+ reportId: 53,
297
+ reportFieldId: 51,
298
+ },
299
+ {
300
+ id: 668,
301
+ reportId: 53,
302
+ reportFieldId: 52,
303
+ },
304
+ ],
305
+ },
306
+ ],
307
+ };
@@ -23,7 +23,7 @@ interface ReportField {
23
23
  title: string;
24
24
  }
25
25
 
26
- type ReportRunnerModalProps = {
26
+ export type ReportRunnerModalProps = {
27
27
  reportId: Report["id"] | null;
28
28
  show: boolean;
29
29
  useShowReportFields: (
@@ -136,28 +136,38 @@ export const ReportRunnerModal = ({
136
136
  </Button>
137
137
 
138
138
  <form noValidate>
139
- <div className="period-by">
140
- {PERIOD_BY_TYPES.map((type) => (
141
- <div key={type}>
142
- <Form.Group>
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}>
143
147
  <Form.Check
144
148
  inline
145
- isInvalid={!!errors.periodBy}
146
149
  label={t(labelByPeriodType[type])}
147
150
  type="radio"
148
151
  id={type}
152
+ required
149
153
  value={type}
150
- {...register("periodBy")}
154
+ {...register("periodBy", {
155
+ required: `${t("Validation:fieldRequired", {
156
+ attribute: t("Design:period"),
157
+ })}`,
158
+ })}
151
159
  />
152
- <Form.Control.Feedback type="invalid">
153
- {errors.periodBy?.message}
154
- </Form.Control.Feedback>
155
- </Form.Group>
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}
156
166
  </div>
157
- ))}
167
+ )}
158
168
  </div>
159
169
 
160
- <div className="controls">
170
+ <div className="controls mt-4">
161
171
  <Form.Group controlId="from-input">
162
172
  <Form.Label>{t("Design:from")}</Form.Label>
163
173
  <Form.Control
@@ -168,7 +178,7 @@ export const ReportRunnerModal = ({
168
178
  required: {
169
179
  value: true,
170
180
  message: `${t("Validation:fieldRequired", {
171
- attribute: t("Design:to"),
181
+ attribute: t("Design:from"),
172
182
  })}`,
173
183
  },
174
184
  })}
@@ -53,7 +53,6 @@ export interface SortableTreeItemProps {
53
53
  };
54
54
  setIsExpanded?: () => void;
55
55
  isOverride?: boolean;
56
- isProduct?: boolean;
57
56
  }
58
57
 
59
58
  export function SortableTreeItem({
@@ -81,7 +80,6 @@ export function SortableTreeItem({
81
80
  secondaryBadge,
82
81
  setIsExpanded,
83
82
  isOverride,
84
- isProduct = false,
85
83
  }: SortableTreeItemProps) {
86
84
  const [expanded, setExpanded] = useState(isExpanded);
87
85
  const [isModalVisible, setIsModalVisible] = useState(isNewAdded);
@@ -152,7 +150,6 @@ export function SortableTreeItem({
152
150
  };
153
151
 
154
152
  const onEdit = (e) => {
155
- if (isOverride && !isProduct) return;
156
153
  e.stopPropagation();
157
154
  if (edit && !isModalVisible) edit();
158
155
  setIsModalVisible(true);