@capillarytech/creatives-library 2.0.70 → 2.0.71
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 +1 -1
- package/components/Ckeditor/index.js +2 -1
- package/components/FormBuilder/index.js +25 -10
- package/components/Header/index.js +3 -1
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +38 -3
- package/components/TemplatePreview/index.js +45 -51
- package/components/TemplatePreview/messages.js +1 -1
- package/containers/Cap/actions.js +0 -5
- package/containers/Cap/reducer.js +1 -1
- package/containers/Cap/selectors.js +0 -13
- package/containers/Ebill/index.js +1 -2
- package/containers/Email/_email.scss +1 -0
- package/containers/Email/actions.js +3 -8
- package/containers/Email/constants.js +0 -1
- package/containers/Email/index.js +947 -322
- package/containers/Email/reducer.js +0 -3
- package/containers/Email/sagas.js +6 -3
- package/containers/Email/selectors.js +1 -4
- package/containers/Line/Create/index.js +1 -2
- package/containers/Line/Edit/_lineEdit.scss +4 -0
- package/containers/Line/Edit/index.js +1 -3
- package/containers/MobilePush/Create/_mobilePushCreate.scss +3 -12
- package/containers/MobilePush/Create/actions.js +0 -6
- package/containers/MobilePush/Create/constants.js +0 -1
- package/containers/MobilePush/Create/index.js +1133 -628
- package/containers/MobilePush/Create/messages.js +1 -5
- package/containers/MobilePush/Create/reducer.js +0 -2
- package/containers/MobilePush/Create/selectors.js +3 -3
- package/containers/MobilePush/Edit/_mobilePushCreate.scss +3 -9
- package/containers/MobilePush/Edit/index.js +1127 -393
- package/containers/MobilePush/Edit/messages.js +0 -4
- package/containers/MobilePush/Edit/reducer.js +1 -2
- package/containers/MobilePush/Edit/selectors.js +3 -6
- package/containers/Sms/Create/_smsCreate.scss +2 -1
- package/containers/Sms/Create/actions.js +4 -4
- package/containers/Sms/Create/index.js +570 -102
- package/containers/Sms/Create/sagas.js +2 -1
- package/containers/Sms/Edit/actions.js +5 -10
- package/containers/Sms/Edit/constants.js +0 -1
- package/containers/Sms/Edit/index.js +548 -103
- package/containers/Sms/Edit/reducer.js +0 -2
- package/containers/Sms/Edit/sagas.js +3 -1
- package/containers/TagList/index.js +3 -3
- package/containers/Templates/actions.js +1 -3
- package/containers/Templates/index.js +299 -268
- package/containers/Templates/messages.js +90 -122
- package/containers/Templates/reducer.js +3 -3
- package/containers/Templates/sagas.js +1 -5
- package/containers/Templates/selectors.js +1 -41
- package/containers/WeChat/MapTemplates/index.js +3 -4
- package/containers/WeChat/RichmediaTemplates/Create/index.js +18 -4
- package/containers/WeChat/RichmediaTemplates/Create/messages.js +4 -0
- package/containers/WeChat/RichmediaTemplates/Edit/index.js +3 -1
- package/containers/WeChat/RichmediaTemplates/View/index.js +3 -1
- package/index.js +31 -31
- package/initialState.js +6 -0
- package/package.json +3 -3
- package/routes.js +24 -19
- package/services/api.js +6 -2
- package/services/getSchema.js +18 -0
- package/v2Containers/App/actions.js +7 -0
- package/v2Containers/App/constants.js +3 -0
- package/v2Containers/App/reducer.js +19 -0
- package/v2Containers/App/sagas.js +26 -0
- package/v2Containers/App/selectors.js +25 -0
- package/v2Containers/App/tests/actions.test.js +18 -0
- package/v2Containers/App/tests/reducer.test.js +9 -0
- package/v2Containers/App/tests/sagas.test.js +15 -0
- package/v2Containers/App/tests/selectors.test.js +10 -0
- package/v2Containers/Assets/Gallery/_gallery.scss +0 -0
- package/v2Containers/Assets/Gallery/actions.js +37 -0
- package/v2Containers/Assets/Gallery/constants.js +23 -0
- package/v2Containers/Assets/Gallery/index.js +479 -0
- package/v2Containers/Assets/Gallery/messages.js +97 -0
- package/v2Containers/Assets/Gallery/reducer.js +81 -0
- package/v2Containers/Assets/Gallery/sagas.js +84 -0
- package/v2Containers/Assets/Gallery/selectors.js +25 -0
- package/v2Containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +7 -0
- package/v2Containers/Assets/Gallery/tests/actions.test.js +26 -0
- package/v2Containers/Assets/Gallery/tests/index.test.js +10 -0
- package/v2Containers/Assets/Gallery/tests/reducer.test.js +95 -0
- package/v2Containers/Assets/Gallery/tests/sagas.test.js +15 -0
- package/v2Containers/Assets/Gallery/tests/selectors.test.js +10 -0
- package/v2Containers/CallTask/_callTask.scss +5 -0
- package/v2Containers/CallTask/actions.js +15 -0
- package/v2Containers/CallTask/constants.js +7 -0
- package/v2Containers/CallTask/index.js +141 -0
- package/v2Containers/CallTask/messages.js +21 -0
- package/v2Containers/CallTask/reducer.js +23 -0
- package/v2Containers/CallTask/sagas.js +11 -0
- package/v2Containers/CallTask/selectors.js +25 -0
- package/v2Containers/CallTask/tests/actions.test.js +18 -0
- package/v2Containers/CallTask/tests/index.test.js +10 -0
- package/v2Containers/CallTask/tests/reducer.test.js +9 -0
- package/v2Containers/CallTask/tests/sagas.test.js +15 -0
- package/v2Containers/CallTask/tests/selectors.test.js +10 -0
- package/v2Containers/Cap/actions.js +64 -0
- package/v2Containers/Cap/constants.js +24 -0
- package/v2Containers/Cap/index.js +349 -0
- package/v2Containers/Cap/messsages.js +63 -0
- package/v2Containers/Cap/reducer.js +111 -0
- package/v2Containers/Cap/sagas.js +143 -0
- package/v2Containers/Cap/selectors.js +85 -0
- package/v2Containers/Cap/tests/index.test.js +16 -0
- package/v2Containers/Cap/tests/selectors.test.js +28 -0
- package/v2Containers/ChannelTemplates/actions.js +20 -0
- package/v2Containers/ChannelTemplates/constants.js +8 -0
- package/v2Containers/ChannelTemplates/index.js +48 -0
- package/v2Containers/ChannelTemplates/messages.js +13 -0
- package/v2Containers/ChannelTemplates/reducer.js +34 -0
- package/v2Containers/ChannelTemplates/sagas.js +32 -0
- package/v2Containers/ChannelTemplates/selectors.js +25 -0
- package/v2Containers/ChannelTemplates/tests/actions.test.js +18 -0
- package/v2Containers/ChannelTemplates/tests/index.test.js +10 -0
- package/v2Containers/ChannelTemplates/tests/reducer.test.js +9 -0
- package/v2Containers/ChannelTemplates/tests/sagas.test.js +15 -0
- package/v2Containers/ChannelTemplates/tests/selectors.test.js +10 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +257 -0
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +45 -0
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +70 -0
- package/v2Containers/CreativesContainer/actions.js +27 -0
- package/v2Containers/CreativesContainer/constants.js +16 -0
- package/v2Containers/CreativesContainer/index.js +483 -0
- package/v2Containers/CreativesContainer/index.scss +27 -0
- package/v2Containers/CreativesContainer/messages.js +293 -0
- package/v2Containers/CreativesContainer/reducer.js +29 -0
- package/v2Containers/CreativesContainer/sagas.js +11 -0
- package/v2Containers/CreativesContainer/selectors.js +30 -0
- package/v2Containers/CreativesContainer/tests/actions.test.js +18 -0
- package/v2Containers/CreativesContainer/tests/index.test.js +10 -0
- package/v2Containers/CreativesContainer/tests/reducer.test.js +9 -0
- package/v2Containers/CreativesContainer/tests/sagas.test.js +15 -0
- package/v2Containers/CreativesContainer/tests/selectors.test.js +10 -0
- package/v2Containers/Dashboard/actions.js +15 -0
- package/v2Containers/Dashboard/constants.js +7 -0
- package/v2Containers/Dashboard/index.js +54 -0
- package/v2Containers/Dashboard/messages.js +13 -0
- package/v2Containers/Dashboard/reducer.js +21 -0
- package/v2Containers/Dashboard/sagas.js +11 -0
- package/v2Containers/Dashboard/selectors.js +25 -0
- package/v2Containers/Dashboard/tests/actions.test.js +18 -0
- package/v2Containers/Dashboard/tests/index.test.js +10 -0
- package/v2Containers/Dashboard/tests/reducer.test.js +9 -0
- package/v2Containers/Dashboard/tests/sagas.test.js +15 -0
- package/v2Containers/Dashboard/tests/selectors.test.js +10 -0
- package/v2Containers/Ebill/_ebill.scss +5 -0
- package/v2Containers/Ebill/actions.js +43 -0
- package/v2Containers/Ebill/constants.js +20 -0
- package/v2Containers/Ebill/index.js +1261 -0
- package/v2Containers/Ebill/messages.js +73 -0
- package/v2Containers/Ebill/reducer.js +72 -0
- package/v2Containers/Ebill/sagas.js +65 -0
- package/v2Containers/Ebill/selectors.js +25 -0
- package/v2Containers/Ebill/tests/actions.test.js +18 -0
- package/v2Containers/Ebill/tests/index.test.js +10 -0
- package/v2Containers/Ebill/tests/reducer.test.js +9 -0
- package/v2Containers/Ebill/tests/sagas.test.js +15 -0
- package/v2Containers/Ebill/tests/selectors.test.js +10 -0
- package/v2Containers/Email/_email.scss +140 -0
- package/v2Containers/Email/actions.js +86 -0
- package/v2Containers/Email/constants.js +37 -0
- package/v2Containers/Email/index.js +2703 -0
- package/v2Containers/Email/initialSchema.js +540 -0
- package/v2Containers/Email/messages.js +237 -0
- package/v2Containers/Email/reducer.js +147 -0
- package/v2Containers/Email/sagas.js +133 -0
- package/v2Containers/Email/selectors.js +34 -0
- package/v2Containers/Email/tests/actions.test.js +18 -0
- package/v2Containers/Email/tests/index.test.js +10 -0
- package/v2Containers/Email/tests/reducer.test.js +9 -0
- package/v2Containers/Email/tests/sagas.test.js +15 -0
- package/v2Containers/Email/tests/selectors.test.js +10 -0
- package/v2Containers/EmailWrapper/actions.js +15 -0
- package/v2Containers/EmailWrapper/constants.js +7 -0
- package/v2Containers/EmailWrapper/index.js +258 -0
- package/v2Containers/EmailWrapper/messages.js +57 -0
- package/v2Containers/EmailWrapper/reducer.js +23 -0
- package/v2Containers/EmailWrapper/sagas.js +11 -0
- package/v2Containers/EmailWrapper/selectors.js +25 -0
- package/v2Containers/EmailWrapper/tests/actions.test.js +18 -0
- package/v2Containers/EmailWrapper/tests/index.test.js +10 -0
- package/v2Containers/EmailWrapper/tests/reducer.test.js +9 -0
- package/v2Containers/EmailWrapper/tests/sagas.test.js +15 -0
- package/v2Containers/EmailWrapper/tests/selectors.test.js +10 -0
- package/v2Containers/LanguageProvider/actions.js +17 -0
- package/v2Containers/LanguageProvider/constants.js +8 -0
- package/v2Containers/LanguageProvider/index.js +46 -0
- package/v2Containers/LanguageProvider/reducer.js +30 -0
- package/v2Containers/LanguageProvider/selectors.js +20 -0
- package/v2Containers/LanguageProvider/tests/actions.test.js +19 -0
- package/v2Containers/LanguageProvider/tests/index.test.js +49 -0
- package/v2Containers/LanguageProvider/tests/reducer.test.js +20 -0
- package/v2Containers/LanguageProvider/tests/selectors.test.js +15 -0
- package/v2Containers/Line/Create/_lineCreate.scss +43 -0
- package/v2Containers/Line/Create/actions.js +90 -0
- package/v2Containers/Line/Create/constants.js +39 -0
- package/v2Containers/Line/Create/index.js +822 -0
- package/v2Containers/Line/Create/messages.js +173 -0
- package/v2Containers/Line/Create/reducer.js +99 -0
- package/v2Containers/Line/Create/sagas.js +107 -0
- package/v2Containers/Line/Create/selectors.js +36 -0
- package/v2Containers/Line/Edit/_lineEdit.scss +21 -0
- package/v2Containers/Line/Edit/actions.js +79 -0
- package/v2Containers/Line/Edit/constants.js +27 -0
- package/v2Containers/Line/Edit/index.js +1050 -0
- package/v2Containers/Line/Edit/messages.js +157 -0
- package/v2Containers/Line/Edit/reducer.js +83 -0
- package/v2Containers/Line/Edit/sagas.js +81 -0
- package/v2Containers/Line/Edit/selectors.js +29 -0
- package/v2Containers/Line/Edit/tests/actions.test.js +18 -0
- package/v2Containers/Line/Edit/tests/index.test.js +10 -0
- package/v2Containers/Line/Edit/tests/reducer.test.js +9 -0
- package/v2Containers/Line/Edit/tests/sagas.test.js +15 -0
- package/v2Containers/Line/Edit/tests/selectors.test.js +10 -0
- package/v2Containers/Login/assets/images/capillary_logo.png +0 -0
- package/v2Containers/Login/components/LoginForm/index.js +59 -0
- package/v2Containers/Login/components/LoginForm/messages.js +21 -0
- package/v2Containers/Login/components/LoginForm/tests/index.test.js +10 -0
- package/v2Containers/Login/index.js +106 -0
- package/v2Containers/Login/messages.js +21 -0
- package/v2Containers/Login/selectors.js +25 -0
- package/v2Containers/Login/tests/index.test.js +10 -0
- package/v2Containers/Login/tests/sagas.test.js +15 -0
- package/v2Containers/Login/tests/selectors.test.js +10 -0
- package/v2Containers/MobilePush/Create/_mobilePushCreate.scss +41 -0
- package/v2Containers/MobilePush/Create/actions.js +52 -0
- package/v2Containers/MobilePush/Create/constants.js +24 -0
- package/v2Containers/MobilePush/Create/index.js +1759 -0
- package/v2Containers/MobilePush/Create/messages.js +237 -0
- package/v2Containers/MobilePush/Create/reducer.js +72 -0
- package/v2Containers/MobilePush/Create/sagas.js +60 -0
- package/v2Containers/MobilePush/Create/selectors.js +28 -0
- package/v2Containers/MobilePush/Create/tests/actions.test.js +18 -0
- package/v2Containers/MobilePush/Create/tests/index.test.js +10 -0
- package/v2Containers/MobilePush/Create/tests/reducer.test.js +9 -0
- package/v2Containers/MobilePush/Create/tests/sagas.test.js +15 -0
- package/v2Containers/MobilePush/Create/tests/selectors.test.js +10 -0
- package/v2Containers/MobilePush/Edit/_mobilePushCreate.scss +38 -0
- package/v2Containers/MobilePush/Edit/actions.js +91 -0
- package/v2Containers/MobilePush/Edit/constants.js +35 -0
- package/v2Containers/MobilePush/Edit/index.js +1846 -0
- package/v2Containers/MobilePush/Edit/messages.js +253 -0
- package/v2Containers/MobilePush/Edit/reducer.js +113 -0
- package/v2Containers/MobilePush/Edit/sagas.js +119 -0
- package/v2Containers/MobilePush/Edit/selectors.js +32 -0
- package/v2Containers/MobilePush/Edit/tests/actions.test.js +18 -0
- package/v2Containers/MobilePush/Edit/tests/index.test.js +10 -0
- package/v2Containers/MobilePush/Edit/tests/reducer.test.js +9 -0
- package/v2Containers/MobilePush/Edit/tests/sagas.test.js +15 -0
- package/v2Containers/MobilePush/Edit/tests/selectors.test.js +10 -0
- package/v2Containers/MobilePush/commonMethods.js +249 -0
- package/v2Containers/MobilePush/eventsMap.js +127 -0
- package/v2Containers/MobilePush/initialSchema.js +1739 -0
- package/v2Containers/MobilepushWrapper/_mobilepushWrapper.scss +18 -0
- package/v2Containers/MobilepushWrapper/index.js +136 -0
- package/v2Containers/MobilepushWrapper/messages.js +29 -0
- package/v2Containers/MobilepushWrapper/tests/index.test.js +10 -0
- package/v2Containers/NotFoundPage/index.js +25 -0
- package/v2Containers/NotFoundPage/messages.js +13 -0
- package/v2Containers/NotFoundPage/tests/index.test.js +17 -0
- package/v2Containers/Sms/Create/_smsCreate.scss +58 -0
- package/v2Containers/Sms/Create/actions.js +27 -0
- package/v2Containers/Sms/Create/constants.js +16 -0
- package/v2Containers/Sms/Create/index.js +1017 -0
- package/v2Containers/Sms/Create/messages.js +85 -0
- package/v2Containers/Sms/Create/reducer.js +41 -0
- package/v2Containers/Sms/Create/sagas.js +35 -0
- package/v2Containers/Sms/Create/selectors.js +28 -0
- package/v2Containers/Sms/Create/tests/actions.test.js +18 -0
- package/v2Containers/Sms/Create/tests/index.test.js +10 -0
- package/v2Containers/Sms/Create/tests/reducer.test.js +9 -0
- package/v2Containers/Sms/Create/tests/sagas.test.js +15 -0
- package/v2Containers/Sms/Create/tests/selectors.test.js +10 -0
- package/v2Containers/Sms/Edit/actions.js +45 -0
- package/v2Containers/Sms/Edit/constants.js +18 -0
- package/v2Containers/Sms/Edit/index.js +1018 -0
- package/v2Containers/Sms/Edit/messages.js +89 -0
- package/v2Containers/Sms/Edit/reducer.js +52 -0
- package/v2Containers/Sms/Edit/sagas.js +50 -0
- package/v2Containers/Sms/Edit/selectors.js +32 -0
- package/v2Containers/Sms/Edit/tests/actions.test.js +18 -0
- package/v2Containers/Sms/Edit/tests/index.test.js +10 -0
- package/v2Containers/Sms/Edit/tests/reducer.test.js +9 -0
- package/v2Containers/Sms/Edit/tests/sagas.test.js +15 -0
- package/v2Containers/Sms/Edit/tests/selectors.test.js +10 -0
- package/v2Containers/Sms/initialSchema.js +281 -0
- package/v2Containers/TagList/_tagList.scss +8 -0
- package/v2Containers/TagList/actions.js +15 -0
- package/v2Containers/TagList/constants.js +7 -0
- package/v2Containers/TagList/index.js +236 -0
- package/v2Containers/TagList/messages.js +13 -0
- package/v2Containers/TagList/reducer.js +23 -0
- package/v2Containers/TagList/sagas.js +11 -0
- package/v2Containers/TagList/selectors.js +25 -0
- package/v2Containers/TagList/tests/actions.test.js +18 -0
- package/v2Containers/TagList/tests/index.test.js +10 -0
- package/v2Containers/TagList/tests/reducer.test.js +9 -0
- package/v2Containers/TagList/tests/sagas.test.js +15 -0
- package/v2Containers/TagList/tests/selectors.test.js +10 -0
- package/v2Containers/Templates/_templates.scss +349 -0
- package/v2Containers/Templates/actions.js +110 -0
- package/v2Containers/Templates/constants.js +45 -0
- package/v2Containers/Templates/index.js +1682 -0
- package/v2Containers/Templates/messages.js +273 -0
- package/v2Containers/Templates/reducer.js +142 -0
- package/v2Containers/Templates/sagas.js +180 -0
- package/v2Containers/Templates/selectors.js +68 -0
- package/v2Containers/Templates/tests/actions.test.js +18 -0
- package/v2Containers/Templates/tests/index.test.js +10 -0
- package/v2Containers/Templates/tests/reducer.test.js +9 -0
- package/v2Containers/Templates/tests/sagas.test.js +15 -0
- package/v2Containers/Templates/tests/selectors.test.js +10 -0
- package/v2Containers/TemplatesV2/_templatesV2.scss +5 -0
- package/v2Containers/TemplatesV2/actions.js +16 -0
- package/v2Containers/TemplatesV2/constants.js +10 -0
- package/v2Containers/TemplatesV2/index.js +217 -0
- package/v2Containers/TemplatesV2/messages.js +29 -0
- package/v2Containers/TemplatesV2/selectors.js +25 -0
- package/v2Containers/TemplatesV2/tests/actions.test.js +18 -0
- package/v2Containers/TemplatesV2/tests/index.test.js +10 -0
- package/v2Containers/TemplatesV2/tests/reducer.test.js +9 -0
- package/v2Containers/TemplatesV2/tests/sagas.test.js +15 -0
- package/v2Containers/TemplatesV2/tests/selectors.test.js +10 -0
- package/v2Containers/TestPage/constants.js +7 -0
- package/v2Containers/TestPage/index.js +31 -0
- package/v2Containers/TestPage/messages.js +13 -0
- package/v2Containers/TestPage/reducer.js +21 -0
- package/v2Containers/TestPage/sagas.js +11 -0
- package/v2Containers/Testv2/actions.js +15 -0
- package/v2Containers/Testv2/constants.js +7 -0
- package/v2Containers/Testv2/index.js +47 -0
- package/v2Containers/Testv2/messages.js +13 -0
- package/v2Containers/Testv2/reducer.js +23 -0
- package/v2Containers/Testv2/sagas.js +11 -0
- package/v2Containers/Testv2/selectors.js +25 -0
- package/v2Containers/Testv2/tests/actions.test.js +18 -0
- package/v2Containers/Testv2/tests/index.test.js +10 -0
- package/v2Containers/Testv2/tests/reducer.test.js +9 -0
- package/v2Containers/Testv2/tests/sagas.test.js +15 -0
- package/v2Containers/Testv2/tests/selectors.test.js +10 -0
- package/v2Containers/WeChat/MapTemplates/_mapTemplates.scss +8 -0
- package/v2Containers/WeChat/MapTemplates/actions.js +52 -0
- package/v2Containers/WeChat/MapTemplates/constants.js +28 -0
- package/v2Containers/WeChat/MapTemplates/index.js +1385 -0
- package/v2Containers/WeChat/MapTemplates/messages.js +73 -0
- package/v2Containers/WeChat/MapTemplates/reducer.js +74 -0
- package/v2Containers/WeChat/MapTemplates/sagas.js +86 -0
- package/v2Containers/WeChat/MapTemplates/selectors.js +25 -0
- package/v2Containers/WeChat/MapTemplates/tests/actions.test.js +18 -0
- package/v2Containers/WeChat/MapTemplates/tests/index.test.js +10 -0
- package/v2Containers/WeChat/MapTemplates/tests/reducer.test.js +9 -0
- package/v2Containers/WeChat/MapTemplates/tests/sagas.test.js +15 -0
- package/v2Containers/WeChat/MapTemplates/tests/selectors.test.js +10 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +57 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/actions.js +36 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/constants.js +15 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +1053 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/messages.js +141 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/reducer.js +60 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +497 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/sagas.js +48 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/selectors.js +37 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/tests/actions.test.js +18 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/tests/index.test.js +10 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/tests/reducer.test.js +9 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/tests/sagas.test.js +15 -0
- package/v2Containers/WeChat/RichmediaTemplates/Create/tests/selectors.test.js +10 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/actions.js +20 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/constants.js +10 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/index.js +116 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/messages.js +13 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/reducer.js +28 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/sagas.js +32 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/selectors.js +30 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/actions.test.js +18 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/index.test.js +10 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/reducer.test.js +9 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/sagas.test.js +15 -0
- package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/selectors.test.js +10 -0
- package/v2Containers/WeChat/RichmediaTemplates/View/actions.js +15 -0
- package/v2Containers/WeChat/RichmediaTemplates/View/constants.js +7 -0
- package/v2Containers/WeChat/RichmediaTemplates/View/index.js +47 -0
- package/v2Containers/WeChat/RichmediaTemplates/View/messages.js +13 -0
- package/v2Containers/WeChat/RichmediaTemplates/View/reducer.js +23 -0
- package/v2Containers/WeChat/RichmediaTemplates/View/sagas.js +11 -0
- package/v2Containers/WeChat/RichmediaTemplates/View/selectors.js +25 -0
- package/v2Containers/WeChat/RichmediaTemplates/View/tests/actions.test.js +18 -0
- package/v2Containers/WeChat/RichmediaTemplates/View/tests/index.test.js +10 -0
- package/v2Containers/WeChat/RichmediaTemplates/View/tests/reducer.test.js +9 -0
- package/v2Containers/WeChat/RichmediaTemplates/View/tests/sagas.test.js +15 -0
- package/v2Containers/WeChat/RichmediaTemplates/View/tests/selectors.test.js +10 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// makeSelectLocationState expects a plain JS object for the routing state
|
|
2
|
+
import { createSelector } from 'reselect';
|
|
3
|
+
import _ from 'lodash';
|
|
4
|
+
const selectCapDomain = (state) => state.get('cap');
|
|
5
|
+
|
|
6
|
+
const makeSelectAuthenticated = () => createSelector(
|
|
7
|
+
selectCapDomain,
|
|
8
|
+
(globalState) => globalState.toJS()
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
const makeSelectMessage = () => createSelector(
|
|
12
|
+
selectCapDomain,
|
|
13
|
+
(globalState) => globalState.get('messages').toJS()
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
const makeSelectMetaEntities = () => createSelector(
|
|
17
|
+
selectCapDomain,
|
|
18
|
+
(globalState) => globalState.get('metaEntities')
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const isLoadingMetaEntities = () => createSelector(
|
|
22
|
+
selectCapDomain,
|
|
23
|
+
(globalState) => globalState.get('fetchingSchema')
|
|
24
|
+
);
|
|
25
|
+
const setInjectedTags = () => createSelector(
|
|
26
|
+
selectCapDomain,
|
|
27
|
+
(globalState) => {
|
|
28
|
+
let injectedTags = globalState.get('injectedTags') || {};
|
|
29
|
+
const metaEntities = globalState.get('metaEntities') || {};
|
|
30
|
+
const customTags = metaEntities.tags && metaEntities.tags.custom ? metaEntities.tags.custom : {};
|
|
31
|
+
console.log("selector cap: ", injectedTags, customTags, metaEntities);
|
|
32
|
+
return (injectedTags = _.merge({}, injectedTags, customTags));
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const makeSelectLocationState = () => {
|
|
37
|
+
let prevRoutingState;
|
|
38
|
+
let prevRoutingStateJS;
|
|
39
|
+
|
|
40
|
+
return (state) => {
|
|
41
|
+
const routingState = state.get('route'); // or state.route
|
|
42
|
+
|
|
43
|
+
if (!routingState.equals(prevRoutingState)) {
|
|
44
|
+
prevRoutingState = routingState;
|
|
45
|
+
prevRoutingStateJS = routingState.toJS();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return prevRoutingStateJS;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const makeSelectOrgId = () => createSelector(
|
|
53
|
+
selectCapDomain,
|
|
54
|
+
(globalState) => globalState.get('orgID')
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const makeSelectUser = () => createSelector(
|
|
58
|
+
selectCapDomain,
|
|
59
|
+
(globalState) => globalState.get('user')
|
|
60
|
+
);
|
|
61
|
+
const selectCurrentOrgDetails = () => createSelector(
|
|
62
|
+
selectCapDomain,
|
|
63
|
+
(globalState) => {
|
|
64
|
+
const currentOrgDetails = globalState.get('currentOrgDetails');
|
|
65
|
+
return currentOrgDetails ? currentOrgDetails.toJS() : null;
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const makeSelectFetchingSchema = () => createSelector(
|
|
70
|
+
selectCapDomain,
|
|
71
|
+
(globalState) => globalState.get('fetchingSchema')
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
makeSelectLocationState,
|
|
76
|
+
makeSelectAuthenticated,
|
|
77
|
+
makeSelectMessage,
|
|
78
|
+
makeSelectOrgId,
|
|
79
|
+
makeSelectMetaEntities,
|
|
80
|
+
makeSelectUser,
|
|
81
|
+
selectCurrentOrgDetails,
|
|
82
|
+
isLoadingMetaEntities,
|
|
83
|
+
makeSelectFetchingSchema,
|
|
84
|
+
setInjectedTags,
|
|
85
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { shallow } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import Cap from '../index';
|
|
5
|
+
|
|
6
|
+
describe('<Cap />', () => {
|
|
7
|
+
it('should render its children', () => {
|
|
8
|
+
const children = (<h1>Test</h1>);
|
|
9
|
+
const renderedComponent = shallow(
|
|
10
|
+
<Cap>
|
|
11
|
+
{children}
|
|
12
|
+
</Cap>
|
|
13
|
+
);
|
|
14
|
+
expect(renderedComponent.contains(children)).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { fromJS } from 'immutable';
|
|
2
|
+
|
|
3
|
+
import { makeSelectLocationState } from 'containers/Cap/selectors';
|
|
4
|
+
|
|
5
|
+
describe('makeSelectLocationState', () => {
|
|
6
|
+
it('should select the route as a plain JS object', () => {
|
|
7
|
+
const route = fromJS({
|
|
8
|
+
locationBeforeTransitions: null,
|
|
9
|
+
});
|
|
10
|
+
const mockedState = fromJS({
|
|
11
|
+
route,
|
|
12
|
+
});
|
|
13
|
+
expect(makeSelectLocationState()(mockedState)).toEqual(route.toJS());
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('should return cached js routeState for same concurrent calls', () => {
|
|
17
|
+
const route = fromJS({
|
|
18
|
+
locationBeforeTransitions: null,
|
|
19
|
+
});
|
|
20
|
+
const mockedState = fromJS({
|
|
21
|
+
route,
|
|
22
|
+
});
|
|
23
|
+
const selectLocationState = makeSelectLocationState();
|
|
24
|
+
|
|
25
|
+
const firstRouteStateJS = selectLocationState(mockedState);
|
|
26
|
+
expect(selectLocationState(mockedState)).toBe(firstRouteStateJS);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* ChannelTemplates actions
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as types from './constants';
|
|
8
|
+
|
|
9
|
+
export function defaultAction() {
|
|
10
|
+
return {
|
|
11
|
+
type: types.DEFAULT_ACTION,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function getTemplates(channel) {
|
|
16
|
+
return {
|
|
17
|
+
type: types.GET_TEMPLATES_REQUEST,
|
|
18
|
+
channel,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* ChannelTemplates
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { connect } from 'react-redux';
|
|
11
|
+
import { FormattedMessage } from 'react-intl';
|
|
12
|
+
import { bindActionCreators } from 'redux';
|
|
13
|
+
import { createStructuredSelector } from 'reselect';
|
|
14
|
+
import makeSelectChannelTemplates from './selectors';
|
|
15
|
+
import * as actions from './actions';
|
|
16
|
+
import messages from './messages';
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export class ChannelTemplates extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
20
|
+
componentDidMount() {
|
|
21
|
+
debugger;
|
|
22
|
+
this.props.actions.getTemplates(this.props.channel);
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
return (
|
|
26
|
+
<CardGrid
|
|
27
|
+
cardDataList={[]}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
ChannelTemplates.propTypes = {
|
|
34
|
+
actions: PropTypes.object.isRequired,
|
|
35
|
+
channel: PropTypes.string,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const mapStateToProps = createStructuredSelector({
|
|
39
|
+
ChannelTemplates: makeSelectChannelTemplates(),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
function mapDispatchToProps(dispatch) {
|
|
43
|
+
return {
|
|
44
|
+
actions: bindActionCreators(actions, dispatch),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default connect(mapStateToProps, mapDispatchToProps)(ChannelTemplates);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ChannelTemplates Messages
|
|
3
|
+
*
|
|
4
|
+
* This contains all the text for the ChannelTemplates component.
|
|
5
|
+
*/
|
|
6
|
+
import { defineMessages } from 'react-intl';
|
|
7
|
+
|
|
8
|
+
export default defineMessages({
|
|
9
|
+
header: {
|
|
10
|
+
id: 'app.containers.ChannelTemplates.header',
|
|
11
|
+
defaultMessage: 'This is ChannelTemplates container !',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* ChannelTemplates reducer
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { fromJS } from 'immutable';
|
|
8
|
+
import * as types from './constants';
|
|
9
|
+
|
|
10
|
+
const initialState = fromJS({
|
|
11
|
+
loadingTemplates: true,
|
|
12
|
+
smsTemplates: [],
|
|
13
|
+
emailTemplates: [],
|
|
14
|
+
wechatTemplates: [],
|
|
15
|
+
mobilepushTemplates: [],
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
function channelTemplatesReducer(state = initialState, action) {
|
|
19
|
+
const channelTemplates = `${action.channel}Templates`;
|
|
20
|
+
switch (action.type) {
|
|
21
|
+
case types.DEFAULT_ACTION:
|
|
22
|
+
return state;
|
|
23
|
+
case types.GET_TEMPLATES_REQUEST:
|
|
24
|
+
return state.set('loadingTemplates', true);
|
|
25
|
+
case types.GET_TEMPLATES_SUCESS:
|
|
26
|
+
return state.set('loadingTemplates', false).set(channelTemplates, action.templates);
|
|
27
|
+
case types.GET_TEMPLATES_FAILURE:
|
|
28
|
+
return state.set('loadingTemplates', false).set('error', action.error);
|
|
29
|
+
default:
|
|
30
|
+
return state;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default channelTemplatesReducer;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { take, takeLatest, call, put, cancel } from 'redux-saga/effects';
|
|
2
|
+
import { LOCATION_CHANGE } from 'react-router-redux';
|
|
3
|
+
import * as Api from '../../services/api';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import * as types from './constants';
|
|
7
|
+
// Individual exports for testing
|
|
8
|
+
export function* defaultSaga() {
|
|
9
|
+
// See example in containers/HomePage/sagas.js
|
|
10
|
+
}
|
|
11
|
+
function* getTemplates(action) {
|
|
12
|
+
try {
|
|
13
|
+
const req = {
|
|
14
|
+
channel: action.channel,
|
|
15
|
+
queryParams: action.query,
|
|
16
|
+
};
|
|
17
|
+
const res = call(Api.getAllTemplates, req);
|
|
18
|
+
put({type: types.GET_TEMPLATES_SUCESS, templates: res.response, channel: action.channel});
|
|
19
|
+
} catch (error) {
|
|
20
|
+
put({type: types.GET_TEMPLATES_FAILURE, error});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function* getTemplatesWatcher() {
|
|
24
|
+
const watcher = yield takeLatest(types.GET_TEMPLATES_REQUEST, getTemplates);
|
|
25
|
+
yield take(LOCATION_CHANGE);
|
|
26
|
+
yield cancel(watcher);
|
|
27
|
+
}
|
|
28
|
+
// All sagas to be loaded
|
|
29
|
+
export default [
|
|
30
|
+
defaultSaga,
|
|
31
|
+
getTemplatesWatcher,
|
|
32
|
+
];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createSelector } from 'reselect';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Direct selector to the channelTemplates state domain
|
|
5
|
+
*/
|
|
6
|
+
const selectChannelTemplatesDomain = () => (state) => state.get('templates');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Other specific selectors
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Default selector used by ChannelTemplates
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const makeSelectChannelTemplates = () => createSelector(
|
|
18
|
+
selectChannelTemplatesDomain(),
|
|
19
|
+
(substate) => substate.toJS()
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export default makeSelectChannelTemplates;
|
|
23
|
+
export {
|
|
24
|
+
selectChannelTemplatesDomain,
|
|
25
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
defaultAction,
|
|
4
|
+
} from '../actions';
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_ACTION,
|
|
7
|
+
} from '../constants';
|
|
8
|
+
|
|
9
|
+
describe('ChannelTemplates actions', () => {
|
|
10
|
+
describe('Default Action', () => {
|
|
11
|
+
it('has a type of DEFAULT_ACTION', () => {
|
|
12
|
+
const expected = {
|
|
13
|
+
type: DEFAULT_ACTION,
|
|
14
|
+
};
|
|
15
|
+
expect(defaultAction()).toEqual(expected);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import { shallow } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
// import { ChannelTemplates } from '../index';
|
|
5
|
+
|
|
6
|
+
describe('<ChannelTemplates />', () => {
|
|
7
|
+
it('Expect to have unit tests specified', () => {
|
|
8
|
+
expect(true).toEqual(false);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test sagas
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* eslint-disable redux-saga/yield-effects */
|
|
6
|
+
// import { take, call, put, select } from 'redux-saga/effects';
|
|
7
|
+
// import { defaultSaga } from '../sagas';
|
|
8
|
+
|
|
9
|
+
// const generator = defaultSaga();
|
|
10
|
+
|
|
11
|
+
describe('defaultSaga Saga', () => {
|
|
12
|
+
it('Expect to have unit tests specified', () => {
|
|
13
|
+
expect(true).toEqual(false);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// import { fromJS } from 'immutable';
|
|
2
|
+
// import { makeSelectChannelTemplatesDomain } from '../selectors';
|
|
3
|
+
|
|
4
|
+
// const selector = makeSelectChannelTemplatesDomain();
|
|
5
|
+
|
|
6
|
+
describe('makeSelectChannelTemplatesDomain', () => {
|
|
7
|
+
it('Expect to have unit tests specified', () => {
|
|
8
|
+
expect(true).toEqual(false);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import TemplatesV2 from '../TemplatesV2';
|
|
5
|
+
import TemplatePreview from '../../components/TemplatePreview';
|
|
6
|
+
import SmsCreate from '../Sms/Create';
|
|
7
|
+
import SmsEdit from '../Sms/Edit';
|
|
8
|
+
import Email from '../Email';
|
|
9
|
+
import EmailWrapper from '../EmailWrapper';
|
|
10
|
+
import MobilepushWrapper from '../MobilepushWrapper';
|
|
11
|
+
import EmailPreviewV2 from '../../components/EmailPreviewV2';
|
|
12
|
+
import MobilePushPreview from '../../components/MobilePushPreviewV2';
|
|
13
|
+
import CallTask from '../CallTask';
|
|
14
|
+
import MobliPushEdit from '../MobilePush/Edit';
|
|
15
|
+
import * as constants from './constants';
|
|
16
|
+
const CreativesWrapper = styled.div`
|
|
17
|
+
.ant-popover,
|
|
18
|
+
.ant-notification,
|
|
19
|
+
.ant-modal-wrap {
|
|
20
|
+
z-index: 10003;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
function SlideBoxContent(props) {
|
|
24
|
+
const {
|
|
25
|
+
slidBoxContent,
|
|
26
|
+
onSelectTemplate,
|
|
27
|
+
onPreviewTemplate,
|
|
28
|
+
templateData,
|
|
29
|
+
location,
|
|
30
|
+
isGetFormData,
|
|
31
|
+
getFormData,
|
|
32
|
+
messageDetails,
|
|
33
|
+
onCreateNew,
|
|
34
|
+
currentChannel,
|
|
35
|
+
onChannelChange,
|
|
36
|
+
onEmailModeChange,
|
|
37
|
+
emailCreateMode,
|
|
38
|
+
onMobilepushModeChange,
|
|
39
|
+
mobilePushCreateMode,
|
|
40
|
+
templateStep,
|
|
41
|
+
onCreateNextStep,
|
|
42
|
+
cap,
|
|
43
|
+
onResetStep,
|
|
44
|
+
isFullMode,
|
|
45
|
+
onCallTaskSubmit,
|
|
46
|
+
setIsLoadingContent,
|
|
47
|
+
showTemplateName,
|
|
48
|
+
} = props;
|
|
49
|
+
const type = messageDetails.type.toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
|
|
50
|
+
const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'defualt' : 'library'};
|
|
51
|
+
const creativesLocationProps = {
|
|
52
|
+
pathname: `/sms/edit`,
|
|
53
|
+
query,
|
|
54
|
+
search: '',
|
|
55
|
+
};
|
|
56
|
+
let channel = currentChannel;//for create mode
|
|
57
|
+
const isCreateSms = slidBoxContent === 'createTemplate' && channel === constants.SMS;
|
|
58
|
+
const isCreateMPush = slidBoxContent === 'createTemplate' && channel === constants.MOBILE_PUSH;
|
|
59
|
+
const isCreateCallTask = slidBoxContent === 'createTemplate' && channel === constants.CALL_TASK;
|
|
60
|
+
let isEditSms = false;
|
|
61
|
+
let isEditEmailWithId = false;
|
|
62
|
+
let isEmailEditWithContent = false;
|
|
63
|
+
let isPreview = false;
|
|
64
|
+
let isEmailPreview = false;
|
|
65
|
+
let isMpushPreview = false;
|
|
66
|
+
let isEditCallTask = false;
|
|
67
|
+
let isEditMPush = false;
|
|
68
|
+
const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL;
|
|
69
|
+
if (templateData && channel) {
|
|
70
|
+
channel = templateData.type;// for edit mode with template data
|
|
71
|
+
isEditSms = slidBoxContent === 'editTemplate' && channel === constants.SMS;
|
|
72
|
+
isEditCallTask = slidBoxContent === 'editTemplate' && channel === constants.CALL_TASK;
|
|
73
|
+
isEditMPush = slidBoxContent === 'editTemplate' && channel === constants.MOBILE_PUSH;
|
|
74
|
+
isEditEmailWithId = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && templateData._id;
|
|
75
|
+
isEmailEditWithContent = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && !templateData._id;
|
|
76
|
+
isPreview = slidBoxContent === 'preview' && channel === constants.SMS;
|
|
77
|
+
isEmailPreview = slidBoxContent === 'preview' && channel === constants.EMAIL;
|
|
78
|
+
isMpushPreview = slidBoxContent === 'preview' && channel === constants.MOBILE_PUSH;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<CreativesWrapper>
|
|
83
|
+
{!isFullMode && slidBoxContent === 'templates' && (
|
|
84
|
+
<TemplatesV2
|
|
85
|
+
isFullMode={isFullMode}
|
|
86
|
+
onSelectTemplate={onSelectTemplate}
|
|
87
|
+
handlePeviewTemplate={onPreviewTemplate}
|
|
88
|
+
location={location}
|
|
89
|
+
createNew={onCreateNew}
|
|
90
|
+
channel={channel.toLowerCase()}
|
|
91
|
+
onChannelChange={onChannelChange}
|
|
92
|
+
onCallTaskSubmit={onCallTaskSubmit}
|
|
93
|
+
cap={cap}
|
|
94
|
+
/>
|
|
95
|
+
)}
|
|
96
|
+
{isPreview && (
|
|
97
|
+
<TemplatePreview
|
|
98
|
+
content={templateData.versions.base['sms-editor']}
|
|
99
|
+
channel={templateData.type.toLowerCase()}
|
|
100
|
+
charCounterEnabled
|
|
101
|
+
templateData={templateData}
|
|
102
|
+
showCount
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
105
|
+
{isEmailPreview && (
|
|
106
|
+
<EmailPreviewV2
|
|
107
|
+
templateData={templateData}
|
|
108
|
+
/>
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
{isMpushPreview &&
|
|
112
|
+
<MobilePushPreview templateData={templateData} channel={channel}/>
|
|
113
|
+
}
|
|
114
|
+
{isEditSms && (
|
|
115
|
+
<SmsEdit
|
|
116
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
117
|
+
location={creativesLocationProps}
|
|
118
|
+
isFullMode={isFullMode}
|
|
119
|
+
route={{ name: 'sms' }}
|
|
120
|
+
params={{id: templateData._id}}
|
|
121
|
+
isGetFormData={isGetFormData}
|
|
122
|
+
getFormSubscriptionData={getFormData}
|
|
123
|
+
getDefaultTags={type}
|
|
124
|
+
templateData={templateData}
|
|
125
|
+
// subscriptionTemplateDetails={templateData} // used only in library mode
|
|
126
|
+
/>
|
|
127
|
+
)}
|
|
128
|
+
{
|
|
129
|
+
isEditCallTask &&
|
|
130
|
+
<CallTask
|
|
131
|
+
mode={'edit'}
|
|
132
|
+
templateData={templateData}
|
|
133
|
+
onCallTaskSubmit={onCallTaskSubmit}
|
|
134
|
+
/>
|
|
135
|
+
}
|
|
136
|
+
{
|
|
137
|
+
isCreateCallTask &&
|
|
138
|
+
<CallTask
|
|
139
|
+
mode={'create'}
|
|
140
|
+
onCallTaskSubmit={onCallTaskSubmit}
|
|
141
|
+
/>
|
|
142
|
+
}
|
|
143
|
+
{isCreateSms && (
|
|
144
|
+
<SmsCreate
|
|
145
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
146
|
+
location={creativesLocationProps}
|
|
147
|
+
route={{ name: 'sms' }}
|
|
148
|
+
isComponent
|
|
149
|
+
isGetFormData={isGetFormData}
|
|
150
|
+
getFormSubscriptionData={getFormData}
|
|
151
|
+
getDefaultTags={type}
|
|
152
|
+
isFullMode={isFullMode}
|
|
153
|
+
/>
|
|
154
|
+
)}
|
|
155
|
+
{isEmailCreate && (
|
|
156
|
+
<EmailWrapper
|
|
157
|
+
key="creatives-email-wrapper"
|
|
158
|
+
date={new Date().getMilliseconds()}
|
|
159
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
160
|
+
onEmailModeChange={onEmailModeChange}
|
|
161
|
+
emailCreateMode={emailCreateMode}
|
|
162
|
+
isGetFormData={isGetFormData}
|
|
163
|
+
getFormdata={getFormData}
|
|
164
|
+
templateData={templateData}
|
|
165
|
+
type={type}
|
|
166
|
+
step={templateStep}
|
|
167
|
+
showNextStep={onCreateNextStep}
|
|
168
|
+
isFullMode={isFullMode}
|
|
169
|
+
cap={cap}
|
|
170
|
+
onResetStep={onResetStep}
|
|
171
|
+
showTemplateName={showTemplateName}
|
|
172
|
+
/>
|
|
173
|
+
)}
|
|
174
|
+
{(isEditEmailWithId || isEmailEditWithContent) && (
|
|
175
|
+
<Email
|
|
176
|
+
key="cretives-container-email-edit"
|
|
177
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
178
|
+
location={{
|
|
179
|
+
pathname: `/email/edit`,
|
|
180
|
+
query: { type: 'embedded', module: 'library'},
|
|
181
|
+
}}
|
|
182
|
+
route={{ name: 'email' }}
|
|
183
|
+
isGetFormData={isGetFormData}
|
|
184
|
+
getFormdata={getFormData}
|
|
185
|
+
params={{ id: templateData._id }}
|
|
186
|
+
templateData={templateData}
|
|
187
|
+
getFormSubscriptionData={getFormData}
|
|
188
|
+
getDefaultTags={type}
|
|
189
|
+
isFullMode={isFullMode}
|
|
190
|
+
cap={cap}
|
|
191
|
+
showTemplateName={showTemplateName}
|
|
192
|
+
/>
|
|
193
|
+
)}
|
|
194
|
+
{isEditMPush &&
|
|
195
|
+
<MobliPushEdit
|
|
196
|
+
getFormLibraryData={getFormData}
|
|
197
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
198
|
+
location={{
|
|
199
|
+
pathname: `/mobilepush/edit/`,
|
|
200
|
+
query,
|
|
201
|
+
}}
|
|
202
|
+
params={{id: templateData._id}}
|
|
203
|
+
isFullMode={isFullMode}
|
|
204
|
+
isGetFormData={isGetFormData}
|
|
205
|
+
route={{ name: 'mobilepush' }}
|
|
206
|
+
templateData={templateData}
|
|
207
|
+
showTemplateName={showTemplateName}
|
|
208
|
+
/>
|
|
209
|
+
}
|
|
210
|
+
{isCreateMPush &&
|
|
211
|
+
<MobilepushWrapper
|
|
212
|
+
key="creatives-mobilepush-wrapper"
|
|
213
|
+
date={new Date().getMilliseconds()}
|
|
214
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
215
|
+
onMobilepushModeChange={onMobilepushModeChange}
|
|
216
|
+
mobilePushCreateMode={mobilePushCreateMode}
|
|
217
|
+
isGetFormData={isGetFormData}
|
|
218
|
+
getFormData={getFormData}
|
|
219
|
+
templateData={templateData}
|
|
220
|
+
type={type}
|
|
221
|
+
step={templateStep}
|
|
222
|
+
showNextStep={onCreateNextStep}
|
|
223
|
+
isFullMode={isFullMode}
|
|
224
|
+
cap={cap}
|
|
225
|
+
onResetStep={onResetStep}
|
|
226
|
+
showTemplateName={showTemplateName}
|
|
227
|
+
query={query}/>
|
|
228
|
+
}
|
|
229
|
+
</CreativesWrapper>
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
SlideBoxContent.propTypes = {
|
|
233
|
+
slidBoxContent: PropTypes.node,
|
|
234
|
+
onSelectTemplate: PropTypes.func,
|
|
235
|
+
onPreviewTemplate: PropTypes.func,
|
|
236
|
+
templateData: PropTypes.object,
|
|
237
|
+
location: PropTypes.object,
|
|
238
|
+
isGetFormData: PropTypes.bool,
|
|
239
|
+
getFormData: PropTypes.func,
|
|
240
|
+
messageDetails: PropTypes.object,
|
|
241
|
+
onCreateNew: PropTypes.func,
|
|
242
|
+
onChannelChange: PropTypes.func,
|
|
243
|
+
currentChannel: PropTypes.string,
|
|
244
|
+
onEmailModeChange: PropTypes.func,
|
|
245
|
+
emailCreateMode: PropTypes.string,
|
|
246
|
+
templateStep: PropTypes.string,
|
|
247
|
+
onCreateNextStep: PropTypes.func,
|
|
248
|
+
cap: PropTypes.object,
|
|
249
|
+
onResetStep: PropTypes.func,
|
|
250
|
+
onCallTaskSubmit: PropTypes.func,
|
|
251
|
+
isFullMode: PropTypes.bool,
|
|
252
|
+
setIsLoadingContent: PropTypes.func,
|
|
253
|
+
onMobilepushModeChange: PropTypes.func,
|
|
254
|
+
mobilePushCreateMode: PropTypes.string,
|
|
255
|
+
showTemplateName: PropTypes.func,
|
|
256
|
+
};
|
|
257
|
+
export default SlideBoxContent;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormattedMessage } from 'react-intl';
|
|
3
|
+
import { CapButton } from '@capillarytech/cap-ui-library';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import messages from './messages';
|
|
6
|
+
function SlideBoxFooter(props) {
|
|
7
|
+
const { slidBoxContent, onSave, onEditTemplate, onCreateNextStep, isFullMode} = props;
|
|
8
|
+
return (
|
|
9
|
+
<div>
|
|
10
|
+
<div>
|
|
11
|
+
{props.shouldShowDoneFooter() && (
|
|
12
|
+
<div>
|
|
13
|
+
<CapButton onClick={onSave}>
|
|
14
|
+
{isFullMode ?
|
|
15
|
+
<FormattedMessage {...messages.creativesTemplatesSaveFullMode}/>
|
|
16
|
+
:
|
|
17
|
+
<FormattedMessage {...messages.creativesTemplatesSave} />
|
|
18
|
+
}
|
|
19
|
+
</CapButton>
|
|
20
|
+
{/* {isFullMode && <CapButton type="secondary" onClick={onDiscard}><FormattedMessage {...messages.creativesTemplatesDiscard}/></CapButton>} */}
|
|
21
|
+
</div>)}
|
|
22
|
+
{props.shouldShowContinueFooter() &&
|
|
23
|
+
<CapButton onClick={onCreateNextStep}>
|
|
24
|
+
<FormattedMessage {...messages.continue} />
|
|
25
|
+
</CapButton>
|
|
26
|
+
}
|
|
27
|
+
{slidBoxContent === 'preview' && (
|
|
28
|
+
<CapButton onClick={onEditTemplate} type="secondary">
|
|
29
|
+
<FormattedMessage {...messages.creativesTemplatesEdit} />
|
|
30
|
+
</CapButton>
|
|
31
|
+
)}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
SlideBoxFooter.propTypes = {
|
|
37
|
+
slidBoxContent: PropTypes.node,
|
|
38
|
+
onSave: PropTypes.func,
|
|
39
|
+
onEditTemplate: PropTypes.func,
|
|
40
|
+
onCreateNextStep: PropTypes.func,
|
|
41
|
+
shouldShowContinueFooter: PropTypes.func,
|
|
42
|
+
shouldShowDoneFooter: PropTypes.func,
|
|
43
|
+
isFullMode: PropTypes.bool,
|
|
44
|
+
};
|
|
45
|
+
export default SlideBoxFooter;
|