@capillarytech/creatives-library 8.0.125 → 8.0.127-alpha.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/config/app.js +6 -0
- package/containers/App/constants.js +1 -0
- package/index.html +3 -1
- package/initialReducer.js +2 -0
- package/package.json +1 -1
- package/services/api.js +94 -1
- package/services/tests/api.test.js +191 -0
- package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +8 -3
- package/tests/integration/TemplateCreation/api-response.js +5 -0
- package/tests/integration/TemplateCreation/msw-handler.js +42 -63
- package/utils/common.js +7 -0
- package/utils/commonUtils.js +2 -6
- package/utils/createPayload.js +272 -0
- package/utils/tests/createPayload.test.js +761 -0
- package/v2Components/CapImageUpload/index.js +59 -46
- package/v2Components/CapInAppCTA/index.js +1 -0
- package/v2Components/CapMpushCTA/constants.js +25 -0
- package/v2Components/CapMpushCTA/index.js +332 -0
- package/v2Components/CapMpushCTA/index.scss +95 -0
- package/v2Components/CapMpushCTA/messages.js +89 -0
- package/v2Components/CapTagList/index.js +177 -120
- package/v2Components/CapVideoUpload/constants.js +3 -0
- package/v2Components/CapVideoUpload/index.js +167 -110
- package/v2Components/CapVideoUpload/messages.js +16 -0
- package/v2Components/Carousel/index.js +15 -13
- package/v2Components/CustomerSearchSection/_customerSearch.scss +309 -0
- package/v2Components/CustomerSearchSection/constants.js +5 -0
- package/v2Components/CustomerSearchSection/index.js +367 -0
- package/v2Components/CustomerSearchSection/messages.js +20 -0
- package/v2Components/CustomerSearchSection/tests/utils.test.js +334 -0
- package/v2Components/CustomerSearchSection/utils.js +49 -0
- package/v2Components/ErrorInfoNote/style.scss +1 -0
- package/v2Components/MobilePushPreviewV2/index.js +37 -5
- package/v2Components/TemplatePreview/_templatePreview.scss +114 -72
- package/v2Components/TemplatePreview/assets/images/Android _ With date and time.svg +29 -0
- package/v2Components/TemplatePreview/assets/images/android.svg +9 -0
- package/v2Components/TemplatePreview/assets/images/iOS _ With date and time.svg +26 -0
- package/v2Components/TemplatePreview/assets/images/ios.svg +9 -0
- package/v2Components/TemplatePreview/index.js +178 -50
- package/v2Components/TemplatePreview/messages.js +4 -0
- package/v2Components/TestAndPreviewSlidebox/CustomValuesEditor.js +169 -0
- package/v2Components/TestAndPreviewSlidebox/LeftPanelContent.js +95 -0
- package/v2Components/TestAndPreviewSlidebox/PreviewSection.js +69 -0
- package/v2Components/TestAndPreviewSlidebox/SendTestMessage.js +68 -0
- package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +543 -0
- package/v2Components/TestAndPreviewSlidebox/actions.js +67 -0
- package/v2Components/TestAndPreviewSlidebox/constants.js +67 -0
- package/v2Components/TestAndPreviewSlidebox/index.js +592 -0
- package/v2Components/TestAndPreviewSlidebox/messages.js +147 -0
- package/v2Components/TestAndPreviewSlidebox/reducer.js +233 -0
- package/v2Components/TestAndPreviewSlidebox/sagas.js +258 -0
- package/v2Components/TestAndPreviewSlidebox/selectors.js +142 -0
- package/v2Components/TestAndPreviewSlidebox/tests/CustomValuesEditor.test.js +425 -0
- package/v2Components/TestAndPreviewSlidebox/tests/LeftPanelContent.test.js +400 -0
- package/v2Components/TestAndPreviewSlidebox/tests/SendTestMessage.test.js +448 -0
- package/v2Components/TestAndPreviewSlidebox/tests/actions.test.js +80 -0
- package/v2Components/TestAndPreviewSlidebox/tests/reducer.test.js +367 -0
- package/v2Components/TestAndPreviewSlidebox/tests/saga.rtl.test.js +192 -0
- package/v2Components/TestAndPreviewSlidebox/tests/saga.test.js +652 -0
- package/v2Components/TestAndPreviewSlidebox/tests/selector.test.js +182 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +22 -10
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +23 -2
- package/v2Containers/CreativesContainer/index.js +216 -136
- package/v2Containers/CreativesContainer/messages.js +4 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +21 -0
- package/v2Containers/Email/index.js +27 -2
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +10 -0
- package/v2Containers/EmailWrapper/index.js +6 -0
- package/v2Containers/InApp/constants.js +1 -0
- package/v2Containers/InApp/index.js +13 -13
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +3 -0
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +2 -0
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +2 -0
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +9 -0
- package/v2Containers/MobilePush/Create/index.js +1 -0
- package/v2Containers/MobilePush/commonMethods.js +7 -14
- package/v2Containers/MobilePushNew/actions.js +116 -0
- package/v2Containers/MobilePushNew/components/CtaButtons.js +170 -0
- package/v2Containers/MobilePushNew/components/MediaUploaders.js +754 -0
- package/v2Containers/MobilePushNew/components/PlatformContentFields.js +279 -0
- package/v2Containers/MobilePushNew/components/index.js +5 -0
- package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +779 -0
- package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +2114 -0
- package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +343 -0
- package/v2Containers/MobilePushNew/constants.js +115 -0
- package/v2Containers/MobilePushNew/hooks/tests/usePlatformSync.test.js +1299 -0
- package/v2Containers/MobilePushNew/hooks/tests/useUpload.test.js +1223 -0
- package/v2Containers/MobilePushNew/hooks/usePlatformSync.js +246 -0
- package/v2Containers/MobilePushNew/hooks/useUpload.js +726 -0
- package/v2Containers/MobilePushNew/index.js +2280 -0
- package/v2Containers/MobilePushNew/index.scss +308 -0
- package/v2Containers/MobilePushNew/messages.js +226 -0
- package/v2Containers/MobilePushNew/reducer.js +160 -0
- package/v2Containers/MobilePushNew/sagas.js +198 -0
- package/v2Containers/MobilePushNew/selectors.js +55 -0
- package/v2Containers/MobilePushNew/tests/reducer.test.js +741 -0
- package/v2Containers/MobilePushNew/tests/sagas.test.js +863 -0
- package/v2Containers/MobilePushNew/tests/selectors.test.js +425 -0
- package/v2Containers/MobilePushNew/tests/utils.test.js +322 -0
- package/v2Containers/MobilePushNew/utils.js +33 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +23 -5
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +4 -0
- package/v2Containers/TagList/index.js +56 -10
- package/v2Containers/Templates/_templates.scss +101 -1
- package/v2Containers/Templates/index.js +147 -35
- package/v2Containers/Templates/messages.js +8 -0
- package/v2Containers/Templates/sagas.js +2 -0
- package/v2Containers/Whatsapp/constants.js +1 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +35 -0
- package/v2Containers/Email/tests/index.test.js +0 -35
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { fromJS } from 'immutable';
|
|
2
|
+
import {
|
|
3
|
+
makeSelectPreviewAndTest,
|
|
4
|
+
makeSelectCustomers,
|
|
5
|
+
makeSelectExtractedTags,
|
|
6
|
+
makeSelectIsSearchingCustomer,
|
|
7
|
+
makeSelectIsExtractingTags,
|
|
8
|
+
makeSelectSearchError,
|
|
9
|
+
makeSelectHasSearched,
|
|
10
|
+
makeSelectApiWarnings,
|
|
11
|
+
makeSelectApiErrors,
|
|
12
|
+
makeSelectPreviewData,
|
|
13
|
+
makeSelectIsUpdatingPreview,
|
|
14
|
+
makeSelectIsSendingTestEmail,
|
|
15
|
+
makeSelectTags,
|
|
16
|
+
makeSelectTestCustomers,
|
|
17
|
+
makeSelectIsFetchingTestCustomers,
|
|
18
|
+
makeSelectTestGroups,
|
|
19
|
+
makeSelectIsFetchingTestGroups,
|
|
20
|
+
makeSelectMessageMetaConfigId,
|
|
21
|
+
makeSelectIsCreatingMessageMeta,
|
|
22
|
+
makeSelectPrefilledValues,
|
|
23
|
+
makeSelectTestMessageResponse,
|
|
24
|
+
makeSelectIsSendingTestMessage,
|
|
25
|
+
} from '../selectors';
|
|
26
|
+
|
|
27
|
+
describe('TestAndPreviewSlidebox selectors', () => {
|
|
28
|
+
it('should return the expected object with default values when substate is empty for makeSelectTestCustomers', () => {
|
|
29
|
+
const state = fromJS({ previewAndTest: { testCustomers: [] } });
|
|
30
|
+
const expected = fromJS([]);
|
|
31
|
+
const selector = makeSelectTestCustomers();
|
|
32
|
+
const result = selector(state);
|
|
33
|
+
expect(result).toEqual(expected);
|
|
34
|
+
});
|
|
35
|
+
it('should return the expected object with default values when substate is empty for makeSelectTestGroups', () => {
|
|
36
|
+
const state = fromJS({ previewAndTest: { testGroups: [] } });
|
|
37
|
+
const expected = fromJS([]);
|
|
38
|
+
const selector = makeSelectTestGroups();
|
|
39
|
+
const result = selector(state);
|
|
40
|
+
expect(result).toEqual(expected);
|
|
41
|
+
});
|
|
42
|
+
it('should return the expected object with default values when substate is empty for makeSelectMessageMetaConfigId', () => {
|
|
43
|
+
const state = fromJS({ previewAndTest: { messageMetaConfigId: null } });
|
|
44
|
+
const expected = null;
|
|
45
|
+
const selector = makeSelectMessageMetaConfigId();
|
|
46
|
+
const result = selector(state);
|
|
47
|
+
expect(result).toEqual(expected);
|
|
48
|
+
});
|
|
49
|
+
it('should return the expected object with default values when substate is empty for makeSelectPrefilledValues', () => {
|
|
50
|
+
const state = fromJS({ previewAndTest: { prefilledValues: {} } });
|
|
51
|
+
const expected = {};
|
|
52
|
+
const selector = makeSelectPrefilledValues();
|
|
53
|
+
const result = selector(state);
|
|
54
|
+
expect(result).toEqual(expected);
|
|
55
|
+
});
|
|
56
|
+
it('should return the expected object with default values when substate is empty for makeSelectTestMessageResponse', () => {
|
|
57
|
+
const state = fromJS({ previewAndTest: { testMessageResponse: null } });
|
|
58
|
+
const expected = null;
|
|
59
|
+
const selector = makeSelectTestMessageResponse();
|
|
60
|
+
const result = selector(state);
|
|
61
|
+
expect(result).toEqual(expected);
|
|
62
|
+
});
|
|
63
|
+
it('should return the expected object with default values when substate is empty for makeSelectPreviewAndTest', () => {
|
|
64
|
+
const state = fromJS({ previewAndTest: { previewData: null } });
|
|
65
|
+
const expected = fromJS({ previewData: null });
|
|
66
|
+
const selector = makeSelectPreviewAndTest();
|
|
67
|
+
const result = selector(state);
|
|
68
|
+
expect(result).toEqual(expected);
|
|
69
|
+
});
|
|
70
|
+
it('should return the expected object with default values when substate is empty for makeSelectCustomers', () => {
|
|
71
|
+
const state = fromJS({ previewAndTest: { customers: [] } });
|
|
72
|
+
const expected = fromJS([]);
|
|
73
|
+
const selector = makeSelectCustomers();
|
|
74
|
+
const result = selector(state);
|
|
75
|
+
expect(result).toEqual(expected);
|
|
76
|
+
});
|
|
77
|
+
it('should return the expected object with default values when substate is empty for makeSelectExtractedTags', () => {
|
|
78
|
+
const state = fromJS({ previewAndTest: { extractedTags: [] } });
|
|
79
|
+
const expected = fromJS([]);
|
|
80
|
+
const selector = makeSelectExtractedTags();
|
|
81
|
+
const result = selector(state);
|
|
82
|
+
expect(result).toEqual(expected);
|
|
83
|
+
});
|
|
84
|
+
it('should return the expected object with default values when substate is empty for makeSelectIsSearchingCustomer', () => {
|
|
85
|
+
const state = fromJS({ previewAndTest: { isSearchingCustomer: false } });
|
|
86
|
+
const expected = false;
|
|
87
|
+
const selector = makeSelectIsSearchingCustomer();
|
|
88
|
+
const result = selector(state);
|
|
89
|
+
expect(result).toEqual(expected);
|
|
90
|
+
});
|
|
91
|
+
it('should return the expected object with default values when substate is empty for makeSelectIsExtractingTags', () => {
|
|
92
|
+
const state = fromJS({ previewAndTest: { isExtractingTags: false } });
|
|
93
|
+
const expected = false;
|
|
94
|
+
const selector = makeSelectIsExtractingTags();
|
|
95
|
+
const result = selector(state);
|
|
96
|
+
expect(result).toEqual(expected);
|
|
97
|
+
});
|
|
98
|
+
it('should return the expected object with default values when substate is empty for makeSelectSearchError', () => {
|
|
99
|
+
const state = fromJS({ previewAndTest: { searchError: null } });
|
|
100
|
+
const expected = null;
|
|
101
|
+
const selector = makeSelectSearchError();
|
|
102
|
+
const result = selector(state);
|
|
103
|
+
expect(result).toEqual(expected);
|
|
104
|
+
});
|
|
105
|
+
it('should return the expected object with default values when substate is empty for makeSelectHasSearched', () => {
|
|
106
|
+
const state = fromJS({ previewAndTest: { hasSearched: false } });
|
|
107
|
+
const expected = false;
|
|
108
|
+
const selector = makeSelectHasSearched();
|
|
109
|
+
const result = selector(state);
|
|
110
|
+
expect(result).toEqual(expected);
|
|
111
|
+
});
|
|
112
|
+
it('should return the expected object with default values when substate is empty for makeSelectApiWarnings', () => {
|
|
113
|
+
const state = fromJS({ previewAndTest: { apiWarnings: [] } });
|
|
114
|
+
const expected = fromJS([]);
|
|
115
|
+
const selector = makeSelectApiWarnings();
|
|
116
|
+
const result = selector(state);
|
|
117
|
+
expect(result).toEqual(expected);
|
|
118
|
+
});
|
|
119
|
+
it('should return the expected object with default values when substate is empty for makeSelectApiErrors', () => {
|
|
120
|
+
const state = fromJS({ previewAndTest: { apiErrors: [] } });
|
|
121
|
+
const expected = fromJS([]);
|
|
122
|
+
const selector = makeSelectApiErrors();
|
|
123
|
+
const result = selector(state);
|
|
124
|
+
expect(result).toEqual(expected);
|
|
125
|
+
});
|
|
126
|
+
it('should return the expected object with default values when substate is empty for makeSelectPreviewData', () => {
|
|
127
|
+
const state = fromJS({ previewAndTest: { previewData: null } });
|
|
128
|
+
const expected = null;
|
|
129
|
+
const selector = makeSelectPreviewData();
|
|
130
|
+
const result = selector(state);
|
|
131
|
+
expect(result).toEqual(expected);
|
|
132
|
+
});
|
|
133
|
+
it('should return the expected object with default values when substate is empty for makeSelectIsUpdatingPreview', () => {
|
|
134
|
+
const state = fromJS({ previewAndTest: { isUpdatingPreview: false } });
|
|
135
|
+
const expected = false;
|
|
136
|
+
const selector = makeSelectIsUpdatingPreview();
|
|
137
|
+
const result = selector(state);
|
|
138
|
+
expect(result).toEqual(expected);
|
|
139
|
+
});
|
|
140
|
+
it('should return the expected object with default values when substate is empty for makeSelectIsSendingTestEmail', () => {
|
|
141
|
+
const state = fromJS({ previewAndTest: { isSendingTestEmail: false } });
|
|
142
|
+
const expected = false;
|
|
143
|
+
const selector = makeSelectIsSendingTestEmail();
|
|
144
|
+
const result = selector(state);
|
|
145
|
+
expect(result).toEqual(expected);
|
|
146
|
+
});
|
|
147
|
+
it('should return the expected object with default values when substate is empty for makeSelectTags', () => {
|
|
148
|
+
const state = fromJS({ previewAndTest: { tags: [] } });
|
|
149
|
+
const expected = fromJS([]);
|
|
150
|
+
const selector = makeSelectTags();
|
|
151
|
+
const result = selector(state);
|
|
152
|
+
expect(result).toEqual(expected);
|
|
153
|
+
});
|
|
154
|
+
it('should return the expected object with default values when substate is empty for makeSelectIsFetchingTestCustomers', () => {
|
|
155
|
+
const state = fromJS({ previewAndTest: { isFetchingTestCustomers: false } });
|
|
156
|
+
const expected = false;
|
|
157
|
+
const selector = makeSelectIsFetchingTestCustomers();
|
|
158
|
+
const result = selector(state);
|
|
159
|
+
expect(result).toEqual(expected);
|
|
160
|
+
});
|
|
161
|
+
it('should return the expected object with default values when substate is empty for makeSelectIsFetchingTestGroups', () => {
|
|
162
|
+
const state = fromJS({ previewAndTest: { isFetchingTestGroups: false } });
|
|
163
|
+
const expected = false;
|
|
164
|
+
const selector = makeSelectIsFetchingTestGroups();
|
|
165
|
+
const result = selector(state);
|
|
166
|
+
expect(result).toEqual(expected);
|
|
167
|
+
});
|
|
168
|
+
it('should return the expected object with default values when substate is empty for makeSelectIsCreatingMessageMeta', () => {
|
|
169
|
+
const state = fromJS({ previewAndTest: { isCreatingMessageMeta: false } });
|
|
170
|
+
const expected = false;
|
|
171
|
+
const selector = makeSelectIsCreatingMessageMeta();
|
|
172
|
+
const result = selector(state);
|
|
173
|
+
expect(result).toEqual(expected);
|
|
174
|
+
});
|
|
175
|
+
it('should return the expected object with default values when substate is empty for makeSelectIsSendingTestMessage', () => {
|
|
176
|
+
const state = fromJS({ previewAndTest: { isSendingTestMessage: false } });
|
|
177
|
+
const expected = false;
|
|
178
|
+
const selector = makeSelectIsSendingTestMessage();
|
|
179
|
+
const result = selector(state);
|
|
180
|
+
expect(result).toEqual(expected);
|
|
181
|
+
});
|
|
182
|
+
});
|
|
@@ -7,17 +7,14 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
7
7
|
import TemplatesV2 from '../TemplatesV2';
|
|
8
8
|
import TemplatePreview from '../../v2Components/TemplatePreview';
|
|
9
9
|
import SmsWrapper from '../SmsWrapper';
|
|
10
|
-
// import SmsEdit from '../Sms/Edit';
|
|
11
10
|
import Email from '../Email';
|
|
12
11
|
import EmailWrapper from '../EmailWrapper';
|
|
13
|
-
import MobilepushWrapper from '../MobilepushWrapper';
|
|
14
12
|
import EmailPreviewV2 from '../../v2Components/EmailPreviewV2';
|
|
15
13
|
import MobilePushPreview from '../../v2Components/MobilePushPreviewV2';
|
|
16
14
|
import WechatWrapper from '../WeChat/Wrapper';
|
|
17
15
|
import Facebook from '../Facebook';
|
|
18
16
|
import { RICH_MEDIA, MAP_TEMPLATE, CREATE } from '../WeChat/Wrapper/constants';
|
|
19
17
|
import CallTask from '../CallTask';
|
|
20
|
-
import MobliPushEdit from '../MobilePush/Edit';
|
|
21
18
|
import * as constants from './constants';
|
|
22
19
|
import LineContainer from '../Line/Container';
|
|
23
20
|
import FTP from '../FTP';
|
|
@@ -28,6 +25,7 @@ import Rcs from '../Rcs';
|
|
|
28
25
|
import { getWhatsappContent } from '../Whatsapp/utils';
|
|
29
26
|
import * as commonUtil from '../../utils/common';
|
|
30
27
|
import Zalo from '../Zalo';
|
|
28
|
+
import MobilePushNew from '../MobilePushNew';
|
|
31
29
|
const CreativesWrapper = styled.div`
|
|
32
30
|
.ant-popover,
|
|
33
31
|
.ant-notification,
|
|
@@ -160,6 +158,9 @@ export function SlideBoxContent(props) {
|
|
|
160
158
|
eventContextTags,
|
|
161
159
|
isLoyaltyModule,
|
|
162
160
|
loyaltyMetaData = {},
|
|
161
|
+
showTestAndPreviewSlidebox,
|
|
162
|
+
handleTestAndPreview,
|
|
163
|
+
handleCloseTestAndPreview,
|
|
163
164
|
} = props;
|
|
164
165
|
const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
|
|
165
166
|
const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
|
|
@@ -476,9 +477,6 @@ export function SlideBoxContent(props) {
|
|
|
476
477
|
forwardedTags={forwardedTags}
|
|
477
478
|
/>
|
|
478
479
|
)}
|
|
479
|
-
{isMpushPreview &&
|
|
480
|
-
<MobilePushPreview templateData={templateData} channel={channel}/>
|
|
481
|
-
}
|
|
482
480
|
{
|
|
483
481
|
(currentChannel === constants.WECHAT && !!slidBoxContent) && <WechatWrapper
|
|
484
482
|
mode={slidBoxContent}
|
|
@@ -624,6 +622,9 @@ export function SlideBoxContent(props) {
|
|
|
624
622
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
625
623
|
eventContextTags={eventContextTags}
|
|
626
624
|
isLoyaltyModule={isLoyaltyModule}
|
|
625
|
+
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
626
|
+
handleTestAndPreview={handleTestAndPreview}
|
|
627
|
+
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
627
628
|
/>
|
|
628
629
|
)}
|
|
629
630
|
{(isEditEmailWithId || isEmailEditWithContent) && (
|
|
@@ -654,10 +655,13 @@ export function SlideBoxContent(props) {
|
|
|
654
655
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
655
656
|
eventContextTags={eventContextTags}
|
|
656
657
|
isLoyaltyModule={isLoyaltyModule}
|
|
658
|
+
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
659
|
+
handleTestAndPreview={handleTestAndPreview}
|
|
660
|
+
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
657
661
|
/>
|
|
658
662
|
)}
|
|
659
663
|
{isEditMPush &&
|
|
660
|
-
<
|
|
664
|
+
<MobilePushNew
|
|
661
665
|
getFormLibraryData={getFormData}
|
|
662
666
|
setIsLoadingContent={setIsLoadingContent}
|
|
663
667
|
location={{
|
|
@@ -684,16 +688,19 @@ export function SlideBoxContent(props) {
|
|
|
684
688
|
/>
|
|
685
689
|
}
|
|
686
690
|
{isCreateMPush &&
|
|
687
|
-
<
|
|
691
|
+
<MobilePushNew
|
|
688
692
|
key="creatives-mobilepush-wrapper"
|
|
689
693
|
date={new Date().getMilliseconds()}
|
|
690
694
|
setIsLoadingContent={setIsLoadingContent}
|
|
691
695
|
onMobilepushModeChange={onMobilepushModeChange}
|
|
692
696
|
mobilePushCreateMode={mobilePushCreateMode}
|
|
693
697
|
isGetFormData={isGetFormData}
|
|
694
|
-
|
|
698
|
+
getFormLibraryData={getFormData}
|
|
699
|
+
location={location}
|
|
700
|
+
getDefaultTags={type}
|
|
695
701
|
templateData={templateData}
|
|
696
702
|
type={type}
|
|
703
|
+
handleClose={handleClose}
|
|
697
704
|
step={templateStep}
|
|
698
705
|
showNextStep={onCreateNextStep}
|
|
699
706
|
isFullMode={isFullMode}
|
|
@@ -711,6 +718,8 @@ export function SlideBoxContent(props) {
|
|
|
711
718
|
onTestContentClicked={onTestContentClicked}
|
|
712
719
|
eventContextTags={eventContextTags}
|
|
713
720
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
721
|
+
onCreateComplete={onCreateComplete}
|
|
722
|
+
creativesMode={creativesMode}
|
|
714
723
|
/>
|
|
715
724
|
}
|
|
716
725
|
{
|
|
@@ -977,6 +986,9 @@ SlideBoxContent.propTypes = {
|
|
|
977
986
|
moduleType: PropTypes.string,
|
|
978
987
|
showLiquidErrorInFooter: PropTypes.bool,
|
|
979
988
|
creativesMode: PropTypes.string,
|
|
980
|
-
hostName: PropTypes.string
|
|
989
|
+
hostName: PropTypes.string,
|
|
990
|
+
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
991
|
+
handleTestAndPreview: PropTypes.func,
|
|
992
|
+
handleCloseTestAndPreview: PropTypes.func
|
|
981
993
|
};
|
|
982
994
|
export default SlideBoxContent;
|
|
@@ -26,13 +26,18 @@ function SlideBoxFooter(props) {
|
|
|
26
26
|
errorMessages,
|
|
27
27
|
isLiquidValidationError,
|
|
28
28
|
currentTab,
|
|
29
|
+
onTestAndPreview,
|
|
30
|
+
// isEmptyContent,
|
|
31
|
+
showTestAndPreviewButton,
|
|
32
|
+
shouldShowDoneFooter,
|
|
33
|
+
shouldShowContinueFooter,
|
|
29
34
|
} = props;
|
|
30
35
|
|
|
31
36
|
return (
|
|
32
37
|
<div className='template-footer-width'>
|
|
33
38
|
{isLiquidValidationError && (<ErrorInfoNote errorMessages={errorMessages} currentTab={currentTab?.toUpperCase()} />)}
|
|
34
39
|
<div>
|
|
35
|
-
{
|
|
40
|
+
{shouldShowDoneFooter() && (
|
|
36
41
|
<div>
|
|
37
42
|
{isFullMode && isTemplateNameEmpty && (
|
|
38
43
|
<CapError type="error">
|
|
@@ -50,11 +55,21 @@ function SlideBoxFooter(props) {
|
|
|
50
55
|
<FormattedMessage {...messages.creativesTemplatesSave} />
|
|
51
56
|
)}
|
|
52
57
|
</CapButton>
|
|
58
|
+
{showTestAndPreviewButton && (
|
|
59
|
+
<CapButton
|
|
60
|
+
type="secondary"
|
|
61
|
+
onClick={onTestAndPreview}
|
|
62
|
+
// disabled={isEmptyContent || false}
|
|
63
|
+
style={{ marginLeft: '8px' }}
|
|
64
|
+
>
|
|
65
|
+
<FormattedMessage {...messages.testAndPreview} />
|
|
66
|
+
</CapButton>
|
|
67
|
+
)}
|
|
53
68
|
</CapRow>
|
|
54
69
|
{/* {isFullMode && <CapButton type="secondary" onClick={onDiscard}><FormattedMessage {...messages.creativesTemplatesDiscard}/></CapButton>} */}
|
|
55
70
|
</div>
|
|
56
71
|
)}
|
|
57
|
-
{
|
|
72
|
+
{shouldShowContinueFooter() && (
|
|
58
73
|
<CapButton onClick={onCreateNextStep}>
|
|
59
74
|
<FormattedMessage {...messages.continue} />
|
|
60
75
|
</CapButton>
|
|
@@ -76,7 +91,13 @@ SlideBoxFooter.propTypes = {
|
|
|
76
91
|
shouldShowContinueFooter: PropTypes.func,
|
|
77
92
|
shouldShowDoneFooter: PropTypes.func,
|
|
78
93
|
isFullMode: PropTypes.bool,
|
|
94
|
+
fetchingCmsData: PropTypes.bool,
|
|
79
95
|
isTemplateNameEmpty: PropTypes.bool,
|
|
96
|
+
errorMessages: PropTypes.array,
|
|
80
97
|
isLiquidValidationError: PropTypes.bool,
|
|
98
|
+
currentTab: PropTypes.string,
|
|
99
|
+
onTestAndPreview: PropTypes.func,
|
|
100
|
+
isEmptyContent: PropTypes.bool,
|
|
101
|
+
showTestAndPreviewButton: PropTypes.bool,
|
|
81
102
|
};
|
|
82
103
|
export default SlideBoxFooter;
|