@capillarytech/creatives-library 8.0.353-alpha.3 → 8.0.353-alpha.4
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/CommonTestAndPreview/UnifiedPreview/ViberPreviewContent.js +14 -132
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +0 -163
- package/v2Components/CommonTestAndPreview/index.js +7 -47
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/ViberPreviewContent.test.js +0 -364
- package/v2Components/FormBuilder/index.js +160 -63
- package/v2Containers/CreativesContainer/index.js +60 -24
- package/v2Containers/Email/index.js +1 -1
- package/v2Containers/Templates/_templates.scss +0 -77
- package/v2Containers/Templates/index.js +2 -75
- package/v2Containers/Viber/constants.js +0 -19
- package/v2Containers/Viber/index.js +47 -714
- package/v2Containers/Viber/index.scss +0 -148
- package/v2Containers/Viber/messages.js +0 -116
- package/v2Containers/Viber/tests/index.test.js +0 -80
|
@@ -200,370 +200,6 @@ describe('ViberPreviewContent', () => {
|
|
|
200
200
|
|
|
201
201
|
expect(screen.getByText('Click Here')).toBeTruthy();
|
|
202
202
|
});
|
|
203
|
-
|
|
204
|
-
it('should not render button when buttonText has only whitespace', () => {
|
|
205
|
-
const props = {
|
|
206
|
-
...defaultProps,
|
|
207
|
-
content: {
|
|
208
|
-
viberPreviewContent: {
|
|
209
|
-
messageContent: 'Message',
|
|
210
|
-
buttonText: ' ',
|
|
211
|
-
},
|
|
212
|
-
},
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
const { container } = render(
|
|
216
|
-
<TestWrapper>
|
|
217
|
-
<ComponentToRender {...props} />
|
|
218
|
-
</TestWrapper>
|
|
219
|
-
);
|
|
220
|
-
|
|
221
|
-
expect(container.querySelector('.viber-button-base')).toBeFalsy();
|
|
222
|
-
});
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
describe('Carousel Content', () => {
|
|
226
|
-
it('should render no content when carousel is selected but cards are empty', () => {
|
|
227
|
-
const props = {
|
|
228
|
-
...defaultProps,
|
|
229
|
-
content: {
|
|
230
|
-
viberPreviewContent: {
|
|
231
|
-
type: 'CAROUSEL',
|
|
232
|
-
cards: [
|
|
233
|
-
{
|
|
234
|
-
text: '',
|
|
235
|
-
mediaUrl: '',
|
|
236
|
-
buttons: [
|
|
237
|
-
{ title: '', action: '' },
|
|
238
|
-
],
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
text: ' ',
|
|
242
|
-
mediaUrl: ' ',
|
|
243
|
-
buttons: [
|
|
244
|
-
{ title: ' ', action: 'https://example.com/2' },
|
|
245
|
-
],
|
|
246
|
-
},
|
|
247
|
-
],
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
render(
|
|
253
|
-
<TestWrapper>
|
|
254
|
-
<ComponentToRender {...props} />
|
|
255
|
-
</TestWrapper>
|
|
256
|
-
);
|
|
257
|
-
|
|
258
|
-
expect(screen.getByText('No content available')).toBeTruthy();
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
it('should render carousel cards when type is CAROUSEL', () => {
|
|
262
|
-
const props = {
|
|
263
|
-
...defaultProps,
|
|
264
|
-
content: {
|
|
265
|
-
viberPreviewContent: {
|
|
266
|
-
type: 'CAROUSEL',
|
|
267
|
-
cards: [
|
|
268
|
-
{
|
|
269
|
-
text: 'Card 1 text',
|
|
270
|
-
mediaUrl: 'https://image.url/card1.jpg',
|
|
271
|
-
buttons: [
|
|
272
|
-
{ title: 'Button 1', action: 'https://example.com/1' },
|
|
273
|
-
],
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
text: 'Card 2 text',
|
|
277
|
-
mediaUrl: 'https://image.url/card2.jpg',
|
|
278
|
-
buttons: [
|
|
279
|
-
{ title: 'Button 2', action: 'https://example.com/2' },
|
|
280
|
-
],
|
|
281
|
-
},
|
|
282
|
-
],
|
|
283
|
-
},
|
|
284
|
-
},
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
render(
|
|
288
|
-
<TestWrapper>
|
|
289
|
-
<ComponentToRender {...props} />
|
|
290
|
-
</TestWrapper>
|
|
291
|
-
);
|
|
292
|
-
|
|
293
|
-
expect(screen.getByText('Card 1 text')).toBeTruthy();
|
|
294
|
-
expect(screen.getByText('Card 2 text')).toBeTruthy();
|
|
295
|
-
expect(screen.getByText('Button 1')).toBeTruthy();
|
|
296
|
-
expect(screen.getByText('Button 2')).toBeTruthy();
|
|
297
|
-
});
|
|
298
|
-
|
|
299
|
-
it('should not render empty carousel button placeholder', () => {
|
|
300
|
-
const props = {
|
|
301
|
-
...defaultProps,
|
|
302
|
-
content: {
|
|
303
|
-
viberPreviewContent: {
|
|
304
|
-
type: 'CAROUSEL',
|
|
305
|
-
cards: [
|
|
306
|
-
{
|
|
307
|
-
text: 'Card 1 text',
|
|
308
|
-
mediaUrl: 'https://image.url/card1.jpg',
|
|
309
|
-
buttons: [
|
|
310
|
-
{ title: '', action: 'https://example.com/1' },
|
|
311
|
-
{ title: ' ', action: 'https://example.com/2' },
|
|
312
|
-
],
|
|
313
|
-
},
|
|
314
|
-
],
|
|
315
|
-
},
|
|
316
|
-
},
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
const { container } = render(
|
|
320
|
-
<TestWrapper>
|
|
321
|
-
<ComponentToRender {...props} />
|
|
322
|
-
</TestWrapper>
|
|
323
|
-
);
|
|
324
|
-
|
|
325
|
-
expect(container.querySelector('.viber-carousel-preview-button')).toBeNull();
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
it('should show carousel shell when showCarouselEditorPreview is true even if cards are empty', () => {
|
|
329
|
-
const props = {
|
|
330
|
-
...defaultProps,
|
|
331
|
-
content: {
|
|
332
|
-
viberPreviewContent: {
|
|
333
|
-
type: 'CAROUSEL',
|
|
334
|
-
showCarouselEditorPreview: true,
|
|
335
|
-
cards: [
|
|
336
|
-
{ text: '', mediaUrl: '', buttons: [{ title: '', action: '' }] },
|
|
337
|
-
{ text: '', mediaUrl: '', buttons: [{ title: '', action: '' }] },
|
|
338
|
-
],
|
|
339
|
-
},
|
|
340
|
-
},
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
const { container } = render(
|
|
344
|
-
<TestWrapper>
|
|
345
|
-
<ComponentToRender {...props} />
|
|
346
|
-
</TestWrapper>
|
|
347
|
-
);
|
|
348
|
-
|
|
349
|
-
expect(screen.queryByText('No content available')).toBeNull();
|
|
350
|
-
expect(container.querySelector('.viber-carousel-preview-scroll')).toBeTruthy();
|
|
351
|
-
expect(container.querySelector('.viber-carousel-message-box-placeholder')).toBeTruthy();
|
|
352
|
-
});
|
|
353
|
-
|
|
354
|
-
it('should render carousel message text in message box when type is CAROUSEL', () => {
|
|
355
|
-
const props = {
|
|
356
|
-
...defaultProps,
|
|
357
|
-
content: {
|
|
358
|
-
viberPreviewContent: {
|
|
359
|
-
type: 'CAROUSEL',
|
|
360
|
-
messageContent: 'Carousel intro copy',
|
|
361
|
-
cards: [
|
|
362
|
-
{
|
|
363
|
-
text: 'Card text',
|
|
364
|
-
mediaUrl: 'https://image.url/c.jpg',
|
|
365
|
-
buttons: [{ title: 'Go', action: 'https://example.com' }],
|
|
366
|
-
},
|
|
367
|
-
],
|
|
368
|
-
},
|
|
369
|
-
},
|
|
370
|
-
};
|
|
371
|
-
|
|
372
|
-
const { container } = render(
|
|
373
|
-
<TestWrapper>
|
|
374
|
-
<ComponentToRender {...props} />
|
|
375
|
-
</TestWrapper>
|
|
376
|
-
);
|
|
377
|
-
|
|
378
|
-
expect(container.querySelector('.viber-carousel-message-box-text')).toHaveTextContent('Carousel intro copy');
|
|
379
|
-
expect(screen.queryByText('Carousel intro copy')).toBeTruthy();
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
it('should hide account icon when carousel is shown', () => {
|
|
383
|
-
const props = {
|
|
384
|
-
...defaultProps,
|
|
385
|
-
content: {
|
|
386
|
-
viberPreviewContent: {
|
|
387
|
-
type: 'CAROUSEL',
|
|
388
|
-
cards: [
|
|
389
|
-
{
|
|
390
|
-
text: 'Carousel card line',
|
|
391
|
-
mediaUrl: '',
|
|
392
|
-
buttons: [{ title: 'Open link', action: 'https://x.com' }],
|
|
393
|
-
},
|
|
394
|
-
],
|
|
395
|
-
},
|
|
396
|
-
},
|
|
397
|
-
};
|
|
398
|
-
|
|
399
|
-
const { container } = render(
|
|
400
|
-
<TestWrapper>
|
|
401
|
-
<ComponentToRender {...props} />
|
|
402
|
-
</TestWrapper>
|
|
403
|
-
);
|
|
404
|
-
|
|
405
|
-
expect(container.querySelector('.viber-account-icon')).toBeNull();
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
it('should use image placeholder when carousel card mediaUrl is whitespace only', () => {
|
|
409
|
-
const props = {
|
|
410
|
-
...defaultProps,
|
|
411
|
-
content: {
|
|
412
|
-
viberPreviewContent: {
|
|
413
|
-
type: 'CAROUSEL',
|
|
414
|
-
cards: [
|
|
415
|
-
{
|
|
416
|
-
text: 'Only text',
|
|
417
|
-
mediaUrl: ' ',
|
|
418
|
-
buttons: [{ title: 'Btn', action: 'https://example.com' }],
|
|
419
|
-
},
|
|
420
|
-
],
|
|
421
|
-
},
|
|
422
|
-
},
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
const { container } = render(
|
|
426
|
-
<TestWrapper>
|
|
427
|
-
<ComponentToRender {...props} />
|
|
428
|
-
</TestWrapper>
|
|
429
|
-
);
|
|
430
|
-
|
|
431
|
-
expect(container.querySelector('.viber-carousel-preview-image-placeholder')).toBeTruthy();
|
|
432
|
-
expect(container.querySelector('.viber-carousel-preview-image')).toBeNull();
|
|
433
|
-
});
|
|
434
|
-
|
|
435
|
-
it('should render at most two carousel buttons per card', () => {
|
|
436
|
-
const props = {
|
|
437
|
-
...defaultProps,
|
|
438
|
-
content: {
|
|
439
|
-
viberPreviewContent: {
|
|
440
|
-
type: 'CAROUSEL',
|
|
441
|
-
cards: [
|
|
442
|
-
{
|
|
443
|
-
text: 'Card',
|
|
444
|
-
mediaUrl: 'https://image.url/c.jpg',
|
|
445
|
-
buttons: [
|
|
446
|
-
{ title: 'One', action: 'https://a.com' },
|
|
447
|
-
{ title: 'Two', action: 'https://b.com' },
|
|
448
|
-
{ title: 'Three', action: 'https://c.com' },
|
|
449
|
-
],
|
|
450
|
-
},
|
|
451
|
-
],
|
|
452
|
-
},
|
|
453
|
-
},
|
|
454
|
-
};
|
|
455
|
-
|
|
456
|
-
const { container } = render(
|
|
457
|
-
<TestWrapper>
|
|
458
|
-
<ComponentToRender {...props} />
|
|
459
|
-
</TestWrapper>
|
|
460
|
-
);
|
|
461
|
-
|
|
462
|
-
expect(container.querySelectorAll('.viber-carousel-preview-button')).toHaveLength(2);
|
|
463
|
-
expect(screen.getByText('One')).toBeTruthy();
|
|
464
|
-
expect(screen.getByText('Two')).toBeTruthy();
|
|
465
|
-
expect(screen.queryByText('Three')).toBeNull();
|
|
466
|
-
});
|
|
467
|
-
|
|
468
|
-
it('should apply secondary class to second carousel button', () => {
|
|
469
|
-
const props = {
|
|
470
|
-
...defaultProps,
|
|
471
|
-
content: {
|
|
472
|
-
viberPreviewContent: {
|
|
473
|
-
type: 'CAROUSEL',
|
|
474
|
-
cards: [
|
|
475
|
-
{
|
|
476
|
-
text: 'Card',
|
|
477
|
-
mediaUrl: 'https://image.url/c.jpg',
|
|
478
|
-
buttons: [
|
|
479
|
-
{ title: 'Primary', action: 'https://a.com' },
|
|
480
|
-
{ title: 'Secondary', action: 'https://b.com' },
|
|
481
|
-
],
|
|
482
|
-
},
|
|
483
|
-
],
|
|
484
|
-
},
|
|
485
|
-
},
|
|
486
|
-
};
|
|
487
|
-
|
|
488
|
-
const { container } = render(
|
|
489
|
-
<TestWrapper>
|
|
490
|
-
<ComponentToRender {...props} />
|
|
491
|
-
</TestWrapper>
|
|
492
|
-
);
|
|
493
|
-
|
|
494
|
-
const buttons = container.querySelectorAll('.viber-carousel-preview-button');
|
|
495
|
-
expect(buttons[0].className).toContain('viber-carousel-preview-button');
|
|
496
|
-
expect(buttons[0].className).not.toContain('viber-carousel-preview-button-secondary');
|
|
497
|
-
expect(buttons[1].className).toContain('viber-carousel-preview-button-secondary');
|
|
498
|
-
});
|
|
499
|
-
|
|
500
|
-
it('should show carousel when only a button title is present on a card', () => {
|
|
501
|
-
const props = {
|
|
502
|
-
...defaultProps,
|
|
503
|
-
content: {
|
|
504
|
-
viberPreviewContent: {
|
|
505
|
-
type: 'CAROUSEL',
|
|
506
|
-
cards: [
|
|
507
|
-
{
|
|
508
|
-
text: '',
|
|
509
|
-
mediaUrl: '',
|
|
510
|
-
buttons: [{ title: 'Tap me', action: 'https://example.com' }],
|
|
511
|
-
},
|
|
512
|
-
],
|
|
513
|
-
},
|
|
514
|
-
},
|
|
515
|
-
};
|
|
516
|
-
|
|
517
|
-
render(
|
|
518
|
-
<TestWrapper>
|
|
519
|
-
<ComponentToRender {...props} />
|
|
520
|
-
</TestWrapper>
|
|
521
|
-
);
|
|
522
|
-
|
|
523
|
-
expect(screen.getByText('Tap me')).toBeTruthy();
|
|
524
|
-
expect(screen.queryByText('No content available')).toBeNull();
|
|
525
|
-
});
|
|
526
|
-
|
|
527
|
-
it('should show one placeholder card when editor preview and cards array is empty', () => {
|
|
528
|
-
const props = {
|
|
529
|
-
...defaultProps,
|
|
530
|
-
content: {
|
|
531
|
-
viberPreviewContent: {
|
|
532
|
-
type: 'CAROUSEL',
|
|
533
|
-
showCarouselEditorPreview: true,
|
|
534
|
-
cards: [],
|
|
535
|
-
},
|
|
536
|
-
},
|
|
537
|
-
};
|
|
538
|
-
|
|
539
|
-
const { container } = render(
|
|
540
|
-
<TestWrapper>
|
|
541
|
-
<ComponentToRender {...props} />
|
|
542
|
-
</TestWrapper>
|
|
543
|
-
);
|
|
544
|
-
|
|
545
|
-
expect(container.querySelectorAll('.viber-carousel-preview-card')).toHaveLength(1);
|
|
546
|
-
});
|
|
547
|
-
|
|
548
|
-
it('should show no content when CAROUSEL has empty cards and no editor preview flag', () => {
|
|
549
|
-
const props = {
|
|
550
|
-
...defaultProps,
|
|
551
|
-
content: {
|
|
552
|
-
viberPreviewContent: {
|
|
553
|
-
type: 'CAROUSEL',
|
|
554
|
-
cards: [],
|
|
555
|
-
},
|
|
556
|
-
},
|
|
557
|
-
};
|
|
558
|
-
|
|
559
|
-
render(
|
|
560
|
-
<TestWrapper>
|
|
561
|
-
<ComponentToRender {...props} />
|
|
562
|
-
</TestWrapper>
|
|
563
|
-
);
|
|
564
|
-
|
|
565
|
-
expect(screen.getByText('No content available')).toBeTruthy();
|
|
566
|
-
});
|
|
567
203
|
});
|
|
568
204
|
|
|
569
205
|
describe('Account and Brand Name', () => {
|
|
@@ -79,6 +79,69 @@ const errorMessageForTags = {
|
|
|
79
79
|
TAG_BRACKET_COUNT_MISMATCH_ERROR: 'tagBracketCountMismatchError'
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
+
// Isolated input for EMAIL template-name: only this tiny component re-renders on each keystroke.
|
|
83
|
+
// formData is updated only on blur (onCommit), eliminating all re-renders during typing.
|
|
84
|
+
class HighFreqInput extends React.Component {
|
|
85
|
+
constructor(props) {
|
|
86
|
+
super(props);
|
|
87
|
+
this.state = { localValue: props.value || '' };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
componentDidUpdate(prevProps) {
|
|
91
|
+
if (prevProps.value !== this.props.value && this.state.localValue !== this.props.value) {
|
|
92
|
+
this.setState({ localValue: this.props.value || '' });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
handleChange = (e) => {
|
|
97
|
+
this.setState({ localValue: e.target.value });
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
handleBlur = (e) => {
|
|
101
|
+
this.props.onCommit(this.state.localValue);
|
|
102
|
+
if (this.props.onBlur) this.props.onBlur(e);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
render() {
|
|
106
|
+
const { value: _v, onCommit: _oc, onBlur: _ob, ...rest } = this.props;
|
|
107
|
+
return <CapInput {...rest} value={this.state.localValue} onChange={this.handleChange} onBlur={this.handleBlur} />;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Isolated wrapper for EMAIL template-subject: blur-only commit, same as HighFreqInput.
|
|
112
|
+
class HighFreqTagInput extends React.Component {
|
|
113
|
+
constructor(props) {
|
|
114
|
+
super(props);
|
|
115
|
+
this.state = { localInputValue: props.inputValue || '' };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
componentDidUpdate(prevProps) {
|
|
119
|
+
if (prevProps.inputValue !== this.props.inputValue && this.state.localInputValue !== this.props.inputValue) {
|
|
120
|
+
this.setState({ localInputValue: this.props.inputValue || '' });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
handleInputChange = (e) => {
|
|
125
|
+
this.setState({ localInputValue: e.target.value });
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
handleBlur = () => {
|
|
129
|
+
this.props.onCommit(this.state.localInputValue);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
render() {
|
|
133
|
+
const { inputValue: _iv, onCommit: _oc, inputOnChange: _ic, ...rest } = this.props;
|
|
134
|
+
return (
|
|
135
|
+
<CapTagListWithInput
|
|
136
|
+
{...rest}
|
|
137
|
+
inputValue={this.state.localInputValue}
|
|
138
|
+
inputOnChange={this.handleInputChange}
|
|
139
|
+
inputProps={{ ...(this.props.inputProps || {}), onBlur: this.handleBlur }}
|
|
140
|
+
/>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
82
145
|
class FormBuilder extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
83
146
|
constructor(props) {
|
|
84
147
|
super(props);
|
|
@@ -352,6 +415,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
352
415
|
this.setState({tabCount: nextProps.tabCount});
|
|
353
416
|
}
|
|
354
417
|
if (nextProps.startValidation && nextProps.startValidation !== false && this.props.startValidation !== nextProps.startValidation) {
|
|
418
|
+
if (this.debouncedUpdateFormData) this.debouncedUpdateFormData.flush();
|
|
355
419
|
this.setState({checkValidation: true});
|
|
356
420
|
this.validateForm(null, null, true, true, () => {
|
|
357
421
|
//triggering the saveFormData or onSubmit when validation sets isFormValid to TRUE
|
|
@@ -3410,40 +3474,62 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3410
3474
|
? formatMessage(messages.personalizationTagsErrorMessage)
|
|
3411
3475
|
: (errorType === TAG_BRACKET_COUNT_MISMATCH_ERROR ? formatMessage(globalMessages.unbalanacedCurlyBraces) : (val.errorMessage && ifError ? val.errorMessage : ''));
|
|
3412
3476
|
if (styling === 'semantic') {
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3477
|
+
const isEmailStandaloneHighFreq = val.standalone && this.props.schema?.channel?.toUpperCase() === 'EMAIL';
|
|
3478
|
+
if (isEmailStandaloneHighFreq) {
|
|
3479
|
+
columns.push(
|
|
3480
|
+
<CapColumn key={val.id} span={val.width} offset={val.offset} style={val.style || {}}>
|
|
3481
|
+
<HighFreqInput
|
|
3482
|
+
id={val.id}
|
|
3483
|
+
errorMessage={errorMessageText}
|
|
3484
|
+
label={val.label}
|
|
3485
|
+
inductiveText={val.inductiveText}
|
|
3486
|
+
className={`input-primary chart-name-input${ifError ? ' error' : ''}`}
|
|
3487
|
+
style={val.style ? val.style : {}}
|
|
3488
|
+
placeholder={val.placeholder}
|
|
3489
|
+
onCommit={(newValue) => this.performFormDataUpdate(newValue, val)}
|
|
3490
|
+
onBlur={(e) => this.handleFieldBlur(e, val)}
|
|
3491
|
+
value={value || ""}
|
|
3492
|
+
disabled={val.disabled}
|
|
3493
|
+
size={val.size || "default"}
|
|
3494
|
+
/>
|
|
3495
|
+
</CapColumn>
|
|
3496
|
+
);
|
|
3497
|
+
} else {
|
|
3498
|
+
columns.push(
|
|
3499
|
+
<CapColumn key={val.id} span={val.width} offset={val.offset} style={val.style || {}}>
|
|
3500
|
+
<CapInput
|
|
3501
|
+
id={val.id}
|
|
3502
|
+
errorMessage={errorMessageText}
|
|
3503
|
+
label={val.label}
|
|
3504
|
+
inductiveText={val.inductiveText}
|
|
3505
|
+
className={`input-primary chart-name-input${ifError ? ' error' : ''}`}
|
|
3506
|
+
// fluid={val.fluid}
|
|
3507
|
+
style={val.style ? val.style : {}}
|
|
3508
|
+
placeholder={val.placeholder}
|
|
3509
|
+
onChange={(e) => this.updateFormData(e.target.value, val)}
|
|
3510
|
+
onBlur={(e) => this.handleFieldBlur(e, val)}
|
|
3511
|
+
value={value || ""}
|
|
3512
|
+
defaultValue={isVersionEnable ? this.state.formData[`${this.state.currentTab - 1}`][val.id] : this.state.formData[val.id]}
|
|
3513
|
+
disabled={val.disabled}
|
|
3514
|
+
size={val.size || "default"}
|
|
3515
|
+
/>
|
|
3516
|
+
{this.props.schema?.channel === EMAIL &&
|
|
3517
|
+
!aiContentBotDisabled && (
|
|
3518
|
+
<CapAskAira.ContentGenerationBot
|
|
3519
|
+
text={value || ""}
|
|
3520
|
+
setText={this.handleSetText.bind(this, val)}
|
|
3521
|
+
iconPlacement="float-br"
|
|
3522
|
+
iconSize="1.6rem"
|
|
3523
|
+
rootStyle={{
|
|
3524
|
+
bottom: "0.2rem",
|
|
3525
|
+
right: "0.2rem",
|
|
3526
|
+
left: "auto",
|
|
3527
|
+
}}
|
|
3528
|
+
/>
|
|
3529
|
+
)}
|
|
3530
|
+
</CapColumn>
|
|
3531
|
+
);
|
|
3532
|
+
}
|
|
3447
3533
|
}
|
|
3448
3534
|
break;
|
|
3449
3535
|
|
|
@@ -3684,37 +3770,48 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3684
3770
|
isBEEAppEnableForCapTagList === false ||
|
|
3685
3771
|
channelForCapTagList !== 'EMAIL'
|
|
3686
3772
|
) {
|
|
3773
|
+
const isEmailStandaloneSubject = val.standalone && channelForCapTagList === 'EMAIL' && val.id === 'template-subject';
|
|
3774
|
+
const tagListProps = {
|
|
3775
|
+
key: `input-${val.id}`,
|
|
3776
|
+
inputId: val.id,
|
|
3777
|
+
inputValue: this.state.formData[val.id] || '',
|
|
3778
|
+
inputPlaceholder: val.placeholder || '',
|
|
3779
|
+
inputErrorMessage: val.errorMessage && ifError ? val.errorMessage : '',
|
|
3780
|
+
inputRequired: val.required || false,
|
|
3781
|
+
inputDisabled: val.disabled || false,
|
|
3782
|
+
headingText: val.label || '',
|
|
3783
|
+
headingStyle: val.headingStyle || { marginTop: '3%', marginRight: '79%' },
|
|
3784
|
+
headingType: "h4",
|
|
3785
|
+
onTagSelect: (data) => this.callChildEvent(data, val, 'onTagSelect'),
|
|
3786
|
+
onContextChange: this.props.onContextChange,
|
|
3787
|
+
location: this.props.location,
|
|
3788
|
+
tags: this.props.tags ? this.props.tags : [],
|
|
3789
|
+
injectedTags: this.props.injectedTags ? this.props.injectedTags : {},
|
|
3790
|
+
className: val.className ? val.className : '',
|
|
3791
|
+
userLocale: this.state.translationLang,
|
|
3792
|
+
selectedOfferDetails: this.props.selectedOfferDetails,
|
|
3793
|
+
eventContextTags: this.props?.eventContextTags,
|
|
3794
|
+
waitEventContextTags: this.props?.waitEventContextTags,
|
|
3795
|
+
moduleFilterEnabled: moduleFilterEnabledForCapTagList,
|
|
3796
|
+
containerStyle: val.style || {},
|
|
3797
|
+
inputProps: val.inputProps || {},
|
|
3798
|
+
showInput: val.showInput !== false,
|
|
3799
|
+
showTagList: val.showTagList !== false,
|
|
3800
|
+
restrictPersonalization: this.props.restrictPersonalization,
|
|
3801
|
+
};
|
|
3687
3802
|
columns.push(
|
|
3688
3803
|
<CapColumn key={`input-${val.id}`} offset={val.offset} span={val.width ? val.width : ''} style={val.style ? val.style : {marginBottom: '16px'}}>
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
headingType="h4"
|
|
3701
|
-
onTagSelect={(data) => this.callChildEvent(data, val, 'onTagSelect')}
|
|
3702
|
-
onContextChange={this.props.onContextChange}
|
|
3703
|
-
location={this.props.location}
|
|
3704
|
-
tags={this.props.tags ? this.props.tags : []}
|
|
3705
|
-
injectedTags={this.props.injectedTags ? this.props.injectedTags : {}}
|
|
3706
|
-
className={val.className ? val.className : ''}
|
|
3707
|
-
userLocale={this.state.translationLang}
|
|
3708
|
-
selectedOfferDetails={this.props.selectedOfferDetails}
|
|
3709
|
-
eventContextTags={this.props?.eventContextTags}
|
|
3710
|
-
waitEventContextTags={this.props?.waitEventContextTags}
|
|
3711
|
-
moduleFilterEnabled={moduleFilterEnabledForCapTagList}
|
|
3712
|
-
containerStyle={val.style || {}}
|
|
3713
|
-
inputProps={val.inputProps || {}}
|
|
3714
|
-
showInput={val.showInput !== false}
|
|
3715
|
-
showTagList={val.showTagList !== false}
|
|
3716
|
-
restrictPersonalization={this.props.restrictPersonalization}
|
|
3717
|
-
/>
|
|
3804
|
+
{isEmailStandaloneSubject ? (
|
|
3805
|
+
<HighFreqTagInput
|
|
3806
|
+
{...tagListProps}
|
|
3807
|
+
onCommit={(newValue) => this.performFormDataUpdate(newValue, val)}
|
|
3808
|
+
/>
|
|
3809
|
+
) : (
|
|
3810
|
+
<CapTagListWithInput
|
|
3811
|
+
{...tagListProps}
|
|
3812
|
+
inputOnChange={(e) => this.updateFormData(e.target.value, val)}
|
|
3813
|
+
/>
|
|
3814
|
+
)}
|
|
3718
3815
|
</CapColumn>
|
|
3719
3816
|
);
|
|
3720
3817
|
}
|