@capillarytech/creatives-library 7.12.16 → 7.12.18
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/CapImageUpload/index.js +3 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +1 -0
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +11 -10
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +1 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +73 -65
- package/v2Containers/Rcs/index.js +1 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +20442 -126
- package/v2Containers/Rcs/tests/index.test.js +17 -0
- package/v2Containers/Whatsapp/index.js +2 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +0 -1024
- package/v2Containers/mockdata.js +2 -13
package/package.json
CHANGED
|
@@ -40,6 +40,7 @@ function CapImageUpload(props) {
|
|
|
40
40
|
className,
|
|
41
41
|
imageData,
|
|
42
42
|
channel,
|
|
43
|
+
channelSpecificStyle,
|
|
43
44
|
} = props;
|
|
44
45
|
const {
|
|
45
46
|
formatMessage,
|
|
@@ -205,6 +206,7 @@ function CapImageUpload(props) {
|
|
|
205
206
|
className="dragger-button re-upload"
|
|
206
207
|
type="flat"
|
|
207
208
|
onClick={onReUpload}
|
|
209
|
+
style={ channelSpecificStyle ? { marginTop:'-16px'} : {}}
|
|
208
210
|
>
|
|
209
211
|
<FormattedMessage {...messages.imageReUpload} />
|
|
210
212
|
</CapButton>
|
|
@@ -274,6 +276,7 @@ CapImageUpload.propTypes = {
|
|
|
274
276
|
imageData: PropTypes.object,
|
|
275
277
|
index: PropTypes.number,
|
|
276
278
|
channel: PropTypes.string,
|
|
279
|
+
channelSpecificStyle: PropTypes.bool,
|
|
277
280
|
};
|
|
278
281
|
|
|
279
282
|
export default injectIntl(CapImageUpload);
|
|
@@ -25,7 +25,7 @@ const StyledLabel = styled(CapLabelInline)`
|
|
|
25
25
|
const PrefixWrapper = styled.div`
|
|
26
26
|
margin-right: 16px;
|
|
27
27
|
`;
|
|
28
|
-
const
|
|
28
|
+
const renderData = (type, value) => (
|
|
29
29
|
<StyledLabel type={type}>
|
|
30
30
|
{value}
|
|
31
31
|
</StyledLabel>
|
|
@@ -37,7 +37,6 @@ export function SlideBoxHeader(props) {
|
|
|
37
37
|
const mapTemplateCreate = !showTemplateNameHeader && slidBoxContent === 'createTemplate' && weChatTemplateType === MAP_TEMPLATE && templateStep !== 'modeSelection';
|
|
38
38
|
const isTraiDlt = isTraiDLTEnable(isFullMode, smsRegister);
|
|
39
39
|
const showCreateTraiSMSHeader = isTraiDlt && channel.toLowerCase() === "sms";
|
|
40
|
-
const showTemplateName = [WHATSAPP, RCS].includes(channel.toLowerCase()) & slidBoxContent === 'editTemplate' & !isFullMode;
|
|
41
40
|
const isWhatsappEdit = channel.toLowerCase() === WHATSAPP && slidBoxContent === 'editTemplate';
|
|
42
41
|
const isWhatsappCreate = channel.toLowerCase() === WHATSAPP && slidBoxContent === 'createTemplate';
|
|
43
42
|
const whatsappOverview = isWhatsappEdit && isFullMode;
|
|
@@ -48,6 +47,8 @@ export function SlideBoxHeader(props) {
|
|
|
48
47
|
whatsappTemplateLanguageCode,
|
|
49
48
|
} = templateData || {};
|
|
50
49
|
const templateName = whatsappTemplateName || templateData?.name;
|
|
50
|
+
const showRcsTemplateName = channel.toLowerCase() === RCS && slidBoxContent === 'editTemplate' && !isFullMode && templateName;
|
|
51
|
+
const showTemplateName = isWhatsappEdit || showRcsTemplateName;
|
|
51
52
|
const whatsappCategory = whatsappTemplateCategory || get(templateData, `versions.base.content.whatsapp.category`, '');
|
|
52
53
|
const whatsappLanguageCode = whatsappTemplateLanguageCode || get(templateData, `versions.base.content.whatsapp.languages[0].language`, '');
|
|
53
54
|
|
|
@@ -100,18 +101,18 @@ export function SlideBoxHeader(props) {
|
|
|
100
101
|
<>
|
|
101
102
|
{showTemplateName ? (
|
|
102
103
|
<>
|
|
103
|
-
{
|
|
104
|
-
{
|
|
104
|
+
{renderData("label1", <FormattedMessage {...globalMessages.templateNameLabel} />)}
|
|
105
|
+
{renderData("label2", templateName)}
|
|
105
106
|
</>
|
|
106
107
|
) : ""}
|
|
107
108
|
{isWhatsappEdit && (
|
|
108
109
|
<>
|
|
109
|
-
{
|
|
110
|
-
{
|
|
111
|
-
{
|
|
112
|
-
{
|
|
113
|
-
{
|
|
114
|
-
{
|
|
110
|
+
{renderData("label3", <FormattedMessage {...whatsppMsg.labelSeperator} />)}
|
|
111
|
+
{renderData("label1", <FormattedMessage {...whatsppMsg.templateCategoryLabel} />)}
|
|
112
|
+
{renderData("label2", formatString(whatsappCategory))}
|
|
113
|
+
{renderData("label3", <FormattedMessage {...whatsppMsg.labelSeperator} />)}
|
|
114
|
+
{renderData("label1", <FormattedMessage {...whatsppMsg.languageLabel} />)}
|
|
115
|
+
{renderData("label2", LANGUAGE_OPTIONS?.find((option) => option.value === whatsappLanguageCode)?.label)}
|
|
115
116
|
</>)
|
|
116
117
|
}
|
|
117
118
|
</>
|
|
@@ -181,6 +181,7 @@ exports[`Test SlideBoxContent container Should render correct component for what
|
|
|
181
181
|
"type": "WHATSAPP",
|
|
182
182
|
"validity": true,
|
|
183
183
|
"whatsappTemplateCategory": "ALERT_UPDATE",
|
|
184
|
+
"whatsappTemplateLanguageCode": "en",
|
|
184
185
|
"whatsappTemplateName": "amit123456",
|
|
185
186
|
}
|
|
186
187
|
}
|
|
@@ -11,7 +11,11 @@ exports[`Test SlideBoxHeader container Should render correct component for rcs c
|
|
|
11
11
|
key="creatives-container-slidebox-header-content"
|
|
12
12
|
>
|
|
13
13
|
<CapHeader
|
|
14
|
-
description={
|
|
14
|
+
description={
|
|
15
|
+
<React.Fragment>
|
|
16
|
+
|
|
17
|
+
</React.Fragment>
|
|
18
|
+
}
|
|
15
19
|
descriptionClass=""
|
|
16
20
|
inline={false}
|
|
17
21
|
prefix={false}
|
|
@@ -130,70 +134,74 @@ exports[`Test SlideBoxHeader container Should render correct component for whats
|
|
|
130
134
|
<CapHeader
|
|
131
135
|
description={
|
|
132
136
|
<React.Fragment>
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
>
|
|
150
|
-
<
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
<
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
<
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
137
|
+
<React.Fragment>
|
|
138
|
+
<SlideBoxHeader__StyledLabel
|
|
139
|
+
type="label1"
|
|
140
|
+
>
|
|
141
|
+
<FormattedMessage
|
|
142
|
+
defaultMessage="Template name"
|
|
143
|
+
id="creatives.containersV2.templateNameLabel"
|
|
144
|
+
values={Object {}}
|
|
145
|
+
/>
|
|
146
|
+
</SlideBoxHeader__StyledLabel>
|
|
147
|
+
<SlideBoxHeader__StyledLabel
|
|
148
|
+
type="label2"
|
|
149
|
+
>
|
|
150
|
+
amit123456
|
|
151
|
+
</SlideBoxHeader__StyledLabel>
|
|
152
|
+
</React.Fragment>
|
|
153
|
+
<React.Fragment>
|
|
154
|
+
<SlideBoxHeader__StyledLabel
|
|
155
|
+
type="label3"
|
|
156
|
+
>
|
|
157
|
+
<FormattedMessage
|
|
158
|
+
defaultMessage="|"
|
|
159
|
+
id="creatives.containersV2.Whatsapp.labelSeperator"
|
|
160
|
+
values={Object {}}
|
|
161
|
+
/>
|
|
162
|
+
</SlideBoxHeader__StyledLabel>
|
|
163
|
+
<SlideBoxHeader__StyledLabel
|
|
164
|
+
type="label1"
|
|
165
|
+
>
|
|
166
|
+
<FormattedMessage
|
|
167
|
+
defaultMessage="Template category"
|
|
168
|
+
id="creatives.containersV2.Whatsapp.templateCategoryLabel"
|
|
169
|
+
values={Object {}}
|
|
170
|
+
/>
|
|
171
|
+
</SlideBoxHeader__StyledLabel>
|
|
172
|
+
<SlideBoxHeader__StyledLabel
|
|
173
|
+
type="label2"
|
|
174
|
+
>
|
|
175
|
+
Alert Update
|
|
176
|
+
</SlideBoxHeader__StyledLabel>
|
|
177
|
+
<SlideBoxHeader__StyledLabel
|
|
178
|
+
type="label3"
|
|
179
|
+
>
|
|
180
|
+
<FormattedMessage
|
|
181
|
+
defaultMessage="|"
|
|
182
|
+
id="creatives.containersV2.Whatsapp.labelSeperator"
|
|
183
|
+
values={Object {}}
|
|
184
|
+
/>
|
|
185
|
+
</SlideBoxHeader__StyledLabel>
|
|
186
|
+
<SlideBoxHeader__StyledLabel
|
|
187
|
+
type="label1"
|
|
188
|
+
>
|
|
189
|
+
<FormattedMessage
|
|
190
|
+
defaultMessage="Language"
|
|
191
|
+
id="creatives.containersV2.Whatsapp.languageLabel"
|
|
192
|
+
values={Object {}}
|
|
193
|
+
/>
|
|
194
|
+
</SlideBoxHeader__StyledLabel>
|
|
195
|
+
<SlideBoxHeader__StyledLabel
|
|
196
|
+
type="label2"
|
|
197
|
+
>
|
|
198
|
+
<FormattedMessage
|
|
199
|
+
defaultMessage="English"
|
|
200
|
+
id="creatives.containersV2.Whatsapp.english"
|
|
201
|
+
values={Object {}}
|
|
202
|
+
/>
|
|
203
|
+
</SlideBoxHeader__StyledLabel>
|
|
204
|
+
</React.Fragment>
|
|
197
205
|
</React.Fragment>
|
|
198
206
|
}
|
|
199
207
|
descriptionClass=""
|