@capillarytech/creatives-library 7.12.27 → 7.12.29

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.12.27",
4
+ "version": "7.12.29",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -95,7 +95,7 @@ export const CapActionButton = (props) => {
95
95
  {/* Add button */}
96
96
  <CapTooltip
97
97
  placement="topLeft"
98
- title={formatMessage(globalMessages.comingSoonTooltip)}
98
+ title={formatMessage(messages.comingSoonTooltip)}
99
99
  >
100
100
  <CapButton
101
101
  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
  });
@@ -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>
@@ -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`,
@@ -8,6 +8,7 @@ import {
8
8
  CREATE_TRAI_SMS_TEMPLATE_REQUEST,
9
9
  CLEAR_TRAI_SMS_TEMPLATE_CREATE_RESPONSE_REQUEST,
10
10
  CHECK_TRAI_SMS_DUPLICATE_TEMPLATE_NAME_REQUEST,
11
+ CHECK_TRAI_SMS_DUPLICATE_TEMPLATE_NAME_SUCCESS,
11
12
  } from './constants';
12
13
 
13
14
  export function createSMSTRAITemplates(templates, callback) {
@@ -29,4 +30,11 @@ export function checkDuplicatesInDb(payload) {
29
30
  type: CHECK_TRAI_SMS_DUPLICATE_TEMPLATE_NAME_REQUEST,
30
31
  payload,
31
32
  };
32
- }
33
+ }
34
+
35
+ export function doneCheckingDuplicates(data) {
36
+ return {
37
+ type: CHECK_TRAI_SMS_DUPLICATE_TEMPLATE_NAME_SUCCESS,
38
+ data,
39
+ };
40
+ }
@@ -428,7 +428,15 @@ export const SmsTraiCreate = (props) => {
428
428
  setUploadValidated(true);
429
429
  setValidatedData(transformedResults);
430
430
  setTemplateRegistrationIndex(templateIdIndex);
431
- actions.checkDuplicatesInDb(checkInDb);
431
+ if (checkInDb.length > 0) {
432
+ actions.checkDuplicatesInDb(checkInDb);
433
+ } else {
434
+ const data = {
435
+ templateId: [],
436
+ count: 0,
437
+ }
438
+ actions.doneCheckingDuplicates(data);
439
+ }
432
440
  };
433
441
 
434
442
  const checkDuplicateTemplateNameInCSV = (