@capillarytech/creatives-library 8.0.202 → 8.0.205
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
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export const OUTBOUND = 'OUTBOUND';
|
|
2
|
+
export const ADD_LANGUAGE = 'addLanguage';
|
|
3
|
+
export const UPLOAD = 'upload';
|
|
4
|
+
export const USE_EDITOR = 'useEditor';
|
|
5
|
+
export const COPY_PRIMARY_LANGUAGE = 'copyPrimaryLanguage';
|
|
2
6
|
export const GLOBAL_CONVERT_OPTIONS = {
|
|
3
7
|
selectors: [
|
|
4
8
|
...[1, 2, 3, 4, 5, 6].map(level => ({
|
|
@@ -54,7 +54,7 @@ import { containsBase64Images } from '../../utils/content';
|
|
|
54
54
|
import { SMS, MOBILE_PUSH, LINE, ENABLE_AI_SUGGESTIONS,AI_CONTENT_BOT_DISABLED, EMAIL, LIQUID_SUPPORTED_CHANNELS, INAPP } from '../../v2Containers/CreativesContainer/constants';
|
|
55
55
|
import globalMessages from '../../v2Containers/Cap/messages';
|
|
56
56
|
import { convert } from 'html-to-text';
|
|
57
|
-
import { OUTBOUND } from './constants';
|
|
57
|
+
import { OUTBOUND, ADD_LANGUAGE, UPLOAD, USE_EDITOR, COPY_PRIMARY_LANGUAGE } from './constants';
|
|
58
58
|
import { GET_TRANSLATION_MAPPED } from '../../constants/unified';
|
|
59
59
|
import moment from 'moment';
|
|
60
60
|
import { CUSTOMER_BARCODE_TAG , COPY_OF, ENTRY_TRIGGER_TAG_REGEX} from '../../constants/unified';
|
|
@@ -186,7 +186,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
186
186
|
|
|
187
187
|
if (this.state.usingTabContainer && !val.standalone) {
|
|
188
188
|
const data1 = data;
|
|
189
|
-
if (event ===
|
|
189
|
+
if (event === ADD_LANGUAGE) {
|
|
190
190
|
const addLanguageType = this.props.addLanguageType;
|
|
191
191
|
if (addLanguageType === '') {
|
|
192
192
|
return;
|
|
@@ -195,7 +195,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
195
195
|
let baseTab;
|
|
196
196
|
|
|
197
197
|
switch (addLanguageType) {
|
|
198
|
-
case
|
|
198
|
+
case UPLOAD:
|
|
199
199
|
baseTab = _.cloneDeep(formData[tabIndex][currentLang]);
|
|
200
200
|
|
|
201
201
|
baseTab.iso_code = data.iso_code;
|
|
@@ -207,8 +207,8 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
207
207
|
formData[tabIndex].activeTab = data.iso_code;
|
|
208
208
|
formData[tabIndex].tabKey = baseTab.tabKey;
|
|
209
209
|
break;
|
|
210
|
-
case
|
|
211
|
-
case
|
|
210
|
+
case COPY_PRIMARY_LANGUAGE:
|
|
211
|
+
case USE_EDITOR:
|
|
212
212
|
baseTab = _.cloneDeep(formData[tabIndex][this.props.baseLanguage]);
|
|
213
213
|
|
|
214
214
|
baseTab.iso_code = data.iso_code;
|
|
@@ -234,7 +234,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
234
234
|
|
|
235
235
|
if (!this.props.isNewVersionFlow) {
|
|
236
236
|
formData[tabIndex][val.id] = data1;
|
|
237
|
-
} else if (this.props.isNewVersionFlow && event !==
|
|
237
|
+
} else if (this.props.isNewVersionFlow && event !== ADD_LANGUAGE && event !== "onContentChange") {
|
|
238
238
|
formData[tabIndex][this.props.baseLanguage][val.id] = data1;
|
|
239
239
|
}
|
|
240
240
|
|
|
@@ -285,7 +285,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
285
285
|
if (event === "onRowClick") {
|
|
286
286
|
val.injectedEvents[event].call(this, data);
|
|
287
287
|
} else if (this.props.isNewVersionFlow && event !== 'onSelect') {
|
|
288
|
-
if (event ===
|
|
288
|
+
if (event === ADD_LANGUAGE) {
|
|
289
289
|
val.injectedEvents[event].call(this, data, formData, val);
|
|
290
290
|
this.setState({currentEventVal: {}, currentEvent: {}, currentEventData: {}});
|
|
291
291
|
} else {
|
|
@@ -589,7 +589,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
589
589
|
const event = this.state.currentEvent;
|
|
590
590
|
if (!_.isEmpty(this.state.currentEvent)) {
|
|
591
591
|
switch (event) {
|
|
592
|
-
case
|
|
592
|
+
case ADD_LANGUAGE:
|
|
593
593
|
this.updateFormData(this.state.currentEventData, this.state.currentEventVal, this.state.currentEvent);
|
|
594
594
|
break;
|
|
595
595
|
default:
|
|
@@ -2278,7 +2278,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2278
2278
|
|
|
2279
2279
|
if (this.state.usingTabContainer && !val.standalone) {
|
|
2280
2280
|
const data1 = data;
|
|
2281
|
-
if (event ===
|
|
2281
|
+
if (event === ADD_LANGUAGE) {
|
|
2282
2282
|
const addLanguageType = this.props.addLanguageType;
|
|
2283
2283
|
if (addLanguageType === '') {
|
|
2284
2284
|
return;
|
|
@@ -2361,7 +2361,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2361
2361
|
|
|
2362
2362
|
if (!this.props.isNewVersionFlow) {
|
|
2363
2363
|
formData[tabIndex][val.id] = data1;
|
|
2364
|
-
} else if (this.props.isNewVersionFlow && event !==
|
|
2364
|
+
} else if (this.props.isNewVersionFlow && event !== ADD_LANGUAGE && event !== "onContentChange") {
|
|
2365
2365
|
formData[tabIndex][this.props.baseLanguage][val.id] = data1;
|
|
2366
2366
|
}
|
|
2367
2367
|
|
|
@@ -2408,7 +2408,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2408
2408
|
if (event === "onRowClick") {
|
|
2409
2409
|
val.injectedEvents[event].call(this, data);
|
|
2410
2410
|
} else if (this.props.isNewVersionFlow && event !== 'onSelect') {
|
|
2411
|
-
if (event ===
|
|
2411
|
+
if (event === ADD_LANGUAGE) {
|
|
2412
2412
|
val.injectedEvents[event].call(this, data, formData, val);
|
|
2413
2413
|
this.setState({currentEventVal: {}, currentEvent: {}, currentEventData: {}});
|
|
2414
2414
|
} else {
|
|
@@ -4041,7 +4041,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
4041
4041
|
id={val.id}
|
|
4042
4042
|
popOverList={this.props.supportedLanguages}
|
|
4043
4043
|
excludeList={this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages}
|
|
4044
|
-
handlePopOverClick={(data) => this.handleAddLanguageFlow(data, val,
|
|
4044
|
+
handlePopOverClick={(data) => this.handleAddLanguageFlow(data, val, ADD_LANGUAGE)}
|
|
4045
4045
|
visible={this.state.customPopoverVisible}
|
|
4046
4046
|
onVisibleChange={this.handleCustomPopoverVisibleChange}
|
|
4047
4047
|
/>
|
|
@@ -2516,7 +2516,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2516
2516
|
});
|
|
2517
2517
|
obj.versions.history.push(newdata);
|
|
2518
2518
|
}
|
|
2519
|
-
if (index === "template-subject") {
|
|
2519
|
+
if (index === "template-subject" && obj?.versions?.history?.[0]) {
|
|
2520
2520
|
obj.versions.history[0].subject = newdata;
|
|
2521
2521
|
}
|
|
2522
2522
|
});
|