@capillarytech/creatives-library 6.9.7 → 6.9.9
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/TagList/index.js +2 -3
- package/package.json +1 -1
- package/v2Components/BeeEditor/index.js +18 -10
- package/v2Components/BeeEditor/messages.js +24 -0
- package/v2Components/FormBuilder/index.js +1 -2
- package/v2Containers/App/constants.js +1 -0
- package/v2Containers/Email/index.js +10 -10
- package/v2Containers/Line/Container/ImageCarousel/Content.js +2 -2
- package/v2Containers/Line/Container/ImageCarousel/constants.js +1 -1
- package/v2Containers/Line/Container/ImageCarousel/index.js +6 -3
- package/v2Containers/Line/Container/_lineCreate.scss +6 -0
- package/v2Containers/TagList/index.js +7 -6
|
@@ -71,10 +71,9 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
71
71
|
//Form tags object with tag headers
|
|
72
72
|
_.forEach(tagsList, (temp) => {
|
|
73
73
|
const tag = temp.definition;
|
|
74
|
-
const userLocale = this.props.userLocale;
|
|
75
74
|
if (!tag['tag-header']) {
|
|
76
75
|
mainTags[tag.value] = {
|
|
77
|
-
name: tag.label[userLocale] ? tag.label[userLocale] : tag.label.en,
|
|
76
|
+
name: tag.label[this.props.userLocale] ? tag.label[this.props.userLocale] : tag.label.en,
|
|
78
77
|
desc: tag.desc ? tag.desc : tag.label.en,
|
|
79
78
|
};
|
|
80
79
|
} else if (tag['tag-header'] && mainTags[tag.value]) {
|
|
@@ -83,7 +82,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
83
82
|
console.log('Inside ', tag.label);
|
|
84
83
|
mainTags[tag.value] = {
|
|
85
84
|
'tag-header': true,
|
|
86
|
-
"name": tag.label[userLocale] ? tag.label[userLocale] : tag.label.en,
|
|
85
|
+
"name": tag.label[this.props.userLocale] ? tag.label[this.props.userLocale] : tag.label.en,
|
|
87
86
|
"desc": tag.desc ? tag.desc : tag.label.en,
|
|
88
87
|
"subtags": tag.subtags,
|
|
89
88
|
};
|
package/package.json
CHANGED
|
@@ -40,7 +40,12 @@ function BeeEditor(props) {
|
|
|
40
40
|
const {formatMessage} = intl;
|
|
41
41
|
const UNSUBSCRIBE = 'unsubscribe';
|
|
42
42
|
let beePluginInstance = null;
|
|
43
|
-
const categoryOptions = [
|
|
43
|
+
const categoryOptions = [{key: 'cta', value: 'cta', label: formatMessage(messages.cta)},
|
|
44
|
+
{key: 'footer', value: 'footer', label: formatMessage(messages.footer)},
|
|
45
|
+
{key: 'header', value: 'header', label: formatMessage(messages.header)},
|
|
46
|
+
{key: 'sp', value: 'sp', label: formatMessage(messages.socialPlatform)},
|
|
47
|
+
{key: 'others', value: 'others', label: formatMessage(messages.others)},
|
|
48
|
+
];
|
|
44
49
|
const [visibleTaglist, setVisibleTaglist] = useState(false);
|
|
45
50
|
const [showRowMetaModal, setRowMetaModal] = useState(false);
|
|
46
51
|
const [selectedTag, setSelectedTag] = useState({});
|
|
@@ -77,16 +82,21 @@ function BeeEditor(props) {
|
|
|
77
82
|
},
|
|
78
83
|
},
|
|
79
84
|
mergeTags: {
|
|
80
|
-
label:
|
|
85
|
+
label: formatMessage(messages.addLabel),
|
|
81
86
|
handler: async (resolve, reject) => {
|
|
87
|
+
// this will open tag modal
|
|
82
88
|
await setVisibleTaglist(true);
|
|
89
|
+
// until tag modal will not open promise will not execute
|
|
90
|
+
// once tag modal is opened it will start 2 sec interval to wait use has selected any tag or cancel the tag selection
|
|
83
91
|
const promise = new Promise((resolveP) => {
|
|
84
92
|
intervalTimer = setInterval(() => {
|
|
93
|
+
// this will execute, if user cancel the tag selection
|
|
85
94
|
if ((savedCallback.current || {}).close === true) {
|
|
86
95
|
reject();
|
|
87
96
|
clearInterval(intervalTimer);
|
|
88
97
|
return;
|
|
89
98
|
}
|
|
99
|
+
// this block is checking use has selected any tag or not
|
|
90
100
|
if (Object.keys(savedCallback.current || {}).length > 0) {
|
|
91
101
|
resolveP(savedCallback.current);
|
|
92
102
|
setSelectedTag({});
|
|
@@ -94,8 +104,9 @@ function BeeEditor(props) {
|
|
|
94
104
|
}
|
|
95
105
|
}, 2000);
|
|
96
106
|
});
|
|
107
|
+
// once prmise will resolve , pass the resolve data to handler to show tags in bee edior
|
|
97
108
|
const result = await promise;
|
|
98
|
-
resolve(result);
|
|
109
|
+
resolve(result);
|
|
99
110
|
},
|
|
100
111
|
},
|
|
101
112
|
saveRow: {
|
|
@@ -131,9 +142,9 @@ function BeeEditor(props) {
|
|
|
131
142
|
onSave: (jsonFile, htmlFile) => {
|
|
132
143
|
saveBeeData(jsonFile, htmlFile);
|
|
133
144
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
console.log('bee-plugin-container onSaveRows',
|
|
145
|
+
// will use this function on save row feature
|
|
146
|
+
onSaveRow: (rowJSON, rowHTML, pageJSON) => {
|
|
147
|
+
console.log('bee-plugin-container onSaveRows', rowJSON, rowHTML, pageJSON);
|
|
137
148
|
},
|
|
138
149
|
};
|
|
139
150
|
window.BeePlugin.create(tokenData, beeConfig, (instance) => {
|
|
@@ -183,15 +194,12 @@ function BeeEditor(props) {
|
|
|
183
194
|
const onRowChange = useCallback((e) => {
|
|
184
195
|
setRowName(e.target.value);
|
|
185
196
|
});
|
|
186
|
-
// will use this function on save row feature
|
|
187
197
|
const onChangeCategoy = (e) => {
|
|
188
|
-
|
|
198
|
+
setRowCategory(e);
|
|
189
199
|
};
|
|
190
|
-
|
|
191
200
|
const onTagChange = (e) => {
|
|
192
201
|
setRowTags(e.target.value);
|
|
193
202
|
};
|
|
194
|
-
|
|
195
203
|
const contentSection = <>
|
|
196
204
|
<CapInput
|
|
197
205
|
label={<FormattedMessage {...messages.rowName} />}
|
|
@@ -44,4 +44,28 @@ export default defineMessages({
|
|
|
44
44
|
id: `${prefix}.tagPlaceHolder`,
|
|
45
45
|
defaultMessage: 'Enter tags',
|
|
46
46
|
},
|
|
47
|
+
addLabel: {
|
|
48
|
+
id: `${prefix}.addLabel`,
|
|
49
|
+
defaultMessage: 'Add label',
|
|
50
|
+
},
|
|
51
|
+
cta: {
|
|
52
|
+
id: `${prefix}.cta`,
|
|
53
|
+
defaultMessage: 'CTA',
|
|
54
|
+
},
|
|
55
|
+
header: {
|
|
56
|
+
id: `${prefix}.header`,
|
|
57
|
+
defaultMessage: 'Header',
|
|
58
|
+
},
|
|
59
|
+
footer: {
|
|
60
|
+
id: `${prefix}.footer`,
|
|
61
|
+
defaultMessage: 'Footer',
|
|
62
|
+
},
|
|
63
|
+
others: {
|
|
64
|
+
id: `${prefix}.others`,
|
|
65
|
+
defaultMessage: 'Others',
|
|
66
|
+
},
|
|
67
|
+
socialPlatform: {
|
|
68
|
+
id: `${prefix}.socialPlatform`,
|
|
69
|
+
defaultMessage: 'Social platform',
|
|
70
|
+
},
|
|
47
71
|
});
|
|
@@ -3221,7 +3221,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3221
3221
|
if (!beeJson || !beeToken) {
|
|
3222
3222
|
return false;
|
|
3223
3223
|
}
|
|
3224
|
-
console.log('beeJson', beeJson);
|
|
3225
3224
|
let isModuleFilterEnabled = _.get(this.props.location, 'query.type', '') !== 'embedded';
|
|
3226
3225
|
const schemaChannel = _.get(this.props.schema, 'channel', "");
|
|
3227
3226
|
if (schemaChannel === 'EMAIL') {
|
|
@@ -3333,7 +3332,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3333
3332
|
}
|
|
3334
3333
|
|
|
3335
3334
|
});
|
|
3336
|
-
if(!this.props.isEmailLoading && !fields.length) {
|
|
3335
|
+
if(!this.props.isEmailLoading && this.props.schema.channel.toUpperCase() === 'EMAIL' && !fields.length) {
|
|
3337
3336
|
return (
|
|
3338
3337
|
<div style={{ textAlign: 'center' }}>
|
|
3339
3338
|
<CapSpin spinning />
|
|
@@ -31,7 +31,7 @@ import * as creativesContainerActions from '../CreativesContainer/actions';
|
|
|
31
31
|
import withCreatives from '../../hoc/withCreatives';
|
|
32
32
|
import { EMAIL } from '../CreativesContainer/constants';
|
|
33
33
|
import { GA } from '@capillarytech/cap-ui-utils';
|
|
34
|
-
import { TRACK_CREATE_EMAIL, TRACK_EDIT_EMAIL } from '../App/constants';
|
|
34
|
+
import { TRACK_CREATE_EMAIL, TRACK_EDIT_EMAIL, BEE_PLUGIN } from '../App/constants';
|
|
35
35
|
import { FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
36
36
|
const {CapCustomCardList} = CapCustomCard;
|
|
37
37
|
export class Email extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
@@ -189,9 +189,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
189
189
|
this.setState({isDragDrop: true});
|
|
190
190
|
}
|
|
191
191
|
if (this.props.params.id) {
|
|
192
|
-
this.props.actions.getCmsSetting(
|
|
192
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate._id, 'open', undefined, isBEESupport);
|
|
193
193
|
} else if (this.props.location.query.module !== "library" || (this.props.location.query.module === "library" && !this.props.templateData)) {
|
|
194
|
-
this.props.actions.getCmsSetting(
|
|
194
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate._id, 'create', undefined, isBEESupport);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
this.setState({ content: (this.props.Templates.selectedEmailLayout ? this.props.Templates.selectedEmailLayout : ''), formData});
|
|
@@ -706,7 +706,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
706
706
|
if (!isNaN(index)) {
|
|
707
707
|
_.forEach(val.selectedLanguages, (language) => {
|
|
708
708
|
if (val[language].is_drag_drop) {
|
|
709
|
-
that.props.actions.getCmsData(
|
|
709
|
+
that.props.actions.getCmsData(BEE_PLUGIN, id, language);
|
|
710
710
|
}
|
|
711
711
|
});
|
|
712
712
|
}
|
|
@@ -914,7 +914,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
914
914
|
// formData.base.activeTab = language;
|
|
915
915
|
// }
|
|
916
916
|
if (language && editData.versions.base[language].is_drag_drop) {
|
|
917
|
-
this.props.actions.getCmsSetting(
|
|
917
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, editData._id, 'open', language, isBEESupport);
|
|
918
918
|
}
|
|
919
919
|
});
|
|
920
920
|
|
|
@@ -1125,7 +1125,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1125
1125
|
const currentTab = this.state.currentTab - 1;
|
|
1126
1126
|
const baseLanguage = this.props.currentOrgDetails.basic_details.base_language ? this.props.currentOrgDetails.basic_details.base_language : 'en';
|
|
1127
1127
|
if (formData[currentTab][baseLanguage].is_drag_drop) {
|
|
1128
|
-
this.props.actions.getCmsSetting(
|
|
1128
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[currentTab][baseLanguage].drag_drop_id, 'duplicate', baseLanguage, isEdmSupport);
|
|
1129
1129
|
}
|
|
1130
1130
|
});
|
|
1131
1131
|
}
|
|
@@ -1404,7 +1404,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1404
1404
|
if (!id) {
|
|
1405
1405
|
id = _.get(formData, `base[${formData.base.activeTab}].id`, '');
|
|
1406
1406
|
}
|
|
1407
|
-
this.props.actions.getCmsData(
|
|
1407
|
+
this.props.actions.getCmsData(BEE_PLUGIN, id);
|
|
1408
1408
|
if (this.state.mode === 'switchEditor') {
|
|
1409
1409
|
let schema = _.cloneDeep(this.state.schema);
|
|
1410
1410
|
_.forEach(schema.containers, (container, index) => {
|
|
@@ -2129,7 +2129,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2129
2129
|
};
|
|
2130
2130
|
if (templates.drag_drop_id) {
|
|
2131
2131
|
tempData.drag_drop_id = templates.drag_drop_id;
|
|
2132
|
-
this.props.actions.getCmsSetting(
|
|
2132
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, tempData._id, 'open', tempData.iso_code, isEdmSupport);
|
|
2133
2133
|
}
|
|
2134
2134
|
// formData.usingTabContainer = true;
|
|
2135
2135
|
// formData.tabCount = 1;
|
|
@@ -2155,7 +2155,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2155
2155
|
// this.setState({tabKey: ''});
|
|
2156
2156
|
_.forEach(formData[0].selectedLanguages, (language) => {
|
|
2157
2157
|
if (formData[0][language].is_drag_drop) {
|
|
2158
|
-
this.props.actions.getCmsSetting(
|
|
2158
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[0][language].drag_drop_id, 'open', language, isEdmSupport);
|
|
2159
2159
|
}
|
|
2160
2160
|
});
|
|
2161
2161
|
});
|
|
@@ -2493,7 +2493,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2493
2493
|
// let getQuery = '';
|
|
2494
2494
|
const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
|
|
2495
2495
|
|
|
2496
|
-
this.props.actions.getCmsSetting(
|
|
2496
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, data._id, 'create', this.state.formData[this.state.currentTab - 1].activeTab, isEdmSupport);
|
|
2497
2497
|
// this.props.templatesActions.setEdmTemplate(data);
|
|
2498
2498
|
this.toggleEdmEmailTemplateSelection();
|
|
2499
2499
|
// if (type && type.toLowerCase() === 'email') {
|
|
@@ -367,8 +367,8 @@ export const LineImageCarouselContent = ({
|
|
|
367
367
|
|
|
368
368
|
const updateActionLabelError = (value) => {
|
|
369
369
|
if (value.length > MAX_ACTION_LABEL_LENGTH) {
|
|
370
|
-
updateActionLabelErrorMessage(formatMessage(messages.
|
|
371
|
-
return formatMessage(messages.
|
|
370
|
+
updateActionLabelErrorMessage(formatMessage(messages.maxActionLabelErrorMessage));
|
|
371
|
+
return formatMessage(messages.maxActionLabelErrorMessage);
|
|
372
372
|
} else {
|
|
373
373
|
updateActionLabelErrorMessage();
|
|
374
374
|
}
|
|
@@ -12,7 +12,7 @@ import CapTooltip from '@capillarytech/cap-ui-library/CapTooltip';
|
|
|
12
12
|
import CapTooltipWithInfo from '@capillarytech/cap-ui-library/CapTooltipWithInfo';
|
|
13
13
|
import LineDrawer from '../Drawer';
|
|
14
14
|
import style from './style';
|
|
15
|
-
import { CAP_G06, FONT_COLOR_01, FONT_COLOR_02, CAP_SPACE_08, CAP_WHITE } from '@capillarytech/cap-ui-library/styled/variables';
|
|
15
|
+
import { CAP_G06, FONT_COLOR_01, FONT_COLOR_02, CAP_SPACE_08, CAP_WHITE, CAP_SPACE_24, CAP_SPACE_04 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
16
16
|
import withStyles from '../../../../hoc/withStyles';
|
|
17
17
|
|
|
18
18
|
import LineImageCarouselContent from './Content';
|
|
@@ -122,7 +122,7 @@ export const LineImageCarousel = (props) => {
|
|
|
122
122
|
}) => {
|
|
123
123
|
isErrorIndex = (isErrorIndex !== undefined)
|
|
124
124
|
? isErrorIndex
|
|
125
|
-
: ((!originalContentUrl || !selectedActionType || actionContentErrorMessage || actionLabelErrorMessage) && activeIndex);
|
|
125
|
+
: ((!originalContentUrl || !selectedActionType || actionContentErrorMessage || actionLabelErrorMessage || !actionContent) && activeIndex);
|
|
126
126
|
columns.push({
|
|
127
127
|
imageUrl: originalContentUrl,
|
|
128
128
|
action: {
|
|
@@ -290,7 +290,10 @@ export const LineImageCarousel = (props) => {
|
|
|
290
290
|
borderRadius: '50%',
|
|
291
291
|
color: CAP_WHITE,
|
|
292
292
|
backgroundColor: !isSelected ? FONT_COLOR_02 : FONT_COLOR_01,
|
|
293
|
-
|
|
293
|
+
height: CAP_SPACE_24,
|
|
294
|
+
width: CAP_SPACE_24,
|
|
295
|
+
textAlign: 'center',
|
|
296
|
+
paddingTop: 4,
|
|
294
297
|
}}
|
|
295
298
|
>
|
|
296
299
|
{index + 1}
|
|
@@ -66,24 +66,25 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
populateTags(tagsList) {
|
|
69
|
-
console.log('populating tags', tagsList);
|
|
69
|
+
console.log('populating tags', (tagsList || []).length);
|
|
70
70
|
const mainTags = {};
|
|
71
71
|
|
|
72
72
|
//Form tags object with tag headers
|
|
73
73
|
_.forEach(tagsList, (temp) => {
|
|
74
74
|
const tag = temp.definition;
|
|
75
|
+
const { userLocale } = this.props;
|
|
75
76
|
if (!tag['tag-header']) {
|
|
76
77
|
mainTags[tag.value] = {
|
|
77
|
-
name: tag.label[
|
|
78
|
+
name: tag.label[userLocale] ? tag.label[userLocale] : tag.label.en,
|
|
78
79
|
desc: tag.desc ? tag.desc : tag.label.en,
|
|
79
80
|
};
|
|
80
81
|
} else if (tag['tag-header'] && mainTags[tag.value]) {
|
|
81
82
|
mainTags[tag.value].subtags = _.concat(mainTags[tag.value].subtags, tag.subtags);
|
|
82
83
|
} else if (!mainTags[tag.value]) {
|
|
83
|
-
console.log('Inside ', tag.label);
|
|
84
|
+
// console.log('Inside ', tag.label);
|
|
84
85
|
mainTags[tag.value] = {
|
|
85
86
|
'tag-header': true,
|
|
86
|
-
"name": tag.label[
|
|
87
|
+
"name": tag.label[userLocale] ? tag.label[userLocale] : tag.label.en,
|
|
87
88
|
"desc": tag.desc ? tag.desc : tag.label.en,
|
|
88
89
|
"subtags": tag.subtags,
|
|
89
90
|
};
|
|
@@ -228,13 +229,13 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
228
229
|
}
|
|
229
230
|
if (this.props.tags && this.props.tags.length > 0) {
|
|
230
231
|
tags = this.populateTags(this.props.tags);
|
|
231
|
-
console.log('populating tags', tags);
|
|
232
|
+
console.log('populating tags', Object.keys(tags || {}).length);
|
|
232
233
|
}
|
|
233
234
|
if (this.props.selectedOfferDetails && !_.isEmpty(this.props.selectedOfferDetails) && (tags && tags.coupon)) {
|
|
234
235
|
this.transformCouponTags(this.props.selectedOfferDetails, tags);
|
|
235
236
|
}
|
|
236
237
|
tags = _.merge( {}, tags, injectedTags);
|
|
237
|
-
console.log('merged tags', tags);
|
|
238
|
+
console.log('merged tags', Object.keys(tags || {}).length);
|
|
238
239
|
return (
|
|
239
240
|
<div className={this.props.className ? this.props.className : ''}>
|
|
240
241
|
<CapTagList
|