@capillarytech/creatives-library 7.5.7 → 7.5.8

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.5.7",
4
+ "version": "7.5.8",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -274,6 +274,11 @@ function CapVideoUpload(props) {
274
274
  <CapHeading.CapHeadingSpan type="h6" className="video-description">
275
275
  <FormattedMessage {...messages.videoRatioDescription} />
276
276
 
277
+ </CapHeading.CapHeadingSpan>
278
+ {' '}
279
+ <CapHeading.CapHeadingSpan type="h6" className="video-description file-format">
280
+ <FormattedMessage {...messages.fileFormat} />
281
+
277
282
  </CapHeading.CapHeadingSpan>
278
283
  <CapHeading.CapHeadingSpan type="h6" className="video-description video-details">
279
284
  <FormattedMessage {...messages.videoSizeDescription} values={{size: bytes2Size(videoSize)}} />
@@ -24,6 +24,9 @@ $classPrefix: cap-custom-video-upload;
24
24
  .video-details{
25
25
  float: right;
26
26
  position: absolute;
27
- right: 40px;
27
+ right: 55px;
28
+ }
29
+ .file-format{
30
+ padding-left:9%;
28
31
  }
29
32
  }
@@ -51,4 +51,8 @@ export default defineMessages({
51
51
  id: `${scope}.imageReUpload`,
52
52
  defaultMessage: 'Re upload',
53
53
  },
54
+ fileFormat: {
55
+ id: `${scope}.fileFormat`,
56
+ defaultMessage: 'File formats: MP4',
57
+ },
54
58
  });
@@ -28,9 +28,9 @@ import {
28
28
  IMAGE,
29
29
  VIDEO,
30
30
  CAROUSEL,
31
+ NO_CALL_TO_ACTION,
31
32
  } from '../../v2Containers/Facebook/Advertisement/constant';
32
33
 
33
- const NO_CALL_TO_ACTION = 'NO_CALL_TO_ACTION';
34
34
 
35
35
  export const CapFacebookPreview = (props) => {
36
36
  const {
@@ -10,3 +10,4 @@ export const IMAGE = 'IMAGE';
10
10
  export const VIDEO = 'VIDEO';
11
11
  export const CAROUSEL = 'CAROUSEL';
12
12
  export const IMAGE_VIDEO = 'imageVideo';
13
+ export const NO_CALL_TO_ACTION = 'NO_CALL_TO_ACTION';
@@ -52,6 +52,7 @@ import {
52
52
  VIDEO,
53
53
  CAROUSEL,
54
54
  IMAGE_VIDEO,
55
+ NO_CALL_TO_ACTION,
55
56
  } from './constant';
56
57
 
57
58
  export const Advertisement = (props) => {
@@ -105,7 +106,7 @@ export const Advertisement = (props) => {
105
106
  const [primaryText, setPrimaryText] = useState('');
106
107
  const [pageId, setPageId] = useState(false);
107
108
  const [displayLink, setDisplayLink] = useState('');
108
- const [callToAction, setCallToAction] = useState("NO_CALL_TO_ACTION");
109
+ const [callToAction, setCallToAction] = useState(NO_CALL_TO_ACTION);
109
110
  const [callToActionError, setCallToActionError] = useState(false);
110
111
  const [messageTitle, updateMessageTitle] = useState('');
111
112
  const [step, updateStep] = useState('modeSelection');
@@ -428,6 +429,7 @@ export const Advertisement = (props) => {
428
429
  flag = true;
429
430
  return flag;
430
431
  }
432
+ const subTypes = [];
431
433
  carouselData.forEach((obj) => {
432
434
  const {
433
435
  webSiteLink,
@@ -444,17 +446,19 @@ export const Advertisement = (props) => {
444
446
  } else if (Object.keys(videoData).length === 0 && subType === VIDEO) {
445
447
  flag = true;
446
448
  }
447
- if (subType === VIDEO) {
448
- if (callToAction === "NO_CALL_TO_ACTION" && !callToActionError) {
449
- setCallToActionError(messages.callToActionMandatoryError);
450
- flag = true;
451
- } else if (callToAction !== "NO_CALL_TO_ACTION" && callToActionError) {
452
- setCallToActionError(false);
453
- }
454
- }
449
+ subTypes.push(subType);
455
450
  });
456
- if (callToAction === "NO_CALL_TO_ACTION" && callToActionError) {
457
- flag = true;
451
+ if (subTypes.includes(VIDEO) ) {
452
+ if (callToAction === NO_CALL_TO_ACTION && !callToActionError) {
453
+ setCallToActionError(messages.callToActionMandatoryError);
454
+ flag = true;
455
+ } else if (callToAction !== NO_CALL_TO_ACTION && callToActionError) {
456
+ setCallToActionError(false);
457
+ flag = false;
458
+ }
459
+ } else if (callToActionError) {
460
+ setCallToActionError(false);
461
+ flag = false;
458
462
  }
459
463
  return flag;
460
464
  }, [
@@ -547,6 +551,7 @@ export const Advertisement = (props) => {
547
551
  onChange={onChangePrimaryText}
548
552
  defaultValue={primaryText || ''}
549
553
  value={primaryText || ''}
554
+ maxLength={125}
550
555
  rows={3}
551
556
  cols={2}
552
557
  placeholder={formatMessage(messages.primaryTextPlaceholder)}
@@ -856,7 +861,7 @@ export const Advertisement = (props) => {
856
861
  <div className="cap-header-facebook-ad">
857
862
  <CapHeading
858
863
  type="h2"
859
- style={{display: 'inline'}}
864
+ className="truncate-text"
860
865
  >
861
866
  {editNameState ? <CapInput
862
867
  type="input"
@@ -12,6 +12,13 @@ $classPrefix: add-facebook-ad-section;
12
12
  padding: 0;
13
13
  }
14
14
  }
15
+ .truncate-text{
16
+ overflow: hidden;
17
+ text-overflow: ellipsis;
18
+ white-space: nowrap;
19
+ min-width: 112px;
20
+ max-width: 920px;
21
+ }
15
22
  .cap-header-facebook-ad{
16
23
  position: fixed;
17
24
  top: 27px;
@@ -29,15 +36,22 @@ $classPrefix: add-facebook-ad-section;
29
36
  margin-left: 6px;
30
37
  }
31
38
  }
32
- .cap-image-upload-CAROUSEL{
39
+ .cap-custom-image-upload{
33
40
  .dragger-button.re-upload{
34
- margin-top: 90px;
35
- top: 0;
41
+ margin-top: 50px;
42
+ top: 0px;
36
43
  position: absolute;
37
- right: 80;
44
+ right: 60px;
38
45
  color: $FONT_COLOR_05;
39
46
  }
47
+ .cap-image-upload-CAROUSEL{
48
+ .dragger-button.re-upload{
49
+ margin-top: 90px;
50
+ right: 0px;
51
+ }
52
+ }
40
53
  }
54
+
41
55
  .facebook-ad-type-card{
42
56
  .ant-card-body {
43
57
  display:flex;
@@ -422,7 +422,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
422
422
  }
423
423
  if (!nextProps.Templates.deleteTemplateInProgress && !isEqual(nextProps.Templates.deleteTemplateInProgress, this.props.Templates.deleteTemplateInProgress) &&
424
424
  nextProps.Templates.deleteResponse) {
425
- const message = `${this.state.channel.toUpperCase()} ${this.props.intl.formatMessage(messages['Template deleted successfully'])}`;
425
+ const message = `${this.state.channel} ${this.props.intl.formatMessage(messages['Template deleted successfully'])}`;
426
426
  CapNotification.success({key: 'deleteSucess', message});
427
427
  this.getAllTemplates({params, resetPage: true});
428
428
  }
@@ -1802,7 +1802,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1802
1802
  const isMobilePushChannel = channel === MOBILE_PUSH;
1803
1803
  const isLineChannel = channel === LINE;
1804
1804
 
1805
-
1805
+
1806
1806
  if ((isWechatChannel || isMobilePushChannel || isLineChannel) && !isEmpty(weCrmAccounts)) {
1807
1807
  forEach(weCrmAccounts, (account) => {
1808
1808
  if ((isWechatChannel && account.configs && account.configs.is_wecrm_enabled) || isMobilePushChannel || isLineChannel) {