@capillarytech/creatives-library 8.0.276 → 8.0.277
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/utils/tests/imageUrlUpload.test.js +298 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +2 -0
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +5 -2
- package/v2Containers/CreativesContainer/index.js +10 -6
- package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +165 -41
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +6 -0
- package/v2Containers/Email/index.js +75 -9
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +9 -4
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +6 -2
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +143 -1
- package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +137 -0
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +7 -3
- package/v2Containers/EmailWrapper/index.js +3 -0
- package/v2Containers/Facebook/Advertisement/index.js +1 -1
- package/v2Containers/Line/Container/_lineCreate.scss +1 -0
- package/v2Containers/Line/Container/style.js +1 -1
- package/v2Containers/MobilePush/Edit/index.js +6 -5
- package/v2Containers/SmsTrai/Create/index.scss +1 -1
- package/v2Containers/SmsTrai/Edit/index.js +9 -3
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +11682 -86
- package/v2Containers/SmsTrai/Edit/tests/index.test.js +5 -0
- package/v2Containers/Viber/index.js +7 -0
- package/v2Containers/Viber/index.scss +4 -1
- package/v2Containers/Viber/style.js +0 -2
|
@@ -167,7 +167,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
167
167
|
};
|
|
168
168
|
this.props.actions.getMobilepushTemplatesList('mobilepush', params);
|
|
169
169
|
}
|
|
170
|
-
if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && _.isEmpty(this.state.fullSchema)) {
|
|
170
|
+
if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && _.isEmpty(this.state.fullSchema) && _.isEmpty(this.state.formData)) {
|
|
171
171
|
this.setState({fullSchema: nextProps.metaEntities.layouts[0].definition, schema: (nextProps.location.query.module === 'loyalty') ? nextProps.metaEntities.layouts[0].definition.textSchema : {}}, () => {
|
|
172
172
|
this.handleEditSchemaOnPropsChange(nextProps, selectedWeChatAccount);
|
|
173
173
|
const templateId = get(this, "props.params.id");
|
|
@@ -388,11 +388,11 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
388
388
|
}
|
|
389
389
|
});
|
|
390
390
|
} else {
|
|
391
|
-
selectedAccount = accounts[0];
|
|
391
|
+
selectedAccount = accounts?.length > 0 ? accounts[0] : {};
|
|
392
392
|
formData['mobilepush-accounts'] = selectedAccount?.id;
|
|
393
393
|
}
|
|
394
394
|
this.props.actions.setWeChatAccount(selectedAccount);
|
|
395
|
-
this.setState({formData, accountsOptions: accounts.map((acc) => ({key: acc.id, label: acc.name, value: acc.id}))});
|
|
395
|
+
this.setState({formData, accountsOptions: accounts?.length > 0 ? accounts.map((acc) => ({key: acc.id, label: acc.name, value: acc.id})) : []});
|
|
396
396
|
};
|
|
397
397
|
|
|
398
398
|
createDefinition = (account) => ({
|
|
@@ -2023,7 +2023,8 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2023
2023
|
<CapSpin spinning={spinning}>
|
|
2024
2024
|
<CapRow>
|
|
2025
2025
|
<CapColumn>
|
|
2026
|
-
|
|
2026
|
+
<FormBuilder
|
|
2027
|
+
key={!_.isEmpty(schema) ? 'has-schema' : 'no-schema'}
|
|
2027
2028
|
channel={MOBILE_PUSH}
|
|
2028
2029
|
schema={schema}
|
|
2029
2030
|
showLiquidErrorInFooter={this.props.showLiquidErrorInFooter}
|
|
@@ -2058,7 +2059,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2058
2059
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
2059
2060
|
isFullMode={this.props.isFullMode}
|
|
2060
2061
|
eventContextTags={this.props?.eventContextTags}
|
|
2061
|
-
/>
|
|
2062
|
+
/>
|
|
2062
2063
|
</CapColumn>
|
|
2063
2064
|
{this.props.iosCtasData && this.state.showIosCtaTable &&
|
|
2064
2065
|
<CapSlideBox
|
|
@@ -106,7 +106,6 @@ export const SmsTraiEdit = (props) => {
|
|
|
106
106
|
padding: ${CAP_SPACE_32} ${CAP_SPACE_24};
|
|
107
107
|
position: fixed;
|
|
108
108
|
bottom: 2rem;
|
|
109
|
-
margin-left: -2rem;
|
|
110
109
|
.ant-btn {
|
|
111
110
|
margin-right: ${CAP_SPACE_16};
|
|
112
111
|
}
|
|
@@ -688,17 +687,24 @@ export const SmsTraiEdit = (props) => {
|
|
|
688
687
|
<CapButton
|
|
689
688
|
onClick={handleTestAndPreview}
|
|
690
689
|
type="secondary"
|
|
691
|
-
className="create-msg
|
|
690
|
+
className="create-msg"
|
|
692
691
|
>
|
|
693
692
|
<FormattedMessage {...messages.testAndPreviewButtonLabel} />
|
|
694
693
|
</CapButton>
|
|
695
694
|
<CapButton
|
|
696
695
|
onClick={isLiquidSupportFeatureEnabled ? onSubmitWrapper : onDoneCallback}
|
|
697
|
-
className="create-msg"
|
|
696
|
+
className="create-msg create-dlt-msg"
|
|
698
697
|
disabled={isTagValidationError || (isLiquidSupportFeatureEnabled && !isObject(metaEntities?.tagLookupMap))}
|
|
699
698
|
>
|
|
700
699
|
<FormattedMessage {...messages.saveButtonLabel} />
|
|
701
700
|
</CapButton>
|
|
701
|
+
<CapButton
|
|
702
|
+
onClick={handleClose}
|
|
703
|
+
className="cancel-dlt-msg"
|
|
704
|
+
type="secondary"
|
|
705
|
+
>
|
|
706
|
+
<FormattedMessage {...messages.cancelButtonLabel} />
|
|
707
|
+
</CapButton>
|
|
702
708
|
</SMSTraiFooter>
|
|
703
709
|
<TestAndPreviewSlidebox
|
|
704
710
|
show={showTestAndPreviewSlidebox}
|