@capillarytech/creatives-library 8.0.263 → 8.0.264
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/assets/Android.png +0 -0
- package/assets/iOS.png +0 -0
- package/constants/unified.js +1 -2
- package/initialReducer.js +0 -2
- package/package.json +1 -1
- package/services/api.js +0 -10
- package/services/tests/api.test.js +0 -34
- package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +35 -17
- package/tests/integration/TemplateCreation/api-response.js +1 -31
- package/tests/integration/TemplateCreation/msw-handler.js +0 -2
- package/utils/common.js +0 -5
- package/utils/commonUtils.js +5 -28
- package/utils/tagValidations.js +2 -1
- package/utils/tests/commonUtil.test.js +0 -224
- package/utils/transformTemplateConfig.js +10 -0
- package/v2Components/CapDeviceContent/index.js +56 -61
- package/v2Components/CapTagList/index.js +1 -6
- package/v2Components/CapTagListWithInput/index.js +1 -5
- package/v2Components/CapTagListWithInput/messages.js +1 -1
- package/v2Components/CapWhatsappCTA/tests/index.test.js +0 -5
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +2 -2
- package/v2Components/ErrorInfoNote/index.js +72 -402
- package/v2Components/ErrorInfoNote/messages.js +6 -32
- package/v2Components/ErrorInfoNote/style.scss +6 -278
- package/v2Components/FormBuilder/index.js +8 -8
- package/v2Components/FormBuilder/tests/index.test.js +4 -13
- package/v2Components/HtmlEditor/HTMLEditor.js +99 -418
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +133 -1882
- package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +16 -27
- package/v2Components/HtmlEditor/_htmlEditor.scss +45 -108
- package/v2Components/HtmlEditor/_index.lazy.scss +1 -0
- package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +102 -23
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +140 -148
- package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +1 -2
- package/v2Components/HtmlEditor/components/DeviceToggle/index.js +3 -3
- package/v2Components/HtmlEditor/components/EditorToolbar/_editorToolbar.scss +1 -9
- package/v2Components/HtmlEditor/components/EditorToolbar/index.js +6 -31
- package/v2Components/HtmlEditor/components/FullscreenModal/_fullscreenModal.scss +0 -22
- package/v2Components/HtmlEditor/components/InAppPreviewPane/DeviceFrame.js +7 -4
- package/v2Components/HtmlEditor/components/InAppPreviewPane/__tests__/DeviceFrame.test.js +45 -35
- package/v2Components/HtmlEditor/components/InAppPreviewPane/_inAppPreviewPane.scss +3 -1
- package/v2Components/HtmlEditor/components/InAppPreviewPane/constants.js +33 -33
- package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +6 -7
- package/v2Components/HtmlEditor/components/PreviewPane/_previewPane.scss +10 -7
- package/v2Components/HtmlEditor/components/PreviewPane/index.js +43 -22
- package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +1 -1
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/__tests__/index.test.js +152 -0
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/_validationErrorDisplay.scss +0 -18
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +31 -36
- package/v2Components/HtmlEditor/components/ValidationPanel/_validationPanel.scss +34 -46
- package/v2Components/HtmlEditor/components/ValidationPanel/index.js +46 -52
- package/v2Components/HtmlEditor/constants.js +20 -45
- package/v2Components/HtmlEditor/hooks/__tests__/useInAppContent.test.js +16 -373
- package/v2Components/HtmlEditor/hooks/__tests__/useValidation.test.js +16 -351
- package/v2Components/HtmlEditor/hooks/useEditorContent.js +2 -5
- package/v2Components/HtmlEditor/hooks/useInAppContent.js +146 -88
- package/v2Components/HtmlEditor/hooks/useValidation.js +56 -213
- package/v2Components/HtmlEditor/index.js +1 -1
- package/v2Components/HtmlEditor/messages.js +94 -102
- package/v2Components/HtmlEditor/utils/__tests__/htmlValidator.enhanced.test.js +45 -214
- package/v2Components/HtmlEditor/utils/__tests__/validationAdapter.test.js +0 -134
- package/v2Components/HtmlEditor/utils/contentSanitizer.js +41 -40
- package/v2Components/HtmlEditor/utils/htmlValidator.js +72 -71
- package/v2Components/HtmlEditor/utils/liquidTemplateSupport.js +124 -158
- package/v2Components/HtmlEditor/utils/properSyntaxHighlighting.js +25 -23
- package/v2Components/HtmlEditor/utils/validationAdapter.js +41 -66
- package/v2Components/MobilePushPreviewV2/index.js +7 -33
- package/v2Components/TemplatePreview/_templatePreview.scss +24 -55
- package/v2Components/TemplatePreview/index.js +32 -47
- package/v2Components/TemplatePreview/messages.js +0 -4
- package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +0 -1
- package/v2Containers/BeeEditor/index.js +90 -172
- package/v2Containers/CreativesContainer/SlideBoxContent.js +51 -127
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +13 -163
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -2
- package/v2Containers/CreativesContainer/constants.js +0 -1
- package/v2Containers/CreativesContainer/index.js +46 -240
- package/v2Containers/CreativesContainer/messages.js +0 -8
- package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +2 -11
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +50 -38
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -103
- package/v2Containers/Email/actions.js +0 -7
- package/v2Containers/Email/constants.js +1 -5
- package/v2Containers/Email/index.js +29 -234
- package/v2Containers/Email/messages.js +0 -32
- package/v2Containers/Email/reducer.js +1 -12
- package/v2Containers/Email/sagas.js +7 -61
- package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +0 -2
- package/v2Containers/Email/tests/reducer.test.js +0 -46
- package/v2Containers/Email/tests/sagas.test.js +29 -320
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +21 -211
- package/v2Containers/EmailWrapper/components/HTMLEditorTesting.js +74 -40
- package/v2Containers/EmailWrapper/components/__tests__/HTMLEditorTesting.test.js +67 -2
- package/v2Containers/EmailWrapper/constants.js +0 -2
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +77 -629
- package/v2Containers/EmailWrapper/index.js +23 -103
- package/v2Containers/EmailWrapper/messages.js +1 -65
- package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +214 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +77 -594
- package/v2Containers/FTP/index.js +1 -1
- package/v2Containers/InApp/actions.js +0 -7
- package/v2Containers/InApp/constants.js +4 -20
- package/v2Containers/InApp/index.js +360 -802
- package/v2Containers/InApp/index.scss +3 -4
- package/v2Containers/InApp/messages.js +3 -7
- package/v2Containers/InApp/reducer.js +3 -21
- package/v2Containers/InApp/sagas.js +9 -29
- package/v2Containers/InApp/selectors.js +5 -25
- package/v2Containers/InApp/tests/index.test.js +50 -154
- package/v2Containers/InApp/tests/reducer.test.js +0 -34
- package/v2Containers/InApp/tests/sagas.test.js +9 -61
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +0 -3
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +0 -2
- package/v2Containers/Line/Container/Text/index.js +1 -0
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +0 -2
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +0 -9
- package/v2Containers/MobilePushNew/index.js +1 -0
- package/v2Containers/Rcs/index.js +3 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +0 -12
- package/v2Containers/SmsTrai/Edit/index.js +1 -0
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +0 -4
- package/v2Containers/TagList/index.js +19 -62
- package/v2Containers/Templates/_templates.scss +1 -60
- package/v2Containers/Templates/index.js +4 -89
- package/v2Containers/Templates/messages.js +0 -4
- package/v2Containers/TemplatesV2/TemplatesV2.style.js +2 -4
- package/v2Containers/Viber/index.js +1 -0
- package/v2Containers/WebPush/Create/index.js +1 -1
- package/v2Containers/WebPush/Create/utils/validation.js +2 -1
- package/v2Containers/Whatsapp/index.js +1 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +0 -34
- package/v2Containers/Zalo/index.js +1 -0
- package/v2Containers/Zalo/tests/index.test.js +1 -5
- package/v2Components/ErrorInfoNote/constants.js +0 -1
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +0 -870
- package/v2Components/HtmlEditor/components/ValidationPanel/constants.js +0 -6
- package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +0 -281
- package/v2Components/HtmlEditor/components/ValidationTabs/index.js +0 -295
- package/v2Components/HtmlEditor/components/ValidationTabs/messages.js +0 -51
- package/v2Components/HtmlEditor/utils/validationConstants.js +0 -38
- package/v2Components/MobilePushPreviewV2/constants.js +0 -6
- package/v2Containers/BeePopupEditor/_beePopupEditor.scss +0 -14
- package/v2Containers/BeePopupEditor/constants.js +0 -10
- package/v2Containers/BeePopupEditor/index.js +0 -194
- package/v2Containers/BeePopupEditor/tests/index.test.js +0 -627
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +0 -1246
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +0 -2472
- package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +0 -520
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +0 -956
- package/v2Containers/InApp/__tests__/InAppHTMLEditor.test.js +0 -376
- package/v2Containers/InApp/__tests__/sagas.test.js +0 -363
- package/v2Containers/InApp/tests/selectors.test.js +0 -612
- package/v2Containers/InAppWrapper/components/InAppWrapperView.js +0 -151
- package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +0 -267
- package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +0 -23
- package/v2Containers/InAppWrapper/constants.js +0 -16
- package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +0 -473
- package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +0 -198
- package/v2Containers/InAppWrapper/index.js +0 -148
- package/v2Containers/InAppWrapper/messages.js +0 -49
- package/v2Containers/InappAdvance/index.js +0 -1099
- package/v2Containers/InappAdvance/index.scss +0 -10
- package/v2Containers/InappAdvance/tests/index.test.js +0 -448
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
useState, useEffect, useCallback, useMemo, useRef,
|
|
3
|
-
} from "react";
|
|
1
|
+
import React, { useState, useEffect, useCallback } from "react";
|
|
4
2
|
import isEmpty from 'lodash/isEmpty';
|
|
5
3
|
import get from 'lodash/get';
|
|
6
4
|
import { bindActionCreators } from "redux";
|
|
@@ -9,19 +7,21 @@ import { injectIntl, FormattedMessage } from "react-intl";
|
|
|
9
7
|
import { DAEMON } from '@capillarytech/vulcan-react-sdk/utils/sagaInjectorTypes';
|
|
10
8
|
import CapHeading from "@capillarytech/cap-ui-library/CapHeading";
|
|
11
9
|
import CapSpin from "@capillarytech/cap-ui-library/CapSpin";
|
|
10
|
+
import CapInput from "@capillarytech/cap-ui-library/CapInput";
|
|
12
11
|
import CapRadioGroup from "@capillarytech/cap-ui-library/CapRadioGroup";
|
|
13
12
|
import CapRow from "@capillarytech/cap-ui-library/CapRow";
|
|
14
13
|
import CapColumn from "@capillarytech/cap-ui-library/CapColumn";
|
|
15
14
|
import CapButton from "@capillarytech/cap-ui-library/CapButton";
|
|
15
|
+
import CapTab from "@capillarytech/cap-ui-library/CapTab";
|
|
16
16
|
import CapNotification from "@capillarytech/cap-ui-library/CapNotification";
|
|
17
|
-
import { makeSelectInApp, makeSelectAccount
|
|
17
|
+
import { makeSelectInApp, makeSelectAccount } from "./selectors";
|
|
18
18
|
import * as globalActions from '../Cap/actions';
|
|
19
19
|
import {
|
|
20
20
|
isLoadingMetaEntities,
|
|
21
21
|
makeSelectMetaEntities,
|
|
22
22
|
setInjectedTags,
|
|
23
23
|
selectCurrentOrgDetails,
|
|
24
|
-
selectLiquidStateDetails
|
|
24
|
+
selectLiquidStateDetails
|
|
25
25
|
} from "../Cap/selectors";
|
|
26
26
|
import * as inAppActions from "./actions";
|
|
27
27
|
import './index.scss';
|
|
@@ -40,7 +40,6 @@ import {
|
|
|
40
40
|
ANDROID,
|
|
41
41
|
BIG_PICTURE,
|
|
42
42
|
BIG_TEXT,
|
|
43
|
-
BIG_HTML,
|
|
44
43
|
DEEP_LINK,
|
|
45
44
|
DEVICE_SUPPORTED,
|
|
46
45
|
INAPP_BUTTON_TYPES,
|
|
@@ -49,22 +48,19 @@ import {
|
|
|
49
48
|
INITIAL_CTA_DATA,
|
|
50
49
|
IOS,
|
|
51
50
|
LAYOUT_RADIO_OPTIONS,
|
|
52
|
-
|
|
51
|
+
AI_CONTENT_BOT_DISABLED,
|
|
53
52
|
} from "./constants";
|
|
54
53
|
import { INAPP, SMS } from "../CreativesContainer/constants";
|
|
55
54
|
import {
|
|
56
55
|
ALL, TAG, EMBEDDED, DEFAULT, FULL, LIBRARY,
|
|
57
56
|
} from "../Whatsapp/constants";
|
|
57
|
+
import CapDeviceContent from "../../v2Components/CapDeviceContent";
|
|
58
58
|
import { getCdnUrl } from "../../utils/cdnTransformation";
|
|
59
59
|
import { getCtaObject, hasAnyErrors, getSingleTab } from "./utils";
|
|
60
60
|
import { validateInAppContent } from "../../utils/commonUtils";
|
|
61
|
+
import ErrorInfoNote from "../../v2Components/ErrorInfoNote";
|
|
61
62
|
import { hasLiquidSupportFeature } from "../../utils/common";
|
|
62
63
|
import formBuilderMessages from "../../v2Components/FormBuilder/messages";
|
|
63
|
-
import HTMLEditor from "../../v2Components/HtmlEditor";
|
|
64
|
-
import { HTML_EDITOR_VARIANTS } from "../../v2Components/HtmlEditor/constants";
|
|
65
|
-
import { INAPP_EDITOR_TYPES } from "../InAppWrapper/constants";
|
|
66
|
-
import InappAdvanced from "../InappAdvance/index";
|
|
67
|
-
import { ErrorInfoNote } from "../../v2Components/ErrorInfoNote";
|
|
68
64
|
|
|
69
65
|
let editContent = {};
|
|
70
66
|
|
|
@@ -72,14 +68,13 @@ export const InApp = (props) => {
|
|
|
72
68
|
const {
|
|
73
69
|
intl,
|
|
74
70
|
actions,
|
|
75
|
-
globalActions,
|
|
76
71
|
isFullMode,
|
|
77
72
|
onCreateComplete,
|
|
78
73
|
params,
|
|
79
74
|
templateData = {},
|
|
80
|
-
defaultData = {},
|
|
81
75
|
editData = {},
|
|
82
76
|
accountData = {},
|
|
77
|
+
globalActions,
|
|
83
78
|
location,
|
|
84
79
|
getDefaultTags,
|
|
85
80
|
supportedTags,
|
|
@@ -87,19 +82,8 @@ export const InApp = (props) => {
|
|
|
87
82
|
injectedTags,
|
|
88
83
|
getFormData,
|
|
89
84
|
selectedOfferDetails,
|
|
90
|
-
fetchingLiquidValidation,
|
|
91
|
-
templateName,
|
|
92
|
-
getTemplateDetailsInProgress,
|
|
93
|
-
isEditInApp,
|
|
94
|
-
setIsLoadingContent,
|
|
95
|
-
query,
|
|
96
|
-
inAppCreateMode,
|
|
97
|
-
isGetFormData,
|
|
98
|
-
showTemplateName,
|
|
99
|
-
onValidationFail,
|
|
100
|
-
type,
|
|
101
|
-
forwardedTags,
|
|
102
85
|
currentOrgDetails,
|
|
86
|
+
fetchingLiquidValidation,
|
|
103
87
|
// TestAndPreviewSlidebox props
|
|
104
88
|
showTestAndPreviewSlidebox: propsShowTestAndPreviewSlidebox,
|
|
105
89
|
handleTestAndPreview: propsHandleTestAndPreview,
|
|
@@ -112,7 +96,7 @@ export const InApp = (props) => {
|
|
|
112
96
|
const [templateMediaType, setTemplateMediaType] = useState(
|
|
113
97
|
INAPP_MEDIA_TYPES.TEXT
|
|
114
98
|
);
|
|
115
|
-
const [
|
|
99
|
+
const [templateName, setTemplateName] = useState("");
|
|
116
100
|
const [templateLayoutType, setTemplateLayoutType] = useState(
|
|
117
101
|
INAPP_MESSAGE_LAYOUT_TYPES.MODAL
|
|
118
102
|
);
|
|
@@ -126,25 +110,6 @@ export const InApp = (props) => {
|
|
|
126
110
|
const [templateMessageErrorIos, setTemplateMessageErrorIos] = useState(false);
|
|
127
111
|
const [templateTitleErrorAndroid, setTemplateTitleErrorAndroid] = useState(false);
|
|
128
112
|
const [templateTitleErrorIos, setTemplateTitleErrorIos] = useState(false);
|
|
129
|
-
// HTML Editor content state (for INAPP HTML variant)
|
|
130
|
-
// Initialize HTML content from edit data if available
|
|
131
|
-
const getInitialHtmlContent = (device) => {
|
|
132
|
-
const editContent = isFullMode
|
|
133
|
-
? get(editData?.templateDetails?.versions, `base.content`, {})
|
|
134
|
-
: get(templateData?.versions, `base.content`, {});
|
|
135
|
-
const deviceContent = editContent?.[device];
|
|
136
|
-
return deviceContent?.message || "";
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const [htmlContentAndroid, setHtmlContentAndroid] = useState(() => getInitialHtmlContent("ANDROID"));
|
|
140
|
-
const [htmlContentIos, setHtmlContentIos] = useState(() => getInitialHtmlContent("IOS"));
|
|
141
|
-
// Track if this is an HTML template (type === HTML or style === BIG_HTML)
|
|
142
|
-
const [isHTMLTemplate, setIsHTMLTemplate] = useState(false);
|
|
143
|
-
// Version to force HTMLEditor remount on layout changes
|
|
144
|
-
const [htmlEditorContentVersion, setHtmlEditorContentVersion] = useState(0);
|
|
145
|
-
// Refs to store latest content before layout changes
|
|
146
|
-
const htmlContentAndroidRef = useRef(htmlContentAndroid);
|
|
147
|
-
const htmlContentIosRef = useRef(htmlContentIos);
|
|
148
113
|
const [accountId, setAccountId] = useState("");
|
|
149
114
|
const [accessToken, setAccessToken] = useState("");
|
|
150
115
|
const [accountName, setAccountName] = useState("");
|
|
@@ -253,6 +218,9 @@ export const InApp = (props) => {
|
|
|
253
218
|
}
|
|
254
219
|
}, [propsHandleCloseTestAndPreview]);
|
|
255
220
|
const { accessibleFeatures = [] } = currentOrgDetails || {};
|
|
221
|
+
const isAiContentBotDisabled = accessibleFeatures?.includes(
|
|
222
|
+
AI_CONTENT_BOT_DISABLED
|
|
223
|
+
);
|
|
256
224
|
const [errorMessage, setErrorMessage] = useState({
|
|
257
225
|
STANDARD_ERROR_MSG: {
|
|
258
226
|
ANDROID: [],
|
|
@@ -280,7 +248,7 @@ export const InApp = (props) => {
|
|
|
280
248
|
// DEVICE_SUPPORTED is '1', which indicates if the particular account is supported, and '0' if the devive is not supported
|
|
281
249
|
//get deep link keys in an array
|
|
282
250
|
const deepLinkKeys = Object.values(JSON.parse(deepLinkObj || '{}'));
|
|
283
|
-
const keys = deepLinkKeys?.map((link) => ({
|
|
251
|
+
const keys = deepLinkKeys?.map((link) => ({label: link.name, value: link.link, title: link.link }));
|
|
284
252
|
setPanes(isAndroidSupported ? ANDROID : IOS);
|
|
285
253
|
setDeepLink(keys);
|
|
286
254
|
setAccountId(sourceAccountIdentifier);
|
|
@@ -305,32 +273,6 @@ export const InApp = (props) => {
|
|
|
305
273
|
};
|
|
306
274
|
}, [paramObj.id]);
|
|
307
275
|
|
|
308
|
-
// Initialize template name from defaultData (from wrapper) or editData/templateData
|
|
309
|
-
useEffect(() => {
|
|
310
|
-
const defaultTemplateName = defaultData?.['template-name'] || '';
|
|
311
|
-
if (defaultTemplateName && !isEditFlow) {
|
|
312
|
-
setTempName(defaultTemplateName);
|
|
313
|
-
// Call showTemplateName callback if provided (for header display)
|
|
314
|
-
if (isFullMode && showTemplateName && defaultTemplateName) {
|
|
315
|
-
showTemplateName({
|
|
316
|
-
formData: { 'template-name': defaultTemplateName },
|
|
317
|
-
onFormDataChange: (updatedFormData) => {
|
|
318
|
-
const newName = updatedFormData?.['template-name'] || '';
|
|
319
|
-
setTempName(newName);
|
|
320
|
-
if (showTemplateName) {
|
|
321
|
-
showTemplateName({
|
|
322
|
-
formData: { 'template-name': newName },
|
|
323
|
-
onFormDataChange: (formData) => {
|
|
324
|
-
setTempName(formData?.['template-name'] || '');
|
|
325
|
-
},
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
},
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}, [defaultData?.['template-name'], showTemplateName, isEditFlow]);
|
|
333
|
-
|
|
334
276
|
useEffect(() => {
|
|
335
277
|
const {
|
|
336
278
|
name = "",
|
|
@@ -338,48 +280,16 @@ export const InApp = (props) => {
|
|
|
338
280
|
createdAt = "",
|
|
339
281
|
} = isFullMode ? editData?.templateDetails || {} : templateData || {};
|
|
340
282
|
editContent = get(versions, `base.content`, {});
|
|
341
|
-
|
|
342
|
-
// LIBRARY MODE FIX: Backend stores bodyType as 'POPUP' but UI expects 'MODAL'
|
|
343
|
-
// Convert back to MODAL for display
|
|
344
|
-
if (!isFullMode && editContent) {
|
|
345
|
-
if (editContent.ANDROID?.bodyType === INAPP_MESSAGE_LAYOUT_TYPES.POPUP) {
|
|
346
|
-
editContent.ANDROID.bodyType = INAPP_MESSAGE_LAYOUT_TYPES.MODAL;
|
|
347
|
-
}
|
|
348
|
-
if (editContent.IOS?.bodyType === INAPP_MESSAGE_LAYOUT_TYPES.POPUP) {
|
|
349
|
-
editContent.IOS.bodyType = INAPP_MESSAGE_LAYOUT_TYPES.MODAL;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
283
|
if (editContent && !isEmpty(editContent)) {
|
|
354
284
|
setEditFlow(true);
|
|
355
|
-
|
|
285
|
+
setTemplateName(name);
|
|
356
286
|
setTemplateDate(createdAt);
|
|
357
287
|
setTemplateLayoutType(editContent?.ANDROID?.bodyType);
|
|
358
|
-
// Call showTemplateName callback when in edit mode + full mode to show template name header
|
|
359
|
-
if (showTemplateName && name) {
|
|
360
|
-
showTemplateName({
|
|
361
|
-
formData: { 'template-name': name },
|
|
362
|
-
onFormDataChange: (updatedFormData) => {
|
|
363
|
-
const newName = updatedFormData?.['template-name'] || '';
|
|
364
|
-
setTempName(newName);
|
|
365
|
-
if (showTemplateName) {
|
|
366
|
-
showTemplateName({
|
|
367
|
-
formData: { 'template-name': newName },
|
|
368
|
-
onFormDataChange: (formData) => {
|
|
369
|
-
setTempName(formData?.['template-name'] || '');
|
|
370
|
-
},
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
},
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
288
|
const androidContent = editContent?.ANDROID;
|
|
377
|
-
let androidIsHTML = false;
|
|
378
289
|
if (!isEmpty(androidContent)) {
|
|
379
290
|
const {
|
|
380
291
|
title: androidTitle = '',
|
|
381
292
|
message: androidMessage = '',
|
|
382
|
-
type: androidType = '',
|
|
383
293
|
ctas: androidCta = {},
|
|
384
294
|
expandableDetails: androidExpandableDetails = {},
|
|
385
295
|
} = androidContent || {};
|
|
@@ -389,30 +299,12 @@ export const InApp = (props) => {
|
|
|
389
299
|
ctas: androidCtas,
|
|
390
300
|
} = androidExpandableDetails || {};
|
|
391
301
|
const androidCtaLength = androidCtas?.length;
|
|
392
|
-
// Check if this is a Bee editor template
|
|
393
|
-
const isBEEeditor = get(androidContent, 'isBEEeditor');
|
|
394
|
-
const isBeeFreeTemplate = !isEmpty(androidTitle) && androidTitle.toLowerCase() === 'bee free template';
|
|
395
|
-
// Check if this is an HTML editor template (identified by special title)
|
|
396
|
-
const isHTMLEditorTemplate = !isEmpty(androidTitle) && androidTitle.toLowerCase() === 'html editor template';
|
|
397
|
-
// Check if this is an HTML template
|
|
398
|
-
// Prioritize HTML editor template title, then check type/style
|
|
399
|
-
// But exclude if it's a Bee editor template
|
|
400
|
-
androidIsHTML = isHTMLEditorTemplate || ((androidType === INAPP_MEDIA_TYPES.HTML || androidStyle === BIG_HTML)
|
|
401
|
-
&& !isBEEeditor
|
|
402
|
-
&& !isBeeFreeTemplate);
|
|
403
|
-
setIsHTMLTemplate(androidIsHTML);
|
|
404
|
-
|
|
405
302
|
setTitleAndroid(androidTitle);
|
|
406
303
|
setTemplateMessageAndroid(androidMessage);
|
|
407
|
-
// Initialize HTML content for HTMLEditor if feature is enabled and it's an HTML template
|
|
408
|
-
if (androidIsHTML) {
|
|
409
|
-
setHtmlContentAndroid(androidMessage);
|
|
410
|
-
}
|
|
411
304
|
setTemplateMediaType(
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
: INAPP_MEDIA_TYPES.IMAGE
|
|
305
|
+
androidStyle === BIG_TEXT
|
|
306
|
+
? INAPP_MEDIA_TYPES.TEXT
|
|
307
|
+
: INAPP_MEDIA_TYPES.IMAGE
|
|
416
308
|
);
|
|
417
309
|
setInAppImageSrcAndroid(androidImage);
|
|
418
310
|
setDeepLinkValueAndroid(androidCta[0]?.actionLink || '');
|
|
@@ -429,7 +321,6 @@ export const InApp = (props) => {
|
|
|
429
321
|
const {
|
|
430
322
|
title: iosTitle = '',
|
|
431
323
|
message: iosMessage = '',
|
|
432
|
-
type: iosType = '',
|
|
433
324
|
ctas: iosCta = {},
|
|
434
325
|
expandableDetails: iosExpandableDetails = {},
|
|
435
326
|
} = iosContent || {};
|
|
@@ -439,53 +330,9 @@ export const InApp = (props) => {
|
|
|
439
330
|
ctas: iosCtas,
|
|
440
331
|
} = iosExpandableDetails || {};
|
|
441
332
|
const iosCtaLength = iosCtas?.length;
|
|
442
|
-
|
|
443
|
-
// Check if this is an HTML template (if Android wasn't HTML, check iOS)
|
|
444
|
-
// Note: androidIsHTML is in the outer scope from the Android content check above
|
|
445
|
-
if (!androidIsHTML) {
|
|
446
|
-
// Check if this is a Bee editor template
|
|
447
|
-
const isBEEeditor = get(iosContent, 'isBEEeditor');
|
|
448
|
-
const isBeeFreeTemplate = !isEmpty(iosTitle) && iosTitle.toLowerCase() === 'bee free template';
|
|
449
|
-
// Check if this is an HTML editor template (identified by special title)
|
|
450
|
-
const isHTMLEditorTemplate = !isEmpty(iosTitle) && iosTitle.toLowerCase() === 'html editor template';
|
|
451
|
-
// Check if this is an HTML template
|
|
452
|
-
// Prioritize HTML editor template title, then check type/style
|
|
453
|
-
// But exclude if it's a Bee editor template
|
|
454
|
-
const iosIsHTML = isHTMLEditorTemplate || ((iosType === INAPP_MEDIA_TYPES.HTML || iosStyle === BIG_HTML)
|
|
455
|
-
&& !isBEEeditor
|
|
456
|
-
&& !isBeeFreeTemplate);
|
|
457
|
-
setIsHTMLTemplate(iosIsHTML);
|
|
458
|
-
// Initialize HTML content for HTMLEditor if feature is enabled and it's an HTML template
|
|
459
|
-
if (iosIsHTML) {
|
|
460
|
-
setHtmlContentIos(iosMessage);
|
|
461
|
-
}
|
|
462
|
-
} else {
|
|
463
|
-
// If Android is HTML, also initialize iOS HTML content if available
|
|
464
|
-
if (androidIsHTML) {
|
|
465
|
-
setHtmlContentIos(iosMessage);
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
|
|
469
333
|
setTitleIos(iosTitle);
|
|
470
334
|
setTemplateMessageIos(iosMessage);
|
|
471
|
-
|
|
472
|
-
if (!androidIsHTML) {
|
|
473
|
-
// Check if this is a Bee editor template
|
|
474
|
-
const isBEEeditor = get(iosContent, 'isBEEeditor');
|
|
475
|
-
const isBeeFreeTemplate = !isEmpty(iosTitle) && iosTitle.toLowerCase() === 'bee free template';
|
|
476
|
-
// Check if this is an HTML editor template (identified by special title)
|
|
477
|
-
const isHTMLEditorTemplate = !isEmpty(iosTitle) && iosTitle.toLowerCase() === 'html editor template';
|
|
478
|
-
// Check if this is an HTML template
|
|
479
|
-
// Prioritize HTML editor template title, then check type/style
|
|
480
|
-
const iosIsHTML = isHTMLEditorTemplate || ((iosType === INAPP_MEDIA_TYPES.HTML || iosStyle === BIG_HTML)
|
|
481
|
-
&& !isBEEeditor
|
|
482
|
-
&& !isBeeFreeTemplate);
|
|
483
|
-
if (iosIsHTML) {
|
|
484
|
-
setTemplateMediaType(INAPP_MEDIA_TYPES.HTML);
|
|
485
|
-
} else {
|
|
486
|
-
setTemplateMediaType(iosStyle === BIG_TEXT ? INAPP_MEDIA_TYPES.TEXT : INAPP_MEDIA_TYPES.IMAGE);
|
|
487
|
-
}
|
|
488
|
-
}
|
|
335
|
+
setTemplateMediaType(iosStyle === BIG_TEXT ? INAPP_MEDIA_TYPES.TEXT : INAPP_MEDIA_TYPES.IMAGE);
|
|
489
336
|
setInAppImageSrcIos(iosImage);
|
|
490
337
|
setButtonTypeIos(iosCtaLength ? INAPP_BUTTON_TYPES.CTA : INAPP_BUTTON_TYPES.NONE);
|
|
491
338
|
setAddActionLinkIos(!isEmpty(iosCta) && true);
|
|
@@ -494,47 +341,12 @@ export const InApp = (props) => {
|
|
|
494
341
|
setCtaDataIos(getCtaObject(iosCtas));
|
|
495
342
|
}
|
|
496
343
|
}
|
|
497
|
-
} else {
|
|
498
|
-
// Explicitly set edit flow to false if there's no edit content
|
|
499
|
-
setEditFlow(false);
|
|
500
344
|
}
|
|
501
345
|
}, [editData.templateDetails || templateData]);
|
|
502
346
|
|
|
503
|
-
// Extract editor type from defaultData for stable reference
|
|
504
|
-
const editorType = useMemo(() => {
|
|
505
|
-
const type = defaultData?.['editor-type'];
|
|
506
|
-
return type;
|
|
507
|
-
}, [defaultData]);
|
|
508
|
-
|
|
509
|
-
// Separate effect for handling editor type from wrapper in create mode
|
|
510
|
-
useEffect(() => {
|
|
511
|
-
// Only process editor type if we're not in edit flow
|
|
512
|
-
if (!isEditFlow) {
|
|
513
|
-
if (editorType === INAPP_EDITOR_TYPES.HTML_EDITOR) {
|
|
514
|
-
setIsHTMLTemplate(true);
|
|
515
|
-
setTemplateMediaType(INAPP_MEDIA_TYPES.HTML);
|
|
516
|
-
} else if (editorType === INAPP_EDITOR_TYPES.DRAG_DROP_EDITOR) {
|
|
517
|
-
setIsHTMLTemplate(false);
|
|
518
|
-
} else if (!editorType) {
|
|
519
|
-
// If no editor type is set yet, ensure we start with false
|
|
520
|
-
setIsHTMLTemplate(false);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
}, [editorType, isEditFlow]);
|
|
524
|
-
|
|
525
347
|
// tag Code start from here
|
|
526
348
|
useEffect(() => {
|
|
527
|
-
//
|
|
528
|
-
tagsFetchedRef.current = false;
|
|
529
|
-
|
|
530
|
-
// Only fetch tags if HTML Editor is not being used (legacy flow)
|
|
531
|
-
// For HTML Editor, tags will be fetched via handleOnTagsContextChange
|
|
532
|
-
if (isHTMLTemplate) {
|
|
533
|
-
// HTML Editor will handle tag fetching via onContextChange
|
|
534
|
-
return;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
//fetching tags for legacy editor
|
|
349
|
+
//fetching tags
|
|
538
350
|
const { type, module } = location.query || {};
|
|
539
351
|
const isEmbedded = type === EMBEDDED;
|
|
540
352
|
const context = isEmbedded ? module : DEFAULT;
|
|
@@ -549,7 +361,7 @@ export const InApp = (props) => {
|
|
|
549
361
|
query.context = getDefaultTags;
|
|
550
362
|
}
|
|
551
363
|
globalActions.fetchSchemaForEntity(query);
|
|
552
|
-
}, [
|
|
364
|
+
}, []);
|
|
553
365
|
|
|
554
366
|
useEffect(() => {
|
|
555
367
|
let tag = get(metaEntities, `tags.standard`, []);
|
|
@@ -560,17 +372,7 @@ export const InApp = (props) => {
|
|
|
560
372
|
updateTags(tag);
|
|
561
373
|
}, [metaEntities]);
|
|
562
374
|
|
|
563
|
-
|
|
564
|
-
const tagsFetchedRef = React.useRef(false);
|
|
565
|
-
|
|
566
|
-
const handleOnTagsContextChange = useCallback((data) => {
|
|
567
|
-
// This function is called when TagList needs to fetch tags
|
|
568
|
-
// It triggers the API call to /meta/TAG endpoint via fetchSchemaForEntity
|
|
569
|
-
// Only fetch if we haven't already fetched for this context
|
|
570
|
-
if (tagsFetchedRef.current) {
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
|
-
|
|
375
|
+
const handleOnTagsContextChange = (data) => {
|
|
574
376
|
const { type } = location.query || {};
|
|
575
377
|
const tempData = (data || '').toLowerCase();
|
|
576
378
|
const isEmbedded = type === EMBEDDED;
|
|
@@ -582,192 +384,260 @@ export const InApp = (props) => {
|
|
|
582
384
|
context,
|
|
583
385
|
embedded,
|
|
584
386
|
};
|
|
585
|
-
// Mark as fetched to prevent duplicate calls
|
|
586
|
-
tagsFetchedRef.current = true;
|
|
587
|
-
// Call the API via Redux action - this will trigger the saga which calls Api.fetchSchemaForEntity
|
|
588
|
-
// The API endpoint will be: /meta/TAG?query={...}
|
|
589
387
|
globalActions.fetchSchemaForEntity(query);
|
|
590
|
-
}
|
|
388
|
+
};
|
|
591
389
|
|
|
390
|
+
const templateDescErrorHandler = (value) => {
|
|
391
|
+
let errorMessage = false;
|
|
392
|
+
const { unsupportedTags, isBraceError } = validateTags({
|
|
393
|
+
content: value,
|
|
394
|
+
tagsParam: tags,
|
|
395
|
+
injectedTagsParams: injectedTags,
|
|
396
|
+
location,
|
|
397
|
+
tagModule: getDefaultTags,
|
|
398
|
+
isFullMode,
|
|
399
|
+
}) || {};
|
|
400
|
+
if (value === '' && INAPP_MEDIA_TYPES.NONE) {
|
|
401
|
+
errorMessage = formatMessage(messages.emptyTemplateDescErrorMessage);
|
|
402
|
+
} else if (unsupportedTags?.length > 0) {
|
|
403
|
+
errorMessage = formatMessage(
|
|
404
|
+
globalMessages.unsupportedTagsValidationError,
|
|
405
|
+
{
|
|
406
|
+
unsupportedTags,
|
|
407
|
+
},
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
if (isBraceError) {
|
|
411
|
+
errorMessage = formatMessage(globalMessages.unbalanacedCurlyBraces);
|
|
412
|
+
}
|
|
413
|
+
return errorMessage;
|
|
414
|
+
};
|
|
592
415
|
|
|
416
|
+
const onTagSelect = (data, id) => {
|
|
417
|
+
if (id === 0) {
|
|
418
|
+
const tempTitle = `${panes === ANDROID ? titleAndroid : titleIos}{{${data}}}`;
|
|
419
|
+
if (panes === ANDROID) {
|
|
420
|
+
setTitleAndroid(tempTitle);
|
|
421
|
+
} else {
|
|
422
|
+
setTitleIos(tempTitle);
|
|
423
|
+
}
|
|
424
|
+
} else {
|
|
425
|
+
const tempMsg = `${panes === ANDROID ? templateMessageAndroid : templateMessageIos}{{${data}}}`;
|
|
426
|
+
const error = templateDescErrorHandler(tempMsg);
|
|
427
|
+
if (panes === ANDROID) {
|
|
428
|
+
setTemplateMessageAndroid(tempMsg);
|
|
429
|
+
setTemplateMessageErrorAndroid(error);
|
|
430
|
+
} else {
|
|
431
|
+
setTemplateMessageIos(tempMsg);
|
|
432
|
+
setTemplateMessageErrorIos(error);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
};
|
|
593
436
|
// tag Code end
|
|
594
437
|
|
|
438
|
+
const onTemplateNameChange = ({ target: { value } }) => {
|
|
439
|
+
setTemplateName(value);
|
|
440
|
+
};
|
|
441
|
+
|
|
595
442
|
const onTemplateLayoutTypeChange = ({ target: { value } }) => {
|
|
596
|
-
// Update layout type and force HTMLEditor to remount with latest content
|
|
597
|
-
// Increment version to force remount - this ensures editor displays current content
|
|
598
443
|
setTemplateLayoutType(value);
|
|
599
|
-
setHtmlEditorContentVersion((prev) => prev + 1);
|
|
600
444
|
};
|
|
601
445
|
|
|
446
|
+
const onCopyTitleAndContent = () => {
|
|
447
|
+
if (panes === ANDROID) {
|
|
448
|
+
setTitleAndroid(titleIos);
|
|
449
|
+
setTemplateMessageAndroid(templateMessageIos);
|
|
450
|
+
} else {
|
|
451
|
+
setTitleIos(titleAndroid);
|
|
452
|
+
setTemplateMessageIos(templateMessageAndroid);
|
|
453
|
+
}
|
|
454
|
+
};
|
|
602
455
|
|
|
456
|
+
const PANES = [
|
|
457
|
+
{
|
|
458
|
+
content: (
|
|
459
|
+
<CapDeviceContent
|
|
460
|
+
intl={intl}
|
|
461
|
+
location={location}
|
|
462
|
+
injectedTags={injectIntl}
|
|
463
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
464
|
+
panes={panes}
|
|
465
|
+
actions={actions}
|
|
466
|
+
editData={editData}
|
|
467
|
+
isFullMode={isFullMode}
|
|
468
|
+
inAppImageSrc={inAppImageSrcAndroid}
|
|
469
|
+
setInAppImageSrc={setInAppImageSrcAndroid}
|
|
470
|
+
isEditFlow={isEditFlow}
|
|
471
|
+
ctaData={ctaDataAndroid}
|
|
472
|
+
setCtaData={setCtaDataAndroid}
|
|
473
|
+
buttonType={buttonTypeAndroid}
|
|
474
|
+
setButtonType={setButtonTypeAndroid}
|
|
475
|
+
accountId={accountId}
|
|
476
|
+
accessToken={accessToken}
|
|
477
|
+
templateMediaType={templateMediaType}
|
|
478
|
+
setTemplateMediaType={setTemplateMediaType}
|
|
479
|
+
title={titleAndroid}
|
|
480
|
+
setTitle={setTitleAndroid}
|
|
481
|
+
templateMessageError={templateMessageErrorAndroid}
|
|
482
|
+
templateMessage={templateMessageAndroid}
|
|
483
|
+
setTemplateMessage={setTemplateMessageAndroid}
|
|
484
|
+
setTemplateMessageError={setTemplateMessageErrorAndroid}
|
|
485
|
+
templateTitleError={templateTitleErrorAndroid}
|
|
486
|
+
setTemplateTitleError={setTemplateTitleErrorAndroid}
|
|
487
|
+
addActionLink={addActionLinkAndroid}
|
|
488
|
+
setAddActionLink={setAddActionLinkAndroid}
|
|
489
|
+
deepLink={deepLink}
|
|
490
|
+
deepLinkValue={deepLinkValueAndroid}
|
|
491
|
+
setDeepLinkValue={setDeepLinkValueAndroid}
|
|
492
|
+
onCopyTitleAndContent={onCopyTitleAndContent}
|
|
493
|
+
tags={tags}
|
|
494
|
+
onTagSelect={onTagSelect}
|
|
495
|
+
handleOnTagsContextChange={handleOnTagsContextChange}
|
|
496
|
+
templateDescErrorHandler={templateDescErrorHandler}
|
|
497
|
+
isAiContentBotDisabled={isAiContentBotDisabled}
|
|
498
|
+
/>
|
|
499
|
+
),
|
|
500
|
+
tab: <FormattedMessage {...messages.Android} />,
|
|
501
|
+
key: ANDROID,
|
|
502
|
+
isSupported: get(accountData, 'selectedWeChatAccount.configs.android') === DEVICE_SUPPORTED,
|
|
503
|
+
// DEVICE_SUPPORTED is '1', which indicates if the particular account is supported, and '0' if the devive is not supported
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
content: (
|
|
507
|
+
<CapDeviceContent
|
|
508
|
+
intl={intl}
|
|
509
|
+
location={location}
|
|
510
|
+
injectedTags={injectIntl}
|
|
511
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
512
|
+
panes={panes}
|
|
513
|
+
actions={actions}
|
|
514
|
+
editData={editData}
|
|
515
|
+
isFullMode={isFullMode}
|
|
516
|
+
inAppImageSrc={inAppImageSrcIos}
|
|
517
|
+
setInAppImageSrc={setInAppImageSrcIos}
|
|
518
|
+
isEditFlow={isEditFlow}
|
|
519
|
+
ctaData={ctaDataIos}
|
|
520
|
+
setCtaData={setCtaDataIos}
|
|
521
|
+
buttonType={buttonTypeIos}
|
|
522
|
+
setButtonType={setButtonTypeIos}
|
|
523
|
+
accountId={accountId}
|
|
524
|
+
accessToken={accessToken}
|
|
525
|
+
templateMediaType={templateMediaType}
|
|
526
|
+
setTemplateMediaType={setTemplateMediaType}
|
|
527
|
+
title={titleIos}
|
|
528
|
+
setTitle={setTitleIos}
|
|
529
|
+
templateMessageError={templateMessageErrorIos}
|
|
530
|
+
templateMessage={templateMessageIos}
|
|
531
|
+
setTemplateMessage={setTemplateMessageIos}
|
|
532
|
+
setTemplateMessageError={setTemplateMessageErrorIos}
|
|
533
|
+
templateTitleError={templateTitleErrorIos}
|
|
534
|
+
setTemplateTitleError={setTemplateTitleErrorIos}
|
|
535
|
+
addActionLink={addActionLinkIos}
|
|
536
|
+
setAddActionLink={setAddActionLinkIos}
|
|
537
|
+
deepLink={deepLink}
|
|
538
|
+
deepLinkValue={deepLinkValueIos}
|
|
539
|
+
setDeepLinkValue={setDeepLinkValueIos}
|
|
540
|
+
onCopyTitleAndContent={onCopyTitleAndContent}
|
|
541
|
+
tags={tags}
|
|
542
|
+
onTagSelect={onTagSelect}
|
|
543
|
+
handleOnTagsContextChange={handleOnTagsContextChange}
|
|
544
|
+
templateDescErrorHandler={templateDescErrorHandler}
|
|
545
|
+
isAiContentBotDisabled={isAiContentBotDisabled}
|
|
546
|
+
/>
|
|
547
|
+
),
|
|
548
|
+
tab: <FormattedMessage {...messages.Ios} />,
|
|
549
|
+
key: IOS,
|
|
550
|
+
isSupported: get(accountData, 'selectedWeChatAccount.configs.ios') === DEVICE_SUPPORTED,
|
|
551
|
+
},
|
|
552
|
+
];
|
|
553
|
+
|
|
554
|
+
const createModeContent = (
|
|
555
|
+
<CapRow>
|
|
556
|
+
{/* template name */}
|
|
557
|
+
<CapHeading type="h4">
|
|
558
|
+
<FormattedMessage {...messages.creativeName} />
|
|
559
|
+
</CapHeading>
|
|
560
|
+
<CapInput
|
|
561
|
+
id="inapp-template-name-input"
|
|
562
|
+
className="inapp-template-name-input"
|
|
563
|
+
onChange={onTemplateNameChange}
|
|
564
|
+
placeholder={formatMessage(globalMessages.templateNamePlaceholder)}
|
|
565
|
+
value={templateName}
|
|
566
|
+
size="default"
|
|
567
|
+
/>
|
|
568
|
+
</CapRow>
|
|
569
|
+
);
|
|
603
570
|
//create methods end
|
|
604
571
|
|
|
605
572
|
//used by create and edit
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
const
|
|
609
|
-
const
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
// Get account-level device support restrictions
|
|
620
|
-
const androidSupported = get(accountData, 'selectedWeChatAccount.configs.android') === DEVICE_SUPPORTED || get(editContent, 'ANDROID.deviceType') === ANDROID;
|
|
621
|
-
const iosSupported = get(accountData, 'selectedWeChatAccount.configs.ios') === DEVICE_SUPPORTED || get(editContent, 'IOS.deviceType') === IOS_CAPITAL;
|
|
622
|
-
|
|
623
|
-
// Check if devices have content - ensure content is a string before calling trim
|
|
624
|
-
let hasAndroidContent = htmlContentAndroid && typeof htmlContentAndroid === 'string' && htmlContentAndroid?.trim() !== '';
|
|
625
|
-
let hasIosContent = htmlContentIos && typeof htmlContentIos === 'string' && htmlContentIos?.trim() !== '';
|
|
626
|
-
|
|
627
|
-
// LIBRARY MODE FIX: In library mode edit, htmlContent states might not be set yet
|
|
628
|
-
// because HTMLEditor loads content via initialContent prop, not via onContentChange
|
|
629
|
-
// Fallback to checking template data content
|
|
630
|
-
if (!hasAndroidContent && isEditFlow && !isFullMode && templateData) {
|
|
631
|
-
const androidTemplateContent = get(templateData, 'versions.base.content.ANDROID.message')
|
|
632
|
-
|| get(templateData, 'versions.base.content.ANDROID.beeHtml.value');
|
|
633
|
-
hasAndroidContent = androidTemplateContent && androidTemplateContent.trim() !== '';
|
|
634
|
-
}
|
|
635
|
-
if (!hasIosContent && isEditFlow && !isFullMode && templateData) {
|
|
636
|
-
const iosTemplateContent = get(templateData, 'versions.base.content.IOS.message')
|
|
637
|
-
|| get(templateData, 'versions.base.content.IOS.beeHtml.value');
|
|
638
|
-
hasIosContent = iosTemplateContent && iosTemplateContent.trim() !== '';
|
|
573
|
+
const getPreviewSection = () => {
|
|
574
|
+
const templateTitle = panes === ANDROID ? titleAndroid : titleIos;
|
|
575
|
+
const templateMsg = panes === ANDROID ? templateMessageAndroid : templateMessageIos;
|
|
576
|
+
const mediaPreview = {};
|
|
577
|
+
let ctaData = {};
|
|
578
|
+
if (panes === ANDROID) {
|
|
579
|
+
ctaData = ctaDataAndroid;
|
|
580
|
+
switch (templateMediaType) {
|
|
581
|
+
case INAPP_MEDIA_TYPES.IMAGE:
|
|
582
|
+
mediaPreview.inAppImageSrcAndroid = inAppImageSrcAndroid;
|
|
583
|
+
break;
|
|
584
|
+
default:
|
|
585
|
+
break;
|
|
639
586
|
}
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
}
|
|
649
|
-
return false;
|
|
650
|
-
}
|
|
651
|
-
// Android not supported and no content in template - skip validation
|
|
652
|
-
return false;
|
|
653
|
-
}
|
|
654
|
-
if (isIosDevice) {
|
|
655
|
-
// Only validate iOS if it's supported by account
|
|
656
|
-
// But in library mode edit, check template data too
|
|
657
|
-
if (iosSupported || (isEditFlow && !isFullMode && hasIosContent)) {
|
|
658
|
-
if (!hasIosContent) {
|
|
659
|
-
return true;
|
|
660
|
-
}
|
|
661
|
-
return false;
|
|
662
|
-
}
|
|
663
|
-
// iOS not supported and no content in template - skip validation
|
|
664
|
-
return false;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
// If no specific device, check if at least one supported device has content
|
|
668
|
-
// Users can create templates with content in Android-only, iOS-only, or both devices
|
|
669
|
-
// Even when both devices are supported, user can create template with content in just one device
|
|
670
|
-
if (androidSupported && iosSupported) {
|
|
671
|
-
// Both devices supported - user can create template with content in Android, iOS, or both
|
|
672
|
-
// Only disable if NEITHER device has content
|
|
673
|
-
if (!hasAndroidContent && !hasIosContent) {
|
|
674
|
-
return true;
|
|
675
|
-
}
|
|
676
|
-
// At least one device has content - enable Done button
|
|
677
|
-
return false;
|
|
678
|
-
}
|
|
679
|
-
if (androidSupported) {
|
|
680
|
-
// Only Android supported - require Android content
|
|
681
|
-
if (!hasAndroidContent) {
|
|
682
|
-
return true;
|
|
683
|
-
}
|
|
684
|
-
// Android has content - enable Done button
|
|
685
|
-
return false;
|
|
686
|
-
}
|
|
687
|
-
if (iosSupported) {
|
|
688
|
-
// Only iOS supported - require iOS content
|
|
689
|
-
if (!hasIosContent) {
|
|
690
|
-
return true;
|
|
691
|
-
}
|
|
692
|
-
// iOS has content - enable Done button
|
|
693
|
-
return false;
|
|
587
|
+
} else {
|
|
588
|
+
ctaData = ctaDataIos;
|
|
589
|
+
switch (templateMediaType) {
|
|
590
|
+
case INAPP_MEDIA_TYPES.IMAGE:
|
|
591
|
+
mediaPreview.inAppImageSrcIos = inAppImageSrcIos;
|
|
592
|
+
break;
|
|
593
|
+
default:
|
|
594
|
+
break;
|
|
694
595
|
}
|
|
695
|
-
// Neither device supported - this shouldn't happen, but handle gracefully
|
|
696
|
-
return true;
|
|
697
596
|
}
|
|
597
|
+
return (
|
|
598
|
+
<UnifiedPreview
|
|
599
|
+
channel={INAPP}
|
|
600
|
+
content={{
|
|
601
|
+
inAppPreviewContent: {
|
|
602
|
+
mediaPreview,
|
|
603
|
+
templateTitle,
|
|
604
|
+
templateMsg,
|
|
605
|
+
...((isBtnTypeCtaAndroid || isBtnTypeCTaIos) && {
|
|
606
|
+
ctaData,
|
|
607
|
+
}),
|
|
608
|
+
},
|
|
609
|
+
templateLayoutType,
|
|
610
|
+
}}
|
|
611
|
+
device={panes}
|
|
612
|
+
showDeviceToggle={false}
|
|
613
|
+
showHeader={false}
|
|
614
|
+
formatMessage={formatMessage}
|
|
615
|
+
/>
|
|
616
|
+
);
|
|
617
|
+
};
|
|
698
618
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
// If no tags are available (e.g., in tests), allow submission even with minimal content
|
|
705
|
-
// This is to support test scenarios where full content validation might not be set up
|
|
706
|
-
const hasTags = tags && tags.length > 0;
|
|
707
|
-
const isTestScenario = !hasTags;
|
|
708
|
-
|
|
709
|
-
// If no device specified, check if at least one supported device has valid content
|
|
710
|
-
if (isNoDevice) {
|
|
711
|
-
// In test scenarios, only require message content (title is optional)
|
|
712
|
-
// In production, require both title and message
|
|
713
|
-
const hasAndroidContent = androidSupported && templateMessageAndroid && templateMessageAndroid?.trim() !== '' && !templateMessageErrorAndroid && (isTestScenario || (titleAndroid && titleAndroid?.trim() !== '' && !templateTitleErrorAndroid));
|
|
714
|
-
const hasIosContent = iosSupported && templateMessageIos && templateMessageIos?.trim() !== '' && !templateMessageErrorIos && (isTestScenario || (titleIos && titleIos?.trim() !== '' && !templateTitleErrorIos));
|
|
715
|
-
|
|
716
|
-
// Check media requirements
|
|
717
|
-
const androidMediaValid = !androidSupported || (templateMediaType === INAPP_MEDIA_TYPES.TEXT || inAppImageSrcAndroid !== '');
|
|
718
|
-
const iosMediaValid = !iosSupported || (templateMediaType === INAPP_MEDIA_TYPES.TEXT || inAppImageSrcIos !== '');
|
|
719
|
-
|
|
720
|
-
// Check CTA requirements
|
|
721
|
-
const androidCtaValid = !isBtnTypeCtaAndroid || (ctaDataAndroid[0]?.isSaved);
|
|
722
|
-
const iosCtaValid = !isBtnTypeCTaIos || (ctaDataIos[0]?.isSaved);
|
|
723
|
-
|
|
724
|
-
// Check action link requirements
|
|
725
|
-
const androidActionLinkValid = !addActionLinkAndroid || deepLinkValueAndroid;
|
|
726
|
-
const iosActionLinkValid = !addActionLinkIos || deepLinkValueIos;
|
|
727
|
-
|
|
728
|
-
// If both devices are supported, at least one should have valid content
|
|
729
|
-
if (androidSupported && iosSupported) {
|
|
730
|
-
const androidValid = hasAndroidContent && androidMediaValid && androidCtaValid && androidActionLinkValid;
|
|
731
|
-
const iosValid = hasIosContent && iosMediaValid && iosCtaValid && iosActionLinkValid;
|
|
732
|
-
return !(androidValid || iosValid);
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
// If only Android is supported, it must have valid content
|
|
736
|
-
if (androidSupported) {
|
|
737
|
-
return !(hasAndroidContent && androidMediaValid && androidCtaValid && androidActionLinkValid);
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
// If only iOS is supported, it must have valid content
|
|
741
|
-
if (iosSupported) {
|
|
742
|
-
return !(hasIosContent && iosMediaValid && iosCtaValid && iosActionLinkValid);
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
// Neither device supported - disable
|
|
619
|
+
const isDisableDone = (device) => {
|
|
620
|
+
const isIosDevice = device === IOS;
|
|
621
|
+
const isAndroidDevice = device === ANDROID;
|
|
622
|
+
//if template name is not entered
|
|
623
|
+
if (isFullMode && templateName.trim() === '') {
|
|
746
624
|
return true;
|
|
747
625
|
}
|
|
748
|
-
|
|
749
626
|
//if template message is not entered
|
|
750
627
|
//for android
|
|
751
|
-
if (isAndroidDevice) {
|
|
752
|
-
|
|
753
|
-
if (androidMessage?.trim() === '' || templateMessageErrorAndroid) {
|
|
754
|
-
return true;
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
//for ios
|
|
758
|
-
if (isIosDevice) {
|
|
759
|
-
const iosMessage = templateMessageIos;
|
|
760
|
-
if (iosMessage?.trim() === '' || templateMessageErrorIos) {
|
|
761
|
-
return true;
|
|
762
|
-
}
|
|
628
|
+
if (isAndroidDevice && (templateMessageAndroid.trim() === '' || templateMessageErrorAndroid)) {
|
|
629
|
+
return true;
|
|
763
630
|
}
|
|
631
|
+
if (isIosDevice && (templateMessageIos.trim() === '' || templateMessageErrorIos)) {
|
|
632
|
+
return true;
|
|
633
|
+
}//for ios
|
|
764
634
|
|
|
765
635
|
//if template title is not entered
|
|
766
636
|
//for android
|
|
767
|
-
if (isAndroidDevice && (titleAndroid
|
|
637
|
+
if (isAndroidDevice && (titleAndroid.trim() === '' || templateTitleErrorAndroid)) {
|
|
768
638
|
return true;
|
|
769
639
|
}
|
|
770
|
-
if (isIosDevice && (titleIos
|
|
640
|
+
if (isIosDevice && (titleIos.trim() === '' || templateTitleErrorIos)) {
|
|
771
641
|
return true;
|
|
772
642
|
}//for ios
|
|
773
643
|
//if media type is image and the mediaType file is not uploaded
|
|
@@ -826,11 +696,11 @@ export const InApp = (props) => {
|
|
|
826
696
|
switch (templateMediaType) {
|
|
827
697
|
case INAPP_MEDIA_TYPES.IMAGE:
|
|
828
698
|
androidMediaParams = {
|
|
829
|
-
image: getCdnUrl({
|
|
699
|
+
image: getCdnUrl({url: inAppImageSrcAndroid, channelName: INAPP }),
|
|
830
700
|
style: BIG_PICTURE,
|
|
831
701
|
};
|
|
832
702
|
iosMediaParams = {
|
|
833
|
-
image: getCdnUrl({
|
|
703
|
+
image: getCdnUrl({url: inAppImageSrcIos, channelName: INAPP }),
|
|
834
704
|
style: BIG_PICTURE,
|
|
835
705
|
};
|
|
836
706
|
break;
|
|
@@ -842,46 +712,16 @@ export const InApp = (props) => {
|
|
|
842
712
|
sourceAccountIdentifier = "",
|
|
843
713
|
id,
|
|
844
714
|
} = accountObj;
|
|
845
|
-
|
|
846
|
-
//
|
|
847
|
-
const
|
|
848
|
-
? htmlContentAndroid
|
|
849
|
-
: templateMessageAndroid;
|
|
850
|
-
|
|
851
|
-
// Determine type and style for Android
|
|
852
|
-
const androidType = isHTMLTemplate ? INAPP_MEDIA_TYPES.HTML : templateMediaType;
|
|
853
|
-
const androidExpandableStyle = isHTMLTemplate ? BIG_HTML : BIG_TEXT;
|
|
854
|
-
|
|
855
|
-
// LIBRARY MODE FIX: Backend doesn't support 'MODAL' bodyType, convert to 'POPUP'
|
|
856
|
-
const bodyTypeForBackend = templateLayoutType === INAPP_MESSAGE_LAYOUT_TYPES.MODAL ? INAPP_MESSAGE_LAYOUT_TYPES.POPUP : templateLayoutType;
|
|
857
|
-
|
|
858
|
-
// Check account-level device support
|
|
859
|
-
const androidSupported = get(accountData, 'selectedWeChatAccount.configs.android') === DEVICE_SUPPORTED || get(editContent, 'ANDROID.deviceType') === ANDROID;
|
|
860
|
-
const iosSupported = get(accountData, 'selectedWeChatAccount.configs.ios') === DEVICE_SUPPORTED || get(editContent, 'IOS.deviceType') === IOS_CAPITAL;
|
|
861
|
-
|
|
862
|
-
// Check if devices have content (for HTML Editor)
|
|
863
|
-
const hasAndroidContent = htmlContentAndroid && htmlContentAndroid?.trim() !== '';
|
|
864
|
-
const hasIosContent = htmlContentIos && htmlContentIos?.trim() !== '';
|
|
865
|
-
|
|
866
|
-
// For HTML Editor, check if device has content and is supported
|
|
867
|
-
// For legacy editor, use isDisableDone check
|
|
868
|
-
// Only include devices that have content - allows Android-only, iOS-only, or both
|
|
869
|
-
const shouldIncludeAndroid = isHTMLTemplate
|
|
870
|
-
? (androidSupported && hasAndroidContent)
|
|
871
|
-
: !isDisableDone(ANDROID);
|
|
872
|
-
|
|
873
|
-
// Construct Android content if device is supported and has content
|
|
874
|
-
// Even when both devices are supported, only include devices that have content
|
|
875
|
-
const androidContent = shouldIncludeAndroid ? {
|
|
715
|
+
|
|
716
|
+
// Construct Android content if not disabled
|
|
717
|
+
const androidContent = !isDisableDone(ANDROID) ? {
|
|
876
718
|
...commonDevicePayload,
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
title: isHTMLTemplate ? 'html editor template' : titleAndroid,
|
|
880
|
-
message: androidMessage,
|
|
719
|
+
title: titleAndroid,
|
|
720
|
+
message: templateMessageAndroid,
|
|
881
721
|
bodyType: templateLayoutType,
|
|
882
722
|
expandableDetails: {
|
|
883
|
-
style:
|
|
884
|
-
message:
|
|
723
|
+
style: BIG_TEXT,
|
|
724
|
+
message: templateMessageAndroid,
|
|
885
725
|
...androidMediaParams,
|
|
886
726
|
...(isBtnTypeCtaAndroid && {
|
|
887
727
|
ctas: getCtaPayload(ANDROID),
|
|
@@ -889,38 +729,19 @@ export const InApp = (props) => {
|
|
|
889
729
|
},
|
|
890
730
|
custom: [],
|
|
891
731
|
...(deepLinkValueAndroid && {
|
|
892
|
-
ctas: [{
|
|
732
|
+
ctas: [{type: DEEP_LINK, actionLink: deepLinkValueAndroid}],
|
|
893
733
|
}),
|
|
894
734
|
} : {};
|
|
895
|
-
|
|
896
|
-
//
|
|
897
|
-
const
|
|
898
|
-
? htmlContentIos
|
|
899
|
-
: templateMessageIos;
|
|
900
|
-
|
|
901
|
-
// Determine type and style for iOS
|
|
902
|
-
const iosType = isHTMLTemplate ? INAPP_MEDIA_TYPES.HTML : templateMediaType;
|
|
903
|
-
const iosExpandableStyle = isHTMLTemplate ? BIG_HTML : BIG_TEXT;
|
|
904
|
-
|
|
905
|
-
// For HTML Editor, check if device has content and is supported
|
|
906
|
-
// For legacy editor, use isDisableDone check
|
|
907
|
-
// Only include devices that have content - allows Android-only, iOS-only, or both
|
|
908
|
-
const shouldIncludeIos = isHTMLTemplate
|
|
909
|
-
? (iosSupported && hasIosContent)
|
|
910
|
-
: !isDisableDone(IOS);
|
|
911
|
-
|
|
912
|
-
// Construct iOS content if device is supported and has content
|
|
913
|
-
// Even when both devices are supported, only include devices that have content
|
|
914
|
-
const iosContent = shouldIncludeIos ? {
|
|
735
|
+
|
|
736
|
+
// Construct iOS content if not disabled
|
|
737
|
+
const iosContent = !isDisableDone(IOS) ? {
|
|
915
738
|
...commonDevicePayload,
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
message: iosMessage,
|
|
920
|
-
bodyType: bodyTypeForBackend,
|
|
739
|
+
title: titleIos,
|
|
740
|
+
message: templateMessageIos,
|
|
741
|
+
bodyType: templateLayoutType,
|
|
921
742
|
expandableDetails: {
|
|
922
|
-
style:
|
|
923
|
-
message:
|
|
743
|
+
style: BIG_TEXT,
|
|
744
|
+
message: templateMessageIos,
|
|
924
745
|
...iosMediaParams,
|
|
925
746
|
...(isBtnTypeCTaIos && {
|
|
926
747
|
ctas: getCtaPayload(IOS),
|
|
@@ -928,16 +749,12 @@ export const InApp = (props) => {
|
|
|
928
749
|
},
|
|
929
750
|
custom: [],
|
|
930
751
|
...(deepLinkValueIos && {
|
|
931
|
-
ctas: [{
|
|
752
|
+
ctas: [{type: DEEP_LINK, actionLink: deepLinkValueIos}],
|
|
932
753
|
}),
|
|
933
754
|
} : {};
|
|
934
|
-
|
|
935
|
-
// Ensure name is always set - use tempName as fallback if templateName is empty
|
|
936
|
-
const templateNameValue = isEditFlow ? tempName : (templateName || tempName || '');
|
|
937
|
-
const trimmedName = (templateNameValue && typeof templateNameValue === 'string') ? templateNameValue?.trim() : '';
|
|
938
|
-
|
|
755
|
+
|
|
939
756
|
const data = {
|
|
940
|
-
name:
|
|
757
|
+
name: templateName,
|
|
941
758
|
versions: {
|
|
942
759
|
base: {
|
|
943
760
|
content: {
|
|
@@ -956,26 +773,28 @@ export const InApp = (props) => {
|
|
|
956
773
|
return data;
|
|
957
774
|
};
|
|
958
775
|
|
|
959
|
-
const actionCallback = ({
|
|
960
|
-
if (!
|
|
776
|
+
const actionCallback = ({ errorMessage }) => {
|
|
777
|
+
if (!errorMessage) {
|
|
961
778
|
CapNotification.success({
|
|
962
|
-
message: isEditFlow
|
|
963
|
-
|
|
964
|
-
|
|
779
|
+
message: isEditFlow ? formatMessage(messages.inAppEditNotification, {
|
|
780
|
+
name: templateName,
|
|
781
|
+
}) : formatMessage(messages.inAppCreateNotification, {
|
|
782
|
+
name: templateName,
|
|
783
|
+
}),
|
|
965
784
|
});
|
|
966
785
|
actions.clearCreateResponse();
|
|
967
786
|
} else {
|
|
968
787
|
CapNotification.error({
|
|
969
|
-
message: JSON.stringify(
|
|
788
|
+
message: JSON.stringify(errorMessage),
|
|
970
789
|
});
|
|
971
790
|
}
|
|
972
791
|
};
|
|
973
792
|
|
|
974
793
|
const onCreateInApp = () => {
|
|
975
794
|
setSpin(true);
|
|
976
|
-
actions.createInAppTemplate(createPayload(), (resp,
|
|
977
|
-
actionCallback({ resp,
|
|
978
|
-
if (!
|
|
795
|
+
actions.createInAppTemplate(createPayload(), (resp, errorMessage) => {
|
|
796
|
+
actionCallback({ resp, errorMessage });
|
|
797
|
+
if (!errorMessage) {
|
|
979
798
|
onCreateComplete();
|
|
980
799
|
} else {
|
|
981
800
|
setSpin(false);
|
|
@@ -990,9 +809,9 @@ export const InApp = (props) => {
|
|
|
990
809
|
...createPayload(),
|
|
991
810
|
_id: params.id,
|
|
992
811
|
},
|
|
993
|
-
(resp,
|
|
994
|
-
actionCallback({ resp,
|
|
995
|
-
if (!
|
|
812
|
+
(resp, errorMessage) => {
|
|
813
|
+
actionCallback({ resp, errorMessage });
|
|
814
|
+
if (!errorMessage) {
|
|
996
815
|
onCreateComplete();
|
|
997
816
|
} else {
|
|
998
817
|
setSpin(false);
|
|
@@ -1001,67 +820,6 @@ export const InApp = (props) => {
|
|
|
1001
820
|
);
|
|
1002
821
|
};
|
|
1003
822
|
|
|
1004
|
-
// Handle HTML content changes from HTMLEditor
|
|
1005
|
-
const handleHtmlContentChange = useCallback((deviceContent, changedDevice) => {
|
|
1006
|
-
// The onChange callback from useInAppContent passes the full deviceContent object
|
|
1007
|
-
// But we only want to update the state for the device that actually changed
|
|
1008
|
-
// Use the second parameter (changedDevice) if provided, otherwise update both
|
|
1009
|
-
|
|
1010
|
-
// Clear validation errors when content changes (similar to Bee Editor)
|
|
1011
|
-
// This ensures Done button re-enables after user fixes errors
|
|
1012
|
-
if (changedDevice) {
|
|
1013
|
-
setErrorMessage((prev) => ({
|
|
1014
|
-
STANDARD_ERROR_MSG: {
|
|
1015
|
-
...prev.STANDARD_ERROR_MSG,
|
|
1016
|
-
[changedDevice.toUpperCase()]: [],
|
|
1017
|
-
GENERIC: [],
|
|
1018
|
-
},
|
|
1019
|
-
LIQUID_ERROR_MSG: {
|
|
1020
|
-
...prev.LIQUID_ERROR_MSG,
|
|
1021
|
-
[changedDevice.toUpperCase()]: [],
|
|
1022
|
-
GENERIC: [],
|
|
1023
|
-
},
|
|
1024
|
-
}));
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
|
-
if (changedDevice) {
|
|
1028
|
-
// Only update the device that actually changed
|
|
1029
|
-
if (changedDevice.toUpperCase() === ANDROID && deviceContent?.android !== undefined) {
|
|
1030
|
-
setHtmlContentAndroid(deviceContent.android || '');
|
|
1031
|
-
} else if (changedDevice.toUpperCase() === IOS_CAPITAL && deviceContent?.ios !== undefined) {
|
|
1032
|
-
setHtmlContentIos(deviceContent.ios || '');
|
|
1033
|
-
}
|
|
1034
|
-
} else {
|
|
1035
|
-
// Fallback: update both if changedDevice not provided (for backward compatibility)
|
|
1036
|
-
// Only update if value actually changed to avoid unnecessary re-renders
|
|
1037
|
-
if (deviceContent?.android !== undefined) {
|
|
1038
|
-
setHtmlContentAndroid((prev) => {
|
|
1039
|
-
const newValue = deviceContent.android || '';
|
|
1040
|
-
return prev !== newValue ? newValue : prev;
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1043
|
-
if (deviceContent?.ios !== undefined) {
|
|
1044
|
-
setHtmlContentIos((prev) => {
|
|
1045
|
-
const newValue = deviceContent.ios || '';
|
|
1046
|
-
return prev !== newValue ? newValue : prev;
|
|
1047
|
-
});
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
}, [ANDROID, IOS, setErrorMessage]);
|
|
1051
|
-
|
|
1052
|
-
// Handle HTML save from HTMLEditor
|
|
1053
|
-
const handleHtmlSave = useCallback((deviceContent) => {
|
|
1054
|
-
// Update state for both devices if present in the callback
|
|
1055
|
-
if (deviceContent?.android !== undefined) {
|
|
1056
|
-
setHtmlContentAndroid(deviceContent.android || '');
|
|
1057
|
-
}
|
|
1058
|
-
if (deviceContent?.ios !== undefined) {
|
|
1059
|
-
setHtmlContentIos(deviceContent.ios || '');
|
|
1060
|
-
}
|
|
1061
|
-
// Auto-save can trigger this, but we don't want to submit automatically
|
|
1062
|
-
// The user will click the Create/Update button to submit
|
|
1063
|
-
}, []);
|
|
1064
|
-
|
|
1065
823
|
const onDoneCallback = () => {
|
|
1066
824
|
if (isFullMode) {
|
|
1067
825
|
if (isEditFlow) {
|
|
@@ -1069,17 +827,15 @@ export const InApp = (props) => {
|
|
|
1069
827
|
}
|
|
1070
828
|
return onCreateInApp();
|
|
1071
829
|
}
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
value: payload,
|
|
830
|
+
return getFormData({
|
|
831
|
+
value: createPayload(),
|
|
1075
832
|
_id: params && params.id,
|
|
1076
833
|
validity: true,
|
|
1077
834
|
type: INAPP,
|
|
1078
835
|
});
|
|
1079
836
|
};
|
|
1080
837
|
|
|
1081
|
-
|
|
1082
|
-
const validationMiddleWare = async () => {
|
|
838
|
+
const liquidMiddleWare = () => {
|
|
1083
839
|
// Set up callbacks for validation results
|
|
1084
840
|
const onError = ({ standardErrors, liquidErrors }) => {
|
|
1085
841
|
setErrorMessage((prev) => ({
|
|
@@ -1092,200 +848,45 @@ export const InApp = (props) => {
|
|
|
1092
848
|
onDoneCallback();
|
|
1093
849
|
};
|
|
1094
850
|
|
|
1095
|
-
//
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
return skipRegexes.some((regex) => regex.test(tag));
|
|
1124
|
-
},
|
|
1125
|
-
singleTab: getSingleTab(accountData),
|
|
1126
|
-
});
|
|
1127
|
-
} else if (hasTags) {
|
|
1128
|
-
// For non-liquid flow, validate tags using validateTags (only if tags are available)
|
|
1129
|
-
const androidContent = htmlContentAndroid || '';
|
|
1130
|
-
const iosContent = htmlContentIos || '';
|
|
1131
|
-
|
|
1132
|
-
const androidSupported = get(accountData, 'selectedWeChatAccount.configs.android') === DEVICE_SUPPORTED || get(editContent, 'ANDROID.deviceType') === ANDROID;
|
|
1133
|
-
const iosSupported = get(accountData, 'selectedWeChatAccount.configs.ios') === DEVICE_SUPPORTED || get(editContent, 'IOS.deviceType') === IOS_CAPITAL;
|
|
1134
|
-
|
|
1135
|
-
let hasErrors = false;
|
|
1136
|
-
const newErrors = {
|
|
1137
|
-
STANDARD_ERROR_MSG: {
|
|
1138
|
-
ANDROID: [],
|
|
1139
|
-
IOS: [],
|
|
1140
|
-
GENERIC: [],
|
|
1141
|
-
},
|
|
1142
|
-
LIQUID_ERROR_MSG: {
|
|
1143
|
-
ANDROID: [],
|
|
1144
|
-
IOS: [],
|
|
1145
|
-
GENERIC: [],
|
|
1146
|
-
},
|
|
1147
|
-
};
|
|
1148
|
-
|
|
1149
|
-
// Validate Android content
|
|
1150
|
-
if (androidSupported && androidContent && androidContent?.trim() !== '') {
|
|
1151
|
-
const validationResponse = validateTags({
|
|
1152
|
-
content: androidContent,
|
|
1153
|
-
tagsParam: tags,
|
|
1154
|
-
injectedTagsParams: injectedTags || {},
|
|
1155
|
-
location,
|
|
1156
|
-
tagModule: getDefaultTags,
|
|
1157
|
-
eventContextTags: metaEntities?.eventContextTags || [],
|
|
1158
|
-
}) || {};
|
|
1159
|
-
|
|
1160
|
-
if (validationResponse?.unsupportedTags?.length > 0) {
|
|
1161
|
-
hasErrors = true;
|
|
1162
|
-
newErrors.LIQUID_ERROR_MSG.ANDROID.push(
|
|
1163
|
-
formatMessage(globalMessages.unsupportedTagsValidationError, {
|
|
1164
|
-
unsupportedTags: validationResponse.unsupportedTags.join(", "),
|
|
1165
|
-
})
|
|
1166
|
-
);
|
|
1167
|
-
}
|
|
1168
|
-
if (validationResponse?.isBraceError) {
|
|
1169
|
-
hasErrors = true;
|
|
1170
|
-
newErrors.LIQUID_ERROR_MSG.ANDROID.push(
|
|
1171
|
-
formatMessage(globalMessages.unbalanacedCurlyBraces)
|
|
1172
|
-
);
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
// Validate iOS content
|
|
1177
|
-
if (iosSupported && iosContent && iosContent?.trim() !== '') {
|
|
1178
|
-
const validationResponse = validateTags({
|
|
1179
|
-
content: iosContent,
|
|
1180
|
-
tagsParam: tags,
|
|
1181
|
-
injectedTagsParams: injectedTags || {},
|
|
1182
|
-
location,
|
|
1183
|
-
tagModule: getDefaultTags,
|
|
1184
|
-
eventContextTags: metaEntities?.eventContextTags || [],
|
|
1185
|
-
}) || {};
|
|
1186
|
-
|
|
1187
|
-
if (validationResponse?.unsupportedTags?.length > 0) {
|
|
1188
|
-
hasErrors = true;
|
|
1189
|
-
newErrors.LIQUID_ERROR_MSG.IOS.push(
|
|
1190
|
-
formatMessage(globalMessages.unsupportedTagsValidationError, {
|
|
1191
|
-
unsupportedTags: validationResponse.unsupportedTags.join(", "),
|
|
1192
|
-
})
|
|
1193
|
-
);
|
|
1194
|
-
}
|
|
1195
|
-
if (validationResponse?.isBraceError) {
|
|
1196
|
-
hasErrors = true;
|
|
1197
|
-
newErrors.LIQUID_ERROR_MSG.IOS.push(
|
|
1198
|
-
formatMessage(globalMessages.unbalanacedCurlyBraces)
|
|
1199
|
-
);
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
if (hasErrors) {
|
|
1204
|
-
setErrorMessage(newErrors);
|
|
1205
|
-
} else {
|
|
1206
|
-
// No errors, proceed with submission
|
|
1207
|
-
onSuccess();
|
|
1208
|
-
}
|
|
1209
|
-
} else {
|
|
1210
|
-
// No tags available, skip validation and proceed directly
|
|
1211
|
-
onSuccess();
|
|
1212
|
-
}
|
|
851
|
+
// Validate the INAPP content
|
|
852
|
+
const payload = createPayload();
|
|
853
|
+
validateInAppContent(payload, {
|
|
854
|
+
currentTab: panes === ANDROID ? 1 : 2, // Convert ANDROID/IOS to tab numbers
|
|
855
|
+
onError,
|
|
856
|
+
onSuccess,
|
|
857
|
+
getLiquidTags: (content, callback) => globalActions.getLiquidTags(content, callback),
|
|
858
|
+
formatMessage,
|
|
859
|
+
messages: formBuilderMessages,
|
|
860
|
+
tagLookupMap: metaEntities?.tagLookupMap || {},
|
|
861
|
+
eventContextTags: metaEntities?.eventContextTags || [],
|
|
862
|
+
isLiquidFlow,
|
|
863
|
+
forwardedTags: {},
|
|
864
|
+
skipTags: (tag) => {
|
|
865
|
+
// Skip certain tags if needed
|
|
866
|
+
const skipRegexes = [
|
|
867
|
+
/dynamic_expiry_date_after_\d+_days\.FORMAT_\d/,
|
|
868
|
+
/unsubscribe\(#[a-zA-Z\d]{6}\)/,
|
|
869
|
+
/Link_to_[a-zA-z]/,
|
|
870
|
+
/SURVEY.*\.TOKEN/,
|
|
871
|
+
/^[A-Za-z].*\([a-zA-Z\d]*\)/,
|
|
872
|
+
];
|
|
873
|
+
|
|
874
|
+
return skipRegexes.some((regex) => regex.test(tag));
|
|
875
|
+
},
|
|
876
|
+
singleTab: getSingleTab(accountData),
|
|
877
|
+
});
|
|
1213
878
|
};
|
|
1214
879
|
|
|
1215
880
|
const isLiquidFlow = hasLiquidSupportFeature();
|
|
1216
|
-
|
|
1217
|
-
// Check template data to determine editor type (for render decision)
|
|
1218
|
-
const templateDetails = isFullMode ? editData?.templateDetails : templateData;
|
|
1219
|
-
const versions = templateDetails?.versions || {};
|
|
1220
|
-
const templateContent = get(versions, 'base.content', {});
|
|
1221
|
-
const androidContent = templateContent?.ANDROID || {};
|
|
1222
|
-
const iosContent = templateContent?.IOS || {};
|
|
1223
|
-
|
|
1224
|
-
// Check if this is a Bee editor template
|
|
1225
|
-
const isBEEeditor = get(androidContent, 'isBEEeditor') || get(iosContent, 'isBEEeditor');
|
|
1226
|
-
const androidTitle = androidContent?.title || '';
|
|
1227
|
-
const iosTitle = iosContent?.title || '';
|
|
1228
|
-
const isBeeFreeTemplate = (!isEmpty(androidTitle) && androidTitle.toLowerCase() === 'bee free template')
|
|
1229
|
-
|| (!isEmpty(iosTitle) && iosTitle.toLowerCase() === 'bee free template');
|
|
1230
|
-
|
|
1231
|
-
// Check if this is an HTML template from content data
|
|
1232
|
-
const androidType = androidContent?.type || '';
|
|
1233
|
-
const androidStyle = androidContent?.expandableDetails?.style || '';
|
|
1234
|
-
const iosType = iosContent?.type || '';
|
|
1235
|
-
const iosStyle = iosContent?.expandableDetails?.style || '';
|
|
1236
|
-
const isHTMLTemplateFromData = (androidType === INAPP_MEDIA_TYPES.HTML || androidStyle === BIG_HTML
|
|
1237
|
-
|| iosType === INAPP_MEDIA_TYPES.HTML || iosStyle === BIG_HTML)
|
|
1238
|
-
&& !isBEEeditor
|
|
1239
|
-
&& !isBeeFreeTemplate;
|
|
1240
|
-
|
|
1241
|
-
// Use state if available, otherwise fall back to direct data check
|
|
1242
|
-
const shouldUseHTMLEditor = isHTMLTemplate || isHTMLTemplateFromData;
|
|
1243
|
-
|
|
1244
|
-
// Only route to Bee editor if it's explicitly a Bee editor AND not an HTML template
|
|
1245
|
-
const shouldUseBeeEditor = (isBEEeditor || isBeeFreeTemplate) && !shouldUseHTMLEditor;
|
|
1246
|
-
|
|
1247
|
-
// Early returns to avoid nested ternary
|
|
1248
|
-
if (isEditInApp && getTemplateDetailsInProgress) {
|
|
1249
|
-
return <CapSpin spinning={getTemplateDetailsInProgress} />;
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
|
-
// Allow BEE editor in both full mode edit (isEditInApp) AND library mode edit (isEditFlow && !isFullMode)
|
|
1253
|
-
if ((isEditInApp || (isEditFlow && !isFullMode)) && shouldUseBeeEditor) {
|
|
1254
|
-
return (
|
|
1255
|
-
<InappAdvanced
|
|
1256
|
-
getFormData={getFormData}
|
|
1257
|
-
setIsLoadingContent={setIsLoadingContent}
|
|
1258
|
-
defaultData={{ "template-name": tempName }}
|
|
1259
|
-
location={{
|
|
1260
|
-
pathname: `/inapp/edit`,
|
|
1261
|
-
query,
|
|
1262
|
-
search: '',
|
|
1263
|
-
}}
|
|
1264
|
-
params={{ mode: inAppCreateMode, id: params.id }}
|
|
1265
|
-
isFullMode={isFullMode}
|
|
1266
|
-
isGetFormData={isGetFormData}
|
|
1267
|
-
showTemplateName={showTemplateName}
|
|
1268
|
-
route={{ name: "inapp" }}
|
|
1269
|
-
getDefaultTags={type}
|
|
1270
|
-
onValidationFail={onValidationFail}
|
|
1271
|
-
templateData={templateData}
|
|
1272
|
-
templateName={tempName}
|
|
1273
|
-
setTemplateName={setTempName}
|
|
1274
|
-
forwardedTags={forwardedTags}
|
|
1275
|
-
selectedOfferDetails={selectedOfferDetails}
|
|
1276
|
-
onCreateComplete={onCreateComplete}
|
|
1277
|
-
/>
|
|
1278
|
-
);
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
881
|
return (
|
|
1282
882
|
<CapSpin spinning={spin || fetchingLiquidValidation} tip={fetchingLiquidValidation ? <FormattedMessage {...formBuilderMessages.liquidSpinText} /> : ""}>
|
|
1283
883
|
<CapRow className="cap-inapp-creatives">
|
|
1284
|
-
<CapColumn span={
|
|
1285
|
-
{
|
|
1286
|
-
{
|
|
884
|
+
<CapColumn span={14}>
|
|
885
|
+
{isFullMode && createModeContent}
|
|
886
|
+
{/* Creative layout type*/}
|
|
887
|
+
{(isFullMode || !isEditFlow) && (
|
|
1287
888
|
<>
|
|
1288
|
-
<CapRow>
|
|
889
|
+
<CapRow className="inapp-creative-layout">
|
|
1289
890
|
<CapHeading type="h4">
|
|
1290
891
|
<FormattedMessage {...messages.creativeLayout} />
|
|
1291
892
|
</CapHeading>
|
|
@@ -1302,64 +903,26 @@ export const InApp = (props) => {
|
|
|
1302
903
|
/>
|
|
1303
904
|
</>
|
|
1304
905
|
)}
|
|
1305
|
-
{
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
// Tag insertion is handled by HTMLEditor's CodeEditorPane at cursor position
|
|
1322
|
-
// Content updates will be propagated via onContentChange callback
|
|
1323
|
-
}}
|
|
1324
|
-
// Don't pass globalActions to prevent duplicate API calls
|
|
1325
|
-
// HTMLEditor will use onContextChange instead
|
|
1326
|
-
onContextChange={handleOnTagsContextChange}
|
|
1327
|
-
// Pass validation errors to HTMLEditor for display
|
|
1328
|
-
errors={errorMessage}
|
|
1329
|
-
isFullMode={isFullMode}
|
|
1330
|
-
data-test="inapp-html-editor"
|
|
1331
|
-
style={{ width: '138%' }}
|
|
1332
|
-
/>
|
|
1333
|
-
) : (
|
|
1334
|
-
<InappAdvanced
|
|
1335
|
-
getFormData={getFormData}
|
|
1336
|
-
setIsLoadingContent={setIsLoadingContent}
|
|
1337
|
-
defaultData={{ "template-name": tempName }}
|
|
1338
|
-
location={{
|
|
1339
|
-
pathname: `/inapp/create`,
|
|
1340
|
-
query,
|
|
1341
|
-
search: '',
|
|
1342
|
-
}}
|
|
1343
|
-
params={{ mode: inAppCreateMode }}
|
|
1344
|
-
isFullMode={isFullMode}
|
|
1345
|
-
isGetFormData={isGetFormData}
|
|
1346
|
-
showTemplateName={showTemplateName}
|
|
1347
|
-
route={{ name: "inapp" }}
|
|
1348
|
-
getDefaultTags={type}
|
|
1349
|
-
onValidationFail={onValidationFail}
|
|
1350
|
-
templateData={templateData}
|
|
1351
|
-
templateName={tempName}
|
|
1352
|
-
setTemplateName={setTempName}
|
|
1353
|
-
forwardedTags={forwardedTags}
|
|
1354
|
-
selectedOfferDetails={selectedOfferDetails}
|
|
1355
|
-
onCreateComplete={onCreateComplete}
|
|
1356
|
-
/>
|
|
1357
|
-
)}
|
|
906
|
+
{/* device tab */}
|
|
907
|
+
<CapTab
|
|
908
|
+
panes={PANES.filter(
|
|
909
|
+
(devicePane) => devicePane?.isSupported === true
|
|
910
|
+
)}
|
|
911
|
+
onChange={(value) => {
|
|
912
|
+
setPanes(value);
|
|
913
|
+
}}
|
|
914
|
+
activeKey={panes}
|
|
915
|
+
defaultActiveKey={panes}
|
|
916
|
+
className="inapp-template-device-tab"
|
|
917
|
+
/>
|
|
918
|
+
<div className="inapp-scroll-div" />
|
|
919
|
+
</CapColumn>
|
|
920
|
+
<CapColumn span={10} className="inapp-preview-container">
|
|
921
|
+
{getPreviewSection()}
|
|
1358
922
|
</CapColumn>
|
|
1359
923
|
</CapRow>
|
|
1360
|
-
{
|
|
1361
|
-
|
|
1362
|
-
shouldUseHTMLEditor && (
|
|
924
|
+
<div className={`inapp-footer ${!isFullMode && `inapp-footer-lib`}`}>
|
|
925
|
+
{
|
|
1363
926
|
<>
|
|
1364
927
|
{hasAnyErrors(errorMessage) && (
|
|
1365
928
|
<ErrorInfoNote
|
|
@@ -1367,28 +930,24 @@ export const InApp = (props) => {
|
|
|
1367
930
|
currentTab={panes}
|
|
1368
931
|
/>
|
|
1369
932
|
)}
|
|
1370
|
-
<
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
);
|
|
1389
|
-
})()}
|
|
1390
|
-
</CapButton>
|
|
1391
|
-
{/* {!isFullMode && ( */}
|
|
933
|
+
<CapButton
|
|
934
|
+
onClick={isLiquidFlow ? liquidMiddleWare : onDoneCallback}
|
|
935
|
+
disabled={isDisableDone(panes)}
|
|
936
|
+
className="inapp-create-btn"
|
|
937
|
+
>
|
|
938
|
+
{isEditFlow ? (
|
|
939
|
+
isFullMode ? (
|
|
940
|
+
<FormattedMessage {...messages.update} />
|
|
941
|
+
) : (
|
|
942
|
+
<FormattedMessage {...globalMessages.done} />
|
|
943
|
+
)
|
|
944
|
+
) : isFullMode ? (
|
|
945
|
+
<FormattedMessage {...messages.create} />
|
|
946
|
+
) : (
|
|
947
|
+
<FormattedMessage {...globalMessages.done} />
|
|
948
|
+
)}
|
|
949
|
+
</CapButton>
|
|
950
|
+
{/* {!isFullMode && ( */}
|
|
1392
951
|
<CapButton
|
|
1393
952
|
onClick={handleTestAndPreview}
|
|
1394
953
|
className="inapp-test-preview-btn"
|
|
@@ -1397,10 +956,10 @@ export const InApp = (props) => {
|
|
|
1397
956
|
>
|
|
1398
957
|
<FormattedMessage {...creativesMessages.testAndPreview} />
|
|
1399
958
|
</CapButton>
|
|
1400
|
-
|
|
1401
|
-
</div>
|
|
959
|
+
{/* )} */}
|
|
1402
960
|
</>
|
|
1403
|
-
|
|
961
|
+
}
|
|
962
|
+
</div>
|
|
1404
963
|
<TestAndPreviewSlidebox
|
|
1405
964
|
show={propsShowTestAndPreviewSlidebox || showTestAndPreviewSlidebox}
|
|
1406
965
|
onClose={handleCloseTestAndPreview}
|
|
@@ -1420,8 +979,7 @@ const mapStateToProps = createStructuredSelector({
|
|
|
1420
979
|
loadingTags: isLoadingMetaEntities(),
|
|
1421
980
|
injectedTags: setInjectedTags(),
|
|
1422
981
|
currentOrgDetails: selectCurrentOrgDetails(),
|
|
1423
|
-
fetchingLiquidValidation: selectLiquidStateDetails()
|
|
1424
|
-
getTemplateDetailsInProgress: makeSelectGetTemplateDetailsInProgress(),
|
|
982
|
+
fetchingLiquidValidation: selectLiquidStateDetails()
|
|
1425
983
|
});
|
|
1426
984
|
|
|
1427
985
|
const mapDispatchToProps = (dispatch) => ({
|