@capillarytech/creatives-library 8.0.168 → 8.0.169
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/test-utils.js +6 -2
- package/v2Components/CapActionButton/index.js +52 -12
- package/v2Components/CapActionButton/messages.js +4 -0
- package/v2Components/CapActionButton/tests/index.test.js +135 -0
- package/v2Components/CapDeviceContent/index.js +5 -0
- package/v2Components/CapInAppCTA/index.js +29 -14
- package/v2Components/CapInAppCTA/index.scss +0 -2
- package/v2Components/CapInAppCTA/messages.js +4 -0
- package/v2Components/CapMpushCTA/index.js +54 -38
- package/v2Components/CapMpushCTA/index.scss +2 -2
- package/v2Components/CapMpushCTA/messages.js +4 -0
- package/v2Components/CapTagListWithInput/index.js +169 -0
- package/v2Components/CapTagListWithInput/messages.js +10 -0
- package/v2Components/CapWhatsappCTA/index.js +2 -2
- package/v2Components/CapWhatsappCarouselButton/index.js +2 -2
- package/v2Components/FormBuilder/index.js +93 -1
- package/v2Components/TestAndPreviewSlidebox/PreviewSection.js +1 -1
- package/v2Components/TestAndPreviewSlidebox/index.js +24 -4
- package/v2Containers/Email/index.js +64 -3
- package/v2Containers/Email/initialSchema.js +7 -21
- package/v2Containers/Line/Container/Wrapper/utils.js +0 -7
- package/v2Containers/MobilePush/Create/index.js +24 -3
- package/v2Containers/MobilePush/commonMethods.js +25 -3
- package/v2Containers/MobilePushNew/components/CtaButtons.js +20 -0
- package/v2Containers/MobilePushNew/components/MediaUploaders.js +31 -3
- package/v2Containers/MobilePushNew/components/PlatformContentFields.js +34 -3
- package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +200 -5
- package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +59 -1
- package/v2Containers/MobilePushNew/index.js +9 -0
- package/v2Containers/MobilePushNew/index.scss +2 -1
- package/v2Containers/Rcs/index.js +77 -71
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +15270 -492
- package/v2Containers/Viber/index.js +102 -76
package/package.json
CHANGED
package/utils/test-utils.js
CHANGED
|
@@ -7,10 +7,14 @@ import history from './history';
|
|
|
7
7
|
import { Provider } from 'react-redux';
|
|
8
8
|
import { configureStore } from '@capillarytech/vulcan-react-sdk/utils';
|
|
9
9
|
import { initialReducer } from '../initialReducer';
|
|
10
|
-
import initialState from '../initialState';
|
|
11
10
|
|
|
12
11
|
function Wrapper({ children }) {
|
|
13
|
-
|
|
12
|
+
const store = configureStore({}, initialReducer, history);
|
|
13
|
+
return (
|
|
14
|
+
<Provider store={store}>
|
|
15
|
+
<IntlProvider locale="en">{children}</IntlProvider>
|
|
16
|
+
</Provider>
|
|
17
|
+
);
|
|
14
18
|
}
|
|
15
19
|
Wrapper.propTypes = {
|
|
16
20
|
children: PropTypes.array,
|
|
@@ -9,10 +9,12 @@ import CapDivider from '@capillarytech/cap-ui-library/CapDivider';
|
|
|
9
9
|
import CapButton from '@capillarytech/cap-ui-library/CapButton';
|
|
10
10
|
import CapTooltip from '@capillarytech/cap-ui-library/CapTooltip';
|
|
11
11
|
import CapLabel from '@capillarytech/cap-ui-library/CapLabel';
|
|
12
|
+
import CapTagListWithInput from '../CapTagListWithInput';
|
|
12
13
|
|
|
13
14
|
import { isUrl } from '../../v2Containers/Line/Container/Wrapper/utils';
|
|
14
15
|
import messages from './messages';
|
|
15
16
|
import './index.scss';
|
|
17
|
+
|
|
16
18
|
export const CapActionButton = (props) => {
|
|
17
19
|
const {
|
|
18
20
|
intl,
|
|
@@ -20,6 +22,12 @@ export const CapActionButton = (props) => {
|
|
|
20
22
|
type,
|
|
21
23
|
updateButtonChange,
|
|
22
24
|
suggestions = [],
|
|
25
|
+
tags = [],
|
|
26
|
+
injectedTags = {},
|
|
27
|
+
location = {},
|
|
28
|
+
selectedOfferDetails = [],
|
|
29
|
+
|
|
30
|
+
onContextChange,
|
|
23
31
|
} = props;
|
|
24
32
|
const { text = '', url = '' } = suggestions[0] || {};
|
|
25
33
|
const [buttonText, setButtonText] = useState(text || '');
|
|
@@ -28,6 +36,13 @@ export const CapActionButton = (props) => {
|
|
|
28
36
|
|
|
29
37
|
const { formatMessage } = intl;
|
|
30
38
|
|
|
39
|
+
const handleTagSelect = (data) => {
|
|
40
|
+
const tempMsg = `${buttonLink}{{${data}}}`;
|
|
41
|
+
setButtonLink(tempMsg);
|
|
42
|
+
onButtonLinkChange({ target: { value: tempMsg } });
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
|
|
31
46
|
const onButtonTextChange = (e) => {
|
|
32
47
|
const val = e.target.value;
|
|
33
48
|
setButtonText(val);
|
|
@@ -81,18 +96,24 @@ export const CapActionButton = (props) => {
|
|
|
81
96
|
}
|
|
82
97
|
/>
|
|
83
98
|
|
|
84
|
-
{/* button Link */}
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
{/* button Link with tags */}
|
|
100
|
+
<CapTagListWithInput
|
|
101
|
+
inputId="rcs-template-Button-link"
|
|
102
|
+
inputValue={buttonLink}
|
|
103
|
+
inputOnChange={onButtonLinkChange}
|
|
104
|
+
inputPlaceholder={formatMessage(messages.templateButtonLinkPlaceholder)}
|
|
105
|
+
inputSize="default"
|
|
106
|
+
inputErrorMessage={buttonURLErrorMessage}
|
|
107
|
+
headingText={formatMessage(messages.templateButtonLink)}
|
|
108
|
+
headingType="h4"
|
|
109
|
+
headingStyle={{ paddingTop: '10px', marginRight: '56%' }}
|
|
110
|
+
moduleFilterEnabled={location?.query?.type !== 'embedded'}
|
|
111
|
+
onTagSelect={handleTagSelect}
|
|
112
|
+
onContextChange={onContextChange}
|
|
113
|
+
location={location}
|
|
114
|
+
tags={tags}
|
|
115
|
+
injectedTags={injectedTags}
|
|
116
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
96
117
|
/>
|
|
97
118
|
|
|
98
119
|
{/* divider */}
|
|
@@ -122,6 +143,25 @@ CapActionButton.propTypes = {
|
|
|
122
143
|
type: PropTypes.string,
|
|
123
144
|
updateButtonChange: PropTypes.func,
|
|
124
145
|
suggestions: PropTypes.array,
|
|
146
|
+
tags: PropTypes.array,
|
|
147
|
+
injectedTags: PropTypes.object,
|
|
148
|
+
location: PropTypes.object,
|
|
149
|
+
selectedOfferDetails: PropTypes.array,
|
|
150
|
+
onTagSelect: PropTypes.func,
|
|
151
|
+
onContextChange: PropTypes.func,
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
CapActionButton.defaultProps = {
|
|
155
|
+
buttonTextlen: 20,
|
|
156
|
+
type: '',
|
|
157
|
+
updateButtonChange: () => {},
|
|
158
|
+
suggestions: [],
|
|
159
|
+
tags: [],
|
|
160
|
+
injectedTags: {},
|
|
161
|
+
location: {},
|
|
162
|
+
selectedOfferDetails: [],
|
|
163
|
+
onTagSelect: () => {},
|
|
164
|
+
onContextChange: () => {},
|
|
125
165
|
};
|
|
126
166
|
|
|
127
167
|
export default injectIntl(CapActionButton);
|
|
@@ -30,4 +30,8 @@ export default defineMessages({
|
|
|
30
30
|
id: `${prefix}.comingSoonTooltip`,
|
|
31
31
|
defaultMessage: 'Right now only one Call to action button is enabled, in future you would be able to add upto 3 buttons.',
|
|
32
32
|
},
|
|
33
|
+
addLabels: {
|
|
34
|
+
id: `${prefix}.addLabels`,
|
|
35
|
+
defaultMessage: 'Add Labels',
|
|
36
|
+
},
|
|
33
37
|
});
|
|
@@ -10,6 +10,132 @@ import {
|
|
|
10
10
|
} from '../../../utils/test-utils';
|
|
11
11
|
import { CapActionButton } from "../index";
|
|
12
12
|
|
|
13
|
+
// Mock Cap UI Library components
|
|
14
|
+
jest.mock('@capillarytech/cap-ui-library/CapRow', () =>
|
|
15
|
+
function MockCapRow({ children, ...props }) {
|
|
16
|
+
return <div {...props} data-testid="cap-row">{children}</div>;
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
jest.mock('@capillarytech/cap-ui-library/CapHeading', () =>
|
|
21
|
+
function MockCapHeading({ children, type, ...props }) {
|
|
22
|
+
const Tag = type === 'h4' ? 'h4' : 'div';
|
|
23
|
+
return <Tag {...props} data-testid="cap-heading">{children}</Tag>;
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
jest.mock('@capillarytech/cap-ui-library/CapInput', () =>
|
|
28
|
+
function MockCapInput({ onChange, value, placeholder, ...props }) {
|
|
29
|
+
return (
|
|
30
|
+
<input
|
|
31
|
+
type="text"
|
|
32
|
+
value={value || ''}
|
|
33
|
+
onChange={onChange}
|
|
34
|
+
placeholder={placeholder}
|
|
35
|
+
{...props}
|
|
36
|
+
data-testid="cap-input"
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
jest.mock('@capillarytech/cap-ui-library/CapDivider', () =>
|
|
43
|
+
function MockCapDivider({ ...props }) {
|
|
44
|
+
return <hr {...props} data-testid="cap-divider" />;
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
jest.mock('@capillarytech/cap-ui-library/CapButton', () =>
|
|
49
|
+
function MockCapButton({ children, ...props }) {
|
|
50
|
+
return <button {...props} data-testid="cap-button">{children}</button>;
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
jest.mock('@capillarytech/cap-ui-library/CapTooltip', () =>
|
|
55
|
+
function MockCapTooltip({ children, title, ...props }) {
|
|
56
|
+
return (
|
|
57
|
+
<div {...props} data-testid="cap-tooltip" title={title}>
|
|
58
|
+
{children}
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
jest.mock('@capillarytech/cap-ui-library/CapLabel', () =>
|
|
65
|
+
function MockCapLabel({ children, ...props }) {
|
|
66
|
+
return <label {...props} data-testid="cap-label">{children}</label>;
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
jest.mock('@capillarytech/cap-ui-library/CapColumn', () =>
|
|
71
|
+
function MockCapColumn({ children, ...props }) {
|
|
72
|
+
return <div {...props} data-testid="cap-column">{children}</div>;
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
jest.mock('../../../v2Containers/TagList', () =>
|
|
77
|
+
function MockTagList({ label, onTagSelect, onContextChange, ...props }) {
|
|
78
|
+
return (
|
|
79
|
+
<div data-testid="tag-list" {...props}>
|
|
80
|
+
<button
|
|
81
|
+
type="button"
|
|
82
|
+
onClick={() => onTagSelect && onTagSelect('test-tag')}
|
|
83
|
+
data-testid="tag-select-button"
|
|
84
|
+
>
|
|
85
|
+
{label || 'Add Label'}
|
|
86
|
+
</button>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
jest.mock('../../../v2Containers/Line/Container/Wrapper/utils', () => ({
|
|
93
|
+
isUrl: jest.fn((url) => {
|
|
94
|
+
if (!url) return false;
|
|
95
|
+
return url.startsWith('http://') || url.startsWith('https://');
|
|
96
|
+
}),
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
jest.mock('../messages', () => ({
|
|
100
|
+
__esModule: true,
|
|
101
|
+
default: {
|
|
102
|
+
templateButtonText: {
|
|
103
|
+
id: 'creatives.componentsV2.CapActionButton.templateButtonText',
|
|
104
|
+
defaultMessage: 'Button text',
|
|
105
|
+
},
|
|
106
|
+
templateButtonTextPlaceholder: {
|
|
107
|
+
id: 'creatives.componentsV2.CapActionButton.templateButtonTextPlaceholder',
|
|
108
|
+
defaultMessage: 'Enter button text',
|
|
109
|
+
},
|
|
110
|
+
templateButtonLink: {
|
|
111
|
+
id: 'creatives.componentsV2.CapActionButton.templateButtonLink',
|
|
112
|
+
defaultMessage: 'Button link',
|
|
113
|
+
},
|
|
114
|
+
templateButtonLinkPlaceholder: {
|
|
115
|
+
id: 'creatives.componentsV2.CapActionButton.templateButtonLinkPlaceholder',
|
|
116
|
+
defaultMessage: 'Enter button link',
|
|
117
|
+
},
|
|
118
|
+
addButton: {
|
|
119
|
+
id: 'creatives.componentsV2.CapActionButton.addButton',
|
|
120
|
+
defaultMessage: 'Add button',
|
|
121
|
+
},
|
|
122
|
+
inValidUrlErrorMessage: {
|
|
123
|
+
id: 'creatives.componentsV2.CapActionButton.inValidUrlErrorMessage',
|
|
124
|
+
defaultMessage: 'Button URL is not valid',
|
|
125
|
+
},
|
|
126
|
+
comingSoonTooltip: {
|
|
127
|
+
id: 'creatives.componentsV2.CapActionButton.comingSoonTooltip',
|
|
128
|
+
defaultMessage: 'Right now only one Call to action button is enabled, in future you would be able to add upto 3 buttons.',
|
|
129
|
+
},
|
|
130
|
+
addLabels: {
|
|
131
|
+
id: 'creatives.componentsV2.CapActionButton.addLabels',
|
|
132
|
+
defaultMessage: 'Add Labels',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
}));
|
|
136
|
+
|
|
137
|
+
jest.mock('../index.scss', () => ({}));
|
|
138
|
+
|
|
13
139
|
|
|
14
140
|
const initializeComponent = () => {
|
|
15
141
|
const Component = injectIntl(CapActionButton);
|
|
@@ -18,6 +144,15 @@ const initializeComponent = () => {
|
|
|
18
144
|
buttonTextlen={200}
|
|
19
145
|
updateButtonChange={() => {}}
|
|
20
146
|
suggestions={[{text: "text", url: 'url'}]}
|
|
147
|
+
tags={[]}
|
|
148
|
+
injectedTags={{}}
|
|
149
|
+
location={{}}
|
|
150
|
+
selectedOfferDetails={[]}
|
|
151
|
+
onContextChange={() => {}}
|
|
152
|
+
onButtonLinkChange={() => {}}
|
|
153
|
+
globalActions={{
|
|
154
|
+
fetchSchemaForEntity: () => {}
|
|
155
|
+
}}
|
|
21
156
|
/>);
|
|
22
157
|
};
|
|
23
158
|
|
|
@@ -337,6 +337,11 @@ const CapDeviceContent = (props) => {
|
|
|
337
337
|
deleteHandler={deleteHandler}
|
|
338
338
|
isEditFlow={isEditFlow}
|
|
339
339
|
deepLink={deepLink}
|
|
340
|
+
onContextChange={handleOnTagsContextChange}
|
|
341
|
+
location={location}
|
|
342
|
+
tags={tags}
|
|
343
|
+
injectedTags={injectedTags}
|
|
344
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
340
345
|
/>
|
|
341
346
|
)}
|
|
342
347
|
</CapRow>
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
CTA_OPTIONS,
|
|
30
30
|
URL_MAX_LENGTH,
|
|
31
31
|
} from "./constants";
|
|
32
|
+
import CapTagListWithInput from "../CapTagListWithInput";
|
|
32
33
|
|
|
33
34
|
export const CapInAppCTA = (props) => {
|
|
34
35
|
const {
|
|
@@ -36,9 +37,12 @@ export const CapInAppCTA = (props) => {
|
|
|
36
37
|
ctaData = [],
|
|
37
38
|
updateHandler,
|
|
38
39
|
deleteHandler,
|
|
39
|
-
isEditFlow,
|
|
40
40
|
deepLink,
|
|
41
|
-
|
|
41
|
+
onContextChange,
|
|
42
|
+
location,
|
|
43
|
+
tags,
|
|
44
|
+
injectedTags,
|
|
45
|
+
selectedOfferDetails,
|
|
42
46
|
} = props;
|
|
43
47
|
const { formatMessage } = intl;
|
|
44
48
|
|
|
@@ -122,6 +126,12 @@ export const CapInAppCTA = (props) => {
|
|
|
122
126
|
const renderArray = [];
|
|
123
127
|
ctaData?.forEach((cta) => {
|
|
124
128
|
const { index, text, url, urlType, isSaved } = cta || {};
|
|
129
|
+
|
|
130
|
+
const onButtonTagSelect = (data) => {
|
|
131
|
+
const newUrl = `${url}{{${data}}}`;
|
|
132
|
+
updateHelper('url', newUrl, index);
|
|
133
|
+
};
|
|
134
|
+
|
|
125
135
|
//this is to display buttons after they are saved, in both create and edit mode.
|
|
126
136
|
if (isSaved) {
|
|
127
137
|
renderArray.push(
|
|
@@ -225,18 +235,23 @@ export const CapInAppCTA = (props) => {
|
|
|
225
235
|
)}
|
|
226
236
|
{urlType === EXTERNAL_URL && (
|
|
227
237
|
<>
|
|
228
|
-
<
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
<CapTagListWithInput
|
|
239
|
+
inputId="inapp-cta-external-link"
|
|
240
|
+
inputValue={url}
|
|
241
|
+
inputOnChange={onUrlChange}
|
|
242
|
+
inputPlaceholder={formatMessage(messages.ctaExternalLinkPlaceholder)}
|
|
243
|
+
inputSize="large"
|
|
244
|
+
inputMaxLength={URL_MAX_LENGTH}
|
|
245
|
+
inputErrorMessage={urlError}
|
|
246
|
+
headingText={formatMessage(messages.urlExternalLink)}
|
|
247
|
+
headingStyle={{ marginTop: '3%',marginRight: '65%'}}
|
|
248
|
+
moduleFilterEnabled={location?.query?.type !== "embedded"}
|
|
249
|
+
onTagSelect={onButtonTagSelect}
|
|
250
|
+
onContextChange={onContextChange}
|
|
251
|
+
location={location}
|
|
252
|
+
tags={tags || []}
|
|
253
|
+
injectedTags={injectedTags || {}}
|
|
254
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
240
255
|
/>
|
|
241
256
|
</>
|
|
242
257
|
)}
|
|
@@ -30,6 +30,8 @@ import {
|
|
|
30
30
|
} from "./constants";
|
|
31
31
|
import { PRIMARY } from "../../v2Containers/MobilePushNew/constants";
|
|
32
32
|
import { URL } from "../../v2Containers/Whatsapp/constants";
|
|
33
|
+
import TagList from "../../v2Containers/TagList";
|
|
34
|
+
import CapTagListWithInput from "../CapTagListWithInput";
|
|
33
35
|
|
|
34
36
|
export const CapMpushCTA = (props) => {
|
|
35
37
|
const {
|
|
@@ -39,6 +41,11 @@ export const CapMpushCTA = (props) => {
|
|
|
39
41
|
deleteHandler,
|
|
40
42
|
deepLink,
|
|
41
43
|
buttonType,
|
|
44
|
+
location,
|
|
45
|
+
tags,
|
|
46
|
+
injectedTags,
|
|
47
|
+
selectedOfferDetails,
|
|
48
|
+
handleOnTagsContextChange,
|
|
42
49
|
} = props;
|
|
43
50
|
const { formatMessage } = intl;
|
|
44
51
|
|
|
@@ -102,7 +109,7 @@ export const CapMpushCTA = (props) => {
|
|
|
102
109
|
const renderLength = (len, max) => (
|
|
103
110
|
<CapHeading
|
|
104
111
|
type="label1"
|
|
105
|
-
className="
|
|
112
|
+
className="mpush-render-btn-length"
|
|
106
113
|
>
|
|
107
114
|
{formatMessage(inAppMsg.templateMessageLength, {
|
|
108
115
|
currentLength: len,
|
|
@@ -216,6 +223,10 @@ export const CapMpushCTA = (props) => {
|
|
|
216
223
|
|
|
217
224
|
filteredCtaData?.forEach((cta) => {
|
|
218
225
|
const { index, text, urlType, isSaved } = cta || {};
|
|
226
|
+
const onButtonTagSelect = (data) => {
|
|
227
|
+
const newUrl = `${localUrlValues[index]}{{${data}}}`;
|
|
228
|
+
updateHelper('url', newUrl, index);
|
|
229
|
+
};
|
|
219
230
|
if (isSaved) {
|
|
220
231
|
renderArray.push(
|
|
221
232
|
<CapRow
|
|
@@ -278,7 +289,7 @@ export const CapMpushCTA = (props) => {
|
|
|
278
289
|
/>
|
|
279
290
|
{renderLength(text.length, BTN_MAX_LENGTH)}
|
|
280
291
|
</CapColumn>
|
|
281
|
-
<CapColumn className="
|
|
292
|
+
<CapColumn className="mpush-cta-buttons">
|
|
282
293
|
<CapRow style={{ width: '30%', marginRight: '10px' }}>
|
|
283
294
|
<CapHeading type="h4" className="cta-label">
|
|
284
295
|
{formatMessage(messages.ctaType)}
|
|
@@ -307,22 +318,27 @@ export const CapMpushCTA = (props) => {
|
|
|
307
318
|
</CapRow>
|
|
308
319
|
)}
|
|
309
320
|
{urlType === EXTERNAL_URL && (
|
|
310
|
-
<
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
321
|
+
<CapTagListWithInput
|
|
322
|
+
inputId="inapp-cta-external-link"
|
|
323
|
+
inputValue={localUrlValues[index] || ''}
|
|
324
|
+
inputOnChange={onUrlChange}
|
|
325
|
+
inputPlaceholder={formatMessage(messages.ctaExternalLinkPlaceholder)}
|
|
326
|
+
inputSize="large"
|
|
327
|
+
inputMaxLength={URL_MAX_LENGTH}
|
|
328
|
+
inputErrorMessage={urlError}
|
|
329
|
+
headingText={formatMessage(messages.urlExternalLink)}
|
|
330
|
+
headingStyle={{ marginTop: '3%', marginRight: '50%'}}
|
|
331
|
+
containerStyle={{ width: '70%' }}
|
|
332
|
+
// tagListStyle={{ display: "flex" }}
|
|
333
|
+
moduleFilterEnabled={location?.query?.type !== "embedded"}
|
|
334
|
+
onTagSelect={onButtonTagSelect}
|
|
335
|
+
onContextChange={handleOnTagsContextChange}
|
|
336
|
+
location={location}
|
|
337
|
+
tags={tags || []}
|
|
338
|
+
injectedTags={injectedTags || {}}
|
|
339
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
340
|
+
inputProps={{ 'data-index': index }}
|
|
341
|
+
/>
|
|
326
342
|
)}
|
|
327
343
|
</CapColumn>
|
|
328
344
|
{urlType === DEEP_LINK && ctaDeepLinkValue && deepLinkKeysFromSelectionArray.length > 0 && (
|
|
@@ -330,26 +346,26 @@ export const CapMpushCTA = (props) => {
|
|
|
330
346
|
<CapHeading type="h4">
|
|
331
347
|
{formatMessage(messages.deepLinkKeys)}
|
|
332
348
|
</CapHeading>
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
349
|
+
<CapLabel type="label2" className="cta-deep-link-keys-value">
|
|
350
|
+
{(() => {
|
|
351
|
+
if (deepLinkKeysFromSelectionArray.length > 0) {
|
|
352
|
+
return deepLinkKeysFromSelectionArray.join(', ');
|
|
353
|
+
}
|
|
354
|
+
if (deepLinkKeysArray.length > 0) {
|
|
355
|
+
return deepLinkKeysArray.join(', ');
|
|
356
|
+
}
|
|
357
|
+
})()}
|
|
358
|
+
</CapLabel>
|
|
359
|
+
<CapInput
|
|
360
|
+
id="inapp-deep-link-keys"
|
|
361
|
+
className="inapp-deep-link-keys"
|
|
362
|
+
onChange={onDeepLinkKeysChange}
|
|
363
|
+
placeholder={formatMessage(messages.deepLinkKeysPlaceholder, { key: deepLinkKeysFromSelectionArray.join(', ') })}
|
|
364
|
+
value={Array.isArray(ctaDeepLinkKeysValue) ? ctaDeepLinkKeysValue.join(', ') : (ctaDeepLinkKeysValue || '')}
|
|
365
|
+
size="large"
|
|
366
|
+
data-index={index}
|
|
367
|
+
errorMessage={deepLinkKeysError ? formatMessage(messages.deepLinkKeysRequired) : ""}
|
|
368
|
+
/>
|
|
353
369
|
</CapRow>
|
|
354
370
|
)}
|
|
355
371
|
<CapRow className="inapp-cta-save-delete-btn">
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
border: 1px solid $CAP_G06;
|
|
8
8
|
border-radius: $CAP_SPACE_04;
|
|
9
9
|
|
|
10
|
-
.
|
|
10
|
+
.mpush-cta-buttons {
|
|
11
11
|
margin-top: $CAP_SPACE_12;
|
|
12
12
|
display: flex;
|
|
13
13
|
flex-direction: row;
|
|
14
14
|
align-items: flex-end;
|
|
15
15
|
justify-content: space-between;
|
|
16
16
|
|
|
17
|
-
.
|
|
17
|
+
.mpush-render-btn-length {
|
|
18
18
|
margin-top: $CAP_SPACE_12;
|
|
19
19
|
width: 90%;
|
|
20
20
|
margin-left: 52%;
|