@capillarytech/creatives-library 8.0.324 → 8.0.325
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
CHANGED
|
@@ -743,6 +743,7 @@ export class Creatives extends React.Component {
|
|
|
743
743
|
smsFallBackContent = {},
|
|
744
744
|
creativeName = "",
|
|
745
745
|
channel = constants.RCS,
|
|
746
|
+
accountId = "",
|
|
746
747
|
rcsCardVarMapped,
|
|
747
748
|
} = templateData || {};
|
|
748
749
|
const { isFullMode: isFullModeForRcsPayload } = this.props;
|
|
@@ -784,6 +785,7 @@ export class Creatives extends React.Component {
|
|
|
784
785
|
RCS: {
|
|
785
786
|
rcsContent: {
|
|
786
787
|
...rcsContent,
|
|
788
|
+
...(accountId && !isFullMode && { accountId }),
|
|
787
789
|
cardContent: [
|
|
788
790
|
{
|
|
789
791
|
...cardContent,
|
|
@@ -1235,7 +1237,7 @@ export class Creatives extends React.Component {
|
|
|
1235
1237
|
};
|
|
1236
1238
|
}
|
|
1237
1239
|
break;
|
|
1238
|
-
case constants.FACEBOOK:
|
|
1240
|
+
case constants.FACEBOOK:
|
|
1239
1241
|
if (template.value) {
|
|
1240
1242
|
const FacebookAd = template?.value?.versions?.base?.content?.FacebookAd;
|
|
1241
1243
|
const { type } = FacebookAd[0];
|
|
@@ -1279,9 +1281,8 @@ export class Creatives extends React.Component {
|
|
|
1279
1281
|
selectedMarketingObjective: template.value.selectedMarketingObjective,
|
|
1280
1282
|
};
|
|
1281
1283
|
}
|
|
1282
|
-
}
|
|
1283
1284
|
break;
|
|
1284
|
-
case constants.RCS:
|
|
1285
|
+
case constants.RCS:
|
|
1285
1286
|
if (template.value) {
|
|
1286
1287
|
const { isFullMode: isFullModeForRcsConsumerPayload } = this.props;
|
|
1287
1288
|
const { name = "", versions = {} } = template.value || {};
|
|
@@ -1329,6 +1330,7 @@ export class Creatives extends React.Component {
|
|
|
1329
1330
|
contentType = "",
|
|
1330
1331
|
cardType = "",
|
|
1331
1332
|
cardSettings = {},
|
|
1333
|
+
accountId = "",
|
|
1332
1334
|
} = get(versions, 'base.content.RCS.rcsContent', {});
|
|
1333
1335
|
const rootRcsCardVarMappedFromSubmit = get(template, 'value.rcsCardVarMapped');
|
|
1334
1336
|
const firstCardFromSubmit = Array.isArray(cardContentFromSubmit)
|
|
@@ -1358,6 +1360,7 @@ export class Creatives extends React.Component {
|
|
|
1358
1360
|
channel,
|
|
1359
1361
|
creativeName: name,
|
|
1360
1362
|
rcsContent,
|
|
1363
|
+
accountId: accountId,
|
|
1361
1364
|
...(includeRootRcsCardVarMappedOnConsumerPayload
|
|
1362
1365
|
? { rcsCardVarMapped: cardVarMappedFromFirstRcsCard }
|
|
1363
1366
|
: {}),
|
|
@@ -1379,9 +1382,8 @@ export class Creatives extends React.Component {
|
|
|
1379
1382
|
};
|
|
1380
1383
|
}
|
|
1381
1384
|
}
|
|
1382
|
-
}
|
|
1383
1385
|
break;
|
|
1384
|
-
case constants.ZALO:
|
|
1386
|
+
case constants.ZALO:
|
|
1385
1387
|
if (template.value) {
|
|
1386
1388
|
templateData = {
|
|
1387
1389
|
...template.value,
|
|
@@ -1390,7 +1392,6 @@ export class Creatives extends React.Component {
|
|
|
1390
1392
|
delete templateData.type;
|
|
1391
1393
|
}
|
|
1392
1394
|
}
|
|
1393
|
-
}
|
|
1394
1395
|
break;
|
|
1395
1396
|
case constants.WEBPUSH: {
|
|
1396
1397
|
if (template.value) {
|
|
@@ -262,6 +262,7 @@ export const Rcs = (props) => {
|
|
|
262
262
|
const [accessToken, setAccessToken] = useState('');
|
|
263
263
|
const [hostName, setHostName] = useState('');
|
|
264
264
|
const [accountName, setAccountName] = useState('');
|
|
265
|
+
const [rcsAccount, setRcsAccount] = useState('');
|
|
265
266
|
useEffect(() => {
|
|
266
267
|
const accountObj = accountData.selectedRcsAccount || {};
|
|
267
268
|
if (!isEmpty(accountObj)) {
|
|
@@ -277,12 +278,14 @@ export const Rcs = (props) => {
|
|
|
277
278
|
setAccessToken(configs.accessToken || '');
|
|
278
279
|
setHostName(accountObj.hostName || '');
|
|
279
280
|
setAccountName(accountObj.name || '');
|
|
281
|
+
setRcsAccount(accountObj.id || '');
|
|
280
282
|
} else {
|
|
281
283
|
setAccountId('');
|
|
282
284
|
setWecrmAccountId('');
|
|
283
285
|
setAccessToken('');
|
|
284
286
|
setHostName('');
|
|
285
287
|
setAccountName('');
|
|
288
|
+
setRcsAccount('');
|
|
286
289
|
}
|
|
287
290
|
}, [accountData.selectedRcsAccount]);
|
|
288
291
|
|
|
@@ -750,7 +753,10 @@ export const Rcs = (props) => {
|
|
|
750
753
|
get(details, 'versions.base.content.RCS.rcsContent.cardSettings', '')
|
|
751
754
|
|| get(details, 'rcsContent.cardSettings', '');
|
|
752
755
|
setMediaData(mediaData, mediaType, cardSettings);
|
|
753
|
-
|
|
756
|
+
if (details?.edit) {
|
|
757
|
+
const rcsAccountId = get(details, 'versions.base.content.RCS.rcsContent.accountId', '');
|
|
758
|
+
setRcsAccount(rcsAccountId);
|
|
759
|
+
}
|
|
754
760
|
const smsFallbackContent = mergeRcsSmsFallBackContentFromDetails(details);
|
|
755
761
|
const base = get(smsFallbackContent, 'versions.base', {});
|
|
756
762
|
const updatedEditor = base['updated-sms-editor'] ?? base['sms-editor'];
|
|
@@ -1966,6 +1972,7 @@ const onTitleAddVar = () => {
|
|
|
1966
1972
|
content: {
|
|
1967
1973
|
RCS: {
|
|
1968
1974
|
rcsContent: {
|
|
1975
|
+
...(rcsAccount && !isFullMode && { accountId: rcsAccount }),
|
|
1969
1976
|
cardType: STANDALONE,
|
|
1970
1977
|
cardSettings: {
|
|
1971
1978
|
cardOrientation: isMediaTypeImage ? RCS_IMAGE_DIMENSIONS[selectedDimension]?.orientation || VERTICAL : RCS_VIDEO_THUMBNAIL_DIMENSIONS[selectedDimension]?.orientation || VERTICAL,
|