@licklist/design 0.78.5-dev.1 → 0.78.5-dev.16

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 (74) hide show
  1. package/dist/CustomDatePicker/CustomDatePicker.d.ts +10 -0
  2. package/dist/CustomDatePicker/CustomDatePicker.d.ts.map +1 -0
  3. package/dist/auth/Layout/UserNavDropDownToggle.js +3 -0
  4. package/dist/custom-fields/field-set/providers/CustomFieldSetsProvider.d.ts +2 -2
  5. package/dist/custom-fields/field-set/providers/CustomFieldSetsProvider.d.ts.map +1 -1
  6. package/dist/events/edit-recurrent-event-modal/EditRecurrentEventModal.d.ts.map +1 -1
  7. package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
  8. package/dist/events/event-venue-map/components/Dropdown/components/DropdownWrapper/DropdownWrapper.d.ts +2 -2
  9. package/dist/events/event-venue-map/components/Dropdown/components/DropdownWrapper/DropdownWrapper.d.ts.map +1 -1
  10. package/dist/file-upload/FileUpload.d.ts +1 -1
  11. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.d.ts +1 -2
  12. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.d.ts.map +1 -1
  13. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.js +2 -2
  14. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.d.ts.map +1 -1
  15. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.js +2 -2
  16. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts.map +1 -1
  17. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.d.ts.map +1 -1
  18. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
  19. package/dist/iframe/order-process/components/PaymentCard/PaymentCard.d.ts +2 -2
  20. package/dist/iframe/order-process/components/PaymentCard/PaymentCard.d.ts.map +1 -1
  21. package/dist/iframe/payment/order-items-table/hooks/useTableData.d.ts +0 -5
  22. package/dist/iframe/payment/order-items-table/hooks/useTableData.d.ts.map +1 -1
  23. package/dist/iframe/payment/order-items-table/hooks/useTableData.js +81 -80
  24. package/dist/iframe/payment/payment-page/PaymentPage.d.ts +1 -1
  25. package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
  26. package/dist/iframe/ryft/utils/ryft-form.d.ts +1 -1
  27. package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
  28. package/dist/modals/dialog/Dialog.d.ts.map +1 -1
  29. package/dist/modals/dialog/Dialog.js +39 -41
  30. package/dist/modals/dialog/DialogContext.d.ts +2 -2
  31. package/dist/modals/dialog/DialogContext.d.ts.map +1 -1
  32. package/dist/notification/email-template/card/EmailTemplateCard.d.ts.map +1 -1
  33. package/dist/notification/email-template/control/EmailTemplateControl.d.ts +1 -0
  34. package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
  35. package/dist/notification/email-template/control/EmailTemplateControl.js +4 -4
  36. package/dist/notification/email-template/form/EmailTemplateForm.d.ts +2 -1
  37. package/dist/notification/email-template/form/EmailTemplateForm.d.ts.map +1 -1
  38. package/dist/notification/email-template/form/EmailTemplateForm.js +2 -1
  39. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  40. package/dist/product-set/product/advanced-options/AdvancedOptions.js +1 -1
  41. package/dist/product-set/utils/index.d.ts +1 -1
  42. package/dist/product-set/utils/index.d.ts.map +1 -1
  43. package/dist/recurrence-input/RecurrenceInput.d.ts.map +1 -1
  44. package/dist/recurrence-input/RecurrenceInput.js +1 -1
  45. package/dist/setting/dashboard/payments/payments-modal/PaymentsModal.d.ts.map +1 -1
  46. package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
  47. package/dist/snippet/snippet-template/preview/Preview.js +14 -20
  48. package/package.json +20 -18
  49. package/src/CustomDatePicker/CustomDatePicker.tsx +252 -0
  50. package/src/auth/Layout/UserNavDropDownToggle.tsx +1 -1
  51. package/src/custom-fields/field-set/providers/CustomFieldSetsProvider.tsx +2 -2
  52. package/src/events/edit-recurrent-event-modal/EditRecurrentEventModal.tsx +1 -0
  53. package/src/events/event-statistic-modal/EventStatisticModal.tsx +1 -0
  54. package/src/events/event-venue-map/components/Dropdown/components/DropdownWrapper/DropdownWrapper.tsx +2 -2
  55. package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.tsx +13 -8
  56. package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.tsx +12 -4
  57. package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx +10 -6
  58. package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.tsx +18 -20
  59. package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +3 -5
  60. package/src/iframe/order-process/components/PaymentCard/PaymentCard.tsx +3 -3
  61. package/src/iframe/payment/order-items-table/hooks/useTableData.tsx +103 -109
  62. package/src/iframe/payment/payment-page/PaymentPage.tsx +1 -1
  63. package/src/iframe/ryft/utils/ryft-form.ts +1 -1
  64. package/src/modals/dialog/Dialog.tsx +35 -36
  65. package/src/modals/dialog/DialogContext.tsx +8 -2
  66. package/src/notification/email-template/card/EmailTemplateCard.tsx +0 -2
  67. package/src/notification/email-template/control/EmailTemplateControl.tsx +7 -5
  68. package/src/notification/email-template/form/EmailTemplateForm.tsx +3 -0
  69. package/src/product-set/form/ProductSetForm.tsx +2 -1
  70. package/src/product-set/utils/index.ts +15 -14
  71. package/src/recurrence-input/RecurrenceInput.tsx +4 -3
  72. package/src/setting/dashboard/payments/payments-modal/PaymentsModal.tsx +1 -0
  73. package/src/snippet/snippet-template/preview/Preview.tsx +6 -9
  74. package/yarn.lock +687 -755
@@ -27,6 +27,7 @@ export interface EmailTemplateControlProps {
27
27
  meta: string
28
28
  defaultAttachments?: Attachment[]
29
29
  notificationTypes?: NotificationType[]
30
+ waiverType?: boolean
30
31
  getDefaultTemplateMetaByType?: (type?: NotificationType | null) => string
31
32
  }
32
33
 
@@ -38,6 +39,7 @@ export const EmailTemplateControl = forwardRef(
38
39
  options = [],
39
40
  defaultAttachments = [],
40
41
  notificationTypes = [],
42
+ waiverType = false,
41
43
  getDefaultTemplateMetaByType,
42
44
  }: EmailTemplateControlProps,
43
45
  ref: any,
@@ -196,7 +198,7 @@ export const EmailTemplateControl = forwardRef(
196
198
  })
197
199
  })
198
200
  }
199
-
201
+
200
202
  return (
201
203
  <>
202
204
  <Row>
@@ -284,7 +286,7 @@ export const EmailTemplateControl = forwardRef(
284
286
  </Form.Group>
285
287
  </Row>
286
288
 
287
- <Row>
289
+ { !waiverType && (<Row>
288
290
  <Form.Group as={Col}>
289
291
  <Form.Check
290
292
  {...register('isActive')}
@@ -301,7 +303,7 @@ export const EmailTemplateControl = forwardRef(
301
303
  custom
302
304
  />
303
305
  </Form.Group>
304
- </Row>
306
+ </Row>)}
305
307
  <Row className='mb-4'>
306
308
  <Form.Group as={Col}>
307
309
  <Form.Label>{t('Design:emailBody')}</Form.Label>
@@ -374,7 +376,7 @@ export const EmailTemplateControl = forwardRef(
374
376
  }
375
377
  // should show dropdown only if user want to include PDF file
376
378
  if (option.type === OPTION_TYPE.files_selector) {
377
- const fileSelectors = JSON.parse(option.defaultValue)
379
+ const fileSelectors = option?.defaultValue ? JSON.parse(option.defaultValue) : ''
378
380
  const fileNames = Object.values(fileSelectors)
379
381
  const fileKeys = Object.keys(fileSelectors)
380
382
 
@@ -423,7 +425,7 @@ export const EmailTemplateControl = forwardRef(
423
425
  )
424
426
  }
425
427
 
426
- if (option.type === OPTION_TYPE.days_reminder) {
428
+ if (option.type === OPTION_TYPE.days_reminder || option.type === OPTION_TYPE.waiver_reminder ) {
427
429
  return (
428
430
  <>
429
431
  <Form.Label className='mt-4'>
@@ -41,6 +41,7 @@ export interface EmailTemplateProps extends HasPermissionProp {
41
41
  placeholders?: NotificationPlaceholder[]
42
42
  options?: TemplateOption[]
43
43
  serverErrors?: ServerError
44
+ waiverType?: boolean
44
45
  notificationTypes?: NotificationType[]
45
46
  getDefaultTemplateMetaByType?: (type?: NotificationType | null) => string
46
47
  onTypeChange?: (type?: NotificationType | null) => void
@@ -54,6 +55,7 @@ export const EmailTemplateForm = ({
54
55
  placeholders = [],
55
56
  options = [],
56
57
  serverErrors,
58
+ waiverType,
57
59
  notificationTypes = [],
58
60
  getDefaultTemplateMetaByType,
59
61
  onTypeChange,
@@ -93,6 +95,7 @@ export const EmailTemplateForm = ({
93
95
  >
94
96
  <EmailTemplateControl
95
97
  ref={emailEditorRef}
98
+ waiverType={waiverType}
96
99
  setIsLoading={setIsLoading}
97
100
  meta={defaultValues?.meta || null}
98
101
  defaultAttachments={defaultValues?.attachments || []}
@@ -2,7 +2,8 @@ import { useEffect, useState } from 'react'
2
2
  import { FormValues } from '@licklist/plugins/dist/types/services/Form/hook-form-service'
3
3
  import { Button, Form, Col, Row } from 'react-bootstrap'
4
4
  import { FormProvider, useForm } from 'react-hook-form'
5
- import { TFunction, useTranslation } from 'react-i18next'
5
+ import { TFunction } from 'i18next'
6
+ import { useTranslation } from 'react-i18next'
6
7
  import { VenueMapSet } from '@licklist/core/dist/DataMapper/Product/VenueMapSetDataMapper'
7
8
  import { ServerError } from '@licklist/plugins/dist/hooks/Api/useHttpQuery'
8
9
  import FormErrorService from '@licklist/plugins/dist/services/Form/FormErrorService'
@@ -2,14 +2,13 @@ import { EmailTemplate } from '@licklist/core/dist/DataMapper/Notification/Email
2
2
  import { SmsTemplate } from '@licklist/core/dist/DataMapper/Notification/SmsTemplateDataMapper'
3
3
  import { ModifierSet } from '@licklist/core/dist/DataMapper/Product/ModifierSetDataMapper'
4
4
  import { convertToTypeaheadOptions } from 'src/sales/coupon/utils'
5
- import { TFunction } from 'react-i18next'
5
+ import { TFunction } from 'i18next'
6
6
  import { UseFormSetError } from 'react-hook-form'
7
7
  import { checkIfZoneCategory } from '@licklist/plugins'
8
8
  import { ProductSet } from '@licklist/core/dist/DataMapper/Product/ProductSetDataMapper'
9
9
  import { TemplateItem } from '../control/ProductSetControl'
10
10
  import { ProductSetFormValues } from '../form/ProductSetForm'
11
11
 
12
-
13
12
  interface CheckAvailableTimesErrors {
14
13
  values: ProductSetFormValues
15
14
  setError: UseFormSetError<ProductSetFormValues>
@@ -61,21 +60,23 @@ export const getFilteredTemplates = (
61
60
  }))
62
61
  }
63
62
 
64
- export const updateModifiersSetAtProductSetForm = (data: ProductSetFormValues) => ({
63
+ export const updateModifiersSetAtProductSetForm = (
64
+ data: ProductSetFormValues,
65
+ ) => ({
65
66
  ...data,
66
- steps: data.steps.map(step => ({
67
- ...step,
68
- productCategories: step.productCategories.map(category => ({
69
- ...category,
70
- products: category.products.map(product => ({
71
- ...product,
72
- modifiersSet: product?.modifiersSet
73
- ? convertToTypeaheadOptions(product.modifiersSet as ModifierSet[])
74
- : [],
75
- })),
67
+ steps: data.steps.map((step) => ({
68
+ ...step,
69
+ productCategories: step.productCategories.map((category) => ({
70
+ ...category,
71
+ products: category.products.map((product) => ({
72
+ ...product,
73
+ modifiersSet: product?.modifiersSet
74
+ ? convertToTypeaheadOptions(product.modifiersSet as ModifierSet[])
75
+ : [],
76
76
  })),
77
+ })),
77
78
  })),
78
- });
79
+ })
79
80
 
80
81
  export const checkAvailableTimesErrors = ({
81
82
  values,
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable prefer-destructuring */
2
2
  /* eslint-disable react-hooks/exhaustive-deps */
3
3
  import { DateTime } from 'luxon'
4
- import { useEffect, useReducer, useState } from 'react'
4
+ import { useEffect, useReducer } from 'react'
5
5
  import RRule, { Frequency, Weekday } from 'rrule'
6
6
  import RecurrenceEndInput, { defaultOccurrences } from './RecurrenceEndInput'
7
7
  import RecurrenceIntervalAndFrequencyInput from './RecurrenceIntervalAndFrequencyInput'
@@ -37,7 +37,7 @@ export function RecurrenceInput({
37
37
 
38
38
  useEffect(
39
39
  // TODO: unhardcode timezone
40
- () =>
40
+ () => {
41
41
  onChange(
42
42
  RRule.optionsToString({
43
43
  freq: state.freq,
@@ -47,7 +47,8 @@ export function RecurrenceInput({
47
47
  tzid: 'Europe/London',
48
48
  ...state,
49
49
  }).replace('RRULE:', ''),
50
- ),
50
+ )
51
+ },
51
52
  [state],
52
53
  )
53
54
 
@@ -25,6 +25,7 @@ export function PaymentsModal({
25
25
 
26
26
  return (
27
27
  <Modal show={isVisible} onHide={onHide} centered>
28
+ {/* @ts-ignore */}
28
29
  <Modal.Header closeButton>
29
30
  <Modal.Title>{t('Design:setEmail')}</Modal.Title>
30
31
  </Modal.Header>
@@ -1,6 +1,5 @@
1
1
  import { useContext, useState } from 'react'
2
2
  import { useTranslation } from 'react-i18next'
3
- import { MemoryRouter } from 'react-router-dom'
4
3
  import { Button } from 'react-bootstrap'
5
4
  import {
6
5
  SNIPPET_TEMPLATE_TYPE_VENUE_MAP,
@@ -79,14 +78,12 @@ export function Preview({
79
78
  <div className='mt-5 pt-5 external-header'>
80
79
  <PageHeader showCloseButton showBackButton>
81
80
  <Timer timer={600} />
82
- <MemoryRouter initialEntries={['/step1', '/step2']}>
83
- <NavigationSteps
84
- steps={[
85
- { pathname: '/step1', key: '/step1', name: 'Burger' },
86
- { pathname: '/step2', key: '/step2', name: 'Cheese' },
87
- ]}
88
- />
89
- </MemoryRouter>
81
+ <NavigationSteps
82
+ steps={[
83
+ { pathname: '/step1', key: '/step1', name: 'Burger' },
84
+ { pathname: '/step2', key: '/step2', name: 'Cheese' },
85
+ ]}
86
+ />
90
87
  </PageHeader>
91
88
  </div>
92
89
  </div>