@capillarytech/creatives-library 7.12.28 → 7.12.30

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.
@@ -1,8 +1,8 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`galleryReducer Initial State should match snapshot returns the initial state 1`] = `
4
- Object {
5
- "assetList": Array [],
4
+ Immutable.Map {
5
+ "assetList": Immutable.List [],
6
6
  "assetUploading": false,
7
7
  "fetchingAllAssets": false,
8
8
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.12.28",
4
+ "version": "7.12.30",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -0,0 +1,30 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<CallTaskPreview /> Test if Call task component renders 1`] = `
4
+ <div
5
+ className="call-task-preview"
6
+ >
7
+ <img
8
+ alt="header"
9
+ className="call-task-image-undefined"
10
+ src="test-file-stub"
11
+ />
12
+ <div
13
+ className="call-task-subject-container-undefined"
14
+ >
15
+ this is test
16
+ </div>
17
+ <div
18
+ className="call-task-message-container-undefined"
19
+ />
20
+ <img
21
+ alt="footer"
22
+ src="test-file-stub"
23
+ style={
24
+ Object {
25
+ "width": "100%",
26
+ }
27
+ }
28
+ />
29
+ </div>
30
+ `;
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
4
4
 
@@ -11,7 +11,6 @@ import CapTooltip from '@capillarytech/cap-ui-library/CapTooltip';
11
11
  import CapLabel from '@capillarytech/cap-ui-library/CapLabel';
12
12
 
13
13
  import { isUrl } from '../../v2Containers/Line/Container/Wrapper/utils';
14
- import globalMessages from '../../v2Containers/Cap/messages';
15
14
  import messages from './messages';
16
15
  import './index.scss';
17
16
  export const CapActionButton = (props) => {
@@ -55,7 +54,12 @@ export const CapActionButton = (props) => {
55
54
 
56
55
  updateButtonURLErrorMessage(errorMessage);
57
56
  };
58
-
57
+ useEffect(() => {
58
+ const foo = document.querySelector('.cap-action-button');
59
+ foo.addEventListener('click', (event) => {
60
+ event.preventDefault();
61
+ });
62
+ }, []);
59
63
  return (<CapRow
60
64
  className="cap-action-button"
61
65
  >
@@ -95,7 +99,7 @@ export const CapActionButton = (props) => {
95
99
  {/* Add button */}
96
100
  <CapTooltip
97
101
  placement="topLeft"
98
- title={formatMessage(globalMessages.comingSoonTooltip)}
102
+ title={formatMessage(messages.comingSoonTooltip)}
99
103
  >
100
104
  <CapButton
101
105
  type="flat" className="disabled-button" isAddBtn>
@@ -26,4 +26,8 @@ export default defineMessages({
26
26
  id: `${prefix}.inValidUrlErrorMessage`,
27
27
  defaultMessage: 'Button URL is not valid',
28
28
  },
29
+ comingSoonTooltip: {
30
+ id: `${prefix}.comingSoonTooltip`,
31
+ defaultMessage: 'Right now only one Call to action button is enabled, in future you would be able to add upto 3 buttons.',
32
+ },
29
33
  });
@@ -62,7 +62,7 @@ exports[`CapActionButton test Test if CapActionButton component renders 1`] = `
62
62
  />
63
63
  <CapTooltip
64
64
  placement="topLeft"
65
- title="Not enabled yet. Coming soon!"
65
+ title="Right now only one Call to action button is enabled, in future you would be able to add upto 3 buttons."
66
66
  >
67
67
  <CapButton
68
68
  className="disabled-button"
@@ -137,7 +137,7 @@ exports[`CapActionButton test Test if CapActionButton component renders 2`] = `
137
137
  />
138
138
  <CapTooltip
139
139
  placement="topLeft"
140
- title="Not enabled yet. Coming soon!"
140
+ title="Right now only one Call to action button is enabled, in future you would be able to add upto 3 buttons."
141
141
  >
142
142
  <CapButton
143
143
  className="disabled-button"
@@ -96,7 +96,7 @@ function CapImageUpload(props) {
96
96
  error: true,
97
97
  };
98
98
  submitAction({fileParams}, incorrectFile);
99
- }
99
+ };
100
100
  if (e) {
101
101
  const event = e;
102
102
  event.target.value = null;
@@ -106,10 +106,10 @@ function CapImageUpload(props) {
106
106
  const submitAction = useCallback((data, incorrectFile) => {
107
107
  const {
108
108
  file,
109
- fileParams
109
+ fileParams,
110
110
  } = data || {};
111
111
  const { size } = file || {};
112
- const { height, width, error } = fileParams || {};
112
+ const { height, width, error } = fileParams || {};
113
113
  if (incorrectFile || size > imgSize || height > imgHeight || width > imgWidth || error) {
114
114
  updateImageErrorMessage(formatMessage(messages.imageIncorrectSize));
115
115
  } else {
@@ -140,9 +140,9 @@ function CapImageUpload(props) {
140
140
  }, []);
141
141
 
142
142
  const onGalleryImageSelect = useCallback((imageTemplate) => {
143
- const image = get(imageTemplate, 'metaInfo.secure_file_path');
143
+ const {secure_file_path: image, width, height, file_size: size} = get(imageTemplate, 'metaInfo', {});
144
144
  updateDrawerRequirement(false);
145
- if (!allowedExtensionsRegex.test(image)) {
145
+ if (!allowedExtensionsRegex.test(image) || height > imgHeight || width > imgWidth || size > imgSize ) {
146
146
  updateImageErrorMessage(formatMessage(messages.imageIncorrectSize));
147
147
  } else {
148
148
  updateImageErrorMessage('');
@@ -206,7 +206,7 @@ function CapImageUpload(props) {
206
206
  className="dragger-button re-upload"
207
207
  type="flat"
208
208
  onClick={onReUpload}
209
- style={ channelSpecificStyle ? { marginTop:'-16px'} : {}}
209
+ style={channelSpecificStyle ? { marginTop: '-16px'} : {}}
210
210
  >
211
211
  <FormattedMessage {...messages.imageReUpload} />
212
212
  </CapButton>
@@ -1,8 +1,8 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`galleryReducer Initial State should match snapshot returns the initial state 1`] = `
4
- Object {
5
- "assetList": Array [],
4
+ Immutable.Map {
5
+ "assetList": Immutable.List [],
6
6
  "assetUploading": false,
7
7
  "fetchingAllAssets": false,
8
8
  }
@@ -102,7 +102,6 @@ exports[`Test SlideBoxContent container Should render correct component for rcs
102
102
  ],
103
103
  "cardSettings": Object {
104
104
  "cardOrientation": "VERTICAL",
105
- "mediaAlignment": "RIGHT",
106
105
  },
107
106
  "cardType": "STANDALONE",
108
107
  "contentType": "RICHCARD",
@@ -125,7 +125,7 @@ export default defineMessages({
125
125
  },
126
126
  templateButtonDesc: {
127
127
  id: `${prefix}.templateButtonDesc`,
128
- defaultMessage: 'These will be show clickable buttons below your message.',
128
+ defaultMessage: 'Use buttons to redirect user to respective link or quick response/ action.',
129
129
  },
130
130
  templateCTAButton: {
131
131
  id: `${prefix}.templateCTAButton`,