@capillarytech/creatives-library 8.0.113 → 8.0.114-alpha.0

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 (106) hide show
  1. package/containers/App/test/saga.test.js +1 -1
  2. package/containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +1 -1
  3. package/containers/Assets/Gallery/tests/actions.test.js +2 -3
  4. package/containers/Assets/Gallery/tests/reducer.test.js +7 -7
  5. package/containers/Assets/Gallery/tests/saga.test.js +9 -9
  6. package/containers/Dashboard/test/saga.test.js +1 -1
  7. package/containers/Ebill/test/saga.test.js +1 -1
  8. package/containers/Email/test/saga.test.js +33 -33
  9. package/containers/LanguageProvider/tests/actions.test.js +1 -1
  10. package/containers/LanguageProvider/tests/reducer.test.js +2 -2
  11. package/containers/LanguageProvider/tests/selectors.test.js +1 -1
  12. package/containers/Line/Create/tests/saga.test.js +2 -9
  13. package/containers/Line/Edit/test/saga.test.js +10 -14
  14. package/containers/MobilePush/Create/test/saga.test.js +2 -2
  15. package/containers/MobilePush/Edit/tests/saga.test.js +14 -14
  16. package/containers/Sms/Create/test/saga.test.js +4 -5
  17. package/containers/Sms/Edit/test/saga.test.js +1 -1
  18. package/containers/Templates/test/saga.test.js +14 -17
  19. package/containers/WeChat/MapTemplates/test/saga.test.js +9 -13
  20. package/containers/WeChat/RichmediaTemplates/Create/test/saga.test.js +1 -1
  21. package/containers/WeChat/RichmediaTemplates/Edit/test/saga.test.js +1 -1
  22. package/package.json +1 -1
  23. package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +8 -9
  24. package/utils/commonUtils.js +389 -3
  25. package/utils/tagValidations.js +20 -5
  26. package/utils/tests/authWrapper.test.js +2 -2
  27. package/utils/tests/cdnTransformation.test.js +16 -15
  28. package/utils/tests/commonUtil.test.js +324 -178
  29. package/v2Components/CapVideoUpload/tests/index.test.js +1 -1
  30. package/v2Components/CapWhatsappCTA/tests/index.test.js +1 -2
  31. package/v2Components/ErrorInfoNote/ErrorTypeRenderer.js +130 -0
  32. package/v2Components/ErrorInfoNote/ErrorTypeRenderer.test.js +146 -0
  33. package/v2Components/ErrorInfoNote/index.js +114 -46
  34. package/v2Components/ErrorInfoNote/messages.js +25 -0
  35. package/v2Components/ErrorInfoNote/style.scss +14 -1
  36. package/v2Components/ErrorInfoNote/utils.js +28 -0
  37. package/v2Components/ErrorInfoNote/utils.test.js +93 -0
  38. package/v2Components/FormBuilder/index.js +200 -127
  39. package/v2Components/FormBuilder/messages.js +1 -1
  40. package/v2Components/MarketingObjective/test/index.test.js +1 -1
  41. package/v2Components/NavigationBar/tests/saga.test.js +2 -3
  42. package/v2Containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +1 -1
  43. package/v2Containers/Assets/Gallery/tests/actions.test.js +2 -3
  44. package/v2Containers/Assets/Gallery/tests/reducer.test.js +7 -7
  45. package/v2Containers/Assets/Gallery/tests/saga.test.js +2 -2
  46. package/v2Containers/BeeEditor/test/saga.test.js +1 -1
  47. package/v2Containers/CallTask/test/saga.test.js +1 -1
  48. package/v2Containers/Cap/reducer.js +4 -4
  49. package/v2Containers/Cap/tests/actions.test.js +1 -1
  50. package/v2Containers/Cap/tests/reducer.test.js +11 -11
  51. package/v2Containers/Cap/tests/saga.test.js +1 -1
  52. package/v2Containers/Cap/tests/selectors.test.js +3 -3
  53. package/v2Containers/CapFacebookPreview/tests/saga.test.js +1 -1
  54. package/v2Containers/CreativesContainer/SlideBoxContent.js +23 -3
  55. package/v2Containers/CreativesContainer/SlideBoxFooter.js +3 -1
  56. package/v2Containers/CreativesContainer/constants.js +2 -1
  57. package/v2Containers/CreativesContainer/index.js +37 -10
  58. package/v2Containers/CreativesContainer/messages.js +4 -0
  59. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +21 -3
  60. package/v2Containers/Ebill/index.js +3 -3
  61. package/v2Containers/Ebill/test/saga.test.js +1 -1
  62. package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +4 -4
  63. package/v2Containers/Email/tests/actions.test.js +1 -1
  64. package/v2Containers/Email/tests/reducer.test.js +2 -2
  65. package/v2Containers/EmailWrapper/components/EmailWrapperView.js +1 -1
  66. package/v2Containers/FTP/test/saga.test.js +1 -1
  67. package/v2Containers/Facebook/test/saga.test.js +7 -7
  68. package/v2Containers/InApp/index.js +127 -49
  69. package/v2Containers/InApp/tests/action.test.js +7 -7
  70. package/v2Containers/InApp/tests/index.test.js +2 -4
  71. package/v2Containers/InApp/tests/reducer.test.js +175 -89
  72. package/v2Containers/InApp/tests/sagas.test.js +1 -1
  73. package/v2Containers/InApp/utils.js +37 -0
  74. package/v2Containers/LanguageProvider/tests/actions.test.js +1 -1
  75. package/v2Containers/LanguageProvider/tests/reducer.test.js +3 -3
  76. package/v2Containers/LanguageProvider/tests/saga.test.js +2 -2
  77. package/v2Containers/LanguageProvider/tests/selectors.test.js +1 -1
  78. package/v2Containers/Line/Container/ImageCarousel/tests/utils.test.js +3 -3
  79. package/v2Containers/Line/Container/Sticker/tests/utils.test.js +6 -6
  80. package/v2Containers/MobilePush/Create/index.js +24 -20
  81. package/v2Containers/MobilePush/Create/test/saga.test.js +2 -2
  82. package/v2Containers/MobilePush/Edit/index.js +4 -1
  83. package/v2Containers/MobilePush/Edit/test/saga.test.js +14 -14
  84. package/v2Containers/MobilepushWrapper/index.js +2 -0
  85. package/v2Containers/Rcs/tests/saga.test.js +1 -1
  86. package/v2Containers/Sms/Create/index.js +14 -2
  87. package/v2Containers/Sms/Create/test/saga.test.js +1 -1
  88. package/v2Containers/Sms/Edit/index.js +2 -0
  89. package/v2Containers/Sms/Edit/test/saga.test.js +5 -5
  90. package/v2Containers/SmsTrai/Create/tests/saga.test.js +1 -1
  91. package/v2Containers/SmsTrai/Create/tests/selectors.test.js +1 -1
  92. package/v2Containers/SmsWrapper/index.js +2 -0
  93. package/v2Containers/TagList/tests/TagList.test.js +1 -3
  94. package/v2Containers/TagList/tests/utils.test.js +3 -3
  95. package/v2Containers/Templates/tests/actions.test.js +1 -1
  96. package/v2Containers/Templates/tests/reducer.test.js +8 -8
  97. package/v2Containers/Templates/tests/sagas.test.js +2 -4
  98. package/v2Containers/WeChat/MapTemplates/test/saga.test.js +9 -13
  99. package/v2Containers/WeChat/RichmediaTemplates/Create/test/saga.test.js +1 -1
  100. package/v2Containers/WeChat/RichmediaTemplates/Edit/test/saga.test.js +1 -1
  101. package/v2Containers/Whatsapp/tests/__snapshots__/utils.test.js.snap +9 -9
  102. package/v2Containers/Whatsapp/tests/actions.test.js +3 -3
  103. package/v2Containers/Whatsapp/tests/reducer.test.js +32 -36
  104. package/v2Containers/Whatsapp/tests/utils.test.js +19 -19
  105. package/v2Containers/Zalo/tests/actions.test.js +3 -3
  106. package/v2Containers/Zalo/tests/reducer.test.js +72 -42
@@ -6,7 +6,7 @@ import * as sagas from '../sagas';
6
6
  import { call } from 'redux-saga/effects';
7
7
 
8
8
  describe('fetchUserList Saga', () => {
9
- it('handles fetching user list successfully', () => {
9
+ it.concurrent('handles fetching user list successfully', () => {
10
10
  const fakeResponse = {
11
11
  data: {
12
12
  result: [{ id: 1, name: 'User One' }]
@@ -25,7 +25,7 @@ describe('fetchUserList Saga', () => {
25
25
  .run();
26
26
  });
27
27
 
28
- it('handles failure in fetching user list', () => {
28
+ it.concurrent('handles failure in fetching user list', () => {
29
29
  const error = new Error('Fetch failed');
30
30
 
31
31
  return expectSaga(sagas.fetchUserList)
@@ -6,7 +6,7 @@ import {
6
6
 
7
7
  describe("BEFREE Sagas", () => {
8
8
  describe("BEFREE Combined", () => {
9
- it("should initialize all BEFREE-related watcher sagas without error", () => {
9
+ it.concurrent("should initialize all BEFREE-related watcher sagas without error", () => {
10
10
  return expectSaga(v2BeeEditionSagas).run();
11
11
  });
12
12
  });
@@ -6,7 +6,7 @@ import {
6
6
 
7
7
  describe("Call Task Sagas", () => {
8
8
  describe("v2CallTaskSagas Combined", () => {
9
- it("should initialize all v2CallTaskSagas-related watcher sagas without error", () => {
9
+ it.concurrent("should initialize all v2CallTaskSagas-related watcher sagas without error", () => {
10
10
  return expectSaga(v2CallTaskSagas).run();
11
11
  });
12
12
  });
@@ -90,13 +90,13 @@ function capReducer(state = fromJS(initialState.cap), action) {
90
90
  .set('fetchingSchemaError', true);
91
91
  case types.GET_LIQUID_TAGS_REQUEST:
92
92
  return state
93
- .set('fetchingLiquidTags', true)
93
+ .set('fetchingLiquidTags', true);
94
94
  case types.GET_LIQUID_TAGS_FAILURE:
95
95
  return state
96
- .set('fetchingLiquidTags', false)
97
- case types.GET_LIQUID_TAGS_SUCCESS:
96
+ .set('fetchingLiquidTags', false);
97
+ case types.GET_LIQUID_TAGS_SUCCESS:
98
98
  return state
99
- .set('fetchingLiquidTags', false)
99
+ .set('fetchingLiquidTags', false);
100
100
  case types.GET_SCHEMA_FOR_ENTITY_SUCCESS: {
101
101
  //Process standard tags
102
102
  const standardTagMapInitial = _.keyBy(
@@ -2,7 +2,7 @@ import * as types from '../constants';
2
2
  import * as actions from '../actions';
3
3
 
4
4
  describe('Test CAP actions', () => {
5
- it('has a type of GET_SUPPORT_VIDEOS_CONFIG_REQUEST action', () => {
5
+ test.concurrent('has a type of GET_SUPPORT_VIDEOS_CONFIG_REQUEST action', () => {
6
6
  const expected = {
7
7
  type: types.GET_SUPPORT_VIDEOS_CONFIG_REQUEST,
8
8
  };
@@ -27,7 +27,7 @@ import { loadItem } from '../../../services/localStorageApi';
27
27
 
28
28
  describe('should handle GET_SUPPORT_VIDEOS_CONFIG', () => {
29
29
  const mockedInitialState = fromJS(initialState.cap);
30
- it('should handle GET_SUPPORT_VIDEOS_CONFIG_REQUEST', () => {
30
+ it.concurrent('should handle GET_SUPPORT_VIDEOS_CONFIG_REQUEST', () => {
31
31
  const action = {
32
32
  type: GET_SUPPORT_VIDEOS_CONFIG_REQUEST,
33
33
  };
@@ -38,7 +38,7 @@ describe('should handle GET_SUPPORT_VIDEOS_CONFIG', () => {
38
38
  });
39
39
  });
40
40
 
41
- it('it handles the GET_SUPPORT_VIDEOS_CONFIG_SUCCESS action', () => {
41
+ it.concurrent('it handles the GET_SUPPORT_VIDEOS_CONFIG_SUCCESS action', () => {
42
42
  const result = {
43
43
  is_active: true,
44
44
  _id: "12345",
@@ -58,7 +58,7 @@ describe('should handle GET_SUPPORT_VIDEOS_CONFIG', () => {
58
58
  });
59
59
  });
60
60
 
61
- it('should handle GET_SUPPORT_VIDEOS_CONFIG_FAILURE', () => {
61
+ it.concurrent('should handle GET_SUPPORT_VIDEOS_CONFIG_FAILURE', () => {
62
62
  const error = 'Error';
63
63
  const action = {
64
64
  type: GET_SUPPORT_VIDEOS_CONFIG_FAILURE,
@@ -70,28 +70,28 @@ describe('should handle GET_SUPPORT_VIDEOS_CONFIG', () => {
70
70
  demoVideoAndLinkJSONStatus: FAILURE,
71
71
  });
72
72
  });
73
- it('handles the GET_LIQUID_TAGS_REQUEST action', () => {
73
+ it.concurrent('handles the GET_LIQUID_TAGS_REQUEST action', () => {
74
74
  const action = {
75
75
  type: GET_LIQUID_TAGS_REQUEST,
76
76
  };
77
77
  expect(reducer(mockedInitialState, action).toJS()).toEqual(expectedStateGetLiquidTagsRequest);
78
78
  });
79
79
 
80
- it('handles the GET_LIQUID_TAGS_FAILURE action', () => {
80
+ it.concurrent('handles the GET_LIQUID_TAGS_FAILURE action', () => {
81
81
  const action = {
82
82
  type: GET_LIQUID_TAGS_FAILURE,
83
83
  };
84
84
  expect(reducer(mockedInitialState, action).toJS()).toEqual(expectedStateGetLiquidTagsFailure);
85
85
  });
86
86
 
87
- it('handles the GET_LIQUID_TAGS_SUCCESS action', () => {
87
+ it.concurrent('handles the GET_LIQUID_TAGS_SUCCESS action', () => {
88
88
  const action = {
89
89
  type: GET_LIQUID_TAGS_SUCCESS,
90
90
  };
91
91
  expect(reducer(mockedInitialState, action).toJS()).toEqual(expectedStateGetLiquidTagsSuccess);
92
92
  });
93
93
 
94
- it('handles the GET_SCHEMA_FOR_ENTITY_SUCCESS action with action type as TAG', () => {
94
+ it.concurrent('handles the GET_SCHEMA_FOR_ENTITY_SUCCESS action with action type as TAG', () => {
95
95
  const action = {
96
96
  type: GET_SCHEMA_FOR_ENTITY_SUCCESS,
97
97
  data: { metaEntities: { standard: { random: "32" } } },
@@ -101,7 +101,7 @@ describe('should handle GET_SUPPORT_VIDEOS_CONFIG', () => {
101
101
  expect(reducer(mockedInitialState, action).toJS()).toEqual(expectedStateGetSchemaForEntitySuccessTAG);
102
102
  });
103
103
 
104
- it('handles the GET_SCHEMA_FOR_ENTITY_SUCCESS action', () => {
104
+ it.concurrent('handles the GET_SCHEMA_FOR_ENTITY_SUCCESS action', () => {
105
105
  const action = {
106
106
  type: GET_SCHEMA_FOR_ENTITY_SUCCESS,
107
107
  data: { metaEntities: { standard: { random: "32" } } },
@@ -109,7 +109,7 @@ describe('should handle GET_SUPPORT_VIDEOS_CONFIG', () => {
109
109
 
110
110
  expect(reducer(mockedInitialState, action).toJS()).toEqual(expectedStateGetSchemaForEntitySuccess);
111
111
  });
112
- it('handles the GET_SCHEMA_FOR_ENTITY_SUCCESS action', () => {
112
+ it.concurrent('handles the GET_SCHEMA_FOR_ENTITY_SUCCESS action', () => {
113
113
  const action = {
114
114
  type: SET_INJECTED_TAGS,
115
115
  data: {},
@@ -120,7 +120,7 @@ describe('should handle GET_SUPPORT_VIDEOS_CONFIG', () => {
120
120
  });
121
121
 
122
122
  describe('GET_SCHEMA_FOR_ENTITY_SUCCESS handler', () => {
123
- it('should handle existing tagLookupMap correctly when metaEntities and tagLookupMap exist', () => {
123
+ it.concurrent('should handle existing tagLookupMap correctly when metaEntities and tagLookupMap exist', () => {
124
124
  const initialStateTest = fromJS({
125
125
  token: loadItem('token') || '',
126
126
  orgID: loadItem('orgID') || '',
@@ -184,7 +184,7 @@ describe('GET_SCHEMA_FOR_ENTITY_SUCCESS handler', () => {
184
184
  }));
185
185
  });
186
186
 
187
- it('should handle non-existent tagLookupMap by returning empty object', () => {
187
+ it.concurrent('should handle non-existent tagLookupMap by returning empty object', () => {
188
188
  const initialStateTest = fromJS({
189
189
  token: loadItem('token') || '',
190
190
  orgID: loadItem('orgID') || '',
@@ -41,7 +41,7 @@ import { LOGOUT_FAILURE, LOGOUT_REQUEST, LOGOUT_SUCCESS } from '../../../contain
41
41
 
42
42
 
43
43
  describe('v2CapSagas', () => {
44
- it("should initialize all v2CapSagas-related watcher sagas without error", () => {
44
+ it("should initialize all v2CapSagas-related watcher sagas without error", async () => {
45
45
  return expectSaga(v2CapSagas).run();
46
46
  });
47
47
  });
@@ -14,7 +14,7 @@ describe('CapSelectors', () => {
14
14
 
15
15
  //not need now :Temp
16
16
  // describe('makeSelectLocationState', () => {
17
- // it('should select the route as a plain JS object', () => {
17
+ // it.concurrent('should select the route as a plain JS object', () => {
18
18
  // const route = fromJS({
19
19
  // locationBeforeTransitions: null,
20
20
  // });
@@ -24,7 +24,7 @@ describe('CapSelectors', () => {
24
24
  // expect(makeSelectLocationState()(mockedState)).toEqual(route.toJS());
25
25
  // });
26
26
 
27
- // it('should return cached js routeState for same concurrent calls', () => {
27
+ // it.concurrent('should return cached js routeState for same concurrent calls', () => {
28
28
  // const route = fromJS({
29
29
  // locationBeforeTransitions: null,
30
30
  // });
@@ -39,7 +39,7 @@ describe('CapSelectors', () => {
39
39
  // });
40
40
 
41
41
  describe('makeSelectDemoVideoAndLink selector', () => {
42
- it('should return the correct substate', () => {
42
+ it.concurrent('should return the correct substate', () => {
43
43
  const selected = makeSelectDemoVideoAndLink().resultFunc(
44
44
  mockState.get('cap'),
45
45
  );
@@ -6,7 +6,7 @@ import {
6
6
 
7
7
  describe("v2CapFacebookPreviewSagas Sagas", () => {
8
8
  describe("v2CapFacebookPreviewSagas Combined", () => {
9
- it("should initialize all v2CapFacebookPreviewSagas-related watcher sagas without error", () => {
9
+ it.concurrent("should initialize all v2CapFacebookPreviewSagas-related watcher sagas without error", () => {
10
10
  return expectSaga(v2CapFacebookPreviewSagas).run();
11
11
  });
12
12
  });
@@ -499,6 +499,7 @@ export function SlideBoxContent(props) {
499
499
  }
500
500
  {isEditSms && (
501
501
  <SmsWrapper
502
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
502
503
  setIsLoadingContent={setIsLoadingContent}
503
504
  isEditSms={isEditSms}
504
505
  location={creativesLocationProps}
@@ -554,6 +555,7 @@ export function SlideBoxContent(props) {
554
555
  }}
555
556
  hostName={hostName}
556
557
  eventContextTags={eventContextTags}
558
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
557
559
  />
558
560
  }
559
561
  {
@@ -568,6 +570,7 @@ export function SlideBoxContent(props) {
568
570
  }
569
571
  {isCreateSms && (
570
572
  <SmsWrapper
573
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
571
574
  setIsLoadingContent={setIsLoadingContent}
572
575
  location={creativesLocationProps}
573
576
  route={{ name: 'sms' }}
@@ -674,6 +677,7 @@ export function SlideBoxContent(props) {
674
677
  hideTestAndPreviewBtn={hideTestAndPreviewBtn}
675
678
  creativesMode={creativesMode}
676
679
  eventContextTags={eventContextTags}
680
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
677
681
  />
678
682
  }
679
683
  {isCreateMPush &&
@@ -703,6 +707,7 @@ export function SlideBoxContent(props) {
703
707
  hideTestAndPreviewBtn={hideTestAndPreviewBtn}
704
708
  onTestContentClicked={onTestContentClicked}
705
709
  eventContextTags={eventContextTags}
710
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
706
711
  />
707
712
  }
708
713
  {
@@ -722,6 +727,7 @@ export function SlideBoxContent(props) {
722
727
  onSelectTemplate={onSelectTemplate}
723
728
  orgUnitId={orgUnitId}
724
729
  eventContextTags={eventContextTags}
730
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
725
731
  />
726
732
  )
727
733
  }
@@ -742,6 +748,7 @@ export function SlideBoxContent(props) {
742
748
  fbAdManager={fbAdManager}
743
749
  onSelectTemplate={onSelectTemplate}
744
750
  eventContextTags={eventContextTags}
751
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
745
752
  />
746
753
  )
747
754
  }
@@ -764,6 +771,7 @@ export function SlideBoxContent(props) {
764
771
  handleClose={handleClose}
765
772
  selectedOfferDetails={selectedOfferDetails}
766
773
  eventContextTags={eventContextTags}
774
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
767
775
  />
768
776
  )
769
777
  }
@@ -783,6 +791,7 @@ export function SlideBoxContent(props) {
783
791
  handleClose={handleClose}
784
792
  selectedOfferDetails={selectedOfferDetails}
785
793
  eventContextTags={eventContextTags}
794
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
786
795
  />
787
796
  )
788
797
  }
@@ -798,6 +807,7 @@ export function SlideBoxContent(props) {
798
807
  templateData={templateData}
799
808
  selectedOfferDetails={selectedOfferDetails}
800
809
  eventContextTags={eventContextTags}
810
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
801
811
  createNew/>
802
812
  )}
803
813
 
@@ -815,13 +825,16 @@ export function SlideBoxContent(props) {
815
825
  templateData={templateData}
816
826
  selectedOfferDetails={selectedOfferDetails}
817
827
  eventContextTags={eventContextTags}
828
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
818
829
  createNew/> }
819
830
 
820
831
  {isCreateWhatsapp && (<Whatsapp
821
832
  isFullMode={isFullMode}
822
833
  onCreateComplete={onCreateComplete}
823
834
  eventContextTags={eventContextTags}
824
- handleClose={handleClose}/>
835
+ handleClose={handleClose}
836
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
837
+ />
825
838
  )}
826
839
 
827
840
  {isEditWhatsapp && (<Whatsapp
@@ -839,7 +852,9 @@ export function SlideBoxContent(props) {
839
852
  pathname: `/whatsapp/edit`,
840
853
  query,
841
854
  search: '',
842
- }}/>
855
+ }}
856
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
857
+ />
843
858
  )}
844
859
 
845
860
  {isCreateInApp && (<InApp
@@ -856,6 +871,7 @@ export function SlideBoxContent(props) {
856
871
  templateData={templateData}
857
872
  getDefaultTags={type}
858
873
  eventContextTags={eventContextTags}
874
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
859
875
  />
860
876
  )}
861
877
 
@@ -875,11 +891,14 @@ export function SlideBoxContent(props) {
875
891
  pathname: `/inapp/edit`,
876
892
  query,
877
893
  search: '',
878
- }} />
894
+ }}
895
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
896
+ />
879
897
  )}
880
898
 
881
899
  {isCreateRcs && (<Rcs
882
900
  {...rcsCommonProps}
901
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
883
902
  location={{
884
903
  pathname: `/rcs/create`,
885
904
  query,
@@ -888,6 +907,7 @@ export function SlideBoxContent(props) {
888
907
  )}
889
908
  {isEditRcs && (<Rcs
890
909
  {...rcsCommonProps}
910
+ showLiquidErrorInFooter={showLiquidErrorInFooter}
891
911
  templateData={templateData}
892
912
  params={{
893
913
  id: templateData._id,
@@ -25,10 +25,12 @@ function SlideBoxFooter(props) {
25
25
  isTemplateNameEmpty,
26
26
  errorMessages,
27
27
  isLiquidValidationError,
28
+ currentTab,
28
29
  } = props;
30
+
29
31
  return (
30
32
  <div className='template-footer-width'>
31
- {isLiquidValidationError && (<ErrorInfoNote errorMessages={errorMessages} />)}
33
+ {isLiquidValidationError && (<ErrorInfoNote errorMessages={errorMessages} currentTab={currentTab?.toUpperCase()} />)}
32
34
  <div>
33
35
  {props.shouldShowDoneFooter() && (
34
36
  <div>
@@ -33,7 +33,7 @@ export const HIDE_CONTAINER_LOADER = "app/CreativesContainer/HIDE_CONTAINER_LOAD
33
33
  export const WHATSAPP_HELP_DOC_LINK = "https://docs.capillarytech.com/docs/create-whatsapp-template";
34
34
 
35
35
  export const ENABLE_AI_SUGGESTIONS = "ENABLE_AI_SUGGESTIONS";
36
- export const LIQUID_SUPPORTED_CHANNELS = [EMAIL];
36
+ export const LIQUID_SUPPORTED_CHANNELS = [EMAIL, SMS, MOBILE_PUSH, INAPP];
37
37
 
38
38
  export const EMF = "EMF";
39
39
  export const VENENO = "VENENO";
@@ -44,3 +44,4 @@ export const EXTERNAL_URL = "EXTERNAL_URL";
44
44
 
45
45
  export const TRANSACTION = "TRANSACTION";
46
46
  export const BIG_TEXT = "BIG_TEXT";
47
+ export const GENERIC = "GENERIC";
@@ -59,6 +59,7 @@ import {
59
59
  } from '@capillarytech/cap-ui-library/styled/variables';
60
60
  import { DAEMON } from '@capillarytech/vulcan-react-sdk/utils/sagaInjectorTypes';
61
61
  import { DYNAMIC_URL } from '../../v2Components/CapWhatsappCTA/constants';
62
+ import ErrorInfoNote from '../../v2Components/ErrorInfoNote';
62
63
 
63
64
  import {
64
65
  transformChannelPayload,
@@ -94,7 +95,13 @@ export class Creatives extends React.Component {
94
95
  weChatMaptemplateStep: 0,
95
96
  isLiquidValidationError: false,
96
97
  errorMessages: [],
98
+ liquidErrorMessage: {
99
+ STANDARD_ERROR_MSG: [],
100
+ LIQUID_ERROR_MSG: [],
101
+ },
102
+ activeFormBuilderTab: constants.ANDROID,
97
103
  };
104
+ this.liquidFlow = Boolean(commonUtil.hasLiquidSupportFeature());
98
105
  this.creativesTemplateSteps = {
99
106
  1: 'modeSelection',
100
107
  2: 'templateSelection', // only for email in current flows wil be used for mpush, line and wechat as well.
@@ -1104,6 +1111,7 @@ export class Creatives extends React.Component {
1104
1111
  }
1105
1112
 
1106
1113
  getFormData = (template) => {
1114
+
1107
1115
  if (template.validity) {
1108
1116
  this.setState(
1109
1117
  {
@@ -1326,10 +1334,14 @@ export class Creatives extends React.Component {
1326
1334
  }
1327
1335
  }
1328
1336
 
1329
- showLiquidErrorInFooter = (errorMessages) => {
1330
- const isError = (errorMessages?.STANDARD_ERROR_MSG?.length > 0 || errorMessages?.LIQUID_ERROR_MSG?.length > 0);
1331
- this.setState({ isLiquidValidationError: isError, errorMessages });
1332
- };
1337
+ showLiquidErrorInFooter = (errorMessagesFromFormBuilder, currentFormBuilderTab) => {
1338
+
1339
+ this.setState({
1340
+ isLiquidValidationError: !isEmpty(get(errorMessagesFromFormBuilder, 'LIQUID_ERROR_MSG', [])) || !isEmpty(get(errorMessagesFromFormBuilder, 'STANDARD_ERROR_MSG', [])),
1341
+ liquidErrorMessage: errorMessagesFromFormBuilder,
1342
+ activeFormBuilderTab: currentFormBuilderTab === 1 ? 'ANDROID' : (currentFormBuilderTab === 2 ? 'IOS' : null), // Update activeFormBuilderTab, default to 1 if undefined
1343
+ });
1344
+ }
1333
1345
 
1334
1346
  shouldShowContinueFooter = () => { // only for email for now, has to be modified according to channel
1335
1347
  const { slidBoxContent, templateStep, currentChannel, emailCreateMode, mobilePushCreateMode, inAppCreateMode, weChatTemplateType } = this.state;
@@ -1389,7 +1401,8 @@ export class Creatives extends React.Component {
1389
1401
  weChatMaptemplateStep,
1390
1402
  isTemplateNameEmpty,
1391
1403
  isLiquidValidationError,
1392
- errorMessages,
1404
+ liquidErrorMessage,
1405
+ activeFormBuilderTab,
1393
1406
  } = this.state;
1394
1407
  const {
1395
1408
  isFullMode,
@@ -1417,11 +1430,11 @@ export class Creatives extends React.Component {
1417
1430
  weChatTemplateType === MAP_TEMPLATE &&
1418
1431
  templateStep !== "modeSelection";
1419
1432
  const slideBoxWrapperMargin =
1420
- errorMessages?.STANDARD_ERROR_MSG?.length > 0 && errorMessages?.LIQUID_ERROR_MSG?.length > 0
1433
+ (get(liquidErrorMessage, 'STANDARD_ERROR_MSG.length', 0) > 0 && get(liquidErrorMessage, 'LIQUID_ERROR_MSG.length', 0) > 0)
1421
1434
  ? CAP_SPACE_64
1422
- : errorMessages?.LIQUID_ERROR_MSG?.length > 0
1435
+ : get(liquidErrorMessage, 'LIQUID_ERROR_MSG.length', 0) > 0
1423
1436
  ? CAP_SPACE_56
1424
- : errorMessages?.STANDARD_ERROR_MSG?.length > 0
1437
+ : get(liquidErrorMessage, 'STANDARD_ERROR_MSG.length', 0) > 0
1425
1438
  ? CAP_SPACE_32
1426
1439
  : 0;
1427
1440
  /* TODO: Instead of passing down same props separately to each component down, write common function to these props and pass it accordingly */
@@ -1519,7 +1532,7 @@ export class Creatives extends React.Component {
1519
1532
  loyaltyMetaData={loyaltyMetaData}
1520
1533
  />
1521
1534
  )}
1522
- footer={this.shouldShowFooter() && (
1535
+ footer={this.shouldShowFooter() ? (
1523
1536
  <SlideBoxFooter
1524
1537
  isFullMode={isFullMode}
1525
1538
  messages={this.props.messages}
@@ -1536,13 +1549,24 @@ export class Creatives extends React.Component {
1536
1549
  fetchingCmsData={fetchingCmsData}
1537
1550
  isTemplateNameEmpty={isTemplateNameEmpty}
1538
1551
  isLiquidValidationError={isLiquidValidationError}
1539
- errorMessages={errorMessages}
1552
+ errorMessages={liquidErrorMessage}
1553
+ currentTab={activeFormBuilderTab}
1540
1554
  />
1555
+ ) : isLiquidValidationError && (
1556
+ <div className="template-footer-width">
1557
+ {(() => {
1558
+
1559
+ const errorsToShow = get(liquidErrorMessage, 'LIQUID_ERROR_MSG', []);
1560
+ const standardErrorsToShow = get(liquidErrorMessage, 'STANDARD_ERROR_MSG', []);
1561
+ return <ErrorInfoNote currentTab={activeFormBuilderTab?.toUpperCase()} errorMessages={{LIQUID_ERROR_MSG: errorsToShow, STANDARD_ERROR_MSG: standardErrorsToShow}} />;
1562
+ })()}
1563
+ </div>
1541
1564
  )}
1542
1565
  handleClose={this.handleCloseSlideBox}
1543
1566
  show={showSlideBox}
1544
1567
  size="size-xl"
1545
1568
  />
1569
+
1546
1570
  </SlideBoxWrapper>
1547
1571
  );
1548
1572
  }
@@ -1577,6 +1601,9 @@ Creatives.propTypes = {
1577
1601
  orgUnitId: PropTypes.number,
1578
1602
  hostName: PropTypes.string,
1579
1603
  eventContextTags: PropTypes.array,
1604
+ intl: PropTypes.shape({
1605
+ formatMessage: PropTypes.func,
1606
+ }),
1580
1607
  stopValidation: PropTypes.func,
1581
1608
  };
1582
1609
  const mapStatesToProps = () => createStructuredSelector({
@@ -14,6 +14,10 @@ export default defineMessages({
14
14
  id: 'creatives.containersV2.Creatives.continue',
15
15
  defaultMessage: 'Continue',
16
16
  },
17
+ "emailBodyEmptyError": {
18
+ id: 'creatives.componentsV2.FormBuilder.emailBodyEmptyError',
19
+ defaultMessage: 'Mobile push body cannot be empty',
20
+ },
17
21
  "lastUpdated": {
18
22
  id: 'creatives.containersV2.Creatives.lastUpdated',
19
23
  defaultMessage: 'Last updated: {date} by {user}',
@@ -215,7 +215,13 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
215
215
  footer={
216
216
  <SlideBoxFooter
217
217
  currentChannel="WHATSAPP"
218
- errorMessages={Array []}
218
+ currentTab="ANDROID"
219
+ errorMessages={
220
+ Object {
221
+ "LIQUID_ERROR_MSG": Array [],
222
+ "STANDARD_ERROR_MSG": Array [],
223
+ }
224
+ }
219
225
  isLiquidValidationError={false}
220
226
  onCreateNextStep={[Function]}
221
227
  onDiscard={[Function]}
@@ -301,7 +307,13 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
301
307
  footer={
302
308
  <SlideBoxFooter
303
309
  currentChannel="WHATSAPP"
304
- errorMessages={Array []}
310
+ currentTab="ANDROID"
311
+ errorMessages={
312
+ Object {
313
+ "LIQUID_ERROR_MSG": Array [],
314
+ "STANDARD_ERROR_MSG": Array [],
315
+ }
316
+ }
305
317
  isLiquidValidationError={false}
306
318
  onCreateNextStep={[Function]}
307
319
  onDiscard={[Function]}
@@ -387,7 +399,13 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
387
399
  footer={
388
400
  <SlideBoxFooter
389
401
  currentChannel="WHATSAPP"
390
- errorMessages={Array []}
402
+ currentTab="ANDROID"
403
+ errorMessages={
404
+ Object {
405
+ "LIQUID_ERROR_MSG": Array [],
406
+ "STANDARD_ERROR_MSG": Array [],
407
+ }
408
+ }
391
409
  isLiquidValidationError={false}
392
410
  onCreateNextStep={[Function]}
393
411
  onDiscard={[Function]}
@@ -955,7 +955,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
955
955
  }
956
956
  temp.injectedEvents = {};
957
957
  _.forEach(col.supportedEvents, (event) => {
958
- console.log('injected event for ', col, event, this.getMappedEvent(col.id, event));
958
+
959
959
  temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
960
960
  });
961
961
 
@@ -1135,7 +1135,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
1135
1135
  }
1136
1136
 
1137
1137
  cloneParent(section, tabIndex) {
1138
- console.log('trying to clone', JSON.stringify(section), tabIndex);
1138
+
1139
1139
  const parentsect = section;
1140
1140
  const childSectionsBeforeCloning = parentsect.childSections.slice();
1141
1141
  const childSections = [];
@@ -1152,7 +1152,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
1152
1152
  childSections.push(sect);
1153
1153
  return true;
1154
1154
  });
1155
- console.log('returning cloned parent section final 1', JSON.stringify(childSections));
1155
+
1156
1156
  parentsect.childSections = childSections;
1157
1157
 
1158
1158
  return _.cloneDeep(parentsect);
@@ -6,7 +6,7 @@ import {
6
6
 
7
7
  describe("EBILL Sagas", () => {
8
8
  describe("v2EbillSagas Combined", () => {
9
- it("should initialize all ebill-related watcher sagas without error", () => {
9
+ it.concurrent("should initialize all ebill-related watcher sagas without error", () => {
10
10
  return expectSaga(v2EbillSagas).run();
11
11
  });
12
12
  });
@@ -1,15 +1,15 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`emailReducer it handles the TRANSFORM_EMAIL_TEMPLATE_REQUEST action 1`] = `
3
+ exports[` 1`] = `
4
4
  Immutable.Map {
5
- "createTemplateInProgress": true,
5
+ "createTemplateInProgress": false,
6
6
  "createResponse": Immutable.Map {},
7
7
  }
8
8
  `;
9
9
 
10
- exports[`emailReducer it returns the initial state 1`] = `
10
+ exports[` 2`] = `
11
11
  Immutable.Map {
12
- "createTemplateInProgress": false,
12
+ "createTemplateInProgress": true,
13
13
  "createResponse": Immutable.Map {},
14
14
  }
15
15
  `;
@@ -2,7 +2,7 @@ import * as actions from '../actions';
2
2
  import * as types from '../constants';
3
3
 
4
4
  describe("transformEmailTemplate actions", () => {
5
- it("test action", () => {
5
+ test.concurrent("test action", () => {
6
6
  const callback = ()=>{};
7
7
  const template = {};
8
8
  const expected = {
@@ -3,11 +3,11 @@ import emailReducer from '../reducer';
3
3
  import * as types from '../constants';
4
4
 
5
5
  describe('emailReducer', () => {
6
- it('it returns the initial state', () => {
6
+ it.concurrent('it returns the initial state', () => {
7
7
  expect(emailReducer(undefined, {})).toMatchSnapshot();
8
8
  });
9
9
 
10
- it('it handles the TRANSFORM_EMAIL_TEMPLATE_REQUEST action ', () => {
10
+ it.concurrent('it handles the TRANSFORM_EMAIL_TEMPLATE_REQUEST action ', () => {
11
11
  const action = {
12
12
  type: types.TRANSFORM_EMAIL_TEMPLATE_REQUEST,
13
13
  template: {},
@@ -138,7 +138,7 @@ const EmailWrapperView = ({
138
138
  emailProps,
139
139
  cmsTemplatesProps,
140
140
  }) => {
141
- console.log("EmailLayout", step, emailCreateMode);
141
+
142
142
  const isShowTemplateSelection = step === STEPS.MODE_SELECTION || (step === STEPS.TEMPLATE_SELECTION && emailCreateMode === EMAIL_CREATE_MODES.UPLOAD);
143
143
 
144
144
  return (
@@ -6,7 +6,7 @@ import {
6
6
  } from "../sagas";
7
7
 
8
8
  describe("v2FTPSagas Combined", () => {
9
- it("should initialize all v2FTPSagas-related watcher sagas without error", () => {
9
+ it.concurrent("should initialize all v2FTPSagas-related watcher sagas without error", () => {
10
10
  return expectSaga(v2FTPSagas).run();
11
11
  });
12
12
  });