@capillarytech/creatives-library 7.17.103 → 7.17.105
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/v2Components/CapDeviceContent/index.js +6 -1
- package/v2Components/CapInAppCTA/index.js +0 -1
- package/v2Components/TemplatePreview/_templatePreview.scss +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +1 -0
- package/v2Containers/InApp/index.js +16 -7
- package/v2Containers/Templates/index.js +3 -0
package/package.json
CHANGED
|
@@ -138,6 +138,11 @@ const CapDeviceContent = (props) => {
|
|
|
138
138
|
setCtaData(INITIAL_CTA_DATA);
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
+
const onActionLinkCheckBoxChange = () => {
|
|
142
|
+
setAddActionLink(!addActionLink);
|
|
143
|
+
setDeepLinkValue('');
|
|
144
|
+
};
|
|
145
|
+
|
|
141
146
|
const uploadInAppAsset = (file, type, fileParams) => {
|
|
142
147
|
actions.uploadInAppAsset(file, type, fileParams, 0);
|
|
143
148
|
};
|
|
@@ -251,7 +256,7 @@ const CapDeviceContent = (props) => {
|
|
|
251
256
|
</CapRow>
|
|
252
257
|
</CapRow>
|
|
253
258
|
<CapRow className="inapp-action-link">
|
|
254
|
-
<CapCheckbox onChange={
|
|
259
|
+
<CapCheckbox onChange={onActionLinkCheckBoxChange} checked={addActionLink} />
|
|
255
260
|
<CapRow className="inapp-render-heading">
|
|
256
261
|
<CapHeader
|
|
257
262
|
title={<CapRow type="flex">
|
|
@@ -89,7 +89,7 @@ export const InApp = (props) => {
|
|
|
89
89
|
const [accountId, setAccountId] = useState("");
|
|
90
90
|
const [accessToken, setAccessToken] = useState("");
|
|
91
91
|
const [accountName, setAccountName] = useState("");
|
|
92
|
-
const [deepLink, setDeepLink] = useState(
|
|
92
|
+
const [deepLink, setDeepLink] = useState([]);
|
|
93
93
|
const [spin, setSpin] = useState(false);
|
|
94
94
|
const [inAppImageSrcAndroid, setInAppImageSrcAndroid] = useState("");
|
|
95
95
|
const [inAppImageSrcIos, setInAppImageSrcIos] = useState("");
|
|
@@ -113,7 +113,7 @@ export const InApp = (props) => {
|
|
|
113
113
|
//gets account details
|
|
114
114
|
useEffect(() => {
|
|
115
115
|
const accountObj = accountData?.selectedWeChatAccount || {};
|
|
116
|
-
const deepLinkObj =
|
|
116
|
+
const deepLinkObj = accountObj?.configs?.deeplink || '';
|
|
117
117
|
if (!isEmpty(accountObj)) {
|
|
118
118
|
const {
|
|
119
119
|
sourceAccountIdentifier = "",
|
|
@@ -123,12 +123,12 @@ export const InApp = (props) => {
|
|
|
123
123
|
const isAndroidSupported = configs?.android === DEVICE_SUPPORTED;
|
|
124
124
|
// DEVICE_SUPPORTED is '1', which indicates if the particular account is supported, and '0' if the devive is not supported
|
|
125
125
|
//get deep link keys in an array
|
|
126
|
-
const deepLinkKeys = Object.values(JSON.parse(deepLinkObj));
|
|
127
|
-
const keys = deepLinkKeys
|
|
126
|
+
const deepLinkKeys = Object.values(JSON.parse(deepLinkObj || '{}'));
|
|
127
|
+
const keys = deepLinkKeys?.map((link) => ({label: link.name, value: link.link, title: link.link }));
|
|
128
128
|
setPanes(isAndroidSupported ? ANDROID : IOS);
|
|
129
129
|
setDeepLink(keys);
|
|
130
130
|
setAccountId(sourceAccountIdentifier);
|
|
131
|
-
setAccessToken(configs
|
|
131
|
+
setAccessToken(configs?.accessToken || "");
|
|
132
132
|
setAccountName(name);
|
|
133
133
|
}
|
|
134
134
|
}, [accountData?.selectedWeChatAccount, accountData?.weCrmAccounts[0]] );
|
|
@@ -183,7 +183,7 @@ export const InApp = (props) => {
|
|
|
183
183
|
: INAPP_MEDIA_TYPES.IMAGE
|
|
184
184
|
);
|
|
185
185
|
setInAppImageSrcAndroid(androidImage);
|
|
186
|
-
setDeepLinkValueAndroid(androidCta[0]?.actionLink);
|
|
186
|
+
setDeepLinkValueAndroid(androidCta[0]?.actionLink || '');
|
|
187
187
|
setAddActionLinkAndroid(!isEmpty(androidCta) && true);
|
|
188
188
|
setButtonTypeAndroid(
|
|
189
189
|
androidCtaLength ? INAPP_BUTTON_TYPES.CTA : INAPP_BUTTON_TYPES.NONE
|
|
@@ -212,7 +212,7 @@ export const InApp = (props) => {
|
|
|
212
212
|
setInAppImageSrcIos(iosImage);
|
|
213
213
|
setButtonTypeIos(iosCtaLength ? INAPP_BUTTON_TYPES.CTA : INAPP_BUTTON_TYPES.NONE);
|
|
214
214
|
setAddActionLinkIos(!isEmpty(iosCta) && true);
|
|
215
|
-
setDeepLinkValueIos(iosCta[0]?.actionLink);
|
|
215
|
+
setDeepLinkValueIos(iosCta[0]?.actionLink || '');
|
|
216
216
|
if (iosCtaLength > 0) {
|
|
217
217
|
setCtaDataIos(getCtaObject(iosCtas));
|
|
218
218
|
}
|
|
@@ -536,6 +536,15 @@ export const InApp = (props) => {
|
|
|
536
536
|
//if button type is cta and there are no buttons saved
|
|
537
537
|
return true;
|
|
538
538
|
}
|
|
539
|
+
|
|
540
|
+
// action link
|
|
541
|
+
if (addActionLinkAndroid && !deepLinkValueAndroid) {
|
|
542
|
+
return true;
|
|
543
|
+
}
|
|
544
|
+
if (addActionLinkIos && !deepLinkValueIos) {
|
|
545
|
+
return true;
|
|
546
|
+
}
|
|
547
|
+
|
|
539
548
|
return false;
|
|
540
549
|
};
|
|
541
550
|
|
|
@@ -802,6 +802,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
802
802
|
queryParams.originalId = this.props.Templates.selectedWeChatAccount.sourceAccountIdentifier;
|
|
803
803
|
}
|
|
804
804
|
const channel = this.state.channel;
|
|
805
|
+
if (([MOBILE_PUSH_LOWERCASE, INAPP_LOWERCASE].includes(channel.toLowerCase())) && !isEmpty(this.props.Templates.selectedWeChatAccount)) {
|
|
806
|
+
queryParams.accountId = this.props.Templates?.selectedWeChatAccount?.id;
|
|
807
|
+
}
|
|
805
808
|
this.props.actions.getAllTemplates(channel, queryParams,`${copyOf}`);
|
|
806
809
|
} else if ((resetPage || (page === 1 && this.state.templatesCount === 0) || page <= (this.state.templatesCount / this.state.perPageLimit))) {
|
|
807
810
|
if (getNextPage) {
|