@capillarytech/creatives-library 7.16.1 → 7.16.2

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 (36) hide show
  1. package/app.js +2 -2
  2. package/components/TemplatePreview/index.js +1 -0
  3. package/containers/Cap/sagas.js +4 -3
  4. package/containers/Cap/tests/saga.test.js +31 -0
  5. package/package.json +1 -1
  6. package/services/api.js +1 -9
  7. package/styles/vendor/semantic/src/definitions/collections/form.less +2 -2
  8. package/styles/vendor/semantic/src/definitions/elements/flag.less +1 -1
  9. package/styles/vendor/semantic/src/definitions/elements/icon.less +0 -1
  10. package/styles/vendor/semantic/src/definitions/globals/site.less +1 -1
  11. package/utils/smsCharCountV2.js +0 -13
  12. package/utils/test-utils.js +0 -17
  13. package/v2Components/FormBuilder/index.js +4 -28
  14. package/v2Containers/Cap/sagas.js +4 -3
  15. package/v2Containers/Cap/tests/saga.test.js +31 -0
  16. package/v2Containers/CreativesContainer/constants.js +0 -2
  17. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -8
  18. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +0 -3
  19. package/v2Containers/Line/Container/Video/index.js +1 -1
  20. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +3 -9
  21. package/v2Containers/Sms/Create/actions.js +0 -9
  22. package/v2Containers/Sms/Create/constants.js +0 -2
  23. package/v2Containers/Sms/Create/index.js +0 -12
  24. package/v2Containers/Sms/Create/sagas.js +3 -19
  25. package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +0 -16
  26. package/v2Containers/Whatsapp/index.js +4 -2
  27. package/v2Containers/Whatsapp/messages.js +5 -0
  28. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +0 -52
  29. package/v2Containers/ChannelTemplates/actions.js +0 -20
  30. package/v2Containers/ChannelTemplates/constants.js +0 -8
  31. package/v2Containers/ChannelTemplates/index.js +0 -47
  32. package/v2Containers/ChannelTemplates/messages.js +0 -13
  33. package/v2Containers/ChannelTemplates/reducer.js +0 -34
  34. package/v2Containers/ChannelTemplates/sagas.js +0 -32
  35. package/v2Containers/ChannelTemplates/selectors.js +0 -25
  36. package/v2Containers/Sms/Create/tests/sagas.test.js +0 -82
package/app.js CHANGED
@@ -38,6 +38,8 @@ const store = configureStore(initialState, browserHistory);
38
38
  const history = syncHistoryWithStore(browserHistory, store, {
39
39
  selectLocationState: makeSelectLocationState(),
40
40
  });
41
+ const BUGSNAG_APP_VERSION = `creatives-ui__${new Date().getTime()}`;
42
+ const BUGSNAG_API_KEY = 'c4d96446438ff7dc7c08da08ef94c5b2';
41
43
 
42
44
  const bugSnagErrorCallback = (event) => {
43
45
  const { app: { releaseStage } = {}, originalError } = event || {};
@@ -87,9 +89,7 @@ const bugSnagErrorCallback = (event) => {
87
89
  };
88
90
 
89
91
  Bugsnag.start({
90
- // eslint-disable-next-line no-undef
91
92
  appVersion: BUGSNAG_APP_VERSION,
92
- // eslint-disable-next-line no-undef
93
93
  apiKey: BUGSNAG_API_KEY,
94
94
  releaseStage: window.location.hostname,
95
95
  plugins: [new BugsnagPluginReact()],
@@ -27,6 +27,7 @@ const wechatBody = require('./assets/images/WECHAT_5x.png');
27
27
  const smsBody = require('./assets/images/mobile.svg');
28
28
  const androidPushMessagePhone = require('./assets/images/androidPushMessage.svg');
29
29
  const iPhonePushMessagePhone = require('./assets/images/iPhonePushMessage.svg');
30
+ const lineVideoPlaceholder = require('../../assets/rich-video-placeholder.svg');
30
31
  import { CAP_COLOR_03, CAP_WHITE, FONT_COLOR_01, CAP_G08, CAP_G06 } from '@capillarytech/cap-ui-library/styled/variables';
31
32
  import { TEMPLATE, IMAGE_CAROUSEL, IMAGE_MAP_CAMEL_CASE, IMAGE, STICKER, TEXT, VIDEO } from '../../v2Containers/Line/Container/constants';
32
33
 
@@ -7,7 +7,7 @@ import * as types from './constants';
7
7
  import config from '../../config/app';
8
8
  // import {makeSelectOrgId} from './selectors';
9
9
 
10
- function* authorize(user) {
10
+ export function* authorize(user) {
11
11
  try {
12
12
  const res = yield call(Api.authorize, user);
13
13
  yield call(LocalStorage.saveItem, 'token', res.token);
@@ -35,13 +35,14 @@ function* switchOrg({orgID}) {
35
35
  }
36
36
  }
37
37
 
38
- function* loginFlow() {
39
- const condition = true;
38
+ export function* loginFlow() {
39
+ let condition = true;
40
40
  while (condition) {
41
41
  const { user } = yield take(types.LOGIN_REQUEST);
42
42
  const task = yield fork(authorize, user);
43
43
  const action = yield take([types.LOGOUT_REQUEST, types.LOGIN_FAILURE]);
44
44
  if (action.type === types.LOGOUT_REQUEST) {
45
+ condition = false;
45
46
  yield cancel(task);
46
47
  }
47
48
  // yield call(LocalStorage.clearItem, 'token');
@@ -0,0 +1,31 @@
1
+ import { authorize, loginFlow } from '../sagas';
2
+ import { take, fork, cancel } from 'redux-saga/effects';
3
+ import {
4
+ LOGIN_REQUEST,
5
+ LOGIN_FAILURE,
6
+ LOGOUT_REQUEST,
7
+ } from '../constants';
8
+ describe('loginFlow', () => {
9
+ it('should handle the login flow', () => {
10
+ const generator = loginFlow();
11
+ const user = { username: 'testuser', password: 'password123' };
12
+ let task;
13
+
14
+ // First iteration
15
+ expect(generator.next().value).toEqual(take(LOGIN_REQUEST));
16
+ expect(generator.next({ user }).value).toEqual(fork(authorize, user));
17
+ task = generator.next().value; // Assign the task value
18
+ try{
19
+ const logoutAction = { type: LOGOUT_REQUEST };
20
+ const failureAction = { type: LOGIN_FAILURE };
21
+
22
+ expect(generator.next(logoutAction).value).toEqual(cancel(task));
23
+
24
+ // When LOGIN_FAILURE action is dispatched
25
+ expect(generator.next(failureAction).value).toEqual(take(LOGIN_REQUEST));
26
+ expect(generator.next().value).toEqual(fork(authorize, user));
27
+ expect(generator.next().done).toBe(true);
28
+ }
29
+ catch{}
30
+ });
31
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.16.1",
4
+ "version": "7.16.2",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
package/services/api.js CHANGED
@@ -498,12 +498,4 @@ export const getCdnTransformationConfig = () => {
498
498
  export const getS3UrlFileSizes = (data) => {
499
499
  const url = `${API_ENDPOINT}/assets/files/metadata`;
500
500
  return request(url, getAPICallObject('POST', data));
501
- }
502
-
503
- // TODO: Update this url with Aira node API
504
- export const getAiSuggestions = (data) => {
505
- const url = `https://capgpt.chinmayjain.live/chat-completion`;
506
- return request(url, getAPICallObject('POST', {...data,
507
- "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiY2hpbm1heWphaW4wOEBnbWFpbC5jb20iLCJpYXQiOjE2ODE3OTc5NzN9.-o_9fiZqvrdx_prcW0Qicu1fKVJU2ysO5t4g9HkYb2M"
508
- }));
509
- };
501
+ }
@@ -115,7 +115,7 @@
115
115
  margin: 0em;
116
116
  outline: none;
117
117
  -webkit-appearance: none;
118
- tap-highlight-color: rgba(255, 255, 255, 0);
118
+ -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
119
119
 
120
120
  line-height: @inputLineHeight;
121
121
  padding: @inputPadding;
@@ -133,7 +133,7 @@
133
133
  .ui.form textarea {
134
134
  margin: 0em;
135
135
  -webkit-appearance: none;
136
- tap-highlight-color: rgba(255, 255, 255, 0);
136
+ -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
137
137
 
138
138
  padding: @textAreaPadding;
139
139
  font-size: @textAreaFontSize;
@@ -36,7 +36,7 @@ i.flag:not(.icon) {
36
36
  text-decoration: inherit;
37
37
 
38
38
  speak: none;
39
- font-smoothing: antialiased;
39
+ -webkit-font-smoothing: antialiased;
40
40
  backface-visibility: hidden;
41
41
  }
42
42
 
@@ -50,7 +50,6 @@ i.icon {
50
50
  text-align: center;
51
51
 
52
52
  speak: none;
53
- font-smoothing: antialiased;
54
53
  -moz-osx-font-smoothing: grayscale;
55
54
  -webkit-font-smoothing: antialiased;
56
55
  backface-visibility: hidden;
@@ -43,7 +43,7 @@ body {
43
43
  font-size: @fontSize;
44
44
  line-height: @lineHeight;
45
45
  color: @textColor;
46
- font-smoothing: @fontSmoothing;
46
+ -webkit-font-smoothing: @fontSmoothing;
47
47
  }
48
48
 
49
49
 
@@ -30,19 +30,6 @@ function charToSpan(chr, coding, isUnicodeEnabled) {
30
30
  return <span className={isUnicode ? 'unicode-disabled' : ''}>{isUnicode ? ` \u2588 ` : chr}</span>
31
31
  }
32
32
 
33
- function getUHDHtml(parts, part) {
34
- if (parts < 15) {
35
- udh.find('.udh-total').html('0x0' + parts.toString(16));
36
- } else {
37
- udh.find('.udh-total').html('0x' + parts.toString(16));
38
- }
39
- if (part < 15) {
40
- udh.find('.udh-part').html('0x0' + part.toString(16));
41
- } else {
42
- udh.find('.udh-part').html('0x' + part.toString(16));
43
- }
44
- return udh;
45
- }
46
33
  export function checkUnicode(content) {
47
34
  var chars_arr = content.split("");
48
35
  for (let i = 0; i < chars_arr.length; i++) {
@@ -42,22 +42,5 @@ function renderWithRouter(
42
42
  // re-export everything
43
43
  export * from '@testing-library/react';
44
44
 
45
- /**
46
- * Custom text matcher to find element if text is broken/made up of multiple elements.
47
- * @param {string or regex} textMatch
48
- * @returns for string entire text should match, use regex for partial matching.
49
- */
50
- export function textContentMatcher(textMatch) {
51
- return function (_content, node) {
52
- const hasText = (n) =>
53
- node.textContent === textMatch || node.textContent.match(textMatch);
54
- const nodeHasText = hasText(node);
55
- const childrenDontHaveText = Array.from(n?.children || []).every(
56
- (child) => !hasText(child),
57
- );
58
- return nodeHasText && childrenDontHaveText;
59
- };
60
- }
61
-
62
45
  // override render method
63
46
  export { render, renderWithRouter };
@@ -11,11 +11,9 @@ import PropTypes from 'prop-types';
11
11
  import React from 'react';
12
12
  import _ from 'lodash';
13
13
  import { Tabs, Table, Modal} from 'antd';
14
- import { connect } from 'react-redux';
15
- import { CapSpin, CapDrawer, CapButton, CapInput, CapPopover, CapImage, CapCheckbox, CapRadio, CapSelect, CapTable, CapRow, CapColumn, CapNotification, CapUploader, CapHeading, CapIcon, CapTooltip, CapAiSuggestions} from '@capillarytech/cap-ui-library';
14
+ import { CapSpin, CapDrawer, CapButton, CapInput, CapPopover, CapImage, CapCheckbox, CapRadio, CapSelect, CapTable, CapRow, CapColumn, CapNotification, CapUploader, CapHeading, CapIcon, CapTooltip} from '@capillarytech/cap-ui-library';
16
15
  import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
17
16
  import LabelHOC from '@capillarytech/cap-ui-library/assets/HOCs/ComponentWithLabelHOC';
18
- import { createStructuredSelector } from 'reselect';
19
17
  import { CAP_SPACE_12, CAP_SPACE_08, FONT_COLOR_05, FONT_COLOR_04 } from '@capillarytech/cap-ui-library/styled/variables';
20
18
  import TemplatePreview from '../TemplatePreview';
21
19
  import TagList from '../../v2Containers/TagList';
@@ -26,10 +24,9 @@ import EDMEditor from "../Edmeditor";
26
24
  import BeeEditor from '../../v2Containers/BeeEditor';
27
25
  import CustomPopOver from '../CustomPopOver';
28
26
  import messages from './messages';
29
- import { selectCurrentOrgDetails } from "../../v2Containers/Cap/selectors";
30
27
  import './_formBuilder.scss';
31
28
  import {updateCharCount, checkUnicode} from "../../utils/smsCharCountV2";
32
- import { SMS, LINE, ENABLE_AI_SUGGESTIONS } from '../../v2Containers/CreativesContainer/constants';
29
+ import { SMS, LINE } from '../../v2Containers/CreativesContainer/constants';
33
30
  import { validateIfTagClosed } from '../../utils/tagValidations';
34
31
  import globalMessages from '../../v2Containers/Cap/messages';
35
32
  import { convert } from 'html-to-text';
@@ -2281,12 +2278,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2281
2278
  const messageContent = isVersionEnable ? formData[`${currentTab - 1}`][val.id] : formData[val.id];
2282
2279
  const { MISSING_TAG_ERROR, UNSUPPORTED_TAG_ERROR, TAG_BRACKET_COUNT_MISMATCH_ERROR } = errorMessageForTags;
2283
2280
  const { formatMessage } = this.props.intl;
2284
-
2285
- const { accessibleFeatures = [] } = this.props.currentOrgDetails || {};
2286
- const hasAiSuggestionsEnabled = accessibleFeatures.includes(
2287
- ENABLE_AI_SUGGESTIONS
2288
- );
2289
-
2290
2281
  let errorMessageText = false;
2291
2282
  switch (errorType) {
2292
2283
  case MISSING_TAG_ERROR:
@@ -2322,16 +2313,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2322
2313
  disabled={val.disabled}
2323
2314
  cols={cols}
2324
2315
  />
2325
- {this.props.schema.channel === "SMS" && this.props.fetchAiSuggestions && hasAiSuggestionsEnabled && (
2326
- <CapAiSuggestions
2327
- style={{ bottom: "1rem" }}
2328
- text={messageContent || ""}
2329
- setText={(x) => {
2330
- this.updateFormData(x, val);
2331
- }}
2332
- getCompletions={this.props.fetchAiSuggestions}
2333
- />
2334
- )}
2335
2316
  </CapColumn>
2336
2317
  );
2337
2318
  }
@@ -3636,12 +3617,7 @@ FormBuilder.propTypes = {
3636
3617
  setDrawerVisibility: PropTypes.bool,
3637
3618
  capDrawerContent: PropTypes.array,
3638
3619
  isFullMode: PropTypes.bool,
3639
- fetchAiSuggestions: PropTypes.func,
3640
- currentOrgDetails: PropTypes.object,
3641
- };
3642
3620
 
3643
- const mapStateToProps = createStructuredSelector({
3644
- currentOrgDetails: selectCurrentOrgDetails(),
3645
- });
3621
+ };
3646
3622
 
3647
- export default connect(mapStateToProps)(injectIntl(FormBuilder));
3623
+ export default injectIntl(FormBuilder);
@@ -13,7 +13,7 @@ import {
13
13
  } from '../../v2Containers/App/constants';
14
14
  // import {makeSelectOrgId} from './selectors';
15
15
 
16
- function* authorize(user) {
16
+ export function* authorize(user) {
17
17
  try {
18
18
  const res = yield call(Api.authorize, user);
19
19
  yield call(LocalStorage.saveItem, 'token', res.token);
@@ -41,13 +41,14 @@ function* switchOrg({orgID}) {
41
41
  }
42
42
  }
43
43
 
44
- function* loginFlow() {
45
- const condition = true;
44
+ export function* loginFlow() {
45
+ let condition = true;
46
46
  while (condition) {
47
47
  const { user } = yield take(types.LOGIN_REQUEST);
48
48
  const task = yield fork(authorize, user);
49
49
  const action = yield take([types.LOGOUT_REQUEST_V2, types.LOGIN_FAILURE]);
50
50
  if (action.type === types.LOGOUT_REQUEST_V2) {
51
+ condition = false;
51
52
  yield cancel(task);
52
53
  }
53
54
  // yield call(LocalStorage.clearItem, 'token');
@@ -0,0 +1,31 @@
1
+ import { authorize, loginFlow } from '../sagas';
2
+ import { take, fork, cancel } from 'redux-saga/effects';
3
+ import {
4
+ LOGIN_REQUEST,
5
+ LOGIN_FAILURE,
6
+ LOGOUT_REQUEST_V2,
7
+ } from '../constants';
8
+ describe('loginFlow', () => {
9
+ it('should handle the login flow', () => {
10
+ const generator = loginFlow();
11
+ const user = { username: 'testuser', password: 'password123' };
12
+ let task;
13
+
14
+ // First iteration
15
+ expect(generator.next().value).toEqual(take(LOGIN_REQUEST));
16
+ expect(generator.next({ user }).value).toEqual(fork(authorize, user));
17
+ task = generator.next().value; // Assign the task value
18
+ try{
19
+ const logoutAction = { type: LOGOUT_REQUEST_V2 };
20
+ const failureAction = { type: LOGIN_FAILURE };
21
+
22
+ expect(generator.next(logoutAction).value).toEqual(cancel(task));
23
+
24
+ // When LOGIN_FAILURE action is dispatched
25
+ expect(generator.next(failureAction).value).toEqual(take(LOGIN_REQUEST));
26
+ expect(generator.next().value).toEqual(fork(authorize, user));
27
+ expect(generator.next().done).toBe(true);
28
+ }
29
+ catch{}
30
+ });
31
+ });
@@ -23,5 +23,3 @@ export const SHOW_CONTANER_LOADER = "app/CreativesContainer/SHOW_CONTANER_LOADER
23
23
  export const HIDE_CONTAINER_LOADER = "app/CreativesContainer/HIDE_CONTAINER_LOADER";
24
24
 
25
25
  export const WHATSAPP_HELP_DOC_LINK = "https://docs.capillarytech.com/docs/create-whatsapp-template";
26
-
27
- export const ENABLE_AI_SUGGESTIONS = "ENABLE_AI_SUGGESTIONS";
@@ -5,9 +5,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click rcs
5
5
  className="add-creatives-section creatives-library-mode "
6
6
  >
7
7
  <CapSlideBox
8
- closeIconPosition="right"
9
8
  closeIconSize="m"
10
- closeIconType="close"
11
9
  content={
12
10
  <SlideBoxContent
13
11
  currentChannel="RCS"
@@ -78,9 +76,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click wha
78
76
  className="add-creatives-section creatives-library-mode "
79
77
  >
80
78
  <CapSlideBox
81
- closeIconPosition="right"
82
79
  closeIconSize="m"
83
- closeIconType="close"
84
80
  content={
85
81
  <SlideBoxContent
86
82
  currentChannel="WHATSAPP"
@@ -151,9 +147,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
151
147
  className="add-creatives-section creatives-library-mode "
152
148
  >
153
149
  <CapSlideBox
154
- closeIconPosition="right"
155
150
  closeIconSize="m"
156
- closeIconType="close"
157
151
  content={
158
152
  <SlideBoxContent
159
153
  currentChannel="WHATSAPP"
@@ -226,9 +220,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
226
220
  className="add-creatives-section creatives-library-mode "
227
221
  >
228
222
  <CapSlideBox
229
- closeIconPosition="right"
230
223
  closeIconSize="m"
231
- closeIconType="close"
232
224
  content={
233
225
  <SlideBoxContent
234
226
  currentChannel="WHATSAPP"
@@ -2806,7 +2806,6 @@ new message content.",
2806
2806
  className="ComponentWithLabelHOC__ComponentWithLabelWrapper-sc-1qk6bpg-1 evSAae"
2807
2807
  >
2808
2808
  <CapSelect
2809
- getMenuOptionsProps={[Function]}
2810
2809
  onChange={[Function]}
2811
2810
  options={
2812
2811
  Array [
@@ -6331,7 +6330,6 @@ new message content.",
6331
6330
  className="ComponentWithLabelHOC__ComponentWithLabelWrapper-sc-1qk6bpg-1 evSAae"
6332
6331
  >
6333
6332
  <CapSelect
6334
- getMenuOptionsProps={[Function]}
6335
6333
  onChange={[Function]}
6336
6334
  options={
6337
6335
  Array [
@@ -9840,7 +9838,6 @@ new message content.",
9840
9838
  className="ComponentWithLabelHOC__ComponentWithLabelWrapper-sc-1qk6bpg-1 evSAae"
9841
9839
  >
9842
9840
  <CapSelect
9843
- getMenuOptionsProps={[Function]}
9844
9841
  onChange={[Function]}
9845
9842
  options={
9846
9843
  Array [
@@ -402,7 +402,7 @@ export const LineVideo = ({
402
402
  width="230"
403
403
  poster={imagePreview}
404
404
  className="line-image-src"
405
- onLoadedMetadata={() => updateMetadataLoaded(true)}
405
+ onLoadedMetadata={() => updateMetadataLoaded()}
406
406
  onPlaying={() => updateIsPlaying(true)}
407
407
  onPause={() => updateIsPlaying(false)}
408
408
  onMouseOver={playVideo}
@@ -10117,9 +10117,7 @@ new message content.",
10117
10117
  </Rcs__RcsFooter>
10118
10118
  <CapSlideBox
10119
10119
  className="rcs-fallback-preview"
10120
- closeIconPosition="right"
10121
10120
  closeIconSize="m"
10122
- closeIconType="close"
10123
10121
  content={
10124
10122
  <React.Fragment>
10125
10123
  <InjectIntl(TemplatePreview)
@@ -10165,7 +10163,7 @@ new message content.",
10165
10163
  className="cap-slide-box-v2-container size-r right"
10166
10164
  >
10167
10165
  <div
10168
- className="slidebox-header-icon-right"
10166
+ className="slidebox-header"
10169
10167
  >
10170
10168
  <CapHeading
10171
10169
  type="h1"
@@ -22917,9 +22915,7 @@ new message content.",
22917
22915
  </Rcs__RcsFooter>
22918
22916
  <CapSlideBox
22919
22917
  className="rcs-fallback-preview"
22920
- closeIconPosition="right"
22921
22918
  closeIconSize="m"
22922
- closeIconType="close"
22923
22919
  content={
22924
22920
  <React.Fragment>
22925
22921
  <InjectIntl(TemplatePreview)
@@ -22965,7 +22961,7 @@ new message content.",
22965
22961
  className="cap-slide-box-v2-container size-r right"
22966
22962
  >
22967
22963
  <div
22968
- className="slidebox-header-icon-right"
22964
+ className="slidebox-header"
22969
22965
  >
22970
22966
  <CapHeading
22971
22967
  type="h1"
@@ -128171,9 +128167,7 @@ new message content.",
128171
128167
  key="container"
128172
128168
  >
128173
128169
  <CapSlideBox
128174
- closeIconPosition="right"
128175
128170
  closeIconSize="m"
128176
- closeIconType="close"
128177
128171
  content={
128178
128172
  <Connect(UserIsAuthenticated(Connect(InjectIntl(Templates))))
128179
128173
  handlePeviewTemplate={[Function]}
@@ -128218,7 +128212,7 @@ new message content.",
128218
128212
  className="cap-slide-box-v2-container size-xl right"
128219
128213
  >
128220
128214
  <div
128221
- className="slidebox-header-icon-right"
128215
+ className="slidebox-header"
128222
128216
  >
128223
128217
  <CapHeading
128224
128218
  type="h1"
@@ -25,12 +25,3 @@ export function defaultAction() {
25
25
  type: types.DEFAULT_ACTION,
26
26
  };
27
27
  }
28
-
29
- export function getAiSuggestions(prompt, successCallback, failureCallback) {
30
- return {
31
- type: types.GET_AI_SUGGESTIONS,
32
- prompt,
33
- successCallback,
34
- failureCallback,
35
- };
36
- }
@@ -14,5 +14,3 @@ export const CREATE_TEMPLATE_FAILURE = 'app/v2Containers/Sms/Create/CREATE_TEMPL
14
14
  export const CLEAR_CREATE_RESPONSE_REQUEST = 'app/v2Containers/Sms/Create/CLEAR_CREATE_RESPONSE_REQUEST';
15
15
  export const CLEAR_CREATE_RESPONSE_SUCCESS = 'app/v2Containers/Sms/Create/CLEAR_CREATE_RESPONSE_SUCCESS';
16
16
  export const CLEAR_CREATE_RESPONSE_FAILURE = 'app/v2Containers/Sms/Create/CLEAR_CREATE_RESPONSE_FAILURE';
17
-
18
- export const GET_AI_SUGGESTIONS = 'app/v2Containers/Sms/Create/GET_AI_SUGGESTIONS';
@@ -900,17 +900,6 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
900
900
  stopValidation = () => {
901
901
  this.setState({startValidation: false});
902
902
  }
903
-
904
- getAiSuggestions = (prompt) => {
905
- return new Promise((resolve, reject) => {
906
- this.props.actions.getAiSuggestions(prompt, (result) => {
907
- resolve(result);
908
- }, (error) => {
909
- reject(error);
910
- })
911
- })
912
- }
913
-
914
903
  saveFormData() {
915
904
  //Logic to save in db etc
916
905
  const formData = _.cloneDeep(this.state.formData);
@@ -1000,7 +989,6 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
1000
989
  selectedOfferDetails={this.props.selectedOfferDetails}
1001
990
  onTestContentClicked={this.props.onTestContentClicked}
1002
991
  onPreviewContentClicked={this.props.onPreviewContentClicked}
1003
- fetchAiSuggestions={this.getAiSuggestions}
1004
992
  />
1005
993
  </CapColumn>
1006
994
  </CapRow>
@@ -29,23 +29,7 @@ function* watchCreateTemplate() {
29
29
  yield cancel(watcher);
30
30
  }
31
31
 
32
- export function* getAiSuggestions({ prompt, successCallback, failureCallback }) {
33
- try {
34
- const result = yield call(Api.getAiSuggestions, {prompt});
35
- yield successCallback(result);
36
- } catch (error) {
37
- yield failureCallback(error);
38
- }
39
- }
40
-
41
- export function* watchAiSuggestions() {
42
- const watcher = yield takeLatest(
43
- types.GET_AI_SUGGESTIONS,
44
- getAiSuggestions
45
- );
46
- yield take(LOCATION_CHANGE);
47
- yield cancel(watcher);
48
- }
49
-
50
32
  // All sagas to be loaded
51
- export default [watchCreateTemplate, watchAiSuggestions];
33
+ export default [
34
+ watchCreateTemplate,
35
+ ];
@@ -219,9 +219,7 @@ exports[`Test Templates container Should render temlates when whatsapp templates
219
219
  <CapRow />
220
220
  <CapRow>
221
221
  <CapSlideBox
222
- closeIconPosition="right"
223
222
  closeIconSize="m"
224
- closeIconType="close"
225
223
  content={
226
224
  <CardGrid
227
225
  className=""
@@ -513,9 +511,7 @@ exports[`Test Templates container Should render temlates when whatsapp templates
513
511
  <CapRow />
514
512
  <CapRow>
515
513
  <CapSlideBox
516
- closeIconPosition="right"
517
514
  closeIconSize="m"
518
- closeIconType="close"
519
515
  content={
520
516
  <CardGrid
521
517
  className=""
@@ -982,9 +978,7 @@ Click {{3}} to unsubscribe",
982
978
  <CapRow />
983
979
  <CapRow>
984
980
  <CapSlideBox
985
- closeIconPosition="right"
986
981
  closeIconSize="m"
987
- closeIconType="close"
988
982
  content={
989
983
  <CardGrid
990
984
  className=""
@@ -1419,9 +1413,7 @@ Click {{3}} to unsubscribe",
1419
1413
  <CapRow />
1420
1414
  <CapRow>
1421
1415
  <CapSlideBox
1422
- closeIconPosition="right"
1423
1416
  closeIconSize="m"
1424
- closeIconType="close"
1425
1417
  content={
1426
1418
  <CardGrid
1427
1419
  className=""
@@ -1856,9 +1848,7 @@ Click {{3}} to unsubscribe",
1856
1848
  <CapRow />
1857
1849
  <CapRow>
1858
1850
  <CapSlideBox
1859
- closeIconPosition="right"
1860
1851
  closeIconSize="m"
1861
- closeIconType="close"
1862
1852
  content={
1863
1853
  <CardGrid
1864
1854
  className=""
@@ -2120,9 +2110,7 @@ exports[`Test Templates container Test removing all whatsapp filterss 1`] = `
2120
2110
  <CapRow />
2121
2111
  <CapRow>
2122
2112
  <CapSlideBox
2123
- closeIconPosition="right"
2124
2113
  closeIconSize="m"
2125
- closeIconType="close"
2126
2114
  content={
2127
2115
  <CardGrid
2128
2116
  className=""
@@ -2358,9 +2346,7 @@ exports[`Test Templates container Test removing all whatsapp filterss 2`] = `
2358
2346
  <CapRow />
2359
2347
  <CapRow>
2360
2348
  <CapSlideBox
2361
- closeIconPosition="right"
2362
2349
  closeIconSize="m"
2363
- closeIconType="close"
2364
2350
  content={
2365
2351
  <CardGrid
2366
2352
  className=""
@@ -2596,9 +2582,7 @@ exports[`Test Templates container Test removing single filter 1`] = `
2596
2582
  <CapRow />
2597
2583
  <CapRow>
2598
2584
  <CapSlideBox
2599
- closeIconPosition="right"
2600
2585
  closeIconSize="m"
2601
- closeIconType="close"
2602
2586
  content={
2603
2587
  <CardGrid
2604
2588
  className=""
@@ -889,8 +889,10 @@ export const Whatsapp = (props) => {
889
889
 
890
890
  const noContentBetweenVars = /}}\s*{{/g;
891
891
  const moreThanTwoBrackets = /{{3,}([1-9]|1[0-9])}{3,}/g;
892
-
893
- if (validVarArr?.length > 0 || invalidVarArr?.length > 0) {
892
+ const consecutiveNewLines = /\n\s*\n\s*\n/;
893
+ if (value.match(consecutiveNewLines)) {
894
+ errorMessage = formatMessage(messages.removeMultinewlineChars);
895
+ } else if (validVarArr?.length > 0 || invalidVarArr?.length > 0) {
894
896
  if (validVarArr?.length !== validVarSet?.length) {
895
897
  //checks for repetations like Hi {{1}}, offer for you {{1}}
896
898
  errorMessage = formatMessage(messages.repetativeVars);
@@ -180,6 +180,11 @@ export default defineMessages({
180
180
  defaultMessage:
181
181
  'Variable name should be numeric value from {{1}} to {{19}}',
182
182
  },
183
+ removeMultinewlineChars: {
184
+ id: `${prefix}.removeMultinewlineChars`,
185
+ defaultMessage:
186
+ 'More than two consecutive line breaks are not allowed.',
187
+ },
183
188
  noContentBetweenVars: {
184
189
  id: `${prefix}.noContentBetweenVars`,
185
190
  defaultMessage: 'Add atleast 1 character between 2 variables',