@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
|
@@ -14,7 +14,7 @@ import { createStructuredSelector } from 'reselect';
|
|
|
14
14
|
import _ from 'lodash';
|
|
15
15
|
import { bindActionCreators } from 'redux';
|
|
16
16
|
import { makeSelectCreate, makeSelectCreateResponse } from './selectors';
|
|
17
|
-
import { makeSelectMetaEntities,
|
|
17
|
+
import { makeSelectMetaEntities, setInjectedTags } from '../../Cap/selectors';
|
|
18
18
|
import { UserIsAuthenticated } from '../../../utils/authWrapper';
|
|
19
19
|
import './_smsCreate.scss';
|
|
20
20
|
import FormBuilder from '../../../components/FormBuilder';
|
|
@@ -24,14 +24,11 @@ import * as charCount from '../../../utils/smsCharCount';
|
|
|
24
24
|
import {checkUnicode} from '../../../utils/smsCharCountV2';
|
|
25
25
|
import * as globalActions from '../../../containers/Cap/actions';
|
|
26
26
|
import {getMessageObject} from '../../../utils/messageUtils';
|
|
27
|
-
import * as creativesContainerActions from '../../CreativesContainer/actions';
|
|
28
|
-
// import callNativeEvent from '../../../utils/callNativeEvent';
|
|
29
27
|
|
|
30
28
|
export class Create extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
31
29
|
constructor(props) {
|
|
32
30
|
super(props);
|
|
33
31
|
this.state = {
|
|
34
|
-
loadingStatus: 0,
|
|
35
32
|
formData: {},
|
|
36
33
|
tabCount: 1,
|
|
37
34
|
currentTab: 1,
|
|
@@ -86,6 +83,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
86
83
|
}
|
|
87
84
|
|
|
88
85
|
componentWillMount() {
|
|
86
|
+
console.log('create mounting');
|
|
89
87
|
if (this.props.route.name === 'view') {
|
|
90
88
|
this.setState({loading: false});
|
|
91
89
|
// this.removeStandAlone();
|
|
@@ -93,6 +91,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
93
91
|
}
|
|
94
92
|
|
|
95
93
|
componentDidMount() {
|
|
94
|
+
console.log('added listener create,', this.props);
|
|
96
95
|
const query = {
|
|
97
96
|
layout: 'SMS',
|
|
98
97
|
type: 'LAYOUT',
|
|
@@ -126,14 +125,30 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
126
125
|
}
|
|
127
126
|
|
|
128
127
|
componentWillReceiveProps(nextProps) {
|
|
128
|
+
console.log('recieved props ', nextProps, this.props, this.state);
|
|
129
129
|
if (nextProps.location.query.module === 'library' && nextProps.isGetFormData) {
|
|
130
130
|
nextProps.getFormSubscriptionData(this.getFormData());
|
|
131
131
|
}
|
|
132
|
+
if (nextProps.createResponse && nextProps.createResponse.templateId) {
|
|
133
|
+
console.log('create response', nextProps.createResponse);
|
|
134
|
+
this.discardValues();
|
|
135
|
+
const message = getMessageObject('success', 'SMS Template Created Successfully', true);
|
|
136
|
+
this.props.globalActions.addMessageToQueue(message);
|
|
137
|
+
this.props.actions.clearCreateResponse();
|
|
138
|
+
const type = this.props.location.query.type;
|
|
139
|
+
const module = this.props.location.query.module ? this.props.location.query.module : 'default';
|
|
140
|
+
this.props.router.push({
|
|
141
|
+
pathname: `/sms/`,
|
|
142
|
+
query: type === 'embedded' ? {type: 'embedded', module} : {module},
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
132
146
|
if (nextProps.Create.createTemplateError && !_.isEqual(nextProps.Create.createTemplateError, this.props.Create.createTemplateError)) {
|
|
133
147
|
const message = getMessageObject('error', (nextProps.Create.createTemplateErrorMessage && nextProps.Create.createTemplateErrorMessage !== '') ? nextProps.Create.createTemplateErrorMessage : this.props.intl.formatMessage(messages.somethingWentWrong), true);
|
|
134
148
|
this.props.globalActions.addMessageToQueue(message);
|
|
135
149
|
}
|
|
136
150
|
if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && _.isEmpty(this.state.schema)) {
|
|
151
|
+
console.log('final schema is**', nextProps.metaEntities.layouts[0].definition);
|
|
137
152
|
this.injectEvents(nextProps.metaEntities.layouts[0].definition);
|
|
138
153
|
if (this.props.location.query.module !== 'library' || (this.props.location.query.module === 'library' && this.props.getDefaultTags)) {
|
|
139
154
|
const query = {
|
|
@@ -154,25 +169,24 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
154
169
|
}
|
|
155
170
|
|
|
156
171
|
componentWillUnmount() {
|
|
157
|
-
|
|
158
|
-
this.props.setIsLoadingContent(true); // setting isLoading of CreativesContainer so that slidebox foot can be hidden till content is loaded
|
|
159
|
-
}
|
|
172
|
+
console.log('removed listener create');
|
|
160
173
|
window.removeEventListener("message", this.handleFrameTasks);
|
|
161
174
|
}
|
|
162
175
|
|
|
163
|
-
onTemplateNameChange() {
|
|
164
|
-
|
|
176
|
+
onTemplateNameChange(name) {
|
|
177
|
+
console.log('Template name changed to ', name);
|
|
165
178
|
}
|
|
166
179
|
|
|
167
|
-
onTemplateContentChange() {
|
|
168
|
-
|
|
180
|
+
onTemplateContentChange(content) {
|
|
181
|
+
console.log('Template content changed to ', content);
|
|
169
182
|
}
|
|
170
183
|
|
|
171
|
-
onVersionNameChange( ) {
|
|
172
|
-
|
|
184
|
+
onVersionNameChange(data, versionIndex) {
|
|
185
|
+
console.log('version name changed to', data, versionIndex);
|
|
173
186
|
}
|
|
174
187
|
|
|
175
188
|
onFormDataChange(formData, tabCount, currentTab) {
|
|
189
|
+
console.log('Form data changed is ', formData, tabCount, currentTab);
|
|
176
190
|
this.setState({formData, tabCount});
|
|
177
191
|
if (currentTab) {
|
|
178
192
|
this.setState({currentTab});
|
|
@@ -180,42 +194,24 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
180
194
|
}
|
|
181
195
|
|
|
182
196
|
onTagSelect(data, currentTab) {
|
|
197
|
+
console.log('parent data tag', data, currentTab);
|
|
183
198
|
const editorId = currentTab > 1 ? `sms-editor${currentTab}` : 'sms-editor';
|
|
184
|
-
this.insertAtCursor(document.getElementById(editorId), `{{${data}}}
|
|
199
|
+
this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`);
|
|
185
200
|
document.getElementById(editorId).focus();
|
|
186
201
|
}
|
|
187
202
|
|
|
188
203
|
onTabChange(data) {
|
|
204
|
+
console.log('inside parent ontabchange', data, this.state);
|
|
189
205
|
this.setState({currentTab: data});
|
|
190
206
|
}
|
|
191
|
-
|
|
192
|
-
if (editResponse.templateId) {
|
|
193
|
-
this.resetSchema();
|
|
194
|
-
this.setState({
|
|
195
|
-
formData: {},
|
|
196
|
-
tabCount: 1,
|
|
197
|
-
currentTab: 1,
|
|
198
|
-
editData: {},
|
|
199
|
-
});
|
|
200
|
-
const message = getMessageObject('success', 'SMS Template Created Successfully', true);
|
|
201
|
-
this.props.globalActions.addMessageToQueue(message);
|
|
202
|
-
const module = this.props.location.query.module ? this.props.location.query.module : 'default';
|
|
203
|
-
const type = this.props.location.query.type;
|
|
204
|
-
if (this.props.isFullMode) {
|
|
205
|
-
this.props.getFormSubscriptionData({ value: editResponse.templateId, validity: true});
|
|
206
|
-
} else {
|
|
207
|
-
this.props.router.push({
|
|
208
|
-
pathname: `/sms/`,
|
|
209
|
-
query: type === 'embedded' ? {type: 'embedded', module} : {module},
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
207
|
+
|
|
214
208
|
getFormData(e, value) {
|
|
209
|
+
console.log('posting final result', this.state.formData);
|
|
215
210
|
const formData = _.cloneDeep(this.state.formData);
|
|
216
211
|
let baseData = {};
|
|
217
212
|
let versionIdx;
|
|
218
213
|
_.forEach(formData, (val, idx) => {
|
|
214
|
+
console.log('val', val);
|
|
219
215
|
if (val.base && idx !== 'base') {
|
|
220
216
|
baseData = val;
|
|
221
217
|
versionIdx = idx;
|
|
@@ -227,19 +223,17 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
227
223
|
}
|
|
228
224
|
const result = {};
|
|
229
225
|
result.base = baseData;
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
226
|
+
const msgObj = charCount.updateCharCount(baseData['sms-editor']);
|
|
227
|
+
result.base.msg_count = msgObj.msgCount;
|
|
228
|
+
console.log("Message Count", msgObj.msgCount);
|
|
234
229
|
const response = {
|
|
235
230
|
action: "getFormData",
|
|
236
231
|
value: result,
|
|
237
232
|
postAction: value || 'next',
|
|
238
233
|
validity: this.state.isFormValid,
|
|
239
|
-
type: 'SMS',
|
|
240
234
|
};
|
|
241
235
|
this.setState({checkValidation: true});
|
|
242
|
-
|
|
236
|
+
console.log('posting final result internal', response);
|
|
243
237
|
if (e) {
|
|
244
238
|
e.source.postMessage(JSON.stringify(response), e.origin);
|
|
245
239
|
}
|
|
@@ -247,6 +241,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
247
241
|
}
|
|
248
242
|
|
|
249
243
|
getCurrentWindow(e) {
|
|
244
|
+
console.log('in sms create', e);
|
|
250
245
|
const response = {
|
|
251
246
|
action: e.action,
|
|
252
247
|
value: 'edit',
|
|
@@ -336,6 +331,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
336
331
|
}
|
|
337
332
|
|
|
338
333
|
moveToTemplates() {
|
|
334
|
+
console.log('in move to Templates');
|
|
339
335
|
const modalContent = {
|
|
340
336
|
title: "Alert",
|
|
341
337
|
body: "Do you really want to go back? All your temporary changes will be lost!",
|
|
@@ -362,6 +358,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
362
358
|
}
|
|
363
359
|
|
|
364
360
|
injectEvents(schema) {
|
|
361
|
+
console.log('now injecting events');
|
|
365
362
|
const temp = schema;
|
|
366
363
|
temp.standalone.sections = this.injectSections(temp.standalone.sections);
|
|
367
364
|
_.forEach(temp.containers, (container) => {
|
|
@@ -369,8 +366,8 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
369
366
|
tempContainer = this.injectContainer(tempContainer);
|
|
370
367
|
return tempContainer;
|
|
371
368
|
});
|
|
372
|
-
|
|
373
|
-
this.setState({schema
|
|
369
|
+
console.log('final injected schema', schema);
|
|
370
|
+
this.setState({schema}, () => {
|
|
374
371
|
const type = this.props.location.query.type;
|
|
375
372
|
if (type === 'embedded') {
|
|
376
373
|
this.removeStandAlone();
|
|
@@ -408,9 +405,10 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
408
405
|
}
|
|
409
406
|
temp.injectedEvents = {};
|
|
410
407
|
_.forEach(col.supportedEvents, (event) => {
|
|
408
|
+
console.log('injected event for ', col, event, this.getMappedEvent(col.id, event));
|
|
411
409
|
temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
|
|
412
410
|
});
|
|
413
|
-
|
|
411
|
+
console.log('should translate multicol', temp);
|
|
414
412
|
if (temp.type === 'icon') {
|
|
415
413
|
return true;
|
|
416
414
|
}
|
|
@@ -441,7 +439,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
441
439
|
_.forEach(col.supportedEvents, (event) => {
|
|
442
440
|
temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
|
|
443
441
|
});
|
|
444
|
-
|
|
442
|
+
console.log('should translate multicol action', temp);
|
|
445
443
|
if (temp.type === 'icon') {
|
|
446
444
|
return true;
|
|
447
445
|
}
|
|
@@ -475,7 +473,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
475
473
|
_.forEach(inputField.supportedEvents, (event) => {
|
|
476
474
|
temp.injectedEvents[event] = this.getMappedEvent(inputField.id, event);
|
|
477
475
|
});
|
|
478
|
-
|
|
476
|
+
console.log('should translate collabel', temp);
|
|
479
477
|
if (temp.type === 'icon') {
|
|
480
478
|
return true;
|
|
481
479
|
}
|
|
@@ -504,7 +502,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
504
502
|
_.forEach(actionField.supportedEvents, (event) => {
|
|
505
503
|
temp.injectedEvents[event] = this.getMappedEvent(actionField.id, event);
|
|
506
504
|
});
|
|
507
|
-
|
|
505
|
+
console.log('should translate collabel action', temp);
|
|
508
506
|
if (temp.type === 'icon') {
|
|
509
507
|
return true;
|
|
510
508
|
}
|
|
@@ -554,6 +552,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
554
552
|
}
|
|
555
553
|
|
|
556
554
|
cloneColLabel(sectionObj, tabIndex) {
|
|
555
|
+
console.log('cloning cloneColLabel', sectionObj, tabIndex);
|
|
557
556
|
const section = _.cloneDeep(sectionObj);
|
|
558
557
|
const inputFields = _.forEach(section.inputFields, (inputField) => {
|
|
559
558
|
const inputF = inputField;
|
|
@@ -562,11 +561,12 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
562
561
|
return inputF;
|
|
563
562
|
});
|
|
564
563
|
section.inputFields = inputFields;
|
|
565
|
-
|
|
564
|
+
console.log('cloned ifs are', section);
|
|
566
565
|
return section;
|
|
567
566
|
}
|
|
568
567
|
|
|
569
568
|
cloneMultiCol(sectionObj, tabIndex) {
|
|
569
|
+
console.log('cloning multicol ', sectionObj, tabIndex);
|
|
570
570
|
const section = _.cloneDeep(sectionObj);
|
|
571
571
|
const inputFields = _.forEach(section.inputFields, (inputField) => {
|
|
572
572
|
const inputF = inputField;
|
|
@@ -580,11 +580,12 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
580
580
|
return inputF;
|
|
581
581
|
});
|
|
582
582
|
section.inputFields = inputFields;
|
|
583
|
-
|
|
583
|
+
console.log('cloned cols are', section);
|
|
584
584
|
return section;
|
|
585
585
|
}
|
|
586
586
|
|
|
587
587
|
cloneParent(section, tabIndex) {
|
|
588
|
+
console.log('trying to clone', JSON.stringify(section), tabIndex);
|
|
588
589
|
const parentsect = section;
|
|
589
590
|
const childSectionsBeforeCloning = parentsect.childSections.slice();
|
|
590
591
|
const childSections = [];
|
|
@@ -597,17 +598,19 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
597
598
|
} else if (childSection.type === 'parent') {
|
|
598
599
|
sect = this.cloneParent(childSection, tabIndex);
|
|
599
600
|
}
|
|
600
|
-
|
|
601
|
+
console.log('returning cloned parent section', sect);
|
|
601
602
|
childSections.push(sect);
|
|
602
603
|
return true;
|
|
603
604
|
});
|
|
604
|
-
|
|
605
|
+
console.log('returning cloned parent section final 1', JSON.stringify(childSections));
|
|
605
606
|
parentsect.childSections = childSections;
|
|
606
|
-
|
|
607
|
+
console.log('returning cloned parent section final', parentsect);
|
|
607
608
|
return _.cloneDeep(parentsect);
|
|
608
609
|
}
|
|
609
610
|
|
|
610
|
-
deleteVersion() {
|
|
611
|
+
deleteVersion(data, currentTab) {
|
|
612
|
+
console.log('trying to delete version in parent sms create');
|
|
613
|
+
console.log('deleting version', data, currentTab);
|
|
611
614
|
if (this.state.tabCount === 1) {
|
|
612
615
|
return;
|
|
613
616
|
}
|
|
@@ -617,20 +620,23 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
617
620
|
this.setState({schema, tabCount: this.state.tabCount - 1});
|
|
618
621
|
}
|
|
619
622
|
|
|
620
|
-
renameVersion() {
|
|
621
|
-
|
|
623
|
+
renameVersion(data, currentTab) {
|
|
624
|
+
console.log('renaming version', data, currentTab);
|
|
622
625
|
}
|
|
623
626
|
|
|
624
|
-
markFinalVersion() {
|
|
627
|
+
markFinalVersion(data, currentTab) {
|
|
625
628
|
const message = getMessageObject('success', 'Template Marked as Final Successfully', true);
|
|
626
629
|
this.props.globalActions.addMessageToQueue(message);
|
|
630
|
+
console.log('markFinal version', data, currentTab);
|
|
627
631
|
}
|
|
628
632
|
|
|
629
|
-
duplicateVersion() {
|
|
633
|
+
duplicateVersion(data, currentTab) {
|
|
634
|
+
console.log('duplicate version', data, currentTab);
|
|
630
635
|
this.addVersion(this.state.tabCount);
|
|
631
636
|
}
|
|
632
637
|
|
|
633
638
|
addVersion(data, addNow) {
|
|
639
|
+
console.log('adding version', data);
|
|
634
640
|
let tabIndex = data + 1;
|
|
635
641
|
const schema = _.cloneDeep(this.state.schema);
|
|
636
642
|
const containers = schema.containers.slice();
|
|
@@ -654,7 +660,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
654
660
|
});
|
|
655
661
|
firstPane.sections = sections;
|
|
656
662
|
schema.containers[0].panes.push(firstPane);
|
|
657
|
-
|
|
663
|
+
console.log('adding version tabIndex', tabIndex, tabIndex === 5, schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols);
|
|
658
664
|
if (tabIndex === 5) {
|
|
659
665
|
schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols[0].disabled = true;
|
|
660
666
|
}
|
|
@@ -679,7 +685,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
679
685
|
});
|
|
680
686
|
firstPane.sections = sections;
|
|
681
687
|
schema.containers[0].panes.push(firstPane);
|
|
682
|
-
|
|
688
|
+
console.log('adding version tabIndex', tabIndex, tabIndex === 5, schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols);
|
|
683
689
|
if (tabIndex === 5) {
|
|
684
690
|
schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols[0].disabled = true;
|
|
685
691
|
}
|
|
@@ -702,15 +708,16 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
702
708
|
}
|
|
703
709
|
}
|
|
704
710
|
if (isValid) {
|
|
711
|
+
console.log('isValid');
|
|
705
712
|
return true;
|
|
706
713
|
}
|
|
707
714
|
const message = getMessageObject('error', 'Template data is not valid', true);
|
|
708
715
|
this.props.globalActions.addMessageToQueue(message);
|
|
709
|
-
|
|
716
|
+
console.log('not valid');
|
|
710
717
|
return false;
|
|
711
718
|
}
|
|
712
719
|
|
|
713
|
-
insertAtCursor(field, myValue
|
|
720
|
+
insertAtCursor(field, myValue) {
|
|
714
721
|
//IE support
|
|
715
722
|
const myField = field;
|
|
716
723
|
if (document.selection) {
|
|
@@ -728,11 +735,8 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
728
735
|
} else {
|
|
729
736
|
myField.value += myValue;
|
|
730
737
|
}
|
|
731
|
-
const
|
|
732
|
-
|
|
733
|
-
this.setState({formData});
|
|
734
|
-
// const event = new Event('input', { bubbles: true });
|
|
735
|
-
// callNativeEvent({field, value: myField.value, event});
|
|
738
|
+
const event = new Event('input', { bubbles: true });
|
|
739
|
+
myField.dispatchEvent(event);
|
|
736
740
|
}
|
|
737
741
|
|
|
738
742
|
startTemplateCreation(data) {
|
|
@@ -763,15 +767,18 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
763
767
|
}
|
|
764
768
|
|
|
765
769
|
startLoading(ifEdit) {
|
|
770
|
+
console.log('startLoading', ifEdit);
|
|
766
771
|
if (ifEdit) {
|
|
767
772
|
this.setState({loading: true});
|
|
768
773
|
}
|
|
769
774
|
}
|
|
770
775
|
|
|
771
776
|
handleFrameTasks = (e) => {
|
|
777
|
+
console.log('data listened to is', e.data);
|
|
772
778
|
const type = e.data;
|
|
773
|
-
|
|
779
|
+
console.log('data type', typeof type);
|
|
774
780
|
if (typeof type === 'object') {
|
|
781
|
+
console.log('received something', type);
|
|
775
782
|
const action = type.action;
|
|
776
783
|
switch (action) {
|
|
777
784
|
case "startTemplateCreation":
|
|
@@ -795,15 +802,15 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
795
802
|
this.getFormData(e);
|
|
796
803
|
break;
|
|
797
804
|
case "startTemplateCreation":
|
|
798
|
-
|
|
805
|
+
console.log('Starting to create template');
|
|
799
806
|
//this.getFormData(e);
|
|
800
807
|
break;
|
|
801
808
|
case "moveToTemplates":
|
|
802
|
-
|
|
809
|
+
console.log('moving to templates');
|
|
803
810
|
this.moveToTemplates();
|
|
804
811
|
break;
|
|
805
812
|
case "validateContent":
|
|
806
|
-
|
|
813
|
+
console.log('validating Content');
|
|
807
814
|
this.validateContent(e);
|
|
808
815
|
break;
|
|
809
816
|
default:
|
|
@@ -813,6 +820,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
813
820
|
}
|
|
814
821
|
|
|
815
822
|
handleOnTagsContextChange = (data) => {
|
|
823
|
+
console.log('parent tags context', data);
|
|
816
824
|
const query = {
|
|
817
825
|
layout: 'SMS',
|
|
818
826
|
type: 'TAG',
|
|
@@ -839,10 +847,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
839
847
|
temp.panes.push(basePane);
|
|
840
848
|
}
|
|
841
849
|
});
|
|
842
|
-
this.setState({ schema
|
|
850
|
+
this.setState({ schema });
|
|
843
851
|
}
|
|
844
852
|
|
|
845
853
|
validateContent = (e) => {
|
|
854
|
+
console.log('posting final validation result', this.state.isFormValid);
|
|
846
855
|
const response = {
|
|
847
856
|
action: "validateContent",
|
|
848
857
|
value: this.state.isFormValid,
|
|
@@ -869,6 +878,487 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
869
878
|
});
|
|
870
879
|
}
|
|
871
880
|
resetSchema() {
|
|
881
|
+
// const schema =
|
|
882
|
+
// {
|
|
883
|
+
// standalone: {
|
|
884
|
+
// sections: [
|
|
885
|
+
// {
|
|
886
|
+
// type: "multicols",
|
|
887
|
+
// inputFields: [
|
|
888
|
+
// {
|
|
889
|
+
// cols: [
|
|
890
|
+
// {
|
|
891
|
+
// id: "template-name",
|
|
892
|
+
// placeholder: "Enter template name",
|
|
893
|
+
// type: "input", //Resembles component to be used
|
|
894
|
+
// metaType: "text",
|
|
895
|
+
// datatype: "string",
|
|
896
|
+
// required: true,
|
|
897
|
+
// fluid: true,
|
|
898
|
+
// style: {
|
|
899
|
+
// fontSize: '20px',
|
|
900
|
+
// fontFamily: 'proxima-nova,sans-serif',
|
|
901
|
+
// fontStyle: 'normal',
|
|
902
|
+
// fontWeight: 600,
|
|
903
|
+
// marginBottom: '16px',
|
|
904
|
+
// },
|
|
905
|
+
// styling: "semantic",
|
|
906
|
+
// order: 1,
|
|
907
|
+
// width: 9,
|
|
908
|
+
// offSet: 10,
|
|
909
|
+
// customComponent: false,
|
|
910
|
+
// standalone: true,
|
|
911
|
+
// supportedEvents: {
|
|
912
|
+
// onChange: this.onTemplateNameChange,
|
|
913
|
+
// },
|
|
914
|
+
// },
|
|
915
|
+
// {
|
|
916
|
+
// id: "discard-button",
|
|
917
|
+
// width: 3,
|
|
918
|
+
// offset: 8,
|
|
919
|
+
// metaType: "submit-button",
|
|
920
|
+
// colStyle: {
|
|
921
|
+
// // marginLeft: '47.833%',
|
|
922
|
+
// textAlign: 'right',
|
|
923
|
+
// paddingRight: '12px',
|
|
924
|
+
// },
|
|
925
|
+
// type: "button",
|
|
926
|
+
// buttonType: "cancel",
|
|
927
|
+
// value: "Discard",
|
|
928
|
+
// customComponent: false,
|
|
929
|
+
// standalone: true,
|
|
930
|
+
// styling: "semantic",
|
|
931
|
+
// order: 3,
|
|
932
|
+
// fluid: false,
|
|
933
|
+
// submitAction: "discardValues",
|
|
934
|
+
// supportedEvents: {
|
|
935
|
+
// discardValues: this.discardValues,
|
|
936
|
+
// },
|
|
937
|
+
// },
|
|
938
|
+
// {
|
|
939
|
+
// id: "cancel-button",
|
|
940
|
+
// width: 2,
|
|
941
|
+
// // offset: 11,
|
|
942
|
+
// metaType: "submit-button",
|
|
943
|
+
// colStyle: {
|
|
944
|
+
// textAlign: 'right',
|
|
945
|
+
// width: '9%',
|
|
946
|
+
// },
|
|
947
|
+
// type: "button",
|
|
948
|
+
// buttonType: "cancel",
|
|
949
|
+
// value: "Cancel",
|
|
950
|
+
// customComponent: false,
|
|
951
|
+
// standalone: true,
|
|
952
|
+
// styling: "semantic",
|
|
953
|
+
// order: 3,
|
|
954
|
+
// fluid: false,
|
|
955
|
+
// submitAction: "cancelTemplate",
|
|
956
|
+
// supportedEvents: {
|
|
957
|
+
// cancelTemplate: this.cancelTemplate,
|
|
958
|
+
// },
|
|
959
|
+
// },
|
|
960
|
+
// {
|
|
961
|
+
// id: "save-button",
|
|
962
|
+
// width: 2,
|
|
963
|
+
// metaType: "submit-button",
|
|
964
|
+
// colStyle: {
|
|
965
|
+
// textAlign: 'right',
|
|
966
|
+
// width: '7%',
|
|
967
|
+
// },
|
|
968
|
+
// type: "button",
|
|
969
|
+
// buttonType: "primary",
|
|
970
|
+
// value: "Save",
|
|
971
|
+
// customComponent: false,
|
|
972
|
+
// styling: "semantic",
|
|
973
|
+
// order: 3,
|
|
974
|
+
// fluid: false,
|
|
975
|
+
// standalone: true,
|
|
976
|
+
// submitAction: "saveFormData",
|
|
977
|
+
// supportedEvents: {
|
|
978
|
+
// saveFormData: this.saveFormData,
|
|
979
|
+
// },
|
|
980
|
+
// },
|
|
981
|
+
// ],
|
|
982
|
+
// },
|
|
983
|
+
// ],
|
|
984
|
+
// actionFields: [],
|
|
985
|
+
// },
|
|
986
|
+
// ],
|
|
987
|
+
// },
|
|
988
|
+
// containers: [
|
|
989
|
+
// {
|
|
990
|
+
// panes: [
|
|
991
|
+
// {
|
|
992
|
+
// sections: [
|
|
993
|
+
// {
|
|
994
|
+
// type: "parent",
|
|
995
|
+
// width: 16,
|
|
996
|
+
// rowStyle: {
|
|
997
|
+
// height: '100%',
|
|
998
|
+
// },
|
|
999
|
+
// childSections: [
|
|
1000
|
+
// {
|
|
1001
|
+
// colStyle: {
|
|
1002
|
+
// paddingTop: '16px',
|
|
1003
|
+
// borderRight: '1px solid #d9d9d9',
|
|
1004
|
+
// height: '100%',
|
|
1005
|
+
// },
|
|
1006
|
+
// width: 16,
|
|
1007
|
+
// type: "parent",
|
|
1008
|
+
// childSections: [
|
|
1009
|
+
// {
|
|
1010
|
+
// type: "col-label",
|
|
1011
|
+
// inputFields: [
|
|
1012
|
+
// {
|
|
1013
|
+
// id: "sms-editor",
|
|
1014
|
+
// label: "Message",
|
|
1015
|
+
// labelStyle: {
|
|
1016
|
+
// backgroundColor: 'white',
|
|
1017
|
+
// textAlign: 'left',
|
|
1018
|
+
// color: '#333333',
|
|
1019
|
+
// lineHeight: '24px',
|
|
1020
|
+
// fontSize: '16px',
|
|
1021
|
+
// fontWeight: '600',
|
|
1022
|
+
// fontFamily: 'proxima-nova, sans-serif',
|
|
1023
|
+
// fontStyle: 'normal',
|
|
1024
|
+
// },
|
|
1025
|
+
// style: {
|
|
1026
|
+
// textAlign: 'left',
|
|
1027
|
+
// color: '#333333',
|
|
1028
|
+
// fontFamily: 'Open-Sans',
|
|
1029
|
+
// lineHeight: '24px',
|
|
1030
|
+
// fontSize: '14px',
|
|
1031
|
+
// },
|
|
1032
|
+
// type: "textarea",
|
|
1033
|
+
// metaType: "text",
|
|
1034
|
+
// datatype: "string",
|
|
1035
|
+
// required: true,
|
|
1036
|
+
// placeholder: "Please input sms template content.",
|
|
1037
|
+
// fluid: false,
|
|
1038
|
+
// styling: "semantic",
|
|
1039
|
+
// onlyDisplay: false,
|
|
1040
|
+
// width: 18,
|
|
1041
|
+
// autosize: true,
|
|
1042
|
+
// autosizeParams: {
|
|
1043
|
+
// minRows: 3,
|
|
1044
|
+
// },
|
|
1045
|
+
// order: 2,
|
|
1046
|
+
// customComponent: true,
|
|
1047
|
+
// supportedEvents: {
|
|
1048
|
+
// onChange: this.onTemplateContentChange,
|
|
1049
|
+
// },
|
|
1050
|
+
// },
|
|
1051
|
+
// ],
|
|
1052
|
+
// actionFields: [
|
|
1053
|
+
// ],
|
|
1054
|
+
// },
|
|
1055
|
+
// {
|
|
1056
|
+
// type: "multicols",
|
|
1057
|
+
// inputFields: [
|
|
1058
|
+
// {
|
|
1059
|
+
// cols: [
|
|
1060
|
+
// {
|
|
1061
|
+
// offset: 19,
|
|
1062
|
+
// id: "tagList",
|
|
1063
|
+
// label: "Tags",
|
|
1064
|
+
// type: "tag-list", //Resembles component to be used
|
|
1065
|
+
// metaType: "List",
|
|
1066
|
+
// datatype: "select",
|
|
1067
|
+
// required: true,
|
|
1068
|
+
// fluid: true,
|
|
1069
|
+
// onlyDisplay: true,
|
|
1070
|
+
// styling: "semantic",
|
|
1071
|
+
// order: 1,
|
|
1072
|
+
// customComponent: true,
|
|
1073
|
+
// supportedEvents: {
|
|
1074
|
+
// onTagSelect: this.onTagSelect,
|
|
1075
|
+
// },
|
|
1076
|
+
// },
|
|
1077
|
+
// ],
|
|
1078
|
+
// },
|
|
1079
|
+
// {
|
|
1080
|
+
// cols: [
|
|
1081
|
+
// {
|
|
1082
|
+
// id: "unicode-validity",
|
|
1083
|
+
// label: "Allow Unicode characters?",
|
|
1084
|
+
// labelStyle: {
|
|
1085
|
+
// backgroundColor: "white",
|
|
1086
|
+
// },
|
|
1087
|
+
// style: {
|
|
1088
|
+
// textAlign: 'left',
|
|
1089
|
+
// color: '#262626',
|
|
1090
|
+
// fontFamily: 'Open-Sans',
|
|
1091
|
+
// lineHeight: '24px',
|
|
1092
|
+
// fontSize: '14px',
|
|
1093
|
+
// },
|
|
1094
|
+
// type: "checkbox", //Resembles component to be used
|
|
1095
|
+
// metaType: "text",
|
|
1096
|
+
// datatype: "boolean",
|
|
1097
|
+
// required: true,
|
|
1098
|
+
// fluid: true,
|
|
1099
|
+
// styling: "semantic",
|
|
1100
|
+
// order: 1,
|
|
1101
|
+
// width: 10,
|
|
1102
|
+
// offset: 4,
|
|
1103
|
+
// onlyDisplay: false,
|
|
1104
|
+
// customComponent: false,
|
|
1105
|
+
// supportedEvents: {
|
|
1106
|
+
// onChange: this.onTemplateNameChange,
|
|
1107
|
+
// },
|
|
1108
|
+
// },
|
|
1109
|
+
// ],
|
|
1110
|
+
// },
|
|
1111
|
+
// ],
|
|
1112
|
+
// actionFields: [],
|
|
1113
|
+
// },
|
|
1114
|
+
// ],
|
|
1115
|
+
// },
|
|
1116
|
+
// {
|
|
1117
|
+
// width: 6,
|
|
1118
|
+
// type: "multicols",
|
|
1119
|
+
// offset: 1,
|
|
1120
|
+
// colStyle: {
|
|
1121
|
+
// paddingTop: '16px',
|
|
1122
|
+
// },
|
|
1123
|
+
// inputFields: [
|
|
1124
|
+
// {
|
|
1125
|
+
// cols: [
|
|
1126
|
+
// {
|
|
1127
|
+
// id: "sms-preview",
|
|
1128
|
+
// type: "sms-preview", //Resembles component to be used
|
|
1129
|
+
// customComponent: true,
|
|
1130
|
+
// customStyling: { padding: '0' },
|
|
1131
|
+
// metaType: "preview",
|
|
1132
|
+
// required: true,
|
|
1133
|
+
// fluid: true,
|
|
1134
|
+
// styling: "semantic",
|
|
1135
|
+
// order: 1,
|
|
1136
|
+
// width: 5,
|
|
1137
|
+
// onlyDisplay: true,
|
|
1138
|
+
// offset: 7,
|
|
1139
|
+
// channel: 'SMS',
|
|
1140
|
+
// supportedEvents: {
|
|
1141
|
+
// onChange: this.onTemplateNameChange,
|
|
1142
|
+
// },
|
|
1143
|
+
// },
|
|
1144
|
+
// ],
|
|
1145
|
+
// },
|
|
1146
|
+
// ],
|
|
1147
|
+
// },
|
|
1148
|
+
// ],
|
|
1149
|
+
// },
|
|
1150
|
+
// ],
|
|
1151
|
+
// },
|
|
1152
|
+
// ],
|
|
1153
|
+
// type: "tabs",
|
|
1154
|
+
// defaultPanes: 1,
|
|
1155
|
+
// additionalPanes: 0,
|
|
1156
|
+
// id: "pane",
|
|
1157
|
+
// tabBarExtraContent: {
|
|
1158
|
+
// sections: [
|
|
1159
|
+
// {
|
|
1160
|
+
// type: "multicols",
|
|
1161
|
+
// actionFields: [
|
|
1162
|
+
// {
|
|
1163
|
+
// cols: [
|
|
1164
|
+
// {
|
|
1165
|
+
// id: "add-version-button",
|
|
1166
|
+
// metaType: "submit-button",
|
|
1167
|
+
// type: "button",
|
|
1168
|
+
// buttonType: "cancel",
|
|
1169
|
+
// icon: "plus-circle-o",
|
|
1170
|
+
// value: "New Version",
|
|
1171
|
+
// customComponent: false,
|
|
1172
|
+
// onlyDisplay: true,
|
|
1173
|
+
// styling: "semantic",
|
|
1174
|
+
// order: 3,
|
|
1175
|
+
// fluid: false,
|
|
1176
|
+
// submitAction: "addVersion",
|
|
1177
|
+
// supportedEvents: {
|
|
1178
|
+
// addVersion: this.addVersion,
|
|
1179
|
+
// },
|
|
1180
|
+
// },
|
|
1181
|
+
// ],
|
|
1182
|
+
// },
|
|
1183
|
+
// ],
|
|
1184
|
+
// inputFields: [],
|
|
1185
|
+
// },
|
|
1186
|
+
// ],
|
|
1187
|
+
// },
|
|
1188
|
+
// tabContent: {
|
|
1189
|
+
// sections: [
|
|
1190
|
+
// {
|
|
1191
|
+
// type: "multicols",
|
|
1192
|
+
// inputFields: [
|
|
1193
|
+
// {
|
|
1194
|
+
// rowStyle: {
|
|
1195
|
+
// display: "flex",
|
|
1196
|
+
// flex: 1,
|
|
1197
|
+
// },
|
|
1198
|
+
// cols: [
|
|
1199
|
+
// {
|
|
1200
|
+
// id: "tab-header",
|
|
1201
|
+
// metaType: "label",
|
|
1202
|
+
// value: "Version",
|
|
1203
|
+
// primitive: true,
|
|
1204
|
+
// dynamicTab: true,
|
|
1205
|
+
// type: "div",
|
|
1206
|
+
// width: 5,
|
|
1207
|
+
// offset: 0,
|
|
1208
|
+
// onlyDisplay: true,
|
|
1209
|
+
// colStyle: {
|
|
1210
|
+
// flex: 1,
|
|
1211
|
+
// },
|
|
1212
|
+
// supportedEvents: {
|
|
1213
|
+
// onChange: this.onVersionNameChange,
|
|
1214
|
+
// },
|
|
1215
|
+
// },
|
|
1216
|
+
// {
|
|
1217
|
+
// id: "tab-options-popover",
|
|
1218
|
+
// metaType: "display",
|
|
1219
|
+
// colStyle: {
|
|
1220
|
+
// flex: 0,
|
|
1221
|
+
// },
|
|
1222
|
+
// type: "popover",
|
|
1223
|
+
// customComponent: false,
|
|
1224
|
+
// styling: "semantic",
|
|
1225
|
+
// order: 3,
|
|
1226
|
+
// fluid: false,
|
|
1227
|
+
// onlyDisplay: true,
|
|
1228
|
+
// submitAction: "onTabOptionSelect",
|
|
1229
|
+
// supportedEvents: {
|
|
1230
|
+
// onTabOptionSelect: this.onTabOptionSelect,
|
|
1231
|
+
// },
|
|
1232
|
+
// content: {
|
|
1233
|
+
// sections: [
|
|
1234
|
+
// {
|
|
1235
|
+
// type: "multicols",
|
|
1236
|
+
// inputFields: [
|
|
1237
|
+
// {
|
|
1238
|
+
// cols: [
|
|
1239
|
+
// {
|
|
1240
|
+
// id: "mark-final-version-label",
|
|
1241
|
+
// metaType: "label",
|
|
1242
|
+
// type: "div",
|
|
1243
|
+
// primitive: true,
|
|
1244
|
+
// value: "Mark as Final",
|
|
1245
|
+
// onlyDisplay: true,
|
|
1246
|
+
// customComponent: false,
|
|
1247
|
+
// order: 3,
|
|
1248
|
+
// fluid: false,
|
|
1249
|
+
// submitAction: "markFinalVersion",
|
|
1250
|
+
// supportedEvents: {
|
|
1251
|
+
// markFinalVersion: this.markFinalVersion,
|
|
1252
|
+
// },
|
|
1253
|
+
// },
|
|
1254
|
+
// ],
|
|
1255
|
+
// },
|
|
1256
|
+
// {
|
|
1257
|
+
// cols: [
|
|
1258
|
+
// {
|
|
1259
|
+
// id: "duplicate-version-label",
|
|
1260
|
+
// metaType: "label",
|
|
1261
|
+
// type: "div",
|
|
1262
|
+
// primitive: true,
|
|
1263
|
+
// value: "Duplicate",
|
|
1264
|
+
// onlyDisplay: true,
|
|
1265
|
+
// customComponent: false,
|
|
1266
|
+
// order: 3,
|
|
1267
|
+
// fluid: false,
|
|
1268
|
+
// submitAction: "duplicateVersion",
|
|
1269
|
+
// supportedEvents: {
|
|
1270
|
+
// duplicateVersion: this.duplicateVersion,
|
|
1271
|
+
// },
|
|
1272
|
+
// },
|
|
1273
|
+
// ],
|
|
1274
|
+
// },
|
|
1275
|
+
// {
|
|
1276
|
+
// cols: [
|
|
1277
|
+
// {
|
|
1278
|
+
// id: "rename-version-label",
|
|
1279
|
+
// metaType: "label",
|
|
1280
|
+
// type: "div",
|
|
1281
|
+
// primitive: true,
|
|
1282
|
+
// value: "Rename",
|
|
1283
|
+
// onlyDisplay: true,
|
|
1284
|
+
// customComponent: false,
|
|
1285
|
+
// order: 3,
|
|
1286
|
+
// fluid: false,
|
|
1287
|
+
// submitAction: "renameVersion",
|
|
1288
|
+
// supportedEvents: {
|
|
1289
|
+
// renameVersion: this.renameVersion,
|
|
1290
|
+
// },
|
|
1291
|
+
// },
|
|
1292
|
+
// ],
|
|
1293
|
+
// },
|
|
1294
|
+
// {
|
|
1295
|
+
// cols: [
|
|
1296
|
+
// {
|
|
1297
|
+
// id: "delete-version-label",
|
|
1298
|
+
// metaType: "label",
|
|
1299
|
+
// type: "div",
|
|
1300
|
+
// primitive: true,
|
|
1301
|
+
// value: "Delete",
|
|
1302
|
+
// onlyDisplay: true,
|
|
1303
|
+
// customComponent: false,
|
|
1304
|
+
// order: 3,
|
|
1305
|
+
// fluid: false,
|
|
1306
|
+
// submitAction: "deleteVersion",
|
|
1307
|
+
// supportedEvents: {
|
|
1308
|
+
// deleteVersion: this.deleteVersion,
|
|
1309
|
+
// },
|
|
1310
|
+
// },
|
|
1311
|
+
// ],
|
|
1312
|
+
// },
|
|
1313
|
+
// ],
|
|
1314
|
+
// actionFields: [],
|
|
1315
|
+
// },
|
|
1316
|
+
// ],
|
|
1317
|
+
// },
|
|
1318
|
+
// value: {
|
|
1319
|
+
// sections: [
|
|
1320
|
+
// {
|
|
1321
|
+
// type: "multicols",
|
|
1322
|
+
// inputFields: [
|
|
1323
|
+
// {
|
|
1324
|
+
// cols: [
|
|
1325
|
+
// {
|
|
1326
|
+
// id: "tab-option-icon",
|
|
1327
|
+
// metaType: "display",
|
|
1328
|
+
// type: "icon",
|
|
1329
|
+
// onlyDisplay: true,
|
|
1330
|
+
// primitive: false,
|
|
1331
|
+
// value: "",
|
|
1332
|
+
// customComponent: false,
|
|
1333
|
+
// order: 3,
|
|
1334
|
+
// fluid: false,
|
|
1335
|
+
// },
|
|
1336
|
+
// ],
|
|
1337
|
+
// },
|
|
1338
|
+
// ],
|
|
1339
|
+
// actionFields: [],
|
|
1340
|
+
// },
|
|
1341
|
+
// ],
|
|
1342
|
+
// },
|
|
1343
|
+
// trigger: "click",
|
|
1344
|
+
// placement: "bottomRight",
|
|
1345
|
+
// },
|
|
1346
|
+
// ],
|
|
1347
|
+
// },
|
|
1348
|
+
// ],
|
|
1349
|
+
// actionFields: [],
|
|
1350
|
+
// },
|
|
1351
|
+
// ],
|
|
1352
|
+
// },
|
|
1353
|
+
// label: "Version",
|
|
1354
|
+
// supportedEvents: {
|
|
1355
|
+
// onTabChange: this.onTabChange,
|
|
1356
|
+
// },
|
|
1357
|
+
// },
|
|
1358
|
+
// ],
|
|
1359
|
+
// channel: "SMS",
|
|
1360
|
+
// module: "Campaigns",
|
|
1361
|
+
// };
|
|
872
1362
|
this.setState({ schema: this.props.metaEntities.layouts[0].definition });
|
|
873
1363
|
}
|
|
874
1364
|
|
|
@@ -879,11 +1369,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
879
1369
|
saveFormData(formData) {
|
|
880
1370
|
//Logic to save in db etc
|
|
881
1371
|
// const isValidated = this.validateFormData(formData);
|
|
882
|
-
//
|
|
1372
|
+
// console.log('whyyyy');
|
|
883
1373
|
// if (!isValidated) {
|
|
884
1374
|
// return;
|
|
885
1375
|
// }
|
|
886
|
-
|
|
1376
|
+
console.log('Saving form data', formData, this.state.tabCount);
|
|
887
1377
|
const obj = {};
|
|
888
1378
|
obj.versions = {
|
|
889
1379
|
base: {},
|
|
@@ -896,36 +1386,21 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
896
1386
|
}
|
|
897
1387
|
obj.name = formData['template-name'];
|
|
898
1388
|
obj.versions.base = formData.base;
|
|
899
|
-
|
|
900
|
-
this.props.actions.createTemplate(obj
|
|
901
|
-
}
|
|
902
|
-
isSmsLoading = () => {
|
|
903
|
-
//let {isLoading} = this.props;
|
|
904
|
-
let isLoading = this.props.isLoadingMetaEntities || this.state.loading || (this.props.Create && "createTemplateInProgress" in this.props.Create && this.props.Create.createTemplateInProgress);
|
|
905
|
-
|
|
906
|
-
if (!isLoading) {
|
|
907
|
-
isLoading = this.state.loadingStatus < 2;
|
|
908
|
-
}
|
|
909
|
-
// if (isLoading && this.state.loadingStatus >= 2) {
|
|
910
|
-
// this.props.creativesContainerActions.hideCreativesContanerLoader();
|
|
911
|
-
// }
|
|
912
|
-
if (!isLoading && this.props.setIsLoadingContent) {
|
|
913
|
-
this.props.setIsLoadingContent(isLoading);
|
|
914
|
-
}
|
|
915
|
-
return isLoading;
|
|
1389
|
+
console.log('obj', obj);
|
|
1390
|
+
this.props.actions.createTemplate(obj);
|
|
916
1391
|
}
|
|
917
1392
|
render() {
|
|
918
1393
|
console.log("this.props sms create: ", this.props);
|
|
919
1394
|
const schema = this.state.schema;
|
|
920
|
-
const spinning = this.
|
|
1395
|
+
const spinning = this.state.loading || (this.props.Create && "createTemplateInProgress" in this.props.Create && this.props.Create.createTemplateInProgress);
|
|
921
1396
|
let tags = this.props.metaEntities && this.props.metaEntities.tags && this.props.metaEntities.tags.standard ? this.props.metaEntities.tags.standard : [];
|
|
922
1397
|
|
|
923
1398
|
if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library' && !this.props.getDefaultTags) {
|
|
924
1399
|
tags = this.props.supportedTags; // if get default tags is not present and supported tags is present use that inlbrary mode
|
|
925
1400
|
}
|
|
926
1401
|
return (
|
|
927
|
-
<div
|
|
928
|
-
<Spin spinning={spinning}>
|
|
1402
|
+
<div>
|
|
1403
|
+
<Spin tip={this.props.intl.formatMessage(messages.saveTemplateLoader)} spinning={spinning}>
|
|
929
1404
|
{/*<\Row style={{marginBottom: '16px', marginLeft: '-40px'}}>
|
|
930
1405
|
<Col offset={1}>
|
|
931
1406
|
<Breadcrumb>
|
|
@@ -938,7 +1413,6 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
938
1413
|
<Row>
|
|
939
1414
|
<Col>
|
|
940
1415
|
<FormBuilder
|
|
941
|
-
isFullMode={this.props.isFullMode}
|
|
942
1416
|
schema={schema}
|
|
943
1417
|
onSubmit={this.saveFormData}
|
|
944
1418
|
onChange={this.onFormDataChange}
|
|
@@ -980,17 +1454,12 @@ Create.propTypes = {
|
|
|
980
1454
|
supportedTags: PropTypes.array,
|
|
981
1455
|
getDefaultTags: PropTypes.string,
|
|
982
1456
|
injectedTags: PropTypes.object,
|
|
983
|
-
setIsLoadingContent: PropTypes.bool,
|
|
984
|
-
isFullMode: PropTypes.bool,
|
|
985
|
-
getFormSubscriptionData: PropTypes.func,
|
|
986
|
-
isLoadingMetaEntities: PropTypes.bool,
|
|
987
1457
|
};
|
|
988
1458
|
|
|
989
1459
|
const mapStateToProps = createStructuredSelector({
|
|
990
1460
|
Create: makeSelectCreate(),
|
|
991
1461
|
createResponse: makeSelectCreateResponse(),
|
|
992
1462
|
metaEntities: makeSelectMetaEntities(),
|
|
993
|
-
isLoadingMetaEntities: isLoadingMetaEntities(),
|
|
994
1463
|
injectedTags: setInjectedTags(),
|
|
995
1464
|
});
|
|
996
1465
|
|
|
@@ -998,7 +1467,6 @@ function mapDispatchToProps(dispatch) {
|
|
|
998
1467
|
return {
|
|
999
1468
|
actions: bindActionCreators(actions, dispatch),
|
|
1000
1469
|
globalActions: bindActionCreators(globalActions, dispatch),
|
|
1001
|
-
creativesContainerActions: bindActionCreators(creativesContainerActions, dispatch),
|
|
1002
1470
|
};
|
|
1003
1471
|
}
|
|
1004
1472
|
|