@capillarytech/creatives-library 7.10.0 → 7.10.2
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 +9 -0
- package/package.json +1 -1
- package/utils/common.js +6 -4
- package/v2Components/CapTagList/index.js +8 -2
- package/v2Containers/Cap/constants.js +1 -0
- package/v2Containers/Cap/reducer.js +3 -0
- package/v2Containers/Cap/selectors.js +1 -0
- package/v2Containers/SmsTrai/Create/index.js +2 -4
- package/v2Containers/SmsTrai/Create/messages.js +1 -1
|
@@ -4,3 +4,12 @@ export const GET_SIDEBAR_FAILURE = 'app/App/GET_SIDEBAR_FAILURE';
|
|
|
4
4
|
|
|
5
5
|
export const STORE2DOOR_PLUS_ENABLED = 'STORE2DOOR_PLUS_ENABLED';
|
|
6
6
|
export const TRAI_DLT = 'TRAI_DLT';
|
|
7
|
+
|
|
8
|
+
export const CARD_RELATED_TAGS = [
|
|
9
|
+
'card_series',
|
|
10
|
+
'card_number',
|
|
11
|
+
'card_issue_date',
|
|
12
|
+
'card_status',
|
|
13
|
+
'card_series_name',
|
|
14
|
+
'card_name',
|
|
15
|
+
];
|
package/package.json
CHANGED
package/utils/common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import { Auth } from '@capillarytech/cap-ui-utils';
|
|
3
|
-
import { STORE2DOOR_PLUS_ENABLED, TRAI_DLT } from '../containers/App/constants';
|
|
3
|
+
import { STORE2DOOR_PLUS_ENABLED, TRAI_DLT, CARD_RELATED_TAGS } from '../containers/App/constants';
|
|
4
4
|
|
|
5
5
|
export function getUserNameById(userId, allUserList) {
|
|
6
6
|
let userName = "";
|
|
@@ -46,10 +46,12 @@ export const hasTraiDltFeature = Auth.hasFeatureAccess.bind(
|
|
|
46
46
|
export function getTreeStructuredTags({tagsList, userLocale = 'en', offerDetails = [], disableTagsDetails = {}}) {
|
|
47
47
|
console.log('populating tags', (tagsList || []).length);
|
|
48
48
|
const mainTags = {};
|
|
49
|
-
const { disableRelatedTags, childTagsToDisable, parentTagstoDisable} = disableTagsDetails;
|
|
49
|
+
const { disableRelatedTags, childTagsToDisable, parentTagstoDisable, showCardsRelatedTags} = disableTagsDetails;
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
const clonedTags = _.filter(tagsList, (tag) =>
|
|
52
|
+
!CARD_RELATED_TAGS.includes(tag?.definition?.value)
|
|
53
|
+
);
|
|
54
|
+
_.forEach(clonedTags, (temp) => {
|
|
53
55
|
const tag = temp.definition;
|
|
54
56
|
if (!tag['tag-header']) { //if tag doesn't have subtag(s), which means this tag itself is tag and not a tag header.
|
|
55
57
|
mainTags[tag.value] = {
|
|
@@ -15,9 +15,11 @@ import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
|
|
|
15
15
|
import { createStructuredSelector } from 'reselect';
|
|
16
16
|
import messages from './messages';
|
|
17
17
|
import { makeSelectLoyaltyPromotionDisplay } from '../../v2Containers/Cap/selectors';
|
|
18
|
+
import { CARD_RELATED_TAGS } from '../../containers/App/constants';
|
|
18
19
|
|
|
19
20
|
const {Search} = CapInput;
|
|
20
21
|
const {CapTreeNode} = CapTree;
|
|
22
|
+
|
|
21
23
|
class CapTagList extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
22
24
|
constructor(props) {
|
|
23
25
|
super(props);
|
|
@@ -133,10 +135,14 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
133
135
|
};
|
|
134
136
|
|
|
135
137
|
renderTags(tags, searchString = '') {
|
|
136
|
-
const { disableRelatedTags, childTagsToDisable, parentTagstoDisable} = this.props.disableTagsDetails;
|
|
138
|
+
const { disableRelatedTags, childTagsToDisable, parentTagstoDisable, showCardsRelatedTags} = this.props.disableTagsDetails;
|
|
137
139
|
const list = [];
|
|
138
140
|
const loyaltyAttrDisableText = <FormattedMessage {...messages.loyaltyAttributeDisable} />;
|
|
139
|
-
_.
|
|
141
|
+
let clonedTags = _.cloneDeep(tags);
|
|
142
|
+
if (!showCardsRelatedTags) {
|
|
143
|
+
clonedTags = _.omit(clonedTags, CARD_RELATED_TAGS);
|
|
144
|
+
}
|
|
145
|
+
_.forEach(clonedTags, (val = '', key) => {
|
|
140
146
|
let supportedTagsString = '';
|
|
141
147
|
_.forEach(val.supportedTags, (supportedTag) => {
|
|
142
148
|
supportedTagsString += `${supportedTag} ,`;
|
|
@@ -29,6 +29,7 @@ export const GET_TOPBAR_MENU_DATA_FAILURE = 'creatives/cap/GET_TOPBAR_MENU_DATA_
|
|
|
29
29
|
export const CLEAR_TOPBAR_MENU_DATA = 'creatives/cap/CLEAR_TOPBAR_MENU_DATA';
|
|
30
30
|
|
|
31
31
|
export const SET_LOYALTY_PROMOTION_RELATED_CREATIVE_TAGS_DISPLAY = 'SET_LOYALTY_PROMOTION_RELATED_CREATIVE_TAGS_DISPLAY';
|
|
32
|
+
export const SET_CARD_RELATED_TAGS_VISIBILITY = 'SET_CARD_RELATED_TAGS_VISIBILITY';
|
|
32
33
|
|
|
33
34
|
export const CAMPAIGN_SETTINGS_URL = '/creatives/settings/message';
|
|
34
35
|
export const ORG_SETTINGS_URL = '/org/index';
|
|
@@ -121,6 +121,9 @@ function capReducer(state = fromJS(initialState.cap), action) {
|
|
|
121
121
|
.set('tagsToDisable', action.tagsToDisable)
|
|
122
122
|
.set('parentTagsToDisable', action.parentTagsToDisable);
|
|
123
123
|
}
|
|
124
|
+
case types.SET_CARD_RELATED_TAGS_VISIBILITY: {
|
|
125
|
+
return state.set('showCardsRelatedTags', action.showCardsRelatedTags);
|
|
126
|
+
}
|
|
124
127
|
default:
|
|
125
128
|
return state;
|
|
126
129
|
}
|
|
@@ -79,6 +79,7 @@ const makeSelectLoyaltyPromotionDisplay = () => createSelector(
|
|
|
79
79
|
disableRelatedTags: globalState.get('disableLoyaltyPromotionRelatedTags'),
|
|
80
80
|
childTagsToDisable: globalState.get('tagsToDisable') || [],
|
|
81
81
|
parentTagstoDisable: globalState.get('parentTagsToDisable') || [],
|
|
82
|
+
showCardsRelatedTags: globalState.get('showCardsRelatedTags') || false,
|
|
82
83
|
}),
|
|
83
84
|
);
|
|
84
85
|
|
|
@@ -126,7 +126,7 @@ export const SmsTraiCreate = (props) => {
|
|
|
126
126
|
`${selectedHeaderAlias.toUpperCase()} is mandatory and each ${selectedHeaderAlias.toUpperCase()} must contain either 6 letters or 6 numbers. It cannot contain special characters`,
|
|
127
127
|
);
|
|
128
128
|
} else if (index === approvalIndex && cell.toLowerCase() !== APPROVED) {
|
|
129
|
-
approvalErrorArray.push(`
|
|
129
|
+
approvalErrorArray.push(`Templates will be created for only approved/ registered templates.`);
|
|
130
130
|
} else if (!cell && index !== headerIndex && index !== approvalIndex) {
|
|
131
131
|
errorArray.push(`"${transformedResults[0][index]}"`);
|
|
132
132
|
}
|
|
@@ -361,9 +361,7 @@ export const SmsTraiCreate = (props) => {
|
|
|
361
361
|
tempArray.push(fileData[row]);
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
tempArray = tempArray.map((row) =>
|
|
365
|
-
return row.map((cell) => cell.replace(',', ' '));
|
|
366
|
-
});
|
|
364
|
+
tempArray = tempArray.map((row) => row.map((cell) => cell.replace(',', ' ')));
|
|
367
365
|
csvContent = tempArray
|
|
368
366
|
.map((e) => e.join(','))
|
|
369
367
|
.map((e) => e.replace(/(\r\n|\n|\r)/gm, ' '))
|
|
@@ -54,7 +54,7 @@ export default defineMessages({
|
|
|
54
54
|
},
|
|
55
55
|
fileMinlengthError: {
|
|
56
56
|
id: `${prefix}.fileMinlengthError`,
|
|
57
|
-
defaultMessage: 'Please select a
|
|
57
|
+
defaultMessage: 'Please select a CSV file with minimum 1 row of data and 1 row of headers',
|
|
58
58
|
},
|
|
59
59
|
fileMaxlengthError: {
|
|
60
60
|
id: `${prefix}.fileMaxlengthError`,
|