@capillarytech/creatives-library 8.0.340-0 → 8.0.340-beta.0.1
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.
- package/app.js +8 -1
- package/global-styles.js +4 -0
- package/package.json +2 -2
- package/styles/components/navigation/_leftnav.scss +1 -1
- package/styles/containers/layout/_layoutPage.scss +1 -1
- package/v2Components/AccessForbidden/index.js +1 -1
- package/v2Components/CapActionButton/index.js +5 -5
- package/v2Components/CapCustomSkeleton/index.js +1 -1
- package/v2Components/CapDeviceContent/index.js +5 -5
- package/v2Components/CapDocumentUpload/index.js +1 -1
- package/v2Components/CapImageUpload/index.js +1 -1
- package/v2Components/CapInAppCTA/index.js +118 -112
- package/v2Components/CapMpushCTA/index.js +72 -66
- package/v2Components/CapTagList/index.js +23 -11
- package/v2Components/CapVideoUpload/index.js +1 -1
- package/v2Components/CapWhatsappCTA/index.js +128 -124
- package/v2Components/CapWhatsappCarouselButton/index.js +27 -29
- package/v2Components/CapWhatsappQuickReply/index.js +7 -7
- package/v2Components/Carousel/index.js +1 -1
- package/v2Components/CommonTestAndPreview/AddTestCustomer.js +1 -1
- package/v2Components/CommonTestAndPreview/CustomValuesEditor.js +10 -11
- package/v2Components/CommonTestAndPreview/CustomerCreationModal.js +1 -1
- package/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.js +4 -4
- package/v2Components/CommonTestAndPreview/DeliverySettings/index.js +1 -1
- package/v2Components/CommonTestAndPreview/ExistingCustomerModal.js +6 -6
- package/v2Components/CommonTestAndPreview/LeftPanelContent.js +5 -5
- package/v2Components/CommonTestAndPreview/PreviewSection.js +1 -1
- package/v2Components/CommonTestAndPreview/UnifiedPreview/DeviceFrame.js +1 -1
- package/v2Components/CommonTestAndPreview/UnifiedPreview/EmailPreviewContent.js +8 -8
- package/v2Components/CommonTestAndPreview/UnifiedPreview/InAppPreviewContent.js +14 -13
- package/v2Components/CommonTestAndPreview/UnifiedPreview/MobilePushPreviewContent.js +22 -21
- package/v2Components/CommonTestAndPreview/UnifiedPreview/PreviewHeader.js +1 -1
- package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js +9 -9
- package/v2Components/CommonTestAndPreview/UnifiedPreview/SmsPreviewContent.js +13 -11
- package/v2Components/CommonTestAndPreview/UnifiedPreview/ViberPreviewContent.js +10 -10
- package/v2Components/CommonTestAndPreview/UnifiedPreview/WhatsAppPreviewContent.js +13 -12
- package/v2Components/CommonTestAndPreview/UnifiedPreview/ZaloPreviewContent.js +4 -3
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +17 -8
- package/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +1 -1
- package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +30 -5
- package/v2Components/CommonTestAndPreview/index.js +3 -3
- package/v2Components/CustomerSearchSection/_customerSearch.scss +2 -1
- package/v2Components/CustomerSearchSection/index.js +9 -9
- package/v2Components/EmailMobilePreview/index.js +1 -1
- package/v2Components/ErrorInfoNote/index.js +13 -11
- package/v2Components/ErrorInfoNote/style.scss +1 -1
- package/v2Components/FormBuilder/_formBuilder.scss +1 -0
- package/v2Components/FormBuilder/index.js +32 -40
- package/v2Components/HtmlEditor/HTMLEditor.js +4 -4
- package/v2Components/HtmlEditor/_htmlEditor.scss +2 -1
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +1 -1
- package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +2 -2
- package/v2Components/HtmlEditor/components/DeviceToggle/index.js +2 -2
- package/v2Components/HtmlEditor/components/EditorToolbar/PreviewModeGroup.js +2 -2
- package/v2Components/HtmlEditor/components/EditorToolbar/index.js +2 -2
- package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +1 -0
- package/v2Components/HtmlEditor/components/PreviewPane/index.js +2 -2
- package/v2Components/HtmlEditor/components/SplitContainer/SplitContainer.js +2 -2
- package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +2 -1
- package/v2Components/HtmlEditor/components/ValidationPanel/index.js +6 -9
- package/v2Components/HtmlEditor/components/ValidationTabs/index.js +2 -2
- package/v2Components/NavigationBar/index.js +7 -1
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +3 -4
- package/v2Components/TemplatePreview/_templatePreview.scss +5 -3
- package/v2Components/TemplatePreview/index.js +11 -9
- package/v2Components/TestAndPreviewSlidebox/CustomValuesEditor.js +4 -4
- package/v2Components/TestAndPreviewSlidebox/LeftPanelContent.js +5 -5
- package/v2Components/TestAndPreviewSlidebox/PreviewSection.js +3 -3
- package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +4 -2
- package/v2Containers/BeePopupEditor/index.js +1 -1
- package/v2Containers/CommunicationFlow/CommunicationFlow.js +5 -5
- package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/ChannelSelectionStep.js +4 -3
- package/v2Containers/CommunicationFlow/steps/CommunicationStrategyStep/CommunicationStrategyStep.js +2 -2
- package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/DeliverySettingsSection.js +3 -2
- package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/SenderDetails.js +7 -7
- package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/SenderDetails.scss +0 -5
- package/v2Containers/CommunicationFlow/steps/DynamicControlsStep/DynamicControlsStep.js +2 -2
- package/v2Containers/CommunicationFlow/steps/MessageTypeStep/MessageTypeStep.js +2 -2
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +1 -1
- package/v2Containers/CreativesContainer/index.js +1 -1
- package/v2Containers/Ebill/index.js +10 -9
- package/v2Containers/Email/index.js +7 -7
- package/v2Containers/Email/initialSchema.js +1 -1
- package/v2Containers/FTP/index.js +1 -1
- package/v2Containers/Facebook/Advertisement/index.js +4 -4
- package/v2Containers/Facebook/index.js +2 -2
- package/v2Containers/InApp/index.js +21 -16
- package/v2Containers/InApp/index.scss +0 -7
- package/v2Containers/InAppWrapper/components/InAppWrapperView.js +2 -2
- package/v2Containers/InappAdvance/index.js +4 -4
- package/v2Containers/LanguageProvider/index.js +3 -3
- package/v2Containers/LanguageProvider/tests/index.test.js +3 -3
- package/v2Containers/Line/Container/Image/index.js +1 -1
- package/v2Containers/Line/Container/ImageCarousel/Content.js +1 -1
- package/v2Containers/Line/Container/ImageCarousel/index.js +5 -5
- package/v2Containers/Line/Container/ImageMap/index.js +3 -3
- package/v2Containers/Line/Container/Sticker/index.js +2 -2
- package/v2Containers/Line/Container/Sticker/utils.js +1 -1
- package/v2Containers/Line/Container/Video/index.js +1 -1
- package/v2Containers/Line/Container/Wrapper/index.js +3 -3
- package/v2Containers/Line/Container/Wrapper/style.js +1 -5
- package/v2Containers/Line/Container/index.js +2 -2
- package/v2Containers/Login/components/LoginForm/index.js +34 -47
- package/v2Containers/Login/index.js +5 -5
- package/v2Containers/MobilePushNew/components/CtaButtons.js +2 -2
- package/v2Containers/MobilePushNew/components/MediaUploaders.js +9 -9
- package/v2Containers/MobilePushNew/components/PlatformContentFields.js +4 -4
- package/v2Containers/MobilePushNew/index.js +2 -2
- package/v2Containers/MobilePushNew/index.scss +9 -6
- package/v2Containers/Rcs/index.js +24 -19
- package/v2Containers/Rcs/index.scss +0 -7
- package/v2Containers/Sms/Create/_smsCreate.scss +9 -2
- package/v2Containers/Sms/SCHEMA_FORMBUILDER_MAP.md +922 -0
- package/v2Containers/Sms/initialSchema.js +7 -1
- package/v2Containers/SmsTrai/Edit/index.js +3 -2
- package/v2Containers/Templates/index.js +16 -16
- package/v2Containers/Viber/constants.js +0 -8
- package/v2Containers/Viber/index.js +19 -19
- package/v2Containers/Viber/index.scss +0 -7
- package/v2Containers/Viber/reducer.js +21 -44
- package/v2Containers/Viber/sagas.js +21 -62
- package/v2Containers/Viber/tests/index.test.js +0 -80
- package/v2Containers/Viber/tests/saga.test.js +40 -365
- package/v2Containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +2 -2
- package/v2Containers/WebPush/Create/components/BrandIconSection.js +1 -1
- package/v2Containers/WebPush/Create/components/ButtonForm.js +2 -2
- package/v2Containers/WebPush/Create/components/ButtonList.js +4 -4
- package/v2Containers/WebPush/Create/components/ButtonsLinksSection.js +4 -4
- package/v2Containers/WebPush/Create/components/FormActions.js +3 -3
- package/v2Containers/WebPush/Create/components/MessageSection.js +2 -2
- package/v2Containers/WebPush/Create/components/NotificationTitleSection.js +2 -2
- package/v2Containers/WebPush/Create/components/_buttons.scss +2 -2
- package/v2Containers/WebPush/Create/index.scss +6 -3
- package/v2Containers/WebPush/Create/preview/WebPushPreview.js +1 -1
- package/v2Containers/Whatsapp/index.js +28 -28
- package/v2Containers/Zalo/index.js +3 -3
- package/.npmrc copy +0 -2
- package/v2Containers/Viber/tests/reducer.test.js +0 -297
|
@@ -41,8 +41,8 @@ export const NotificationTitleSection = ({
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
return (
|
|
44
|
-
<CapRow className="creatives-webpush-title">
|
|
45
|
-
<CapRow className="tooltip-add-label-container webpush-title-taglist">
|
|
44
|
+
<CapRow useLegacy className="creatives-webpush-title">
|
|
45
|
+
<CapRow useLegacy className="tooltip-add-label-container webpush-title-taglist">
|
|
46
46
|
{tagList}
|
|
47
47
|
</CapRow>
|
|
48
48
|
<CapHeading type="h4" className="webpush-title">
|
|
@@ -81,12 +81,12 @@
|
|
|
81
81
|
// High specificity selectors to override Cap UI library styles
|
|
82
82
|
// Target both CapButton and Ant Design button classes that may be on the same element
|
|
83
83
|
.button-add-controls button.button-add-trigger,
|
|
84
|
-
.button-add-controls .button-add-trigger.cap-button,
|
|
84
|
+
.button-add-controls .button-add-trigger.cap-button-v2,
|
|
85
85
|
.button-add-controls .button-add-trigger.ant-btn,
|
|
86
86
|
.button-add-controls .button-add-trigger.cap-button-flat,
|
|
87
87
|
.button-add-controls .button-add-trigger.ant-btn-flat,
|
|
88
88
|
.webpush-button-list button.button-add-trigger,
|
|
89
|
-
.webpush-button-list .button-add-trigger.cap-button,
|
|
89
|
+
.webpush-button-list .button-add-trigger.cap-button-v2,
|
|
90
90
|
.webpush-button-list .button-add-trigger.ant-btn,
|
|
91
91
|
.webpush-button-list .button-add-trigger.cap-button-flat,
|
|
92
92
|
.webpush-button-list .button-add-trigger.ant-btn-flat {
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
.creatives-webpush-message,
|
|
7
7
|
.creatives-webpush-media {
|
|
8
8
|
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
9
|
+
flex-direction: column !important;
|
|
10
|
+
flex-flow: column nowrap;
|
|
10
11
|
gap: $CAP_SPACE_08;
|
|
11
12
|
position: relative;
|
|
12
13
|
}
|
|
@@ -25,7 +26,8 @@
|
|
|
25
26
|
|
|
26
27
|
.creatives-webpush-brand-icon {
|
|
27
28
|
display: flex;
|
|
28
|
-
flex-direction: column;
|
|
29
|
+
flex-direction: column !important;
|
|
30
|
+
flex-flow: column nowrap;
|
|
29
31
|
gap: $CAP_SPACE_08;
|
|
30
32
|
|
|
31
33
|
.webpush-brand-icon {
|
|
@@ -37,7 +39,8 @@
|
|
|
37
39
|
|
|
38
40
|
.creatives-webpush-buttons-links {
|
|
39
41
|
display: flex;
|
|
40
|
-
flex-direction: column;
|
|
42
|
+
flex-direction: column !important;
|
|
43
|
+
flex-flow: column nowrap;
|
|
41
44
|
gap: 0.65rem;
|
|
42
45
|
|
|
43
46
|
.webpush-buttons-links {
|
|
@@ -96,7 +96,7 @@ const WebPushPreview = ({
|
|
|
96
96
|
<CapRow className="preview-all-devices-button">
|
|
97
97
|
<CapColumn span={24}>
|
|
98
98
|
<CapButton
|
|
99
|
-
type="
|
|
99
|
+
type="link"
|
|
100
100
|
onClick={handleOpenPreviewSlideBox}
|
|
101
101
|
className="preview-all-devices-trigger"
|
|
102
102
|
data-test-id="webpush-preview-toggle"
|
|
@@ -1883,7 +1883,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
1883
1883
|
extra={
|
|
1884
1884
|
!isEditMode && (
|
|
1885
1885
|
<CapButton
|
|
1886
|
-
type="
|
|
1886
|
+
type="link"
|
|
1887
1887
|
onClick={() => {
|
|
1888
1888
|
deleteCarouselCard(index);
|
|
1889
1889
|
}}
|
|
@@ -1895,16 +1895,16 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
1895
1895
|
}
|
|
1896
1896
|
className="whatsapp-carousel-card"
|
|
1897
1897
|
>
|
|
1898
|
-
<CapRow>
|
|
1898
|
+
<CapRow useLegacy>
|
|
1899
1899
|
{carouselMediaType === IMAGE.toLowerCase() ? (
|
|
1900
|
-
<CapRow>
|
|
1900
|
+
<CapRow useLegacy>
|
|
1901
1901
|
<CapHeading type="h4">
|
|
1902
1902
|
{formatMessage(messages.mediaImage)}
|
|
1903
1903
|
</CapHeading>
|
|
1904
1904
|
{renderImageComponent(index)}
|
|
1905
1905
|
</CapRow>
|
|
1906
1906
|
) : (
|
|
1907
|
-
<CapRow>
|
|
1907
|
+
<CapRow useLegacy>
|
|
1908
1908
|
<CapHeading type="h4">
|
|
1909
1909
|
{formatMessage(messages.mediaVideo)}
|
|
1910
1910
|
</CapHeading>
|
|
@@ -1912,7 +1912,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
1912
1912
|
</CapRow>
|
|
1913
1913
|
)}
|
|
1914
1914
|
</CapRow>
|
|
1915
|
-
<CapRow>
|
|
1915
|
+
<CapRow useLegacy>
|
|
1916
1916
|
<CapHeader
|
|
1917
1917
|
className={`${
|
|
1918
1918
|
isMediaTypeImage ? "whatsapp-heading-spacing" : ""
|
|
@@ -1959,7 +1959,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
1959
1959
|
: !isAuthenticationTemplate && (
|
|
1960
1960
|
<CapButton
|
|
1961
1961
|
data-testid="suffix-button"
|
|
1962
|
-
type="
|
|
1962
|
+
type="link"
|
|
1963
1963
|
isAddBtn
|
|
1964
1964
|
onClick={() => onCarouselBodyAddVar(index)}
|
|
1965
1965
|
disabled={
|
|
@@ -1976,7 +1976,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
1976
1976
|
{isEditMode ?
|
|
1977
1977
|
<>
|
|
1978
1978
|
<CapTooltip placement="bottom" title={disabledEditTooltipRender()}>
|
|
1979
|
-
<CapRow
|
|
1979
|
+
<CapRow useLegacy
|
|
1980
1980
|
className={`whatsapp-edit-template-message-input ${
|
|
1981
1981
|
templateStatus !== WHATSAPP_STATUSES.approved &&
|
|
1982
1982
|
"whatsapp-edit-disabled"
|
|
@@ -1994,7 +1994,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
1994
1994
|
)}
|
|
1995
1995
|
</>
|
|
1996
1996
|
:
|
|
1997
|
-
<CapRow>
|
|
1997
|
+
<CapRow useLegacy>
|
|
1998
1998
|
<div className="whatsapp-create-template-message-input-wrapper">
|
|
1999
1999
|
<TextArea
|
|
2000
2000
|
autosize={{ minRows: 3, maxRows: 5 }}
|
|
@@ -2013,7 +2013,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2013
2013
|
</CapRow>
|
|
2014
2014
|
}
|
|
2015
2015
|
</CapRow>
|
|
2016
|
-
<CapRow>
|
|
2016
|
+
<CapRow useLegacy>
|
|
2017
2017
|
<CapHeading
|
|
2018
2018
|
className="whatsapp-carousel-message-heading"
|
|
2019
2019
|
type="h4"
|
|
@@ -2021,13 +2021,13 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2021
2021
|
{formatMessage(messages.btnLabel)}
|
|
2022
2022
|
</CapHeading>
|
|
2023
2023
|
{index === 0 && (
|
|
2024
|
-
<CapRow>
|
|
2024
|
+
<CapRow useLegacy>
|
|
2025
2025
|
<CapInfoNote
|
|
2026
2026
|
message={formatMessage(messages.carouselButtonInfo)}
|
|
2027
2027
|
/>
|
|
2028
2028
|
</CapRow>
|
|
2029
2029
|
)}
|
|
2030
|
-
<CapRow>
|
|
2030
|
+
<CapRow useLegacy>
|
|
2031
2031
|
<CapWhatsappCarouselButton
|
|
2032
2032
|
carouselData={carouselData}
|
|
2033
2033
|
setCarouselData={setCarouselData}
|
|
@@ -2073,7 +2073,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2073
2073
|
<CapDivider type="vertical" />
|
|
2074
2074
|
<CapButton
|
|
2075
2075
|
onClick={addContent}
|
|
2076
|
-
type="
|
|
2076
|
+
type="link"
|
|
2077
2077
|
className="add-carousel-content-button"
|
|
2078
2078
|
disabled={MAX_CAROUSEL_ALLOWED === carouselData.length || !checkDisableAddCarouselButton()}
|
|
2079
2079
|
>
|
|
@@ -2164,7 +2164,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2164
2164
|
}
|
|
2165
2165
|
suffix={
|
|
2166
2166
|
<CapButton
|
|
2167
|
-
type="
|
|
2167
|
+
type="link"
|
|
2168
2168
|
isAddBtn
|
|
2169
2169
|
onClick={onHeaderAddVar}
|
|
2170
2170
|
disabled={
|
|
@@ -2178,7 +2178,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2178
2178
|
</CapButton>
|
|
2179
2179
|
}
|
|
2180
2180
|
/>
|
|
2181
|
-
<CapRow className="whatsapp-create-template-message-input whatsapp-create-template-header-input">
|
|
2181
|
+
<CapRow useLegacy className="whatsapp-create-template-message-input whatsapp-create-template-header-input">
|
|
2182
2182
|
<TextArea
|
|
2183
2183
|
id="whatsapp-create-template-message-input"
|
|
2184
2184
|
autosize={{ minRows: 1, maxRows: 5 }}
|
|
@@ -2224,7 +2224,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2224
2224
|
{!isAuthenticationTemplate && (
|
|
2225
2225
|
<CapButton
|
|
2226
2226
|
data-testid="suffix-button"
|
|
2227
|
-
type="
|
|
2227
|
+
type="link"
|
|
2228
2228
|
isAddBtn
|
|
2229
2229
|
onClick={onMessageAddVar}
|
|
2230
2230
|
disabled={
|
|
@@ -2238,7 +2238,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2238
2238
|
</>
|
|
2239
2239
|
}
|
|
2240
2240
|
/>
|
|
2241
|
-
<CapRow className="whatsapp-create-template-message-input">
|
|
2241
|
+
<CapRow useLegacy className="whatsapp-create-template-message-input">
|
|
2242
2242
|
<div className='whatsapp-create-template-message-input-wrapper'>
|
|
2243
2243
|
<TextArea
|
|
2244
2244
|
id="whatsapp-create-template-message-input"
|
|
@@ -2274,7 +2274,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2274
2274
|
{renderMessageLength(MESSAGE_TEXT)}
|
|
2275
2275
|
{
|
|
2276
2276
|
isMediaTypeCarousel && (
|
|
2277
|
-
<CapRow>
|
|
2277
|
+
<CapRow useLegacy>
|
|
2278
2278
|
<CapRow className="carousel-media-selection">
|
|
2279
2279
|
<CapColumn className="carousel-media-selection-heading">
|
|
2280
2280
|
<CapHeading type="h4">
|
|
@@ -2291,7 +2291,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2291
2291
|
/>
|
|
2292
2292
|
</CapColumn>
|
|
2293
2293
|
</CapRow>
|
|
2294
|
-
<CapRow className="whatsapp-carousel-tab">
|
|
2294
|
+
<CapRow useLegacy className="whatsapp-carousel-tab">
|
|
2295
2295
|
<CapTab
|
|
2296
2296
|
defaultActiveKey={`${defaultActiveIndex}`}
|
|
2297
2297
|
activeKey={activeIndex}
|
|
@@ -2325,7 +2325,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2325
2325
|
</CapHeading>
|
|
2326
2326
|
}
|
|
2327
2327
|
/>
|
|
2328
|
-
<CapRow className="whatsapp-create-template-message-input whatsapp-create-template-header-input">
|
|
2328
|
+
<CapRow useLegacy className="whatsapp-create-template-message-input whatsapp-create-template-header-input">
|
|
2329
2329
|
{isAuthenticationTemplate ? (
|
|
2330
2330
|
<CapRow className="whatsapp-extra-security-footer">
|
|
2331
2331
|
<CapCheckbox
|
|
@@ -2372,7 +2372,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2372
2372
|
}
|
|
2373
2373
|
>
|
|
2374
2374
|
<CapButton
|
|
2375
|
-
type="
|
|
2375
|
+
type="link"
|
|
2376
2376
|
className="add-btn"
|
|
2377
2377
|
onClick={() =>
|
|
2378
2378
|
window.open(
|
|
@@ -2701,7 +2701,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2701
2701
|
{/* this section is for render header section */}
|
|
2702
2702
|
{(templateHeader && isMediaTypeText && isHostIsNotTwilio) && (
|
|
2703
2703
|
<>
|
|
2704
|
-
<CapRow className="whatsapp-render-heading">
|
|
2704
|
+
<CapRow useLegacy className="whatsapp-render-heading">
|
|
2705
2705
|
<CapHeader
|
|
2706
2706
|
title={
|
|
2707
2707
|
<CapHeading type="h4">
|
|
@@ -2724,7 +2724,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2724
2724
|
/>
|
|
2725
2725
|
</CapRow>
|
|
2726
2726
|
<CapTooltip placement="bottom" title={disabledEditTooltipRender()}>
|
|
2727
|
-
<CapRow
|
|
2727
|
+
<CapRow useLegacy
|
|
2728
2728
|
className={`whatsapp-edit-template-message-input ${
|
|
2729
2729
|
templateStatus !== WHATSAPP_STATUSES.approved &&
|
|
2730
2730
|
"whatsapp-edit-disabled"
|
|
@@ -2742,7 +2742,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2742
2742
|
)}
|
|
2743
2743
|
</>
|
|
2744
2744
|
)}
|
|
2745
|
-
<CapRow className="whatsapp-render-heading">
|
|
2745
|
+
<CapRow useLegacy className="whatsapp-render-heading">
|
|
2746
2746
|
<CapHeader
|
|
2747
2747
|
title={
|
|
2748
2748
|
<CapHeading type="h4">
|
|
@@ -2767,7 +2767,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2767
2767
|
/>
|
|
2768
2768
|
</CapRow>
|
|
2769
2769
|
<CapTooltip placement="bottom" title={disabledEditTooltipRender()}>
|
|
2770
|
-
<CapRow
|
|
2770
|
+
<CapRow useLegacy
|
|
2771
2771
|
className={`whatsapp-edit-template-message-input ${
|
|
2772
2772
|
templateStatus !== WHATSAPP_STATUSES.approved &&
|
|
2773
2773
|
'whatsapp-edit-disabled'
|
|
@@ -2810,7 +2810,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2810
2810
|
</CapHeading>
|
|
2811
2811
|
}
|
|
2812
2812
|
/>
|
|
2813
|
-
<CapRow className="whatsapp-footer-edit-container">
|
|
2813
|
+
<CapRow useLegacy className="whatsapp-footer-edit-container">
|
|
2814
2814
|
<CapHeading type="h4" className="whatsapp-footer-edit-text">
|
|
2815
2815
|
{templateFooter}
|
|
2816
2816
|
</CapHeading>
|
|
@@ -2821,7 +2821,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2821
2821
|
{/* button section view in edit mode*/}
|
|
2822
2822
|
{isMediaTypeCarousel &&
|
|
2823
2823
|
(
|
|
2824
|
-
<CapRow>
|
|
2824
|
+
<CapRow useLegacy>
|
|
2825
2825
|
<CapRow className="carousel-media-selection">
|
|
2826
2826
|
<CapColumn className="carousel-media-selection-heading">
|
|
2827
2827
|
<CapHeading type="h4">
|
|
@@ -2832,7 +2832,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2832
2832
|
<CapLabel type="label15">{carouselData?.[0]?.mediaType}</CapLabel>
|
|
2833
2833
|
</CapColumn>
|
|
2834
2834
|
</CapRow>
|
|
2835
|
-
<CapRow className="whatsapp-carousel-tab">
|
|
2835
|
+
<CapRow useLegacy className="whatsapp-carousel-tab">
|
|
2836
2836
|
<CapTab
|
|
2837
2837
|
defaultActiveKey={`${defaultActiveIndex}`}
|
|
2838
2838
|
activeKey={activeIndex}
|
|
@@ -2844,7 +2844,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2844
2844
|
)
|
|
2845
2845
|
}
|
|
2846
2846
|
{!isMediaTypeCarousel &&
|
|
2847
|
-
<CapRow>
|
|
2847
|
+
<CapRow useLegacy>
|
|
2848
2848
|
{isBtnTypeQuickReply ? (
|
|
2849
2849
|
<CapHeading type="h4" className="whatsapp-render-heading">
|
|
2850
2850
|
{formatMessage(messages.quickReplyButtons)}
|
|
@@ -501,8 +501,8 @@ export const Zalo = (props) => {
|
|
|
501
501
|
type={getTemplateStatusType()}
|
|
502
502
|
/>
|
|
503
503
|
)}
|
|
504
|
-
<CapRow>
|
|
505
|
-
<CapRow className="whatsapp-render-heading">
|
|
504
|
+
<CapRow useLegacy>
|
|
505
|
+
<CapRow useLegacy className="whatsapp-render-heading">
|
|
506
506
|
<CapHeader
|
|
507
507
|
className="zalo-variable-heading"
|
|
508
508
|
title={
|
|
@@ -525,7 +525,7 @@ export const Zalo = (props) => {
|
|
|
525
525
|
}
|
|
526
526
|
/>
|
|
527
527
|
</CapRow>
|
|
528
|
-
<CapRow className="zalo-variable-list">
|
|
528
|
+
<CapRow useLegacy className="zalo-variable-list">
|
|
529
529
|
{renderContent()}
|
|
530
530
|
{
|
|
531
531
|
hasTag && (
|
package/.npmrc copy
DELETED
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import { fromJS } from 'immutable';
|
|
2
|
-
import viberReducer from '../reducer';
|
|
3
|
-
import * as types from '../constants';
|
|
4
|
-
import { ASSET_STATUS } from '../../../utils/assetStatusConstants';
|
|
5
|
-
|
|
6
|
-
const initialState = fromJS({
|
|
7
|
-
uploadedAssetData: {},
|
|
8
|
-
createTemplateInProgress: false,
|
|
9
|
-
assetProcessing: {},
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
describe('viberReducer', () => {
|
|
13
|
-
it('returns initial state for unknown action', () => {
|
|
14
|
-
expect(viberReducer(undefined, { type: '@@INIT' })).toEqual(initialState);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
describe('CREATE_VIBER_TEMPLATE_*', () => {
|
|
18
|
-
it('handles CREATE_VIBER_TEMPLATE_REQUEST', () => {
|
|
19
|
-
const next = viberReducer(initialState, {
|
|
20
|
-
type: types.CREATE_VIBER_TEMPLATE_REQUEST,
|
|
21
|
-
});
|
|
22
|
-
expect(next.get('createTemplateInProgress')).toBe(true);
|
|
23
|
-
expect(next.get('createTemplateError')).toBe(false);
|
|
24
|
-
expect(next.get('createTemplateErrorMessage')).toEqual(fromJS(''));
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('handles CREATE_VIBER_TEMPLATE_SUCCESS with status > 300', () => {
|
|
28
|
-
const next = viberReducer(initialState, {
|
|
29
|
-
type: types.CREATE_VIBER_TEMPLATE_SUCCESS,
|
|
30
|
-
data: { id: 'x' },
|
|
31
|
-
statusCode: 400,
|
|
32
|
-
errorMsg: 'oops',
|
|
33
|
-
});
|
|
34
|
-
expect(next.get('createTemplateInProgress')).toBe(false);
|
|
35
|
-
expect(next.get('response')).toEqual({ id: 'x' });
|
|
36
|
-
expect(next.get('createTemplateError')).toBe(true);
|
|
37
|
-
expect(next.get('createTemplateErrorMessage')).toEqual(fromJS('oops'));
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('handles CREATE_VIBER_TEMPLATE_SUCCESS with status <= 300', () => {
|
|
41
|
-
const next = viberReducer(initialState, {
|
|
42
|
-
type: types.CREATE_VIBER_TEMPLATE_SUCCESS,
|
|
43
|
-
data: { id: 'x' },
|
|
44
|
-
statusCode: 200,
|
|
45
|
-
errorMsg: '',
|
|
46
|
-
});
|
|
47
|
-
expect(next.get('createTemplateError')).toBe(false);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('handles CREATE_VIBER_TEMPLATE_FAILURE', () => {
|
|
51
|
-
const next = viberReducer(initialState, {
|
|
52
|
-
type: types.CREATE_VIBER_TEMPLATE_FAILURE,
|
|
53
|
-
errorMsg: 'bad',
|
|
54
|
-
});
|
|
55
|
-
expect(next.get('createTemplateInProgress')).toBe(false);
|
|
56
|
-
expect(next.get('createTemplateError')).toBe(true);
|
|
57
|
-
expect(next.get('createTemplateErrorMessage')).toEqual(fromJS('bad'));
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
describe('UPLOAD_VIBER_ASSET_*', () => {
|
|
62
|
-
it('handles UPLOAD_VIBER_ASSET_REQUEST', () => {
|
|
63
|
-
const next = viberReducer(initialState, {
|
|
64
|
-
type: types.UPLOAD_VIBER_ASSET_REQUEST,
|
|
65
|
-
});
|
|
66
|
-
expect(next.get('uploadAssetSuccess')).toBe(false);
|
|
67
|
-
expect(next.get('assetUploading')).toBe(true);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('handles UPLOAD_VIBER_ASSET_SUCCESS and wraps data with fromJS (finding 2)', () => {
|
|
71
|
-
const payload = { url: 'https://cdn/x.png', meta: { size: 100 } };
|
|
72
|
-
const next = viberReducer(initialState, {
|
|
73
|
-
type: types.UPLOAD_VIBER_ASSET_SUCCESS,
|
|
74
|
-
data: payload,
|
|
75
|
-
statusCode: 200,
|
|
76
|
-
});
|
|
77
|
-
expect(next.get('assetUploading')).toBe(false);
|
|
78
|
-
expect(next.get('uploadAssetSuccess')).toBe(true);
|
|
79
|
-
// must be wrapped in Immutable (same as asyncUploadCases.handleCompleted)
|
|
80
|
-
const stored = next.get('uploadedAssetData');
|
|
81
|
-
expect(stored).toEqual(fromJS(payload));
|
|
82
|
-
// verify it's actually an Immutable Map, not a plain JS object
|
|
83
|
-
expect(stored.toJS).toBeDefined();
|
|
84
|
-
expect(typeof stored.toJS).toBe('function');
|
|
85
|
-
expect(stored.get('url')).toBe(payload.url);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it('handles UPLOAD_VIBER_ASSET_SUCCESS with templateType key wrapped in fromJS', () => {
|
|
89
|
-
const payload = { url: 'https://cdn/y.mp4' };
|
|
90
|
-
const next = viberReducer(initialState, {
|
|
91
|
-
type: types.UPLOAD_VIBER_ASSET_SUCCESS,
|
|
92
|
-
data: payload,
|
|
93
|
-
statusCode: 200,
|
|
94
|
-
templateType: 3,
|
|
95
|
-
});
|
|
96
|
-
const stored = next.get('uploadedAssetData3');
|
|
97
|
-
expect(stored).toEqual(fromJS(payload));
|
|
98
|
-
expect(stored.get('url')).toBe(payload.url);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
it('UPLOAD_VIBER_ASSET_SUCCESS sets uploadAssetSuccess false when status >= 300', () => {
|
|
102
|
-
const next = viberReducer(initialState, {
|
|
103
|
-
type: types.UPLOAD_VIBER_ASSET_SUCCESS,
|
|
104
|
-
data: {},
|
|
105
|
-
statusCode: 500,
|
|
106
|
-
});
|
|
107
|
-
expect(next.get('uploadAssetSuccess')).toBe(false);
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
it('UPLOAD_VIBER_ASSET_SUCCESS sync and async produce same shape', () => {
|
|
111
|
-
const asset = { url: 'https://cdn/same.png' };
|
|
112
|
-
const sync = viberReducer(initialState, {
|
|
113
|
-
type: types.UPLOAD_VIBER_ASSET_SUCCESS,
|
|
114
|
-
data: asset,
|
|
115
|
-
statusCode: 200,
|
|
116
|
-
});
|
|
117
|
-
const async_ = viberReducer(initialState, {
|
|
118
|
-
type: types.UPLOAD_VIBER_ASSET_COMPLETED,
|
|
119
|
-
payload: { assetId: 'a1', asset },
|
|
120
|
-
});
|
|
121
|
-
// Both paths should store uploadedAssetData as Immutable fromJS(asset)
|
|
122
|
-
expect(sync.get('uploadedAssetData')).toEqual(async_.get('uploadedAssetData'));
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it('handles UPLOAD_VIBER_ASSET_FAILURE', () => {
|
|
126
|
-
const next = viberReducer(initialState, {
|
|
127
|
-
type: types.UPLOAD_VIBER_ASSET_FAILURE,
|
|
128
|
-
});
|
|
129
|
-
expect(next.get('uploadAssetSuccess')).toBe(false);
|
|
130
|
-
expect(next.get('assetUploading')).toBe(false);
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
describe('async polling cases', () => {
|
|
135
|
-
it('handles UPLOAD_VIBER_ASSET_PROCESSING', () => {
|
|
136
|
-
const next = viberReducer(initialState, {
|
|
137
|
-
type: types.UPLOAD_VIBER_ASSET_PROCESSING,
|
|
138
|
-
payload: { assetId: 'a1', asset: { id: 'a1' } },
|
|
139
|
-
});
|
|
140
|
-
expect(next.get('assetUploading')).toBe(true);
|
|
141
|
-
expect(next.get('uploadAssetSuccess')).toBe(false);
|
|
142
|
-
expect(next.getIn(['assetProcessing', 'a1', 'status'])).toBe(ASSET_STATUS.PROCESSING);
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
it('handles UPLOAD_VIBER_ASSET_COMPLETED', () => {
|
|
146
|
-
const next = viberReducer(initialState, {
|
|
147
|
-
type: types.UPLOAD_VIBER_ASSET_COMPLETED,
|
|
148
|
-
payload: { assetId: 'a1', asset: { url: 'https://cdn/x.png' } },
|
|
149
|
-
});
|
|
150
|
-
expect(next.get('assetUploading')).toBe(false);
|
|
151
|
-
expect(next.get('uploadAssetSuccess')).toBe(true);
|
|
152
|
-
expect(next.getIn(['assetProcessing', 'a1', 'status'])).toBe(ASSET_STATUS.COMPLETED);
|
|
153
|
-
expect(next.get('uploadedAssetData')).toEqual(fromJS({ url: 'https://cdn/x.png' }));
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
it('handles UPLOAD_VIBER_ASSET_FAILED', () => {
|
|
157
|
-
const next = viberReducer(initialState, {
|
|
158
|
-
type: types.UPLOAD_VIBER_ASSET_FAILED,
|
|
159
|
-
payload: { assetId: 'a1', error: 'boom' },
|
|
160
|
-
});
|
|
161
|
-
expect(next.get('assetUploading')).toBe(false);
|
|
162
|
-
expect(next.get('uploadAssetSuccess')).toBe(false);
|
|
163
|
-
expect(next.getIn(['assetProcessing', 'a1', 'status'])).toBe(ASSET_STATUS.FAILED);
|
|
164
|
-
expect(next.getIn(['assetProcessing', 'a1', 'error'])).toBe('boom');
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
it('handles UPLOAD_VIBER_ASSET_TIMEOUT', () => {
|
|
168
|
-
const next = viberReducer(initialState, {
|
|
169
|
-
type: types.UPLOAD_VIBER_ASSET_TIMEOUT,
|
|
170
|
-
payload: { assetId: 'a1', message: 'timed out' },
|
|
171
|
-
});
|
|
172
|
-
expect(next.get('assetUploading')).toBe(false);
|
|
173
|
-
expect(next.getIn(['assetProcessing', 'a1', 'status'])).toBe(ASSET_STATUS.TIMEOUT);
|
|
174
|
-
expect(next.getIn(['assetProcessing', 'a1', 'error'])).toBe('timed out');
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
describe('CLEAR_VIBER_ASSET (finding 3)', () => {
|
|
179
|
-
const dirtyState = initialState
|
|
180
|
-
.set('assetUploading', true)
|
|
181
|
-
.set('uploadAssetSuccess', true)
|
|
182
|
-
.set('uploadedAssetData', fromJS({ url: 'x' }))
|
|
183
|
-
.set('uploadedAssetData2', fromJS({ url: 'y' }))
|
|
184
|
-
.setIn(['assetProcessing', 'a1'], fromJS({ status: 'processing' }));
|
|
185
|
-
|
|
186
|
-
it('clears default uploadedAssetData and resets upload flags', () => {
|
|
187
|
-
const next = viberReducer(dirtyState, { type: types.CLEAR_VIBER_ASSET });
|
|
188
|
-
expect(next.has('uploadedAssetData')).toBe(false);
|
|
189
|
-
expect(next.get('assetProcessing')).toEqual(fromJS({}));
|
|
190
|
-
expect(next.get('assetUploading')).toBe(false);
|
|
191
|
-
expect(next.get('uploadAssetSuccess')).toBe(false);
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
it('clears templateType-specific uploadedAssetData and resets upload flags', () => {
|
|
195
|
-
const next = viberReducer(dirtyState, {
|
|
196
|
-
type: types.CLEAR_VIBER_ASSET,
|
|
197
|
-
templateType: 2,
|
|
198
|
-
});
|
|
199
|
-
expect(next.has('uploadedAssetData2')).toBe(false);
|
|
200
|
-
// default key untouched by specific clear
|
|
201
|
-
expect(next.has('uploadedAssetData')).toBe(true);
|
|
202
|
-
expect(next.get('assetProcessing')).toEqual(fromJS({}));
|
|
203
|
-
expect(next.get('assetUploading')).toBe(false);
|
|
204
|
-
expect(next.get('uploadAssetSuccess')).toBe(false);
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
describe('CLEAR_VIBER_DATA (finding 3 mirror)', () => {
|
|
209
|
-
it('clears assetProcessing, assetUploading, uploadAssetSuccess', () => {
|
|
210
|
-
const dirtyState = initialState
|
|
211
|
-
.set('assetUploading', true)
|
|
212
|
-
.set('uploadAssetSuccess', true)
|
|
213
|
-
.set('metaEntities', fromJS({ some: 'data' }))
|
|
214
|
-
.set('templateDetails', fromJS({ id: 'x' }))
|
|
215
|
-
.setIn(['assetProcessing', 'a1'], fromJS({ status: 'processing' }));
|
|
216
|
-
const next = viberReducer(dirtyState, { type: types.CLEAR_VIBER_DATA });
|
|
217
|
-
expect(next.has('uploadedAssetData')).toBe(false);
|
|
218
|
-
expect(next.has('metaEntities')).toBe(false);
|
|
219
|
-
expect(next.has('templateDetails')).toBe(false);
|
|
220
|
-
expect(next.get('assetProcessing')).toEqual(fromJS({}));
|
|
221
|
-
expect(next.get('assetUploading')).toBe(false);
|
|
222
|
-
expect(next.get('uploadAssetSuccess')).toBe(false);
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
describe('EDIT_VIBER_TEMPLATE_*', () => {
|
|
227
|
-
it('handles EDIT_VIBER_TEMPLATE_REQUEST', () => {
|
|
228
|
-
const next = viberReducer(initialState, {
|
|
229
|
-
type: types.EDIT_VIBER_TEMPLATE_REQUEST,
|
|
230
|
-
});
|
|
231
|
-
expect(next.get('editTemplateInProgress')).toBe(true);
|
|
232
|
-
expect(next.get('editTemplateError')).toBe(false);
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
it('handles EDIT_VIBER_TEMPLATE_SUCCESS', () => {
|
|
236
|
-
const next = viberReducer(initialState, {
|
|
237
|
-
type: types.EDIT_VIBER_TEMPLATE_SUCCESS,
|
|
238
|
-
data: { id: 'e' },
|
|
239
|
-
statusCode: 200,
|
|
240
|
-
errorMsg: '',
|
|
241
|
-
});
|
|
242
|
-
expect(next.get('editTemplateInProgress')).toBe(false);
|
|
243
|
-
expect(next.get('editResponse')).toEqual({ id: 'e' });
|
|
244
|
-
expect(next.get('editTemplateError')).toBe(false);
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
it('handles EDIT_VIBER_TEMPLATE_SUCCESS error status', () => {
|
|
248
|
-
const next = viberReducer(initialState, {
|
|
249
|
-
type: types.EDIT_VIBER_TEMPLATE_SUCCESS,
|
|
250
|
-
data: {},
|
|
251
|
-
statusCode: 500,
|
|
252
|
-
errorMsg: 'err',
|
|
253
|
-
});
|
|
254
|
-
expect(next.get('editTemplateError')).toBe(true);
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
it('handles EDIT_VIBER_TEMPLATE_FAILURE', () => {
|
|
258
|
-
const next = viberReducer(initialState, {
|
|
259
|
-
type: types.EDIT_VIBER_TEMPLATE_FAILURE,
|
|
260
|
-
errorMsg: 'nope',
|
|
261
|
-
});
|
|
262
|
-
expect(next.get('editTemplateError')).toBe(true);
|
|
263
|
-
});
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
describe('GET/CLEAR branches', () => {
|
|
267
|
-
it('handles GET_VIBER_TEMPLATE_DETAILS_REQUEST', () => {
|
|
268
|
-
const next = viberReducer(initialState, {
|
|
269
|
-
type: types.GET_VIBER_TEMPLATE_DETAILS_REQUEST,
|
|
270
|
-
});
|
|
271
|
-
expect(next.get('getTemplateDetailsInProgress')).toBe(true);
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
it('handles GET_VIBER_TEMPLATE_DETAILS_SUCCESS', () => {
|
|
275
|
-
const next = viberReducer(initialState, {
|
|
276
|
-
type: types.GET_VIBER_TEMPLATE_DETAILS_SUCCESS,
|
|
277
|
-
data: { id: 'd' },
|
|
278
|
-
});
|
|
279
|
-
expect(next.get('getTemplateDetailsInProgress')).toBe(false);
|
|
280
|
-
expect(next.get('templateDetails')).toEqual({ id: 'd' });
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
it('handles GET_VIBER_TEMPLATE_DETAILS_FAILURE / CLEAR_VIBER_EDIT_RESPONSE_REQUEST', () => {
|
|
284
|
-
const next = viberReducer(initialState, {
|
|
285
|
-
type: types.CLEAR_VIBER_EDIT_RESPONSE_REQUEST,
|
|
286
|
-
});
|
|
287
|
-
expect(next.get('editResponse')).toEqual({});
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
it('handles CLEAR_VIBER_CREATE_RESPONSE_REQUEST', () => {
|
|
291
|
-
const next = viberReducer(initialState, {
|
|
292
|
-
type: types.CLEAR_VIBER_CREATE_RESPONSE_REQUEST,
|
|
293
|
-
});
|
|
294
|
-
expect(next.get('response')).toEqual({});
|
|
295
|
-
});
|
|
296
|
-
});
|
|
297
|
-
});
|