@licklist/design 0.78.5-dev.2 → 0.78.5-dev.23
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/dist/CustomDatePicker/CustomDatePicker.d.ts +10 -0
- package/dist/CustomDatePicker/CustomDatePicker.d.ts.map +1 -0
- package/dist/auth/ChangePassword/ChangePasswordComponent.d.ts.map +1 -1
- package/dist/auth/ChangePassword/ChangePasswordComponent.js +5 -4
- package/dist/auth/Layout/UserNavDropDownToggle.js +3 -0
- package/dist/auth/Login/LoginComponent.d.ts.map +1 -1
- package/dist/auth/Login/LoginComponent.js +11 -7
- package/dist/auth/Register/RegisterComponent.d.ts.map +1 -1
- package/dist/auth/Register/RegisterComponent.js +5 -4
- package/dist/auth/ResetPassword/ResetPasswordComponent.d.ts.map +1 -1
- package/dist/auth/ResetPassword/ResetPasswordComponent.js +5 -4
- package/dist/auth/Social/SocialCallbackComponent.d.ts.map +1 -1
- package/dist/auth/Social/SocialCallbackComponent.js +5 -2
- package/dist/auth/Social/SocialFormComponent.d.ts.map +1 -1
- package/dist/auth/Social/SocialFormComponent.js +4 -4
- package/dist/custom-fields/field-set/components/CustomFieldSet/CustomFieldSet.d.ts.map +1 -1
- package/dist/custom-fields/field-set/components/CustomFieldSet/CustomFieldSet.js +5 -4
- package/dist/customRadioButton/RadioButton.d.ts +11 -0
- package/dist/customRadioButton/RadioButton.d.ts.map +1 -0
- package/dist/customRadioButton/RadioButton.js +93 -0
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
- package/dist/events/edit-recurrent-event-modal/EditRecurrentEventModal.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
- package/dist/file-upload/FileUpload.d.ts.map +1 -1
- package/dist/file-upload/FileUpload.js +4 -4
- package/dist/iframe/payment/order-items-table/hooks/useTableData.d.ts.map +1 -1
- package/dist/iframe/payment/order-items-table/hooks/useTableData.js +81 -80
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/modals/dialog/Dialog.d.ts.map +1 -1
- package/dist/modals/dialog/Dialog.js +39 -41
- package/dist/notification/email-template/card/EmailTemplateCard.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts +1 -0
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.js +4 -4
- package/dist/notification/email-template/form/EmailTemplateForm.d.ts +2 -1
- package/dist/notification/email-template/form/EmailTemplateForm.d.ts.map +1 -1
- package/dist/notification/email-template/form/EmailTemplateForm.js +2 -1
- package/dist/product-set/product/advanced-options/AdvancedOptions.js +1 -1
- package/dist/recurrence-input/RecurrenceInput.d.ts.map +1 -1
- package/dist/recurrence-input/RecurrenceInput.js +1 -1
- package/dist/sales/guest-profile/profile/Profile.d.ts.map +1 -1
- package/dist/sales/guest-profile/profile/Profile.js +2 -1
- package/dist/setting/dashboard/payments/payments-modal/PaymentsModal.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.js +14 -20
- package/package.json +6 -6
- package/src/CustomDatePicker/CustomDatePicker.tsx +258 -0
- package/src/auth/ChangePassword/ChangePasswordComponent.tsx +3 -4
- package/src/auth/Layout/UserNavDropDownToggle.tsx +1 -1
- package/src/auth/Login/LoginComponent.tsx +7 -5
- package/src/auth/Register/RegisterComponent.tsx +3 -4
- package/src/auth/ResetPassword/ResetPasswordComponent.tsx +3 -4
- package/src/auth/Social/SocialCallbackComponent.tsx +3 -2
- package/src/auth/Social/SocialFormComponent.tsx +2 -3
- package/src/custom-fields/field-set/components/CustomFieldSet/CustomFieldSet.tsx +3 -4
- package/src/customRadioButton/RadioButton.tsx +84 -0
- package/src/events/edit-recurrent-event-modal/EditRecurrentEventModal.tsx +1 -0
- package/src/events/event-statistic-modal/EventStatisticModal.tsx +1 -0
- package/src/file-upload/FileUpload.tsx +2 -3
- package/src/iframe/payment/order-items-table/hooks/useTableData.tsx +103 -109
- package/src/index.ts +1 -0
- package/src/modals/dialog/Dialog.tsx +35 -36
- package/src/notification/email-template/card/EmailTemplateCard.tsx +0 -2
- package/src/notification/email-template/control/EmailTemplateControl.tsx +7 -5
- package/src/notification/email-template/form/EmailTemplateForm.tsx +3 -0
- package/src/recurrence-input/RecurrenceInput.tsx +4 -3
- package/src/sales/guest-profile/profile/Profile.tsx +2 -5
- package/src/setting/dashboard/payments/payments-modal/PaymentsModal.tsx +1 -0
- package/src/snippet/snippet-template/preview/Preview.tsx +6 -9
- package/yarn.lock +528 -576
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { showAlert } from '@licklist/plugins/dist/context/app/AlertContext'
|
|
1
2
|
/* eslint-disable no-return-assign */
|
|
2
3
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
3
4
|
import { useEffect, useState } from 'react'
|
|
4
5
|
import clsx from 'clsx'
|
|
5
|
-
import useNotification from '@licklist/plugins/dist/context/app/hooks/useNotification'
|
|
6
6
|
import { Image } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
|
|
7
7
|
import { Attachment } from '@licklist/core/dist/DataMapper/Notification/AttachmentDataMapper'
|
|
8
8
|
import { AttachmentMetadata } from '@licklist/core/dist/DataMapper/Notification/AttachmentMetadataDataMapper'
|
|
@@ -153,7 +153,6 @@ export const useFileUpload = ({
|
|
|
153
153
|
const [files, setFiles] = useState<File[] | null>(null)
|
|
154
154
|
const [isDragged, setIsDragged] = useState(false)
|
|
155
155
|
|
|
156
|
-
const notification = useNotification()
|
|
157
156
|
const { t } = useTranslation('Design')
|
|
158
157
|
|
|
159
158
|
const uploadFile = (file: File) => {
|
|
@@ -183,7 +182,7 @@ export const useFileUpload = ({
|
|
|
183
182
|
if (isExtensionValid) {
|
|
184
183
|
uploadFile(file)
|
|
185
184
|
} else {
|
|
186
|
-
|
|
185
|
+
showAlert({ type: 'error',
|
|
187
186
|
title: t('fileNotUploaded', { fileName: file.name }),
|
|
188
187
|
message: t('invalidExtension', { extension: fileExtension }),
|
|
189
188
|
})
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import { useMemo } from 'react'
|
|
2
|
-
import { uniqueId, flatMap, flatten
|
|
2
|
+
import { uniqueId, flatMap, flatten } from 'lodash'
|
|
3
3
|
import { useIntl } from 'react-intl'
|
|
4
4
|
import { useTranslation } from 'react-i18next'
|
|
5
5
|
import { Product } from '@licklist/core/dist/DataMapper/Product/ProductDataMapper'
|
|
6
6
|
import { OrderModifier } from '@licklist/core/dist/DataMapper/Order/OrderModifierDataMapper'
|
|
7
|
+
import { OrderProduct } from '@licklist/core/dist/DataMapper/Order/OrderProductDataMapper'
|
|
7
8
|
import {
|
|
8
9
|
PAYMENT_TYPE_VAT,
|
|
9
10
|
PAYMENT_TYPE_FEE,
|
|
10
11
|
PAYMENT_TYPE_NET_PROFIT,
|
|
11
12
|
} from '@licklist/core/dist/DataMapper/Order/PaymentDataMapper'
|
|
12
13
|
import { StaticTableData } from '../../../../table'
|
|
13
|
-
import {
|
|
14
|
+
import { getTotalSumByCategory } from '../utils'
|
|
14
15
|
import { OrderItemsTableProps, SummaryItem } from '../types'
|
|
15
16
|
import { getOrderSummaryItems } from '../utils/paymentSummary'
|
|
16
|
-
import { Order } from '@licklist/core/dist/DataMapper'
|
|
17
|
-
import { OrderPayment } from '@licklist/core/dist/DataMapper/Order/OrderPaymentDataMapper'
|
|
18
|
-
import { OrderProduct } from '@licklist/core/dist/DataMapper/Order/OrderProductDataMapper'
|
|
19
|
-
import { OrderModifierByProduct } from '@licklist/core/dist/DataMapper/Order/OrderModifiierByProduct'
|
|
20
17
|
|
|
21
18
|
const CURRENCY_DEFAULT = 'GBP'
|
|
19
|
+
|
|
22
20
|
export const PAYMENT_TYPE_TRANSLATE_KEYS = {
|
|
23
21
|
[PAYMENT_TYPE_NET_PROFIT]: 'netAmount',
|
|
24
22
|
[PAYMENT_TYPE_FEE]: 'bookeditFee',
|
|
@@ -41,43 +39,62 @@ export const useTableData = ({
|
|
|
41
39
|
})
|
|
42
40
|
|
|
43
41
|
const wrapLabelContent = (string: string) => (
|
|
44
|
-
<div className=
|
|
42
|
+
<div className="label">{string}</div>
|
|
45
43
|
)
|
|
46
44
|
|
|
47
45
|
const renderCategoryItem = (products: Product[]) => ({
|
|
48
46
|
key: uniqueId('category-id-'),
|
|
49
|
-
name: wrapLabelContent(products[0]
|
|
47
|
+
name: wrapLabelContent(products[0]?.productCategory?.name ?? ''),
|
|
50
48
|
quantity: '',
|
|
51
49
|
price: wrapLabelContent(
|
|
52
50
|
`${t('total')}: ${formatPrice(
|
|
53
|
-
getTotalSumByCategory(order.orderProducts, products),
|
|
51
|
+
getTotalSumByCategory(order.orderProducts ?? [], products),
|
|
54
52
|
)}`,
|
|
55
53
|
),
|
|
56
54
|
})
|
|
57
55
|
|
|
58
|
-
const reworkProductStructure = (order: OrderProduct) =>
|
|
59
|
-
order
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
56
|
+
const reworkProductStructure = (order: OrderProduct) => {
|
|
57
|
+
if (!order) return []
|
|
58
|
+
|
|
59
|
+
const groups: any[] = (order as any)?.orderProductModifiersGroups ?? []
|
|
60
|
+
if (!Array.isArray(groups) || !groups.length) return [order]
|
|
61
|
+
|
|
62
|
+
return groups.flatMap((modGroup, idx) => ({
|
|
63
|
+
deletedAt: order.deletedAt ?? null,
|
|
64
|
+
id: `${order.id}-${idx + 1}`,
|
|
65
|
+
orderId: order.orderId ?? null,
|
|
66
|
+
price: order.price ?? 0,
|
|
67
|
+
productId: order.productId ?? '',
|
|
68
|
+
quantity: modGroup?.productQuantity ?? 1,
|
|
69
|
+
deposit: order.deposit ?? 0,
|
|
70
|
+
orderProductModifiers:
|
|
71
|
+
(modGroup?.modifiers ?? []).map((mod: any) => ({
|
|
72
|
+
modifierId: mod?.modifierId ?? '',
|
|
73
|
+
price: mod?.price ?? 0,
|
|
74
|
+
productId: mod?.productId ?? '',
|
|
75
|
+
quantity: mod?.quantity ?? 1,
|
|
76
|
+
modifierSetId: mod?.modifierSetId ?? '',
|
|
77
|
+
modifier: mod?.modifier ?? null,
|
|
78
|
+
})) ?? [],
|
|
79
|
+
}))
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const renderModifierItem = (orderModifier: OrderModifier) => {
|
|
83
|
+
if (!orderModifier || orderModifier.quantity === 0) return null
|
|
84
|
+
const { quantity, modifier, modifierId, price } = orderModifier
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
key: modifierId,
|
|
88
|
+
name: ` - ${modifier?.name || ''}`,
|
|
89
|
+
quantity: (
|
|
90
|
+
<div className="quantity">
|
|
91
|
+
<div className="multiplier">x</div>
|
|
92
|
+
{quantity}
|
|
93
|
+
</div>
|
|
94
|
+
),
|
|
95
|
+
price: formatPrice(price ?? 0),
|
|
96
|
+
}
|
|
97
|
+
}
|
|
81
98
|
|
|
82
99
|
const renderProductItem = ({
|
|
83
100
|
product,
|
|
@@ -86,43 +103,26 @@ export const useTableData = ({
|
|
|
86
103
|
product: OrderProduct
|
|
87
104
|
productsForCategory: Product[]
|
|
88
105
|
}) => {
|
|
89
|
-
if (product.quantity === 0)
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
106
|
+
if (!product || product.quantity === 0) return null
|
|
107
|
+
|
|
93
108
|
const name =
|
|
94
|
-
productsForCategory.find((item) => item.id === product.productId)?.name ||
|
|
109
|
+
productsForCategory.find((item) => item.id === product.productId)?.name ||
|
|
110
|
+
''
|
|
95
111
|
|
|
96
112
|
return {
|
|
97
113
|
key: product.id,
|
|
98
114
|
name,
|
|
99
115
|
quantity: (
|
|
100
|
-
<div className=
|
|
101
|
-
<div className=
|
|
116
|
+
<div className="quantity">
|
|
117
|
+
<div className="multiplier">x</div>
|
|
102
118
|
{product.quantity}
|
|
103
119
|
</div>
|
|
104
120
|
),
|
|
105
|
-
price: formatPrice(product.price),
|
|
106
|
-
modifier:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const renderModifierItem = (orderModifier: OrderModifier) => {
|
|
111
|
-
const { quantity, modifier, modifierId, price } = orderModifier
|
|
112
|
-
if (quantity === 0) {
|
|
113
|
-
return null
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return {
|
|
117
|
-
key: modifierId,
|
|
118
|
-
name: ` - ${modifier?.name || ''}`,
|
|
119
|
-
quantity: (
|
|
120
|
-
<div className='quantity'>
|
|
121
|
-
<div className='multiplier'>x</div>
|
|
122
|
-
{quantity}
|
|
123
|
-
</div>
|
|
124
|
-
),
|
|
125
|
-
price: formatPrice(price),
|
|
121
|
+
price: formatPrice(product.price ?? 0),
|
|
122
|
+
modifier:
|
|
123
|
+
(product?.orderProductModifiers?.map(renderModifierItem) ?? []).filter(
|
|
124
|
+
Boolean,
|
|
125
|
+
),
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -132,41 +132,40 @@ export const useTableData = ({
|
|
|
132
132
|
]
|
|
133
133
|
|
|
134
134
|
return productCategories.reduce(
|
|
135
|
-
(
|
|
136
|
-
const productsForCategory =
|
|
137
|
-
(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
)
|
|
145
|
-
|
|
146
|
-
if (!products.length) {
|
|
147
|
-
return previousValues
|
|
148
|
-
}
|
|
135
|
+
(acc: StaticTableData[], categoryId) => {
|
|
136
|
+
const productsForCategory =
|
|
137
|
+
order?.products.filter((p) => p.productCategoryId === categoryId) ?? []
|
|
138
|
+
|
|
139
|
+
const products =
|
|
140
|
+
order?.orderProducts?.filter((el) =>
|
|
141
|
+
productsForCategory.map((p) => p.id).includes(el.productId),
|
|
142
|
+
) ?? []
|
|
143
|
+
|
|
144
|
+
if (!products.length) return acc
|
|
145
|
+
|
|
149
146
|
const productsWithReworkedModifier = products.map((product) => {
|
|
150
|
-
if (!product
|
|
147
|
+
if (!product?.orderProductModifiers?.length) return product
|
|
151
148
|
return reworkProductStructure(product)
|
|
152
149
|
})
|
|
153
150
|
|
|
154
|
-
const filteredProducts =
|
|
155
|
-
(
|
|
156
|
-
renderProductItem({
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
151
|
+
const filteredProducts = flatten(productsWithReworkedModifier)
|
|
152
|
+
.map((p) =>
|
|
153
|
+
renderProductItem({
|
|
154
|
+
product: p as OrderProduct,
|
|
155
|
+
productsForCategory,
|
|
156
|
+
}),
|
|
157
|
+
)
|
|
158
|
+
.filter((row): row is NonNullable<typeof row> => Boolean(row))
|
|
159
|
+
|
|
160
|
+
if (!filteredProducts.length) return acc
|
|
163
161
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
162
|
+
const productWithModifier = flatMap(filteredProducts, (row) => [
|
|
163
|
+
row,
|
|
164
|
+
...(row.modifier ?? []),
|
|
165
|
+
])
|
|
167
166
|
|
|
168
167
|
return [
|
|
169
|
-
...
|
|
168
|
+
...acc,
|
|
170
169
|
renderCategoryItem(productsForCategory),
|
|
171
170
|
...productWithModifier,
|
|
172
171
|
]
|
|
@@ -183,26 +182,21 @@ export const useTableData = ({
|
|
|
183
182
|
price: wrapLabelContent(formatPrice(price)),
|
|
184
183
|
}))
|
|
185
184
|
|
|
186
|
-
const data = useMemo(
|
|
187
|
-
()
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
]
|
|
203
|
-
},
|
|
204
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
205
|
-
[order, externalDiscount, isPaymentProcessed],
|
|
206
|
-
)
|
|
185
|
+
const data = useMemo(() => {
|
|
186
|
+
if (!order) return []
|
|
187
|
+
|
|
188
|
+
return [
|
|
189
|
+
...renderProductsContent(),
|
|
190
|
+
...renderSummaryItems(
|
|
191
|
+
getOrderSummaryItems({
|
|
192
|
+
order,
|
|
193
|
+
paymentDetail,
|
|
194
|
+
isPaymentProcessed,
|
|
195
|
+
externalDiscount,
|
|
196
|
+
}),
|
|
197
|
+
),
|
|
198
|
+
]
|
|
199
|
+
}, [order, externalDiscount, isPaymentProcessed, paymentDetail])
|
|
200
|
+
|
|
207
201
|
return data
|
|
208
202
|
}
|
package/src/index.ts
CHANGED
|
@@ -32,42 +32,41 @@ export const Dialog = ({
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
<Modal
|
|
36
|
+
show={isActive}
|
|
37
|
+
onHide={onDecline}
|
|
38
|
+
animation={false}
|
|
39
|
+
size='sm'
|
|
40
|
+
centered
|
|
41
|
+
className='text-center justify-content-center rounded'
|
|
42
|
+
>
|
|
43
|
+
{/* @ts-ignore */}
|
|
44
|
+
<Modal.Header className='justify-content-center border-0'>
|
|
45
|
+
{title && <Modal.Title as='h6'>{title}</Modal.Title>}
|
|
46
|
+
</Modal.Header>
|
|
47
|
+
{content && (
|
|
48
|
+
<Modal.Body className='justify-content-center'>{content}</Modal.Body>
|
|
49
|
+
)}
|
|
50
|
+
<Modal.Footer className='border-0 justify-content-center'>
|
|
51
|
+
{customButtons || (
|
|
52
|
+
<>
|
|
53
|
+
<Button
|
|
54
|
+
variant='secondary'
|
|
55
|
+
className='modal-buttons'
|
|
56
|
+
onClick={declineHandler}
|
|
57
|
+
>
|
|
58
|
+
{t('cancel')}
|
|
59
|
+
</Button>
|
|
60
|
+
<Button
|
|
61
|
+
variant='primary'
|
|
62
|
+
className='modal-buttons'
|
|
63
|
+
onClick={approveHandler}
|
|
64
|
+
>
|
|
65
|
+
{t('Design:confirm')}
|
|
66
|
+
</Button>
|
|
67
|
+
</>
|
|
49
68
|
)}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<>
|
|
53
|
-
<Button
|
|
54
|
-
variant='secondary'
|
|
55
|
-
className='modal-buttons'
|
|
56
|
-
onClick={declineHandler}
|
|
57
|
-
>
|
|
58
|
-
{t('cancel')}
|
|
59
|
-
</Button>
|
|
60
|
-
<Button
|
|
61
|
-
variant='primary'
|
|
62
|
-
className='modal-buttons'
|
|
63
|
-
onClick={approveHandler}
|
|
64
|
-
>
|
|
65
|
-
{t('Design:confirm')}
|
|
66
|
-
</Button>
|
|
67
|
-
</>
|
|
68
|
-
)}
|
|
69
|
-
</Modal.Footer>
|
|
70
|
-
</Modal>
|
|
71
|
-
</>
|
|
69
|
+
</Modal.Footer>
|
|
70
|
+
</Modal>
|
|
72
71
|
)
|
|
73
72
|
}
|
|
@@ -35,8 +35,6 @@ export function EmailTemplateCard({
|
|
|
35
35
|
return (
|
|
36
36
|
<div className='snippet-template-card'>
|
|
37
37
|
<div className='snippet-template-card-header'>
|
|
38
|
-
{/* TODO fix issue react router types
|
|
39
|
-
@ts-expect-error */}
|
|
40
38
|
<Link to={href}>{name}</Link>
|
|
41
39
|
{hasPermission && Boolean(onRemove) && (
|
|
42
40
|
<ConfirmModal
|
|
@@ -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
|
-
|
|
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 || []}
|
|
@@ -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
|
|
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
|
|
|
@@ -16,11 +16,8 @@ export const Profile = ({ user }: ProfileProps) => {
|
|
|
16
16
|
return null
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const {
|
|
20
|
-
|
|
21
|
-
lastName,
|
|
22
|
-
userDetail: { gender },
|
|
23
|
-
} = user
|
|
19
|
+
const { firstName, lastName, userDetail } = user
|
|
20
|
+
const gender = userDetail?.gender
|
|
24
21
|
|
|
25
22
|
return (
|
|
26
23
|
<div className='profile'>
|
|
@@ -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
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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>
|