@capillarytech/creatives-library 9.0.56-alpha.3 → 9.0.56-alpha.5

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 (29) hide show
  1. package/package.json +1 -1
  2. package/services/api.js +8 -6
  3. package/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +2 -1
  4. package/v2Components/CommonTestAndPreview/actions.js +13 -0
  5. package/v2Components/CommonTestAndPreview/constants.js +6 -0
  6. package/v2Components/CommonTestAndPreview/index.js +23 -21
  7. package/v2Components/CommonTestAndPreview/reducer.js +20 -0
  8. package/v2Components/CommonTestAndPreview/sagas.js +28 -0
  9. package/v2Components/CommonTestAndPreview/selectors.js +6 -0
  10. package/v2Components/CommonTestAndPreview/tests/actions.test.js +15 -0
  11. package/v2Components/CommonTestAndPreview/tests/index.test.js +101 -0
  12. package/v2Components/CommonTestAndPreview/tests/reducer.test.js +41 -0
  13. package/v2Components/CommonTestAndPreview/tests/sagas.test.js +84 -0
  14. package/v2Components/CommonTestAndPreview/tests/selectors.test.js +12 -0
  15. package/v2Components/TestAndPreviewSlidebox/index.js +3 -0
  16. package/v2Containers/CommunicationFlow/CommunicationFlow.js +40 -37
  17. package/v2Containers/CommunicationFlow/CommunicationFlow.scss +29 -1
  18. package/v2Containers/CommunicationFlow/CommunicationFlowCard.js +2 -4
  19. package/v2Containers/CommunicationFlow/Tests/CommunicationFlow.test.js +16 -3
  20. package/v2Containers/CommunicationFlow/constants.js +12 -8
  21. package/v2Containers/CommunicationFlow/index.js +6 -8
  22. package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/ChannelSelectionStep.js +2 -22
  23. package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/ChannelSelectionStep.scss +4 -0
  24. package/v2Containers/CreativesContainer/index.js +0 -1
  25. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +79 -7
  26. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +18 -0
  27. package/v2Containers/WebPush/Create/preview/WebPushPreview.js +17 -12
  28. package/v2Containers/WebPush/Create/preview/tests/WebPushPreview.test.js +5 -0
  29. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +204 -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,6 +12790,7 @@ 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
  }
@@ -15082,6 +15085,7 @@ new message content.",
15082
15085
  isFetchingTestGroups={false}
15083
15086
  isLoadingSenderDetails={false}
15084
15087
  isSearchingCustomer={false}
15088
+ isSendingCcsTestMessage={false}
15085
15089
  isSendingTestMessage={false}
15086
15090
  isUpdatingPreview={false}
15087
15091
  messageMetaConfigId={null}
@@ -15120,6 +15124,7 @@ new message content.",
15120
15124
  "getTestGroupsRequested": [Function],
15121
15125
  "getWeCrmAccountsRequested": [Function],
15122
15126
  "searchCustomersRequested": [Function],
15127
+ "sendCcsTestMessageRequested": [Function],
15123
15128
  "sendTestMessageRequested": [Function],
15124
15129
  "updatePreviewRequested": [Function],
15125
15130
  }
@@ -17421,6 +17426,7 @@ new message content.",
17421
17426
  isFetchingTestGroups={false}
17422
17427
  isLoadingSenderDetails={false}
17423
17428
  isSearchingCustomer={false}
17429
+ isSendingCcsTestMessage={false}
17424
17430
  isSendingTestMessage={false}
17425
17431
  isUpdatingPreview={false}
17426
17432
  messageMetaConfigId={null}
@@ -31829,6 +31835,7 @@ FREE GIFTS-
31829
31835
  "getTestGroupsRequested": [Function],
31830
31836
  "getWeCrmAccountsRequested": [Function],
31831
31837
  "searchCustomersRequested": [Function],
31838
+ "sendCcsTestMessageRequested": [Function],
31832
31839
  "sendTestMessageRequested": [Function],
31833
31840
  "updatePreviewRequested": [Function],
31834
31841
  }
@@ -31874,6 +31881,7 @@ FREE GIFTS-
31874
31881
  isFetchingTestGroups={false}
31875
31882
  isLoadingSenderDetails={false}
31876
31883
  isSearchingCustomer={false}
31884
+ isSendingCcsTestMessage={false}
31877
31885
  isSendingTestMessage={false}
31878
31886
  isUpdatingPreview={false}
31879
31887
  messageMetaConfigId={null}
@@ -31910,6 +31918,7 @@ FREE GIFTS-
31910
31918
  "getTestGroupsRequested": [Function],
31911
31919
  "getWeCrmAccountsRequested": [Function],
31912
31920
  "searchCustomersRequested": [Function],
31921
+ "sendCcsTestMessageRequested": [Function],
31913
31922
  "sendTestMessageRequested": [Function],
31914
31923
  "updatePreviewRequested": [Function],
31915
31924
  }
@@ -34204,6 +34213,7 @@ new message content.",
34204
34213
  isFetchingTestGroups={false}
34205
34214
  isLoadingSenderDetails={false}
34206
34215
  isSearchingCustomer={false}
34216
+ isSendingCcsTestMessage={false}
34207
34217
  isSendingTestMessage={false}
34208
34218
  isUpdatingPreview={false}
34209
34219
  messageMetaConfigId={null}
@@ -34242,6 +34252,7 @@ new message content.",
34242
34252
  "getTestGroupsRequested": [Function],
34243
34253
  "getWeCrmAccountsRequested": [Function],
34244
34254
  "searchCustomersRequested": [Function],
34255
+ "sendCcsTestMessageRequested": [Function],
34245
34256
  "sendTestMessageRequested": [Function],
34246
34257
  "updatePreviewRequested": [Function],
34247
34258
  }
@@ -36543,6 +36554,7 @@ new message content.",
36543
36554
  isFetchingTestGroups={false}
36544
36555
  isLoadingSenderDetails={false}
36545
36556
  isSearchingCustomer={false}
36557
+ isSendingCcsTestMessage={false}
36546
36558
  isSendingTestMessage={false}
36547
36559
  isUpdatingPreview={false}
36548
36560
  messageMetaConfigId={null}
@@ -49487,6 +49499,7 @@ FREE GIFTS-
49487
49499
  "getTestGroupsRequested": [Function],
49488
49500
  "getWeCrmAccountsRequested": [Function],
49489
49501
  "searchCustomersRequested": [Function],
49502
+ "sendCcsTestMessageRequested": [Function],
49490
49503
  "sendTestMessageRequested": [Function],
49491
49504
  "updatePreviewRequested": [Function],
49492
49505
  }
@@ -49532,6 +49545,7 @@ FREE GIFTS-
49532
49545
  isFetchingTestGroups={false}
49533
49546
  isLoadingSenderDetails={false}
49534
49547
  isSearchingCustomer={false}
49548
+ isSendingCcsTestMessage={false}
49535
49549
  isSendingTestMessage={false}
49536
49550
  isUpdatingPreview={false}
49537
49551
  messageMetaConfigId={null}
@@ -49568,6 +49582,7 @@ FREE GIFTS-
49568
49582
  "getTestGroupsRequested": [Function],
49569
49583
  "getWeCrmAccountsRequested": [Function],
49570
49584
  "searchCustomersRequested": [Function],
49585
+ "sendCcsTestMessageRequested": [Function],
49571
49586
  "sendTestMessageRequested": [Function],
49572
49587
  "updatePreviewRequested": [Function],
49573
49588
  }
@@ -51862,6 +51877,7 @@ new message content.",
51862
51877
  isFetchingTestGroups={false}
51863
51878
  isLoadingSenderDetails={false}
51864
51879
  isSearchingCustomer={false}
51880
+ isSendingCcsTestMessage={false}
51865
51881
  isSendingTestMessage={false}
51866
51882
  isUpdatingPreview={false}
51867
51883
  messageMetaConfigId={null}
@@ -51900,6 +51916,7 @@ new message content.",
51900
51916
  "getTestGroupsRequested": [Function],
51901
51917
  "getWeCrmAccountsRequested": [Function],
51902
51918
  "searchCustomersRequested": [Function],
51919
+ "sendCcsTestMessageRequested": [Function],
51903
51920
  "sendTestMessageRequested": [Function],
51904
51921
  "updatePreviewRequested": [Function],
51905
51922
  }
@@ -54201,6 +54218,7 @@ new message content.",
54201
54218
  isFetchingTestGroups={false}
54202
54219
  isLoadingSenderDetails={false}
54203
54220
  isSearchingCustomer={false}
54221
+ isSendingCcsTestMessage={false}
54204
54222
  isSendingTestMessage={false}
54205
54223
  isUpdatingPreview={false}
54206
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);