@capillarytech/creatives-library 2.0.70 → 2.0.72
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/EmailMobilePreview/index.scss +0 -1
- package/components/EmailPreviewV2/_emailPreviewV2.scss +4 -1
- package/components/EmailPreviewV2/index.js +1 -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/config/app.js +1 -0
- 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 +1851 -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 +1725 -0
- package/v2Containers/Templates/messages.js +278 -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,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { FormattedMessage } from 'react-intl';
|
|
4
|
+
import { CapHeader, CapIcons, CapLabel } from '@capillarytech/cap-ui-library';
|
|
5
|
+
import moment from 'moment';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import messages from './messages';
|
|
8
|
+
const PrefixWrapper = styled.div`
|
|
9
|
+
margin-right: 16px;
|
|
10
|
+
`;
|
|
11
|
+
function SlideBoxHeader(props) {
|
|
12
|
+
const { slidBoxContent, templateData, onShowTemplates, creativesMode, isFullMode, showPrefix, showTemplateName } = props;
|
|
13
|
+
const TemplateName = isFullMode && showTemplateName;
|
|
14
|
+
return (
|
|
15
|
+
<div key="creatives-container-slidebox-header-content">
|
|
16
|
+
{slidBoxContent === 'templates' && !TemplateName && (
|
|
17
|
+
<CapHeader
|
|
18
|
+
title={<FormattedMessage {...messages.creativeTemplates} />}
|
|
19
|
+
description={
|
|
20
|
+
<FormattedMessage {...messages.creativeTemplatesDesc} />
|
|
21
|
+
}
|
|
22
|
+
/>
|
|
23
|
+
)}
|
|
24
|
+
{TemplateName && <TemplateName/>}
|
|
25
|
+
{slidBoxContent === 'preview' && (
|
|
26
|
+
<CapHeader
|
|
27
|
+
title={templateData.name}
|
|
28
|
+
description={<CapLabel type="label3">
|
|
29
|
+
<FormattedMessage {...messages.lastUpdated}/>{moment(templateData.updatedAt).format('DD MMM YYYY')} <FormattedMessage {...messages.by}/>{templateData.updatedByName}
|
|
30
|
+
</CapLabel>}
|
|
31
|
+
prefix={!isFullMode &&
|
|
32
|
+
<PrefixWrapper>
|
|
33
|
+
<CapIcons.backIcon onClick={onShowTemplates} />
|
|
34
|
+
</PrefixWrapper>
|
|
35
|
+
}
|
|
36
|
+
/>
|
|
37
|
+
)}
|
|
38
|
+
{!TemplateName && slidBoxContent === 'editTemplate' && (
|
|
39
|
+
<CapHeader
|
|
40
|
+
title={<FormattedMessage {...messages.editMessageContent} />}
|
|
41
|
+
prefix={creativesMode !== 'edit' && !isFullMode && showPrefix &&
|
|
42
|
+
<PrefixWrapper>
|
|
43
|
+
<CapIcons.backIcon onClick={onShowTemplates} />
|
|
44
|
+
</PrefixWrapper>
|
|
45
|
+
}
|
|
46
|
+
/>
|
|
47
|
+
)}
|
|
48
|
+
{!TemplateName && slidBoxContent === 'createTemplate' && (
|
|
49
|
+
<CapHeader
|
|
50
|
+
title={<FormattedMessage {...messages.createMessageContent} />}
|
|
51
|
+
prefix={!isFullMode && showPrefix &&
|
|
52
|
+
<PrefixWrapper>
|
|
53
|
+
<CapIcons.backIcon onClick={onShowTemplates} />
|
|
54
|
+
</PrefixWrapper>
|
|
55
|
+
}
|
|
56
|
+
/>
|
|
57
|
+
)}
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
SlideBoxHeader.propTypes = {
|
|
62
|
+
slidBoxContent: PropTypes.node,
|
|
63
|
+
templateData: PropTypes.object,
|
|
64
|
+
onShowTemplates: PropTypes.func,
|
|
65
|
+
creativesMode: PropTypes.string,
|
|
66
|
+
isFullMode: PropTypes.bool,
|
|
67
|
+
showPrefix: PropTypes.bool,
|
|
68
|
+
showTemplateName: PropTypes.func,
|
|
69
|
+
};
|
|
70
|
+
export default SlideBoxHeader;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* CreativesContainer actions
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
DEFAULT_ACTION,
|
|
9
|
+
HIDE_CONTAINER_LOADER,
|
|
10
|
+
SHOW_CONTANER_LOADER,
|
|
11
|
+
} from './constants';
|
|
12
|
+
|
|
13
|
+
export function defaultAction() {
|
|
14
|
+
return {
|
|
15
|
+
type: DEFAULT_ACTION,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function showCreativesContainerLoader() {
|
|
19
|
+
return {
|
|
20
|
+
type: SHOW_CONTANER_LOADER,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function hideCreativesContanerLoader() {
|
|
24
|
+
return {
|
|
25
|
+
type: HIDE_CONTAINER_LOADER,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* CreativesContainer constants
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const DEFAULT_ACTION = 'app/CreativesContainer/DEFAULT_ACTION';
|
|
8
|
+
export const EMAIL = "EMAIL";
|
|
9
|
+
export const SMS = "SMS";
|
|
10
|
+
export const EBILL = "EBILL";
|
|
11
|
+
export const LINE = "LINE";
|
|
12
|
+
export const CALL_TASK = "CALL_TASK";
|
|
13
|
+
export const MOBILE_PUSH = "MOBILEPUSH";
|
|
14
|
+
export const WECHAT = "WECHAT";
|
|
15
|
+
export const SHOW_CONTANER_LOADER = "app/CreativesContainer/SHOW_CONTANER_LOADER";
|
|
16
|
+
export const HIDE_CONTAINER_LOADER = "app/CreativesContainer/HIDE_CONTAINER_LOADER";
|
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import {
|
|
4
|
+
CapSlideBox, CapHeader, CapLink, CapInput,
|
|
5
|
+
} from '@capillarytech/cap-ui-library';
|
|
6
|
+
import { injectIntl, FormattedMessage } from 'react-intl';
|
|
7
|
+
import classnames from 'classnames';
|
|
8
|
+
import {isEmpty, get, forEach} from 'lodash';
|
|
9
|
+
import { connect } from 'react-redux';
|
|
10
|
+
import { createStructuredSelector } from 'reselect';
|
|
11
|
+
import { bindActionCreators } from 'redux';
|
|
12
|
+
import styled from 'styled-components';
|
|
13
|
+
|
|
14
|
+
import * as actions from './actions';
|
|
15
|
+
import {selectEmailLayout, uploadSelector, templateUserList} from '../Templates/selectors';
|
|
16
|
+
import SlideBoxContent from './SlideBoxContent';
|
|
17
|
+
import SlideBoxHeader from './SlideBoxHeader';
|
|
18
|
+
import SlideBoxFooter from './SlideBoxFooter';
|
|
19
|
+
import * as constants from './constants';
|
|
20
|
+
import * as commonUtil from '../../utils/common';
|
|
21
|
+
|
|
22
|
+
import './index.scss';
|
|
23
|
+
import * as templateActions from '../Templates/actions';
|
|
24
|
+
import * as globalActions from '../Cap/actions';
|
|
25
|
+
import {isLoading as isLoadingSelector} from './selectors';
|
|
26
|
+
import messages from './messages';
|
|
27
|
+
const classPrefix = 'add-creatives-section';
|
|
28
|
+
|
|
29
|
+
const SlideBoxWrapper = styled.div`
|
|
30
|
+
.cap-slide-box-v2-container{
|
|
31
|
+
.slidebox-header, .slidebox-content-container, .slidebox-footer{
|
|
32
|
+
padding: 0 32px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
class Creatives extends React.Component {
|
|
37
|
+
constructor(props) {
|
|
38
|
+
super(props);
|
|
39
|
+
this.state = {
|
|
40
|
+
isLoadingContent: true,
|
|
41
|
+
templateStep: 1, //modeSelection: for template name and (for email selecting upload or editor), and createTemplate to create template create based on modeSelection
|
|
42
|
+
showSlideBox: true,
|
|
43
|
+
slidBoxContent: this.getSlideBocContent({mode: props.creativesMode, templateData: props.templateData, isFullMode: props.isFullMode}),
|
|
44
|
+
templateData: this.getTemplateData(props.templateData),
|
|
45
|
+
currentChannel: this.props.channel || 'sms',
|
|
46
|
+
};
|
|
47
|
+
this.creativesTemplateSteps = {
|
|
48
|
+
1: 'modeSelection',
|
|
49
|
+
2: 'templateSelection', // only for email in current flows wil be used for mpush, line and wechat as well.
|
|
50
|
+
3: 'createTemplateContent',
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
componentWillUnmount() {
|
|
54
|
+
if (!this.props.isFullMode) {
|
|
55
|
+
this.props.templateActions.resetTemplateStoreData();
|
|
56
|
+
this.props.globalActions.clearMetaEntities();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
onSelectTemplate = (template) => {
|
|
62
|
+
this.setState({ slidBoxContent: 'editTemplate', templateData: template });
|
|
63
|
+
};
|
|
64
|
+
onPreviewTemplate = (template) => {
|
|
65
|
+
const templateData = template;
|
|
66
|
+
const usersList = commonUtil.getMergedUserList(this.props.templateUserList);
|
|
67
|
+
const userId = parseInt(template.updatedBy, 10);
|
|
68
|
+
templateData.updatedByName = commonUtil.getUserNameById(userId, usersList );
|
|
69
|
+
this.setState({ slidBoxContent: 'preview', templateData });
|
|
70
|
+
};
|
|
71
|
+
onEditTemplate = () => {
|
|
72
|
+
this.setState({ slidBoxContent: 'editTemplate', showSlideBox: true });
|
|
73
|
+
};
|
|
74
|
+
onCreateNew = () => {
|
|
75
|
+
this.setState({ slidBoxContent: 'createTemplate', showSlideBox: true });
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
onShowTemplates = () => {
|
|
79
|
+
this.setState({ slidBoxContent: 'templates', showSlideBox: true, isGetFormData: false });
|
|
80
|
+
};
|
|
81
|
+
onChannelChange = (channel) => {
|
|
82
|
+
this.setState({currentChannel: channel});
|
|
83
|
+
}
|
|
84
|
+
onCreateNextStep = () => {
|
|
85
|
+
this.setState((prevState) => {
|
|
86
|
+
let templateStep = prevState.templateStep + 1;
|
|
87
|
+
const {emailCreateMode, currentChannel} = prevState;
|
|
88
|
+
if ((currentChannel.toUpperCase() === constants.EMAIL && emailCreateMode === "upload") || currentChannel.toUpperCase() === constants.MOBILE_PUSH) {
|
|
89
|
+
templateStep = prevState.templateStep + 2;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
templateStep,
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
onEmailModeChange = (mode) => {
|
|
99
|
+
this.setState({ emailCreateMode: mode});
|
|
100
|
+
}
|
|
101
|
+
onMobilepushModeChange = (mode) => {
|
|
102
|
+
this.setState({ mobilePushCreateMode: mode});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
onCallTaskSubmit = (data) => {
|
|
106
|
+
this.props.getCreativesData({
|
|
107
|
+
channel: 'CALL_TASK',
|
|
108
|
+
...data,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
getTemplateData = (templateData) => { //from consumers to creatives
|
|
113
|
+
const {isFullMode} = this.props;
|
|
114
|
+
if (!isFullMode && templateData) { // for component mode
|
|
115
|
+
const {channel} = templateData;
|
|
116
|
+
let creativesTeplateData = {type: channel };
|
|
117
|
+
if (channel === constants.SMS) {
|
|
118
|
+
const formData = {
|
|
119
|
+
"sms-editor": templateData.messageBody,
|
|
120
|
+
};
|
|
121
|
+
creativesTeplateData = {
|
|
122
|
+
type: channel,
|
|
123
|
+
name: "Campaign message SMS content",
|
|
124
|
+
versions: {
|
|
125
|
+
base: formData,
|
|
126
|
+
history: [formData],
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
} else if (channel === constants.EMAIL) {
|
|
130
|
+
const formData = {
|
|
131
|
+
subject: templateData.emailSubject,
|
|
132
|
+
html_content: templateData.emailBody,
|
|
133
|
+
is_drag_drop: templateData.is_drag_drop,
|
|
134
|
+
lang_id: templateData.lang_id,
|
|
135
|
+
iso_code: templateData.iso_code,
|
|
136
|
+
language: templateData.language,
|
|
137
|
+
drag_drop_id: templateData.drag_drop_id,
|
|
138
|
+
};
|
|
139
|
+
creativesTeplateData = {
|
|
140
|
+
base: formData,
|
|
141
|
+
edit: true,
|
|
142
|
+
type: channel,
|
|
143
|
+
};
|
|
144
|
+
} else if (channel === constants.CALL_TASK) {
|
|
145
|
+
creativesTeplateData = {
|
|
146
|
+
subject: templateData.subject,
|
|
147
|
+
messageBody: templateData.messageBody,
|
|
148
|
+
description: templateData.description,
|
|
149
|
+
edit: true,
|
|
150
|
+
type: channel,
|
|
151
|
+
};
|
|
152
|
+
} else if (channel === constants.MOBILE_PUSH) {
|
|
153
|
+
const mode = get(templateData, 'androidContent.type') || get(templateData, 'iosContent.type');
|
|
154
|
+
creativesTeplateData = {
|
|
155
|
+
type: channel,
|
|
156
|
+
name: templateData.messageSubject,
|
|
157
|
+
versions: {
|
|
158
|
+
base: {
|
|
159
|
+
ANDROID: templateData.androidContent,
|
|
160
|
+
IOS: templateData.iosContent,
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
definition: {accountId: templateData.accountId, mode: mode.toLowerCase()},
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
return creativesTeplateData;
|
|
167
|
+
}
|
|
168
|
+
return templateData || null;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
getCreativesData = (channel, template) => { //from creatives to consumers
|
|
172
|
+
let templateData = {channel };
|
|
173
|
+
if (channel === constants.SMS && template.value.base) {
|
|
174
|
+
templateData.messageBody = template.value.base['sms-editor'];
|
|
175
|
+
} else if (channel === constants.EMAIL && template.value.base) {
|
|
176
|
+
const emailBase = template.value.base;
|
|
177
|
+
templateData = {...templateData, ...emailBase, emailBody: emailBase.html_content, emailSubject: emailBase.subject};
|
|
178
|
+
delete templateData.html_content;
|
|
179
|
+
delete templateData.subject;
|
|
180
|
+
} else if (channel === constants.MOBILE_PUSH && get(template, "value.versions.base")) {
|
|
181
|
+
const mobilpushTemplate = template.value;
|
|
182
|
+
templateData.accountId = get(mobilpushTemplate, 'definition.accountId');
|
|
183
|
+
const androidContent = get(mobilpushTemplate, 'versions.base.ANDROID');
|
|
184
|
+
if (!isEmpty(androidContent)) {
|
|
185
|
+
delete androidContent.cuid;
|
|
186
|
+
delete androidContent.luid;
|
|
187
|
+
delete androidContent.communicationId;
|
|
188
|
+
const custom = {};
|
|
189
|
+
forEach(androidContent.custom, (customKeyValue) => {
|
|
190
|
+
custom[customKeyValue.key] = customKeyValue.value;
|
|
191
|
+
} );
|
|
192
|
+
androidContent.custom = custom;
|
|
193
|
+
templateData.androidContent = androidContent;
|
|
194
|
+
templateData.androidContent.type = get(mobilpushTemplate, 'definition.mode').toUpperCase();
|
|
195
|
+
templateData.androidContent.deviceType = 'ANDROID';
|
|
196
|
+
}
|
|
197
|
+
const iosContent = get(mobilpushTemplate, 'versions.base.IOS');
|
|
198
|
+
if (!isEmpty(iosContent)) {
|
|
199
|
+
delete iosContent.cuid;
|
|
200
|
+
delete iosContent.luid;
|
|
201
|
+
delete iosContent.communicationId;
|
|
202
|
+
const custom = {};
|
|
203
|
+
forEach(iosContent.custom, (customKeyValue) => {
|
|
204
|
+
custom[customKeyValue.key] = customKeyValue.value;
|
|
205
|
+
} );
|
|
206
|
+
iosContent.custom = custom;
|
|
207
|
+
templateData.iosContent = iosContent;
|
|
208
|
+
templateData.iosContent.type = get(mobilpushTemplate, 'definition.mode').toUpperCase();
|
|
209
|
+
templateData.iosContent.deviceType = 'IOS';
|
|
210
|
+
}
|
|
211
|
+
templateData.messageSubject = mobilpushTemplate.name;
|
|
212
|
+
}
|
|
213
|
+
return templateData;
|
|
214
|
+
};
|
|
215
|
+
getSlideBocContent({mode, templateData, isFullMode}) {
|
|
216
|
+
let creativesMode = isFullMode ? 'createTemplate' : 'templates';// for library mode templates page is initial mode and for full mode createTemplates
|
|
217
|
+
if (mode === 'create' && isFullMode) {
|
|
218
|
+
creativesMode = 'createTemplate';
|
|
219
|
+
} else if (mode === 'create' && isEmpty(templateData)) {
|
|
220
|
+
creativesMode = 'templates';
|
|
221
|
+
} else if (mode === 'edit') {
|
|
222
|
+
creativesMode = 'editTemplate';
|
|
223
|
+
} else if (mode === 'preview' && isFullMode) {
|
|
224
|
+
creativesMode = 'preview';
|
|
225
|
+
}
|
|
226
|
+
return creativesMode;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
getFormData = (template) => {
|
|
230
|
+
if (template.validity) {
|
|
231
|
+
this.setState(
|
|
232
|
+
{
|
|
233
|
+
isGetFormData: false,
|
|
234
|
+
},
|
|
235
|
+
() => {
|
|
236
|
+
const templateData = this.state.templateData ? this.state.templateData : template; //select existing or create new content
|
|
237
|
+
const channel = templateData.type;
|
|
238
|
+
const creativesData = this.getCreativesData(channel, template);// convers data to consumer understandable format
|
|
239
|
+
this.props.getCreativesData(creativesData);// send data to consumer
|
|
240
|
+
},
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
setIsLoadingContent = (isLoadingContent) => {
|
|
245
|
+
if (this.state.isLoadingContent !== isLoadingContent) {
|
|
246
|
+
this.setState({isLoadingContent });
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
resetStep = () => {
|
|
250
|
+
this.setState((prevState) => {
|
|
251
|
+
let newState = {
|
|
252
|
+
templateStep: 1,
|
|
253
|
+
};
|
|
254
|
+
if (prevState.currentChannel.toUpperCase() === constants.EMAIL) {
|
|
255
|
+
newState = { ...newState, emailCreateMode: null };
|
|
256
|
+
}
|
|
257
|
+
return newState;
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
handleCloseSlideBox = () => {
|
|
261
|
+
this.setState((prevState) => ({
|
|
262
|
+
...prevState,
|
|
263
|
+
templateData: undefined,
|
|
264
|
+
showSlideBox: false,
|
|
265
|
+
}), this.props.handleCloseCreatives);
|
|
266
|
+
};
|
|
267
|
+
saveMessage = () => {
|
|
268
|
+
this.setState({ isGetFormData: true });
|
|
269
|
+
};
|
|
270
|
+
discardMessage = () => {
|
|
271
|
+
this.setState({ isDiscardMessage: true });
|
|
272
|
+
}
|
|
273
|
+
shouldShowFooter = () => {
|
|
274
|
+
const {isFullMode } = this.props;
|
|
275
|
+
const {slidBoxContent, currentChannel, emailCreateMode, templateStep, mobilePushCreateMode} = this.state;
|
|
276
|
+
const channel = currentChannel.toUpperCase();
|
|
277
|
+
const currentStep = this.creativesTemplateSteps[templateStep];
|
|
278
|
+
let showFooter = false;
|
|
279
|
+
showFooter = isFullMode && slidBoxContent === "preview";
|
|
280
|
+
const isMobilepush = channel === constants.MOBILE_PUSH;
|
|
281
|
+
if (!isFullMode ) {
|
|
282
|
+
const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL && currentStep !== 'createTemplateContent';
|
|
283
|
+
const isCreate = (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate') && !isEmailCreate;
|
|
284
|
+
const isCallTask = channel === constants.CALL_TASK;
|
|
285
|
+
showFooter = (isCreate || (isEmailCreate && emailCreateMode) || slidBoxContent === 'preview') && !isCallTask;
|
|
286
|
+
if (isMobilepush) {
|
|
287
|
+
showFooter = currentStep === "modeSelection" || (currentStep === 'createTemplateContent' && !isEmpty(mobilePushCreateMode));
|
|
288
|
+
}
|
|
289
|
+
} else if (channel === constants.EMAIL && isFullMode) {
|
|
290
|
+
const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL && currentStep !== 'createTemplateContent';
|
|
291
|
+
showFooter = isEmailCreate && emailCreateMode;
|
|
292
|
+
}
|
|
293
|
+
if (channel === constants.EMAIL && emailCreateMode === "upload") {
|
|
294
|
+
showFooter = showFooter && !this.props.isUploading;
|
|
295
|
+
}
|
|
296
|
+
if (slidBoxContent === 'createTemplate' && channel === constants.EMAIL && emailCreateMode && currentStep === 'createTemplateContent') { // full mode create flow email
|
|
297
|
+
showFooter = true;
|
|
298
|
+
}
|
|
299
|
+
if (slidBoxContent === "editTemplate" && ((channel === constants.EMAIL && currentStep === 'modeSelection'))) {
|
|
300
|
+
showFooter = true;
|
|
301
|
+
}
|
|
302
|
+
if (channel === constants.MOBILE_PUSH && ((slidBoxContent === 'createTemplate' && !isEmpty(mobilePushCreateMode)) || (slidBoxContent === 'editTemplate' && currentStep === 'modeSelection'))) {
|
|
303
|
+
showFooter = true;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
if (showFooter) {
|
|
308
|
+
if (slidBoxContent === "createTemplate" && ((channel === constants.EMAIL && currentStep === 'createTemplateContent') || (channel === constants.SMS && currentStep === 'modeSelection'))) {
|
|
309
|
+
showFooter = showFooter && !this.state.isLoadingContent;
|
|
310
|
+
} else if (slidBoxContent === "editTemplate" && ((channel === constants.EMAIL && currentStep === 'modeSelection') || (channel === constants.SMS && currentStep === 'modeSelection'))) {
|
|
311
|
+
showFooter = showFooter && !this.state.isLoadingContent;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return showFooter;
|
|
315
|
+
}
|
|
316
|
+
shouldShowDoneFooter = () => {
|
|
317
|
+
const {slidBoxContent, templateStep, currentChannel} = this.state;
|
|
318
|
+
const currentStep = this.creativesTemplateSteps[templateStep];
|
|
319
|
+
let showDone = false;
|
|
320
|
+
const channel = currentChannel.toUpperCase();
|
|
321
|
+
if (channel === constants.EMAIL || channel === constants.SMS) {
|
|
322
|
+
const isEmailCreate = slidBoxContent === 'createTemplate' && currentChannel.toUpperCase() === constants.EMAIL && currentStep !== 'createTemplateContent';
|
|
323
|
+
showDone = (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate') && !isEmailCreate;
|
|
324
|
+
} else if (channel === constants.MOBILE_PUSH) {
|
|
325
|
+
showDone = currentStep === "createTemplateContent" || slidBoxContent === "editTemplate";
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
return showDone;
|
|
329
|
+
}
|
|
330
|
+
showTemplateName = ({formData, onFormDataChange}) => { //gets called from email/index after template data is fetched
|
|
331
|
+
const {slidBoxContent, currentChannel, isEditName} = this.state;
|
|
332
|
+
const channel = currentChannel.toUpperCase();
|
|
333
|
+
if ((channel === constants.EMAIL || channel === constants.MOBILE_PUSH) && (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate')) {
|
|
334
|
+
const name = get(formData, 'template-name');
|
|
335
|
+
if (name && !isEditName) {
|
|
336
|
+
const TemplateNameComponent = () => (
|
|
337
|
+
<CapHeader
|
|
338
|
+
inline
|
|
339
|
+
title={name}
|
|
340
|
+
description={<CapLink
|
|
341
|
+
title={<FormattedMessage {...messages.creativesTemplatesEditName}/>}
|
|
342
|
+
onClick={() => { this.setState({isEditName: true}, () => { this.showTemplateName({formData, onFormDataChange}); }); }}/>
|
|
343
|
+
}/>);
|
|
344
|
+
this.setState({templateNameComponent: TemplateNameComponent});
|
|
345
|
+
} else if (isEditName) {
|
|
346
|
+
const TemplateNameComponent = () => (<CapInput
|
|
347
|
+
key="cap-input-template-name"
|
|
348
|
+
value={name}
|
|
349
|
+
suffix={<span/>}
|
|
350
|
+
onBlur={() => { this.setState({isEditName: false}, () => { this.showTemplateName({formData, onFormDataChange}); }); }}
|
|
351
|
+
onChange={(ev) => {
|
|
352
|
+
const value = ev.currentTarget.value;
|
|
353
|
+
const newFormData = {...formData, 'template-name': value};
|
|
354
|
+
onFormDataChange(newFormData);
|
|
355
|
+
}}
|
|
356
|
+
/>);
|
|
357
|
+
this.setState({templateNameComponent: TemplateNameComponent});
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
shouldShowContinueFooter = () => { // only for email for now, has to be modified according to channel
|
|
362
|
+
const {slidBoxContent, templateStep, currentChannel, emailCreateMode, mobilePushCreateMode} = this.state;
|
|
363
|
+
let isShowContinueFooter = false;
|
|
364
|
+
const currentStep = this.creativesTemplateSteps[templateStep];
|
|
365
|
+
const channel = currentChannel.toUpperCase();
|
|
366
|
+
if (channel === constants.EMAIL || channel === constants.SMS) {
|
|
367
|
+
if ((emailCreateMode === "upload" && !isEmpty(this.props.EmailLayout)) || emailCreateMode === "editor") {
|
|
368
|
+
let isEmailCreate = slidBoxContent === 'createTemplate';
|
|
369
|
+
isEmailCreate = currentChannel.toUpperCase() === constants.EMAIL && ((emailCreateMode === "upload" && currentStep !== 'createTemplateContent') || ( emailCreateMode === "editor" && currentStep !== 'createTemplateContent' && currentStep !== "templateSelection"));
|
|
370
|
+
isShowContinueFooter = isEmailCreate && emailCreateMode;
|
|
371
|
+
}
|
|
372
|
+
} else if (currentChannel.toUpperCase() === constants.MOBILE_PUSH) {
|
|
373
|
+
isShowContinueFooter = !isEmpty(mobilePushCreateMode) && currentStep === "modeSelection";
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
return isShowContinueFooter;
|
|
377
|
+
}
|
|
378
|
+
render() {
|
|
379
|
+
const {templateNameComponent, slidBoxContent, isGetFormData, showSlideBox, templateData, currentChannel, emailCreateMode, templateStep, isLoadingContent, mobilePushCreateMode, isDiscardMessage} = this.state;
|
|
380
|
+
const {isFullMode, creativesMode, cap, isUploading} = this.props;
|
|
381
|
+
return (
|
|
382
|
+
<SlideBoxWrapper className={classnames(`${classPrefix} ${isFullMode ? 'creatives-full-mode' : 'creatives-library-mode'}`)}>
|
|
383
|
+
<CapSlideBox
|
|
384
|
+
header={
|
|
385
|
+
<SlideBoxHeader
|
|
386
|
+
key="creatives-container-slidebox-header"
|
|
387
|
+
messages={this.props.messages}
|
|
388
|
+
slidBoxContent={this.state.slidBoxContent}
|
|
389
|
+
templateData={templateData}
|
|
390
|
+
onShowTemplates={this.onShowTemplates}
|
|
391
|
+
creativesMode={creativesMode}
|
|
392
|
+
isFullMode={isFullMode}
|
|
393
|
+
isLoadingContent={isLoadingContent}
|
|
394
|
+
showTemplateName={templateNameComponent}
|
|
395
|
+
showPrefix={!isUploading} // not show back button when email template is being uploaded
|
|
396
|
+
/>
|
|
397
|
+
}
|
|
398
|
+
content={
|
|
399
|
+
<SlideBoxContent
|
|
400
|
+
key="creatives-container-slidebox-content"
|
|
401
|
+
onSelectTemplate={this.onSelectTemplate}
|
|
402
|
+
onPreviewTemplate={this.onPreviewTemplate}
|
|
403
|
+
slidBoxContent={slidBoxContent}
|
|
404
|
+
templateData={templateData}
|
|
405
|
+
location={this.props.location}
|
|
406
|
+
messageDetails={this.props.messageDetails}
|
|
407
|
+
getFormData={this.getFormData}
|
|
408
|
+
onCallTaskSubmit={this.onCallTaskSubmit}
|
|
409
|
+
onCreateNew={this.onCreateNew}
|
|
410
|
+
isGetFormData={isGetFormData}
|
|
411
|
+
isDiscardMessage={isDiscardMessage}
|
|
412
|
+
isFullMode={isFullMode}
|
|
413
|
+
currentChannel={currentChannel.toUpperCase()}
|
|
414
|
+
onChannelChange={this.onChannelChange}
|
|
415
|
+
onEmailModeChange={this.onEmailModeChange}//used when create is clicked in email
|
|
416
|
+
emailCreateMode={emailCreateMode}// upload zip || use editor are values
|
|
417
|
+
templateStep={this.creativesTemplateSteps[templateStep]}
|
|
418
|
+
onCreateNextStep={this.onCreateNextStep}
|
|
419
|
+
onResetStep={this.resetStep}
|
|
420
|
+
cap={cap}
|
|
421
|
+
setIsLoadingContent={this.setIsLoadingContent}
|
|
422
|
+
onMobilepushModeChange={this.onMobilepushModeChange}
|
|
423
|
+
mobilePushCreateMode={mobilePushCreateMode}
|
|
424
|
+
showTemplateName={this.showTemplateName}
|
|
425
|
+
/>
|
|
426
|
+
}
|
|
427
|
+
footer={this.shouldShowFooter() &&
|
|
428
|
+
<SlideBoxFooter
|
|
429
|
+
isFullMode={isFullMode}
|
|
430
|
+
messages={this.props.messages}
|
|
431
|
+
onSave={this.saveMessage}
|
|
432
|
+
onDiscard={this.discardMessage}
|
|
433
|
+
onEditTemplate={this.onEditTemplate}
|
|
434
|
+
slidBoxContent={slidBoxContent}
|
|
435
|
+
onCreateNextStep={this.onCreateNextStep}
|
|
436
|
+
currentChannel={currentChannel.toUpperCase()}
|
|
437
|
+
templateStep={this.creativesTemplateSteps[templateStep]}
|
|
438
|
+
emailCreateMode={emailCreateMode}
|
|
439
|
+
shouldShowContinueFooter={this.shouldShowContinueFooter}
|
|
440
|
+
shouldShowDoneFooter={this.shouldShowDoneFooter}
|
|
441
|
+
/>
|
|
442
|
+
}
|
|
443
|
+
handleClose={this.handleCloseSlideBox}
|
|
444
|
+
show={showSlideBox}
|
|
445
|
+
size="size-l"
|
|
446
|
+
/>
|
|
447
|
+
</SlideBoxWrapper>
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
Creatives.propTypes = {
|
|
453
|
+
getCreativesData: PropTypes.func,
|
|
454
|
+
messages: PropTypes.object,
|
|
455
|
+
messageDetails: PropTypes.object,
|
|
456
|
+
creativesMode: PropTypes.string,
|
|
457
|
+
location: PropTypes.object,
|
|
458
|
+
handleCloseCreatives: PropTypes.func,
|
|
459
|
+
templateData: PropTypes.object,
|
|
460
|
+
isFullMode: PropTypes.bool,
|
|
461
|
+
channel: PropTypes.string,
|
|
462
|
+
templateActions: PropTypes.object,
|
|
463
|
+
globalActions: PropTypes.object,
|
|
464
|
+
cap: PropTypes.object,
|
|
465
|
+
// isLoading: PropTypes.bool,
|
|
466
|
+
templateUserList: PropTypes.array,
|
|
467
|
+
isUploading: PropTypes.bool,
|
|
468
|
+
EmailLayout: PropTypes.string,
|
|
469
|
+
};
|
|
470
|
+
const mapStatesToProps = () => createStructuredSelector({
|
|
471
|
+
isLoading: isLoadingSelector(),
|
|
472
|
+
templateUserList: templateUserList(),
|
|
473
|
+
EmailLayout: selectEmailLayout(),
|
|
474
|
+
isUploading: uploadSelector(),
|
|
475
|
+
});
|
|
476
|
+
function mapDispatchToProps(dispatch) {
|
|
477
|
+
return {
|
|
478
|
+
templateActions: bindActionCreators(templateActions, dispatch),
|
|
479
|
+
globalActions: bindActionCreators(globalActions, dispatch),
|
|
480
|
+
actions: bindActionCreators(actions, dispatch),
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
export default connect(mapStatesToProps, mapDispatchToProps)(injectIntl(Creatives));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@import '~@capillarytech/cap-ui-library/styles/_variables.scss';
|
|
2
|
+
|
|
3
|
+
$classPrefix: add-creatives-section;
|
|
4
|
+
|
|
5
|
+
.#{$classPrefix} {
|
|
6
|
+
&.creatives-library-mode{
|
|
7
|
+
.sms-create-container, .sms-email-container{
|
|
8
|
+
.ant-tabs-top-bar{
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
.#{$classPrefix}-footer {
|
|
14
|
+
position: absolute;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
left: 1px;
|
|
17
|
+
padding: 0 12px;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
height: 48px;
|
|
21
|
+
border-top: 1px solid $CAP_G07;
|
|
22
|
+
|
|
23
|
+
&.with-creative {
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|