@capillarytech/creatives-library 7.0.6 → 7.0.8
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 +1 -1
- package/v2Components/FormBuilder/index.js +4 -5
- package/v2Components/TemplatePreview/index.js +7 -3
- package/v2Containers/CreativesContainer/index.js +5 -4
- package/v2Containers/MobilePush/Create/sagas.js +4 -1
- package/v2Containers/Templates/_templates.scss +2 -2
- package/v2Containers/Viber/index.js +3 -2
- package/v2Containers/Viber/messages.js +4 -0
package/package.json
CHANGED
|
@@ -122,14 +122,13 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
122
122
|
}
|
|
123
123
|
if (nextProps.startValidation && nextProps.startValidation !== false && this.props.startValidation !== nextProps.startValidation) {
|
|
124
124
|
this.setState({checkValidation: true});
|
|
125
|
-
this.validateForm(null, null, true, true
|
|
125
|
+
this.validateForm(null, null, true, true);
|
|
126
126
|
//triggering the saveFormData or onSubmit when validation sets isFormValid to TRUE
|
|
127
|
-
|
|
127
|
+
if (this.state.isFormValid) {
|
|
128
128
|
this.saveForm(true);
|
|
129
|
-
|
|
129
|
+
this.setState({isFormValid:false});
|
|
130
|
+
}
|
|
130
131
|
this.props.stopValidation();
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
132
|
}
|
|
134
133
|
// if (nextProps.saveForm && this.props.saveForm !== nextProps.saveForm) {
|
|
135
134
|
// this.saveForm(saveForm);
|
|
@@ -184,7 +184,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
184
184
|
"padding": '3.5px 0 0',
|
|
185
185
|
'border-radius': '8px',
|
|
186
186
|
'background-color': CAP_G15,
|
|
187
|
-
'width': '
|
|
187
|
+
'width': '81%',
|
|
188
188
|
};
|
|
189
189
|
const getVideoContent = ({
|
|
190
190
|
video,
|
|
@@ -614,13 +614,17 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
614
614
|
'background-color': CAP_PURPLE01,
|
|
615
615
|
"margin-top": '14px',
|
|
616
616
|
'text-align': 'center',
|
|
617
|
-
"width": '
|
|
617
|
+
"width": '140px',
|
|
618
618
|
"height": '20px',
|
|
619
|
-
"margin-left": "
|
|
619
|
+
"margin-left": "2px",
|
|
620
620
|
}}>
|
|
621
621
|
<p
|
|
622
622
|
style={{ 'font-size': '12px',
|
|
623
623
|
'font-weight': '500',
|
|
624
|
+
"display": '-webkit-box',
|
|
625
|
+
'-webkit-line-clamp': '1',
|
|
626
|
+
'-webkit-box-orient': 'vertical',
|
|
627
|
+
'overflow': 'hidden',
|
|
624
628
|
"color": CAP_WHITE }}
|
|
625
629
|
>
|
|
626
630
|
{buttonText || ''}</p>
|
|
@@ -351,10 +351,11 @@ class Creatives extends React.Component {
|
|
|
351
351
|
break;
|
|
352
352
|
case constants.VIBER:
|
|
353
353
|
if (template.value) {
|
|
354
|
-
const { Templates
|
|
354
|
+
const { Templates, templateData: templateDataProps } = this.props;
|
|
355
|
+
const { accountDetails: selectedAccountDetails, accountId: selectedAccountId } = templateDataProps || {};
|
|
355
356
|
const selectedViberAccount = Templates && Templates.selectedViberAccount;
|
|
356
|
-
const accountDetails = selectedViberAccount ? JSON.stringify(selectedViberAccount) : '';
|
|
357
|
-
const accountId = selectedViberAccount ? selectedViberAccount.id : '';
|
|
357
|
+
const accountDetails = selectedAccountDetails || (selectedViberAccount ? JSON.stringify(selectedViberAccount) : '');
|
|
358
|
+
const accountId = selectedAccountId || (selectedViberAccount ? selectedViberAccount.id : '');
|
|
358
359
|
const { versions } = template.value;
|
|
359
360
|
const content = cloneDeep(versions.base.content);
|
|
360
361
|
content.scenarioKey = get(accountDetails, 'configs.scenario_key');
|
|
@@ -709,4 +710,4 @@ function mapDispatchToProps(dispatch) {
|
|
|
709
710
|
actions: bindActionCreators(actions, dispatch),
|
|
710
711
|
};
|
|
711
712
|
}
|
|
712
|
-
export default connect(mapStatesToProps, mapDispatchToProps)(injectIntl(Creatives));
|
|
713
|
+
export default connect(mapStatesToProps, mapDispatchToProps)(injectIntl(Creatives));
|
|
@@ -11,8 +11,11 @@ export function* createTemplate(template) {
|
|
|
11
11
|
try {
|
|
12
12
|
console.log('saga createTemplate mobilepush', template);
|
|
13
13
|
const result = yield call(Api.createMobilePushTemplate, template);
|
|
14
|
-
if (result.message
|
|
14
|
+
if (result.message) {
|
|
15
15
|
errorMsg = result.message;
|
|
16
|
+
if(result.status.code>=400){
|
|
17
|
+
throw errorMsg;
|
|
18
|
+
}
|
|
16
19
|
}
|
|
17
20
|
if (template.callback) {
|
|
18
21
|
yield call(template.callback, result.response);
|
|
@@ -516,6 +516,7 @@ const Viber = (props) => {
|
|
|
516
516
|
defaultValue={buttonText}
|
|
517
517
|
value={buttonText}
|
|
518
518
|
style={{paddingBottom: '11px'}}
|
|
519
|
+
maxLength={20}
|
|
519
520
|
/>
|
|
520
521
|
<CapInput
|
|
521
522
|
id="viber-button-url"
|
|
@@ -563,7 +564,7 @@ const Viber = (props) => {
|
|
|
563
564
|
const createCallback = (errorMessage, isEdit) => {
|
|
564
565
|
if (!errorMessage) {
|
|
565
566
|
CapNotification.success({
|
|
566
|
-
message: formatMessage(messages.viberCreateNotification),
|
|
567
|
+
message: isEdit ? formatMessage(messages.viberEditNotification) : formatMessage(messages.viberCreateNotification),
|
|
567
568
|
});
|
|
568
569
|
if (isEdit) {
|
|
569
570
|
actions.clearEditResponse();
|
|
@@ -626,7 +627,7 @@ const Viber = (props) => {
|
|
|
626
627
|
return true;
|
|
627
628
|
}
|
|
628
629
|
// if button is being added than button url and button Text both are mandatory
|
|
629
|
-
if (( trimedButtonText === '' && trimedButtonUrl !== '') || (
|
|
630
|
+
if (( trimedButtonText === '' && trimedButtonUrl !== '') || ( trimedButtonText !== '' && trimedButtonUrl === '')) {
|
|
630
631
|
return true;
|
|
631
632
|
}
|
|
632
633
|
// if button url is not valid url
|
|
@@ -118,6 +118,10 @@ export default defineMessages({
|
|
|
118
118
|
id: `${scope}.viberCreateNotification`,
|
|
119
119
|
defaultMessage: 'Viber template created successfully',
|
|
120
120
|
},
|
|
121
|
+
viberEditNotification: {
|
|
122
|
+
id: `${scope}.viberEditNotification`,
|
|
123
|
+
defaultMessage: 'Viber template updated successfully',
|
|
124
|
+
},
|
|
121
125
|
textMessageTitlePlaceholder: {
|
|
122
126
|
id: `${scope}.textMessageTitlePlaceholder`,
|
|
123
127
|
defaultMessage: 'Enter template name',
|