@capillarytech/creatives-library 7.17.23 → 7.17.24
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/containers/App/constants.js +4 -0
- package/package.json +1 -1
- package/utils/common.js +13 -9
|
@@ -6,6 +6,10 @@ export const STORE2DOOR_PLUS_ENABLED = 'STORE2DOOR_PLUS_ENABLED';
|
|
|
6
6
|
export const TRAI_DLT = 'TRAI_DLT';
|
|
7
7
|
export const CARD_BASED_SCOPE = 'CARD_BASED_SCOPE';
|
|
8
8
|
export const HOSPITALITY_BASED_SCOPE = 'HOSPITALITY_BASED_SCOPE';
|
|
9
|
+
export const REGISTRATION_CUSTOM_FIELD = 'Registration custom fields';
|
|
10
|
+
export const CUSTOM_TAG = 'CustomTagMessage';
|
|
11
|
+
export const CUSTOMER_EXTENDED_FIELD = 'Customer extended fields';
|
|
12
|
+
export const EXTENDED_TAG = 'ExtendedTagMessage';
|
|
9
13
|
|
|
10
14
|
export const CARD_RELATED_TAGS = [
|
|
11
15
|
'card_series',
|
package/package.json
CHANGED
package/utils/common.js
CHANGED
|
@@ -7,6 +7,10 @@ import {
|
|
|
7
7
|
CARD_BASED_SCOPE,
|
|
8
8
|
HOSPITALITY_RELATED_TAGS,
|
|
9
9
|
HOSPITALITY_BASED_SCOPE,
|
|
10
|
+
EXTENDED_TAG,
|
|
11
|
+
CUSTOMER_EXTENDED_FIELD,
|
|
12
|
+
CUSTOM_TAG,
|
|
13
|
+
REGISTRATION_CUSTOM_FIELD
|
|
10
14
|
} from '../containers/App/constants';
|
|
11
15
|
import { apiMessageFormatHandler } from './commonUtils';
|
|
12
16
|
|
|
@@ -283,16 +287,16 @@ export const intlKeyGenerator = (value = "") => {
|
|
|
283
287
|
};
|
|
284
288
|
|
|
285
289
|
export const handleInjectedData = (data, scope) => {
|
|
286
|
-
|
|
290
|
+
const temp = _.cloneDeep(data);
|
|
287
291
|
let tagType;
|
|
288
292
|
for (const tagKey in temp) {
|
|
289
293
|
if (temp.hasOwnProperty(tagKey)) {
|
|
290
294
|
const tag = temp[tagKey];
|
|
291
295
|
|
|
292
|
-
if (tag?.name ===
|
|
293
|
-
tagType =
|
|
294
|
-
} else if (tag?.name ===
|
|
295
|
-
tagType =
|
|
296
|
+
if (tag?.name === REGISTRATION_CUSTOM_FIELD) {
|
|
297
|
+
tagType = CUSTOM_TAG;
|
|
298
|
+
} else if (tag?.name === CUSTOMER_EXTENDED_FIELD) {
|
|
299
|
+
tagType = EXTENDED_TAG;
|
|
296
300
|
}
|
|
297
301
|
|
|
298
302
|
if (tag?.name) {
|
|
@@ -305,8 +309,8 @@ export const handleInjectedData = (data, scope) => {
|
|
|
305
309
|
tag["name"] = apiMessageFormatHandler(id, name);
|
|
306
310
|
}
|
|
307
311
|
|
|
308
|
-
if (tag
|
|
309
|
-
for (const subtagKey in tag
|
|
312
|
+
if (tag?.subtags) {
|
|
313
|
+
for (const subtagKey in tag.subtags) {
|
|
310
314
|
if (tag["subtags"].hasOwnProperty(subtagKey)) {
|
|
311
315
|
const subtag = tag["subtags"][subtagKey];
|
|
312
316
|
if (subtag?.name) {
|
|
@@ -330,8 +334,8 @@ export const handleInjectedData = (data, scope) => {
|
|
|
330
334
|
}
|
|
331
335
|
}
|
|
332
336
|
}
|
|
333
|
-
tagType="";
|
|
337
|
+
tagType = "";
|
|
334
338
|
}
|
|
335
339
|
}
|
|
336
340
|
return temp;
|
|
337
|
-
};
|
|
341
|
+
};
|