@licklist/design 0.71.5-dev.0 → 0.71.5-dev.10
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/SaleDeadline/SaleDeadline.d.ts +7 -1
- package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.js +10 -7
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +2 -0
- package/dist/events/edit-event-modal/hooks/useValidationOptions.d.ts +0 -1
- package/dist/events/edit-event-modal/hooks/useValidationOptions.d.ts.map +1 -1
- package/dist/events/edit-event-modal/hooks/useValidationOptions.js +1 -6
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -0
- package/dist/events/edit-recurrent-event-modal/EditRecurrentEventModal.d.ts.map +1 -1
- package/dist/events/edit-recurrent-event-modal/EditRecurrentEventModal.js +1 -0
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts +2 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.js +2 -2
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.js +3 -2
- package/dist/events/event-statistic-modal/utils/index.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/utils/index.js +4 -5
- package/dist/iframe/page/components/PageBody/constants.d.ts +1 -0
- package/dist/iframe/page/components/PageBody/constants.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/constants.js +2 -1
- package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.js +6 -1
- package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.js +4 -3
- package/dist/product-set/control/ProductSetControl.d.ts +2 -0
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +5 -0
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +1 -0
- package/dist/product-set/form/ProductSetForm.d.ts +2 -1
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +2 -1
- package/dist/product-set/form/ProductsControl.js +1 -0
- package/dist/product-set/product/advanced-options/AdvancedOptions.js +1 -0
- package/dist/product-set/product-category/ProductCategoryControl.d.ts +1 -0
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +7 -1
- package/dist/snippet/snippet-template/preview/Preview.js +1 -0
- package/package.json +8 -7
- package/src/events/edit-event-modal/component/SaleDeadline/SaleDeadline.tsx +42 -16
- package/src/events/edit-event-modal/hooks/useValidationOptions.tsx +0 -5
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -0
- package/src/events/edit-recurrent-event-modal/EditRecurrentEventModal.tsx +6 -1
- package/src/events/event-statistic-modal/EventStatisticModal.tsx +3 -1
- package/src/events/event-statistic-modal/hooks/useTableData.tsx +5 -3
- package/src/events/event-statistic-modal/utils/index.ts +5 -13
- package/src/iframe/page/components/PageBody/constants.ts +1 -0
- package/src/iframe/page/components/PageBody/hooks/useResizePageBody.ts +11 -2
- package/src/iframe/ryft/RyftPaymentForm.tsx +10 -8
- package/src/product-set/control/ProductSetControl.tsx +5 -0
- package/src/product-set/form/ProductCategoriesControl.tsx +1 -0
- package/src/product-set/form/ProductSetForm.tsx +2 -0
- package/src/product-set/product-category/ProductCategoryControl.tsx +13 -0
- package/yarn.lock +570 -494
|
@@ -9,6 +9,9 @@ import { Switch, NumberInput } from '../../../../static'
|
|
|
9
9
|
const SALE_DEADLINE_BEFORE_TYPE = 'before'
|
|
10
10
|
const SALE_DEADLINE_AFTER_TYPE = 'after'
|
|
11
11
|
|
|
12
|
+
export const SALE_DEADLINE_NAME_CATEGORY = 'saleDeadlineCategory'
|
|
13
|
+
export const SALE_DEADLINE_NAME = 'saleDeadline'
|
|
14
|
+
|
|
12
15
|
const SALE_DEADLINES_EVENT_START_TYPES = [
|
|
13
16
|
{ type: SALE_DEADLINE_BEFORE_TYPE },
|
|
14
17
|
{ type: SALE_DEADLINE_AFTER_TYPE },
|
|
@@ -18,11 +21,28 @@ type DeadlineType =
|
|
|
18
21
|
| typeof SALE_DEADLINE_BEFORE_TYPE
|
|
19
22
|
| typeof SALE_DEADLINE_AFTER_TYPE
|
|
20
23
|
|
|
24
|
+
export const DEADLINE_NAME = [
|
|
25
|
+
SALE_DEADLINE_NAME_CATEGORY,
|
|
26
|
+
SALE_DEADLINE_NAME,
|
|
27
|
+
] as const
|
|
28
|
+
|
|
29
|
+
export type DeadLineNameType = (typeof DEADLINE_NAME)[number]
|
|
30
|
+
|
|
21
31
|
type SaleDeadlineType = {
|
|
22
32
|
saleDeadline: null | number
|
|
33
|
+
} | {
|
|
34
|
+
[key: string] : null | number
|
|
23
35
|
}
|
|
24
36
|
|
|
25
|
-
export const SaleDeadline = ({
|
|
37
|
+
export const SaleDeadline = ({
|
|
38
|
+
disabled = false,
|
|
39
|
+
onlyBefore = false,
|
|
40
|
+
deadLineCategory,
|
|
41
|
+
}: {
|
|
42
|
+
disabled?: boolean
|
|
43
|
+
onlyBefore?: boolean
|
|
44
|
+
deadLineCategory?: string
|
|
45
|
+
}) => {
|
|
26
46
|
const { t } = useTranslation(['Design'])
|
|
27
47
|
const {
|
|
28
48
|
control,
|
|
@@ -32,9 +52,11 @@ export const SaleDeadline = ({ disabled = false }: { disabled?: boolean }) => {
|
|
|
32
52
|
const [deadlineType, setDeadlineType] = useState<DeadlineType>(
|
|
33
53
|
SALE_DEADLINE_BEFORE_TYPE,
|
|
34
54
|
)
|
|
35
|
-
|
|
55
|
+
|
|
56
|
+
const saleDeadline = watch(deadLineCategory || SALE_DEADLINE_NAME)
|
|
36
57
|
|
|
37
58
|
useEffect(() => {
|
|
59
|
+
if (onlyBefore) return
|
|
38
60
|
if (saleDeadline > 0) {
|
|
39
61
|
setDeadlineType(SALE_DEADLINE_AFTER_TYPE)
|
|
40
62
|
}
|
|
@@ -45,11 +67,11 @@ export const SaleDeadline = ({ disabled = false }: { disabled?: boolean }) => {
|
|
|
45
67
|
<Form.Group className='sales-deadline'>
|
|
46
68
|
<Form.Label>{t('Design:salesDeadline')}</Form.Label>
|
|
47
69
|
<Form.Control.Feedback type='invalid'>
|
|
48
|
-
{errors.
|
|
70
|
+
{errors.root?.message}
|
|
49
71
|
</Form.Control.Feedback>
|
|
50
72
|
<Controller
|
|
51
73
|
control={control}
|
|
52
|
-
name=
|
|
74
|
+
name={deadLineCategory || SALE_DEADLINE_NAME}
|
|
53
75
|
render={({
|
|
54
76
|
field: { value, onChange },
|
|
55
77
|
fieldState: { invalid, error },
|
|
@@ -111,18 +133,22 @@ export const SaleDeadline = ({ disabled = false }: { disabled?: boolean }) => {
|
|
|
111
133
|
|
|
112
134
|
return (
|
|
113
135
|
<>
|
|
114
|
-
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
136
|
+
{!onlyBefore && (
|
|
137
|
+
<Form.Group className='d-flex flex-column flex-grow-1 align-items-start'>
|
|
138
|
+
<Switch
|
|
139
|
+
name='sale-deadline'
|
|
140
|
+
options={SALE_DEADLINES_EVENT_START_TYPES.map(
|
|
141
|
+
({ type }) => ({
|
|
142
|
+
id: type,
|
|
143
|
+
value: t(`Design:${type}`),
|
|
144
|
+
}),
|
|
145
|
+
)}
|
|
146
|
+
value={deadlineType}
|
|
147
|
+
onChange={changeValueByType}
|
|
148
|
+
disabled={disabled}
|
|
149
|
+
/>
|
|
150
|
+
</Form.Group>
|
|
151
|
+
)}
|
|
126
152
|
<div className='d-flex'>
|
|
127
153
|
<Form.Group className='d-flex flex-column col-4 pl-0'>
|
|
128
154
|
<Form.Label>{t('Design:saleDays')}</Form.Label>
|
|
@@ -12,11 +12,6 @@ export const useValidationOptions = () => {
|
|
|
12
12
|
required: t('Validation:fieldRequired', {
|
|
13
13
|
attribute: t('start'),
|
|
14
14
|
}) as string,
|
|
15
|
-
// TODO: uncomment when event splitting is implemented
|
|
16
|
-
// and extract into plugins
|
|
17
|
-
validate: (value) =>
|
|
18
|
-
DateTime.fromISO(value).diffNow().toMillis() > 0 ||
|
|
19
|
-
(t('Validation:fieldValidEventStart') as string),
|
|
20
15
|
},
|
|
21
16
|
|
|
22
17
|
end: {
|
|
@@ -20,6 +20,7 @@ export const getDefaultValues = (
|
|
|
20
20
|
relyOnPeopleType: productSet?.relyOnPeopleType ?? null,
|
|
21
21
|
thankYouPageUrl: productSet?.thankYouPageUrl ?? '',
|
|
22
22
|
fieldSetId: productSet?.fieldSetId,
|
|
23
|
+
saleDeadline: productSet?.saleDeadline,
|
|
23
24
|
emailTemplates:
|
|
24
25
|
productSet?.mailTemplates && productSet?.mailTemplates?.length > 0
|
|
25
26
|
? getFilteredTemplates(productSet?.mailTemplates)
|
|
@@ -61,7 +61,12 @@ export const EditRecurrentEventModal = ({
|
|
|
61
61
|
<Form onSubmit={handleSubmit(onSubmit)} noValidate>
|
|
62
62
|
<Modal.Header className='border-0'>
|
|
63
63
|
<Modal.Title as='h6'>{title}</Modal.Title>
|
|
64
|
-
<Button
|
|
64
|
+
<Button
|
|
65
|
+
variant='danger'
|
|
66
|
+
className='btn-sm rounded'
|
|
67
|
+
disabled={disabled}
|
|
68
|
+
onClick={onHide}
|
|
69
|
+
>
|
|
65
70
|
<FaTimes size={16} />
|
|
66
71
|
</Button>
|
|
67
72
|
</Modal.Header>
|
|
@@ -12,6 +12,7 @@ export type EventStatisticModalProps = {
|
|
|
12
12
|
date?: Event['startAt'] | null
|
|
13
13
|
eventStatistic?: EventStatistic | null
|
|
14
14
|
title?: string
|
|
15
|
+
eventId?: string
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export const EventStatisticModal = ({
|
|
@@ -20,10 +21,11 @@ export const EventStatisticModal = ({
|
|
|
20
21
|
date,
|
|
21
22
|
eventStatistic,
|
|
22
23
|
title,
|
|
24
|
+
eventId,
|
|
23
25
|
}: EventStatisticModalProps) => {
|
|
24
26
|
const { t } = useTranslation('Design')
|
|
25
27
|
|
|
26
|
-
const data = useTableData(date, eventStatistic)
|
|
28
|
+
const data = useTableData(date, eventStatistic, eventId )
|
|
27
29
|
const handleClose = () => {
|
|
28
30
|
setIsOpen(false)
|
|
29
31
|
}
|
|
@@ -11,6 +11,7 @@ import { StaticTableData } from '../../../table'
|
|
|
11
11
|
export const useTableData = (
|
|
12
12
|
date: Event['startAt'] | null,
|
|
13
13
|
eventStatistic: EventStatistic | null,
|
|
14
|
+
eventId: string
|
|
14
15
|
) => {
|
|
15
16
|
const { t } = useTranslation('Design')
|
|
16
17
|
const { formatNumber } = useIntl()
|
|
@@ -33,6 +34,7 @@ export const useTableData = (
|
|
|
33
34
|
const transformStatisticToTableRows = (
|
|
34
35
|
date: Event['startAt'],
|
|
35
36
|
statistic: EventStatistic | null,
|
|
37
|
+
eventId: string
|
|
36
38
|
) => {
|
|
37
39
|
if (!statistic) {
|
|
38
40
|
return []
|
|
@@ -40,7 +42,7 @@ export const useTableData = (
|
|
|
40
42
|
|
|
41
43
|
const tableDataRows: StaticTableData[] = []
|
|
42
44
|
|
|
43
|
-
convertEventStatisticToTableData(date, statistic).forEach(
|
|
45
|
+
convertEventStatisticToTableData(date, statistic, eventId).forEach(
|
|
44
46
|
({ name, quantity, total, isBold, isHeader, key }) => {
|
|
45
47
|
const formattedTotal = !Object.keys(TRANSLATION_KEYS).includes(
|
|
46
48
|
String(total),
|
|
@@ -82,9 +84,9 @@ export const useTableData = (
|
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
useEffect(() => {
|
|
85
|
-
setTableRows(transformStatisticToTableRows(date, eventStatistic))
|
|
87
|
+
setTableRows(transformStatisticToTableRows(date, eventStatistic, eventId))
|
|
86
88
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
|
-
}, [date, eventStatistic])
|
|
89
|
+
}, [date, eventId, eventStatistic])
|
|
88
90
|
|
|
89
91
|
return tableRows
|
|
90
92
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventStatistic } from '@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper'
|
|
2
2
|
import { DateTime } from 'luxon'
|
|
3
3
|
import { DATE_FORMAT, DATE_TIME_FULL_FORMAT } from '@licklist/core/dist/Config'
|
|
4
|
-
import { values } from 'lodash'
|
|
4
|
+
import { values, maxBy } from 'lodash'
|
|
5
5
|
|
|
6
6
|
export const TRANSLATION_KEYS = {
|
|
7
7
|
shortQuantity: 'shortQuantity',
|
|
@@ -36,7 +36,6 @@ export const convertEventStatisticToTableData = (
|
|
|
36
36
|
const summaryFormattedDate = DateTime.fromISO(date)
|
|
37
37
|
.toUTC()
|
|
38
38
|
.toFormat(DATE_FORMAT)
|
|
39
|
-
|
|
40
39
|
const summaryDays =
|
|
41
40
|
Object.keys(eventStatistic?.productCategorySummary)?.filter(
|
|
42
41
|
(date) =>
|
|
@@ -46,15 +45,11 @@ export const convertEventStatisticToTableData = (
|
|
|
46
45
|
) ?? []
|
|
47
46
|
|
|
48
47
|
const summaryMap = new Map<string, TableDataRecord>()
|
|
49
|
-
|
|
50
|
-
const maxTotalQuantity = values(eventStatistic?.productCategorySummary)
|
|
48
|
+
const allProductsSummary = values(eventStatistic?.productCategorySummary)
|
|
51
49
|
.flat()
|
|
52
50
|
.flatMap((categorySummary) => categorySummary.productsSummary)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
productSummary.totalQuantity > acc ? productSummary.totalQuantity : acc,
|
|
56
|
-
0,
|
|
57
|
-
)
|
|
51
|
+
|
|
52
|
+
const maxTotalQuantity = maxBy(allProductsSummary, 'id').totalQuantity || 0
|
|
58
53
|
|
|
59
54
|
summaryDays
|
|
60
55
|
.map((day) => eventStatistic?.productCategorySummary[day])
|
|
@@ -69,9 +64,7 @@ export const convertEventStatisticToTableData = (
|
|
|
69
64
|
.forEach(
|
|
70
65
|
({ totalPerCategory, productsSummary = [], categoryName, eventId }) => {
|
|
71
66
|
let quantity = 0
|
|
72
|
-
|
|
73
67
|
totalAmount += totalPerCategory || 0
|
|
74
|
-
|
|
75
68
|
if (!summaryMap.has(`${categoryName}`)) {
|
|
76
69
|
summaryMap.set(`${categoryName}`, {
|
|
77
70
|
name: categoryName,
|
|
@@ -113,13 +106,13 @@ export const convertEventStatisticToTableData = (
|
|
|
113
106
|
})
|
|
114
107
|
},
|
|
115
108
|
)
|
|
116
|
-
|
|
117
109
|
const prevTotalPerCategory = summaryMap.get(
|
|
118
110
|
`${categoryName}.${TRANSLATION_KEYS.totalPerCategory}`,
|
|
119
111
|
) ?? {
|
|
120
112
|
quantity: 0,
|
|
121
113
|
total: 0,
|
|
122
114
|
}
|
|
115
|
+
|
|
123
116
|
summaryMap.set(`${categoryName}.${TRANSLATION_KEYS.totalPerCategory}`, {
|
|
124
117
|
name: TRANSLATION_KEYS.totalPerCategory,
|
|
125
118
|
key: `${eventId}.${categoryName}.${TRANSLATION_KEYS.totalPerCategory}`,
|
|
@@ -127,7 +120,6 @@ export const convertEventStatisticToTableData = (
|
|
|
127
120
|
total: String(Number(prevTotalPerCategory.total) + totalPerCategory),
|
|
128
121
|
isBold: true,
|
|
129
122
|
})
|
|
130
|
-
|
|
131
123
|
totalQuantity += quantity
|
|
132
124
|
},
|
|
133
125
|
)
|
|
@@ -2,6 +2,7 @@ import { useEffect, useMemo, useState, useRef } from 'react'
|
|
|
2
2
|
import { useWindowDimensions } from '@licklist/plugins/dist/hooks/Media/useWindowDimensions'
|
|
3
3
|
import {
|
|
4
4
|
TAB_WIDTH,
|
|
5
|
+
MOBILE_WIDTH,
|
|
5
6
|
STANDARD_BODY_PADDING,
|
|
6
7
|
STANDARD_HEADER_FOOTER_SIZE,
|
|
7
8
|
RIGHT_BLOCK_RESIZED_EVENT,
|
|
@@ -60,6 +61,16 @@ export const useResizePageBody = () => {
|
|
|
60
61
|
})
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
if (width <= MOBILE_WIDTH && Boolean(CALENDAR_WRAPPER_HEIGHT)) {
|
|
65
|
+
return {
|
|
66
|
+
maxHeight:
|
|
67
|
+
height -
|
|
68
|
+
STANDARD_BODY_PADDING -
|
|
69
|
+
rightBlockHeight -
|
|
70
|
+
CALENDAR_WRAPPER_HEIGHT,
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
}
|
|
63
74
|
return {
|
|
64
75
|
maxHeight:
|
|
65
76
|
height -
|
|
@@ -87,7 +98,6 @@ export const useResizePageBody = () => {
|
|
|
87
98
|
|
|
88
99
|
if (width >= TAB_WIDTH && !isContainerSizeApplied) {
|
|
89
100
|
isContainerSizeApplied.current = true
|
|
90
|
-
|
|
91
101
|
setLeftBlockContainerSizes({
|
|
92
102
|
width: leftBlockContainer.clientWidth,
|
|
93
103
|
height: leftBlockContainer.clientHeight,
|
|
@@ -117,7 +127,6 @@ export const useResizePageBody = () => {
|
|
|
117
127
|
) {
|
|
118
128
|
minimalMapSize.current = calculatedMinimalMapSize
|
|
119
129
|
}
|
|
120
|
-
|
|
121
130
|
return {
|
|
122
131
|
width: leftBlockContainer.clientWidth,
|
|
123
132
|
height: minimalMapSize.current,
|
|
@@ -5,12 +5,14 @@ import { useForm } from 'react-hook-form'
|
|
|
5
5
|
import Button from 'react-bootstrap/Button'
|
|
6
6
|
import { useHistory } from 'react-router-dom'
|
|
7
7
|
import Alert from 'react-bootstrap/Alert'
|
|
8
|
+
import {
|
|
9
|
+
STATUS_APPROVED,
|
|
10
|
+
STATUS_CAPTURED,
|
|
11
|
+
STATUS_PENDING_ACTION,
|
|
12
|
+
STATUS_PENDING_PAYMENT,
|
|
13
|
+
} from '@licklist/core/dist/DataMapper/Order/PaymentSessionOrderDataMapper'
|
|
8
14
|
import {
|
|
9
15
|
useRyftPayment,
|
|
10
|
-
RYFT_STATUS_APPROVED,
|
|
11
|
-
RYFT_STATUS_CAPTURED,
|
|
12
|
-
RYFT_STATUS_PENDING_ACTION,
|
|
13
|
-
RYFT_STATUS_PENDING_PAYMENT,
|
|
14
16
|
AttemptPaymentResponse,
|
|
15
17
|
} from '@licklist/plugins/dist/hooks/Ryft/useRyftPayment'
|
|
16
18
|
import { ProviderPaymentSettings } from '@licklist/core/dist/DataMapper/Setting/ProviderPaymentSettingsDataMapper'
|
|
@@ -105,7 +107,7 @@ export const RyftPaymentForm = ({
|
|
|
105
107
|
|
|
106
108
|
if ('requiredAction' in paymentSession) {
|
|
107
109
|
if (
|
|
108
|
-
paymentSession.status !==
|
|
110
|
+
paymentSession.status !== STATUS_PENDING_ACTION ||
|
|
109
111
|
!paymentSession.requiredAction?.url
|
|
110
112
|
) {
|
|
111
113
|
redirectOnFailAttempt(paymentSession)
|
|
@@ -117,9 +119,9 @@ export const RyftPaymentForm = ({
|
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
if (
|
|
120
|
-
paymentSession.status ===
|
|
121
|
-
paymentSession.status ===
|
|
122
|
-
paymentSession.status ===
|
|
122
|
+
paymentSession.status === STATUS_APPROVED ||
|
|
123
|
+
paymentSession.status === STATUS_CAPTURED ||
|
|
124
|
+
paymentSession.status === STATUS_PENDING_PAYMENT
|
|
123
125
|
) {
|
|
124
126
|
redirectOnFailAttempt(paymentSession)
|
|
125
127
|
return
|
|
@@ -23,6 +23,7 @@ import { ruleForUrlWithProtocol } from '@licklist/plugins/dist/validation/Rules/
|
|
|
23
23
|
import { WorkHour } from '@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper'
|
|
24
24
|
import { checkIfZoneCategory } from '@licklist/plugins'
|
|
25
25
|
import { Image } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
|
|
26
|
+
import { SaleDeadline } from 'src/events/edit-event-modal/component/SaleDeadline'
|
|
26
27
|
import { WarningMessage } from '../../static'
|
|
27
28
|
import { SelectItem } from '../../types/generic/SelectItem'
|
|
28
29
|
import {
|
|
@@ -66,6 +67,7 @@ export interface ProductSetControlValues extends DateAndRecurrenceInputValues {
|
|
|
66
67
|
productGroups?: SelectItem[]
|
|
67
68
|
relyOnPeopleType?: RelyOnPeopleType | null
|
|
68
69
|
fieldSetId?: number
|
|
70
|
+
saleDeadline?: number
|
|
69
71
|
steps: Step[]
|
|
70
72
|
emailTemplates?: TemplateItem[]
|
|
71
73
|
smsTemplates?: TemplateItem[]
|
|
@@ -93,6 +95,7 @@ export interface ProductSetControlProps {
|
|
|
93
95
|
workHours: WorkHour[] | undefined
|
|
94
96
|
providerHasBookingManagement?: boolean
|
|
95
97
|
isOverrides?: boolean
|
|
98
|
+
saleDeadline?: number
|
|
96
99
|
isCreateNewOverrides?: boolean
|
|
97
100
|
timeZone: string
|
|
98
101
|
}
|
|
@@ -222,6 +225,8 @@ export function ProductSetControl({
|
|
|
222
225
|
</>
|
|
223
226
|
)}
|
|
224
227
|
|
|
228
|
+
<SaleDeadline disabled={false} onlyBefore />
|
|
229
|
+
|
|
225
230
|
<div className='divider' />
|
|
226
231
|
|
|
227
232
|
<TutorialGifCard isOverrides={isOverrides} />
|
|
@@ -59,6 +59,7 @@ export interface ProductSetFormProps
|
|
|
59
59
|
isCreateAction?: boolean
|
|
60
60
|
isOverrides?: boolean
|
|
61
61
|
workHours?: WorkHour[]
|
|
62
|
+
saleDeadline?: number
|
|
62
63
|
isCreateNewOverrides?: boolean
|
|
63
64
|
timeZone: string
|
|
64
65
|
}
|
|
@@ -77,6 +78,7 @@ export function ProductSetForm({
|
|
|
77
78
|
zones,
|
|
78
79
|
isCreateAction,
|
|
79
80
|
workHours,
|
|
81
|
+
saleDeadline,
|
|
80
82
|
isOverrides,
|
|
81
83
|
isCreateNewOverrides,
|
|
82
84
|
timeZone,
|
|
@@ -17,6 +17,10 @@ import { Switch, BooleanSwitch } from '../../static'
|
|
|
17
17
|
import { ProductSetFormValues } from '../form/ProductSetForm'
|
|
18
18
|
import { IsDeletableEvent, ProductCategory } from '../types'
|
|
19
19
|
import { ReactComponent as IncrementIcon } from '../../assets/dashboard/increment.svg'
|
|
20
|
+
import {
|
|
21
|
+
SaleDeadline,
|
|
22
|
+
SALE_DEADLINE_NAME_CATEGORY,
|
|
23
|
+
} from '../../events/edit-event-modal/component/SaleDeadline/SaleDeadline'
|
|
20
24
|
|
|
21
25
|
export interface ProductCategoryControlValues extends FormValues {
|
|
22
26
|
id: number
|
|
@@ -36,6 +40,7 @@ export interface ProductCategoryControlValues extends FormValues {
|
|
|
36
40
|
hasSubEvents?: boolean
|
|
37
41
|
weight?: number
|
|
38
42
|
isReusable?: boolean
|
|
43
|
+
saleDeadlineCategory?: number
|
|
39
44
|
termsAndConditions?: string
|
|
40
45
|
sort: number | null
|
|
41
46
|
}
|
|
@@ -423,6 +428,14 @@ export function ProductCategoryControl({
|
|
|
423
428
|
</div>
|
|
424
429
|
</Form.Group>
|
|
425
430
|
)}
|
|
431
|
+
|
|
432
|
+
<SaleDeadline
|
|
433
|
+
disabled={false}
|
|
434
|
+
deadLineCategory={
|
|
435
|
+
`${fieldNamePrefix}.${SALE_DEADLINE_NAME_CATEGORY}` as const
|
|
436
|
+
}
|
|
437
|
+
onlyBefore
|
|
438
|
+
/>
|
|
426
439
|
{/*
|
|
427
440
|
|
|
428
441
|
|