@capillarytech/creatives-library 8.0.18 → 8.0.20
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/package.json +1 -1
- package/v2Containers/Cap/reducer.js +3 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +3 -0
- package/v2Containers/CreativesContainer/index.js +2 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +5 -0
- package/v2Containers/MobilePush/Create/constants.js +1 -0
- package/v2Containers/MobilePush/Create/index.js +19 -4
- package/v2Containers/Zalo/index.js +2 -1
package/package.json
CHANGED
|
@@ -126,12 +126,14 @@ function capReducer(state = fromJS(initialState.cap), action) {
|
|
|
126
126
|
tags: action.data && action.entityType === 'TAG' ? action.data.metaEntities : stateMeta.tags,
|
|
127
127
|
tagLookupMap: action?.data && action?.entityType === TAG ? combinedTagMap : stateMeta?.tagLookupMap,
|
|
128
128
|
})
|
|
129
|
-
.set('fetchingSchemaError', false)
|
|
129
|
+
.set('fetchingSchemaError', false)
|
|
130
|
+
.set('fetchingLiquidTags', false);
|
|
130
131
|
}
|
|
131
132
|
case types.CLEAR_META_ENTITIES:
|
|
132
133
|
return state.set('metaEntities', {
|
|
133
134
|
layouts: [],
|
|
134
135
|
tags: [],
|
|
136
|
+
tagLookupMap: [],
|
|
135
137
|
});
|
|
136
138
|
// eslint-disable-next-line no-case-declarations
|
|
137
139
|
case types.HIDE_TAGS:
|
|
@@ -155,6 +155,7 @@ export function SlideBoxContent(props) {
|
|
|
155
155
|
moduleType,
|
|
156
156
|
showLiquidErrorInFooter,
|
|
157
157
|
creativesMode,
|
|
158
|
+
hostName = '',
|
|
158
159
|
} = props;
|
|
159
160
|
const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
|
|
160
161
|
const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
|
|
@@ -543,6 +544,7 @@ export function SlideBoxContent(props) {
|
|
|
543
544
|
query,
|
|
544
545
|
search: '',
|
|
545
546
|
}}
|
|
547
|
+
hostName={hostName}
|
|
546
548
|
/>
|
|
547
549
|
}
|
|
548
550
|
{
|
|
@@ -924,5 +926,6 @@ SlideBoxContent.propTypes = {
|
|
|
924
926
|
moduleType: PropTypes.string,
|
|
925
927
|
showLiquidErrorInFooter: PropTypes.bool,
|
|
926
928
|
creativesMode: PropTypes.string,
|
|
929
|
+
hostName: PropTypes.string,
|
|
927
930
|
};
|
|
928
931
|
export default SlideBoxContent;
|
|
@@ -1319,6 +1319,7 @@ export class Creatives extends React.Component {
|
|
|
1319
1319
|
moduleType={this.props.messageDetails?.type}
|
|
1320
1320
|
showLiquidErrorInFooter={this.showLiquidErrorInFooter}
|
|
1321
1321
|
creativesMode={creativesMode} // An existing prop that we're using here. Required to ensure correct account details in Edit or Preview in case of Embedded mode.
|
|
1322
|
+
hostName={this.props?.hostName || ''}
|
|
1322
1323
|
/>
|
|
1323
1324
|
}
|
|
1324
1325
|
footer={this.shouldShowFooter() &&
|
|
@@ -1377,6 +1378,7 @@ Creatives.propTypes = {
|
|
|
1377
1378
|
selectedAccount: PropTypes.object,
|
|
1378
1379
|
strategy: PropTypes.string,
|
|
1379
1380
|
orgUnitId: PropTypes.number,
|
|
1381
|
+
hostName: PropTypes.string,
|
|
1380
1382
|
};
|
|
1381
1383
|
const mapStatesToProps = () => createStructuredSelector({
|
|
1382
1384
|
isLoading: isLoadingSelector(),
|
|
@@ -14,6 +14,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click rcs
|
|
|
14
14
|
currentChannel="RCS"
|
|
15
15
|
getFormData={[Function]}
|
|
16
16
|
handleClose={[Function]}
|
|
17
|
+
hostName=""
|
|
17
18
|
onCallTaskSubmit={[Function]}
|
|
18
19
|
onChannelChange={[Function]}
|
|
19
20
|
onCreateComplete={[MockFunction]}
|
|
@@ -90,6 +91,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click wha
|
|
|
90
91
|
currentChannel="WHATSAPP"
|
|
91
92
|
getFormData={[Function]}
|
|
92
93
|
handleClose={[Function]}
|
|
94
|
+
hostName=""
|
|
93
95
|
onCallTaskSubmit={[Function]}
|
|
94
96
|
onChannelChange={[Function]}
|
|
95
97
|
onCreateComplete={[MockFunction]}
|
|
@@ -166,6 +168,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
|
|
|
166
168
|
currentChannel="WHATSAPP"
|
|
167
169
|
getFormData={[Function]}
|
|
168
170
|
handleClose={[Function]}
|
|
171
|
+
hostName=""
|
|
169
172
|
onCallTaskSubmit={[Function]}
|
|
170
173
|
onChannelChange={[Function]}
|
|
171
174
|
onCreateComplete={[MockFunction]}
|
|
@@ -246,6 +249,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
|
|
|
246
249
|
currentChannel="WHATSAPP"
|
|
247
250
|
getFormData={[Function]}
|
|
248
251
|
handleClose={[Function]}
|
|
252
|
+
hostName=""
|
|
249
253
|
onCallTaskSubmit={[Function]}
|
|
250
254
|
onChannelChange={[Function]}
|
|
251
255
|
onCreateComplete={[MockFunction]}
|
|
@@ -326,6 +330,7 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
|
|
|
326
330
|
currentChannel="WHATSAPP"
|
|
327
331
|
getFormData={[Function]}
|
|
328
332
|
handleClose={[Function]}
|
|
333
|
+
hostName=""
|
|
329
334
|
onCallTaskSubmit={[Function]}
|
|
330
335
|
onChannelChange={[Function]}
|
|
331
336
|
onCreateComplete={[MockFunction]}
|
|
@@ -22,3 +22,4 @@ export const GET_IOS_CTAS = 'app/v2Containers/PushMessage/Create/GET_IOS_CTAS';
|
|
|
22
22
|
export const GET_IOS_CTAS_SUCCESS = 'app/v2Containers/PushMessage/Create/GET_IOS_CTAS_SUCCESS';
|
|
23
23
|
export const GET_IOS_CTAS_FAILURE = 'app/v2Containers/PushMessage/Create/GET_IOS_CTAS_FAILURE';
|
|
24
24
|
export const RESET_STORE = 'app/v2Containers/PushMessage/Create/RESET_STORE';
|
|
25
|
+
export const EXTERNAL_LINK_LOWERCASE = 'external link';
|
|
@@ -36,6 +36,7 @@ import injectReducer from '../../../utils/injectReducer';
|
|
|
36
36
|
import injectSaga from '../../../utils/injectSaga';
|
|
37
37
|
import v2MobilePushCreateReducer from './reducer';
|
|
38
38
|
import { v2MobilePushWatchDuplicateTemplateSaga } from './sagas';
|
|
39
|
+
import { EXTERNAL_LINK_LOWERCASE } from './constants';
|
|
39
40
|
|
|
40
41
|
const PrefixWrapper = styled.div`
|
|
41
42
|
margin-right: 16px;
|
|
@@ -200,11 +201,25 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
200
201
|
newFormData[0]["add-sec-cta-2"] = false;
|
|
201
202
|
}
|
|
202
203
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
const compareValue =
|
|
205
|
+
newFormData?.[this.state?.currentTab - 1]?.[inputField?.id] || "";
|
|
206
|
+
this.setState(
|
|
207
|
+
{
|
|
208
|
+
formData: newFormData,
|
|
209
|
+
tabCount,
|
|
210
|
+
isSchemaChanged:
|
|
211
|
+
compareValue.toLowerCase() === EXTERNAL_LINK_LOWERCASE ||
|
|
212
|
+
!this.state?.isSchemaChanged,
|
|
213
|
+
},
|
|
214
|
+
() => {
|
|
215
|
+
if (isFullMode && showTemplateName) {
|
|
216
|
+
showTemplateName({
|
|
217
|
+
formData: this.state?.formData,
|
|
218
|
+
onFormDataChange: this.onFormDataChange,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
206
221
|
}
|
|
207
|
-
|
|
222
|
+
);
|
|
208
223
|
};
|
|
209
224
|
|
|
210
225
|
onTagSelect = (data, currentTab, srcComp) => {
|
|
@@ -69,8 +69,9 @@ export const Zalo = (props) => {
|
|
|
69
69
|
injectedTags,
|
|
70
70
|
getFormData,
|
|
71
71
|
selectedOfferDetails,
|
|
72
|
+
hostName: zaloHostName = '',
|
|
72
73
|
} = props || {};
|
|
73
|
-
const {hostName = ''} = senderDetails;
|
|
74
|
+
const {hostName = zaloHostName || ''} = senderDetails;
|
|
74
75
|
const { formatMessage } = intl;
|
|
75
76
|
const [oa_id, setOaId] = useState('');
|
|
76
77
|
const [token, setToken] = useState('');
|