@capillarytech/creatives-library 8.0.110-alpha.0 → 8.0.110
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
|
@@ -343,9 +343,14 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
343
343
|
const {formatMessage} = intl;
|
|
344
344
|
const { tagValue, expandedKeys, autoExpandParent, searchValue, visible, translationLang } = this.state;
|
|
345
345
|
const options = [
|
|
346
|
+
{
|
|
347
|
+
value: "All",
|
|
348
|
+
label: formatMessage(messages.all),
|
|
349
|
+
key: 'all',
|
|
350
|
+
},
|
|
346
351
|
{
|
|
347
352
|
value: "Outbound",
|
|
348
|
-
label: formatMessage(messages.
|
|
353
|
+
label: formatMessage(messages.outbound),
|
|
349
354
|
key: 'outbound',
|
|
350
355
|
},
|
|
351
356
|
{
|
|
@@ -365,7 +370,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
365
370
|
getPopupContainer={(triggerNode) => triggerNode.parentNode}
|
|
366
371
|
style={{width: '250px', marginBottom: '16px', minWidth: 'initial', display: 'inherit'}}
|
|
367
372
|
onChange={this.props.onContextChange}
|
|
368
|
-
defaultValue={
|
|
373
|
+
defaultValue={formatMessage(messages.all)}
|
|
369
374
|
options={options}>
|
|
370
375
|
</CapSelect> : ''}
|
|
371
376
|
<CapTree
|
|
@@ -26,9 +26,9 @@ export default defineMessages({
|
|
|
26
26
|
id: 'creatives.componentsV2.CapTagList.all',
|
|
27
27
|
defaultMessage: 'All',
|
|
28
28
|
},
|
|
29
|
-
"
|
|
30
|
-
id: 'creatives.componentsV2.CapTagList.
|
|
31
|
-
defaultMessage: '
|
|
29
|
+
"outbound": {
|
|
30
|
+
id: 'creatives.componentsV2.CapTagList.outbound',
|
|
31
|
+
defaultMessage: 'Outbound',
|
|
32
32
|
},
|
|
33
33
|
"loyalty": {
|
|
34
34
|
id: 'creatives.componentsV2.CapTagList.loyalty',
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
WEBSITE,
|
|
34
34
|
DYNAMIC_URL,
|
|
35
35
|
STATIC_URL,
|
|
36
|
+
DYNAMIC_URL_SUFFIX,
|
|
36
37
|
} from './constants';
|
|
37
38
|
import {
|
|
38
39
|
INITIAL_CTA_DATA,
|
|
@@ -120,8 +121,8 @@ export const CapWhatsappCTA = (props) => {
|
|
|
120
121
|
|
|
121
122
|
const ctaOptions = CTA_OPTIONS.map((option) => {
|
|
122
123
|
const { value, label, tooltipLabel } = option;
|
|
123
|
-
//
|
|
124
|
-
const isDisabled = ctaData.length === 2 && ctaData[0].ctaType === value;
|
|
124
|
+
//only disable PHONE_NUMBER if first button is also PHONE_NUMBER
|
|
125
|
+
const isDisabled = ctaData.length === 2 && ctaData[0].ctaType === PHONE_NUMBER && value === PHONE_NUMBER;
|
|
125
126
|
return {
|
|
126
127
|
value,
|
|
127
128
|
label: renderCtaOptions(label, tooltipLabel, isDisabled),
|
|
@@ -162,7 +163,6 @@ export const CapWhatsappCTA = (props) => {
|
|
|
162
163
|
let { value, id } = target;
|
|
163
164
|
if (urlType === DYNAMIC_URL) {
|
|
164
165
|
value = value.replace(invalidVarRegex, '');
|
|
165
|
-
value = `${value}{{1}}`;
|
|
166
166
|
}
|
|
167
167
|
let errorMessage = false;
|
|
168
168
|
if (!isUrl(value)) {
|
|
@@ -190,6 +190,14 @@ export const CapWhatsappCTA = (props) => {
|
|
|
190
190
|
};
|
|
191
191
|
|
|
192
192
|
const saveCta = (index) => {
|
|
193
|
+
const clonedIndexCta = cloneDeep(ctaData[index]);
|
|
194
|
+
// If this is a website CTA with dynamic URL type, ensure {{1}} is added at the end
|
|
195
|
+
if (clonedIndexCta?.ctaType === WEBSITE && clonedIndexCta?.urlType === DYNAMIC_URL) {
|
|
196
|
+
if (!clonedIndexCta?.url?.includes(DYNAMIC_URL_SUFFIX)) {
|
|
197
|
+
clonedIndexCta.url += DYNAMIC_URL_SUFFIX;
|
|
198
|
+
ctaData[index] = clonedIndexCta;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
193
201
|
updateHelper('isSaved', true, index);
|
|
194
202
|
};
|
|
195
203
|
const editCta = (index) => {
|
|
@@ -391,6 +399,7 @@ export const CapWhatsappCTA = (props) => {
|
|
|
391
399
|
</CapHeading>
|
|
392
400
|
<CapInput
|
|
393
401
|
id={index}
|
|
402
|
+
addonAfter={urlType === DYNAMIC_URL && !url.includes(DYNAMIC_URL_SUFFIX) && DYNAMIC_URL_SUFFIX}
|
|
394
403
|
className="whatsapp-cta-url"
|
|
395
404
|
onChange={(event) => onUrlChange(event, urlType)}
|
|
396
405
|
placeholder={
|