@capillarytech/creatives-library 8.0.129 → 8.0.130

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.
Files changed (76) hide show
  1. package/containers/App/constants.js +0 -1
  2. package/containers/Templates/constants.js +10 -1
  3. package/containers/Templates/index.js +45 -45
  4. package/package.json +1 -1
  5. package/services/api.js +9 -7
  6. package/services/tests/haptic-api.test.js +387 -0
  7. package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +3 -8
  8. package/tests/integration/TemplateCreation/api-response.js +0 -5
  9. package/tests/integration/TemplateCreation/msw-handler.js +63 -42
  10. package/utils/common.js +0 -7
  11. package/utils/commonUtils.js +6 -2
  12. package/utils/tests/vendorDataTransformers.test.js +512 -0
  13. package/utils/vendorDataTransformers.js +108 -0
  14. package/v2Components/CapDocumentUpload/index.js +2 -2
  15. package/v2Components/CapImageUpload/index.js +46 -59
  16. package/v2Components/CapInAppCTA/index.js +0 -1
  17. package/v2Components/CapTagList/index.js +120 -177
  18. package/v2Components/CapVideoUpload/constants.js +0 -3
  19. package/v2Components/CapVideoUpload/index.js +110 -167
  20. package/v2Components/CapVideoUpload/messages.js +0 -16
  21. package/v2Components/Carousel/index.js +13 -15
  22. package/v2Components/ErrorInfoNote/style.scss +0 -1
  23. package/v2Components/MobilePushPreviewV2/index.js +5 -37
  24. package/v2Components/TemplatePreview/_templatePreview.scss +72 -114
  25. package/v2Components/TemplatePreview/index.js +50 -178
  26. package/v2Components/TemplatePreview/messages.js +0 -4
  27. package/v2Containers/CreativesContainer/SlideBoxContent.js +62 -127
  28. package/v2Containers/CreativesContainer/index.js +136 -191
  29. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +22 -0
  30. package/v2Containers/InApp/constants.js +0 -1
  31. package/v2Containers/InApp/index.js +13 -13
  32. package/v2Containers/MobilePush/Create/index.js +0 -1
  33. package/v2Containers/MobilePush/commonMethods.js +14 -7
  34. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +5 -5
  35. package/v2Containers/TagList/index.js +10 -56
  36. package/v2Containers/Templates/_templates.scss +1 -101
  37. package/v2Containers/Templates/index.js +41 -151
  38. package/v2Containers/Templates/messages.js +0 -8
  39. package/v2Containers/Templates/sagas.js +0 -2
  40. package/v2Containers/Whatsapp/constants.js +32 -1
  41. package/v2Containers/Whatsapp/index.js +104 -25
  42. package/v2Containers/Whatsapp/tests/haptic.test.js +405 -0
  43. package/utils/createPayload.js +0 -405
  44. package/utils/tests/createPayload.test.js +0 -785
  45. package/v2Components/CapMpushCTA/constants.js +0 -25
  46. package/v2Components/CapMpushCTA/index.js +0 -402
  47. package/v2Components/CapMpushCTA/index.scss +0 -95
  48. package/v2Components/CapMpushCTA/messages.js +0 -101
  49. package/v2Components/TemplatePreview/assets/images/Android _ With date and time.svg +0 -29
  50. package/v2Components/TemplatePreview/assets/images/android.svg +0 -9
  51. package/v2Components/TemplatePreview/assets/images/iOS _ With date and time.svg +0 -26
  52. package/v2Components/TemplatePreview/assets/images/ios.svg +0 -9
  53. package/v2Containers/MobilePushNew/actions.js +0 -116
  54. package/v2Containers/MobilePushNew/components/CtaButtons.js +0 -181
  55. package/v2Containers/MobilePushNew/components/MediaUploaders.js +0 -834
  56. package/v2Containers/MobilePushNew/components/PlatformContentFields.js +0 -345
  57. package/v2Containers/MobilePushNew/components/index.js +0 -5
  58. package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +0 -798
  59. package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +0 -2114
  60. package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +0 -343
  61. package/v2Containers/MobilePushNew/constants.js +0 -115
  62. package/v2Containers/MobilePushNew/hooks/tests/usePlatformSync.test.js +0 -1299
  63. package/v2Containers/MobilePushNew/hooks/tests/useUpload.test.js +0 -1223
  64. package/v2Containers/MobilePushNew/hooks/usePlatformSync.js +0 -246
  65. package/v2Containers/MobilePushNew/hooks/useUpload.js +0 -726
  66. package/v2Containers/MobilePushNew/index.js +0 -3412
  67. package/v2Containers/MobilePushNew/index.scss +0 -308
  68. package/v2Containers/MobilePushNew/messages.js +0 -242
  69. package/v2Containers/MobilePushNew/reducer.js +0 -160
  70. package/v2Containers/MobilePushNew/sagas.js +0 -198
  71. package/v2Containers/MobilePushNew/selectors.js +0 -55
  72. package/v2Containers/MobilePushNew/tests/reducer.test.js +0 -741
  73. package/v2Containers/MobilePushNew/tests/sagas.test.js +0 -863
  74. package/v2Containers/MobilePushNew/tests/selectors.test.js +0 -425
  75. package/v2Containers/MobilePushNew/tests/utils.test.js +0 -322
  76. package/v2Containers/MobilePushNew/utils.js +0 -33
@@ -22,9 +22,7 @@ import { isEmpty, get } from 'lodash';
22
22
  import './index.scss';
23
23
  import Gallery from '../../v2Containers/Assets/Gallery';
24
24
  import { MAX_SUPPORTED_IMAGE_SIZE } from './constants';
25
- import {
26
- FACEBOOK, INAPP, RCS, WHATSAPP, VIBER,
27
- } from "../../v2Containers/CreativesContainer/constants";
25
+ import { FACEBOOK, INAPP, RCS, WHATSAPP, VIBER } from "../../v2Containers/CreativesContainer/constants";
28
26
 
29
27
  import messages from './messages';
30
28
  function CapImageUpload(props) {
@@ -47,25 +45,19 @@ function CapImageUpload(props) {
47
45
  channel,
48
46
  channelSpecificStyle,
49
47
  showReUploadButton = true,
50
- disableAutoRestore = false, // New prop to disable automatic restoration
51
48
  } = props;
52
49
  const {
53
50
  formatMessage,
54
- } = intl || {};
51
+ } = intl || {};
55
52
 
56
53
 
57
54
  useEffect(() => {
58
- // Skip automatic restoration if disableAutoRestore is true
59
- if (disableAutoRestore) {
60
- return;
61
- }
62
-
63
55
  const imageDataObj = imageData[`uploadedAssetData${index}`];
64
56
  if (!isEmpty(imageDataObj)) {
65
- const { secure_file_path = '' } = get(imageDataObj, 'metaInfo', {});
66
- updateImageSrc(secure_file_path);
57
+ const { secure_file_path = '', karixFileHandle = '', hapticFileHandle = '' } = get(imageDataObj, 'metaInfo', {});
58
+ updateImageSrc(secure_file_path, hapticFileHandle || karixFileHandle);
67
59
  }
68
- }, [imageData[`uploadedAssetData${index}`], disableAutoRestore]);
60
+ }, [imageData[`uploadedAssetData${index}`]]);
69
61
 
70
62
  const [isImageError, updateImageErrorMessage] = useState(false);
71
63
  const [isDrawerRequired, updateDrawerRequirement] = useState(false);
@@ -73,7 +65,7 @@ function CapImageUpload(props) {
73
65
  const {CapHeadingSpan} = CapHeading;
74
66
  const ImageComponent = useCallback(
75
67
  () => (
76
- <>
68
+ <>
77
69
  {
78
70
  !isEmpty(imageSrc) ? (
79
71
  <div className={`image-container upload ${props.ifError ? 'error' : ''}`}>
@@ -82,10 +74,10 @@ function CapImageUpload(props) {
82
74
  )}
83
75
  </div>
84
76
  ) : null}
85
- </>
86
- ),
87
- [imageSrc],
88
- );
77
+ </>
78
+ ),
79
+ [imageSrc],
80
+ );
89
81
 
90
82
  const WithLabel = LabelHOC(ImageComponent);
91
83
 
@@ -155,13 +147,10 @@ function CapImageUpload(props) {
155
147
  const onReUpload = useCallback(() => {
156
148
  updateImageSrc('');
157
149
  updateOnReUpload();
158
- // Don't automatically trigger file dialog - let user choose between computer and gallery
159
150
  }, []);
160
151
 
161
152
  const onGalleryImageSelect = useCallback((imageTemplate) => {
162
- const {
163
- secure_file_path: image, width, height, file_size: size,
164
- } = get(imageTemplate, 'metaInfo', {});
153
+ const {secure_file_path: image, width, height, file_size: size} = get(imageTemplate, 'metaInfo', {});
165
154
  updateDrawerRequirement(false);
166
155
  if (!allowedExtensionsRegex.test(image) || height > imgHeight || width > imgWidth || size > imgSize ) {
167
156
  updateImageErrorMessage(formatMessage(messages.imageErrorDesc));
@@ -187,7 +176,7 @@ function CapImageUpload(props) {
187
176
  isFullMode={isFullMode}
188
177
  isLineAsset
189
178
  onGalleryImageSelect={onGalleryImageSelect}
190
- />
179
+ />
191
180
  </>
192
181
  );
193
182
  }, []);
@@ -205,35 +194,34 @@ function CapImageUpload(props) {
205
194
 
206
195
  const getImageSection = useCallback(() => {
207
196
  if (imageSrc === "") {
208
- return (
209
- <>
210
- <CapUploader.CapDragger
211
- customRequest={capUploaderCustomRequest}
212
- className="form-builder-dragger grey-background"
213
- showUploadList={!isImageError}
214
- >
215
- <CapHeading className="dragger-title" type="h7">
216
- <FormattedMessage {...messages.dragAndDrop} />
217
- </CapHeading>
218
- <CapHeading className="dragger-or" type="label6">
219
- <FormattedMessage {...messages.or} />
220
- </CapHeading>
221
- <CapButton className="dragger-button upload-image" type="secondary">
222
- <FormattedMessage {...messages.uploadComputer} />
197
+ return (<>
198
+ <CapUploader.CapDragger
199
+ customRequest={capUploaderCustomRequest}
200
+ className="form-builder-dragger grey-background"
201
+ showUploadList={!isImageError}
202
+ >
203
+ <CapHeading className="dragger-title" type="h7">
204
+ <FormattedMessage {...messages.dragAndDrop} />
205
+ </CapHeading>
206
+ <CapHeading className="dragger-or" type="label6">
207
+ <FormattedMessage {...messages.or} />
208
+ </CapHeading>
209
+ <CapButton className="dragger-button upload-image" type="secondary">
210
+ <FormattedMessage {...messages.uploadComputer} />
211
+ </CapButton>
212
+ {channel !== WHATSAPP && (
213
+ <CapButton
214
+ className="dragger-button gallery-select"
215
+ type="secondary"
216
+ onClick={onGalleryClick}
217
+ >
218
+ <FormattedMessage {...messages.uploadGallery} />
223
219
  </CapButton>
224
- {channel !== WHATSAPP && (
225
- <CapButton
226
- className="dragger-button gallery-select"
227
- type="secondary"
228
- onClick={onGalleryClick}
229
- >
230
- <FormattedMessage {...messages.uploadGallery} />
231
- </CapButton>
232
- )}
233
- </CapUploader.CapDragger>
234
- <CapError type="error" className="upload-image-error">
235
- {isImageError}
236
- </CapError>
220
+ )}
221
+ </CapUploader.CapDragger>
222
+ <CapError type="error" className="upload-image-error">
223
+ {isImageError}
224
+ </CapError>
237
225
  </>
238
226
  );
239
227
  }
@@ -254,26 +242,26 @@ function CapImageUpload(props) {
254
242
  return (
255
243
  <div style={style} className="cap-custom-image-upload">
256
244
  <WithLabel
257
- key="with-label"
245
+ key={`with-label`}
258
246
  ifError={!!isImageError}
259
247
 
260
- />
261
- <form encType="multipart/form-data" id="form" className={className}>
248
+ />
249
+ <form encType="multipart/form-data" id={`form`} className={className}>
262
250
  <input
263
- key="imgFile"
251
+ key={`imgFile`}
264
252
  style={{ display: 'none' }}
265
- id="imageFileName"
253
+ id="fileName"
266
254
  type="file"
267
255
  onChange={(e) => uploadImages(e, { files: e.target.files })}
268
256
  accept={supportedExtensions || "image/*"}
269
- />
257
+ />
270
258
  {getImageSection()}
271
259
  <CapDrawer
272
260
  content={getGalleryDrawerContent()}
273
261
  visible={isDrawerRequired}
274
262
  width={430}
275
263
  onClose={() => updateDrawerRequirement(false)}
276
- />
264
+ />
277
265
  </form>
278
266
  <div className="image-info-wrapper">
279
267
  {channel === WHATSAPP && (
@@ -321,7 +309,6 @@ CapImageUpload.propTypes = {
321
309
  index: PropTypes.number,
322
310
  channel: PropTypes.string,
323
311
  channelSpecificStyle: PropTypes.bool,
324
- disableAutoRestore: PropTypes.bool,
325
312
  };
326
313
 
327
314
  export default injectIntl(CapImageUpload);
@@ -38,7 +38,6 @@ export const CapInAppCTA = (props) => {
38
38
  deleteHandler,
39
39
  isEditFlow,
40
40
  deepLink,
41
- channel,
42
41
  } = props;
43
42
  const { formatMessage } = intl;
44
43
 
@@ -58,19 +58,14 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
58
58
  dynamicDateValue: '',
59
59
  showModal: false,
60
60
  translationLang: '',
61
- tagsList: [],
62
- selectedContext: 'Outbound',
63
- isLoadingLoyaltyTags: false,
64
- isLoadingContextChange: false,
61
+ tagsList: []
65
62
  };
66
63
  this.renderTags = this.renderTags.bind(this);
67
64
  this.getSearchedExpandedKeys = this.getSearchedExpandedKeys.bind(this);
68
65
  }
69
-
70
66
  getTranslationMappedLocale(locale) {
71
67
  return GET_TRANSLATION_MAPPED?.[locale];
72
68
  }
73
-
74
69
  componentDidMount() {
75
70
  const user = localStorage.getItem('user');
76
71
  let locale = 'en';
@@ -84,36 +79,17 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
84
79
  });
85
80
  }
86
81
 
87
- componentDidUpdate(prevProps, prevState) {
82
+ componentDidUpdate(prevProps, prevState){
88
83
  if (this.props.tags !== prevProps.tags || this.state.searchValue !== prevState.searchValue) {
89
- const temp = this.renderTags(this.props.tags, this.state.searchValue);
90
- this.setState({
91
- tagsList: temp,
92
- });
93
- }
94
-
95
- // Reset loading states when tags are received after context change
96
- if ((this.state.isLoadingLoyaltyTags || this.state.isLoadingContextChange)
97
- && this.props.tags !== prevProps.tags) {
84
+ let temp = this.renderTags(this.props.tags, this.state.searchValue);
98
85
  this.setState({
99
- isLoadingLoyaltyTags: false,
100
- isLoadingContextChange: false,
101
- });
102
- }
103
-
104
- // Backup: Reset loading states if props.loading changed from true to false
105
- // This handles cases where the API doesn't return different tags but injectedTags change
106
- if (prevProps.loading === true && this.props.loading === false
107
- && (this.state.isLoadingLoyaltyTags || this.state.isLoadingContextChange)) {
108
- this.setState({
109
- isLoadingLoyaltyTags: false,
110
- isLoadingContextChange: false,
86
+ tagsList: temp
111
87
  });
112
88
  }
113
89
  }
114
90
 
115
91
  onChange = (e) => {
116
- const {value} = e.target;
92
+ const value = e.target.value;
117
93
  let expandedKeys = this.getSearchedExpandedKeys(this.props.tags, value);
118
94
  if (value === '') {
119
95
  expandedKeys = [];
@@ -124,7 +100,6 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
124
100
  autoExpandParent: true,
125
101
  });
126
102
  };
127
-
128
103
  onExpand = (expandedKeys, info) => {
129
104
  this.handleOnExpand(info.node.props.eventKey);
130
105
  };
@@ -132,25 +107,26 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
132
107
  getSearchedExpandedKeys(tags, value = '') {
133
108
  let list = [];
134
109
  _.forEach(tags, (val = {}, key) => {
135
- const tagName = typeof val?.name === STRING
136
- ? _.toLower(_.get(val, "name", ""))
137
- : _.toLower(_.get(val, "name.props.defaultMessage", ""));
110
+ const tagName =
111
+ typeof val?.name === STRING
112
+ ? _.toLower(_.get(val, "name", ""))
113
+ : _.toLower(_.get(val, "name.props.defaultMessage", ""));
138
114
  const tagNameWithoutUnderscore = tagName.replace(/_/g, " ");
139
115
  const searchStringLower = _.toLower(value);
140
116
  if (_.has(val, "subtags")) {
141
117
  if (
142
- val?.name
143
- && (tagName.includes(searchStringLower)
144
- || tagNameWithoutUnderscore.includes(searchStringLower))
118
+ val?.name &&
119
+ (tagName.includes(searchStringLower) ||
120
+ tagNameWithoutUnderscore.includes(searchStringLower))
145
121
  ) {
146
122
  list.push(key);
147
123
  }
148
124
  const temp = this.getSearchedExpandedKeys(val?.subtags, value);
149
125
  list = list.concat(temp);
150
126
  } else if (
151
- val?.name
152
- && (tagName.includes(searchStringLower)
153
- || tagNameWithoutUnderscore.includes(searchStringLower))
127
+ val?.name &&
128
+ (tagName.includes(searchStringLower) ||
129
+ tagNameWithoutUnderscore.includes(searchStringLower))
154
130
  ) {
155
131
  list.push(key);
156
132
  }
@@ -159,21 +135,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
159
135
  }
160
136
 
161
137
  handleOnChange = (data) => {
162
- const { selectedContext } = this.state;
163
-
164
- // Only proceed if the context has actually changed
165
- if (selectedContext !== data) {
166
- // Set loading state for any context change
167
- this.setState({
168
- isLoadingContextChange: true,
169
- selectedContext: data,
170
- // Keep loyalty-specific loading for backward compatibility
171
- isLoadingLoyaltyTags: data === 'Loyalty',
172
- });
173
-
174
- // Call the parent's context change handler
175
- this.props.onContextChange(data);
176
- }
138
+ this.props.onContextChange(data);
177
139
  };
178
140
 
179
141
  handleDynamicDateChange = (data) => {
@@ -230,7 +192,6 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
230
192
  }
231
193
  this.setState({expandedKeys, autoExpandParent: false});
232
194
  };
233
-
234
195
  togglePopoverVisibility = (visible) => {
235
196
  this.setState({visible});
236
197
  };
@@ -239,11 +200,9 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
239
200
  this.setState({showModal: true, visible: false});
240
201
  };
241
202
 
242
- renderTags = (tags) => {
203
+ renderTags(tags) {
243
204
  const searchString = this.state.searchValue || '';
244
- const {
245
- disableRelatedTags, childTagsToDisable, parentTagstoDisable,
246
- } = this?.props?.disableTagsDetails;
205
+ const { disableRelatedTags, childTagsToDisable, parentTagstoDisable, showCardsRelatedTags } = this?.props?.disableTagsDetails;
247
206
  const { accessibleFeatures = [] } = this?.props?.currentOrgDetails || {};
248
207
  const hideDateTagsForJpLocale = accessibleFeatures.includes(JP_LOCALE_HIDE_FEATURE);
249
208
  const list = [];
@@ -267,14 +226,16 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
267
226
  supportedTagsString += `${supportedTag} ,`;
268
227
  });
269
228
  supportedTagsString = supportedTagsString.replace(/,\s*$/, "");
270
- const tagName = typeof val?.name === STRING
271
- ? _.toLower(_.get(val, "name", ""))
272
- : _.toLower(_.get(val, "name.props.defaultMessage", ""));
229
+ const tagName =
230
+ typeof val?.name === STRING
231
+ ? _.toLower(_.get(val, "name", ""))
232
+ : _.toLower(_.get(val, "name.props.defaultMessage", ""));
273
233
  const tagNameWithoutUnderscore = tagName.replace(/_/g, " ");
274
234
  const searchStringLower = _.toLower(searchString);
275
- const tagContainsSearchedString = searchStringLower
276
- && (tagName.includes(searchStringLower)
277
- || tagNameWithoutUnderscore.includes(searchStringLower));
235
+ const tagContainsSearchedString =
236
+ searchStringLower &&
237
+ (tagName.includes(searchStringLower) ||
238
+ tagNameWithoutUnderscore.includes(searchStringLower));
278
239
  if (_.has(val, 'subtags')) {
279
240
  const disabled = disableRelatedTags ? parentTagstoDisable.includes(key) : false;
280
241
  const temp = this.renderTags(val?.subtags);
@@ -325,8 +286,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
325
286
  : `${key}`
326
287
  }
327
288
  disabled={childDisabled}
328
- >
329
- </CapTreeNode>
289
+ ></CapTreeNode>
330
290
  );
331
291
  hidingDateTagsForJpLocale(
332
292
  hideDateTagsForJpLocale,
@@ -361,8 +321,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
361
321
  : `${key}`
362
322
  }
363
323
  disabled={childDisabled}
364
- >
365
- </CapTreeNode>
324
+ ></CapTreeNode>
366
325
  );
367
326
  hidingDateTagsForJpLocale(
368
327
  hideDateTagsForJpLocale,
@@ -375,23 +334,14 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
375
334
  });
376
335
  return list;
377
336
  }
378
-
379
337
  openTranslationLink = () => {
380
338
  window.open(TAG_TRANSLATION_DOC, '_blank');
381
339
  }
382
-
383
340
  render() {
384
- const {
385
- hidePopover = false, intl = {}, moduleFilterEnabled, label, modalProps, channel, fetchingSchemaError = false,
386
- } = this.props;
341
+ const { hidePopover = false, tags = {}, intl = {}, moduleFilterEnabled, label, modalProps, channel, fetchingSchemaError = false } = this.props;
342
+ const tg = tags;
387
343
  const {formatMessage} = intl;
388
- const {
389
- tagValue, expandedKeys, autoExpandParent, visible, translationLang, selectedContext, isLoadingLoyaltyTags, isLoadingContextChange,
390
- } = this.state;
391
-
392
- // Show loading spinner if general loading OR if specifically loading loyalty tags OR if context change is in progress
393
- const shouldShowLoading = this.props.loading || (selectedContext === 'Loyalty' && isLoadingLoyaltyTags) || isLoadingContextChange;
394
-
344
+ const { tagValue, expandedKeys, autoExpandParent, searchValue, visible, translationLang } = this.state;
395
345
  const options = [
396
346
  {
397
347
  value: "Outbound",
@@ -404,106 +354,99 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
404
354
  key: 'loyalty',
405
355
  },
406
356
  ];
407
- const contentSection = (
408
- <div>
409
- <CapSpin tip={formatMessage(messages.gettingTags)} spinning={shouldShowLoading}>
410
- <Search
411
- style={{ marginBottom: 8, width: '250px'}}
412
- placeholder={formatMessage(messages.search)}
413
- onChange={this.onChange} />
414
- {moduleFilterEnabled ? (
415
- <CapSelect
416
- getPopupContainer={(triggerNode) => triggerNode.parentNode}
417
- style={{
418
- width: '250px', marginBottom: '16px', minWidth: 'initial', display: 'inherit',
419
- }}
420
- onChange={this.handleOnChange}
421
- value={selectedContext}
422
- options={options}>
423
- </CapSelect>
424
- ) : ''}
425
- <CapTree
426
- styling={{height: '350px', overflow: 'auto'}}
427
- onSelect={this.handleOnSelect}
428
- selectedKeys={tagValue}
429
- expandedKeys={expandedKeys}
430
- autoExpandParent={autoExpandParent}
431
- onExpand={this.onExpand}
432
- >
433
- {/* {this.renderTags(tg, searchValue)} */}
434
- {this.state.tagsList}
435
- </CapTree>
436
- {translationLang === "ja-JP" && (
437
- <div className="tag-list-footer">
438
- <CapIcon
439
- type="help"
440
- size="s"
441
- />
442
- <CapLink>
443
- <CapButton id="translationtagfooter" type="flat" onClick={this.openTranslationLink}>
444
- <div className="tag-list-footer-icon">
445
- <div>{JAPANESE_HELP_TEXT}</div>
446
- <CapIcon
447
- type="open-in-new-light"
448
- size="s"
449
- svgProps={{ color: FONT_COLOR_05 }}
450
- />
451
- </div>
452
- </CapButton>
453
- </CapLink>
454
- </div>
455
- )}
357
+ const contentSection = (<div>
358
+ <CapSpin tip={formatMessage(messages.gettingTags)} spinning={this.props.loading}>
359
+ <Search
360
+ style={{ marginBottom: 8, width: '250px'}}
361
+ placeholder={formatMessage(messages.search)}
362
+ onChange={this.onChange} />
363
+ {moduleFilterEnabled ?
364
+ <CapSelect
365
+ getPopupContainer={(triggerNode) => triggerNode.parentNode}
366
+ style={{width: '250px', marginBottom: '16px', minWidth: 'initial', display: 'inherit'}}
367
+ onChange={this.props.onContextChange}
368
+ defaultValue={'Outbound'}
369
+ options={options}>
370
+ </CapSelect> : ''}
371
+ <CapTree
372
+ styling={{height: '350px', overflow: 'auto'}}
373
+ onSelect={this.handleOnSelect}
374
+ selectedKeys={tagValue}
375
+ expandedKeys={expandedKeys}
376
+ autoExpandParent={autoExpandParent}
377
+ onExpand={this.onExpand}
378
+ >
379
+ {/* {this.renderTags(tg, searchValue)} */}
380
+ {this.state.tagsList}
381
+ </CapTree>
382
+ {translationLang === "ja-JP" &&
383
+ <div className="tag-list-footer">
384
+ <CapIcon
385
+ type="help"
386
+ size="s"
387
+ />
388
+ <CapLink>
389
+ <CapButton id="translationtagfooter" type="flat" onClick={this.openTranslationLink} >
390
+ <div className="tag-list-footer-icon">
391
+ <div>{JAPANESE_HELP_TEXT}</div>
392
+ <CapIcon
393
+ type="open-in-new-light"
394
+ size="s"
395
+ svgProps={{ color: FONT_COLOR_05 }}
396
+ />
397
+ </div>
398
+ </CapButton>
399
+ </CapLink>
400
+ </div>
401
+ }
456
402
 
457
- </CapSpin>
458
- </div>
459
- );
403
+ </CapSpin>
404
+ </div>);
460
405
  return (
461
406
  <>
462
- {hidePopover ? (
463
- <CapModal
464
- visible={this.props.visibleTaglist}
465
- footer={[]}
466
- {...modalProps}
467
- >
468
- {contentSection}
469
- </CapModal>
470
- ) : (
471
- <CapPopover
472
- visible={fetchingSchemaError ? false : visible}
473
- onVisibleChange={this.togglePopoverVisibility}
474
- content={contentSection}
475
- trigger="click"
476
- placement={channel === EMAIL.toUpperCase() ? "leftTop" : "rightTop"}
407
+ {hidePopover ? <CapModal
408
+ visible={this.props.visibleTaglist}
409
+ footer={[]}
410
+ {...modalProps}
411
+ >
412
+ {contentSection}
413
+ </CapModal> :
414
+ <CapPopover
415
+ visible={fetchingSchemaError ? false : visible}
416
+ onVisibleChange={this.togglePopoverVisibility}
417
+ content={contentSection}
418
+ trigger="click"
419
+ placement={channel === EMAIL.toUpperCase() ? "leftTop" : "rightTop"}
420
+ >
421
+ <CapTooltip
422
+ title={
423
+ fetchingSchemaError && (
424
+ <CapRow className="tooltip-text-container">
425
+ <CapLabel className="tooltip-text1">
426
+ {formatMessage(messages.somethingWentWrong)}
427
+ </CapLabel>
428
+ <CapLabel className="tooltip-text2">
429
+ {formatMessage(messages.labelFetchErrorMsg)}
430
+ </CapLabel>
431
+ </CapRow>
432
+ )
433
+ }
434
+ placement="right"
477
435
  >
478
- <CapTooltip
479
- title={
480
- fetchingSchemaError && (
481
- <CapRow className="tooltip-text-container">
482
- <CapLabel className="tooltip-text1">
483
- {formatMessage(messages.somethingWentWrong)}
484
- </CapLabel>
485
- <CapLabel className="tooltip-text2">
486
- {formatMessage(messages.labelFetchErrorMsg)}
487
- </CapLabel>
488
- </CapRow>
489
- )
490
- }
491
- placement="right"
492
- >
493
- <CapRow className="tooltip-add-label-container">
494
- <CapButton
495
- disabled={
496
- this?.props?.disabled || fetchingSchemaError
497
- }
498
- isAddBtn
499
- type="flat"
500
- >
501
- {label || ""}
502
- </CapButton>
503
- </CapRow>
504
- </CapTooltip>
505
- </CapPopover>
506
- )}
436
+ <CapRow className="tooltip-add-label-container">
437
+ <CapButton
438
+ disabled={
439
+ this?.props?.disabled || fetchingSchemaError
440
+ }
441
+ isAddBtn
442
+ type="flat"
443
+ >
444
+ {label || ""}
445
+ </CapButton>
446
+ </CapRow>
447
+ </CapTooltip>
448
+ </CapPopover>
449
+ }
507
450
  <CapModal
508
451
  visible={this.state.showModal}
509
452
  title={this.props.intl.formatMessage(messages["Dynamic Days before Expiry"])}
@@ -1,10 +1,7 @@
1
1
  export const WHATSAPP = 'WHATSAPP';
2
2
  export const DEFAULT = 'DEFAULT';
3
- export const MOBILEPUSH = 'MOBILEPUSH';
4
3
  export const SUPPORTED_FILE_FORMATS = {
5
4
  VIBER: '3GP, MP4, MOV, M4V',
6
5
  DEFAULT: 'MP4',
7
- MOBILEPUSH: '3GP, MP4, MOV, M4V',
8
6
  };
9
7
  export const VIBER_MAX_DURATION = 600; // seconds
10
- export const MAX_DURATION = 600; // seconds for all channels