@capillarytech/creatives-library 7.10.51 → 7.10.53
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/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +2 -0
- package/containers/Email/index.js +3 -2
- package/package.json +1 -1
- package/v2Components/TemplatePreview/_templatePreview.scss +17 -9
- package/v2Components/TemplatePreview/index.js +66 -52
- package/v2Components/WhatsappStatusContainer/_whatsappStatusContainer.scss +15 -0
- package/v2Components/WhatsappStatusContainer/index.js +58 -0
- package/v2Containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +2 -0
- package/v2Containers/Cap/messages.js +8 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +7 -6
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +19 -13
- package/v2Containers/CreativesContainer/index.js +18 -1
- package/v2Containers/CreativesContainer/messages.js +4 -0
- package/v2Containers/Email/index.js +3 -1
- package/v2Containers/SmsTrai/Create/constants.js +3 -7
- package/v2Containers/SmsTrai/Create/index.js +74 -28
- package/v2Containers/SmsTrai/Edit/constants.js +0 -1
- package/v2Containers/Templates/_templates.scss +19 -31
- package/v2Containers/Templates/actions.js +10 -16
- package/v2Containers/Templates/index.js +37 -15
- package/v2Containers/Whatsapp/index.js +4 -3
- package/v2Containers/Whatsapp/index.scss +53 -54
- package/v2Containers/Whatsapp/messages.js +0 -8
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +1343 -863
- package/v2Containers/Whatsapp/tests/index.test.js +2 -4
- package/v2Containers/Whatsapp/utils.js +0 -47
|
@@ -117,10 +117,9 @@ describe('Creatives Whatsapp test/>', () => {
|
|
|
117
117
|
const sendForApprovalBtn = renderedComponent
|
|
118
118
|
.find('CapButton.whatsapp-create-btn')
|
|
119
119
|
.props();
|
|
120
|
-
expect(sendForApprovalBtn.children.props.defaultMessage).toBe(
|
|
121
|
-
'Send for approval',
|
|
122
|
-
);
|
|
123
120
|
expect(sendForApprovalBtn.disabled).toBe(true);
|
|
121
|
+
sendForApprovalBtn.onClick();
|
|
122
|
+
expect(createWhatsappTemplate).toHaveBeenCalled();
|
|
124
123
|
});
|
|
125
124
|
|
|
126
125
|
it('Cancel Btn', () => {
|
|
@@ -128,7 +127,6 @@ describe('Creatives Whatsapp test/>', () => {
|
|
|
128
127
|
const cancelBtn = renderedComponent
|
|
129
128
|
.find('CapButton.whatsapp-cancel-btn')
|
|
130
129
|
.props();
|
|
131
|
-
expect(cancelBtn.children.props.defaultMessage).toBe('Cancel');
|
|
132
130
|
cancelBtn.onClick();
|
|
133
131
|
expect(renderedComponent).toMatchSnapshot();
|
|
134
132
|
});
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CapRow, CapStatus, CapColoredTag } from '@capillarytech/cap-ui-library';
|
|
3
2
|
import { WHATSAPP } from '../CreativesContainer/constants';
|
|
4
3
|
import {
|
|
5
|
-
CATEGORY as WHATSAPP_CATEGORY,
|
|
6
|
-
STATUS as WHATSAPP_STATUS,
|
|
7
4
|
STATUS_OPTIONS,
|
|
8
5
|
CATEGORY_OPTIONS,
|
|
9
6
|
WHATSAPP_STATUSES,
|
|
@@ -42,48 +39,4 @@ export const getWhatsappStatus = (status) => {
|
|
|
42
39
|
status = WHATSAPP_STATUSES.awaitingApproval;
|
|
43
40
|
}
|
|
44
41
|
return STATUS_OPTIONS.find((obj) => obj.value === status);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export const getWhatsappStatusContainer = (template) => {
|
|
48
|
-
const {
|
|
49
|
-
versions: {
|
|
50
|
-
base: {
|
|
51
|
-
content: {
|
|
52
|
-
[WHATSAPP.toLowerCase()]: {
|
|
53
|
-
[WHATSAPP_STATUS]: status,
|
|
54
|
-
[WHATSAPP_CATEGORY]: category,
|
|
55
|
-
} = {},
|
|
56
|
-
} = {},
|
|
57
|
-
} = {},
|
|
58
|
-
} = {},
|
|
59
|
-
} = template;
|
|
60
|
-
|
|
61
|
-
const categoryObj = getWhatsappCategory(category) || {};
|
|
62
|
-
const {
|
|
63
|
-
label: categoryLabel,
|
|
64
|
-
tagColor: categoryTagColor,
|
|
65
|
-
tagTextColor: categoryTextColor,
|
|
66
|
-
} = categoryObj;
|
|
67
|
-
return (
|
|
68
|
-
<CapRow type="flex" align="middle" className="whatsapp-status-container">
|
|
69
|
-
<CapStatus
|
|
70
|
-
type={status}
|
|
71
|
-
text={getWhatsappStatus(status)?.label}
|
|
72
|
-
labelType="label3"
|
|
73
|
-
/>
|
|
74
|
-
{
|
|
75
|
-
categoryLabel ? (
|
|
76
|
-
<CapColoredTag
|
|
77
|
-
tagColor={categoryTagColor}
|
|
78
|
-
tagTextColor={categoryTextColor}
|
|
79
|
-
tagHeight="20px"
|
|
80
|
-
tagFontSize="12px"
|
|
81
|
-
className="whatsapp-category-tag"
|
|
82
|
-
>
|
|
83
|
-
{categoryLabel}
|
|
84
|
-
</CapColoredTag>
|
|
85
|
-
) : null
|
|
86
|
-
}
|
|
87
|
-
</CapRow>
|
|
88
|
-
)
|
|
89
42
|
}
|