@licklist/design 0.65.0 → 0.66.0-dev.0
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/date-time-button/DateTimeButton.js +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.d.ts +4 -1
- package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.js +1 -1
- package/dist/iframe/ryft/utils/ryft-form.d.ts +5 -2
- package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
- package/dist/iframe/ryft/utils/ryft-form.js +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.js +1 -1
- package/dist/product-set/control/DateInput.js +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts +3 -2
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +1 -1
- package/dist/product-set/form/ProductCategoriesControl.d.ts +3 -1
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts +6 -2
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +1 -1
- package/dist/product-set/form/ProductsControl.d.ts +3 -1
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +1 -1
- package/dist/product-set/form/StepsControl.d.ts +3 -1
- package/dist/product-set/form/StepsControl.d.ts.map +1 -1
- package/dist/product-set/form/StepsControl.js +1 -1
- package/dist/product-set/product/ProductControl.d.ts +1 -0
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +1 -1
- package/dist/product-set/step/StepControl.d.ts +2 -1
- package/dist/product-set/step/StepControl.d.ts.map +1 -1
- package/dist/product-set/step/StepControl.js +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
- package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.js +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +3 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
- package/dist/recurring-date-picker-input/utils.d.ts +5 -0
- package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/utils.js +1 -1
- package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts +1 -1
- package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts.map +1 -1
- package/dist/report/ReportRunnerModal/ReportRunnerModal.js +1 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
- package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts +1 -2
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.js +1 -1
- package/dist/styles/date-time-button/DateTimeButton.scss +1 -0
- package/dist/styles/iframe-page/PageBody.scss +0 -1
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +8 -0
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/styles/zones/ZoneForm.scss +2 -1
- package/dist/zone/form/ZoneForm.d.ts +2 -2
- package/dist/zone/form/ZoneForm.d.ts.map +1 -1
- package/dist/zone/form/ZoneForm.js +1 -1
- package/dist/zone/form/components/ZoneControl.d.ts +2 -2
- package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneControl.js +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -4
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
- package/dist/zone/form/utils/dates.d.ts.map +1 -1
- package/package.json +3 -5
- package/src/date-time-button/DateTimeButton.stories.tsx +2 -1
- package/src/date-time-button/DateTimeButton.tsx +7 -5
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +14 -9
- package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +2 -0
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -0
- package/src/iframe/ryft/RyftPaymentForm.tsx +11 -2
- package/src/iframe/ryft/utils/ryft-form.ts +23 -4
- package/src/product-set/control/DateAndRecurrenceInput.tsx +3 -4
- package/src/product-set/control/DateInput.tsx +2 -2
- package/src/product-set/control/ProductSetControl.tsx +17 -5
- package/src/product-set/form/ProductCategoriesControl.tsx +15 -4
- package/src/product-set/form/ProductSetForm.tsx +13 -2
- package/src/product-set/form/ProductsControl.tsx +93 -77
- package/src/product-set/form/StepsControl.tsx +15 -7
- package/src/product-set/product/ProductControl.tsx +8 -5
- package/src/product-set/step/StepControl.tsx +4 -3
- package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +4 -18
- package/src/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.tsx +49 -21
- package/src/recurring-date-picker-input/RecurringDatePickerInput.stories.tsx +13 -7
- package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +12 -1
- package/src/recurring-date-picker-input/utils.ts +90 -1
- package/src/report/ReportRunnerModal/ReportRunnerModal.stories.tsx +307 -0
- package/src/report/ReportRunnerModal/ReportRunnerModal.tsx +24 -14
- package/src/sales/booking/results/components/ResultCard.tsx +0 -3
- package/src/setting/admin/AdminSettingForm.tsx +2 -2
- package/src/sortable-tree/SortableTreeItem.tsx +0 -3
- package/src/static/switch/BooleanSwitch.tsx +1 -1
- package/src/styles/date-time-button/DateTimeButton.scss +1 -0
- package/src/styles/iframe-page/PageBody.scss +0 -1
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +8 -0
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/styles/zones/ZoneForm.scss +2 -1
- package/src/zone/form/ZoneForm.tsx +3 -2
- package/src/zone/form/components/ZoneControl.tsx +3 -3
- package/src/zone/form/components/ZoneRecurrencesControl.tsx +7 -5
- package/src/zone/form/utils/dates.ts +9 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("tslib"),t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-bootstrap"),a=require("../../../static/Icon.js"),u=require("react-hook-form"),l=require("@react-aria/utils"),c=require("react-use");require("../../../static/index.js");var d=require("@dnd-kit/core"),s=require("@dnd-kit/sortable"),m=require("../../../modals/confirmation/ConfirmModal.js"),v=require("../../../recurring-date-picker-input/RecurringDatePickerInput.js"),f=require("../../../product-set/control/DateAndRecurrenceInput.js"),p=require("./ZoneRecurrenceControl.js");exports.ZoneRecurrencesControl=function(){var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("tslib"),t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-bootstrap"),a=require("../../../static/Icon.js"),u=require("react-hook-form"),l=require("@react-aria/utils"),c=require("react-use");require("../../../static/index.js");var d=require("@dnd-kit/core"),s=require("@dnd-kit/sortable"),m=require("../../../modals/confirmation/ConfirmModal.js"),v=require("../../../recurring-date-picker-input/RecurringDatePickerInput.js"),f=require("../../../product-set/control/DateAndRecurrenceInput.js"),p=require("./ZoneRecurrenceControl.js");exports.ZoneRecurrencesControl=function(e){var g,_,E=e.workHours,q=u.useFormContext(),x=q.control,C=q.register,D=q.formState.errors,R=q.getValues,b=q.setValue,k=q.clearErrors,y=u.useFieldArray({name:"zoneRecurrences",control:x,keyName:"_id"}),I=y.fields,S=y.append,z=y.update,N=y.move,h=r.__read(t.useState(!1),2),j=h[0],w=h[1],T=r.__read(t.useState({index:null,values:null}),2),A=T[0],F=T[1],M=function(){return F({index:null,values:null})},P=t.useRef();c.useClickAway(P,(function(e){var r,t,n;m.CONFIRM_MODAL_ACTIONS.includes(null===(n=null===(t=null===(r=e.target)||void 0===r?void 0:r.attributes)||void 0===t?void 0:t.getNamedItem("data-id"))||void 0===n?void 0:n.value)||(w(!1),M())}));var O=l.useId(),V=i.useTranslation(["Design","Validation"]).t,L=function(){M(),w((function(e){return!e}))};return t.useEffect((function(){I.length&&k("zoneRecurrences")}),[I,k]),n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,V("zoneAvailable")),n.createElement(o.OverlayTrigger,{show:j,overlay:n.createElement(o.Popover,{id:O,className:"rounded"},n.createElement(o.Popover.Content,{className:"shadow-lg rounded",ref:P},n.createElement(v.RecurringDatePickerInput,{defaultValues:A.values,onChange:function(e){return r.__awaiter(void 0,void 0,void 0,(function(){var t,n,i;return r.__generator(this,(function(r){return t={rrule:e.rrule,startDate:e.startDate,endDate:e.endDate,startTime:e.startTime,endTime:e.endTime},(null===(n=A.values)||void 0===n?void 0:n.id)&&(t.id=null===(i=A.values)||void 0===i?void 0:i.id),null!==A.index?z(A.index,t):S(t),w((function(){return!1})),M(),[2]}))}))},onDelete:function(){var e=A.index;w(!1),M(),setTimeout((function(){var r=R().zoneRecurrences;b("zoneRecurrences",(void 0===r?[]:r).filter((function(r,t){return t!==e})))}),100)},setInitialStartDateAfterSelect:!0,workHours:E}))),trigger:"click",placement:"bottom",popperConfig:{modifiers:[f.sameWidthPopperModifier]}},n.createElement("div",{className:"zone-recurrences"},n.createElement(d.DndContext,{onDragEnd:function(e){var r=e.over,t=e.active;if(r.id!==t.id){var n=I.findIndex((function(e){return String(e._id)===t.id})),i=I.findIndex((function(e){return String(e._id)===r.id}));N(n,i)}}},n.createElement(s.SortableContext,{items:null!==(g=null==I?void 0:I.map((function(e){return String(e._id)})))&&void 0!==g?g:[],strategy:s.verticalListSortingStrategy},null==I?void 0:I.map((function(e,r){return n.createElement(p.ZoneRecurrenceControl,{key:e._id,zoneRecurrence:e,onEdit:function(){return function(e,r){M(),F({index:r,values:e}),w((function(){return!0}))}(e,r)}})})))),n.createElement("div",{className:"zone-recurrence-icon-wrapper",role:"button",tabIndex:0,onClick:L,onKeyDown:L},n.createElement(a.default,{type:"plus-circle",height:"1rem",className:"zone-recurrence-icon-add mr-2"}),V("addDates")),n.createElement(o.Form.Control,r.__assign({type:"hidden"},C("zoneRecurrences",{required:{value:!0,message:V("Validation:fieldMinNumber",{attribute:V("dates"),min:1})}}))),n.createElement("div",{className:"manual-form-error"},null===(_=D.zoneRecurrences)||void 0===_?void 0:_.message))))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/utils/dates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAOtF,eAAO,MAAM,qBAAqB,cACrB,MAAM,WACR,MAAM,6BAuChB,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/utils/dates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAOtF,eAAO,MAAM,qBAAqB,cACrB,MAAM,WACR,MAAM,6BAuChB,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,QAAQ,EAAE,aAyC9D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.0-dev.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"@fortawesome/free-brands-svg-icons": "5.15.2",
|
|
51
51
|
"@fortawesome/free-solid-svg-icons": "5.15.2",
|
|
52
52
|
"@fortawesome/react-fontawesome": "0.1.9",
|
|
53
|
-
"@licklist/core": "
|
|
53
|
+
"@licklist/core": ">=0.28.0-dev.0 < 0.28.0",
|
|
54
54
|
"@licklist/eslint-config": "0.4.5",
|
|
55
|
-
"@licklist/plugins": "
|
|
55
|
+
"@licklist/plugins": ">=0.30.0-dev.1 < 0.30.0",
|
|
56
56
|
"@mdx-js/react": "1.6.22",
|
|
57
57
|
"@popperjs/core": "2.11.8",
|
|
58
58
|
"@react-aria/utils": "3.9.0",
|
|
@@ -116,7 +116,6 @@
|
|
|
116
116
|
"emojibase": "6.1.0",
|
|
117
117
|
"emojibase-data": "7.0.1",
|
|
118
118
|
"emojibase-regex": "6.0.1",
|
|
119
|
-
"enzyme": "3.11.0",
|
|
120
119
|
"eslint": "7.32.0",
|
|
121
120
|
"eslint-config-airbnb": "18.2.1",
|
|
122
121
|
"eslint-config-prettier": "8.3.0",
|
|
@@ -188,7 +187,6 @@
|
|
|
188
187
|
"devDependencies": {
|
|
189
188
|
"@types/react": "17.0.2",
|
|
190
189
|
"@types/react-dom": "17.0.2",
|
|
191
|
-
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
|
|
192
190
|
"identity-obj-proxy": "^3.0.0"
|
|
193
191
|
},
|
|
194
192
|
"volta": {
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
component: DateTimeButton,
|
|
9
9
|
} as Meta;
|
|
10
10
|
|
|
11
|
-
const date = DateTime.now();
|
|
11
|
+
const date = DateTime.now().plus({ hour: 1 });
|
|
12
12
|
|
|
13
13
|
export const Default: Story<DateTimeButtonProps> = (args) => {
|
|
14
14
|
return <DateTimeButton {...args} />;
|
|
@@ -19,6 +19,7 @@ Default.args = {
|
|
|
19
19
|
isSelected: false,
|
|
20
20
|
isDisabled: false,
|
|
21
21
|
onSelect: () => null,
|
|
22
|
+
shouldCalculateResources: false,
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
export const Selected: Story<DateTimeButtonProps> = (args) => {
|
|
@@ -46,7 +46,7 @@ export const DateTimeButton = ({
|
|
|
46
46
|
|
|
47
47
|
const isTimeVariant = variant === Variant.time;
|
|
48
48
|
|
|
49
|
-
const
|
|
49
|
+
const isPast = variant === Variant.time ? isPastTime(date) : isPastDate(date);
|
|
50
50
|
|
|
51
51
|
const noResources =
|
|
52
52
|
shouldCalculateResources &&
|
|
@@ -55,7 +55,7 @@ export const DateTimeButton = ({
|
|
|
55
55
|
!has(resources, "bookedResources") ||
|
|
56
56
|
!has(resources, "totalResources"));
|
|
57
57
|
|
|
58
|
-
const isDisabled = _isDisabled || isSoldOut ||
|
|
58
|
+
const isDisabled = _isDisabled || isSoldOut || isPast || noResources;
|
|
59
59
|
|
|
60
60
|
return (
|
|
61
61
|
<button
|
|
@@ -85,7 +85,7 @@ export const DateTimeButton = ({
|
|
|
85
85
|
{showResources && resources && (
|
|
86
86
|
<AvailabilityIndicator
|
|
87
87
|
resources={resources}
|
|
88
|
-
isUnavailable={_isDisabled ||
|
|
88
|
+
isUnavailable={_isDisabled || isPast}
|
|
89
89
|
isSoldOut={isSoldOut}
|
|
90
90
|
/>
|
|
91
91
|
)}
|
|
@@ -93,5 +93,7 @@ export const DateTimeButton = ({
|
|
|
93
93
|
);
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
const
|
|
97
|
-
|
|
96
|
+
const isPastTime = (date: DateTime): boolean => DateTime.now() > date;
|
|
97
|
+
|
|
98
|
+
const isPastDate = (date: DateTime): boolean =>
|
|
99
|
+
DateTime.now() > date.set({ hour: 23, minute: 59, second: 59 });
|
package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx
CHANGED
|
@@ -40,6 +40,10 @@ export const SelectEventProductSet = ({
|
|
|
40
40
|
const productSetId = watch("productSetId");
|
|
41
41
|
const editedProductSet = watch("editedProductSet");
|
|
42
42
|
|
|
43
|
+
const selectedProductSet = productSets.find(
|
|
44
|
+
(productSet) => productSet.id === productSetId
|
|
45
|
+
)?.parentMenuId;
|
|
46
|
+
|
|
43
47
|
const onEditProductSet = useCallback(
|
|
44
48
|
() => {
|
|
45
49
|
setEditProductSetId(String(productSetId));
|
|
@@ -84,6 +88,9 @@ export const SelectEventProductSet = ({
|
|
|
84
88
|
setValue("productSetId", value);
|
|
85
89
|
};
|
|
86
90
|
|
|
91
|
+
const showOverrideProductSet =
|
|
92
|
+
!showEditProductSet && productSetId && !selectedProductSet;
|
|
93
|
+
|
|
87
94
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
88
95
|
const onSubmit = (value: EditEventFormValues["editedProductSet"]) => {
|
|
89
96
|
setShowEditProductSet(false);
|
|
@@ -159,7 +166,7 @@ export const SelectEventProductSet = ({
|
|
|
159
166
|
{t("addNewProductSet")}
|
|
160
167
|
</Button>
|
|
161
168
|
)}
|
|
162
|
-
{
|
|
169
|
+
{showOverrideProductSet && (
|
|
163
170
|
<Button
|
|
164
171
|
variant=""
|
|
165
172
|
className="btn product-set-button "
|
|
@@ -199,14 +206,12 @@ export const SelectEventProductSet = ({
|
|
|
199
206
|
</Form.Group>
|
|
200
207
|
</div>
|
|
201
208
|
{showEditProductSet && productSetId && (
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
/>
|
|
209
|
-
</>
|
|
209
|
+
<EditEventProductSet
|
|
210
|
+
onSubmit={onSubmit}
|
|
211
|
+
defaultValues={
|
|
212
|
+
productSetId === editedProductSet?.id && editedProductSet
|
|
213
|
+
}
|
|
214
|
+
/>
|
|
210
215
|
)}
|
|
211
216
|
</>
|
|
212
217
|
);
|
|
@@ -36,6 +36,9 @@ export interface RyftPaymentFormProps {
|
|
|
36
36
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
37
|
accountId: any;
|
|
38
38
|
isCreateLoading: boolean;
|
|
39
|
+
isAppUsingInIframe?: boolean;
|
|
40
|
+
onApplePayButtonClick?: () => void;
|
|
41
|
+
applePayButtonDisabled?: boolean;
|
|
39
42
|
initRyft: (
|
|
40
43
|
onSuccess: () => void,
|
|
41
44
|
onFailure: (error?: string) => void
|
|
@@ -48,15 +51,19 @@ export interface RyftPaymentFormProps {
|
|
|
48
51
|
export const RyftPaymentForm = ({
|
|
49
52
|
accountId,
|
|
50
53
|
isCreateLoading,
|
|
54
|
+
isAppUsingInIframe,
|
|
51
55
|
providerPaymentSettings,
|
|
56
|
+
onApplePayButtonClick,
|
|
52
57
|
initRyft,
|
|
53
58
|
resetReferrer,
|
|
54
59
|
onSubmit,
|
|
55
60
|
}: RyftPaymentFormProps) => {
|
|
56
61
|
const { t } = useTranslation(["Design", "Validation", "Ryft"]);
|
|
57
62
|
const formRef = useRef<HTMLFormElement | null>(null);
|
|
63
|
+
const showApplePayButton =
|
|
64
|
+
isAppUsingInIframe &&
|
|
65
|
+
providerPaymentSettings?.additionalPaymentMethodsEnabled;
|
|
58
66
|
const history = useHistory();
|
|
59
|
-
|
|
60
67
|
const [isValid, setIsValid] = useState(false);
|
|
61
68
|
const [isBtnDisabled, setIsBtnDisabled] = useState(false);
|
|
62
69
|
const [ryftInitFailure, setRyftInitFailure] = useState<boolean>(false);
|
|
@@ -133,12 +140,14 @@ export const RyftPaymentForm = ({
|
|
|
133
140
|
}
|
|
134
141
|
injectComponentsInRyftForm({
|
|
135
142
|
t,
|
|
143
|
+
isAppUsingInIframe,
|
|
144
|
+
onApplePayButtonClick,
|
|
136
145
|
additionalPaymentMethodsEnabled:
|
|
137
146
|
providerPaymentSettings?.additionalPaymentMethodsEnabled,
|
|
138
147
|
});
|
|
139
148
|
},
|
|
140
149
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
141
|
-
[formRef.current?.childNodes?.length]
|
|
150
|
+
[formRef.current?.childNodes?.length, showApplePayButton]
|
|
142
151
|
);
|
|
143
152
|
|
|
144
153
|
useEffect(() => {
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { TFunction } from "react-i18next";
|
|
2
|
+
import { RyftPaymentFormProps } from "../RyftPaymentForm";
|
|
3
|
+
|
|
4
|
+
interface InjectComponentsInRyftForm
|
|
5
|
+
extends Pick<
|
|
6
|
+
RyftPaymentFormProps,
|
|
7
|
+
"onApplePayButtonClick" | "isAppUsingInIframe"
|
|
8
|
+
> {
|
|
9
|
+
t: TFunction<string[]>;
|
|
10
|
+
additionalPaymentMethodsEnabled?: boolean;
|
|
11
|
+
}
|
|
2
12
|
|
|
3
13
|
export const injectComponentsInRyftForm = ({
|
|
4
14
|
t,
|
|
5
15
|
additionalPaymentMethodsEnabled,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) => {
|
|
16
|
+
isAppUsingInIframe,
|
|
17
|
+
onApplePayButtonClick,
|
|
18
|
+
}: InjectComponentsInRyftForm) => {
|
|
10
19
|
const cardContainer = document.getElementById("ryft-pay-iframe");
|
|
11
20
|
|
|
12
21
|
if (!cardContainer) {
|
|
@@ -34,6 +43,7 @@ export const injectComponentsInRyftForm = ({
|
|
|
34
43
|
// Removing of the old mobile title container and divider container
|
|
35
44
|
document.getElementById("mobile-pay-title")?.remove();
|
|
36
45
|
document.getElementById("mobile-pay-divider-container")?.remove();
|
|
46
|
+
document.getElementById("apple-pay")?.remove();
|
|
37
47
|
|
|
38
48
|
// Adding title and divider for apple and google pay button
|
|
39
49
|
const mobilePayTitle = document.createElement("div");
|
|
@@ -48,6 +58,15 @@ export const injectComponentsInRyftForm = ({
|
|
|
48
58
|
divider.id = "mobile-pay-divider";
|
|
49
59
|
container.id = "mobile-pay-divider-container";
|
|
50
60
|
container.append(dividerText, divider);
|
|
61
|
+
if (isAppUsingInIframe) {
|
|
62
|
+
const applePayButton = document.createElement("button");
|
|
63
|
+
applePayButton.id = "apple-pay";
|
|
64
|
+
applePayButton.type = "button";
|
|
65
|
+
applePayButton.className = "bg-dark btn btn-primary apple-pay-button";
|
|
66
|
+
applePayButton.textContent = t("Events:payWithApple");
|
|
67
|
+
applePayButton.onclick = onApplePayButtonClick;
|
|
68
|
+
payGrid.append(applePayButton);
|
|
69
|
+
}
|
|
51
70
|
payGrid.before(mobilePayTitle);
|
|
52
71
|
payGrid.after(container);
|
|
53
72
|
};
|
|
@@ -28,15 +28,13 @@ import {
|
|
|
28
28
|
AvailableTimesControlRef,
|
|
29
29
|
} from "../../zone/form/components/AvailableTimesControl";
|
|
30
30
|
|
|
31
|
-
// eslint-disable-next-line max-len
|
|
32
|
-
|
|
33
31
|
export interface DateAndRecurrenceInputValues {
|
|
34
32
|
menuRecurrences?: Partial<ProductSetRecurrence>[];
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
interface DateAndRecurrenceInputProps {
|
|
38
36
|
isEventEditProductSet?: boolean;
|
|
39
|
-
workHours
|
|
37
|
+
workHours: WorkHour[] | undefined;
|
|
40
38
|
providerHasBookingManagement: boolean;
|
|
41
39
|
isLoading?: boolean;
|
|
42
40
|
}
|
|
@@ -90,7 +88,7 @@ export const DateAndRecurrenceInput = ({
|
|
|
90
88
|
clearEditState();
|
|
91
89
|
});
|
|
92
90
|
|
|
93
|
-
const popoverId = useId()
|
|
91
|
+
const popoverId = useId();
|
|
94
92
|
|
|
95
93
|
const { t } = useTranslation("Design");
|
|
96
94
|
|
|
@@ -228,6 +226,7 @@ export const DateAndRecurrenceInput = ({
|
|
|
228
226
|
defaultValues={editState.values}
|
|
229
227
|
onChange={handleRecurringDateChange}
|
|
230
228
|
onDelete={handleDelete}
|
|
229
|
+
workHours={workHours}
|
|
231
230
|
>
|
|
232
231
|
{providerHasBookingManagement && (
|
|
233
232
|
<AvailableTimesControl
|
|
@@ -5,7 +5,7 @@ import { Form, OverlayTrigger, Popover } from "react-bootstrap";
|
|
|
5
5
|
import { useFieldArray, useFormContext } from "react-hook-form";
|
|
6
6
|
import { useTranslation } from "react-i18next";
|
|
7
7
|
import { useClickAway } from "react-use";
|
|
8
|
-
import {
|
|
8
|
+
import { UTC_TIMEZONE, TIME_FORMAT } from "@licklist/core/dist/Config/Date";
|
|
9
9
|
import { ProductSetRecurrence } from "@licklist/core/dist/DataMapper/Product/ProductSetRecurrenceDataMapper";
|
|
10
10
|
import { DateTime } from "luxon";
|
|
11
11
|
import RRule, { Frequency } from "rrule";
|
|
@@ -136,7 +136,7 @@ export const DateInput = ({
|
|
|
136
136
|
until: (start as DateTime).toJSDate(),
|
|
137
137
|
byweekday: [],
|
|
138
138
|
freq: Frequency.DAILY,
|
|
139
|
-
tzid:
|
|
139
|
+
tzid: UTC_TIMEZONE,
|
|
140
140
|
interval: 1,
|
|
141
141
|
}).replace("RRULE:", "");
|
|
142
142
|
|
|
@@ -85,9 +85,10 @@ export interface ProductSetControlProps {
|
|
|
85
85
|
fieldSets?: FieldSet[];
|
|
86
86
|
showEmailTemplate?: boolean;
|
|
87
87
|
showSmsTemplate?: boolean;
|
|
88
|
-
workHours
|
|
88
|
+
workHours: WorkHour[] | undefined;
|
|
89
89
|
providerHasBookingManagement?: boolean;
|
|
90
90
|
isOverrides?: boolean;
|
|
91
|
+
isCreateNewOverrides?: boolean;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
export function ProductSetControl({
|
|
@@ -104,6 +105,7 @@ export function ProductSetControl({
|
|
|
104
105
|
workHours,
|
|
105
106
|
providerHasBookingManagement = false,
|
|
106
107
|
isOverrides = false,
|
|
108
|
+
isCreateNewOverrides = false,
|
|
107
109
|
}: ProductSetControlProps) {
|
|
108
110
|
const { t } = useTranslation(["Design", "Validation", "Notification"]);
|
|
109
111
|
const {
|
|
@@ -123,6 +125,11 @@ export function ProductSetControl({
|
|
|
123
125
|
|
|
124
126
|
const showSmsTemplateSelector = showSmsTemplate && !isOverrides;
|
|
125
127
|
const showEmailTemplateSelector = showEmailTemplate && !isOverrides;
|
|
128
|
+
const showDateSelector = !isEventEditProductSet && isOverrides;
|
|
129
|
+
|
|
130
|
+
const isZoneAdded = steps.some(({ productCategories }) =>
|
|
131
|
+
productCategories.some(({ zoneId }) => zoneId)
|
|
132
|
+
);
|
|
126
133
|
|
|
127
134
|
return (
|
|
128
135
|
<Row
|
|
@@ -165,9 +172,9 @@ export function ProductSetControl({
|
|
|
165
172
|
</Form.Control.Feedback>
|
|
166
173
|
</Form.Group>
|
|
167
174
|
|
|
168
|
-
{
|
|
175
|
+
{showDateSelector ? (
|
|
169
176
|
<DateInput
|
|
170
|
-
workHours={workHours}
|
|
177
|
+
workHours={isZoneAdded ? workHours : undefined}
|
|
171
178
|
isLoading={isLoading}
|
|
172
179
|
providerHasBookingManagement={providerHasBookingManagement}
|
|
173
180
|
/>
|
|
@@ -176,7 +183,7 @@ export function ProductSetControl({
|
|
|
176
183
|
{isCreateAction && (
|
|
177
184
|
<DateAndRecurrenceInput
|
|
178
185
|
isEventEditProductSet={isEventEditProductSet}
|
|
179
|
-
workHours={workHours}
|
|
186
|
+
workHours={isZoneAdded ? workHours : undefined}
|
|
180
187
|
isLoading={isLoading}
|
|
181
188
|
providerHasBookingManagement={providerHasBookingManagement}
|
|
182
189
|
/>
|
|
@@ -188,7 +195,12 @@ export function ProductSetControl({
|
|
|
188
195
|
|
|
189
196
|
<TutorialGifCard isOverrides={isOverrides} />
|
|
190
197
|
|
|
191
|
-
<StepsControl
|
|
198
|
+
<StepsControl
|
|
199
|
+
isLoading={isLoading}
|
|
200
|
+
isEventEditProductSet={isEventEditProductSet}
|
|
201
|
+
isOverrides={isOverrides}
|
|
202
|
+
isCreateNewOverrides={isCreateNewOverrides}
|
|
203
|
+
/>
|
|
192
204
|
</Col>
|
|
193
205
|
<Col md={6} sm={12}>
|
|
194
206
|
<div className="second-column">
|
|
@@ -36,6 +36,8 @@ import { useSortableTreeFunctions } from "../hooks/useSortableTreeFunctions";
|
|
|
36
36
|
interface ProductCategoriesControlProps extends WithIsLoading {
|
|
37
37
|
stepIndex: number;
|
|
38
38
|
isOverrides?: boolean;
|
|
39
|
+
isEventEditProductSet?: boolean;
|
|
40
|
+
isCreateNewOverrides?: boolean;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
const getCategoryDefaultValue = (
|
|
@@ -67,6 +69,8 @@ export function ProductCategoriesControl({
|
|
|
67
69
|
isLoading,
|
|
68
70
|
stepIndex,
|
|
69
71
|
isOverrides,
|
|
72
|
+
isEventEditProductSet,
|
|
73
|
+
isCreateNewOverrides,
|
|
70
74
|
}: ProductCategoriesControlProps) {
|
|
71
75
|
const { t } = useTranslation("Design");
|
|
72
76
|
const {
|
|
@@ -214,6 +218,11 @@ export function ProductCategoriesControl({
|
|
|
214
218
|
? String(productCategory.id)
|
|
215
219
|
: productCategory.uniqueId;
|
|
216
220
|
|
|
221
|
+
const isOverridesCategory = productCategory.products.some((product) =>
|
|
222
|
+
isEventEditProductSet ? !!product.id : !!product.originalProductId
|
|
223
|
+
);
|
|
224
|
+
const isNewOverridesCategory =
|
|
225
|
+
isCreateNewOverrides && !!productCategory.id;
|
|
217
226
|
const onSetIsExpanded = () => {
|
|
218
227
|
setIsExpanded(productCategoryId);
|
|
219
228
|
};
|
|
@@ -269,7 +278,10 @@ export function ProductCategoriesControl({
|
|
|
269
278
|
categoryName={value}
|
|
270
279
|
stepIndex={stepIndex}
|
|
271
280
|
productCategoryIndex={index}
|
|
272
|
-
isOverride={
|
|
281
|
+
isOverride={
|
|
282
|
+
isNewOverridesCategory ||
|
|
283
|
+
(isOverrides && isOverridesCategory)
|
|
284
|
+
}
|
|
273
285
|
/>
|
|
274
286
|
}
|
|
275
287
|
isOverride={isOverrides}
|
|
@@ -296,6 +308,8 @@ export function ProductCategoriesControl({
|
|
|
296
308
|
productCategoryIndex={index}
|
|
297
309
|
categoryType={productCategory.type}
|
|
298
310
|
isOverrides={isOverrides}
|
|
311
|
+
isEventEditProductSet={isEventEditProductSet}
|
|
312
|
+
isCreateNewOverrides={isCreateNewOverrides}
|
|
299
313
|
/>
|
|
300
314
|
</SortableTree.Item>
|
|
301
315
|
)}
|
|
@@ -305,9 +319,7 @@ export function ProductCategoriesControl({
|
|
|
305
319
|
</SortableTree>
|
|
306
320
|
<CreateProductSetItem
|
|
307
321
|
title={t("addCategory")}
|
|
308
|
-
isOverride={isOverrides}
|
|
309
322
|
onClick={() => {
|
|
310
|
-
if (isOverrides) return;
|
|
311
323
|
setIsSelectCategoryVisible(true);
|
|
312
324
|
}}
|
|
313
325
|
/>
|
|
@@ -316,7 +328,6 @@ export function ProductCategoriesControl({
|
|
|
316
328
|
isVisible={isSelectCategoryVisible}
|
|
317
329
|
onHide={() => setIsSelectCategoryVisible(false)}
|
|
318
330
|
onCategorySelect={(categoryType) => {
|
|
319
|
-
if (isOverrides) return;
|
|
320
331
|
append(getCategoryDefaultValue(categoryType, fields.length));
|
|
321
332
|
setShowCategoryModal(true);
|
|
322
333
|
if (
|
|
@@ -26,12 +26,16 @@ import { checkAvailableTimesErrors, getFilteredTemplates } from "../utils";
|
|
|
26
26
|
export interface WithIsLoading {
|
|
27
27
|
isLoading: boolean;
|
|
28
28
|
}
|
|
29
|
+
export interface WithIdOptional {
|
|
30
|
+
id?: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
29
33
|
export interface WithId {
|
|
30
34
|
id: number;
|
|
31
35
|
}
|
|
32
36
|
export interface ProductSetFormValues
|
|
33
37
|
extends FormValues,
|
|
34
|
-
|
|
38
|
+
WithIdOptional,
|
|
35
39
|
ProductSetControlValues {
|
|
36
40
|
steps: Step[];
|
|
37
41
|
isOverrides?: boolean;
|
|
@@ -53,6 +57,7 @@ export interface ProductSetFormProps
|
|
|
53
57
|
isCreateAction?: boolean;
|
|
54
58
|
isOverrides?: boolean;
|
|
55
59
|
workHours?: WorkHour[];
|
|
60
|
+
isCreateNewOverrides?: boolean;
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
export function ProductSetForm({
|
|
@@ -70,6 +75,7 @@ export function ProductSetForm({
|
|
|
70
75
|
isCreateAction,
|
|
71
76
|
workHours,
|
|
72
77
|
isOverrides,
|
|
78
|
+
isCreateNewOverrides,
|
|
73
79
|
...shared
|
|
74
80
|
}: ProductSetFormProps) {
|
|
75
81
|
const { t } = useTranslation("Design");
|
|
@@ -115,7 +121,11 @@ export function ProductSetForm({
|
|
|
115
121
|
}, [serverErrors, setError]);
|
|
116
122
|
|
|
117
123
|
useEffect(() => {
|
|
118
|
-
window.history.pushState(
|
|
124
|
+
window.history.pushState(
|
|
125
|
+
null,
|
|
126
|
+
"",
|
|
127
|
+
window.location.pathname + window.location.search
|
|
128
|
+
);
|
|
119
129
|
window.addEventListener("beforeunload", onBeforeUnload);
|
|
120
130
|
window.addEventListener("popstate", onPopState);
|
|
121
131
|
|
|
@@ -166,6 +176,7 @@ export function ProductSetForm({
|
|
|
166
176
|
workHours={workHours}
|
|
167
177
|
providerHasBookingManagement={providerHasBookingManagement}
|
|
168
178
|
isOverrides={isOverrides}
|
|
179
|
+
isCreateNewOverrides={isCreateNewOverrides}
|
|
169
180
|
/>
|
|
170
181
|
<Row>
|
|
171
182
|
<Col md={6} sm={12} />
|