@capillarytech/creatives-library 8.0.163 → 8.0.165

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 (297) hide show
  1. package/constants/unified.js +189 -0
  2. package/index.js +4 -2
  3. package/package.json +1 -1
  4. package/routes.js +136 -202
  5. package/services/getSchema.js +1 -1
  6. package/services/localStorageApi.js +1 -0
  7. package/tests/i18n.test.js +1 -1
  8. package/utils/authWrapper.js +1 -1
  9. package/utils/common.js +2 -2
  10. package/utils/tagValidations.js +1 -1
  11. package/utils/tests/authWrapper.test.js +1 -1
  12. package/utils/tests/checkStore.test.js +1 -1
  13. package/utils/tests/customAuth.test.js +1 -1
  14. package/utils/transformerUtils.js +1 -1
  15. package/v2Components/CapTagList/index.js +9 -14
  16. package/v2Components/Carousel/style.scss +1 -1
  17. package/v2Components/EmailMobilePreview/index.js +2 -2
  18. package/v2Components/FormBuilder/index.js +2 -2
  19. package/v2Components/TemplatePreview/index.js +2 -1
  20. package/v2Components/TestAndPreviewSlidebox/index.js +7 -7
  21. package/v2Containers/Cap/tests/saga.test.js +1 -1
  22. package/v2Containers/CreativesContainer/index.js +2 -0
  23. package/v2Containers/Email/index.js +1 -1
  24. package/v2Containers/FTP/index.js +1 -1
  25. package/v2Containers/Line/Container/Text/index.js +1 -1
  26. package/v2Containers/Sms/Create/index.js +1 -1
  27. package/v2Containers/Sms/Edit/index.js +1 -1
  28. package/v2Containers/TagList/index.js +1 -1
  29. package/v2Containers/TagList/utils.js +1 -1
  30. package/v2Containers/Templates/index.js +1 -1
  31. package/v2Containers/Templates/sagas.js +1 -1
  32. package/v2Containers/Whatsapp/constants.js +1 -1
  33. package/v2Containers/Whatsapp/tests/index.test.js +1 -1
  34. package/components/BreadCrumbs/index.js +0 -65
  35. package/components/BreadCrumbs/messages.js +0 -13
  36. package/components/CapTagList/index.js +0 -235
  37. package/components/CapTagList/messages.js +0 -45
  38. package/components/Card/_customCard.scss +0 -40
  39. package/components/Card/index.js +0 -78
  40. package/components/Card/tests/__snapshots__/index.test.js.snap +0 -22
  41. package/components/Card/tests/index.test.js +0 -20
  42. package/components/CardGrid/index.js +0 -71
  43. package/components/Ckeditor/index.js +0 -238
  44. package/components/Ckeditor/messages.js +0 -13
  45. package/components/Ckeditor/style.scss +0 -3
  46. package/components/Component/index.js +0 -29
  47. package/components/CustomPopOver/index.js +0 -81
  48. package/components/CustomPopOver/messages.js +0 -17
  49. package/components/DateFilter/index.js +0 -349
  50. package/components/DateFilter/messages.js +0 -57
  51. package/components/DateRange/index.js +0 -114
  52. package/components/DateRange/messages.js +0 -25
  53. package/components/Edmeditor/index.js +0 -65
  54. package/components/Edmeditor/messages.js +0 -13
  55. package/components/EmailPreview/_emailPreview.scss +0 -119
  56. package/components/EmailPreview/assets/images/iPad.svg +0 -10
  57. package/components/EmailPreview/assets/images/mobile.png +0 -0
  58. package/components/EmailPreview/index.js +0 -107
  59. package/components/EmailPreview/messages.js +0 -33
  60. package/components/Footer/index.js +0 -27
  61. package/components/Footer/messages.js +0 -13
  62. package/components/FormBuilder/_formBuilder.scss +0 -83
  63. package/components/FormBuilder/index.js +0 -3279
  64. package/components/FormBuilder/messages.js +0 -61
  65. package/components/Header/index.js +0 -44
  66. package/components/Header/messages.js +0 -29
  67. package/components/ImagePreview/_imagePreview.scss +0 -63
  68. package/components/ImagePreview/index.js +0 -52
  69. package/components/ImagePreview/messages.js +0 -17
  70. package/components/PageHeader/_pageHeader.scss +0 -22
  71. package/components/PageHeader/index.js +0 -37
  72. package/components/PageHeader/messages.js +0 -13
  73. package/components/Pagination/_pagination.scss +0 -5
  74. package/components/Pagination/index.js +0 -49
  75. package/components/PreviewSideBar/_previewsidebar.scss +0 -28
  76. package/components/PreviewSideBar/index.js +0 -152
  77. package/components/PreviewSideBar/messages.js +0 -41
  78. package/components/Sidebar/_sidebar.scss +0 -115
  79. package/components/Sidebar/index.js +0 -214
  80. package/components/Sidebar/messages.js +0 -21
  81. package/components/SlideBox/_slideBox.scss +0 -63
  82. package/components/SlideBox/index.js +0 -47
  83. package/components/SlideBox/tests/index.test.js +0 -103
  84. package/components/SmsEditor/index.js +0 -55
  85. package/components/SmsTest/index.js +0 -117
  86. package/components/SmsTest/messages.js +0 -21
  87. package/components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +0 -42
  88. package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +0 -141
  89. package/components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +0 -21
  90. package/components/TemplatePreview/_templatePreview.scss +0 -642
  91. package/components/TemplatePreview/assets/images/WECHAT_5x.png +0 -0
  92. package/components/TemplatePreview/assets/images/androidPushMessage.svg +0 -45
  93. package/components/TemplatePreview/assets/images/home-screen-android.svg +0 -21
  94. package/components/TemplatePreview/assets/images/home-screen-ios.svg +0 -16
  95. package/components/TemplatePreview/assets/images/iPhonePushMessage.svg +0 -135
  96. package/components/TemplatePreview/assets/images/mobile.svg +0 -24
  97. package/components/TemplatePreview/assets/images/sms-body.png +0 -0
  98. package/components/TemplatePreview/assets/images/sms-icon.png +0 -0
  99. package/components/TemplatePreview/assets/images/sms_mobile.png +0 -0
  100. package/components/TemplatePreview/assets/images/sms_mobile_android.svg +0 -22
  101. package/components/TemplatePreview/assets/images/sms_mobile_ios.svg +0 -16
  102. package/components/TemplatePreview/assets/images/user-icon.svg +0 -19
  103. package/components/TemplatePreview/assets/images/wechat-mobile.svg +0 -78
  104. package/components/TemplatePreview/assets/images/wechat_mobile_android.svg +0 -20
  105. package/components/TemplatePreview/index.js +0 -617
  106. package/components/TemplatePreview/messages.js +0 -78
  107. package/components/Toastr/index.js +0 -60
  108. package/components/Toastr/messages.js +0 -13
  109. package/components/ToastrMessage/index.js +0 -113
  110. package/components/ToastrMessage/messages.js +0 -17
  111. package/components/TopBar/_topbar.scss +0 -46
  112. package/components/TopBar/assets/images/capillary_logo.png +0 -0
  113. package/components/TopBar/assets/images/old_capillary_logo.png +0 -0
  114. package/components/TopBar/index.js +0 -113
  115. package/components/TopBar/messages.js +0 -29
  116. package/containers/App/actions.js +0 -7
  117. package/containers/App/constants.js +0 -114
  118. package/containers/App/index.js +0 -52
  119. package/containers/App/reducer.js +0 -19
  120. package/containers/App/sagas.js +0 -31
  121. package/containers/App/selectors.js +0 -25
  122. package/containers/App/test/saga.test.js +0 -11
  123. package/containers/Assets/Gallery/_gallery.scss +0 -126
  124. package/containers/Assets/Gallery/actions.js +0 -37
  125. package/containers/Assets/Gallery/constants.js +0 -23
  126. package/containers/Assets/Gallery/index.js +0 -473
  127. package/containers/Assets/Gallery/messages.js +0 -93
  128. package/containers/Assets/Gallery/reducer.js +0 -81
  129. package/containers/Assets/Gallery/sagas.js +0 -80
  130. package/containers/Assets/Gallery/selectors.js +0 -25
  131. package/containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +0 -9
  132. package/containers/Assets/Gallery/tests/actions.test.js +0 -25
  133. package/containers/Assets/Gallery/tests/reducer.test.js +0 -96
  134. package/containers/Assets/Gallery/tests/saga.test.js +0 -157
  135. package/containers/Cap/actions.js +0 -66
  136. package/containers/Cap/constants.js +0 -25
  137. package/containers/Cap/index.js +0 -402
  138. package/containers/Cap/messages.js +0 -75
  139. package/containers/Cap/reducer.js +0 -113
  140. package/containers/Cap/sagas.js +0 -159
  141. package/containers/Cap/selectors.js +0 -75
  142. package/containers/Cap/tests/__snapshots__/index.test.js.snap +0 -2270
  143. package/containers/Cap/tests/index.test.js +0 -22
  144. package/containers/Cap/tests/saga.test.js +0 -284
  145. package/containers/Dashboard/actions.js +0 -15
  146. package/containers/Dashboard/constants.js +0 -7
  147. package/containers/Dashboard/index.js +0 -76
  148. package/containers/Dashboard/messages.js +0 -13
  149. package/containers/Dashboard/reducer.js +0 -21
  150. package/containers/Dashboard/sagas.js +0 -17
  151. package/containers/Dashboard/selectors.js +0 -25
  152. package/containers/Dashboard/test/saga.test.js +0 -9
  153. package/containers/Ebill/_ebill.scss +0 -5
  154. package/containers/Ebill/actions.js +0 -43
  155. package/containers/Ebill/constants.js +0 -20
  156. package/containers/Ebill/index.js +0 -1278
  157. package/containers/Ebill/messages.js +0 -77
  158. package/containers/Ebill/reducer.js +0 -72
  159. package/containers/Ebill/sagas.js +0 -74
  160. package/containers/Ebill/selectors.js +0 -25
  161. package/containers/Ebill/test/saga.test.js +0 -11
  162. package/containers/Email/_email.scss +0 -141
  163. package/containers/Email/actions.js +0 -81
  164. package/containers/Email/constants.js +0 -36
  165. package/containers/Email/index.js +0 -3325
  166. package/containers/Email/messages.js +0 -289
  167. package/containers/Email/reducer.js +0 -142
  168. package/containers/Email/sagas.js +0 -135
  169. package/containers/Email/selectors.js +0 -31
  170. package/containers/Email/test/saga.test.js +0 -671
  171. package/containers/LanguageProvider/actions.js +0 -17
  172. package/containers/LanguageProvider/constants.js +0 -8
  173. package/containers/LanguageProvider/index.js +0 -80
  174. package/containers/LanguageProvider/reducer.js +0 -30
  175. package/containers/LanguageProvider/selectors.js +0 -20
  176. package/containers/LanguageProvider/tests/actions.test.js +0 -19
  177. package/containers/LanguageProvider/tests/index.test.js +0 -78
  178. package/containers/LanguageProvider/tests/reducer.test.js +0 -20
  179. package/containers/LanguageProvider/tests/selectors.test.js +0 -15
  180. package/containers/Line/Create/_lineCreate.scss +0 -54
  181. package/containers/Line/Create/actions.js +0 -90
  182. package/containers/Line/Create/constants.js +0 -39
  183. package/containers/Line/Create/index.js +0 -836
  184. package/containers/Line/Create/messages.js +0 -189
  185. package/containers/Line/Create/reducer.js +0 -99
  186. package/containers/Line/Create/sagas.js +0 -121
  187. package/containers/Line/Create/selectors.js +0 -36
  188. package/containers/Line/Create/tests/saga.test.js +0 -202
  189. package/containers/Line/Edit/_lineEdit.scss +0 -35
  190. package/containers/Line/Edit/actions.js +0 -79
  191. package/containers/Line/Edit/constants.js +0 -27
  192. package/containers/Line/Edit/index.js +0 -1050
  193. package/containers/Line/Edit/messages.js +0 -177
  194. package/containers/Line/Edit/reducer.js +0 -83
  195. package/containers/Line/Edit/sagas.js +0 -80
  196. package/containers/Line/Edit/selectors.js +0 -29
  197. package/containers/Line/Edit/test/saga.test.js +0 -160
  198. package/containers/Login/assets/images/capillary_logo.png +0 -0
  199. package/containers/Login/components/LoginForm/index.js +0 -62
  200. package/containers/Login/components/LoginForm/messages.js +0 -33
  201. package/containers/Login/index.js +0 -130
  202. package/containers/Login/messages.js +0 -25
  203. package/containers/Login/selectors.js +0 -25
  204. package/containers/MobilePush/Create/_mobilePushCreate.scss +0 -39
  205. package/containers/MobilePush/Create/actions.js +0 -46
  206. package/containers/MobilePush/Create/constants.js +0 -23
  207. package/containers/MobilePush/Create/index.js +0 -2303
  208. package/containers/MobilePush/Create/messages.js +0 -269
  209. package/containers/MobilePush/Create/reducer.js +0 -70
  210. package/containers/MobilePush/Create/sagas.js +0 -74
  211. package/containers/MobilePush/Create/selectors.js +0 -28
  212. package/containers/MobilePush/Create/test/saga.test.js +0 -19
  213. package/containers/MobilePush/Edit/_mobilePushCreate.scss +0 -39
  214. package/containers/MobilePush/Edit/actions.js +0 -91
  215. package/containers/MobilePush/Edit/constants.js +0 -35
  216. package/containers/MobilePush/Edit/index.js +0 -2601
  217. package/containers/MobilePush/Edit/messages.js +0 -266
  218. package/containers/MobilePush/Edit/reducer.js +0 -112
  219. package/containers/MobilePush/Edit/sagas.js +0 -126
  220. package/containers/MobilePush/Edit/selectors.js +0 -29
  221. package/containers/MobilePush/Edit/tests/saga.test.js +0 -255
  222. package/containers/NotFoundPage/index.js +0 -25
  223. package/containers/NotFoundPage/messages.js +0 -13
  224. package/containers/NotFoundPage/tests/index.test.js +0 -17
  225. package/containers/Sms/Create/_smsCreate.scss +0 -42
  226. package/containers/Sms/Create/actions.js +0 -27
  227. package/containers/Sms/Create/constants.js +0 -16
  228. package/containers/Sms/Create/index.js +0 -1488
  229. package/containers/Sms/Create/messages.js +0 -109
  230. package/containers/Sms/Create/reducer.js +0 -41
  231. package/containers/Sms/Create/sagas.js +0 -40
  232. package/containers/Sms/Create/selectors.js +0 -28
  233. package/containers/Sms/Create/test/saga.test.js +0 -11
  234. package/containers/Sms/Edit/actions.js +0 -40
  235. package/containers/Sms/Edit/constants.js +0 -17
  236. package/containers/Sms/Edit/index.js +0 -1472
  237. package/containers/Sms/Edit/messages.js +0 -105
  238. package/containers/Sms/Edit/reducer.js +0 -50
  239. package/containers/Sms/Edit/sagas.js +0 -60
  240. package/containers/Sms/Edit/selectors.js +0 -32
  241. package/containers/Sms/Edit/test/saga.test.js +0 -13
  242. package/containers/TagList/_tagList.scss +0 -8
  243. package/containers/TagList/actions.js +0 -15
  244. package/containers/TagList/constants.js +0 -32
  245. package/containers/TagList/index.js +0 -236
  246. package/containers/TagList/messages.js +0 -13
  247. package/containers/TagList/reducer.js +0 -23
  248. package/containers/TagList/sagas.js +0 -11
  249. package/containers/TagList/selectors.js +0 -25
  250. package/containers/Templates/_templates.scss +0 -333
  251. package/containers/Templates/actions.js +0 -103
  252. package/containers/Templates/constants.js +0 -60
  253. package/containers/Templates/index.js +0 -1756
  254. package/containers/Templates/messages.js +0 -337
  255. package/containers/Templates/reducer.js +0 -142
  256. package/containers/Templates/sagas.js +0 -163
  257. package/containers/Templates/selectors.js +0 -28
  258. package/containers/Templates/test/saga.test.js +0 -241
  259. package/containers/WeChat/MapTemplates/_mapTemplates.scss +0 -8
  260. package/containers/WeChat/MapTemplates/actions.js +0 -52
  261. package/containers/WeChat/MapTemplates/constants.js +0 -28
  262. package/containers/WeChat/MapTemplates/index.js +0 -1610
  263. package/containers/WeChat/MapTemplates/messages.js +0 -157
  264. package/containers/WeChat/MapTemplates/reducer.js +0 -74
  265. package/containers/WeChat/MapTemplates/sagas.js +0 -84
  266. package/containers/WeChat/MapTemplates/selectors.js +0 -25
  267. package/containers/WeChat/MapTemplates/test/saga.test.js +0 -155
  268. package/containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +0 -57
  269. package/containers/WeChat/RichmediaTemplates/Create/actions.js +0 -36
  270. package/containers/WeChat/RichmediaTemplates/Create/constants.js +0 -15
  271. package/containers/WeChat/RichmediaTemplates/Create/index.js +0 -1071
  272. package/containers/WeChat/RichmediaTemplates/Create/messages.js +0 -165
  273. package/containers/WeChat/RichmediaTemplates/Create/reducer.js +0 -60
  274. package/containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +0 -497
  275. package/containers/WeChat/RichmediaTemplates/Create/sagas.js +0 -51
  276. package/containers/WeChat/RichmediaTemplates/Create/selectors.js +0 -37
  277. package/containers/WeChat/RichmediaTemplates/Create/test/saga.test.js +0 -13
  278. package/containers/WeChat/RichmediaTemplates/Edit/actions.js +0 -20
  279. package/containers/WeChat/RichmediaTemplates/Edit/constants.js +0 -10
  280. package/containers/WeChat/RichmediaTemplates/Edit/index.js +0 -136
  281. package/containers/WeChat/RichmediaTemplates/Edit/messages.js +0 -13
  282. package/containers/WeChat/RichmediaTemplates/Edit/reducer.js +0 -28
  283. package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +0 -36
  284. package/containers/WeChat/RichmediaTemplates/Edit/selectors.js +0 -30
  285. package/containers/WeChat/RichmediaTemplates/Edit/test/saga.test.js +0 -12
  286. package/containers/WeChat/RichmediaTemplates/View/actions.js +0 -15
  287. package/containers/WeChat/RichmediaTemplates/View/constants.js +0 -7
  288. package/containers/WeChat/RichmediaTemplates/View/index.js +0 -47
  289. package/containers/WeChat/RichmediaTemplates/View/messages.js +0 -21
  290. package/containers/WeChat/RichmediaTemplates/View/reducer.js +0 -23
  291. package/containers/WeChat/RichmediaTemplates/View/sagas.js +0 -11
  292. package/containers/WeChat/RichmediaTemplates/View/selectors.js +0 -25
  293. package/utils/asyncInjectors.js +0 -78
  294. package/utils/callNativeEvent.js +0 -16
  295. package/utils/checkStore.js +0 -21
  296. package/utils/customAuthWrapper.js +0 -62
  297. package/utils/customConnectedAuthWrapper.js +0 -26
@@ -30,15 +30,8 @@ import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
30
30
  import { createStructuredSelector } from 'reselect';
31
31
  import messages from './messages';
32
32
  import { makeSelectLoyaltyPromotionDisplay } from '../../v2Containers/Cap/selectors';
33
- import { CARD_RELATED_TAGS, HOSPITALITY_RELATED_TAGS, CUSTOMER_BARCODE_TAG } from '../../containers/App/constants';
33
+ import { CARD_RELATED_TAGS, HOSPITALITY_RELATED_TAGS, CUSTOMER_BARCODE_TAG, GET_TRANSLATION_MAPPED ,JAPANESE_HELP_TEXT, TAG_TRANSLATION_DOC} from '../../constants/unified';
34
34
  import { hasCardBasedScope, hasCustomerBarcodeFeatureEnabled, hasHospitalityBasedScope } from '../../utils/common';
35
-
36
- import {
37
- GET_TRANSLATION_MAPPED,
38
- JAPANESE_HELP_TEXT,
39
- TAG_TRANSLATION_DOC,
40
- STRING,
41
- } from "../../containers/TagList/constants";
42
35
  import { EMAIL, JP_LOCALE_HIDE_FEATURE, LOYALTY } from '../../v2Containers/App/constants';
43
36
  import { hidingDateTagsForJpLocale } from '../../v2Containers/TagList/utils';
44
37
 
@@ -132,9 +125,10 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
132
125
  getSearchedExpandedKeys(tags, value = '') {
133
126
  let list = [];
134
127
  _.forEach(tags, (val = {}, key) => {
135
- const tagName = typeof val?.name === STRING
136
- ? _.toLower(_.get(val, "name", ""))
137
- : _.toLower(_.get(val, "name.props.defaultMessage", ""));
128
+ const tagName =
129
+ typeof val?.name === 'string'
130
+ ? _.toLower(_.get(val, "name", ""))
131
+ : _.toLower(_.get(val, "name.props.defaultMessage", ""));
138
132
  const tagNameWithoutUnderscore = tagName.replace(/_/g, " ");
139
133
  const searchStringLower = _.toLower(value);
140
134
  if (_.has(val, "subtags")) {
@@ -267,9 +261,10 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
267
261
  supportedTagsString += `${supportedTag} ,`;
268
262
  });
269
263
  supportedTagsString = supportedTagsString.replace(/,\s*$/, "");
270
- const tagName = typeof val?.name === STRING
271
- ? _.toLower(_.get(val, "name", ""))
272
- : _.toLower(_.get(val, "name.props.defaultMessage", ""));
264
+ const tagName =
265
+ typeof val?.name === 'string'
266
+ ? _.toLower(_.get(val, "name", ""))
267
+ : _.toLower(_.get(val, "name.props.defaultMessage", ""));
273
268
  const tagNameWithoutUnderscore = tagName.replace(/_/g, " ");
274
269
  const searchStringLower = _.toLower(searchString);
275
270
  const tagContainsSearchedString = searchStringLower
@@ -26,7 +26,7 @@
26
26
  text-align: center;
27
27
  width: 120px !important;
28
28
  border-radius: 12px;
29
- background-color: $CAP_G09,
29
+ background-color: $CAP_G09;
30
30
  }
31
31
 
32
32
  .ant-carousel .slick-slide {
@@ -19,8 +19,8 @@ import messages from '../EmailPreviewV2/messages';
19
19
  import './index.scss';
20
20
  import mobileBody from '../../assets/DeviceForEmail.png';
21
21
  import { iframePreviewAdjustWidth, removeLinksFromHtmlContent } from './../../utils/common';
22
- import {selectTemplateContent} from '../../containers/Templates/selectors';
23
- import * as templateActions from '../../containers/Templates/actions';
22
+ import {selectTemplateContent} from '../../v2Containers/Templates/selectors';
23
+ import * as templateActions from '../../v2Containers/Templates/actions';
24
24
 
25
25
  const deviceAspectRatio = {
26
26
  mobile: {
@@ -54,9 +54,9 @@ import { SMS, MOBILE_PUSH, LINE, ENABLE_AI_SUGGESTIONS,AI_CONTENT_BOT_DISABLED,
54
54
  import globalMessages from '../../v2Containers/Cap/messages';
55
55
  import { convert } from 'html-to-text';
56
56
  import { OUTBOUND } from './constants';
57
- import { GET_TRANSLATION_MAPPED } from '../../containers/TagList/constants';
57
+ import { GET_TRANSLATION_MAPPED } from '../../constants/unified';
58
58
  import moment from 'moment';
59
- import { CUSTOMER_BARCODE_TAG , COPY_OF, ENTRY_TRIGGER_TAG_REGEX} from '../../containers/App/constants';
59
+ import { CUSTOMER_BARCODE_TAG , COPY_OF, ENTRY_TRIGGER_TAG_REGEX} from '../../constants/unified';
60
60
  import { REQUEST } from '../../v2Containers/Cap/constants'
61
61
  import { hasLiquidSupportFeature, isEmailUnsubscribeTagMandatory } from '../../utils/common';
62
62
  import { isUrl } from '../../v2Containers/Line/Container/Wrapper/utils';
@@ -32,10 +32,11 @@ import {
32
32
  RCS,
33
33
  ZALO,
34
34
  INAPP,
35
+ VIBER,
36
+ FACEBOOK,
35
37
  MOBILE_PUSH
36
38
  } from '../../v2Containers/CreativesContainer/constants';
37
39
  import Carousel from '../Carousel';
38
- import { VIBER, FACEBOOK } from '../../v2Containers/App/constants';
39
40
  import whatsappMobileAndroid from './assets/images/whatsapp_mobile_android.svg';
40
41
  import inAppMobileAndroidModal from './assets/images/inapp_mobile_android_modal.svg';
41
42
  import inAppMobileAndroidTop from './assets/images/inapp_mobile_android_top.svg';
@@ -294,7 +294,7 @@ const TestAndPreviewSlidebox = (props) => {
294
294
  const currentPath = parentPath ? `${parentPath}.${tag.name}` : tag.name;
295
295
 
296
296
  // Skip unsubscribe tag for input fields
297
- if (tag.name === 'unsubscribe') {
297
+ if (tag?.name === 'unsubscribe') {
298
298
  return;
299
299
  }
300
300
 
@@ -326,10 +326,10 @@ const TestAndPreviewSlidebox = (props) => {
326
326
  // Initialize custom values for required tags
327
327
  const initialValues = {};
328
328
  required.forEach((tag) => {
329
- initialValues[tag.fullPath] = '';
329
+ initialValues[tag?.fullPath] = '';
330
330
  });
331
331
  optional.forEach((tag) => {
332
- initialValues[tag.fullPath] = '';
332
+ initialValues[tag?.fullPath] = '';
333
333
  });
334
334
  setCustomValues(initialValues);
335
335
  } else {
@@ -373,7 +373,7 @@ const TestAndPreviewSlidebox = (props) => {
373
373
  // Always replace all values with prefilled values
374
374
  const updatedValues = {};
375
375
  [...requiredTags, ...optionalTags].forEach((tag) => {
376
- updatedValues[tag.fullPath] = prefilledValues[tag.fullPath] || '';
376
+ updatedValues[tag?.fullPath] = prefilledValues[tag?.fullPath] || '';
377
377
  });
378
378
 
379
379
 
@@ -445,7 +445,7 @@ const TestAndPreviewSlidebox = (props) => {
445
445
  // Clear any existing values while waiting for prefilled values
446
446
  const emptyValues = {};
447
447
  [...requiredTags, ...optionalTags].forEach((tag) => {
448
- emptyValues[tag.fullPath] = '';
448
+ emptyValues[tag?.fullPath] = '';
449
449
  });
450
450
  setCustomValues(emptyValues);
451
451
  };
@@ -456,7 +456,7 @@ const TestAndPreviewSlidebox = (props) => {
456
456
  // Initialize empty values for all tags
457
457
  const emptyValues = {};
458
458
  [...requiredTags, ...optionalTags].forEach((tag) => {
459
- emptyValues[tag.fullPath] = '';
459
+ emptyValues[tag?.fullPath] = '';
460
460
  });
461
461
  setCustomValues(emptyValues);
462
462
 
@@ -496,7 +496,7 @@ const TestAndPreviewSlidebox = (props) => {
496
496
  // Initialize empty values for all tags
497
497
  const emptyValues = {};
498
498
  [...requiredTags, ...optionalTags].forEach((tag) => {
499
- emptyValues[tag.fullPath] = '';
499
+ emptyValues[tag?.fullPath] = '';
500
500
  });
501
501
  setCustomValues(emptyValues);
502
502
 
@@ -36,7 +36,7 @@ import {
36
36
  CREATE_CENTRAL_COMMS_META_ID_REQUEST,
37
37
  } from '../constants';
38
38
  import { callback, error, error2, videoConfigData } from '../../mockdata';
39
- import { LOGOUT_FAILURE, LOGOUT_REQUEST, LOGOUT_SUCCESS } from '../../../containers/Cap/constants';
39
+ import { LOGOUT_FAILURE, LOGOUT_SUCCESS } from '../../../constants/unified';
40
40
 
41
41
 
42
42
 
@@ -543,6 +543,7 @@ export class Creatives extends React.Component {
543
543
  whatsappMedia = {},
544
544
  isPreviewUrl = false,
545
545
  cards = [],
546
+ id = '',
546
547
  } = {},
547
548
  } = templateData;
548
549
  const mediaParams = {};
@@ -582,6 +583,7 @@ export class Creatives extends React.Component {
582
583
  }
583
584
  const unsubscribeRegex = /Click {{unsubscribe}} to unsubscribe/g;
584
585
  creativesTemplateData = {
586
+ _id: id,
585
587
  type: constants.WHATSAPP,
586
588
  edit: true,
587
589
  name,
@@ -37,9 +37,9 @@ import { FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
37
37
  import { gtmPush } from '../../utils/gtmTrackers';
38
38
  const {CapCustomCardList} = CapCustomCard;
39
39
  import {storeS3FileSizeDetails, CREATIVES_S3_ASSET_FILESIZES} from '../../utils/cdnTransformation';
40
+ import { CUSTOMER_BARCODE_TAG } from '../../constants/unified';
40
41
 
41
42
  import { containsBase64Images } from '../../utils/content';
42
- import { CUSTOMER_BARCODE_TAG } from '../../containers/App/constants';
43
43
  import injectReducer from '../../utils/injectReducer';
44
44
  import v2EmailReducer from './reducer';
45
45
  import { v2EmailSagas } from './sagas';
@@ -29,7 +29,7 @@ import { makeSelectLoyaltyPromotionDisplay, setInjectedTags } from '../Cap/selec
29
29
  import withCreatives from '../../hoc/withCreatives';
30
30
  import messages from './messages';
31
31
  import './_FTP.scss';
32
- import * as globalActions from '../../containers/Cap/actions';
32
+ import * as globalActions from '../Cap/actions';
33
33
  import { TagList } from '../TagList';
34
34
  import { NO_COMMUNICATION, CREATE, EDIT, PREVIEW } from '../App/constants';
35
35
  import { getTreeStructuredTags } from '../../utils/common';
@@ -17,7 +17,7 @@ import withStyles from '../../../../hoc/withStyles';
17
17
  import globalMessages from '../../../Cap/messages';
18
18
  import { validateTags } from '../../../../utils/tagValidations';
19
19
  import moment from 'moment';
20
- import { GET_TRANSLATION_MAPPED } from '../../../../containers/TagList/constants';
20
+ import { GET_TRANSLATION_MAPPED } from '../../../../constants/unified';
21
21
 
22
22
  const { TextArea } = CapInput;
23
23
  const {CapCustomCardList} = CapCustomCard;
@@ -24,7 +24,7 @@ import {getMessageObject} from '../../../utils/messageUtils';
24
24
  import { gtmPush } from '../../../utils/gtmTrackers';
25
25
  import * as creativesContainerActions from '../../CreativesContainer/actions';
26
26
  import {SMS} from '../../CreativesContainer/constants';
27
- // import callNativeEvent from '../../../utils/callNativeEvent';
27
+ // import callNativeEvent from '../../../legacy/callNativeEvent';
28
28
  import {showError} from '../commonMethods';
29
29
  import withCreatives from '../../../hoc/withCreatives';
30
30
  import { GA } from '@capillarytech/cap-ui-utils';
@@ -24,7 +24,7 @@ import messages from './messages';
24
24
  import {getMessageObject} from '../../../utils/messageUtils';
25
25
  import { gtmPush } from '../../../utils/gtmTrackers';
26
26
  import * as creativesContainerActions from '../../CreativesContainer/actions';
27
- // import callNativeEvent from '../../../utils/callNativeEvent';
27
+ // import callNativeEvent from '../../../legacy/callNativeEvent';
28
28
  import {showError} from '../commonMethods';
29
29
  import withCreatives from '../../../hoc/withCreatives';
30
30
  import { EDIT, TRACK_EDIT_SMS } from '../../App/constants';
@@ -28,7 +28,7 @@ import {
28
28
  } from '../../utils/common';
29
29
  import {
30
30
  GIFT_VOUCHER_RELATED_TAGS, PROMO_ENGINE_RELATED_TAGS, BADGES_RELATED_TAGS, BADGES_ENROLL, BADGES_ISSUE,
31
- } from '../../containers/App/constants';
31
+ } from '../../constants/unified';
32
32
 
33
33
  const {TreeNode} = Tree;
34
34
 
@@ -1,4 +1,4 @@
1
- import { JAPANESE_HIDE_DATE_TAGS } from "../../containers/TagList/constants";
1
+ import { JAPANESE_HIDE_DATE_TAGS } from "../../constants/unified";
2
2
 
3
3
 
4
4
  export const hidingDateTagsForJpLocale = (hideDateTagsForJpLocale, val, list, value) => {
@@ -105,7 +105,7 @@ import {
105
105
  CREATE,
106
106
  } from '../App/constants';
107
107
  import {MAX_WHATSAPP_TEMPLATES, WARNING_WHATSAPP_TEMPLATES , ACCOUNT_MAPPING_ON_CHANNEL} from './constants';
108
- import { COPY_OF } from '../../containers/App/constants';
108
+ import { COPY_OF } from '../../constants/unified';
109
109
  import {
110
110
  STATUS_OPTIONS,
111
111
  CATEGORY,
@@ -6,7 +6,7 @@ import get from 'lodash/get';
6
6
  import * as Api from '../../services/api';
7
7
  import * as types from './constants';
8
8
  import { saveCdnConfigs, removeAllCdnLocalStorageItems } from '../../utils/cdnTransformation';
9
- import { COPY_OF } from '../../containers/App/constants';
9
+ import { COPY_OF } from '../../constants/unified';
10
10
  import { ZALO_TEMPLATE_INFO_REQUEST } from '../Zalo/constants';
11
11
  import { getTemplateInfoById } from '../Zalo/saga';
12
12
  import { watchCreateTemplate } from '../MobilePushNew/sagas';
@@ -80,7 +80,7 @@ export const mediaTypeOptions = ({host, templateCategory}) => {
80
80
  tagColor: CAP_GREEN02,
81
81
  tagTextColor: CAP_GREEN01,
82
82
  },
83
- ...(templateCategory === WHATSAPP_CATEGORIES.marketing && host === HOST_GUPSHUP
83
+ ...(templateCategory === WHATSAPP_CATEGORIES.marketing && (host === HOST_GUPSHUP || host === HOST_KARIX)
84
84
  ? [
85
85
  {
86
86
  key: 'CAROUSEL',
@@ -577,7 +577,7 @@ describe('mediaTypeOptions', () => {
577
577
  ? opt.some((o) => o.key === 'CAROUSEL')
578
578
  : opt.key === 'CAROUSEL'
579
579
  ) || options.flat().some((o) => o.key === 'CAROUSEL');
580
- expect(hasCarousel).toBe(false);
580
+ expect(hasCarousel).toBe(true);
581
581
  });
582
582
 
583
583
  it('should NOT include CAROUSEL when category is NOT MARKETING and host is HOST_GUPSHUP', () => {
@@ -1,65 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- // import styled from 'styled-components';
4
- import { Link } from 'react-router';
5
- import _ from 'lodash';
6
-
7
- class BreadCrumbs extends React.Component { // eslint-disable-line react/prefer-stateless-function
8
- constructor(props) {
9
- super(props);
10
- this.prepareBreadcrumbElement = this.prepareBreadcrumbElement.bind(this);
11
- this.disabledBreadcrumb = this.disabledBreadcrumb.bind(this);
12
- }
13
-
14
- disabledBreadcrumb(e, location) {
15
- if (location.disabled) {
16
- e.preventDefault();
17
- }
18
- }
19
-
20
- prepareBreadcrumbElement() {
21
- const breadcrumbs = [];
22
- _.forEach(this.props.locations, (location) => {
23
- const titleText = (typeof location.text === 'string') ? location.text : location.text.props.defaultMessage;
24
- const element = (
25
- <Link
26
- to={location.url}
27
- key={titleText}
28
- title={titleText}
29
- onClick={(e) => this.disabledBreadcrumb(e, location)}
30
- >
31
- <span
32
- className={location.disabled ? 'disabled-breadcrumb' : 'active-breadcrumb'}
33
- disabled={location.disabled}
34
- > {location.text}
35
- </span>
36
- </Link>
37
- );
38
- if (breadcrumbs.length !== 0) {
39
- breadcrumbs.push(
40
- <span
41
- key={`${titleText}separator`}
42
- > {this.props.separator ? this.props.separator : ' / '}
43
- </span>
44
- );
45
- }
46
- breadcrumbs.push(element);
47
- });
48
- return breadcrumbs;
49
- }
50
-
51
- render() {
52
- return (
53
- <div className="breadcrumbs-wrapper">
54
- {this.prepareBreadcrumbElement()}
55
- </div>
56
- );
57
- }
58
- }
59
-
60
- BreadCrumbs.propTypes = {
61
- locations: PropTypes.array.isRequired,
62
- separator: PropTypes.string,
63
- };
64
-
65
- export default BreadCrumbs;
@@ -1,13 +0,0 @@
1
- /*
2
- * BreadCrumbs Messages
3
- *
4
- * This contains all the text for the BreadCrumbs component.
5
- */
6
- import { defineMessages } from 'react-intl';
7
-
8
- export default defineMessages({
9
- header: {
10
- id: 'creatives.components.BreadCrumbs.header',
11
- defaultMessage: 'This is the BreadCrumbs component !',
12
- },
13
- });
@@ -1,235 +0,0 @@
1
- /**
2
- *
3
- * CapTagList
4
- *
5
- */
6
-
7
- import PropTypes from 'prop-types';
8
-
9
- import React from 'react';
10
- // import styled from 'styled-components';
11
- import { Tree, Input, Spin, Modal } from 'antd';
12
- import _ from 'lodash';
13
- // import { CapInput } from '@capillarytech/cap-react-ui-library/basic/input';
14
- import { injectIntl, intlShape } from 'react-intl';
15
- import { CapButton, CapPopover, CapSelect, CapInput } from '@capillarytech/cap-react-ui-library';
16
- import messages from './messages';
17
- const Search = Input.Search;
18
- const TreeNode = Tree.TreeNode;
19
-
20
- class CapTagList extends React.Component { // eslint-disable-line react/prefer-stateless-function
21
-
22
- constructor(props) {
23
- super(props);
24
- this.state = {
25
- tagValue: '',
26
- expandedKeys: [],
27
- searchValue: '',
28
- autoExpandParent: true,
29
- visible: false,
30
- dynamicDateValue: '',
31
- showModal: false,
32
- };
33
- this.renderTags = this.renderTags.bind(this);
34
- this.getSearchedExpandedKeys = this.getSearchedExpandedKeys.bind(this);
35
- }
36
-
37
- onChange = (e) => {
38
- const value = e.target.value;
39
- let expandedKeys = this.getSearchedExpandedKeys(this.props.tags, value);
40
- if (value === '') {
41
- expandedKeys = [];
42
- }
43
- this.setState({
44
- expandedKeys,
45
- searchValue: value,
46
- autoExpandParent: true,
47
- });
48
- };
49
- onExpand = (expandedKeys, info) => {
50
- this.handleOnExpand(info.node.props.eventKey);
51
- };
52
-
53
- getSearchedExpandedKeys(tags, value = '') {
54
- let list = [];
55
- _.forEach(tags, (val, key) => {
56
- if (_.has(val, 'subtags')) {
57
- if ((val.name || '').toLowerCase().indexOf(value.toLowerCase()) !== -1) {
58
- list.push(key);
59
- }
60
- const temp = this.getSearchedExpandedKeys(val.subtags, value);
61
- list = list.concat(temp);
62
- } else if ((val.name || '').toLowerCase().indexOf(value.toLowerCase()) !== -1) {
63
- list.push(key);
64
- }
65
- });
66
- return list;
67
- }
68
-
69
- handleOnChange = (data, e) => {
70
-
71
- this.props.onContextChange(data);
72
- };
73
-
74
- handleDynamicDateChange = (data, e) => {
75
-
76
- this.setState({dynamicDateValue: data.target.value});
77
- };
78
-
79
- handleOk = () => {
80
- const days = this.state.dynamicDateValue;
81
- let tagValue = this.state.tagValue;
82
- tagValue = tagValue.replace("(N)", `${days}`);
83
- const resultArray = [];
84
- resultArray.push(tagValue);
85
- this.props.onSelect(resultArray);
86
- this.setState({showModal: false, dynamicDateValue: ''});
87
- };
88
-
89
- handleCancel = () => {
90
- this.setState({showModal: false, dynamicDateValue: ''});
91
- };
92
-
93
- checkIfDynamicTag = (tag) => {
94
- const regex = /dynamic_expiry_date_after_\(N\)_days.FORMAT_\d/g;
95
- const match = regex.exec(tag);
96
- if (match !== null) {
97
- return true;
98
- }
99
- return false;
100
- };
101
-
102
- handleOnSelect = (selectedKeys, info) => {
103
- if (selectedKeys.length > 0) {
104
- if (info && info.selectedNodes && info.selectedNodes.length > 0 && info.selectedNodes[0].props.isLeaf) {
105
- this.setState({tagValue: selectedKeys[0]});
106
- const ifDynamicTag = this.checkIfDynamicTag(selectedKeys[0]);
107
- if (ifDynamicTag) {
108
- this.renderDynamicTagFlow();
109
- } else {
110
- this.props.onSelect(selectedKeys, info);
111
- this.setState({visible: false});
112
- }
113
- } else if (info && info.selectedNodes && info.selectedNodes.length > 0 && !info.selectedNodes[0].props.isLeaf) {
114
- this.handleOnExpand(selectedKeys[0]);
115
- }
116
- }
117
- };
118
-
119
- handleOnExpand = (key) => {
120
- const expandedKeys = this.state.expandedKeys.slice();
121
- const index = _.indexOf(expandedKeys, key);
122
- if (index !== -1) {
123
- expandedKeys.splice(index, 1);
124
- } else {
125
- expandedKeys.push(key);
126
- }
127
- this.setState({expandedKeys, autoExpandParent: false});
128
- };
129
- togglePopoverVisibility = (visible) => {
130
-
131
- this.setState({visible});
132
- };
133
-
134
- renderDynamicTagFlow = () => {
135
- this.setState({showModal: true, visible: false});
136
- };
137
-
138
- renderTags(tags, searchString = '') {
139
-
140
- const list = [];
141
- _.forEach(tags, (val, key) => {
142
- let supportedTagsString = '';
143
- _.forEach(val.supportedTags, (supportedTag) => {
144
- supportedTagsString += `${supportedTag} ,`;
145
- });
146
- supportedTagsString = supportedTagsString.replace(/,\s*$/, "");
147
-
148
- if (_.has(val, 'subtags')) {
149
- const temp = this.renderTags(val.subtags);
150
- list.push((
151
- <TreeNode title={val.name} key={key}>
152
- {temp}
153
- </TreeNode>
154
- ));
155
- } else if (searchString === '' || !searchString || ((val.name || '').toLowerCase().indexOf(searchString.toLowerCase()) !== -1)) {
156
- const tempNode = (<TreeNode title={val.name} isLeaf key={key}></TreeNode>);
157
- list.push(tempNode);
158
- }
159
- });
160
- return list;
161
- }
162
-
163
- render() {
164
- const tg = this.props.tags;
165
- const options = [
166
- {
167
- value: "All",
168
- label: this.props.intl.formatMessage(messages.all),
169
- },
170
- {
171
- value: "Outbound",
172
- label: this.props.intl.formatMessage(messages.outbound),
173
- },
174
- {
175
- value: "Loyalty",
176
- label: this.props.intl.formatMessage(messages.loyalty),
177
- },
178
- ];
179
- return (
180
- <div>
181
- <CapPopover
182
- visible={this.state.visible}
183
- onVisibleChange={this.togglePopoverVisibility}
184
- content={<div>
185
- <Spin tip={this.props?.intl?.formatMessage(messages.gettingTags)} spinning={this.props.loading}>
186
- <Search style={{ marginBottom: 8, width: '250px'}} placeholder={this.props?.intl?.formatMessage(messages.searchText)} onChange={this.onChange} />
187
- {this.props.moduleFilterEnabled ? <CapSelect getPopupContainer={(triggerNode) => triggerNode.parentNode} style={{width: '250px', marginBottom: '16px', minWidth: 'initial', display: 'inherit'}} onChange={this.props.onContextChange} defaultValue="All" options={options}>
188
- </CapSelect> : ''}
189
- <Tree
190
- styling={{height: '350px', overflow: 'auto'}}
191
- onSelect={this.handleOnSelect}
192
- selectedKeys={this.state.tagValue}
193
- expandedKeys={this.state.expandedKeys}
194
- autoExpandParent={this.state.autoExpandParent}
195
- onExpand={this.onExpand}
196
- >
197
- {this.renderTags(tg, this.state.searchValue)}
198
- </Tree>
199
- </Spin>
200
- </div>}
201
- trigger="click"
202
- placement="bottomRight">
203
- <CapButton icon="plus-circle-o" type="secondary">{this.props.label !== '' ? this.props.label : ''}</CapButton>
204
- </CapPopover>
205
- <Modal
206
- visible={this.state.showModal}
207
- title={this.props.intl.formatMessage(messages["Dynamic Days before Expiry"])}
208
- onOk={this.handleOk}
209
- onCancel={this.handleCancel}
210
- footer={[
211
- <CapButton key="back" onClick={this.handleCancel}>{this.props.intl.formatMessage(messages.Cancel)}</CapButton>,
212
- <CapButton key="submit" type="primary" id="delete-version" onClick={this.handleOk}>
213
- {this.props.intl.formatMessage(messages.Ok)}
214
- </CapButton>,
215
- ]}
216
- >
217
- <p>{this.props.intl.formatMessage(messages.numberOfDaysBeforeExpiry)}</p>
218
- <CapInput onChange={this.handleDynamicDateChange} value={this.state.dynamicDateValue}></CapInput>
219
- </Modal>
220
- </div>
221
- );
222
- }
223
- }
224
-
225
- CapTagList.propTypes = {
226
- tags: PropTypes.object,
227
- onSelect: PropTypes.func,
228
- label: PropTypes.string,
229
- onContextChange: PropTypes.func,
230
- loading: PropTypes.bool,
231
- moduleFilterEnabled: PropTypes.bool,
232
- intl: intlShape.isRequired,
233
- };
234
-
235
- export default injectIntl(CapTagList);
@@ -1,45 +0,0 @@
1
- /*
2
- * CapTagList Messages
3
- *
4
- * This contains all the text for the CapTagList component.
5
- */
6
- import { defineMessages } from 'react-intl';
7
-
8
- export default defineMessages({
9
- "Ok": {
10
- id: 'creatives.components.CapTagList.Ok',
11
- defaultMessage: 'Ok',
12
- },
13
- "numberOfDaysBeforeExpiry": {
14
- id: 'creatives.components.CapTagList.numberOfDaysBeforeExpiry',
15
- defaultMessage: 'Number of days before expiry',
16
- },
17
- "Cancel": {
18
- id: 'creatives.components.CapTagList.Cancel',
19
- defaultMessage: 'Cancel',
20
- },
21
- "Dynamic Days before Expiry": {
22
- id: 'creatives.components.CapTagList.dynamic_days_before_expiry',
23
- defaultMessage: 'Dynamic days before expiry',
24
- },
25
- "all": {
26
- id: 'creatives.components.CapTagList.all',
27
- defaultMessage: 'All',
28
- },
29
- "outbound": {
30
- id: 'creatives.components.CapTagList.outbound',
31
- defaultMessage: 'Outbound',
32
- },
33
- "loyalty": {
34
- id: 'creatives.components.CapTagList.loyalty',
35
- defaultMessage: 'Loyalty',
36
- },
37
- "searchText": {
38
- id: 'creatives.components.CapTagList.searchText',
39
- defaultMessage: 'Search',
40
- },
41
- "gettingTags": {
42
- id: 'creatives.components.CapTagList.gettingTags',
43
- defaultMessage: "Getting tags...",
44
- },
45
- });