@lookiero/checkout 6.0.1-beta.1 → 6.1.0-beta.11
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/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +1 -8
- package/dist/src/infrastructure/ui/views/item/Item.js +0 -10
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +3 -3
- package/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.ts +1 -9
- package/src/infrastructure/ui/views/item/Item.tsx +0 -11
|
@@ -5,20 +5,13 @@ import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
|
|
|
5
5
|
import { I18nMessages } from "../i18n/i18n";
|
|
6
6
|
const PAYMENT_ERROR = "ERROR";
|
|
7
7
|
const PAYMENT_SUCCESS = "PAYMENT_INSTRUMENT_UPDATED";
|
|
8
|
-
const PAYMENT_ERROR_TOAST_ID = "8228c0dd-5c7c-4040-8240-a6f642202b96";
|
|
9
|
-
const PAYMENT_SUCCESS_TOAST_ID = "7486a0fa-1080-4690-9494-1c3ff58ef50d";
|
|
10
8
|
const usePaymentInstrumentEvents = ({ logger }) => {
|
|
11
9
|
const { subscribe, unsubscribe } = useEvent();
|
|
12
10
|
const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
|
|
13
|
-
const onSuccess = useCallback(({ message }) => createNotification({
|
|
14
|
-
aggregateId: PAYMENT_SUCCESS_TOAST_ID,
|
|
15
|
-
bodyI18nKey: message.id,
|
|
16
|
-
level: NotificationLevel.SUCCESS,
|
|
17
|
-
}), [createNotification]);
|
|
11
|
+
const onSuccess = useCallback(({ message }) => createNotification({ bodyI18nKey: message.id, level: NotificationLevel.SUCCESS }), [createNotification]);
|
|
18
12
|
const onError = useCallback(({ error }) => {
|
|
19
13
|
if (error.toaster) {
|
|
20
14
|
createNotification({
|
|
21
|
-
aggregateId: PAYMENT_ERROR_TOAST_ID,
|
|
22
15
|
bodyI18nKey: error.toaster.id || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR,
|
|
23
16
|
level: NotificationLevel.ERROR,
|
|
24
17
|
});
|
|
@@ -3,10 +3,8 @@ import { generatePath, useMatch, useNavigate, useParams } from "react-router-nat
|
|
|
3
3
|
import { Box, Spinner } from "@lookiero/aurora";
|
|
4
4
|
import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
|
|
5
5
|
import { useLogger } from "@lookiero/sty-psp-logging";
|
|
6
|
-
import { NotificationLevel, useCreateToastNotification } from "@lookiero/sty-psp-notifications";
|
|
7
6
|
import { useScreenSize } from "@lookiero/sty-psp-ui";
|
|
8
7
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
9
|
-
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
10
8
|
import { useBookCheckoutBookingForCheckoutItem } from "../../../domain/checkoutBooking/react/useBookCheckoutBookingForCheckoutItem";
|
|
11
9
|
import { useReturnCheckoutItem } from "../../../domain/checkoutItem/react/useReturnCheckoutItem";
|
|
12
10
|
import { useViewBookedProductsVariantsForCheckoutItem } from "../../../projection/bookedProductsVariants/react/useViewBookedProductsVariantsForCheckoutItem";
|
|
@@ -39,14 +37,6 @@ const Item = ({ layout: Layout }) => {
|
|
|
39
37
|
const basePath = useBasePath();
|
|
40
38
|
const { customer: { customerId, country, segment }, } = useStaticInfo();
|
|
41
39
|
const isDesktopScreen = screenSize !== "S";
|
|
42
|
-
const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
createNotification({
|
|
45
|
-
aggregateId: "8228c0dd-5c7c-4040-8240-a6f642202b96",
|
|
46
|
-
bodyI18nKey: "whatever",
|
|
47
|
-
level: NotificationLevel.ERROR,
|
|
48
|
-
});
|
|
49
|
-
}, [createNotification]);
|
|
50
40
|
const { id } = useParams();
|
|
51
41
|
const [fiveItemsDiscount = 0, fiveItemsDiscountStatus] = useViewFiveItemsDiscountByCustomerId({ customerId });
|
|
52
42
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "6.0
|
|
1
|
+
export declare const VERSION = "6.1.0-beta.11";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "6.0
|
|
1
|
+
export const VERSION = "6.1.0-beta.11";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0-beta.11",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": "false",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"@lookiero/sty-psp-i18n": "^0.1.7",
|
|
22
22
|
"@lookiero/sty-psp-locale": "^0.2.1",
|
|
23
23
|
"@lookiero/sty-psp-logging": "^0.2.2",
|
|
24
|
-
"@lookiero/sty-psp-notifications": "0.5.5-beta.
|
|
24
|
+
"@lookiero/sty-psp-notifications": "^0.5.5-beta.11",
|
|
25
25
|
"@lookiero/sty-psp-react-native": "^0.2.0",
|
|
26
26
|
"@lookiero/sty-psp-segment": "^0.1.1",
|
|
27
27
|
"@lookiero/sty-psp-storage": "^0.1.3",
|
|
28
28
|
"@lookiero/sty-psp-tracking": "^0.1.6",
|
|
29
|
-
"@lookiero/sty-psp-ui": "^0.5.
|
|
29
|
+
"@lookiero/sty-psp-ui": "^0.5.3-beta.11",
|
|
30
30
|
"@lookiero/sty-psp-ui-settings": "^0.1.1",
|
|
31
31
|
"@lookiero/sty-psp-units": "^0.1.1",
|
|
32
32
|
"@lookiero/sty-psp-uuid": "^0.1.0",
|
|
@@ -7,8 +7,6 @@ import { I18nMessages } from "../i18n/i18n";
|
|
|
7
7
|
|
|
8
8
|
const PAYMENT_ERROR = "ERROR";
|
|
9
9
|
const PAYMENT_SUCCESS = "PAYMENT_INSTRUMENT_UPDATED";
|
|
10
|
-
const PAYMENT_ERROR_TOAST_ID = "8228c0dd-5c7c-4040-8240-a6f642202b96";
|
|
11
|
-
const PAYMENT_SUCCESS_TOAST_ID = "7486a0fa-1080-4690-9494-1c3ff58ef50d";
|
|
12
10
|
|
|
13
11
|
interface Message {
|
|
14
12
|
readonly id: string;
|
|
@@ -47,12 +45,7 @@ const usePaymentInstrumentEvents: UsePaymentInstrumentEventsFunction = ({ logger
|
|
|
47
45
|
const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
|
|
48
46
|
|
|
49
47
|
const onSuccess: OnSuccessFunction = useCallback(
|
|
50
|
-
({ message }) =>
|
|
51
|
-
createNotification({
|
|
52
|
-
aggregateId: PAYMENT_SUCCESS_TOAST_ID,
|
|
53
|
-
bodyI18nKey: message.id,
|
|
54
|
-
level: NotificationLevel.SUCCESS,
|
|
55
|
-
}),
|
|
48
|
+
({ message }) => createNotification({ bodyI18nKey: message.id, level: NotificationLevel.SUCCESS }),
|
|
56
49
|
[createNotification],
|
|
57
50
|
);
|
|
58
51
|
|
|
@@ -60,7 +53,6 @@ const usePaymentInstrumentEvents: UsePaymentInstrumentEventsFunction = ({ logger
|
|
|
60
53
|
({ error }) => {
|
|
61
54
|
if (error.toaster) {
|
|
62
55
|
createNotification({
|
|
63
|
-
aggregateId: PAYMENT_ERROR_TOAST_ID,
|
|
64
56
|
bodyI18nKey: error.toaster.id || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR,
|
|
65
57
|
level: NotificationLevel.ERROR,
|
|
66
58
|
});
|
|
@@ -3,7 +3,6 @@ import { generatePath, useMatch, useNavigate, useParams } from "react-router-nat
|
|
|
3
3
|
import { Box, Spinner } from "@lookiero/aurora";
|
|
4
4
|
import { CommandStatus, QueryStatus } from "@lookiero/messaging-react";
|
|
5
5
|
import { useLogger } from "@lookiero/sty-psp-logging";
|
|
6
|
-
import { NotificationLevel, useCreateToastNotification } from "@lookiero/sty-psp-notifications";
|
|
7
6
|
import { useScreenSize } from "@lookiero/sty-psp-ui";
|
|
8
7
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
9
8
|
import {
|
|
@@ -12,7 +11,6 @@ import {
|
|
|
12
11
|
} from "../../../../projection/bookedProductsVariants/bookedProductsVariants";
|
|
13
12
|
import { CheckoutItemProjection } from "../../../../projection/checkoutItem/checkoutItem";
|
|
14
13
|
import { FeedbackProjection } from "../../../../projection/feedback/feedback";
|
|
15
|
-
import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
|
|
16
14
|
import { useBookCheckoutBookingForCheckoutItem } from "../../../domain/checkoutBooking/react/useBookCheckoutBookingForCheckoutItem";
|
|
17
15
|
import { useReturnCheckoutItem } from "../../../domain/checkoutItem/react/useReturnCheckoutItem";
|
|
18
16
|
import { useViewBookedProductsVariantsForCheckoutItem } from "../../../projection/bookedProductsVariants/react/useViewBookedProductsVariantsForCheckoutItem";
|
|
@@ -75,15 +73,6 @@ const Item: FC<ItemProps> = ({ layout: Layout }) => {
|
|
|
75
73
|
} = useStaticInfo();
|
|
76
74
|
const isDesktopScreen = screenSize !== "S";
|
|
77
75
|
|
|
78
|
-
const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
|
|
79
|
-
useEffect(() => {
|
|
80
|
-
createNotification({
|
|
81
|
-
aggregateId: "8228c0dd-5c7c-4040-8240-a6f642202b96",
|
|
82
|
-
bodyI18nKey: "whatever",
|
|
83
|
-
level: NotificationLevel.ERROR,
|
|
84
|
-
});
|
|
85
|
-
}, [createNotification]);
|
|
86
|
-
|
|
87
76
|
const { id } = useParams();
|
|
88
77
|
const [fiveItemsDiscount = 0, fiveItemsDiscountStatus] = useViewFiveItemsDiscountByCustomerId({ customerId });
|
|
89
78
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|