@licklist/design 0.71.18-dev.3 → 0.71.18-dev.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.
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.d.ts +18 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.d.ts.map +1 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.js +281 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.d.ts +15 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.d.ts.map +1 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.js +89 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts +16 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts.map +1 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.js +447 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.d.ts +12 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.d.ts.map +1 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.js +45 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/index.d.ts +2 -0
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/index.d.ts.map +1 -0
- package/dist/iframe/ProductWithModifierModal/index.d.ts +2 -0
- package/dist/iframe/ProductWithModifierModal/index.d.ts.map +1 -0
- package/dist/iframe/event/ticket-description/TicketDescription.d.ts +2 -1
- package/dist/iframe/event/ticket-description/TicketDescription.d.ts.map +1 -1
- package/dist/iframe/event/ticket-description/TicketDescription.js +4 -3
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.js +29 -2
- package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts +4 -0
- package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/utils/index.js +27 -2
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.js +106 -2
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +3 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +95 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductWithModifier/ProductWithModifier.d.ts +22 -0
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductWithModifier/ProductWithModifier.d.ts.map +1 -0
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductWithModifier/ProductWithModifier.js +62 -0
- package/dist/iframe/order-process/components/CategoryProduct/constants.d.ts +2 -0
- package/dist/iframe/order-process/components/CategoryProduct/constants.d.ts.map +1 -0
- package/dist/iframe/order-process/components/CategoryProduct/constants.js +4 -0
- package/dist/iframe/order-process/components/utils/useOnWindowUnmount.d.ts +6 -0
- package/dist/iframe/order-process/components/utils/useOnWindowUnmount.d.ts.map +1 -0
- package/dist/iframe/order-process/components/utils/useOnWindowUnmount.js +18 -0
- package/dist/iframe/payment/order-items-table/hooks/useTableData.d.ts.map +1 -1
- package/dist/iframe/payment/order-items-table/hooks/useTableData.js +83 -10
- package/dist/iframe/payment/order-items-table/utils/index.d.ts.map +1 -1
- package/dist/iframe/payment/order-items-table/utils/index.js +15 -0
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +2 -2
- package/dist/product-set/form/ProductSetForm.d.ts +3 -1
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +6 -4
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +17 -5
- package/dist/product-set/form/context.d.ts +3 -1
- package/dist/product-set/form/context.d.ts.map +1 -1
- package/dist/product-set/form/context.js +2 -1
- package/dist/product-set/product/ProductControl.d.ts +8 -0
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +25 -1
- package/dist/product-set/utils/index.d.ts +88 -0
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.js +19 -1
- package/dist/sales/coupon/utils/index.d.ts +2 -1
- package/dist/sales/coupon/utils/index.d.ts.map +1 -1
- package/dist/styles/iframe-page/Page.scss +16 -0
- package/dist/styles/iframe-page/PageBody.scss +4 -0
- package/dist/styles/modals/Modals.scss +16 -0
- package/dist/styles/product-set/ProductSetForm.scss +10 -0
- package/dist/styles/sales/ManualBooking.scss +6 -0
- package/dist/styles/themes/bookedit/index.scss +14 -0
- package/package.json +6 -6
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.tsx +205 -0
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.tsx +75 -0
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx +471 -0
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ProductControll.tsx +55 -0
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/index.ts +1 -0
- package/src/iframe/ProductWithModifierModal/index.ts +1 -0
- package/src/iframe/event/ticket-description/TicketDescription.tsx +5 -3
- package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +32 -1
- package/src/iframe/order-process/components/BookingSummary/utils/index.ts +45 -1
- package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +155 -75
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +58 -1
- package/src/iframe/order-process/components/CategoryProduct/components/ProductWithModifier/ProductWithModifier.tsx +84 -0
- package/src/iframe/order-process/components/CategoryProduct/constants.ts +1 -0
- package/src/iframe/order-process/components/utils/useOnWindowUnmount.ts +25 -0
- package/src/iframe/payment/order-items-table/hooks/useTableData.tsx +84 -14
- package/src/iframe/payment/order-items-table/utils/index.ts +23 -0
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +2 -2
- package/src/product-set/form/ProductSetForm.tsx +11 -3
- package/src/product-set/form/ProductsControl.tsx +24 -15
- package/src/product-set/form/context.tsx +5 -0
- package/src/product-set/product/ProductControl.tsx +37 -1
- package/src/product-set/utils/index.ts +19 -0
- package/src/sales/coupon/utils/index.ts +5 -3
- package/src/styles/iframe-page/Page.scss +16 -0
- package/src/styles/iframe-page/PageBody.scss +4 -0
- package/src/styles/modals/Modals.scss +16 -0
- package/src/styles/product-set/ProductSetForm.scss +10 -0
- package/src/styles/sales/ManualBooking.scss +6 -0
- package/src/styles/themes/bookedit/index.scss +14 -0
- package/yarn.lock +171 -199
|
@@ -23,7 +23,7 @@ const paymentNotProcessedSummary = ({
|
|
|
23
23
|
? getExternalPaymentDetail(paymentDetail)
|
|
24
24
|
: undefined
|
|
25
25
|
|
|
26
|
-
const total = calculateTotalPrice(order, externalPaymentDetail)
|
|
26
|
+
const total = order?.fullAmount || calculateTotalPrice(order, externalPaymentDetail)
|
|
27
27
|
|
|
28
28
|
const summaryItems: SummaryItem[] = [
|
|
29
29
|
{
|
|
@@ -58,7 +58,7 @@ const processedPaymentSummary = ({
|
|
|
58
58
|
price: getPaymentValueByType(order.payments, key),
|
|
59
59
|
}))
|
|
60
60
|
|
|
61
|
-
const total = calculateTotalPrice(order, externalPaymentDetail)
|
|
61
|
+
const total = order.fullAmount || calculateTotalPrice(order, externalPaymentDetail)
|
|
62
62
|
|
|
63
63
|
const totalDiscount = calculateTotalDiscount(order.payments)
|
|
64
64
|
|
|
@@ -6,6 +6,7 @@ import { TFunction, useTranslation } from 'react-i18next'
|
|
|
6
6
|
import { VenueMapSet } from '@licklist/core/dist/DataMapper/Product/VenueMapSetDataMapper'
|
|
7
7
|
import { ServerError } from '@licklist/plugins/dist/hooks/Api/useHttpQuery'
|
|
8
8
|
import FormErrorService from '@licklist/plugins/dist/services/Form/FormErrorService'
|
|
9
|
+
import { ModifierSet } from '@licklist/core/dist/DataMapper/Product/ModifierSetDataMapper'
|
|
9
10
|
|
|
10
11
|
import { isEqual } from 'lodash'
|
|
11
12
|
// eslint-disable-next-line max-len
|
|
@@ -22,7 +23,11 @@ import {
|
|
|
22
23
|
import { Step } from '../types'
|
|
23
24
|
import { ProductSetContextProvider, ProductSetLoadingContext } from './context'
|
|
24
25
|
import { SelectItem } from '../../types/generic/SelectItem'
|
|
25
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
checkAvailableTimesErrors,
|
|
28
|
+
updateModifiersSetAtProductSetForm,
|
|
29
|
+
getFilteredTemplates,
|
|
30
|
+
} from '../utils'
|
|
26
31
|
import { ErrorModal } from '../../iframe/order-process/components/ErrorModal'
|
|
27
32
|
|
|
28
33
|
export interface WithIsLoading {
|
|
@@ -62,6 +67,7 @@ export interface ProductSetFormProps
|
|
|
62
67
|
saleDeadline?: number
|
|
63
68
|
isCreateNewOverrides?: boolean
|
|
64
69
|
timeZone: string
|
|
70
|
+
modifiersSetList?: ModifierSet[]
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
export function ProductSetForm({
|
|
@@ -71,6 +77,7 @@ export function ProductSetForm({
|
|
|
71
77
|
onSubmitAndRedirect,
|
|
72
78
|
onSubmitNoRedirect,
|
|
73
79
|
productGroupList,
|
|
80
|
+
modifiersSetList,
|
|
74
81
|
serverErrors,
|
|
75
82
|
providerHasMap = false,
|
|
76
83
|
venueMapSets = [],
|
|
@@ -95,7 +102,7 @@ export function ProductSetForm({
|
|
|
95
102
|
const [errorMessage, setErrorMessage] = useState('')
|
|
96
103
|
|
|
97
104
|
const form = useForm<ProductSetFormValues>({
|
|
98
|
-
defaultValues,
|
|
105
|
+
defaultValues: updateModifiersSetAtProductSetForm(defaultValues),
|
|
99
106
|
mode: 'onChange',
|
|
100
107
|
})
|
|
101
108
|
|
|
@@ -122,7 +129,7 @@ export function ProductSetForm({
|
|
|
122
129
|
if (!defaultValues || isEqual(defaultValues, formValues)) {
|
|
123
130
|
return
|
|
124
131
|
}
|
|
125
|
-
reset(defaultValues)
|
|
132
|
+
reset(updateModifiersSetAtProductSetForm(defaultValues))
|
|
126
133
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
127
134
|
}, [defaultValues])
|
|
128
135
|
|
|
@@ -162,6 +169,7 @@ export function ProductSetForm({
|
|
|
162
169
|
<ProductSetContextProvider
|
|
163
170
|
productGroupList={productGroupList}
|
|
164
171
|
providerHasMap={providerHasMap}
|
|
172
|
+
modifiersSetList={modifiersSetList}
|
|
165
173
|
venueMapSets={venueMapSets}
|
|
166
174
|
providerHasBookingManagement={providerHasBookingManagement}
|
|
167
175
|
zones={zones}
|
|
@@ -49,6 +49,8 @@ const getDefaultProductValue = (sort: number): Product => ({
|
|
|
49
49
|
maxQuantity: null,
|
|
50
50
|
totalQuantity: 0,
|
|
51
51
|
isAvailable: true,
|
|
52
|
+
modifiersSet: [],
|
|
53
|
+
modifiersSetsId: [],
|
|
52
54
|
isSoldOut: false,
|
|
53
55
|
isRequired: false,
|
|
54
56
|
isUnlimited: false,
|
|
@@ -198,6 +200,8 @@ export function ProductsControl({
|
|
|
198
200
|
? !!product.id
|
|
199
201
|
: isOverrides && !!product.originalProductId
|
|
200
202
|
|
|
203
|
+
const modifierSets = product?.modifiersSet.length || 0
|
|
204
|
+
|
|
201
205
|
const isNewProductOverrides = isCreateNewOverrides && !!product.id
|
|
202
206
|
|
|
203
207
|
return (
|
|
@@ -226,21 +230,26 @@ export function ProductsControl({
|
|
|
226
230
|
edit={() => edit(index)}
|
|
227
231
|
secondaryBadge={getBadgeConfig(categoryType, t(categoryType))}
|
|
228
232
|
subTitle={
|
|
229
|
-
<div className='
|
|
230
|
-
<div className='product-set-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
233
|
+
<div className='d-flex justify-content-between'>
|
|
234
|
+
<div className='product-set-badges-container'>
|
|
235
|
+
<div className='product-set-subtitle-dot product-set-subtitle-product-dot' />
|
|
236
|
+
<span>
|
|
237
|
+
{`£${prices[index]} ${t('each')} - ${t('qty')}:${
|
|
238
|
+
!isUnlimitedQuantities[index]
|
|
239
|
+
? ` ${quantities[index]}`
|
|
240
|
+
: t(' unlimited')
|
|
241
|
+
} ${
|
|
242
|
+
!isUnlimitedQuantities[index]
|
|
243
|
+
? ` - ${t('possibleRevenue')} £${
|
|
244
|
+
prices[index] * quantities[index]
|
|
245
|
+
}`
|
|
246
|
+
: ''
|
|
247
|
+
} `}
|
|
248
|
+
</span>
|
|
249
|
+
</div>
|
|
250
|
+
{!!modifierSets && (
|
|
251
|
+
<Badge className='modifier-badge'>{`${modifierSets} ${t('modifiersSets')}`}</Badge>
|
|
252
|
+
)}
|
|
244
253
|
</div>
|
|
245
254
|
}
|
|
246
255
|
modalLabel={t('addNewProduct')}
|
|
@@ -7,15 +7,18 @@ import {
|
|
|
7
7
|
Dispatch,
|
|
8
8
|
} from 'react'
|
|
9
9
|
import { VenueMapSet } from '@licklist/core/dist/DataMapper/Product/VenueMapSetDataMapper'
|
|
10
|
+
import { ModifierSet } from '@licklist/core/dist/DataMapper/Product/ModifierSetDataMapper'
|
|
10
11
|
// eslint-disable-next-line max-len
|
|
11
12
|
import { ProviderBookingManagementSetting } from '@licklist/core/dist/DataMapper/Provider/ProviderBookingManagementSettingDataMapper'
|
|
12
13
|
import { Zone } from '@licklist/core/dist/DataMapper/Provider/ZoneDataMapper'
|
|
13
14
|
import { SelectItem } from '../../types/generic/SelectItem'
|
|
14
15
|
|
|
16
|
+
|
|
15
17
|
interface LoadingContext {
|
|
16
18
|
isLoading: boolean
|
|
17
19
|
setLoading: (loading: boolean) => void
|
|
18
20
|
productGroupList?: SelectItem[]
|
|
21
|
+
modifiersSetList?: ModifierSet[] | null
|
|
19
22
|
providerHasMap?: boolean | null
|
|
20
23
|
venueMapSets?: VenueMapSet[]
|
|
21
24
|
providerHasBookingManagement?: ProviderBookingManagementSetting['hasBookingManagement']
|
|
@@ -43,6 +46,7 @@ type ProductSetContextProviderProps = PropsWithChildren<
|
|
|
43
46
|
export function ProductSetContextProvider({
|
|
44
47
|
children,
|
|
45
48
|
productGroupList = [],
|
|
49
|
+
modifiersSetList =[],
|
|
46
50
|
providerHasMap = false,
|
|
47
51
|
venueMapSets = [],
|
|
48
52
|
providerHasBookingManagement,
|
|
@@ -62,6 +66,7 @@ export function ProductSetContextProvider({
|
|
|
62
66
|
isLoading: loading,
|
|
63
67
|
setLoading,
|
|
64
68
|
productGroupList,
|
|
69
|
+
modifiersSetList,
|
|
65
70
|
providerHasMap,
|
|
66
71
|
venueMapSets,
|
|
67
72
|
providerHasBookingManagement,
|
|
@@ -39,6 +39,8 @@ import {
|
|
|
39
39
|
IMAGE_TYPE_IMAGE,
|
|
40
40
|
} from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
|
|
41
41
|
import { FaClipboard } from 'react-icons/fa'
|
|
42
|
+
import { Typeahead } from 'src/typeahead'
|
|
43
|
+
import { convertToTypeaheadOptions } from 'src/sales/coupon/utils'
|
|
42
44
|
import { checkIfZoneCategory } from '@licklist/plugins'
|
|
43
45
|
import { FileUpload } from '../../file-upload'
|
|
44
46
|
import { BooleanSwitch } from '../../static'
|
|
@@ -65,6 +67,14 @@ import { ProductZoneControlValues } from '../product-zone'
|
|
|
65
67
|
import { AdvancedOptions } from './advanced-options'
|
|
66
68
|
import { ProductZonesControl } from '../form/ProductZonesControl'
|
|
67
69
|
|
|
70
|
+
|
|
71
|
+
export interface ModifiersSet {
|
|
72
|
+
id: number
|
|
73
|
+
value?: string
|
|
74
|
+
name?: string
|
|
75
|
+
label?: string
|
|
76
|
+
}
|
|
77
|
+
|
|
68
78
|
// TO DO refactor this file
|
|
69
79
|
// and add correct types
|
|
70
80
|
export interface ProductControlValues
|
|
@@ -88,6 +98,8 @@ export interface ProductControlValues
|
|
|
88
98
|
hasSpecialNotes: boolean
|
|
89
99
|
minSpend?: number | null
|
|
90
100
|
type?: ProductType
|
|
101
|
+
modifiersSetsId?: Array<ModifiersSet>
|
|
102
|
+
modifiersSet?: Array<ModifiersSet>
|
|
91
103
|
weight?: number
|
|
92
104
|
tierId?: number
|
|
93
105
|
images: Image[] | null
|
|
@@ -111,6 +123,7 @@ export interface ProductControlProps<T>
|
|
|
111
123
|
hasTicket?: boolean
|
|
112
124
|
categoryType?: CategoryType
|
|
113
125
|
isOverrides?: boolean
|
|
126
|
+
|
|
114
127
|
}
|
|
115
128
|
|
|
116
129
|
export function ProductControl<T extends FormValues>({
|
|
@@ -126,6 +139,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
126
139
|
categoryType,
|
|
127
140
|
isOverrides = false,
|
|
128
141
|
}: ProductControlProps<T>) {
|
|
142
|
+
|
|
129
143
|
const {
|
|
130
144
|
register,
|
|
131
145
|
control,
|
|
@@ -135,14 +149,16 @@ export function ProductControl<T extends FormValues>({
|
|
|
135
149
|
watch,
|
|
136
150
|
} = useFormContext<T>()
|
|
137
151
|
|
|
138
|
-
const { setLoading } = useContext(ProductSetLoadingContext)
|
|
152
|
+
const { setLoading, modifiersSetList } = useContext(ProductSetLoadingContext)
|
|
139
153
|
const { t } = useTranslation(['Design', 'Validation', 'ProductSet'])
|
|
140
154
|
const [expanded, setExpanded] = useState(false)
|
|
155
|
+
|
|
141
156
|
const [initialImages, setInitialImages] = useState<Image[] | null>(null)
|
|
142
157
|
// @TODO: After checking "isUnlimited" checkbox need to reset field totalQuantity
|
|
143
158
|
const isUnlimited = Boolean(
|
|
144
159
|
watch(`${fieldNamePrefix}.isUnlimited` as Path<T>),
|
|
145
160
|
)
|
|
161
|
+
|
|
146
162
|
const advancedId = useId()
|
|
147
163
|
const nameId = useId()
|
|
148
164
|
|
|
@@ -200,6 +216,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
200
216
|
setInitialImages(formImages as Image[])
|
|
201
217
|
}, [getValues, setInitialImages, fieldNamePrefix])
|
|
202
218
|
|
|
219
|
+
|
|
203
220
|
useEffect(() => {
|
|
204
221
|
if (Array.isArray(images)) {
|
|
205
222
|
setValue(
|
|
@@ -212,6 +229,9 @@ export function ProductControl<T extends FormValues>({
|
|
|
212
229
|
|
|
213
230
|
const quantitySelector = quantityValue ?? '1'
|
|
214
231
|
const quantity = QUANTITY_TYPE_LIST_DTO[quantitySelector as string]
|
|
232
|
+
|
|
233
|
+
const modifierList = convertToTypeaheadOptions(modifiersSetList)
|
|
234
|
+
|
|
215
235
|
return (
|
|
216
236
|
<>
|
|
217
237
|
<Row>
|
|
@@ -354,6 +374,22 @@ export function ProductControl<T extends FormValues>({
|
|
|
354
374
|
</Form.Group>
|
|
355
375
|
</Col>
|
|
356
376
|
</Row>
|
|
377
|
+
<Row>
|
|
378
|
+
<Col>
|
|
379
|
+
<Form.Group className='mb-3'>
|
|
380
|
+
<Form.Label>{t('Design:addModifierSet')}</Form.Label>
|
|
381
|
+
<Typeahead
|
|
382
|
+
name='modifierList'
|
|
383
|
+
options={modifierList}
|
|
384
|
+
{...register(`${fieldNamePrefix}.modifiersSet` as Path<T>)}
|
|
385
|
+
isMultipleChoise
|
|
386
|
+
isCouponForm
|
|
387
|
+
placeholder={t('Design:choose')}
|
|
388
|
+
noOptionsMessage={t('Design:noSelectedModifier')}
|
|
389
|
+
/>
|
|
390
|
+
</Form.Group>
|
|
391
|
+
</Col>
|
|
392
|
+
</Row>
|
|
357
393
|
|
|
358
394
|
<Row className='my-4 mx-0 d-flex flex-column'>
|
|
359
395
|
{isZoneCategory && (
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { EmailTemplate } from '@licklist/core/dist/DataMapper/Notification/EmailTemplateDataMapper'
|
|
2
2
|
import { SmsTemplate } from '@licklist/core/dist/DataMapper/Notification/SmsTemplateDataMapper'
|
|
3
|
+
import { ModifierSet } from '@licklist/core/dist/DataMapper/Product/ModifierSetDataMapper'
|
|
4
|
+
import { convertToTypeaheadOptions } from 'src/sales/coupon/utils'
|
|
3
5
|
import { TFunction } from 'react-i18next'
|
|
4
6
|
import { UseFormSetError } from 'react-hook-form'
|
|
5
7
|
import { checkIfZoneCategory } from '@licklist/plugins'
|
|
@@ -7,6 +9,7 @@ import { ProductSet } from '@licklist/core/dist/DataMapper/Product/ProductSetDat
|
|
|
7
9
|
import { TemplateItem } from '../control/ProductSetControl'
|
|
8
10
|
import { ProductSetFormValues } from '../form/ProductSetForm'
|
|
9
11
|
|
|
12
|
+
|
|
10
13
|
interface CheckAvailableTimesErrors {
|
|
11
14
|
values: ProductSetFormValues
|
|
12
15
|
setError: UseFormSetError<ProductSetFormValues>
|
|
@@ -58,6 +61,22 @@ export const getFilteredTemplates = (
|
|
|
58
61
|
}))
|
|
59
62
|
}
|
|
60
63
|
|
|
64
|
+
export const updateModifiersSetAtProductSetForm = (data: ProductSetFormValues) => ({
|
|
65
|
+
...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
|
+
})),
|
|
76
|
+
})),
|
|
77
|
+
})),
|
|
78
|
+
});
|
|
79
|
+
|
|
61
80
|
export const checkAvailableTimesErrors = ({
|
|
62
81
|
values,
|
|
63
82
|
setError,
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
import { ModifierSet } from '@licklist/core/dist/DataMapper/Product/ModifierSetDataMapper'
|
|
1
3
|
import { ProductGroup } from '@licklist/core/dist/DataMapper/Product/ProductGroupDataMapper'
|
|
2
4
|
|
|
3
|
-
export const convertToTypeaheadOptions = (productGroups?: ProductGroup[]) => {
|
|
5
|
+
export const convertToTypeaheadOptions = (productGroups?: ProductGroup[] | ModifierSet[]) => {
|
|
4
6
|
if (!productGroups || !productGroups.length) {
|
|
5
7
|
return []
|
|
6
8
|
}
|
|
7
9
|
|
|
8
|
-
return productGroups.map(({ id, name }: ProductGroup) => ({
|
|
10
|
+
return productGroups.map(({ id, name }: ProductGroup | ModifierSet ) => ({
|
|
9
11
|
id: Number(id),
|
|
10
12
|
value: name,
|
|
11
|
-
label: name,
|
|
13
|
+
label: name ,
|
|
12
14
|
}))
|
|
13
15
|
}
|
|
@@ -24,6 +24,22 @@
|
|
|
24
24
|
min-width: auto;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
.manual-booking-form-modal {
|
|
28
|
+
width: 40vw !important;
|
|
29
|
+
left: 60vh;
|
|
30
|
+
|
|
31
|
+
.modal-content {
|
|
32
|
+
height: 96vh;
|
|
33
|
+
margin-left: auto;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@include media-breakpoint-down(sm) {
|
|
37
|
+
width: 100vw !important;
|
|
38
|
+
left: 0;
|
|
39
|
+
top: 10% !important;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
27
43
|
.header-block {
|
|
28
44
|
margin-bottom: 1rem;
|
|
29
45
|
}
|
|
@@ -6,6 +6,22 @@
|
|
|
6
6
|
z-index: 1080;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
.manual-booking-form-modal {
|
|
10
|
+
width: 40vw !important;
|
|
11
|
+
left: 66vw;
|
|
12
|
+
|
|
13
|
+
.modal-content {
|
|
14
|
+
min-height: 95vh;
|
|
15
|
+
margin-left: auto;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@include media-breakpoint-down(sm) {
|
|
19
|
+
width: 100vw !important;
|
|
20
|
+
left: 0;
|
|
21
|
+
top: 10% !important;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
9
25
|
.confirm-modal {
|
|
10
26
|
z-index: 1081;
|
|
11
27
|
}
|
|
@@ -58,6 +58,11 @@
|
|
|
58
58
|
font-weight: 600;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
.modifier-badge {
|
|
62
|
+
font-size: 0.5rem;
|
|
63
|
+
font-weight: 400;
|
|
64
|
+
}
|
|
65
|
+
|
|
61
66
|
.step-badge {
|
|
62
67
|
background-color: #ffdbdb;
|
|
63
68
|
color: #d52902;
|
|
@@ -81,6 +86,11 @@
|
|
|
81
86
|
background-color: #e9f5ea;
|
|
82
87
|
color: #269b36;
|
|
83
88
|
}
|
|
89
|
+
|
|
90
|
+
.modifier-badge {
|
|
91
|
+
background-color: #e9f5ea;
|
|
92
|
+
color: #269b36;
|
|
93
|
+
}
|
|
84
94
|
}
|
|
85
95
|
|
|
86
96
|
.product-set-mobile-footer {
|
|
@@ -51,6 +51,20 @@
|
|
|
51
51
|
border-bottom: 1px solid #f0f0f0;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
.modifier-header {
|
|
55
|
+
background-color: color('white');
|
|
56
|
+
padding: 0 2.5rem;
|
|
57
|
+
z-index: 2;
|
|
58
|
+
margin-top: 1rem;
|
|
59
|
+
min-height: 2rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.modifier-container {
|
|
63
|
+
background-color: color('white');
|
|
64
|
+
border-bottom: 2px solid #f0f0f0;
|
|
65
|
+
padding-bottom: 1rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
54
68
|
.header-user-image {
|
|
55
69
|
width: 3rem;
|
|
56
70
|
height: 3rem;
|