@capillarytech/creatives-library 9.0.56-alpha.2 → 9.0.56-alpha.4

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 (26) hide show
  1. package/package.json +1 -1
  2. package/v2Components/CommonTestAndPreview/actions.js +13 -0
  3. package/v2Components/CommonTestAndPreview/constants.js +6 -0
  4. package/v2Components/CommonTestAndPreview/index.js +22 -20
  5. package/v2Components/CommonTestAndPreview/reducer.js +20 -0
  6. package/v2Components/CommonTestAndPreview/sagas.js +28 -0
  7. package/v2Components/CommonTestAndPreview/selectors.js +6 -0
  8. package/v2Components/CommonTestAndPreview/tests/actions.test.js +15 -0
  9. package/v2Components/CommonTestAndPreview/tests/index.test.js +101 -0
  10. package/v2Components/CommonTestAndPreview/tests/reducer.test.js +41 -0
  11. package/v2Components/CommonTestAndPreview/tests/sagas.test.js +84 -0
  12. package/v2Components/CommonTestAndPreview/tests/selectors.test.js +12 -0
  13. package/v2Components/TestAndPreviewSlidebox/index.js +3 -0
  14. package/v2Containers/CommunicationFlow/CommunicationFlow.js +27 -22
  15. package/v2Containers/CommunicationFlow/CommunicationFlow.scss +29 -1
  16. package/v2Containers/CommunicationFlow/Tests/CommunicationFlow.test.js +30 -0
  17. package/v2Containers/CommunicationFlow/constants.js +2 -0
  18. package/v2Containers/CommunicationFlow/index.js +1 -1
  19. package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/ChannelSelectionStep.js +2 -22
  20. package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/ChannelSelectionStep.scss +4 -0
  21. package/v2Containers/CreativesContainer/index.js +0 -1
  22. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +103 -7
  23. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +24 -0
  24. package/v2Containers/WebPush/Create/preview/WebPushPreview.js +17 -12
  25. package/v2Containers/WebPush/Create/preview/tests/WebPushPreview.test.js +5 -0
  26. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +272 -0
@@ -12707,6 +12707,7 @@ FREE GIFTS-
12707
12707
  "getTestGroupsRequested": [Function],
12708
12708
  "getWeCrmAccountsRequested": [Function],
12709
12709
  "searchCustomersRequested": [Function],
12710
+ "sendCcsTestMessageRequested": [Function],
12710
12711
  "sendTestMessageRequested": [Function],
12711
12712
  "updatePreviewRequested": [Function],
12712
12713
  }
@@ -12752,6 +12753,7 @@ FREE GIFTS-
12752
12753
  isFetchingTestGroups={false}
12753
12754
  isLoadingSenderDetails={false}
12754
12755
  isSearchingCustomer={false}
12756
+ isSendingCcsTestMessage={false}
12755
12757
  isSendingTestMessage={false}
12756
12758
  isUpdatingPreview={false}
12757
12759
  messageMetaConfigId={null}
@@ -12788,11 +12790,13 @@ FREE GIFTS-
12788
12790
  "getTestGroupsRequested": [Function],
12789
12791
  "getWeCrmAccountsRequested": [Function],
12790
12792
  "searchCustomersRequested": [Function],
12793
+ "sendCcsTestMessageRequested": [Function],
12791
12794
  "sendTestMessageRequested": [Function],
12792
12795
  "updatePreviewRequested": [Function],
12793
12796
  }
12794
12797
  }
12795
12798
  beeInstance={null}
12799
+ ccsSendTransaction={null}
12796
12800
  channel={null}
12797
12801
  content="LATEST FASHION@VISHAL
12798
12802
  {#var#}
@@ -15081,6 +15085,7 @@ new message content.",
15081
15085
  isFetchingTestGroups={false}
15082
15086
  isLoadingSenderDetails={false}
15083
15087
  isSearchingCustomer={false}
15088
+ isSendingCcsTestMessage={false}
15084
15089
  isSendingTestMessage={false}
15085
15090
  isUpdatingPreview={false}
15086
15091
  messageMetaConfigId={null}
@@ -15119,11 +15124,13 @@ new message content.",
15119
15124
  "getTestGroupsRequested": [Function],
15120
15125
  "getWeCrmAccountsRequested": [Function],
15121
15126
  "searchCustomersRequested": [Function],
15127
+ "sendCcsTestMessageRequested": [Function],
15122
15128
  "sendTestMessageRequested": [Function],
15123
15129
  "updatePreviewRequested": [Function],
15124
15130
  }
15125
15131
  }
15126
15132
  beeInstance={null}
15133
+ ccsSendTransaction={null}
15127
15134
  channel="SMS"
15128
15135
  config={
15129
15136
  Object {
@@ -17419,6 +17426,7 @@ new message content.",
17419
17426
  isFetchingTestGroups={false}
17420
17427
  isLoadingSenderDetails={false}
17421
17428
  isSearchingCustomer={false}
17429
+ isSendingCcsTestMessage={false}
17422
17430
  isSendingTestMessage={false}
17423
17431
  isUpdatingPreview={false}
17424
17432
  messageMetaConfigId={null}
@@ -31827,6 +31835,7 @@ FREE GIFTS-
31827
31835
  "getTestGroupsRequested": [Function],
31828
31836
  "getWeCrmAccountsRequested": [Function],
31829
31837
  "searchCustomersRequested": [Function],
31838
+ "sendCcsTestMessageRequested": [Function],
31830
31839
  "sendTestMessageRequested": [Function],
31831
31840
  "updatePreviewRequested": [Function],
31832
31841
  }
@@ -31872,6 +31881,7 @@ FREE GIFTS-
31872
31881
  isFetchingTestGroups={false}
31873
31882
  isLoadingSenderDetails={false}
31874
31883
  isSearchingCustomer={false}
31884
+ isSendingCcsTestMessage={false}
31875
31885
  isSendingTestMessage={false}
31876
31886
  isUpdatingPreview={false}
31877
31887
  messageMetaConfigId={null}
@@ -31908,11 +31918,13 @@ FREE GIFTS-
31908
31918
  "getTestGroupsRequested": [Function],
31909
31919
  "getWeCrmAccountsRequested": [Function],
31910
31920
  "searchCustomersRequested": [Function],
31921
+ "sendCcsTestMessageRequested": [Function],
31911
31922
  "sendTestMessageRequested": [Function],
31912
31923
  "updatePreviewRequested": [Function],
31913
31924
  }
31914
31925
  }
31915
31926
  beeInstance={null}
31927
+ ccsSendTransaction={null}
31916
31928
  channel={null}
31917
31929
  content="LATEST FASHION@VISHAL
31918
31930
  test1
@@ -34201,6 +34213,7 @@ new message content.",
34201
34213
  isFetchingTestGroups={false}
34202
34214
  isLoadingSenderDetails={false}
34203
34215
  isSearchingCustomer={false}
34216
+ isSendingCcsTestMessage={false}
34204
34217
  isSendingTestMessage={false}
34205
34218
  isUpdatingPreview={false}
34206
34219
  messageMetaConfigId={null}
@@ -34239,11 +34252,13 @@ new message content.",
34239
34252
  "getTestGroupsRequested": [Function],
34240
34253
  "getWeCrmAccountsRequested": [Function],
34241
34254
  "searchCustomersRequested": [Function],
34255
+ "sendCcsTestMessageRequested": [Function],
34242
34256
  "sendTestMessageRequested": [Function],
34243
34257
  "updatePreviewRequested": [Function],
34244
34258
  }
34245
34259
  }
34246
34260
  beeInstance={null}
34261
+ ccsSendTransaction={null}
34247
34262
  channel="SMS"
34248
34263
  config={
34249
34264
  Object {
@@ -36539,6 +36554,7 @@ new message content.",
36539
36554
  isFetchingTestGroups={false}
36540
36555
  isLoadingSenderDetails={false}
36541
36556
  isSearchingCustomer={false}
36557
+ isSendingCcsTestMessage={false}
36542
36558
  isSendingTestMessage={false}
36543
36559
  isUpdatingPreview={false}
36544
36560
  messageMetaConfigId={null}
@@ -49483,6 +49499,7 @@ FREE GIFTS-
49483
49499
  "getTestGroupsRequested": [Function],
49484
49500
  "getWeCrmAccountsRequested": [Function],
49485
49501
  "searchCustomersRequested": [Function],
49502
+ "sendCcsTestMessageRequested": [Function],
49486
49503
  "sendTestMessageRequested": [Function],
49487
49504
  "updatePreviewRequested": [Function],
49488
49505
  }
@@ -49528,6 +49545,7 @@ FREE GIFTS-
49528
49545
  isFetchingTestGroups={false}
49529
49546
  isLoadingSenderDetails={false}
49530
49547
  isSearchingCustomer={false}
49548
+ isSendingCcsTestMessage={false}
49531
49549
  isSendingTestMessage={false}
49532
49550
  isUpdatingPreview={false}
49533
49551
  messageMetaConfigId={null}
@@ -49564,11 +49582,13 @@ FREE GIFTS-
49564
49582
  "getTestGroupsRequested": [Function],
49565
49583
  "getWeCrmAccountsRequested": [Function],
49566
49584
  "searchCustomersRequested": [Function],
49585
+ "sendCcsTestMessageRequested": [Function],
49567
49586
  "sendTestMessageRequested": [Function],
49568
49587
  "updatePreviewRequested": [Function],
49569
49588
  }
49570
49589
  }
49571
49590
  beeInstance={null}
49591
+ ccsSendTransaction={null}
49572
49592
  channel={null}
49573
49593
  content="LATEST FASHION@VISHAL
49574
49594
  {#var#}
@@ -51857,6 +51877,7 @@ new message content.",
51857
51877
  isFetchingTestGroups={false}
51858
51878
  isLoadingSenderDetails={false}
51859
51879
  isSearchingCustomer={false}
51880
+ isSendingCcsTestMessage={false}
51860
51881
  isSendingTestMessage={false}
51861
51882
  isUpdatingPreview={false}
51862
51883
  messageMetaConfigId={null}
@@ -51895,11 +51916,13 @@ new message content.",
51895
51916
  "getTestGroupsRequested": [Function],
51896
51917
  "getWeCrmAccountsRequested": [Function],
51897
51918
  "searchCustomersRequested": [Function],
51919
+ "sendCcsTestMessageRequested": [Function],
51898
51920
  "sendTestMessageRequested": [Function],
51899
51921
  "updatePreviewRequested": [Function],
51900
51922
  }
51901
51923
  }
51902
51924
  beeInstance={null}
51925
+ ccsSendTransaction={null}
51903
51926
  channel="SMS"
51904
51927
  config={
51905
51928
  Object {
@@ -54195,6 +54218,7 @@ new message content.",
54195
54218
  isFetchingTestGroups={false}
54196
54219
  isLoadingSenderDetails={false}
54197
54220
  isSearchingCustomer={false}
54221
+ isSendingCcsTestMessage={false}
54198
54222
  isSendingTestMessage={false}
54199
54223
  isUpdatingPreview={false}
54200
54224
  messageMetaConfigId={null}
@@ -33,6 +33,7 @@ const WebPushPreview = ({
33
33
  brandIconSrc,
34
34
  buttons,
35
35
  onClickShowInAllDevices,
36
+ showPreviewInAllDevices,
36
37
  }) => {
37
38
  const [selectedOS, setSelectedOS] = useState(DEFAULT_OS);
38
39
  const [selectedBrowser, setSelectedBrowser] = useState(DEFAULT_BROWSER);
@@ -93,18 +94,20 @@ const WebPushPreview = ({
93
94
  buttons={buttons}
94
95
  />
95
96
  <PreviewDisclaimer />
96
- <CapRow className="preview-all-devices-button">
97
- <CapColumn span={24}>
98
- <CapButton
99
- type="link"
100
- onClick={handleOpenPreviewSlideBox}
101
- className="preview-all-devices-trigger"
102
- data-test-id="webpush-preview-toggle"
103
- >
104
- <FormattedMessage {...messages.previewInAllDevices} />
105
- </CapButton>
106
- </CapColumn>
107
- </CapRow>
97
+ {showPreviewInAllDevices && (
98
+ <CapRow className="preview-all-devices-button">
99
+ <CapColumn span={24}>
100
+ <CapButton
101
+ type="link"
102
+ onClick={handleOpenPreviewSlideBox}
103
+ className="preview-all-devices-trigger"
104
+ data-test-id="webpush-preview-toggle"
105
+ >
106
+ <FormattedMessage {...messages.previewInAllDevices} />
107
+ </CapButton>
108
+ </CapColumn>
109
+ </CapRow>
110
+ )}
108
111
  </CapColumn>
109
112
  <CapSlideBox
110
113
  header={<FormattedMessage {...messages.webPushNotificationPreview} />}
@@ -141,6 +144,7 @@ WebPushPreview.propTypes = {
141
144
  })
142
145
  ),
143
146
  onClickShowInAllDevices: PropTypes.func,
147
+ showPreviewInAllDevices: PropTypes.bool,
144
148
  };
145
149
 
146
150
  WebPushPreview.defaultProps = {
@@ -150,6 +154,7 @@ WebPushPreview.defaultProps = {
150
154
  imageSrc: '',
151
155
  brandIconSrc: '',
152
156
  buttons: [],
157
+ showPreviewInAllDevices: true,
153
158
  };
154
159
 
155
160
  export default WebPushPreview;
@@ -109,6 +109,11 @@ describe('WebPushPreview', () => {
109
109
  expect(button.hasClass('preview-all-devices-trigger')).toBe(true);
110
110
  });
111
111
 
112
+ it('should hide "Preview in all devices" button when showPreviewInAllDevices is false', () => {
113
+ const wrapper = mountWithIntl(<WebPushPreview {...defaultProps} showPreviewInAllDevices={false} />);
114
+ expect(wrapper.find('.preview-all-devices-button').exists()).toBe(false);
115
+ });
116
+
112
117
  it('should render CapSlideBox component', () => {
113
118
  const wrapper = mountWithIntl(<WebPushPreview {...defaultProps} />);
114
119
  const allSlideBoxes = wrapper.find(CapSlideBox);