@capillarytech/creatives-library 2.0.69 → 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
|
@@ -15,7 +15,7 @@ import { createStructuredSelector } from 'reselect';
|
|
|
15
15
|
import _ from 'lodash';
|
|
16
16
|
import { bindActionCreators } from 'redux';
|
|
17
17
|
import { makeSelectEdit, makeSelectEditResponse, makeSelectTemplateDetailsResponse } from './selectors';
|
|
18
|
-
import { makeSelectMetaEntities,
|
|
18
|
+
import { makeSelectMetaEntities, setInjectedTags } from '../../Cap/selectors';
|
|
19
19
|
import { UserIsAuthenticated } from '../../../utils/authWrapper';
|
|
20
20
|
import FormBuilder from '../../../components/FormBuilder';
|
|
21
21
|
import * as actions from './actions';
|
|
@@ -24,14 +24,11 @@ import '../Create/_smsCreate.scss';
|
|
|
24
24
|
import messages from './messages';
|
|
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 Edit 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
|
schema: {},
|
|
@@ -85,6 +82,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
85
82
|
}
|
|
86
83
|
|
|
87
84
|
componentWillMount() {
|
|
85
|
+
console.log('edit mounting');
|
|
88
86
|
const query = {
|
|
89
87
|
layout: 'SMS',
|
|
90
88
|
type: 'LAYOUT',
|
|
@@ -128,7 +126,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
128
126
|
this.setEditState(nextProps.templateDetails);
|
|
129
127
|
}
|
|
130
128
|
if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && _.isEmpty(this.state.schema)) {
|
|
131
|
-
this.setState({schema: nextProps.metaEntities.layouts[0].definition
|
|
129
|
+
this.setState({schema: nextProps.metaEntities.layouts[0].definition}, () => {
|
|
132
130
|
this.injectEvents(nextProps.metaEntities.layouts[0].definition);
|
|
133
131
|
});
|
|
134
132
|
if (this.props.location.query.module !== 'library' || (this.props.location.query.module === 'library' && this.props.getDefaultTags)) {
|
|
@@ -148,6 +146,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
148
146
|
}
|
|
149
147
|
}
|
|
150
148
|
if (nextProps.Edit.editResponse && nextProps.Edit.editResponse.templateId) {
|
|
149
|
+
console.log('reseting schema');
|
|
151
150
|
this.resetSchema();
|
|
152
151
|
this.setState({
|
|
153
152
|
formData: {},
|
|
@@ -173,66 +172,41 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
173
172
|
}
|
|
174
173
|
|
|
175
174
|
componentWillUnmount() {
|
|
176
|
-
if (this.props.setIsLoadingContent) {
|
|
177
|
-
this.props.setIsLoadingContent(true); // setting isLoading of CreativesContainer so that slidebox foot can be hidden till content is loaded
|
|
178
|
-
}
|
|
179
|
-
this.props.actions.resetEditTemplate();
|
|
180
175
|
window.removeEventListener("message", this.handleFrameTasks);
|
|
181
176
|
}
|
|
182
177
|
|
|
183
|
-
onTemplateNameChange() {
|
|
184
|
-
|
|
178
|
+
onTemplateNameChange(name) {
|
|
179
|
+
console.log('Template name changed to ', name);
|
|
185
180
|
}
|
|
186
181
|
|
|
187
|
-
onTemplateContentChange() {
|
|
188
|
-
|
|
182
|
+
onTemplateContentChange(content) {
|
|
183
|
+
console.log('Template content changed to ', content);
|
|
189
184
|
}
|
|
190
185
|
|
|
191
186
|
onFormDataChange(formData, tabCount, currentTab) {
|
|
187
|
+
console.log('Form data changed is ', formData, tabCount, currentTab);
|
|
192
188
|
this.setState({formData, tabCount, currentTab});
|
|
193
189
|
if (currentTab) {
|
|
194
190
|
this.setState({currentTab});
|
|
195
191
|
}
|
|
196
192
|
}
|
|
197
193
|
|
|
198
|
-
onVersionNameChange() {
|
|
199
|
-
|
|
194
|
+
onVersionNameChange(data, versionIndex) {
|
|
195
|
+
console.log('version name changed to', data, versionIndex);
|
|
200
196
|
}
|
|
201
197
|
|
|
202
198
|
onTagSelect(data, currentTab) {
|
|
199
|
+
console.log('parent data tag', data, currentTab);
|
|
203
200
|
const editorId = currentTab > 1 ? `sms-editor${currentTab}` : 'sms-editor';
|
|
204
|
-
this.insertAtCursor(document.getElementById(editorId), `{{${data}}}
|
|
201
|
+
this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`);
|
|
205
202
|
document.getElementById(editorId).focus();
|
|
206
203
|
}
|
|
207
204
|
|
|
208
205
|
onTabChange(data) {
|
|
206
|
+
console.log('inside parent ontabchange', data, this.state);
|
|
209
207
|
this.setState({currentTab: data});
|
|
210
208
|
}
|
|
211
|
-
|
|
212
|
-
if (editResponse.templateId) {
|
|
213
|
-
this.resetSchema();
|
|
214
|
-
this.setState({
|
|
215
|
-
formData: {},
|
|
216
|
-
tabCount: 1,
|
|
217
|
-
currentTab: 1,
|
|
218
|
-
editData: {},
|
|
219
|
-
});
|
|
220
|
-
const message = getMessageObject('success', 'SMS Template Edited Successfully', true);
|
|
221
|
-
this.props.globalActions.addMessageToQueue(message);
|
|
222
|
-
this.props.actions.clearEditResponse();
|
|
223
|
-
const module = this.props.location.query.module ? this.props.location.query.module : 'default';
|
|
224
|
-
const type = this.props.location.query.type;
|
|
225
|
-
if (this.props.isFullMode) {
|
|
226
|
-
const {versions, ...rest} = editResponse.templateId;
|
|
227
|
-
this.props.getFormSubscriptionData({ value: versions, ...rest, validity: true});
|
|
228
|
-
} else {
|
|
229
|
-
this.props.router.push({
|
|
230
|
-
pathname: `/sms/`,
|
|
231
|
-
query: type === 'embedded' ? {type: 'embedded', module} : {module},
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
209
|
+
|
|
236
210
|
setEditState(data) {
|
|
237
211
|
const that = this;
|
|
238
212
|
const tabCount = data.versions.history.length;
|
|
@@ -253,7 +227,8 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
253
227
|
}
|
|
254
228
|
if (type === 'embedded' || count > 0) {
|
|
255
229
|
setTimeout( () => {
|
|
256
|
-
|
|
230
|
+
console.log('removing standalone');
|
|
231
|
+
if (type === 'embedded') {
|
|
257
232
|
that.removeStandAlone();
|
|
258
233
|
} else {
|
|
259
234
|
that.addVersion(count, tabCount);
|
|
@@ -268,7 +243,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
268
243
|
formData[0].base = true;
|
|
269
244
|
}
|
|
270
245
|
formData.base = data.versions.base;
|
|
271
|
-
|
|
246
|
+
console.log('form data after discarding ', formData);
|
|
272
247
|
this.setState({tabCount, formData, editData: data, currentTab}, () => {
|
|
273
248
|
});
|
|
274
249
|
}
|
|
@@ -278,10 +253,12 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
278
253
|
}
|
|
279
254
|
|
|
280
255
|
getFormData(e, value) {
|
|
256
|
+
console.log('posting final result', this.state.formData);
|
|
281
257
|
const formData = _.cloneDeep(this.state.formData);
|
|
282
258
|
let baseData = {};
|
|
283
259
|
let versionIdx;
|
|
284
260
|
_.forEach(formData, (val, idx) => {
|
|
261
|
+
console.log('val', val);
|
|
285
262
|
if (val.base && idx !== 'base') {
|
|
286
263
|
baseData = val;
|
|
287
264
|
versionIdx = idx;
|
|
@@ -293,19 +270,17 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
293
270
|
}
|
|
294
271
|
const result = {};
|
|
295
272
|
result.base = baseData;
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
273
|
+
const msgObj = updateCharCount(baseData['sms-editor']);
|
|
274
|
+
result.base.msg_count = msgObj.msgCount;
|
|
275
|
+
console.log("Message Count", msgObj.msgCount);
|
|
300
276
|
const response = {
|
|
301
277
|
action: "getFormData",
|
|
302
278
|
value: result,
|
|
303
279
|
postAction: value || 'next',
|
|
304
280
|
validity: this.state.isFormValid,
|
|
305
|
-
type: 'SMS',
|
|
306
281
|
};
|
|
307
282
|
this.setState({checkValidation: true});
|
|
308
|
-
|
|
283
|
+
console.log('posting final result internal', response);
|
|
309
284
|
if (e) {
|
|
310
285
|
e.source.postMessage(JSON.stringify(response), e.origin);
|
|
311
286
|
}
|
|
@@ -313,6 +288,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
313
288
|
}
|
|
314
289
|
|
|
315
290
|
getCurrentWindow(e) {
|
|
291
|
+
console.log('in sms create', e);
|
|
316
292
|
const response = {
|
|
317
293
|
action: e.action,
|
|
318
294
|
value: 'edit',
|
|
@@ -373,6 +349,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
373
349
|
}
|
|
374
350
|
|
|
375
351
|
handleOnTagsContextChange = (data) => {
|
|
352
|
+
console.log('parent tags context', data);
|
|
376
353
|
const query = {
|
|
377
354
|
layout: 'SMS',
|
|
378
355
|
type: 'TAG',
|
|
@@ -391,9 +368,10 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
391
368
|
}
|
|
392
369
|
|
|
393
370
|
startTemplateCreation(data) {
|
|
371
|
+
console.log('startTemplateCreation');
|
|
394
372
|
if (data.edit) {
|
|
395
373
|
const ifUnicode = checkUnicode(data.content);
|
|
396
|
-
|
|
374
|
+
console.log('smsDetails', ifUnicode, data.content);
|
|
397
375
|
const content = data.content;
|
|
398
376
|
const tempData = {
|
|
399
377
|
'sms-editor': content,
|
|
@@ -411,12 +389,14 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
411
389
|
}
|
|
412
390
|
|
|
413
391
|
startLoading(ifEdit) {
|
|
392
|
+
console.log('startLoading', ifEdit);
|
|
414
393
|
if (ifEdit) {
|
|
415
394
|
this.setState({loading: true});
|
|
416
395
|
}
|
|
417
396
|
}
|
|
418
397
|
|
|
419
398
|
moveToTemplates() {
|
|
399
|
+
console.log('in move to Templates');
|
|
420
400
|
const modalContent = {
|
|
421
401
|
title: "Alert",
|
|
422
402
|
body: "Do you really want to go back? All your temporary changes will be lost!",
|
|
@@ -433,6 +413,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
433
413
|
}
|
|
434
414
|
|
|
435
415
|
discardValues() {
|
|
416
|
+
console.log('discarding', this.props.Edit);
|
|
436
417
|
this.resetSchema();
|
|
437
418
|
this.setState({
|
|
438
419
|
formData: {},
|
|
@@ -445,6 +426,487 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
445
426
|
}
|
|
446
427
|
|
|
447
428
|
resetSchema() {
|
|
429
|
+
//const schema =
|
|
430
|
+
// {
|
|
431
|
+
// standalone: {
|
|
432
|
+
// sections: [
|
|
433
|
+
// {
|
|
434
|
+
// type: "multicols",
|
|
435
|
+
// inputFields: [
|
|
436
|
+
// {
|
|
437
|
+
// cols: [
|
|
438
|
+
// {
|
|
439
|
+
// id: "template-name",
|
|
440
|
+
// placeholder: "Enter template name",
|
|
441
|
+
// type: "input", //Resembles component to be used
|
|
442
|
+
// metaType: "text",
|
|
443
|
+
// datatype: "string",
|
|
444
|
+
// required: true,
|
|
445
|
+
// fluid: true,
|
|
446
|
+
// style: {
|
|
447
|
+
// fontSize: '20px',
|
|
448
|
+
// fontFamily: 'proxima-nova,sans-serif',
|
|
449
|
+
// fontStyle: 'normal',
|
|
450
|
+
// fontWeight: 600,
|
|
451
|
+
// marginBottom: '16px',
|
|
452
|
+
// },
|
|
453
|
+
// styling: "semantic",
|
|
454
|
+
// order: 1,
|
|
455
|
+
// width: 9,
|
|
456
|
+
// // offSet: 10,
|
|
457
|
+
// customComponent: false,
|
|
458
|
+
// standalone: true,
|
|
459
|
+
// supportedEvents: {
|
|
460
|
+
// onChange: this.onTemplateNameChange,
|
|
461
|
+
// },
|
|
462
|
+
// },
|
|
463
|
+
// {
|
|
464
|
+
// id: "discard-button",
|
|
465
|
+
// width: 3,
|
|
466
|
+
// offset: 8,
|
|
467
|
+
// metaType: "submit-button",
|
|
468
|
+
// colStyle: {
|
|
469
|
+
// // marginLeft: '47.833%',
|
|
470
|
+
// textAlign: 'right',
|
|
471
|
+
// paddingRight: '12px',
|
|
472
|
+
// },
|
|
473
|
+
// type: "button",
|
|
474
|
+
// buttonType: "cancel",
|
|
475
|
+
// value: "Discard",
|
|
476
|
+
// customComponent: false,
|
|
477
|
+
// standalone: true,
|
|
478
|
+
// styling: "semantic",
|
|
479
|
+
// order: 3,
|
|
480
|
+
// fluid: false,
|
|
481
|
+
// submitAction: "discardValues",
|
|
482
|
+
// supportedEvents: {
|
|
483
|
+
// discardValues: this.discardValues,
|
|
484
|
+
// },
|
|
485
|
+
// },
|
|
486
|
+
// {
|
|
487
|
+
// id: "cancel-button",
|
|
488
|
+
// width: 2,
|
|
489
|
+
// // offset: 11,
|
|
490
|
+
// metaType: "submit-button",
|
|
491
|
+
// colStyle: {
|
|
492
|
+
// textAlign: 'right',
|
|
493
|
+
// width: '9%',
|
|
494
|
+
// },
|
|
495
|
+
// type: "button",
|
|
496
|
+
// buttonType: "cancel",
|
|
497
|
+
// value: "Cancel",
|
|
498
|
+
// customComponent: false,
|
|
499
|
+
// standalone: true,
|
|
500
|
+
// styling: "semantic",
|
|
501
|
+
// order: 3,
|
|
502
|
+
// fluid: false,
|
|
503
|
+
// submitAction: "cancelTemplate",
|
|
504
|
+
// supportedEvents: {
|
|
505
|
+
// cancelTemplate: this.cancelTemplate,
|
|
506
|
+
// },
|
|
507
|
+
// },
|
|
508
|
+
// {
|
|
509
|
+
// id: "save-button",
|
|
510
|
+
// width: 2,
|
|
511
|
+
// metaType: "submit-button",
|
|
512
|
+
// colStyle: {
|
|
513
|
+
// textAlign: 'right',
|
|
514
|
+
// width: '7%',
|
|
515
|
+
// },
|
|
516
|
+
// type: "button",
|
|
517
|
+
// buttonType: "primary",
|
|
518
|
+
// value: "Save",
|
|
519
|
+
// customComponent: false,
|
|
520
|
+
// styling: "semantic",
|
|
521
|
+
// order: 3,
|
|
522
|
+
// fluid: false,
|
|
523
|
+
// standalone: true,
|
|
524
|
+
// submitAction: "saveFormData",
|
|
525
|
+
// supportedEvents: {
|
|
526
|
+
// saveFormData: this.saveFormData,
|
|
527
|
+
// },
|
|
528
|
+
// },
|
|
529
|
+
// ],
|
|
530
|
+
// },
|
|
531
|
+
// ],
|
|
532
|
+
// actionFields: [],
|
|
533
|
+
// },
|
|
534
|
+
// ],
|
|
535
|
+
// },
|
|
536
|
+
// containers: [
|
|
537
|
+
// {
|
|
538
|
+
// panes: [
|
|
539
|
+
// {
|
|
540
|
+
// sections: [
|
|
541
|
+
// {
|
|
542
|
+
// type: "parent",
|
|
543
|
+
// width: 16,
|
|
544
|
+
// rowStyle: {
|
|
545
|
+
// height: '100%',
|
|
546
|
+
// },
|
|
547
|
+
// childSections: [
|
|
548
|
+
// {
|
|
549
|
+
// colStyle: {
|
|
550
|
+
// paddingTop: '16px',
|
|
551
|
+
// borderRight: '1px solid #d9d9d9',
|
|
552
|
+
// height: '100%',
|
|
553
|
+
// },
|
|
554
|
+
// width: 16,
|
|
555
|
+
// type: "parent",
|
|
556
|
+
// childSections: [
|
|
557
|
+
// {
|
|
558
|
+
// type: "col-label",
|
|
559
|
+
// inputFields: [
|
|
560
|
+
// {
|
|
561
|
+
// id: "sms-editor",
|
|
562
|
+
// label: "Message",
|
|
563
|
+
// labelStyle: {
|
|
564
|
+
// backgroundColor: 'white',
|
|
565
|
+
// textAlign: 'left',
|
|
566
|
+
// color: '#333333',
|
|
567
|
+
// lineHeight: '24px',
|
|
568
|
+
// fontSize: '16px',
|
|
569
|
+
// fontWeight: '600',
|
|
570
|
+
// fontFamily: 'proxima-nova, sans-serif',
|
|
571
|
+
// fontStyle: 'normal',
|
|
572
|
+
// },
|
|
573
|
+
// style: {
|
|
574
|
+
// textAlign: 'left',
|
|
575
|
+
// color: '#333333',
|
|
576
|
+
// fontFamily: 'Open-Sans',
|
|
577
|
+
// lineHeight: '24px',
|
|
578
|
+
// fontSize: '14px',
|
|
579
|
+
// },
|
|
580
|
+
// type: "textarea",
|
|
581
|
+
// metaType: "text",
|
|
582
|
+
// datatype: "string",
|
|
583
|
+
// required: true,
|
|
584
|
+
// placeholder: "Please input sms template content.",
|
|
585
|
+
// fluid: false,
|
|
586
|
+
// styling: "semantic",
|
|
587
|
+
// onlyDisplay: false,
|
|
588
|
+
// width: 18,
|
|
589
|
+
// autosize: true,
|
|
590
|
+
// autosizeParams: {
|
|
591
|
+
// minRows: 3,
|
|
592
|
+
// },
|
|
593
|
+
// order: 2,
|
|
594
|
+
// customComponent: true,
|
|
595
|
+
// supportedEvents: {
|
|
596
|
+
// onChange: this.onTemplateContentChange,
|
|
597
|
+
// },
|
|
598
|
+
// },
|
|
599
|
+
// ],
|
|
600
|
+
// actionFields: [
|
|
601
|
+
// ],
|
|
602
|
+
// },
|
|
603
|
+
// {
|
|
604
|
+
// type: "multicols",
|
|
605
|
+
// inputFields: [
|
|
606
|
+
// {
|
|
607
|
+
// cols: [
|
|
608
|
+
// {
|
|
609
|
+
// offset: 19,
|
|
610
|
+
// id: "tagList",
|
|
611
|
+
// label: "Tags",
|
|
612
|
+
// type: "tag-list", //Resembles component to be used
|
|
613
|
+
// metaType: "List",
|
|
614
|
+
// datatype: "select",
|
|
615
|
+
// required: true,
|
|
616
|
+
// fluid: true,
|
|
617
|
+
// onlyDisplay: true,
|
|
618
|
+
// styling: "semantic",
|
|
619
|
+
// order: 1,
|
|
620
|
+
// customComponent: true,
|
|
621
|
+
// supportedEvents: {
|
|
622
|
+
// onTagSelect: this.onTagSelect,
|
|
623
|
+
// },
|
|
624
|
+
// },
|
|
625
|
+
// ],
|
|
626
|
+
// },
|
|
627
|
+
// {
|
|
628
|
+
// cols: [
|
|
629
|
+
// {
|
|
630
|
+
// id: "unicode-validity",
|
|
631
|
+
// label: "Allow Unicode characters?",
|
|
632
|
+
// labelStyle: {
|
|
633
|
+
// backgroundColor: "white",
|
|
634
|
+
// },
|
|
635
|
+
// style: {
|
|
636
|
+
// textAlign: 'left',
|
|
637
|
+
// color: '#262626',
|
|
638
|
+
// fontFamily: 'Open-Sans',
|
|
639
|
+
// lineHeight: '24px',
|
|
640
|
+
// fontSize: '14px',
|
|
641
|
+
// },
|
|
642
|
+
// type: "checkbox", //Resembles component to be used
|
|
643
|
+
// metaType: "text",
|
|
644
|
+
// datatype: "boolean",
|
|
645
|
+
// required: true,
|
|
646
|
+
// fluid: true,
|
|
647
|
+
// styling: "semantic",
|
|
648
|
+
// order: 1,
|
|
649
|
+
// width: 10,
|
|
650
|
+
// offset: 4,
|
|
651
|
+
// onlyDisplay: false,
|
|
652
|
+
// customComponent: false,
|
|
653
|
+
// supportedEvents: {
|
|
654
|
+
// onChange: this.onTemplateNameChange,
|
|
655
|
+
// },
|
|
656
|
+
// },
|
|
657
|
+
// ],
|
|
658
|
+
// },
|
|
659
|
+
// ],
|
|
660
|
+
// actionFields: [],
|
|
661
|
+
// },
|
|
662
|
+
// ],
|
|
663
|
+
// },
|
|
664
|
+
// {
|
|
665
|
+
// width: 6,
|
|
666
|
+
// type: "multicols",
|
|
667
|
+
// offset: 1,
|
|
668
|
+
// colStyle: {
|
|
669
|
+
// paddingTop: '16px',
|
|
670
|
+
// },
|
|
671
|
+
// inputFields: [
|
|
672
|
+
// {
|
|
673
|
+
// cols: [
|
|
674
|
+
// {
|
|
675
|
+
// id: "sms-preview",
|
|
676
|
+
// type: "sms-preview", //Resembles component to be used
|
|
677
|
+
// customComponent: true,
|
|
678
|
+
// customStyling: { padding: '0' },
|
|
679
|
+
// metaType: "preview",
|
|
680
|
+
// required: true,
|
|
681
|
+
// fluid: true,
|
|
682
|
+
// styling: "semantic",
|
|
683
|
+
// order: 1,
|
|
684
|
+
// width: 5,
|
|
685
|
+
// onlyDisplay: true,
|
|
686
|
+
// offset: 7,
|
|
687
|
+
// channel: 'SMS',
|
|
688
|
+
// supportedEvents: {
|
|
689
|
+
// onChange: this.onTemplateNameChange,
|
|
690
|
+
// },
|
|
691
|
+
// },
|
|
692
|
+
// ],
|
|
693
|
+
// },
|
|
694
|
+
// ],
|
|
695
|
+
// },
|
|
696
|
+
// ],
|
|
697
|
+
// },
|
|
698
|
+
// ],
|
|
699
|
+
// },
|
|
700
|
+
// ],
|
|
701
|
+
// type: "tabs",
|
|
702
|
+
// defaultPanes: 1,
|
|
703
|
+
// additionalPanes: 0,
|
|
704
|
+
// id: "pane",
|
|
705
|
+
// tabBarExtraContent: {
|
|
706
|
+
// sections: [
|
|
707
|
+
// {
|
|
708
|
+
// type: "multicols",
|
|
709
|
+
// actionFields: [
|
|
710
|
+
// {
|
|
711
|
+
// cols: [
|
|
712
|
+
// {
|
|
713
|
+
// id: "add-version-button",
|
|
714
|
+
// metaType: "submit-button",
|
|
715
|
+
// type: "button",
|
|
716
|
+
// buttonType: "cancel",
|
|
717
|
+
// icon: "plus-circle-o",
|
|
718
|
+
// value: "New Version",
|
|
719
|
+
// customComponent: false,
|
|
720
|
+
// onlyDisplay: true,
|
|
721
|
+
// styling: "semantic",
|
|
722
|
+
// order: 3,
|
|
723
|
+
// fluid: false,
|
|
724
|
+
// submitAction: "addVersion",
|
|
725
|
+
// supportedEvents: {
|
|
726
|
+
// addVersion: this.addVersion,
|
|
727
|
+
// },
|
|
728
|
+
// },
|
|
729
|
+
// ],
|
|
730
|
+
// },
|
|
731
|
+
// ],
|
|
732
|
+
// inputFields: [],
|
|
733
|
+
// },
|
|
734
|
+
// ],
|
|
735
|
+
// },
|
|
736
|
+
// tabContent: {
|
|
737
|
+
// sections: [
|
|
738
|
+
// {
|
|
739
|
+
// type: "multicols",
|
|
740
|
+
// inputFields: [
|
|
741
|
+
// {
|
|
742
|
+
// rowStyle: {
|
|
743
|
+
// display: "flex",
|
|
744
|
+
// flex: 1,
|
|
745
|
+
// },
|
|
746
|
+
// cols: [
|
|
747
|
+
// {
|
|
748
|
+
// id: "tab-header",
|
|
749
|
+
// metaType: "label",
|
|
750
|
+
// value: "Version",
|
|
751
|
+
// primitive: true,
|
|
752
|
+
// dynamicTab: true,
|
|
753
|
+
// type: "div",
|
|
754
|
+
// width: 5,
|
|
755
|
+
// offset: 0,
|
|
756
|
+
// onlyDisplay: true,
|
|
757
|
+
// colStyle: {
|
|
758
|
+
// flex: 1,
|
|
759
|
+
// },
|
|
760
|
+
// supportedEvents: {
|
|
761
|
+
// onChange: this.onVersionNameChange,
|
|
762
|
+
// },
|
|
763
|
+
// },
|
|
764
|
+
// {
|
|
765
|
+
// id: "tab-options-popover",
|
|
766
|
+
// metaType: "display",
|
|
767
|
+
// colStyle: {
|
|
768
|
+
// flex: 0,
|
|
769
|
+
// },
|
|
770
|
+
// type: "popover",
|
|
771
|
+
// customComponent: false,
|
|
772
|
+
// styling: "semantic",
|
|
773
|
+
// order: 3,
|
|
774
|
+
// fluid: false,
|
|
775
|
+
// onlyDisplay: true,
|
|
776
|
+
// submitAction: "onTabOptionSelect",
|
|
777
|
+
// supportedEvents: {
|
|
778
|
+
// onTabOptionSelect: this.onTabOptionSelect,
|
|
779
|
+
// },
|
|
780
|
+
// content: {
|
|
781
|
+
// sections: [
|
|
782
|
+
// {
|
|
783
|
+
// type: "multicols",
|
|
784
|
+
// inputFields: [
|
|
785
|
+
// {
|
|
786
|
+
// cols: [
|
|
787
|
+
// {
|
|
788
|
+
// id: "mark-final-version-label",
|
|
789
|
+
// metaType: "label",
|
|
790
|
+
// type: "div",
|
|
791
|
+
// primitive: true,
|
|
792
|
+
// value: "Mark as Final",
|
|
793
|
+
// onlyDisplay: true,
|
|
794
|
+
// customComponent: false,
|
|
795
|
+
// order: 3,
|
|
796
|
+
// fluid: false,
|
|
797
|
+
// submitAction: "markFinalVersion",
|
|
798
|
+
// supportedEvents: {
|
|
799
|
+
// markFinalVersion: this.markFinalVersion,
|
|
800
|
+
// },
|
|
801
|
+
// },
|
|
802
|
+
// ],
|
|
803
|
+
// },
|
|
804
|
+
// {
|
|
805
|
+
// cols: [
|
|
806
|
+
// {
|
|
807
|
+
// id: "duplicate-version-label",
|
|
808
|
+
// metaType: "label",
|
|
809
|
+
// type: "div",
|
|
810
|
+
// primitive: true,
|
|
811
|
+
// value: "Duplicate",
|
|
812
|
+
// onlyDisplay: true,
|
|
813
|
+
// customComponent: false,
|
|
814
|
+
// order: 3,
|
|
815
|
+
// fluid: false,
|
|
816
|
+
// submitAction: "duplicateVersion",
|
|
817
|
+
// supportedEvents: {
|
|
818
|
+
// duplicateVersion: this.duplicateVersion,
|
|
819
|
+
// },
|
|
820
|
+
// },
|
|
821
|
+
// ],
|
|
822
|
+
// },
|
|
823
|
+
// {
|
|
824
|
+
// cols: [
|
|
825
|
+
// {
|
|
826
|
+
// id: "rename-version-label",
|
|
827
|
+
// metaType: "label",
|
|
828
|
+
// type: "div",
|
|
829
|
+
// primitive: true,
|
|
830
|
+
// value: "Rename",
|
|
831
|
+
// onlyDisplay: true,
|
|
832
|
+
// customComponent: false,
|
|
833
|
+
// order: 3,
|
|
834
|
+
// fluid: false,
|
|
835
|
+
// submitAction: "renameVersion",
|
|
836
|
+
// supportedEvents: {
|
|
837
|
+
// renameVersion: this.renameVersion,
|
|
838
|
+
// },
|
|
839
|
+
// },
|
|
840
|
+
// ],
|
|
841
|
+
// },
|
|
842
|
+
// {
|
|
843
|
+
// cols: [
|
|
844
|
+
// {
|
|
845
|
+
// id: "delete-version-label",
|
|
846
|
+
// metaType: "label",
|
|
847
|
+
// type: "div",
|
|
848
|
+
// primitive: true,
|
|
849
|
+
// value: "Delete",
|
|
850
|
+
// onlyDisplay: true,
|
|
851
|
+
// customComponent: false,
|
|
852
|
+
// order: 3,
|
|
853
|
+
// fluid: false,
|
|
854
|
+
// submitAction: "deleteVersion",
|
|
855
|
+
// supportedEvents: {
|
|
856
|
+
// deleteVersion: this.deleteVersion,
|
|
857
|
+
// },
|
|
858
|
+
// },
|
|
859
|
+
// ],
|
|
860
|
+
// },
|
|
861
|
+
// ],
|
|
862
|
+
// actionFields: [],
|
|
863
|
+
// },
|
|
864
|
+
// ],
|
|
865
|
+
// },
|
|
866
|
+
// value: {
|
|
867
|
+
// sections: [
|
|
868
|
+
// {
|
|
869
|
+
// type: "multicols",
|
|
870
|
+
// inputFields: [
|
|
871
|
+
// {
|
|
872
|
+
// cols: [
|
|
873
|
+
// {
|
|
874
|
+
// id: "tab-option-icon",
|
|
875
|
+
// metaType: "display",
|
|
876
|
+
// type: "icon",
|
|
877
|
+
// onlyDisplay: true,
|
|
878
|
+
// primitive: false,
|
|
879
|
+
// value: "",
|
|
880
|
+
// customComponent: false,
|
|
881
|
+
// order: 3,
|
|
882
|
+
// fluid: false,
|
|
883
|
+
// },
|
|
884
|
+
// ],
|
|
885
|
+
// },
|
|
886
|
+
// ],
|
|
887
|
+
// actionFields: [],
|
|
888
|
+
// },
|
|
889
|
+
// ],
|
|
890
|
+
// },
|
|
891
|
+
// trigger: "click",
|
|
892
|
+
// placement: "bottomRight",
|
|
893
|
+
// },
|
|
894
|
+
// ],
|
|
895
|
+
// },
|
|
896
|
+
// ],
|
|
897
|
+
// actionFields: [],
|
|
898
|
+
// },
|
|
899
|
+
// ],
|
|
900
|
+
// },
|
|
901
|
+
// label: "Version",
|
|
902
|
+
// supportedEvents: {
|
|
903
|
+
// onTabChange: this.onTabChange,
|
|
904
|
+
// },
|
|
905
|
+
// },
|
|
906
|
+
// ],
|
|
907
|
+
// channel: "SMS",
|
|
908
|
+
// module: "Campaigns",
|
|
909
|
+
// };
|
|
448
910
|
this.setState({ schema: this.props.metaEntities.layouts[0].definition });
|
|
449
911
|
}
|
|
450
912
|
|
|
@@ -461,13 +923,15 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
461
923
|
}
|
|
462
924
|
}
|
|
463
925
|
if (isValid) {
|
|
926
|
+
console.log('isValid');
|
|
464
927
|
return true;
|
|
465
928
|
}
|
|
466
|
-
|
|
929
|
+
console.log('not valid');
|
|
467
930
|
return false;
|
|
468
931
|
}
|
|
469
932
|
|
|
470
933
|
injectEvents(schema) {
|
|
934
|
+
console.log('now injecting events in edit');
|
|
471
935
|
const temp = schema;
|
|
472
936
|
temp.standalone.sections = this.injectSections(temp.standalone.sections);
|
|
473
937
|
_.forEach(temp.containers, (container) => {
|
|
@@ -475,7 +939,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
475
939
|
tempContainer = this.injectContainer(tempContainer);
|
|
476
940
|
return tempContainer;
|
|
477
941
|
});
|
|
478
|
-
this.setState({schema
|
|
942
|
+
this.setState({schema});
|
|
479
943
|
return schema;
|
|
480
944
|
}
|
|
481
945
|
|
|
@@ -510,7 +974,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
510
974
|
_.forEach(col.supportedEvents, (event) => {
|
|
511
975
|
temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
|
|
512
976
|
});
|
|
513
|
-
|
|
977
|
+
console.log('should translate multicol', temp);
|
|
514
978
|
temp = this.injectMessages(temp);
|
|
515
979
|
return true;
|
|
516
980
|
});
|
|
@@ -527,7 +991,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
527
991
|
_.forEach(col.supportedEvents, (event) => {
|
|
528
992
|
temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
|
|
529
993
|
});
|
|
530
|
-
|
|
994
|
+
console.log('should translate multicol action', temp);
|
|
531
995
|
temp = this.injectMessages(temp);
|
|
532
996
|
return true;
|
|
533
997
|
});
|
|
@@ -547,7 +1011,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
547
1011
|
_.forEach(inputField.supportedEvents, (event) => {
|
|
548
1012
|
temp.injectedEvents[event] = this.getMappedEvent(inputField.id, event);
|
|
549
1013
|
});
|
|
550
|
-
|
|
1014
|
+
console.log('should translate collabel', temp);
|
|
551
1015
|
temp = this.injectMessages(temp);
|
|
552
1016
|
return true;
|
|
553
1017
|
});
|
|
@@ -562,7 +1026,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
562
1026
|
_.forEach(actionField.supportedEvents, (event) => {
|
|
563
1027
|
temp.injectedEvents[event] = this.getMappedEvent(actionField.id, event);
|
|
564
1028
|
});
|
|
565
|
-
|
|
1029
|
+
console.log('should translate collabel action', temp);
|
|
566
1030
|
temp = this.injectMessages(temp);
|
|
567
1031
|
return true;
|
|
568
1032
|
});
|
|
@@ -671,16 +1135,18 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
671
1135
|
this.setState({schema, tabCount: this.state.tabCount - 1});
|
|
672
1136
|
}
|
|
673
1137
|
|
|
674
|
-
renameVersion() {
|
|
675
|
-
|
|
1138
|
+
renameVersion(data, currentTab) {
|
|
1139
|
+
console.log('renaming version', data, currentTab);
|
|
676
1140
|
}
|
|
677
1141
|
|
|
678
|
-
markFinalVersion() {
|
|
1142
|
+
markFinalVersion(data, currentTab) {
|
|
679
1143
|
const message = getMessageObject('success', 'Template Marked as Final Successfully', true);
|
|
680
1144
|
this.props.globalActions.addMessageToQueue(message);
|
|
1145
|
+
console.log('markFinal version', data, currentTab);
|
|
681
1146
|
}
|
|
682
1147
|
|
|
683
|
-
duplicateVersion() {
|
|
1148
|
+
duplicateVersion(data, currentTab) {
|
|
1149
|
+
console.log('duplicate version', data, currentTab);
|
|
684
1150
|
this.addVersion(this.state.tabCount);
|
|
685
1151
|
}
|
|
686
1152
|
|
|
@@ -694,6 +1160,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
694
1160
|
}
|
|
695
1161
|
|
|
696
1162
|
addVersion(data, addNow) {
|
|
1163
|
+
console.log('adding version', data);
|
|
697
1164
|
let tabIndex = data + 1;
|
|
698
1165
|
const schema = _.cloneDeep(this.state.schema);
|
|
699
1166
|
const containers = schema.containers.slice();
|
|
@@ -717,7 +1184,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
717
1184
|
});
|
|
718
1185
|
firstPane.sections = sections;
|
|
719
1186
|
schema.containers[0].panes.push(firstPane);
|
|
720
|
-
|
|
1187
|
+
console.log('adding version tabIndex', tabIndex, tabIndex === 5, schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols);
|
|
721
1188
|
if (tabIndex === 5) {
|
|
722
1189
|
schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols[0].disabled = true;
|
|
723
1190
|
}
|
|
@@ -742,7 +1209,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
742
1209
|
});
|
|
743
1210
|
firstPane.sections = sections;
|
|
744
1211
|
schema.containers[0].panes.push(firstPane);
|
|
745
|
-
|
|
1212
|
+
console.log('adding version tabIndex', tabIndex, tabIndex === 5, schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols);
|
|
746
1213
|
if (tabIndex === 5) {
|
|
747
1214
|
schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols[0].disabled = true;
|
|
748
1215
|
}
|
|
@@ -751,7 +1218,8 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
751
1218
|
}
|
|
752
1219
|
}
|
|
753
1220
|
}
|
|
754
|
-
|
|
1221
|
+
|
|
1222
|
+
insertAtCursor(field, myValue) {
|
|
755
1223
|
//IE support
|
|
756
1224
|
const myField = field;
|
|
757
1225
|
if (document.selection) {
|
|
@@ -769,16 +1237,15 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
769
1237
|
} else {
|
|
770
1238
|
myField.value += myValue;
|
|
771
1239
|
}
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
this.setState({formData});
|
|
775
|
-
// const event = new Event('input', { bubbles: true });
|
|
776
|
-
// callNativeEvent({field, value: myField.value, event});
|
|
1240
|
+
const event = new Event('input', { bubbles: true });
|
|
1241
|
+
myField.dispatchEvent(event);
|
|
777
1242
|
}
|
|
778
1243
|
|
|
779
1244
|
handleFrameTasks = (e) => {
|
|
1245
|
+
console.log('data listened to is', e.data);
|
|
780
1246
|
const type = e.data;
|
|
781
1247
|
if (typeof type === 'object') {
|
|
1248
|
+
console.log('received something', type);
|
|
782
1249
|
const action = type.action;
|
|
783
1250
|
switch (action) {
|
|
784
1251
|
case "startTemplateCreation":
|
|
@@ -802,15 +1269,15 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
802
1269
|
this.getFormData(e);
|
|
803
1270
|
break;
|
|
804
1271
|
case "startTemplateCreation":
|
|
805
|
-
|
|
1272
|
+
console.log('Starting to create template');
|
|
806
1273
|
//this.getFormData(e);
|
|
807
1274
|
break;
|
|
808
1275
|
case "moveToTemplates":
|
|
809
|
-
|
|
1276
|
+
console.log('moving to templates');
|
|
810
1277
|
this.moveToTemplates();
|
|
811
1278
|
break;
|
|
812
1279
|
case "validateContent":
|
|
813
|
-
|
|
1280
|
+
console.log('validating Content');
|
|
814
1281
|
this.validateContent(e);
|
|
815
1282
|
break;
|
|
816
1283
|
default:
|
|
@@ -820,7 +1287,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
820
1287
|
|
|
821
1288
|
removeStandAlone() {
|
|
822
1289
|
let formData = _.cloneDeep(this.state.formData);
|
|
823
|
-
|
|
1290
|
+
console.log('removing standalone 2', formData);
|
|
824
1291
|
let baseFormData = {};
|
|
825
1292
|
const oldBaseKeys = formData[0];
|
|
826
1293
|
let baseIndex = -1;
|
|
@@ -863,11 +1330,12 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
863
1330
|
temp.panes.push(basePane);
|
|
864
1331
|
}
|
|
865
1332
|
});
|
|
866
|
-
|
|
867
|
-
this.setState({ schema,
|
|
1333
|
+
console.log('final data after removing', formData);
|
|
1334
|
+
this.setState({ schema, formData, tabCount: 1, tabKey: formData.base.tabKey, currentTab: 1 });
|
|
868
1335
|
}
|
|
869
1336
|
|
|
870
1337
|
validateContent = (e) => {
|
|
1338
|
+
console.log('posting final validation result', this.state.isFormValid);
|
|
871
1339
|
const response = {
|
|
872
1340
|
action: "validateContent",
|
|
873
1341
|
value: this.state.isFormValid,
|
|
@@ -887,7 +1355,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
887
1355
|
|
|
888
1356
|
saveFormData(formData) {
|
|
889
1357
|
//Logic to save in db etc
|
|
890
|
-
|
|
1358
|
+
console.log('Saving form data', formData, this.state.tabCount);
|
|
891
1359
|
const obj = _.cloneDeep(this.state.editData);
|
|
892
1360
|
obj.versions = {
|
|
893
1361
|
base: {},
|
|
@@ -898,35 +1366,20 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
898
1366
|
}
|
|
899
1367
|
obj.name = formData['template-name'];
|
|
900
1368
|
obj.versions.base = formData.base;
|
|
901
|
-
|
|
902
|
-
this.props.actions.editTemplate(obj
|
|
903
|
-
}
|
|
904
|
-
isSmsLoading = () => {
|
|
905
|
-
//let {isLoading} = this.props;
|
|
906
|
-
let isLoading = this.props.isLoadingMetaEntities || this.state.loading || (this.props.Edit && (("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) || ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress)));
|
|
907
|
-
|
|
908
|
-
if (!isLoading) {
|
|
909
|
-
isLoading = this.props.isFullMode ? this.state.loadingStatus < 2 : this.state.loadingStatus < 3;
|
|
910
|
-
}
|
|
911
|
-
// if (isLoading && this.state.loadingStatus >= 3) {
|
|
912
|
-
// this.props.creativesContainerActions.hideCreativesContanerLoader();
|
|
913
|
-
// }
|
|
914
|
-
if (!isLoading && this.props.setIsLoadingContent) {
|
|
915
|
-
this.props.setIsLoadingContent(isLoading);
|
|
916
|
-
}
|
|
917
|
-
return isLoading;
|
|
1369
|
+
console.log('edit obj', obj);
|
|
1370
|
+
this.props.actions.editTemplate(obj);
|
|
918
1371
|
}
|
|
919
1372
|
render() {
|
|
920
1373
|
const schema = this.state.schema;
|
|
921
1374
|
let tipText = this.props.Edit && ("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) ? this.props.intl.formatMessage(messages.getTemplateDetailsLoader) : '';
|
|
922
1375
|
tipText = this.props.Edit && ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress) ? this.props.intl.formatMessage(messages.saveTemplateLoader) : '';
|
|
923
|
-
const spinning = this.
|
|
924
|
-
let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
|
|
1376
|
+
const spinning = this.state.loading || (this.props.Edit && (("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) || ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress)));
|
|
1377
|
+
let tags = this.props.metaEntities && this.props.metaEntities.tags && this.props.metaEntities.tags.standard ? this.props.metaEntities.tags.standard : [];
|
|
925
1378
|
if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library' && !this.props.getDefaultTags) {
|
|
926
1379
|
tags = this.props.supportedTags;
|
|
927
1380
|
}
|
|
928
1381
|
return (
|
|
929
|
-
<div
|
|
1382
|
+
<div>
|
|
930
1383
|
<Spin tip={tipText} spinning={spinning}>
|
|
931
1384
|
{/*<Row style={{marginBottom: '16px', marginLeft: '-40px'}}>
|
|
932
1385
|
<Col offset={1}>
|
|
@@ -940,7 +1393,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
940
1393
|
<Row>
|
|
941
1394
|
<Col>
|
|
942
1395
|
<FormBuilder
|
|
943
|
-
isFullMode={this.props.isFullMode}
|
|
944
1396
|
schema={schema}
|
|
945
1397
|
onSubmit={this.saveFormData}
|
|
946
1398
|
onChange={this.onFormDataChange}
|
|
@@ -983,11 +1435,6 @@ Edit.propTypes = {
|
|
|
983
1435
|
templateData: PropTypes.object,
|
|
984
1436
|
supportedTags: PropTypes.array,
|
|
985
1437
|
getDefaultTags: PropTypes.string,
|
|
986
|
-
isLoadingMetaEntities: PropTypes.bool,
|
|
987
|
-
// creativesContainerActions: PropTypes.object,
|
|
988
|
-
isFullMode: PropTypes.bool,
|
|
989
|
-
getFormSubscriptionData: PropTypes.func,
|
|
990
|
-
setIsLoadingContent: PropTypes.func,
|
|
991
1438
|
// route: PropTypes.object,
|
|
992
1439
|
injectedTags: PropTypes.object,
|
|
993
1440
|
};
|
|
@@ -998,14 +1445,12 @@ const mapStateToProps = createStructuredSelector({
|
|
|
998
1445
|
templateDetails: makeSelectTemplateDetailsResponse(),
|
|
999
1446
|
metaEntities: makeSelectMetaEntities(),
|
|
1000
1447
|
injectedTags: setInjectedTags(),
|
|
1001
|
-
isLoadingMetaEntities: isLoadingMetaEntities(),
|
|
1002
1448
|
});
|
|
1003
1449
|
|
|
1004
1450
|
function mapDispatchToProps(dispatch) {
|
|
1005
1451
|
return {
|
|
1006
1452
|
actions: bindActionCreators(actions, dispatch),
|
|
1007
1453
|
globalActions: bindActionCreators(globalActions, dispatch),
|
|
1008
|
-
creativesContainerActions: bindActionCreators(creativesContainerActions, dispatch),
|
|
1009
1454
|
};
|
|
1010
1455
|
}
|
|
1011
1456
|
|