From e8bdaece189f08d2fc7940edea788a137f358eee Mon Sep 17 00:00:00 2001
From: "hyunwoo93.cha"
Date: Thu, 23 Jan 2025 15:47:53 +0900
Subject: [PATCH] =?UTF-8?q?[SHOPTIME-3780]=20[ShopTime=20=EA=B3=A0?=
=?UTF-8?q?=EB=8F=84=ED=99=94]=20ShopLC=20/=20=EC=83=81=ED=92=88=20?=
=?UTF-8?q?=EC=9E=AC=EA=B3=A0=20=EC=88=98=EB=9F=89=20=EC=B2=B4=ED=81=AC=20?=
=?UTF-8?q?=EA=B8=B0=EC=A4=80=20=EB=B3=80=EA=B2=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/actions/commonActions.js | 18 ++++++++----------
com.twin.app.shoptime/src/utils/Config.js | 4 +---
.../src/utils/helperMethods.js | 17 ++++++++++++++++-
.../DetailPanel/SingleProduct/SingleOption.jsx | 10 +++++++++-
.../src/views/MainView/MainView.jsx | 3 ++-
5 files changed, 36 insertions(+), 16 deletions(-)
diff --git a/com.twin.app.shoptime/src/actions/commonActions.js b/com.twin.app.shoptime/src/actions/commonActions.js
index 808294f6..57d8cafe 100644
--- a/com.twin.app.shoptime/src/actions/commonActions.js
+++ b/com.twin.app.shoptime/src/actions/commonActions.js
@@ -482,22 +482,19 @@ export const setGNBMenu = (menu) => ({
payload: menu,
});
-export const setErrorMessage = (errorCode, errorMsg) => ({
- type: types.SET_ERROR_MESSAGE,
- payload: {
- errorCode,
- errorMsg,
- },
-});
-
export const clearErrorMessage = () => ({
type: types.CLEAR_ERROR_MESSAGE,
});
export const showError =
- (errorCode, errorMsg, shouldPopPanel = false, retDetailCode = null) =>
+ (
+ errorCode,
+ errorMsg,
+ shouldPopPanel = false,
+ retDetailCode = null,
+ returnBindStrings = null
+ ) =>
(dispatch) => {
- dispatch(setErrorMessage(errorCode, errorMsg, retDetailCode));
dispatch(
setShowPopup(Config.ACTIVE_POPUP.errorPopup, {
data: {
@@ -505,6 +502,7 @@ export const showError =
errorMsg,
retDetailCode,
shouldPopPanel,
+ returnBindStrings,
},
})
);
diff --git a/com.twin.app.shoptime/src/utils/Config.js b/com.twin.app.shoptime/src/utils/Config.js
index 9ec5a1df..50fa3e6b 100644
--- a/com.twin.app.shoptime/src/utils/Config.js
+++ b/com.twin.app.shoptime/src/utils/Config.js
@@ -528,9 +528,7 @@ export const ERROR_MESSAGES_GROUPS = [
},
{
codes: [1120],
- message: $L(
- "The selected item is out of stock and cannot be ordered.(ID: Development in progress)"
- ),
+ message: $L("The selected item is out of stock and cannot be ordered."),
},
{
codes: [1121],
diff --git a/com.twin.app.shoptime/src/utils/helperMethods.js b/com.twin.app.shoptime/src/utils/helperMethods.js
index 2c894a4c..f401db85 100644
--- a/com.twin.app.shoptime/src/utils/helperMethods.js
+++ b/com.twin.app.shoptime/src/utils/helperMethods.js
@@ -542,7 +542,12 @@ export const getTimeDifferenceByMilliseconds = (
return timeDifference > threshold;
};
-export const getErrorMessage = (errorCode, retMsg, retDetailCode) => {
+export const getErrorMessage = (
+ errorCode,
+ retMsg,
+ retDetailCode,
+ returnBindStrings
+) => {
const group = ERROR_MESSAGES_GROUPS.find((group) =>
group.codes.includes(Number(errorCode))
);
@@ -554,6 +559,16 @@ export const getErrorMessage = (errorCode, retMsg, retDetailCode) => {
: "";
if (group) {
+ if (
+ errorCode === 1120 &&
+ returnBindStrings &&
+ typeof returnBindStrings === "object"
+ ) {
+ return `${errorPrefix} ${group.message} (ID: ${returnBindStrings.join(
+ ", "
+ )})`;
+ }
+
return errorPrefix + group.message;
} else if (retMsg) {
return errorPrefix + retMsg;
diff --git a/com.twin.app.shoptime/src/views/DetailPanel/SingleProduct/SingleOption.jsx b/com.twin.app.shoptime/src/views/DetailPanel/SingleProduct/SingleOption.jsx
index c1e463db..eeec2fc0 100644
--- a/com.twin.app.shoptime/src/views/DetailPanel/SingleProduct/SingleOption.jsx
+++ b/com.twin.app.shoptime/src/views/DetailPanel/SingleProduct/SingleOption.jsx
@@ -408,7 +408,15 @@ export default function SingleOption({
dispatch(setShowPopup(Config.ACTIVE_POPUP.qrPopup));
dispatch(changeAppStatus({ isLoading: false }));
} else {
- dispatch(showError(response.retCode, response.retMsg, false));
+ dispatch(
+ showError(
+ response.retCode,
+ response.retMsg,
+ false,
+ response.retDetailCode,
+ response.returnBindStrings
+ )
+ );
dispatch(changeAppStatus({ isLoading: false }));
return;
diff --git a/com.twin.app.shoptime/src/views/MainView/MainView.jsx b/com.twin.app.shoptime/src/views/MainView/MainView.jsx
index 71d5094f..a85cb07e 100644
--- a/com.twin.app.shoptime/src/views/MainView/MainView.jsx
+++ b/com.twin.app.shoptime/src/views/MainView/MainView.jsx
@@ -719,7 +719,8 @@ export default function MainView({ className, initService }) {
getErrorMessage(
popupData.errorCode,
popupData.errorMsg,
- popupData.retDetailCode
+ popupData.retDetailCode,
+ popupData.returnBindStrings
)}